hats-finance / Accumulated-finance-0x75278bcc0fa7c9e3af98654bce195eaf3bb6a784

0 stars 0 forks source link

Incorrect `lastTokenIndex` calculation in `_removeTokenFromOwnerEnumeration` #42

Open hats-bug-reporter[bot] opened 1 week ago

hats-bug-reporter[bot] commented 1 week ago

Github username: @Jelev123 Twitter username: zhulien_zhelev Submission hash (on-chain): 0x6bca9f93654b036c074e839be164d669ff25c487a48279c857464cd88693c763 Severity: low

Description: Description\ In _removeTokenFromOwnerEnumeration function has wrong calculation of lastTokenIndex

  1. Proof of Concept (PoC) File
    uint256 lastTokenIndex = balanceOf(from);

Recommendation The calculation should be

uint256 lastTokenIndex = balanceOf(from) - 1;
0xRizwan commented 1 week ago

Non-issue, Implementation is correct and its taken from Openzeppelin

Jelev123 commented 1 week ago

Oh, damn i didn`t see that, Tnx