ethernaut icon indicating copy to clipboard operation
ethernaut copied to clipboard

OpenZeppelin Hackathon - Order Book

Open CallMeGwei opened this issue 4 years ago • 1 comments

We (@CallMeGwei, @nikeshnazareth, @fasteater) are submitting two levels as part of this PR, one being an introduction to the concept we felt necessary for solving our actual hackathon submission. The introductory level is called Malleability, and it is a complete level in its own right. It has a complete test suite as well. It introduces the idea of signature malleability.

Our actual hackathon submission, however, is the Order Book challenge. It is feature complete and has a full test suite proving the viability of the solution and the challenge scenario. Due to complexities of scenario set up, we had to modify the OrderBookFactory to deploy a minimal proxy as the level, rather than a full OrderBook. The test suite interacts with this proxy-type level, illustrating that the deployment strategy is viable. However, the Factory must be made aware of the implementation address. This is done via the relevant gamedata.json deployParams. The tooling will require slight modifications if testing via the UI is desired for local networks, however, because manual deployment of the implementation is currently required.

Even with the more efficient deployment mechanism, we are still encountering deployment issues which we believe to be related to running out of gas. We have further optimizations in mind, but have run out of time before the hackathon deadline. The gas-saving refactors we plan to implement to the OrderBook level will in no way detract from the spirit or solution mechanics of the challenge, they are just deployment optimizations.

We believe our level illustrates an important topic in a fun way. The gas errors we've encountered have led us to experiment with a new way to deploy levels that requires less block space and less gas usage - which we feel could eventually be the preferred method of level instantiation in the future.

CallMeGwei avatar Oct 08 '21 12:10 CallMeGwei

At the 11th hour... all deployment issues have been resolved. Order book instances are now fully deployable via Ethernaut so long as the implementation that the proxy points to is deployed on the relevant network.

:partying_face:

CallMeGwei avatar Oct 08 '21 14:10 CallMeGwei

Rebased in here https://github.com/OpenZeppelin/ethernaut/pull/551

xaler5 avatar Jan 12 '23 08:01 xaler5