Today, Sam Spratt announced the winners of The Monument Game. Each winner must transfer their Player ticket in exchange of receiving their Skulls of Luci token - this is done via a custom swap contract by @koloz193, fully trustlessly. Let's walk through the contract!
We start off by declaring two events - one for a skull being claimed, and one for the Monument Game winners being decided. We also define a Ticket type which contains a comment (each winner's observation) and the skullId they'll be awarded.

Next we define state variables: _semaphore (used later for a reentrancy guard), the address holding the skulls prior to claim, the skulls contract, the Player contract, a mapping of the winners, and a bool for whether they've been selected already.

Two modifiers: addressesSet is used to check that the addresses have been set prior to people claiming, and guarded is used as a reentrancy guard for when winners call the claim function.

In the constructor, we set the addresses for the skulls vault, the skulls token, and the player ticket contract.

Next are three admin functions for updating those values if necessary, and a function for inputting the necessary data for all three winners of the game (their player tickets, their observations, and the skull ID they're going to get in return).

Lastly, we have the claimSkull() function which allows the winning Skulls of Luci to be claimed and transfers the winners' tickets in exchange. Anyone can trigger the claim, but it requires the contract to be approved to transfer both Player and Skulls tokens.

And that's the LucisTrade contract! Congrats to @benskaarphoto, @bugindreamland, and @GareySimpson on winning the Monument Game and to @SamSpratt for a wonderful work and performance.
You can view the full contract here.
If you enjoyed this thread, share it and give me a follow on Twitter. I write daily about onchain software and media. You can view some of my other smart contract breakdowns in this thread.
