Smart Contracts

Prepare solidity compiler

Usage: ioctl contract prepare

➜  ioctl contract prepare

...
Solidity compiler is ready now.

This process installs solc to you env. You can also install it by using the following commands.

On Ubuntu, you can use the following command

sudo add-apt-repository ppa:ethereum/ethereum
sudo apt-get update
sudo apt-get install solc

On macOS, you can use the following command

brew update
brew upgrade
brew tap ethereum/ethereum
brew install solidity@5

For more detailed instruction of installing solc, please refer to https://solidity.readthedocs.io/en/v0.5.0/installing-solidity.html.

Please note that ioctl currently supports solc 4.x and 5.x. Please make sure you install the current version.

Compile smart contract

Usage: ioctl contract compile CONTRACT_NAME [CODE_FILES...] [--abi-out ABI_PATH] [--bin-out BIN_PATH]

Deploy smart contract from sol file

Usage: ioctl contract deploy sol CONTRACT_NAME [CODE_FILES...] [--with-arguments INIT_INPUT]

Deploy smart contract from bytecode

Usage: ioctl contract deploy bytecode BYTECODE [ABI_PATH INIT_INPUT]

Deploy smart contract from bin file

Usage: ioctl contract deploy bin BIN_PATH [ABI_PATH INIT_INPUT]

Invoke smart contract by function

Usage: ioctl contract invoke function (CONTRACT_ADDRESS|ALIAS) ABI_PATH FUNCTION_NAME [AMOUNT_IOTX] [--with-arguments INVOKE_INPUT]

Invoke smart contract by bytecode

Usage: ioctl contract invoke bytecode (CONTRACT_ADDRESS|ALIAS) PACKED_ARGUMENTS [AMOUNT_IOTX]

Test smart contract by bytecode

Usage: ioctl contract test bytecode (CONTRACT_ADDRESS|ALIAS) PACKED_ARGUMENTS [AMOUNT_IOTX]

Test smart contract by function

Usage: ioctl contract test function (CONTRACT_ADDRESS|ALIAS) ABI_PATH FUNCTION_NAME [AMOUNT_IOTX] [--with-arguments INVOKE_INPUT]

Share local files with IoTeX IDE

Usage: ioctl contract share LOCAL_FOLDER_PATH [--iotex-ide YOUR_IOTEX_IDE_URL_INSTANCE]

LOCAL_FOLDER_PATH can be absolute or relatively. --iotex-ide flag defaults to https://ide.iotex.io.