simolus3 / web3dart

Ethereum library, written in Dart.
MIT License
442 stars 274 forks source link

How to init the contract object like web3js #11

Open edgeowner opened 5 years ago

edgeowner commented 5 years ago

eg.

simolus3 commented 5 years ago

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.