scrtlabs / Grants

Repository for grant proposal submissions
42 stars 22 forks source link

Fadroma - Secret Network smart contracts development tooling #77

Open mradkov opened 2 years ago

mradkov commented 2 years ago

Fadroma - Secret Network smart contracts development tooling

Project Description

The purpose of the Fadroma suite of tools is to facilitate the rapid prototyping, continued development, and maintenance of decentralized services and applications. It consists of a Rust library to serve as a foundation for building smart contracts, and a TypeScript-based build system for deploying smart contracts and interacting with them from JavaScript. The result is a portable and accessible development environment for smart contracts that abstracts away a large part of the grunt-work and lets you focus on your product logic.

Problem / Solution

As a smart contract developer, I need to focus on the business logic of what I’m writing. For that, I need to iterate on a tight feedback loop. Therefore, I start my project with Fadroma because it lets me automate the repetitive workflow steps and provides me with reusable building blocks to streamline contract development. This empowers me to maintain high development velocity and deliver a reliable product.

As a full-stack Web 2.0 developer being onboarded to blockchain development, I expect a streamlined, comphrehensive development environment that builds on top of the similarities between the Web 2.0 and Web 3.0 operational model, provides clear affordances towards approaching the areas where the two differ (e.g. viewing smart contracts as a serverless deployment platform that is metered per operation rather than per CPU hour). I want to easily write abstractions to communicate with smart contracts from JavaScript.

Detailed product description

logo-2

Over the past year and a half, we've been developing Fadroma as our in-house repository of Secret Network-related capabilities. It has been instrumental to realising the Sienna Network project. From the start, we decided to keep a common library to facilitate the rapid prototyping, continued development, and maintenance of decentralized services and applications based on CosmWasm.

Fadroma currently consists of:

Fadroma's architecture went through several changes since its inception. We are currently approaching a 1.0.0 stable release with support for secret-cosmwasm-std 0.10, secretjs 1.4.0 and a legacy mode based on secretjs 0.17.5. It is capable of building smart contracts in a Docker container, and deploying them to either a containerised local devnet, the pulsar-2 testnet, or the secret-4 mainnet using a scripting API that allows us to declaratively express the complex deployment and configuration procedures of an evolving DeFi system using concise TypeScript. There is also a Mocknet mode which runs smart contract binaries in the standard WASM runtime of Node.js, and allows their behaviours to be validated without having to spin up.

Fadroma code is covered by Rust test suites, and lcov reports. For testing smart contracts, we provide the Ensemble feature (for integration testing from pure Rust) and the Mocknet (which runs smart contract binaries in a simulated environment based on Node.js's built-in WASM runtime, enabling fast-forwarded exploration of dynamic multi-user, multi-contract system behaviour). Fadroma's main dependencies are Node.js >=16 and Docker; containerised builds make it possible to build a Fadroma project without having a Rust toolchain at all.

It is feasible to add rootless builds (with Podman), containerless reproducible builds (with Riff) and/or remote builds (using a custom, build service).

fadroma-architecture

Go-to-Market plan

Fadroma is already open-sourced and even used in production, powering major apps on Secret Network.

As an open-source project, Fadroma is intended to become a common foundation for the community to build on, and a standard component of Cosmos developers’ workflows in the way Truffle and Hardhat are for EVM ecosystems.

Regarding announcements, marketing and community:

The product is already live and it is in use by major apps on Secret Network.

Value capture for Secret Network ecosystem

Fadroma improves day-to-day operations of developers on Secret Network.

To continually improve the viability of the blockchain paradigm as a foundation for the decentralized software ecosystem of tomorrow, the tooling used for developing smart contract-based products needs to be qualitatively better than those currently being used for mainstream Web development.

We’d like for Fadroma to provide a streamlined workflow for rapid development of Secret Network-based products, guiding developers’ attention towards extensive high-level validation of smart contracts’ behaviour, and preventing them from getting bogged down in platform details.

Eventually, we’d like for Fadroma to become the frontend for an extensive library of pre-validated templates for smart contracts that can be customised and deployed with little to no coding, similar to what OpenZeppelin provides for Ethereum, or CosmWasm Plus provides for Cosmos.

Additionally, Fadroma IBC support will make it easier to use Secret Network as a privacy provider for unencrypted Cosmos blockchains.

In short:

The more users Fadroma has -> the more developers work on Secret Network -> the more adoption of Secret Network.

Statistics

The project is used by two of the major projects on Secret Network:

We don't have any telemetry built-in the project, but based on GitHub statistics for project clone we have ~1000 unique clones for this month. These are mainly Secret Network users (or soon to be users) as the project only supports SN.

68747470733a2f2f6e6f7465732e6861636b2e62672f75706c6f6164732f75706c6f61645f39393364646261376166323037383437363565393031373134303836323439332e6a7067

Demo

In this demo we demonstrate some of the features of Fadroma.

asciicast

Team members

Team Website

Team's experience

We have extensive experience developing smart contracts, tooling and infrastructure for blockchain networks and blockchain based projects for the past 6yrs.

Some of our previous work can be seen on our website and GitHub org.

Team Code Repos

Team LinkedIn Profiles

Development Roadmap

Delivery

Contract development and testing

Macros

Contract operation

Distribution

Milestones:

(🤫 what's been done so far) 0.1. Declarative macro trying to make CosmWasm look like Redux (dropped) 0.2. First project built and deployed with Fadroma on CW0.10. 0.3. Localnet container management. 0.4. Procedural macro for flexible generation of composable smart contracts and components. 0.5. Receipts system - record of uploaded and instantiated contracts 0.6. Ensemble - Rust multi-contract integration testing environment. 0.7. Mocknet - JavaScript/WASM integration testing environment. Test production builds, fast. 0.8. Pluggable builder interface supporting containerised and raw builds, incl. from past commits 0.9. Pluggable uploader interface, currently supporting uploads from local files. 0.10. Comprehensive domain model of smart contract operations workflow, providing a foundation for idiomatic client libraries and ops scripts. (👇 we're here)

Rationale: The Secret Network upgrade to CW1.0 will be a major milestone reached. Having support of CW1.0 in Fadroma will make development more efficient while preserving the already useful toolkit provided so far and make CW1.0 contracts from other chains easily transferrable to Secret Network to be tested and deployed. Cross-chain IBC testing will be easier.

(👇 what we need support for)

Rationale: After reaching the milestone for Fadroma - CW1.0 support, more time has to be put on stability, performance, fixing known issues and polishing the experience for developers using it. We aim to make the project even more lightweight and well structured. Better up-to-date documentation and more examples are in the scope of this milestone.

Rationale: Project setup has to be quick for seamless development experience. We want to work on improving this by adding project scaffolding for Fadroma. Additionally we've spotted some tricky workflows while working on Secret contracts - such as the need of keeping track of old builds and deployments so we want to improve on that.

The REPL is a handy tool we believe will improve dev UX - wether it is a quick contract config that has to be made or an experiment.

Rationale: In this milestone we want to focus on handy features we've used in other tools while developing on other blockchain ecosystems. We believe these are the logical next step in developing Fadroma.

gantt
    title Milestones Gantt Diagram
    dateFormat  YYYY-MM-DD
    excludes    weekends

    section Milestone 0
    Milestone 0.1 - 0.10     :done,    m0, 2021-03-03, 2022-09-14

    section Milestone 1.0
    Milestone 1.0    :crit, active, 2022-09-01, 4w
    CW1.0 support    :milestone, after m10

    section Milestone 1.1
    Milestone 1.1              :    m11, 2022-10-01, 6w

    section Milestone 1.2
    Milestone 1.2              :    m12, after m11, 6w

    section Milestone 1.3
    Milestone 1.3              :    m13, after m12, 6w

Grant request

The total grant request is $89,597 (or the equivalent of SCRT at daily exchange rate on payment or USDT).

$13,337 awarded at the time of grant approval and payment on each milestone completion after.

We propose this grant timeline and funding breakdown:

Milestone Estimated Date Amount
1. Grant Accepted Present (T0) $13,337
2. M1.1 Completed T0 + 6 weeks $25,420
3. M1.2 Completed T0 + 12 weeks $25,420
4. M1.3 Completed T0 + 18 weeks $25,420
Total $89,597

Additional Information

mradkov commented 1 year ago

CW1.0 support is available: https://github.com/hackbg/fadroma/pull/139

YonatanE22 commented 1 year ago

Hey @mradkov , thanks for applying for the grant. You can reach me on TG @Yonatan_SCRTLabs