Activity - cusma - Algorand

Fetching global state via PythonSDK

Hi @boomerang, I just paste here a snippet I wrote some time ago. Try it and see if it works as example for your code.

app_id = 0 #FIXME

app = indexer_client.applications(app_id)

app_global_state = app['application']['params']['global-state']

print(json.dumps(app_global_state, indent=4))

How to deal with integer overflows in PyTeal

The normal multiplication opcode * of the previous version has now been substituted with the wide multiplication mulw opcode, documented here. Among other things, with this opcode you can check if the results of the multiplication is greater than an uint64, an act accordingly. You can review the …


Question about the future of Inner Transactions and their effect on the network

The developing strategy for the AVM is: starting with very strict limitations and then removing or “relaxing” those limits step-by-step while being careful to preserve the equilibrium that ensures Pure PoS throughput and scalability. This is why the AVM has grown incrementally from purely stateless …


Question about fast catchup vs normal catchup

Technology like Algorand State Proofs are going to enable a kind of “compression” of blockchain’s verification, so that even with years of ledger’s growth there will be a way to keep the catchup process efficient and decentralized without trading it for network’s health. This being said the point …


Multisig Accounts and Inner Transactions

Quote from here: “Accounts are entities on the Algorand blockchain associated with specific on-chain local state. An Algorand Address is the unique identifier for an Algorand Account.”. I really recommend to have a look at this section of the documentation: Overview - Algorand Developer Portal On…


Is rekeying non-custodial?

The rekey must be executed by who is currently in charge of Account’s authorization. So, if User A is in charge of Account A’s authorization then only User A can execute the rekey; external accounts (e.g. a system admin) cannot rekey Account A on User A’s behalf. If you want an account recovery …


Logic eval error: invalid ApplicationArgs index 2 but I don’t have 3 args

The tealdebugger is just a tool you can use to verify a given dry-runned transaction against Smart Contracts’ logic, step by step. It doesn’t matter if the tool has been written in Go, this is just due to the fact that the Algorand’s node is written in Go. You can actually use Python SDK to create …


Connecting a stateful and stateless smart contract

Hi @javier0rosas You can store the Smart Signature (Stateless ASC1) address as a global variable in the Smart Contract. Take a look at this article to read more about the topic. Remember that with the AVM 1.0 linking Stateless and Stateful components is no more needed! In fact, with the AVM 1.0 …


Getting application arguments as ints in TEAL

Hi @xonack, You should convert your argument using the btoi opcode. It does exactly what you want: converts bytes passed as big endian through app call arguments to uint64.


Dynamically representing the “weight” of a given ASA

AlgoRealm is a solution in which I showed how you can combine ASA with Stateful and Stateless ASC1 to extend ASA properties to embed royalties into a NFT. This specific example makes use of a Stateful ASC1 to track dynamic properties of two NFTs (latest amount of donation and the nickname of the donor).


Can I have blocks more than 1000 when using non-archival mode?

No, you cannot configure that number but if you want to be able to read the blockchain while not running an Archival Node yourself you can use third-party Indexer APIs as a service such as PureStake or Algoexplorer.


Asset_holding_get doesn’t recognize asset Id

Hi @Hardik, You must use the Foreign Asset Array to work with ASA in Stateful ASC1. This means that you should not directly pass the Asset ID to asset_holding_get opcode, but you should instead specify the index of the argument passed through the Foreign Asset Array in the Application Call.


Can stateless smart contract become manager and modify asset?

Yes, once you assign the Asset Manager address to a Stateless ASC1 then this Contract Account would be able to approve or reject Asset Config transactions according to its TEAL logic, acting as ASA configurator.


Contract account can opt-in asset?

Hi @rafmc98, Yes, Contract Accounts can Opt-In ASAs if in their TEAL logic Opt-In transactions are properly handled. This means that when you build the Stateless ASC1 you have to include Opt-In transaction checks among its approval conditions. Here you have some best practices to code an Opt-In application.


Sandbox indexer setup

I had the same problem and I solved it doing: ./sandbox up release


Error using “goal listpartkeys”

I simply retried after key registration and it worked. So, as you suggested, the bug is related only to unregistered keys I guess. Maybe it could be more informative to explicitly say that the command works only if there exists at least one registered key.