我正在尝试调用已部署合同的批准功能。我正在获取实际的函数来回溯并且金额和合同正确,但是我没有获得正确的批准功能来链接到令牌。它只是尝试批准发送一个空令牌。
我尝试将功能与某个地址相关联,但无法这样做。
pragma solidity >=0.4.22 <0.6.0;
contract Deployed {
mapping (address => mapping (address => uint256)) public allowance;
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
function approve(address _spender, uint256 _value) public returns (bool arbitrary) {
allowance[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
}
contract Existing {
Deployed dc;
constructor(address _t) public {dc = Deployed(_t);}
function approve(address _spender, uint256 _value) public returns (bool) {
return dc.approve(_spender, _value);
}
}
我只希望批准功能引用实际部署的合同。