Description
This command line tool greatly simplifies the compiling and deploying process of multiple seele solidity contracts.
Installation
# as command line tool npm i -g seele-contract-core # as module npm i seele-contract-core
Usage
# initiate contract scc init -n mycontract# creates the following tree # . # ├── abi # ├── byt.json # ├── conf.json # ├── deploy.json # └── src # # # 2 directories, 3 files # copy your solidity source code files to ./src # toggle configurations in conf.json # only compile scc make -c -n mycontract# only deploy scc make -d -n mycontract# compile and deploy scc make -cd -n mycontract
Or in code
const path = const scc = { const root = await process const dirname = 'yourContract' const project = '.contract' scc const dir = path const contract = scc // contract.compile() // contract.deploy() // compile and deploy { ; } ;}
API
In your conf.json
- compiler
- version: currently only v0.4.24 is made available
- shard: seele currently has four shards, the network used will be determined through the shard of
transactions.privateKey
andtransactions.fromAddress
pair. - transactions
- limit: gas limit of each transaction.
- depth: wait for how many blocks after transaction packaged.
- privateKey: private key used for signing transactions.
- fromAddress: address of signature private key.
- addressBook:
- To skip certain contract deployment. Ex: if I've already deployed
"SafeMath.sol"
at"0xce8b79448f41224413b6e13f5ae624b901070022"
Instead of deploying the contract with another transaction, the contract address will be reused in the next iteration of deployment."addressBook":, - To skip certain contract deployment. Ex: if I've already deployed
- constructors:
- If a contract happen to have a constructor to be a payable contract, the structure to use would be the following
"myContract.sol":"address[]""uint256"//abi"0x627306090abab3a6e1400e9345bc60c78a8bef57""0x4b0897b0513fdc7c541b6d9d7e929c4e5364d2db""0x416e6e6965"//value1000 //payable amount, 1000 fan