Claiming the Astral Colossus NFT

cha0sg0d
dfdao
Published in
4 min readFeb 16, 2022
The Astral Colossus Leaderboard

The Astral Colossus was the first of its kind: A smart contract player that enabled permissionless collaboration in Dark Forest, via players donating points and getting their contributions recorded.

In just about 30% of the total duration of v0.6 round 4, the Astral Colossus amassed over 76 million points and finished 35th out of 781 players.

During the development of the Colossus, we did not have enough time to enable the contract to receive prize NFTs. Thankfully, the Dark Forest core team was kind enough to give the prize planet to the dfdao Gnosis Safe, a multi-signature wallet.

Problem solved, right? We could claim the prize planet and move to our next step: rewarding the contributors who made this prize possible.

To claim our planet, we simply needed to call the claimWinner function on the Valhalla smart contract, which would mint the NFT, Ring Rush.

However, two complications occurred along the way that we thought were interesting enough to write about.

Problem 1 — Proxy ABI

The Gnosis Safe has an arbitrary Contract Interaction method that would allow us to claim Ring Rush . To do this, you simply need the address and ABI of the contract you want to interact with.

When we input the Valhalla address, the ABI was automatically generated! This is thanks to the Valhalla contract being verified on Etherscan.

We looked for the claimWinner function in the ABI, but it was not there. Unfortunately, the Gnosis Safe UI was unable to recognize that the Valhalla contract is a proxy contract.

To avoid confusion, we will refer to the proxy contract as ValhallaProxy and the actual contract logic as ValhallaLogic.

On Etherscan, we found the address for ValhallaLogic. When we input this address into Gnosis, the ABI we were expecting appeared, with the claimWinner function. However, the whole point of proxy contracts is that you cannot call the logic contract directly. This makes sense, because if you are calling a contract that has logic and state, you don’t need a proxy!

Thus, we needed to use the ValhallaLogic ABI for the ValhallaProxy contract. To accomplish this, Manan used a very special developer tool called copy and paste. We input the address for ValhallaLogic, copied the ABI, then simply replaced the ABI field of ValhallaProxy with our copied data.

Thanks to this quick hack, we successfully sent the transaction!

Here is a video of this entire process.

Problem 2 — Finding our Transaction on Etherscan

We jumped over to Etherscan, expecting to see a fresh claimWinner call on the ValhallaProxy, and another problem occurred. We couldn’t find our transaction!

missing tx on Valhalla Contract

There should have been a Claim Winner method transaction listed about ~2 minutes ago, but we only saw one from over a 1 day ago.

A transaction sent to the Gnosis Safe is actually two transactions: The verifying of signer approval and then the execution of the intended transaction. The Gnosis Safe executes the approved transaction via an internal call.

As it turns out, Etherscan does not list internal calls to a contract on that contract’s dashboard. When we went to check ValhallaProxy for our claimWinner call, it wasn’t there because the Gnosis Safe had executed the claim internally.

We pulled up our original transaction to the Gnosis Safe, and sure enough, the claimWinner was there.

Tx to

To see this in even more detail, the Internal Txns for this transaction clearly shows the Gnosis safe (0xe20) calling the Valhalla proxy (0x972) which in turn calls the ValhallaLogic (0xacc).

Internal Tx for Gnosis Safe call

Success!

We opened up the Assets tab of the Gnosis Safe UI and lo and behold, our planet was sitting there beautifully. Our next step will be to discuss with the Astral Colossus contributors how to manage the ownership of this planet.

Ring Rush

Lessons Learned

  1. Multi-sig wallets are a powerful tool, but much trickier to use than an externally owned account (a single user). We had to gain significant familiarity with the Gnosis interface and rely on pre-existing knowledge of where to look for internal transactions in order to verify our NFT claim occurred successfully.
  2. The Gnosis Safe interface needs a better way to programmatically fetch the ABI for verified proxy contracts.

--

--