代码之家  ›  专栏  ›  技术社区  ›  Amarsh

混音+Ganache-不能从一个合同调用另一个合同

  •  0
  • Amarsh  · 技术社区  · 6 年前

    我有一个无辜的期待合同,工作无痛的混音。如果我在Remix中使用JavaScript VM,测试契约可以很容易地调用另一个。

    我还在端口7454上运行ganache cli。如果我将Remix连接到ganachecli,那么每个契约都可以单独工作。但我不能打电话给另一个测试。混音控制台说 transact to Test.send errored: VM Exception while processing transaction: revert

    我的合同是这样的:

    pragma solidity 0.4.25;
    
    contract Another {
        uint public balance;
        function sendToAnother() public {
            balance += 10;
        }
    }
    
    contract Test {
        function send(address another) public {
            Another(another).sendToAnother();
        }
    }
    

    我的一个怀疑是——我是否正确地找到了另一份合同的地址?我是从混音公司复制的 Deployed Contracts 选项卡。

    0 回复  |  直到 6 年前