Deploy and interact with WASM smart contracts on the Bittensor chain via pallet-contracts.
Upload WASM contract code to the chain.
agcli contracts upload --code /path/to/contract.wasm [--storage-deposit-limit 1000000]Returns the tx hash. The code hash can be found in chain events.
Create a contract instance from an already-uploaded code hash.
agcli contracts instantiate --code-hash 0x... \
[--value 0] [--data 0x...] [--salt 0x...] \
[--gas-ref-time 10000000000] [--gas-proof-size 1048576] \
[--storage-deposit-limit 1000000]--code-hash: Hash from a previousupload--data: Constructor selector + args (hex-encoded)--salt: Unique salt for address derivation--value: TAO (in RAO) to transfer to the new contract
Call an existing contract.
agcli contracts call --contract 5Contract... --data 0xSelectorArgs... \
[--value 0] [--gas-ref-time 10000000000] [--gas-proof-size 1048576]--contract: SS58 address of the deployed contract--data: Method selector + encoded arguments (hex)
Remove previously uploaded contract code.
agcli contracts remove-code --code-hash 0x...Contracts::upload_code— Upload WASM bytecodeContracts::instantiate— Create contract instanceContracts::call— Invoke contract methodContracts::remove_code— Remove uploaded code
agcli evm call— EVM (Solidity) contract interaction