Status Embark plugin to make interaction with smart contracts a little easier. So instead of this
await MyERC20.methods.mint("0x6DC4Ae6F756287DA58EE29a0fba6676718EfC496", 100).send({ "from": "0x6DC4Ae6F756287DA58EE29a0fba6676718EfC496" })
you can do this:
send mint { accounts[0], 100 }
- Call the
initfunction (call initorsend init) to declare which contract you wish to interact with. Must be the contract's name.
call init MyERC20
You can only interact with one contract at a time. Subsequent init calls will override the address you are interacting with.
- Use
callfor constant functions,sendfor non-constant functions. Example:
call allowance { accounts[0], 0x2245EE61ee5Dbe58CEee388431A34E5e700A6a95 }
call owner
call balanceOf 0x2245EE61ee5Dbe58CEee388431A34E5e700A6a95 { from: "accounts[1]" }
send pause {} { from: "accounts[0]", gas: 100000 }
send mint { accounts[0], 100 } { from: "accounts[0]" }
- Function parameters must be wrapped in curly braces and separated by comma if there is more than one, e.g.
call allowance { 0x2245EE61ee5Dbe58CEee388431A34E5e700A6a95, 0x2245EE61ee5Dbe58CEee388431A34E5e700A6a95 }
-
callandsendoptions must always be wrapped in curly braces and follow (relaxed) JSON syntax. -
To call a function with options but no parameters, include empty braces in the call for the parameters:
send pause {} { from: "accounts[0]", gas: 100000 }
You can use web3.eth.defaultAccount and accounts like in your regular Embark code instead of having to provide literal addresses.
ECCÌ uses JSON5, so JSON keys may be unquoted. Values must be either single- or double-quoted.