【发布时间】:2020-02-24 13:12:03
【问题描述】:
我目前在 ethereum.remix.org 上制作测试合约。 但是如何在测试文件中指定发送合约调用的账户?
contract test {
MyContract contract;
address creator = address(0);
address payable account2 = address(1);
address payable account3 = address(2);
address payable account4 = address(3);
function beforeAll () public {
contract = new MyContract();
}
function makeCallFromAccount2 () {
contract.function1(10);
}
}
如何指定 contract.function1(10) 从账户 2 执行? (这很重要,因为合约方法使用 msg.sender 值)
【问题讨论】:
标签: ethereum solidity web3 remix