Open 0xdcota opened 1 year ago
A new argument "actionArgsHash" was added to the struct of the permit
struct Permit { uint256 chainid; address owner; address operator; address receiver; uint256 amount; uint256 nonce; uint256 deadline; bytes32 actionArgsHash; }
In where:
actionArgsHash = keccak256(abi.encode(IRouter.Actions[] memory, bytes[] memory))
However: the IRouter.Action.PermitWithdraw, and IRouter.Action.PermitBorrow in the hash need to be substitute with the "ZeroPermitArgs"
Where "ZeroPermitArgs" is defined as follows:
function getZeroPermitEncodedArgs( address vault, address owner, address receiver, uint256 amount ) public view returns (bytes memory) { bytes32 ZERO_BYTES32 = 0x0000000000000000000000000000000000000000000000000000000000000000; return abi.encode(vault, owner, receiver, amount, 0, 0, ZERO_BYTES32, ZERO_BYTES32); }
At the smart contract level the actionArgsHash is constructed inside the router.internalBundle and therefore it cannot be faked.
This was implemented in pr #446 , and require the SDK to be updated appropriately.
A new argument "actionArgsHash" was added to the struct of the permit
In where:
However: the IRouter.Action.PermitWithdraw, and IRouter.Action.PermitBorrow in the hash need to be substitute with the "ZeroPermitArgs"
Where "ZeroPermitArgs" is defined as follows:
At the smart contract level the actionArgsHash is constructed inside the router.internalBundle and therefore it cannot be faked.
This was implemented in pr #446 , and require the SDK to be updated appropriately.