Solidity payable 方法表现
1 pragma solidity ^0.4.4; 2 3 contract Person { 4 5 string public name; 6 uint age; 7 uint private weight; 8 string internal birthday; 9 10 function Person() { 11 name = ""; 12 age = 0; 13 weight = 0; 14 birthday = "0000-00-00"; 15 } 16 17 function f0() payable public returns(uint){ 18 return address(this).balance; // 只要一调用f0,balance就改了,不需要等f0执行结束 19 } 20 21 function f1() public returns(uint) { 22 return address(this).balance; // 调用完f0,再调f1查询合约账户余额,与f0查到的相同 23 }
1.001^365=1.44......life is a project
原创文章,转载请注明出处!

浙公网安备 33010602011771号