简体   繁体   English

remix solidity contract如何将多个参数传递给create按钮

[英]remix solidity contract how to pass multiple arguments into the create button

I have a sample code look like this: 我有一个示例代码如下所示:

function HubiiCrowdsale(address _teamMultisig, uint _start, uint _end) Crowdsale(_teamMultisig, _start, _end, hubii_minimum_funding) public {
      PricingStrategy p_strategy = new FlatPricing(token_in_wei);
      CeilingStrategy c_strategy = new FixedCeiling(chunked_multiple, limit_per_address);
      FinalizeAgent f_agent = new BonusFinalizeAgent(this, bonus_base_points, _teamMultisig); 
      setPricingStrategy(p_strategy);
      setCeilingStrategy(c_strategy);
      // Testing values
      token = new CrowdsaleToken(token_name, token_symbol, token_initial_supply, token_decimals, _teamMultisig, token_mintable);
      token.setMintAgent(address(this), true);
      token.setMintAgent(address(f_agent), true);
      token.setReleaseAgent(address(f_agent));
      setFinalizeAgent(f_agent);
  }

it just needs me to pass (address _teamMultisig, uint _start, uint _end) three arguments into the create button to create the contract, I have tried 它只需要我传递(地址_teamMultisig,uint _start,uint _end)三个参数到创建按钮创建合同,我试过

"0xca35b7d915458ef540ade6068dfe2f44e8fa733c" 1234 1235

gives error: 给出错误:

creation of browser/ballot.sol:HubiiCrowdsale errored: Error encoding arguments: SyntaxError: Unexpected number in JSON at position 46

and: 和:

{"_teamMultisig":"0xca35b7d915458ef540ade6068dfe2f44e8fa733c","_start":1234,"_end":1235}

gives error 给出错误

creation of browser/ballot.sol:HubiiCrowdsale errored: Error encoding arguments: Error: Argument is not a number

what is the correct way to pass argument here? 在这里传递参数的正确方法是什么?

Try: 尝试:

"0xca35b7d915458ef540ade6068dfe2f44e8fa733c", 1234, 1235

It's comma delimited 它以逗号分隔

Edit: I've just seen the comment above, there's also a modifier constraint called "Crowdsale" can you please provide the code for this too as this could be causing further errors. 编辑:我刚刚看到上面的评论,还有一个名为“Crowdsale”的修饰符约束,请你为此提供代码,因为这可能会导致进一步的错误。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在合约中设置 ETH 的接收者,以在 remix IDE 中使用solidity usign call() 从一个地址向另一个地址发送ETH - How to set the receiver of ETH in a contract to send ETH from one address to another with solidity usign call() in remix IDE 在 Remix 中部署 solidity 合约时如何修复/调试错误(无效的 arrayify 值) - How to fix / debug errors (invalid arrayify value) when deploying a solidity contract in Remix 如何解决solidity Remix中的类型错误 - how to solve type error in solidity Remix 如何测试 Solidity 应付合同 - How to test a Solidity payable contract 主网在Remix Solidity智能合约中将地址数组部署为构造函数参数不起作用 - Mainnet deploying array of addresses as constructor parameter in Remix Solidity smart contract does not work 如何牢固地使用Oraclize将参数传递给数据源? - How to use Oraclize in solidity to pass arguments to the data source? 如何在 Solidity 智能合约中启用 Claim Tokens? - How to enable Claim Tokens in Solidity Smart Contract? 如何获得合同稳固性的当前状态? - How to get current state of contract solidity? 如何用solidity语言删除合同的这个ParserError? - How to remove this ParserError of contract in solidity language? Solidity - 如何从外部合同中调用智能合约实例? - Solidity - How to call smart contract instances from external contract?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM