OpenBrush — Making Writing Smart Contracts Easier — Supercolony

Toma Sadova
WASM conference
Published in
4 min readDec 9, 2021

Supercolony is delighted to receive a follow-up grant from Web3 Foundation to continue our work on the OpenBrush project. OpenBrush is an open-source library for smart contract development on ink! The project aims to make ink! development faster, safer and easier for developers across the Polkadot ecosystem.

OpenBrush aims to be the starting point for smart contract developers switching from Ethereum, making it easier for them to enter the Polkadot (ink!) ecosystem. Ink! is an eDSL to write smart contracts in Rust for blockchains built on the Substrate framework. Ink! contracts are compiled to WASM.

OpenBrush is to Polkadot what OpenZeppelin is to Solidity. OpenBrush contains the same folder structure as OpenZeppelin and has extensive documentation that describes the differences between ink! and Solidity. Furthermore, it also includes information on how developers should change their mindset, design their projects, deploy contracts and test them, etc.

In addition to having a standard implementation, Openbrush also has macros to simplify and abstract application (or smart contract) development.

The OpenBrush library provides the default implementation of standard contracts, which developers can customize. The library also offers additional features which are not available in ink! (our team will attempt to integrate them into ink! later). These are useful for development because they are like a collection of modifiers. Additionally, OpenBrush offers the option of building your own modifier quickly.

The aim of our team was to improve the smart-contract development experience and improve ink! by making it more user-friendly, fostering its adoption. And we did it!

Before we created OpenBrush, there was a lack of tools and knowledge to accelerate smart contract development, especially in WASM. OpenBrush is essentially a new and easier way to create smart contracts in WASM.

Finished work — Scope of this Grant

In the first phase of this project, we implemented reusable contracts in ink!, similar to OpenZeppelin (our first milestone). Then we simplified the usage of the library and provided macros that allow the creation of your own base implementation (second milestone).

We also created the first Polkadot Standard: the PSP22, a standard for fungible tokens targeting Substrate based blockchains.

For this grant, in the framework for the third milestone the following were quickly implemented: Cargo-Contract-pull, Parity-Scale-Cosec-pull, Ink-pull, Ink-pull, Cargo-Contract-pull.

We also made a quick implementation of Mapping and provided a report on how much space it saves- here.

Here is our complete W3F Open Grant Proposal.

Future plans 💪

Our future plan is to continue delivering for ink! (for example, reducing the size of contracts, fixing events, upgradeable contracts, and more) as well as improving the OpenBrush library.

At the same time, we want to help to reduce the size of contracts. We analyze the binary(web assembler) file and find that ink! generates many of the same code in the case of scale::Decode and scale::Encode. So, we will create the ink_codec library, which allows us to use it in a dynamic dispatch manner. More info — here.

We are also working on two new PSPs: a token standard for NFT and for multi-token.

BTW, we are planning to organize the first WASM conference ever! Follow us on Twitter, all the news will be there — https://twitter.com/supercolony_net

About Supercolony

Supercolony is made up of a team of founders and builders who believe in a future where we can create and innovate for the benefit of society. We choose to work at the edge of innovation to realize this vision at scale by connecting founders to all of the necessary resources that help companies succeed in today’s crypto ecosystem.

By combining design and development expertise, operational support, and the initial capital, we help turn bold ideas into successful companies. We have also aligned ourselves with partners in every major crypto vertical, including VCs, security auditors, legal experts, and more.

FAQ

Where and how does your project fit into the ecosystem?

The necessity of a solution like this seemed rather urgent when we started to work with ink!. We quickly realized that we strategically would like to become the company that builds within the ecosystem. We decided that we wanted to commit and help ink! become widespread and used extensively.

What need(s) does your project meet?

Our project is the starting point for smart contract developers coming from other ecosystems like Ethereum, and it aims to improve smart contract development on ink!.

About PSP22:

https://medium.com/supercolony/psp22-the-first-smart-contract-standard-on-the-polkadot-ecosystem-fef3f6c27d88

https://github.com/w3f/PSPs/pull/25

Read more about Supercolony on our Website and keep up with developments by following us on Twitter or on Telegram.

--

--