2017-09-21 63 views
3

我有一个示例代码如下所示:混音坚固的合同如何将多个参数传递到创建按钮

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); 
    } 

它只是需要我通过(地址_teamMultisig,UINT _start,UINT _end)三个参数成在创建按钮,创建合同,我已经试过

"0xca35b7d915458ef540ade6068dfe2f44e8fa733c" 1234 1235 

给出了错误:

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

的d:

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

给出错误

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

什么是路过这里的说法正确的方法是什么?

+0

您是否试过('“0xca35b7d915458ef540ade6068dfe2f44e8fa733c”,1234,1235') - 没有括号 - ? –

+0

我试过了,它说'创建浏览器/ ballot.sol:HubiiCrowdsale错误:发送事务失败:无效地址。如果您使用注入的提供者,请检查它是否已正确解锁。 “ –

回答

3

尝试:

"0xca35b7d915458ef540ade6068dfe2f44e8fa733c", 1234, 1235 

它的逗号分隔

编辑:我刚看到上面的评论,也有叫“Crowdsale”可以请你为这也为提供的代码修改约束这可能会导致进一步的错误。

相关问题