Skip to main content

Contract setup

Setup token contract code on your Inery Account. The process of setting up the token contract will take place on Inery Node

Get token contract

We will take the token contract from the already existing one, by copying the inery.token contract code and writing it in the wasm and abi files that we will use later to set up the token contract on our own account

Fetch code by executing command :

 cline get code inery.token -c token.wasm -a token.abi --wasm

output :

code hash: ac6fb455ea0a66a42fa9bc9aef61cfaf18109346795142194fe3b167dea3a97c saving wasm to token.wasm saving abi to token.abi

wasm and abi for token contract are saved in token.wasm and token.abi files

Set token contract

Setting token contract from token.wasm and token.abi files generated in previous step to token22 account token22 is random account generated for demonstration purposes

Manage wallet

Unlock wallet and import private key of an account you want to use as token contract

In terminal execute commands :

  • Unlock wallet
 cline wallet unlock --password WALLET_PASSWORD
  • Import private key
 cline wallet import --private-key ACCOUNT_PRIVATE_KEY

Set code and abi

Push set code transaction to set token contract to your account

  • Set code
 cline set code token22 token.wasm

output :

Reading WASM from /root/token.wasm... Setting Code... executed transaction: 31b009ed4010adc959e1d5177be0213a4a39e87668fe01f3e8ed076c5827a12d 7536 bytes 2281 us # inery <= inery::setcode {"account":"token22","vmtype":0,"vmversion":0,"code":"0061736d0100000001a0011b60000060017e0060027f7f...

  • Set abi
 cline set code token22 token.abi

output :

Setting ABI... executed transaction: 11e840da507ac57c76bdcef13114cb7922037d7d53e53cf8685def8d9e7c4d0d 1280 bytes 390 us # inery <= inery::setabi {"account":"token22","abi":"0e696e6572793a3a6162692f312e310008076163636f756e7400010762616c616e636505...

Successfully created token account!