aboutsummaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
authorchriseth <c@ethdev.com>2016-08-01 22:10:26 +0800
committerGitHub <noreply@github.com>2016-08-01 22:10:26 +0800
commit08c6a4e7ba330b02f394224cf1593f96db6be554 (patch)
tree5e6c81b29fd77f83a5fac38e2f095ddd4dff50a9 /docs
parent21a7dda733b68a4417c4822b22bd4810a9c3e5d1 (diff)
parentd5e536a4fb2a87efe8de3df9bda487ca2459e24c (diff)
downloaddexon-solidity-08c6a4e7ba330b02f394224cf1593f96db6be554.tar.gz
dexon-solidity-08c6a4e7ba330b02f394224cf1593f96db6be554.tar.zst
dexon-solidity-08c6a4e7ba330b02f394224cf1593f96db6be554.zip
Merge pull request #776 from chriseth/deploydocs
Deploydocs
Diffstat (limited to 'docs')
-rw-r--r--docs/contracts.rst6
1 files changed, 5 insertions, 1 deletions
diff --git a/docs/contracts.rst b/docs/contracts.rst
index 81c5d353..3d592ecf 100644
--- a/docs/contracts.rst
+++ b/docs/contracts.rst
@@ -23,6 +23,9 @@ name as the contract) is executed once.
From ``web3.js``, i.e. the JavaScript
API, this is done as follows::
+ // Need to specify some source including contract name for the data param below
+ var source = "contract CONTRACT_NAME { function CONTRACT_NAME(unit a, uint b) {} }";
+
// The json abi array generated by the compiler
var abiArray = [
{
@@ -41,7 +44,8 @@ API, this is done as follows::
}
];
- var MyContract = web3.eth.contract(abiArray);
+ var MyContract_ = web3.eth.contract(source);
+ MyContract = web3.eth.contract(MyContract_.CONTRACT_NAME.info.abiDefinition);
// deploy new contract
var contractInstance = MyContract.new(
10,