web3dart
web3dart copied to clipboard
How to init the contract object like web3js
eg.
- web3.eth.Contract(mycontract.abi,contractAddress)
Hey, the contract API of this library still is a bit rough and not very similar to web3js. You might want to take a look at this example which uses the CryptoKittens smart contract as an example.
The idea is that you first create the ABI from the json definition using ContractABI.parseFromJSON and then construct a DeployedContact with that ABI, the target address, your credentials and the client instance.
You can then use that class to send transactions or call methods interacting with the smart contract.