Contract management in everdev gives you the ability to easily deploy and run your smart contracts on blockchain network(s).
View contract info
This command displays a detailed summary for a contract. Contract ABI and TVC files are required to run it. Account address on the network is calculated from TVC and signer.
Note that the entire set of params is enclosed in DOUBLE quotes, and each parameter containing special characters is enclosed in SINGLE quotes. In the next paragraph, you can find an example of calling a function when its argument is a struct.
Run contract deployed on the network
This command runs any function of a contract deployed on the blockchain. Contract ABI and TVC files are required to run it.
everdevcontractrunabi_filename
Command displays available functions and asks to select one. Result example:
Network, signer and account address parameters can be overridden and function parameters specified in the command with the following options:
$everdevcontractrun-hEverDevVersion:0.5.0Use:everdevcontractrunfilefunction [options]Args:fileABIfilefunctionFunction nameOptions:--help,-hShowcommandusage--network,-nNetworkname--signer,-sSignerkeyname--data,-dDeployinginitialdataasname:value,...Thisdataisrequiredtocalculatetheaccountaddressandtodeploycontract.Arrayvaluesmustbespecifiedas [item,...]. Spaces are notallowed.Ifvaluecontainsspacesorspecialsymbols"[],:"itmustbeenclosedin""or''--address,-aAccountaddress--input,-iFunctionparametersasname:value,...Arrayvaluesmustbespecifiedas [item,...]. Spaces are notallowed.Ifvaluecontainsspacesorspecialsymbols"[],:"itmustbeenclosedin""or''--prevent-ui,-pPreventuserinteractionUsefulinshellscriptinge.g.onserverorinsomeautomatingtodisablewaitingfortheuserinput.Insteadeverdevwillabortwitherror.Forexamplewhensomeparametersaremissingincommandlinethentondevwillpromptusertoinputvaluesformissingparameters (or failsifprevent-uioptionisspecified).
Example of creating a transaction and confirming it in a multisig wallet:
everdev contract run SetcodeMultisigWallet.abi.json submitTransaction -n dev -s sign1 -i dest:255a3ad9dfa8aa4f3481856aafc7d79f47d50205190bd56147138740e9b177f3,value:500000000,bounce:true,allBalance:false,payload:""
everdev contract run SetcodeMultisigWallet.abi.json confirmTransaction -n dev -a 0:04dee1edc3f3d6b23529dcf5a6133627d06a39826bb14cc6334ffea272b15d50 -s sign2 -i transactionId:6954030467099431873
To execute a contract without signing, use signer none option:
everdev contract run --signer none --address <address>
or
everdev contract run -s none -a <address>
In this case you have to explicitly specify address in run function because otherwise everdev may calculate a wrong address from empty pubkey.
To execute a smart contract function with bytes argument, the argument needs to be in hex format.
Network, signer and account address parameters can be overridden and function parameters specified in the command with the following options:
$everdevcontractrun-executor-hEverDevVersion:0.5.0Use:everdevcontractrun-executorfilefunction [options]Args:fileABIfilefunctionFunction nameOptions:--help,-hShowcommandusage--network,-nNetworkname--signer,-sSignerkeyname--data,-dDeployinginitialdataasname:value,...Thisdataisrequiredtocalculatetheaccountaddressandtodeploycontract.Arrayvaluesmustbespecifiedas [item,...]. Spaces are notallowed.Ifvaluecontainsspacesorspecialsymbols"[],:"itmustbeenclosedin""or''--address,-aAccountaddress--input,-iFunctionparametersasname:value,...Arrayvaluesmustbespecifiedas [item,...]. Spaces are notallowed.Ifvaluecontainsspacesorspecialsymbols"[],:"itmustbeenclosedin""or''--prevent-ui,-pPreventuserinteractionUsefulinshellscriptinge.g.onserverorinsomeautomatingtodisablewaitingfortheuserinput.Insteadeverdevwillabortwitherror.Forexamplewhensomeparametersaremissingincommandlinethentondevwillpromptusertoinputvaluesformissingparameters (or failsifprevent-uioptionisspecified).
Top up contract balance from giver
If you have set a giver for a network, you can top up contract balances on it with the following command.
everdev contract topup abi_filename
Defalt signer and giver parameters will be used, unless otherwise specified through the following options:
$ everdev contract topup -h
EverDev Version: 0.5.0
Use: everdev contract topup file [options]
Args:
file ABI file
Options:
--help, -h Show command usage
--address, -a Account address
--network, -n Network name
--signer, -s Signer key name
--data, -d Deploying initial data as name:value,...
This data is required to calculate the account address and to
deploy contract.
Array values must be specified as [item,...]. Spaces are not
allowed. If value contains spaces or special symbols "[],:"
it must be enclosed in "" or ''
--value, -v Deploying balance value in nano tokens
To top up any known address without providing keys or contract files, use the following command:
everdev contract topup --address <address>
or
everdev ct -a <addrress>
Decode data from a contract deployed on the network.
$ everdev contract decode-data --help
EverDev Version: 1.2.0
Use: everdev contract decode-data file [options]
Args:
file ABI file
Options:
--help, -h Show command usage
--network, -n Network name
--address, -a Account address