✅Private Club
Last updated
Last updated
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 further push()
operations when user4 calls becomeMember()
. 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 calling becomeMember()
to achieve DoS since it uses low-level call which is expensive.
Remember to include gas: blockGasLimit
when you call becomeMember()
. We are simulating DoS, not achieving actual DoS. Can't really achieve the real DoS since user4 needs to call becomeMember()
, we don't want this call to revert.
The rest of this chall is easy enough.