Submitted by async, also found by 0xA5DF, 0xpiglet, 0xsanson, ak1, DimitarDimitrov, Dravee, ElKu, IllIllI, JohnSmith, kenzo, and scaraven
VoteEscrowDelegation.sol#L101-L108
In VoteEscrowDelegation._writeCheckpoint, when the checkpoint is overwritten in the same block the new value is set with memory oldCheckpoint and thus is never written to storage.
Users that remove and delegate a token (or call delegate on the same token twice) in the same block will only have their first delegation persisted.
Define the oldCheckpoint variable as a storage pointer:
Checkpoint storage oldCheckpoint = checkpoints[toTokenId][nCheckpoints - 1];
0xA5DF (warden) commented:
zeroexdead (Golom) confirmed
zeroexdead (Golom) commented:
0xsaruman (Golom) resolved
