Contract management
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.
everdev contract info abi_filenameResult example:
$ everdev contract info SetcodeMultisigWallet.abi.json
Configuration
Network: dev (eri01.net.everos.dev, rbx01.net.everos.dev, gra01.net.everos.dev)
Signer: test (public ad4bf7bd8da244932c52127a943bfa9217b6e215c1b3307272283c4d64f34486)
Address: 0:04dee1edc3f3d6b23529dcf5a6133627d06a39826bb14cc6334ffea272b15d50 (calculated from TVC and signer public)
Code Hash: e2b60b6b602c10ced7ea8ede4bdf96342c97570a3798066f3fb50a4b2b27a208 (from TVC file)
Account: Active
Balance: 1919381000 (≈ 2 tokens)
Details: {
"json_version": 5,
"id": "0:04dee1edc3f3d6b23529dcf5a6133627d06a39826bb14cc6334ffea272b15d50",
"workchain_id": 0,
"boc": "te6ccgECZwEAGvQAAm/AAE3uHtw/PW ... 4MEDIoIQ/////byxkOAB8AH4R26Q3o (6912 bytes)",
"last_paid": 1619084675,
"bits": "0xcbc7",
"cells": "0x67",
"public_cells": "0x0",
"last_trans_lt": "0x3baac81fb43",
"balance": "0x72676e08",
"code": "te6ccgECXwEAGcoAAib/APSkICLAAZ ... wQMighD////9vLGQ4AHwAfhHbpDeg= (6614 bytes)",
"code_hash": "e2b60b6b602c10ced7ea8ede4bdf96342c97570a3798066f3fb50a4b2b27a208",
"data": "te6ccgEBBwEA7gAC361L972NokSTLF ... S/Xy90TNN3lUFM1WGpdlIcBQDAAAFA (249 bytes)",
"data_hash": "ec28abd34e75f40a66561bdc06b436cbe24d10d5da7519a7d5db41026c67155d",
"acc_type": 1,
"acc_type_name": "Active"
}Network, signer, data and account address parameters can be overridden with the following options:
Deploy contract
This command deploys a contract to the blockchain. Contract ABI and TVC files are required to run it.
Command displays deployment summary and requests constructor function parameters. Result example:
Deploy parameters can be specified in the deploy command with the following options:
Example of a 2/3 multisig wallet deployment command:
Enclosing special characters
If the parameters contain special characters, they must be enclosed in quotation marks. Here is an example of how this can be done:
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.
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:
Example of creating a transaction and confirming it in a multisig wallet:
To execute a contract without signing, use signer none option:
or
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.
Example:
Execute a smart contract function with structure arguments:
or with an array of structures:
Run contract locally on TVM
This command downloads a contract and runs it locally on TVM. Contract ABI and TVC files are required to run it.
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:
Emulate transaction executor locally on TVM
This command downloads a contract and emulates transaction execution locally on TVM. Contract ABI and TVC files are required to run it.
Command displays available functions and asks to select one. Result:
Network, signer and account address parameters can be overridden and function parameters specified in the command with the following options:
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.
Defalt signer and giver parameters will be used, unless otherwise specified through the following options:
To top up any known address without providing keys or contract files, use the following command:
or
Decode data from a contract deployed on the network.
For example:
Decode TVC into code, data, libraries and special options.
For example:
Last updated
Was this helpful?