From 08f8a3dd2692fad1658ec081c9396286a02cf2d8 Mon Sep 17 00:00:00 2001 From: sc0Vu Date: Tue, 2 Jan 2018 16:49:46 +0800 Subject: [PATCH] Readme.md --- README.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/README.md b/README.md index b0bc302..b07dd4a 100644 --- a/README.md +++ b/README.md @@ -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).