All - Activity - JasonW - Algorand

TOKEN with an address generated from a Smart Contract creation

Tokens on Algorand do not require smart contracts. You can read how to create, transfer, etc here: Algorand Standard Assets (ASAs) - Algorand Developer Portal That said if you want to use logic(smart contract) with a token you can do that. Take a look at this ARC: ARCs/arc-0020.md at main · algoran…

Boxes in Inner Transactions

I understand the use case. Right now you can set 8 box names per outer tx that can be used by the inner tx as well. That said if you are creating the asset in the first call and want to use that with the inner as the box name that is currently not possible as you won’t know beforehand what the id is…

Reserve: Smart contract Opt in

Only if local state is used, which is the only reason to opt an account into a smart contract

Boxes in Inner Transactions

Boxes use the outer tx group for the references. IE you can change whats already available inside an inner tx.

Deploy a stateful contract through a stateful contract

Why not do something like what is shown in this example: beaker/examples/c2c at master · algorand-devrel/beaker · GitHub

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

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…

Can you create a dapp with smart contracts written in multiple forms of code?

Currently dapps(smart contracts) on Algorand are only written with TEAL and many tools convert to teal including PyTeal and Reach, but that has little to do with cross chain dapps. This is one of the reasons Algorand is working on State Proofs, so tokens and other things can cross chains in a decent…

Optin to a token through a wallet within the App

Take a look at receiving an asset here:

Hi! i'm trying to do an asset transfer using escrow but it's showing me this error

You logic in the escrow is rejecting the transaction.

State Proofs Current Status?

We should be posting some state proof initial docs later this week. I believe some of the basic tech is already been merged to master.

Statefull vs Stateless smart contracts

There are no plans to add this functionality currently.

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:

indexer.searchForTransactions().limit(10).do() is returning older transactions

Currently, that is not in the indexer API, but you could go round by round until you got the 1k or write your own query against the indexer DB.

indexer.searchForTransactions().limit(10).do() is returning older transactions

This is the way the indexer is currently designed. Filtering txes by account by default reverses this order. Can you not use after-time field filter or the round?

Subroutine for security checks (RekeyTo, AssetCloseTo etc)?

You should be able to do this.

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.

Retrieve the amount of a swap transaction

Using the Algorand SDKs, if you have the signed or unsigned transactions, you can just loop through them and get the txids. for unsigned something like:

txids = [tx.get_txid() for tx in grouped_txns]

For signed:

txids = [tx.txn.get_txid() for tx in signed_txns]

Private network - node accessible from another VM within network or remotely?

If you just want to setup a testing node, just use sandbox, which can connect to testnet or mainnet. ie ./sandbox up mainnet.

get the nodes IP and connect to that IP using port 4001 with algod.

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…

How about automatic payments on a schedule?

Smart Signatures are written in TEAL or Python (using Pyteal) just like smart contracts but they are evaluated when they are submitted. Smart contracts “live” on the blockchain. Rounds happen approx every 4.5 seconds. Smart contracts can get the time of the last round but smart signatures don’t yet …

How about automatic payments on a schedule?

You could have the utility get them to sign a smart signature which then allows the utility to submit a transaction on their behalf. The logic in the smart signature would check the amount, fee, and use a lease and a few other things. That is what smart signatures are used for, ie delegation.

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);

Handling multiple Algorand accounts that deals with internal transfer

Without knowing more details its a bit hard to comment. Your solution seems very plausible though.

Is it possible to tell if an account already opt-in to an ASA?

Opcodes - Algorand Developer Portal returns two values, The first is 1/0 depending on if the user opted into the asset and the second value is the balance of that asset.

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.

Checking the Txn.type_enum() during Optin

You need to use the onCompletion field, to get the application subtype. Txn.on_completion() == OnComplete.OptIn

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.

Does the JS SDK support BigInt or not?

Can you try something like the following (note the let totalIssuance = BigInt(‘18446744073709551615’)

let params = await client.getTransactionParams().do();
params.fee = 1000;
params.flatFee = true;
let note = undefined;
// Asset creation specific parameters
// The following parameters are asset sp…

AWS KMS with Algorand

Algorand uses ed25519 keys. I think KMS supports those but I am not 100% sure.

Question about Stateful Smart Contracts

Currently, assets or algos can only leave a smart contract with an inner tx.

How to find error line number in PyTEAL/TEAL? (developer experience)

Tealdbg is pretty simple to use but you can also do a dryrun using goal like

./goal clerk dryrun -t signed.tx

Where signed.tx is the outputted signed transaction or group of transactions.

Python getting suggested_fee in v2

params in the following code contains a min_fee property that you can examine.

# build transaction
from algosdk.future.transaction import PaymentTxn

params = algod_client.suggested_params()
receiver = "HZ57J3K46JIJXILONBBZOHX6BKPXEM2VVXNRFSUED6DKFD5ZD24PMJ3MVA"
note = "Hello World".enc…

Installation problems on Ubuntu 20.04

Are you having issues just running as a service? Does the node run?

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.

Algodjango - blockchain web widgets

Thanks for sharing the project!

Use Standalone key for signing TXs

You can use algokey, but you can also import the key into any kmd wallet. It wont be recoverable with the wallet backup phrase but you can always recover the key with the accounts mnemonic.

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.

TEAL Turing complete or non-turing complete

The PyTeal docs are being updated. We just added looping and subroutines to the AVM: Introducing Algorand Virtual Machine: AVM 0.9 Release | Algorand Developer Portal Do keep in mind though the AVM runtime restricts run time of contracts based on opcode costs.

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 f…

Crowdfunding smartcontract error

Are you doing this on TestNet, a private network, or Sandbox? Once you create a wallet, create a new account in that wallet using goal account new and use the -w flag to specify the new wallet. Once you have done that change the creator address you used to the new account. Keep in mind that once yo…

ASA compiling error in node

Did you change that code sample at all?

Node returns Invalid API Token error

What is your $ALGORAND_DATA pointing to? This seems like a env issue.

Stateless contract checking

If you have the stateless contract compiled you have its address. You can code that into your stateful contract to check if that is the sender of a transaction. For example

txn Sender
addr F4HJHVIPILZN3BISEVKXL4NSASZB4LRB25H4WCSEENSPCJ5DYW6CKUVZOA
==

NFT forging in Algorand

Creating an NFT on Algorand is a simple transaction with a fee of 1000 microAlgos. You have to maintain a balance of .1 Algos for every ASA type you create but you do not lose those tokens.

ASA limit reasons

When AVM 1.0 comes out this limit is likely have a much much higher limit. Currently, you can always create additional accounts.

The Confusion of Smart Contracts

Only stateful smart contracts can write state. The sdks do support calling stateful contracts and you can also add up to 1kb note to any transaction using the sdks.

Fee in Local Networks

Are you using the suggested fee in your transaction or are you setting a fee based on bytes? Post an example code of one of your transactions.

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

Invalid : approval program too long. max len 1024 bytes

That is the compiled byte size of the program. You can get around this by splitting contracts and linking them with an additional transaction in some cases. Hopefully, this change will be available over the summer.

Invalid : approval program too long. max len 1024 bytes

That is a current limitation in Algorand. These limits are added to keep performance high. That said, this particular one is being addressed with a new feature that is being worked on now: https://github.com/algorand/go-algorand/pull/2157

Algorand Development From Source

Can you give some more detail on the error you are getting when running Make?

Teal debugging - Invocation error

Glad you got it working!

Order-book & Decentralized Exchange

Correct but it would take much to make that happen too. Currently that would be a layer2 app.

Order-book & Decentralized Exchange

So in that example I used a delegated signature instead of an escrow. If i would have used an escrow I could have opted the escrow into the stateful contract and stored the order number there. That would mean for every open order I would have an escrow which is opted into the stateful contract with …

Teal debugging - Invocation error

Thanks for posting back. I wonder if you would have tried just doing a dryrun what error you would have gotten.

Order-book & Decentralized Exchange

I think you may be able to build this up using the indexer. Take a look at this simplified DEX example: Example Digital Exchange Smart Contract Application | Algorand Developer Portal

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
==
&&

Login process to an application using wallet mnemonic

I believe originmint is primarily showcasing creating NFTs as a demo site. For a production Dapp, I would suggest providing a login mechanism through a wallet provide like the ones shown here: Community Projects - Algorand Developer Portal Or even the mobile wallet with QR Codes: Payment Prompts w…