Scrypto DAO Challenge Results | The Radix Blog | Radix DLT
October 19, 2022
Hello community! This is once again the time to announce the winners of the latest Scrypto competition. This time around, participants had from September 13th to October 11th to come up with a Scrypto package related to Decentralized Autonomous Organizations (DAO).
DAOs, which allow a group of people with similar interests to make decisions together and manage an organization in a trustless way using smart-contracts, are becoming increasingly popular. We outlined different real-world examples of DAOs on the announcement blog post if you want to learn more about that.
This time, we received a total of 12 participants. I know we say it every time, but the submissions we receive always exceed our expectations. It’s amazing to see how the community has evolved since the first challenge we hosted (which was about decentralized exchanges). Just look at the submitted examples for the first and fifth challenges on GitHub and see the difference for yourself.
I recommend remembering the name of the participants of the Scrypto challenges as they are going to make history by being among the first to deploy Scrypto packages on Babylon. By participating in Scrypto competitions and refining their skills, they are getting ready for Babylon. Now the question to ask yourself is… are you getting ready?
As a reminder, each entry was judged based on the following five criteria:
- Quality and asset-orientedness of the code: did the participant show a good understanding of the asset-oriented programming paradigm?
- Breadth of functionality: the more we could do with the submitted package, the more points the participant got.
- Creativity of the concept: was the idea creative and original?
- Quality of the documentation and comments in the code: did the participant provide documentation to make it easier to understand the code?
Now, without further ado, let’s announce the winners…
1st place: Align by Peter Kim
Peter Kim implemented a DAO blueprint that people can instantiate with different parameters. The Scrypto package that Peter Kim submitted consists of five blueprints:
- DAO Blueprint: This is the core blueprint that governs the whole DAO. It connects all the following blueprints together.
- Community: Allow community representatives to manage and contribute to the core DAO through liquid democracy.
- Proposal: Stores the vote history and manages the DAO’s collective actions.
- Treasury: Blueprint that manages and stores the assets of the DAO.
- LocalOracle: This oracle is used by the DAO to access precise unix time data.
Peter Kim implemented so many features in this submission. They included a total of 8 Decentralized Government (DeGov) techniques: Quorum Voting, Quadratic Voting, Rage Quitting, Liquid Democracy, Holographic Voting, Weighted Voting, Reputation-based voting and a novel concept that Peter Kim called “Power Taxing”. This last one is a new concept that the author invented that allows the community representative to essentially get more voting power by taxing a part of the voting power of the members of the community.
People can register as a user of the DAO by calling the `become_dao_member` method on the Core component. A user badge represented as a soulbound NFT that stores the user’s data is then returned to the caller. Once registered, they can contribute to the DAO by submitting three kind of proposals:
- Call method proposal: When accepted by the community, a component method will be called.
- Withdraw funds proposal: When accepted, the proposer gets the amount of tokens requested.
- Distribute resources proposal: When accepted, an amount of tokens is distributed to the voters.
There are simply too many features to highlight them all in this blog post — like the slashing and dividend systems. If you are interested, we suggest reading through the code and the extensive documentation that Peter wrote alongside his code.
With his submission, Peter Kim will receive $8500 worth of XRD.
“Align blueprint package used many advanced Decentralized Governance techniques, most notably Liquid Democracy, Commitment Voting and Rage Withdraw. The same thing cannot be achieved without many advanced Scrypto modules and design patterns such as Reusable Blueprint — which were used for Liquidity Democracy and advanced proposals’ creation; the Resource Manager — was used to indirectly, seamlessly retrieve and update user’s account data on-the-fly while executing smartcontract logic; the Access Control — which was used to create solid “code and law” on the DAO without extra worry about security. Align blueprint package will undoubtedly become the first package toward my greatest ambition of a “just utopia”. I have always believed “DAO can create a better society” and hope that in the future, with the help of Scrypto, there will be more people with the same belief to realize our dream together.” — Peter Kim
2nd place: DAO-kit by backyard-coder
Last time, it was FR05T8YTE making a comeback and now it’s the turn of backyard-coder! Back in May, backyard-coder participated in the Scrypto oracle competition and won first place. This time, they built a DAO system that can work with any pre-existing component on the ledger. DAO-kit proposes three Scrypto blueprints that can be used together or individually to create the DAO that fits your needs:
- MembershipSystem: This blueprint allows the management of the members of the DAO. The identity of each member is represented by a non-fungible token that the member receives after registering. This NFT stores the name of the member and custom data that is represented as bytes.
- VotingSystem: This blueprint manages proposals and votes in the DAO. Members can propose things that other members then vote on. The proposal could simply be a proposition that is recorded on the ledger and where the action is done off-chain or it can specify component methods that will automatically be called once the proposal is accepted.
- CodeExecutionSystem: If you need your DAO to execute component methods once a proposal has been accepted, you would use this blueprint. It manages the calling of methods and the authority (badges) required to do it.
A very elegant feature that backyard-coder implemented is the use of a transient badge as a way to do safe re-entrancy. Remember that native re-entrancy is not possible with Scrypto as a security feature. A transient badge is a token that a component gives you and that you cannot store in your account. You have to return it to that same component by the end of the transaction or else it would fail. This essentially forces the transaction submitter to call a specific method on the component in the same transaction.
On top of that, to the best of our knowledge, backyard-coder built the first public frontend example that uses Svelte, a frontend development framework that is becoming increasingly popular, to connect a web application to the Babylon Alphanet. If you are a fan of Svelte or simply want to see how to interact with Alphanet you should definitely check out their code here.
With their submission, backyard-coder will receive $4500 worth of XRD.
“Just as with a previous challenge, it was a lot of fun to develop with Scrypto. The language is based on some clever core concepts, and especially its resource-centric approach makes developing complex applications easy and intuitive. I was very pleased to see that the current version of Scrypto is even more polished and well-thought-out than the previous ones. The hard work of the team is really starting to show here! Except for a few minor things, the language already feels like it could be used to program production-ready blueprints. Of course, the team still has some cool features in the pipeline, and I’m looking forward to taking up the next challenge using an even better version of Scrypto.” — backyard-coder
3rd place: smorgasdao by scryptonight
Last but not least, we got scryptonight in third place! Scryptonight also went meta by designing a DAO system that fits with any component already present on the blockchain instead of creating a single specific DAO. Scryptonight describes their submission as a “configurable DAO that can control any badge-administered component”. Members are able to propose method calls on specific components and once the proposal is approved the system automatically calls that method with the required badges.
As always, scryptonight’s code is concise and extremely well documented. They wrote all the code in a single blueprint which makes it a very good example for people who want to get a first taste of Scrypto.
It is good to see that Scryptonight and many others are starting to use the “General Reusable Blueprints” design pattern that we are advocating. In short, blueprints, which contain the dApps code, live on the ledger and offer “instantiation functions” that people can call to instantiate components with different parameters from it. This makes it possible to host the code only once on the ledger and have many different components pointing to that same code, each with some customization. So in short, the general reusable blueprints design pattern is a way to write the instantiation functions so that they allow even more reusability and customization.
With their submission, scryptonight will receive $2000 worth of XRD.
“The Scrypto challenges just get more exciting to me every time I participate in one, and every time I learn something new (in this one I figured out how to use enums properly in my component interface). I find that completing a challenge forces me to produce a whole product in a way that I probably never would have if I was just playing around with fun features in a throwaway project — and I highly recommend to anyone out there dabbling in Scrypto to give a scrypto challenge a go just to see what it’s like to touch all the different aspects in making one work.” — scryptonight
Honorable mentions: Styx-dao by arthurvinci
Arthurvinci wrote a Scrypto package that acts as a DAO that manages assets for a community. Community members are able to propose two types of changes. They can allow the spending of a particular resource to a particular account or they can allow the minting of more Styx tokens, the governance token of the platform.
Arthurvinci even took the time to write a whitepaper explaining their package and outlining the different algorithms they used for their submission. We suggest reading it to get a more in-depth understanding of the platform.
“Having already experimented with Rust, it was quite easy to understand how to produce Scrypto code. The asset-oriented paradigm can be a bit restrictive sometimes but it is quite intuitive and, as Scrypto is still in an early phase, new features will come soon. Moreover, the team is very responsive and helped me a lot when I had issues. I learnt a lot doing the Scrypto challenge and I feel like I still have a lot to learn.” — arthurvinci
Again, we would like to congratulate everyone who participated in this competition! You are among the first Scryptonauts to explore the realms of asset-orientedness and safe smart-contract environments and you should be proud of that.
Stay tuned to our Radix Discord channel and join our developer mailing list to be among the first to learn about our developer events and upcoming competitions. We are going to announce the next competition very shortly.
Thanks everyone and keep coding awesome stuff!
Originally published at https://www.radixdlt.com.