Platform: Code4rena
Start Date: 09/09/2022
Pot Size: $42,000 USDC
Total HM: 2
Participants: 101
Period: 3 days
Judge: hickuphh3
Total Solo HM: 2
Id: 161
League: ETH
Rank: 75/101
Findings: 1
Award: $33.58
🌟 Selected for report: 0
🚀 Solo Findings: 0
🌟 Selected for report: GalloDaSballo
Also found by: 0x040, 0x1f8b, 0x4non, 0x52, 0x85102, 0xNazgul, 0xSky, 0xSmartContract, Aymen0909, Bnke0x0, CertoraInc, Chandr, Chom, CodingNameKiki, Deivitto, Diana, Funen, JC, Jeiwan, Junnon, KIntern_NA, Lambda, Mohandes, Noah3o6, Ocean_Sky, Picodes, R2, Randyyy, RaymondFam, ReyAdmirado, Rohan16, Rolezn, Samatak, Sm4rty, SnowMan, SooYa, StevenL, Tagir2003, Tointer, TomJ, Tomo, V_B, Waze, _Adam, __141345__, a12jmx, ajtra, ak1, asutorufos, bharg4v, bobirichman, brgltd, c3phas, cccz, cryptonue, cryptostellar5, cryptphi, csanuragjain, d3e4, datapunk, delfin454000, dipp, djxploit, durianSausage, erictee, fatherOfBlocks, gogo, got_targ, hansfriese, horsefacts, hyh, ignacio, innertia, izhuer, karanctf, ladboy233, leosathya, lucacez, lukris02, mics, oyc_109, pashov, pauliax, prasantgupta52, rbserver, ret2basic, rfa, robee, rokinot, rotcivegaf, rvierdiiev, sach1r0, scaraven, sikorico, simon135, smiling_heretic, sorrynotsorry, unforgiven, wagmi, yixxas
33.5809 USDC - $33.58
Id | Title |
---|---|
1 | Users cannot claim if they have at least 2 valid leaves in merkle tree |
2 | Users can sign again even when they have already signed |
For each (user, cToken) pair, contract RariMerkleRedeemer
kept track of claims[][]
amount. When users claim with any valid data, value of claims
is updated only once.
So if an user has 2 valid data with the same token in merkle tree, the second one cannot be claimed, since in line 171, it checked that
require(claims[msg.sender][_cToken] == 0, "User has already claimed for this cToken.");
In RariMerkleRedeemer
, users have to sign a message before they can claim and redeem. And in every sign function, there is a hasNotSigned
modifier to not allow users to sign again. Except in signAndClaim()
function, it's lacking hasNotSigned
modifier.
Even though this does not affect the logic, it is inconsistent and should be fixed for better code quality.
hasNotSigned
modifier to signAndClaim
function.