theCyber — The new GateKeeperTwo

Introduction

In the first article of this series about theCyber, we discovered about this new exclusive on-chain club. The second article of the series focused on analysing how to enter theCyber.

Shortly after the information being published, a flaw in theCyberGateKeeper has been raised on reddit. As a result, a new version of the GateKeeper smart contract has been written and deployed by 0age.

bug
Figure 1. Smart Contracts cannot be modified once deployed

In this article, we take a look at the new smart contract: GateKeeperTwo.

Warning
NON SPOILER ALERT: If you read the previous articles, you know that I don’t intend (at least yet) to spoil the fun of entering the theCyber by yourself. This is why no information will be published that is not public yet. This article is not intended to provide any sort of solution.

GateKeeperTwo

Blockchain and Smart Contracts do not work as software development as you know it. When you find a bug in a Smart Contract, you cannot simply update this Smart Contract with a new version. The data stored on a Blockchain is immutable.

After the bug was discover (and discussed on reddit), a new version of the GateKeeper has been deployed at a new address.

The new contract can be found at gatekeepertwo.thecyber.eth.

Beside fixing the issue of the first GateKeeper contract, the new version brings a couple of changes:

  • There can only be now a maximum of 128 entrant submissions (250 previously)

  • A few more data and helpers are exposed, you can see them here

  • Some of the Gates have been changed

  • All the entrants that managed to enter the original GateKeeper before block #5375177 have been added to the new GateKeeperTwo contract


New Gates

While the GateOne did not change, GateTwo and GateThree are totally new beasts.

labyrinth

GateOne

The first gate is an old friend if you analysed the first GateKeeper.

If you have a little experience with Solidity or take the time to read the solidity documentation around this chapter, you should be able to pass this gate without much troubles.

gate1
Figure 2. GateOne

GateTwo

0age offers us here a nice challenge. Your eyebrows will likely raise once you pass GateOne and read the requirements of the following modifier.

gate2
Figure 3. GateTwo

Solidity is a high level language to write smart contracts but also allows using assembler instructions. Although an educated guess may do, you are probably eager to know what extcodesize() exactly does and what Caller is. You will find some more information in the solidity documentation again, right there.

GateThree

Another new challenge here. GateThree uses again the notion of GateKey that we saw in the first GateKeeper. So it seems that we need again to provide a valid passphrase as well as a _gatekey that will satisfy the condition below:

gate3
Figure 4. GateThree

New goodies

The new contract comes with a few goodies. Assuming you got a passphrase somewhere, the new contract allows you to check whether this pass phrase has been already used or not.

We can see for instance that correct horse battery staple has never been used. Let me save you some unsuccessful attempts, this pass phrase is NOT part of the valid ones. No need to check it!

correcthorse
Figure 5.

On the other hand, we can see that the correct pass phrase prejudice salmon mislead collect has been used already, so no need to try this one either:

prejudicesalmon
Figure 6.

Current number of entrants

At the time of writing, the number of account that made it into the GateKeeperTwo is 51/128.

nbentrants
Figure 7. 51/128 Entrants

Once again, 0age offers us here an exciting challenge and a great opportunity to learn about solidity, Ethereum and Smart Contracts.

roadstone
Figure 8. That’s what I had in mind after initially reading GateOne and GateTwo!

As with many puzzles, the solution seems to be impossible until you find it and realise that it was not that hard after all.

Good luck and see you in theCyber.

Avatar
Wilfried Kopp aka. Chevdor
Building Blockchains & Decentralized Solutions

I build decentralized solutions and tooling to support them. I am developing Smart Contracts and dApps on Ethereum and developing tooling for Substrate (Polkadot & Kusama). I love Rust! I am using Docker extensively and above all I like efficiency. GPG Fingerprint 15AF C574 D3F9 F1C3 CCDD E31E 2DCE C4DC 506E 6475.

Related