Here is my example:
contract A {
function a() public returns(uint256) {
return 1;
}
}
contract B {
address addrOfA;
function b() public returns(uint256) {
(, bytes memory returnData) = addrOfA.delegatecall(abi.encodeWithSingature("a()");
return uint256(returnData);
}
}
What should I do to make the b()
return 1? How to deal with the return value returnData
so that I can get the value 1
from the delegate call on a()
?