Platform: Code4rena
Start Date: 19/08/2021
Pot Size: $30,000 USDC
Total HM: 5
Participants: 11
Period: 7 days
Judge: 0xean
Total Solo HM: 4
Id: 26
League: ETH
Rank: 8/11
Findings: 1
Award: $577.05
🌟 Selected for report: 1
🚀 Solo Findings: 0
🌟 Selected for report: 0xImpostor
577.0529 USDC - $577.05
0xImpostor
When the current owner of the card is still the new owner of the card, transferCard
is called before the treasury is updated. While this does not currently pose a risk, it is not aligned with best practices of check-effect-interations and opens your code to a potential re-entrancy attack in the future.
Manual analysis
// line 381 treasury.updateRentalRate( _oldOwner, _user, user[_oldOwner][index[_oldOwner][_market][_card]].price, _price, block.timestamp ); transferCard(_market, _card, _oldOwner, _user, _price); ... // line 449 treasury.updateRentalRate( _user, _user, _price, _currUser.price, block.timestamp ); transferCard(_market, _card, _user, _user, _currUser.price);
#0 - Splidge
2021-09-07T10:32:14Z
Fixed here