aboutsummaryrefslogtreecommitdiffstats
path: root/docs/contracts.rst
diff options
context:
space:
mode:
authorDmitry K <winsvega@mail.ru>2016-08-02 16:11:09 +0800
committerDmitry K <winsvega@mail.ru>2016-08-02 16:11:09 +0800
commita10b6f92f97bf2eacc80534f6640e08f0b26e95d (patch)
treeffb7d72d52ae7a8d30194186bc15886c10118c5a /docs/contracts.rst
parentd1c744450965644df17fcc73006dd7495e75c477 (diff)
parent85a61fe886c2d99d397bf30cc01d971558130287 (diff)
downloaddexon-solidity-a10b6f92f97bf2eacc80534f6640e08f0b26e95d.tar.gz
dexon-solidity-a10b6f92f97bf2eacc80534f6640e08f0b26e95d.tar.zst
dexon-solidity-a10b6f92f97bf2eacc80534f6640e08f0b26e95d.zip
Merge branch 'develop' of https://github.com/ethereum/solidity into develop
Diffstat (limited to 'docs/contracts.rst')
-rw-r--r--docs/contracts.rst8
1 files changed, 6 insertions, 2 deletions
diff --git a/docs/contracts.rst b/docs/contracts.rst
index c02c1490..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,
@@ -85,7 +89,7 @@ This means that cyclic creation dependencies are impossible.
// Only the creator can alter the name --
// the comparison is possible since contracts
// are implicitly convertible to addresses.
- if (msg.sender == creator)
+ if (msg.sender == address(creator))
name = newName;
}