BugHunter101
medium
TxBuilderExtension.onDeferredLiquidityCheck() does not use payable
. This will cause errors when calling some functions that require fees
TxBuilderExtension.onDeferredLiquidityCheck() does not use payable
. This will cause errors when calling some functions that require fees
As we can see, onDeferredLiquidityCheck()
is a callback function and it will call executeInternal()
function onDeferredLiquidityCheck(bytes memory encodedData) external override {
require(msg.sender == address(ironBank), "untrusted message sender");
(address initiator, Action[] memory actions, uint256 index) =
abi.decode(encodedData, (address, Action[], uint256));
executeInternal(initiator, actions, index);
}
the executeInternal()
will be called according to the parameter actions
specification.
And then, there have some function which require fees . such borrowNativeToken
function borrowNativeToken(address user, uint256 borrowAmount) internal nonReentrant {
ironBank.borrow(user, address(this), weth, borrowAmount);
WethInterface(weth).withdraw(borrowAmount);
(bool sent,) = user.call{value: borrowAmount}("");
require(sent, "failed to send native token");
}
So, when we call borrowNativeToken()
will cause error. TxBuilderExtension.onDeferredLiquidityCheck() does not use payable
. This will cause errors when calling some functions that require fees.
This will cause errors when calling some functions that require fees
Manual Review
Adding payable
for this function