1

I'm following this Elrond NFTs smart contracts (from scratch part 2) tutorial: https://www.youtube.com/watch?v=jpJQ-YB4NnQ I successfully compile the smart contract but when I use . interaction/devnet.snippets.sh I do not get the smart contract address, as can be seen in this log.

Because of this, I cannot run the issueToken function.

can anyone help?

INFO:accounts:Account.sync_nonce()
INFO:accounts:Account.sync_nonce() done: 10733
INFO:cli.contracts:Contract address: erd1qqqqqqqqqqqqqpgq093ggau3mcjq4p5ln7skvtrk4wjhyfpwd8ssjj45qw
INFO:utils:View this contract address in the Elrond Devnet Explorer: https://devnet-explorer.elrond.com/accounts/erd1qqqqqqqqqqqqqpgq093ggau3mcjq4p5ln7skvtrk4wjhyfpwd8ssjj45qw
INFO:transactions:Transaction.send: nonce=10733
INFO:transactions:Hash: 4f25756f9246985732038eccc0cbc4fda480b8409fcc70dff089c1d59684e652
INFO:utils:View this transaction in the Elrond Devnet Explorer: https://devnet-explorer.elrond.com/transactions/4f25756f9246985732038eccc0cbc4fda480b8409fcc70dff089c1d59684e652
WARNING:cli.data:Always review --expression parameters before executing this command!
WARNING:cli.data:Always review --expression parameters before executing this command!
WARNING:cli.data:Never use this command to store sensitive information! Data is unencrypted.
INFO:cli.data:Data has been stored at key = 'address-devnet', in partition = '*'.
WARNING:cli.data:Never use this command to store sensitive information! Data is unencrypted.
INFO:cli.data:Data has been stored at key = 'deployTransaction-devnet', in partition = '*'.

Smart contract address:  

1 Answers1

1

The outfile log structure changed in the meantime and you're most likely still looking for data in the old structure. Now, the address in the new log structure is stored under the ['contractAddress'] key instead of ['emitted_tx']['address'], respectively transaction hash into ['emittedTransactionHash'] instead of ['emitted_tx']['address'].

Therefore, you have to change these lines:

TRANSACTION=$(erdpy data parse --file="${MY_LOGS}/deploy-devnet.interaction.json" --expression="data['emitted_tx']['hash']")
ADDRESS=$(erdpy data parse --file="${MY_LOGS}/deploy-devnet.interaction.json" --expression="data['emitted_tx']['address']")

to these:

TRANSACTION=$(erdpy data parse --file="${MY_LOGS}/deploy-devnet.interaction.json" --expression="data['emittedTransactionHash']")
ADDRESS=$(erdpy data parse --file="${MY_LOGS}/deploy-devnet.interaction.json" --expression="data['contractAddress']")
Brother Jder
  • 415
  • 2
  • 9
  • but now I'm getting "invalid token index" when trying to issueToken – Vitor Ribeiro Oct 11 '22 at 10:15
  • That sounds like a new separate problem. Perhaps it's better to post the code of the .sh script you're using, otherwise we're kinda blind and don't know what are you trying to do. – Brother Jder Oct 12 '22 at 11:27