首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >与构造函数中使用多参数时的可靠编译错误有关

与构造函数中使用多参数时的可靠编译错误有关
EN

Stack Overflow用户
提问于 2022-08-02 10:51:20
回答 1查看 189关注 0票数 0

CompilerError:叠得太深了。尝试使用--via-ir (cli)或等效的viaIR: true (标准JSON)进行编译,同时启用优化器。否则,尝试删除局部变量。编译内联程序集时:变量dataEnd在堆栈中太深了一个槽。

代码语言:javascript
复制
constructor(address _escrow, uint256 _Presale_Start_Countdown, uint256 _Presale_End_Countdown,  uint256 _Softcap_End_Countdown, uint256 _Hardcap_End_Countdown, address _funder1, 
    address _funder2, address _funder3, address _Development, address _Marketing, address _Community, address _TokenStability, uint256 _DropTokens ) public {
    Presale_Start_Countdown = _Presale_Start_Countdown;
    Presale_End_Countdown = _Presale_End_Countdown;
    require(_escrow != address(0));
    escrow = _escrow;
    DropTokens = _DropTokens;
    presaleSupply_ = 3000000000000000000000000;
    funder1 = _funder1;
    funder2 = _funder2;
    funder3 = _funder3;
    Development = _Development;
    Marketing = _Marketing;
    Community = _Community;
    TokenStability =_TokenStability;
    balance[escrow] += DropTokens;
    balance[escrow] += presaleSupply_;
    }
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2022-08-02 10:58:14

为什么构造函数中有很多参数?,我建议您在构造函数中设置重要参数,然后可以通过set方法设置其他参数,也可以只通过所有者修饰符检查set函数。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/73206279

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档