Git Product home page Git Product logo

non-fungible-apps's Introduction

Fleek Non Fungible Apps

The repository for Fleek Non Fungible Apps project

๐Ÿšง IMPORTANT ๐Ÿšง - This initiative is under development, so this repo should be treated as a WIP. The goals and the roadmap might change as the project is shaped.

โšก Overview

This is the landing point for Fleek's initiative to implement infrastructure as Solidity contracts.

The vision is to have this on a suitable L2 or L3 based on EVM so there is flexibility in terms of which chains to work with. And we can create a network of smart contracts that represent the different parts of your stack.

The goal is to be a more verifiable and crypto-friendly Serverless.yaml or Cloudformation manifests that will enable us to develop use cases on top like community hosting.

We've developed a base set of contract code so now we want to harden it as well as add more metadata and features to support use cases with the first use case being community hosting. So be sure to check out the roadmap on the wiki.

You can find the wiki here for more information about the project.

โŒจ๏ธ Developing

๐Ÿ“ Project Structure

Inside the root folder you are going to find:

  • /contracts: all the developed contracts
  • /deploy: scripts used for deployment on different networks
  • /deployments: resultant ABI and info for deployments (each network will have a nested folder)
  • /lib: external modules used by Foundry
  • /scripts: any utility scripts used for interacting with deployed contracts
  • /test: tests suits to validate contracts
  • /ui: a web application to interact with deployed contracts

And after running it locally some folders may be generated:

  • /artifacts: ABIs and build info generated by Hardhat
  • /cache: cache info used by Hardhat
  • /forge-cache: cache info used by Foundry
  • /node_modules: all dependencies for the Node.js environment
  • /out: resultant ABIs for all contracts that has interactions

๐Ÿ“„ Contracts

The contracts present in this project are based in Solidity and it uses Node.js for running scripts and yarn to keep dependencies management.

โš ๏ธ Before starting developing make sure you Solidity, Node.js and yarn correctly installed in your environment

Follow the steps:

  1. Clone the repo, check out how here.

  2. Install the dependencies:

    $ yarn
  3. Compile the contracts to make sure everything is correct:

    $ yarn compile

    The output should looks like:

    yarn run v1.22.19
    $ hardhat compile
    Compiled 14 Solidity files successfully.
    Done in 0.98s.
  4. Now you are able to make your code changes in the project. To help with Solidity, check the language references.

โœ… Testing Contracts

The project is covered with test suits (Foundry & Hardhat) that must pass to guarantee code integrity.

HardHat tests

All HardHat tests are located at this directory.

  1. Make sure that you have the dependencies installed:

    $ yarn
    
  2. Run:

    $ yarn test:hardhat
    

    The output should finish looking like:

    ...
    
    33 passing (1s)
    
    Done in 2.11s.
    

Foundry tests

All Forge tests are located at this directory.

In order to run them, you need to have Forge by Foundry installed on your machine (check this installation guide).

It is also required for you to have forge-std in your ./lib/ directory. In case you don't have it yet, you can run:

$ git submodule update --init --recursive

After installing Foundry and its components, you can simply run in the root directory:

$ yarn test:foundry

It is going to execute all test cases that are described in the /test/foundry directory. Your output should looks like:

Test result: ok. 36 passed; 0 failed; finished in 4.06ms
Done in 0.58s.

Running Both Test Environments

Alternatively, you can run both test environments by executing:

$ yarn test

โš ๏ธ Please make sure to update tests as appropriate before pushing code

๐Ÿš€ Deployment

This guide contains instructions to deploy the contract on three networks. If the execution is successful, you will see the contract address on your screen at the end of the instructions.

Hardhat Local Network

HardHat offers a local testnet environment that allows users and testers to deploy and interact with contracts without the need to contact external APIs and endpoints.

To start your local HardHat network, you need to run a node first. It is important to not terminate the command before proceeding with the instructions:

$ yarn node:hardhat

To deploy the contract on the HardHat network, execute:

$ yarn deploy:local

If the execution is successful, you will see the contract address on your screen.

Polygon Mumbai Testnet

To deploy the contract on the testnet, you have to first export your wallet's private key and update the .env.example file at the root directory of this repository.

The .env.example file needs to be renamed to .env before continuing. Make sure you are using your private API URL, if you have one.

After updating the .env file, you can run:

$ yarn deploy:mumbai

to deploy the contract on the testnet. Please note that your wallet needs to hold enough Mumbai MATIC for the deployment to be successful. To reach more in-depth information about how to deploy contract checkout this guide.

โ–ถ๏ธ Interaction scripts

Right away, in the /scripts folder you are able to see some scripts that will help you to interact with deployed contracts. By default you are able to select localhost, hardhat or mumbai network name predefined on hardhat.config.ts. The scripts will be using the deployment information stored in the /deployments folder. You should have a nested folder for each of the networks you have deployed it. The scripts needs be run using the Hardhat environment following the pattern:

# Replace <script_name> with the selected script
# Replace <network_name> with the selected network
$ npx hardhat run scripts/<script_name>.js --network <network_name>

๐Ÿ’กYou are able to see and change the arguments for each script at the top of each file

๐Ÿ–ฅ๏ธ User Interface

Within the project is included a React web application to expose and test the interaction with deployed scripts. Check the UI readme for more info

๐Ÿ’… Code Styling

For code formatting we are using Prettier and following the styling guide from Solidity documentation. For formatting the code you are able to run:

$ yarn format

โš ๏ธ Please make sure you are following the code styling guid before pushing code

๐Ÿ›ฃ๏ธ Roadmap

Our goal is to reach a point where trustable Solidity contracts can be used for identifying properly the data about web3 applications. Within that goal, we want to also provide ways for users to organize and list information about their application. To get at this we are currently starting with:

  • Define trustable and extendable smart contracts and standards
  • Prove how the concept would be applicable using static sites
  • Prove community hosted apps via these contracts

Later on, when the initiative prove its value, a service will be added to Fleek's platform in a friendly way for anyone be able to get their applications onboard.

๐Ÿ’ก Proof of concept

The proof of concept is being a work in progress and you can reach more information here.

๐Ÿ“š Dependency Highlights

We use the following libraries to develop Fleek Non Fungible Apps

๐Ÿ™ Contributing

This is an open source initiative! Any new idea is welcome, if you want to help us to improve the project please checkout the contributing guide.

๐Ÿ“œ License

Fleek Non Fungible Apps is released under the MIT License.

๐Ÿ› Bug reporting

If you have found a bug to report, please create an issue. Thank you!

non-fungible-apps's People

Contributors

migueltoscano avatar emperororokusaki avatar csosamorales avatar zoruka avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.