✅Predictable NFT
Idea
Go to the contract address and decompile the bytecode:
Here tokens[stor0]
is the rank of the NFT minted. tokens[stor0] = 3
means "Superior" and that is what we want. Therefore the key to this chall is handle sha3(id, caller, block.number) % 100 > 90
.
Recall that block.number
can't be used for the source of randomness because this information will stay the same if we recompute it within the same tx. There are two subtle details:
id++
happens beforesha3()
, be aware of that.We can't see if
encode()
orencodePacked()
is used by the original contract, so try both.
PoC
Last updated