簡體   English   中英

remix solidity contract如何將多個參數傳遞給create按鈕

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

我有一個示例代碼如下所示:

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

和:

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

給出錯誤

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

在這里傳遞參數的正確方法是什么?

嘗試:

"0xca35b7d915458ef540ade6068dfe2f44e8fa733c", 1234, 1235

它以逗號分隔

編輯:我剛剛看到上面的評論,還有一個名為“Crowdsale”的修飾符約束,請你為此提供代碼,因為這可能會導致進一步的錯誤。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM