//This is the code:
pragma solidity ^0.4.16;
contract FunctionTest {
bool public foo = true;
string public name;
uint256 public counter = 0;
function setName(string name) public string returns(string) {
string a = name;
return a;
}
function writeToStorage() {
foo = !foo;
}
function readFromStorageConstant() public constant returns (bool) {
return foo;
}
function readFromStorageView() public view returns (bool) {
return foo;
}
function increaseCounter(uint256 counter) public returns(uint256)
{
counter = counter + 10;
return counter;
}
}发布于 2017-12-30 03:54:18
这一行在语法上是不正确的:
function setName(string name) public string returns(string) {它应改为:
function setName(string name) public returns(string) {https://ethereum.stackexchange.com/questions/34704
复制相似问题