Platform: Code4rena
Start Date: 28/11/2022
Pot Size: $192,500 USDC
Total HM: 33
Participants: 106
Period: 11 days
Judge: LSDan
Total Solo HM: 15
Id: 186
League: ETH
Rank: 66/106
Findings: 1
Award: $103.92
🌟 Selected for report: 0
🚀 Solo Findings: 0
🌟 Selected for report: IllIllI
Also found by: 0x4non, 0x52, 0xAgro, 0xNazgul, 0xSmartContract, 0xackermann, 9svR6w, Awesome, Aymen0909, B2, BRONZEDISC, Bnke0x0, Deekshith99, Deivitto, Diana, Dravee, HE1M, Jeiwan, Kaiziron, KingNFT, Lambda, Mukund, PaludoX0, RaymondFam, Rolezn, Sathish9098, Secureverse, SmartSek, __141345__, ahmedov, ayeslick, brgltd, cccz, ch0bu, chrisdior4, cryptonue, cryptostellar5, csanuragjain, datapunk, delfin454000, erictee, gz627, gzeon, helios, i_got_hacked, ignacio, imare, jadezti, jayphbee, joestakey, kankodu, ksk2345, ladboy233, martin, nadin, nicobevi, oyc_109, pashov, pavankv, pedr02b2, pzeus, rbserver, ronnyx2017, rvierdiiev, shark, unforgiven, xiaoming90, yjrwkk
103.9175 USDC - $103.92
Function supplyWithPermit is incompatible with DAI permit interface. This function may work for other stablecoins like USDC, USDT, but users of DAI may be at disadvantage.
supplyWithPermit() in PoolCore.sol is an external function which can be called directly bypassing UI. In such cases, the user will not be able to supply DAI when using supplyWithPermit() Functionality of supplyWithPermit is broken for DAI due to interface/parameter mismatch.
Contract : PoolCore.sol Function : supplyWithPermit This internally calls IERC20WithPermit(asset).permit( msg.sender, address(this), amount, deadline, permitV, permitR, permitS );
Whereas in the DAI contract permit is defined as below
function permit(address holder, address spender, uint256 nonce, uint256 expiry, bool allowed, uint8 v, bytes32 r, bytes32 s) external
ref: https://etherscan.io/address/0x6b175474e89094c44da98b954eedeac495271d0f#code
There is an additional bool field 'allowed' in DAI permit, and also the nonce parameter will be incorrect .
Customise this function supplyWithPermit to handle specifically DAI with other stablecoins. Check for DAI as asset and call permit with different parameter/signature.
#0 - c4-judge
2022-12-20T16:32:14Z
dmvt marked the issue as duplicate of #203
#1 - c4-judge
2023-01-23T12:09:31Z
dmvt marked the issue as not a duplicate
#2 - c4-judge
2023-01-23T12:09:46Z
dmvt changed the severity to QA (Quality Assurance)
#3 - c4-judge
2023-01-25T16:18:22Z
dmvt marked the issue as grade-b