我正在研究关于可靠性的智能合约,但遇到了问题。每次我尝试创建这个合同时,我的论点都没有得到证实。
我希望在选择名称时会出现“OreOreCoin”,但我得到的是一个空字符串。
和
这是我的代码:
pragma solidity ^0.4.8;
contract OreOreCoin{
string public name;
string public symbol;
uint8 public decimals;
uint256 public totalSupply;
mapping (address => uint256) public balanceOf;
event Transfer(address indexed from, address indexed to, uint256 value);
function OreOreCoin(uint256 _supply, string _name, string _symbol, uint8
_demicals){
balanceOf[msg.sender] = _supply;
name = _name;
symbol = _symbol;
decimals = _demicals;
totalSupply = _supply;
}
function transfer(address _to, uint256 _value){
if(balanceOf[msg.sender] < _value) throw;
if(balanceOf[_to] + _value < balanceOf[_to]) throw;
balanceOf[msg.sender] -= _value;
balanceOf[_to] += _value;
Transfer(msg.sender,_to,_value);
}
}
可能是什么问题呢?