What I would like to do is something like this:
function testCall(uint amount) public virtual returns (bool) {
address tta = address(0xE7B6....);
(bool success, bytes memory result) = tta.delegatecall(abi.encodeWithSignature("approve(address, uint256)", address(this), amount));
return success;
}
The token looks like this (has the approve function)
However, whenever the function is executed, it reverts with an error.
What am I doing wrong?
What I need to accomplish is to let the user approve the contract to make a transferFrom
by executing the contract's testCall()
function first.
"approve(address, uint256)"
. – goodvibration Aug 22 '20 at 18:42