Readme.md

This commit is contained in:
sc0Vu 2018-01-02 16:49:46 +08:00
parent a8be114c88
commit 08f8a3dd26

View File

@ -131,6 +131,23 @@ $net->provider->execute(function ($err, $data) {
});
```
### Contract
```
use Web3\Contract;
$contract = new Contract('http://localhost:8545', $abi);
// deploy contract
$contract->bytecode($bytecode)->new($params, $callback);
// call contract function
$contract->at($contractAddress)->call($functionName, $params, $callback);
// change function state
$contract->at($contractAddress)->send($functionName, $params, $callback);
```
# Examples
To run examples, you need to run ethereum blockchain local (testrpc).