【问题标题】:Identifier not found or not unique. Compilation errror未找到标识符或标识符不唯一。编译错误
【发布时间】:2019-04-26 01:01:12
【问题描述】:

/home/ubuntu/token_sale/contracts/SandeepDappToken.sol:17:34: DeclarationError: Identifier not found or not unique. function transfer(address _to, unit256 _value) public 返回(bool 成功) ^—-^ 编译失败。见下文 代码:

pragma solidity ^0.4.23;

contract SandeepDappToken
{
    // constructor

    // set the v ariable
    uint256  public totalSupply;

    string public name = ‘Dapp’;

    mapping(address => uint256) public balanceOf;

    constructor(uint256 _initialSupply )  public {
        balanceOf[msg.sender] = _initialSupply;
        totalSupply = _initialSupply;
    }

    function  transfer(address _to, unit256  _value) public returns (bool success)
    {
        require(balanceOf[msg.sender] >= _value);
    }
}

【问题讨论】:

    标签: ethereum solidity


    【解决方案1】:

    更改您的代码:

    unit256 到 uint256

    function  transfer(address _to, uint256  _value) public returns (bool success)
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-07-31
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-10-23
      • 2016-03-30
      相关资源
      最近更新 更多