摘要:父合约 contract fruit{ string public name = 'eat'; } 继承 import "/4_.sol"; contract Apple is fruit { function getType() external view returns(string memor
阅读全文
摘要:A合约调用B合约 合约B contract B { uint public x; uint public value; function setX(uint _x) public returns (uint){ x = _x; return x; } function setXandSendEthe
阅读全文
摘要:delegateCall 用于重定向父合约; A 合约越来调用B1, 将地址改为 B2 就可以调用 B2 合约B1 contract B { uint public num; uint public value; function setVars(uint _num) public payable{
阅读全文
摘要:数组 例子 contract ArrayTest { uint256[] public array01; uint256[] public array02=[1,2,3]; function push(uint256 i) public{ array01.push(i); } function po
阅读全文
摘要:修饰器,通过定义一个方法,使用该方法去修饰其他方法。 用个没有用修饰器的例子说明,onlyOwner 是一个校验地址是不是原来账号的地址的方法。 将该合约部署 contract Test { address public owner; uint256 public price; constructo
阅读全文