test001
pragma solidity ^0.4.0;
contract Calc{
/*区块链存储*/
uint count;
/*执行会写入数据,所以需要`transaction`的方式执行。*/
function add(uint a, uint b) returns(uint){
count++;
return a + b;
}
/*执行不会写入数据,所以允许`call`的方式执行。*/
function getCount() constant returns (uint){
return count;
}
}
Disclaimer: The above articles are added by users themselves and are only for typing and communication purposes. They do not represent the views of this website, and this website does not assume any legal responsibility. This statement is hereby made! If there is any infringement of your rights, please contact us promptly to delete it.