Activity - JasonW - Algorand
How can I store structs, arrays and mappings in PyTeal?
On problem 2, most structs, lists, etc can be converted to byte arrays which can be stored in local or global state. That said, writing teal or Pyteal to manipulate or read the structs inside the contract can be difficult. The Beaker project implements some key functionality that makes handling this…
TEAL: How can I supply arguments to an inner transaction?
Take a look at this: The Algorand Virtual Machine (AVM) and TEAL. - Algorand Developer Portal Just reuse this property itxn_field ApplicationArgs so something like int 5 //first parm itxn_field ApplicationArgs int 6 //second parm itxn_field ApplicationArgs
Phone directory program. Algorand blockchain as a replacement for a sql table
Does this data need to be private? You could enter contacts using the notefield on a payment tx and not use smart contracts at all. Use the indexer to look up notes. This tutorial needs to be updated but should give you the general idea.
Use the indexer to search:
Maximum input data size for a stateful contract
You are correct on the 3k and you could group three app transactions in one atomic and access the additional data.
Algorand Smart Contracts Integration
We just finished up the base ABI which is basically a way (in JSON) for a smart contract creator to describe the contract. Without this users of the contract have to read the contract code. The SDK now has support for reading these ABI JSON files and invoking the method. That said, giving out or pub…
What format are these Buffers in?
Those are the address bytes. You should be able to get the string address using something like:
const rec = algosdk.encodeAddress(confirmation.txn.txn.rcv);
or for an asset
const rec = algosdk.encodeAddress(confirmation.txn.txn.arcv);
Does the JS SDK support BigInt or not?
I totally missed the issue you were having. The JS SDK has an issue handling larger assetid/appid numbers than 2^53. This will be fixed in the future. It will be a long time before it matters (>10,000 years), so for now you are pretty safe just using number.
Algoexplorer.io API returning 403 for some calls
Algoexplorer is deprecating some calls for performance reasons. Here is the list of available calls now AlgoExplorer API v2, If you want to use this call, it’s best to set up your own node.
Checking the Txn.type_enum() during Optin
You need to use the onCompletion field, to get the application subtype.
Txn.on_completion() == OnComplete.OptIn
An account opting in for more than 10Apps
Can you give a bit more detail. Stateful smart contracts only have to be opted into if you store local state for the user. BTW the limit of 10 is going to be increased most likely in the next release.
Extra pages for Smart contracts
Look at the warning in this section: Overview - Algorand Developer Portal It’s a known issue and should be resolved in the next update.
CORS error when trying to connect to Kmd from browser app
Take a look at the allowed_origins setting in the kmd_config.json file in your kmd data directory: Node Configuration Settings - Algorand Developer Portal Note that this is for creating accounts in KMD. You do not have to use KMD if you want to do key management yourself. The SDK provides methods for that.
ASA limit reasons
When AVM 1.0 comes out, this limit is likely to have a much higher limit. Currently, you can always create additional accounts.
MainNet access through algoexplorer.io
If you want mainnet use: https://algoexplorer.io/api-dev/v2 If you want testnet use: https://testnet.algoexplorer.io/api-dev/v2
Teal debugging - Invocation error
So I believe your error is that you are only supplying one parameter to the && opcode. It requires two. Change your code to:
gtxn 0 TypeEnum
int appl // 6
== // 6
gtxn 1 TypeEnum
int axfer
==
&&
gtxn 2 TypeEnum
int pay
==
&&
Grouping Transaction Design Question
You could do it as you describe. Most of the logic required in the escrow is very similar to an htlc contract. If you did not have the requirement that the oracle be on-chain, you could probably do it all in the escrow. Take a look at the htlc contract for more details on how your escrow should look…
ASAs “ReserveAddress”
So once you create an ASA, the token(s) are placed in the creator account. The reserve account is a logical structure where some builders will use the address to put all the tokens in “reserve.” They are considered unminted until they leave this reserve account.
Setting the Debugger Context (JSON)
The dryrun file can be either json or messagepack depending on the dryrun-dump-format parameter. The json object has the following structure: go-algorand/types.go at 310e05a092284becbb5b761152c25e344860aba8 · algorand/go-algorand · GitHub Internal msgpack format: go-algorand/dryrun.go at 310e05a092…
Sharing LogicSig
If you have stored it as a byte array like :slight_smile:
// check serialization
byte[] outBytes = Encoder.encodeToMsgPack(lsig);
you should be able to load it like
LogicsigSignature lsig1 = Encoder.decodeFromMsgPack(outBytes, LogicsigSignature.class);
assertThat(lsig).isEqualTo…
Create Asset / Smart Contract using a Smart Contract
No contracts cant create other contracts or assets, but a call to a smart contract can be grouped with an asset creation transaction or smart contract creation transaction to approve the creation.
Problem with ./sandbox enter
You need to specify algod, indexer or indexerdb. Run ./sandbox and you will see the options. To enter the algod sandbox, type ./sandbox enter algod.
Question about atomic transactions
you need .1 balance for standard transactions but you also need .1 balance to opt into an asset. That is a total .2 algos.
First prize for XCarbon demo
Add "fee": 1000, "flatFee": true,
Also you can get the suggested min fee and do:
let params = await algodClient.getTransactionParams();
. . "fee": params.minFee, "flatFee": true,
Algorand Standard Assets: execute opt-in transaction in a user-friendly way
We are close to releasing an update on the mobile wallet that will give you this functionality.
Where is a tutorial for dApps for Algorand?
You can look at individual sdks on at the developer site: https://developer.algorand.org/docs/go-sdk https://developer.algorand.org/docs/javascript-sdk https://developer.algorand.org/docs/java-sdk https://developer.algorand.org/docs/python-sdk We also have some exercises here to help get you up…
Algorand go sdk SignTransaction wrong
This looks like your block range must have been off. Try using the suggested parameters for the last round and a 1000 and try again:
tx, err := transaction.MakePaymentTxn(fromAddr, toAddr, 1000, 200000, txParams.LastRound, (txParams.LastRound + 1000), nil, "", genID, genHash)
Also your fee is going…