【问题标题】:Solidity Syntax error with changing mint rate uint更改 mint rate uint 导致的 Solidity 语法错误
【发布时间】:2022-02-18 16:13:24
【问题描述】:

我是 Solidity 的新手,我想知道为什么这不起作用。

//Mint Price
uint256 public mintRate = 0.025 ether;

function changeMintRate(uint256 _mintRate) public onlyOwner{
        uint256 public mintRate = _mintRate ether;
    }

【问题讨论】:

    标签: blockchain ethereum solidity smartcontracts


    【解决方案1】:

    这行写错了

    uint256 public mintRate = _mintRate ether;
    

    请做:

    mintRate = _mintRate ether;
    

    【讨论】:

    • 谢谢,我正在重新定义变量。
    猜你喜欢
    • 1970-01-01
    • 2017-01-05
    • 2018-08-05
    • 2014-08-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-04-01
    • 1970-01-01
    相关资源
    最近更新 更多