✅Private Club
Idea
The essence of this chall is the "block gas limit" DoS part. There are two things to mention:
I thought keep calling
addMemberByAdmin()
can achieve DoS, but that is not true. You will end up with a huge dynamic array, which costs too much gas on furtherpush()
operations when user4 callsbecomeMember()
. This is because gas usage grows exponentially when you access huge index in an array, that's how EVM was designed to discourge the use of huge arrays. In fact we should keep callingbecomeMember()
to achieve DoS since it uses low-level call which is expensive.Remember to include
gas: blockGasLimit
when you callbecomeMember()
. We are simulating DoS, not achieving actual DoS. Can't really achieve the real DoS since user4 needs to callbecomeMember()
, we don't want this call to revert.
The rest of this chall is easy enough.
PoC
Last updated