Giter Site home page Giter Site logo

twister's Introduction

TWISTER

There is already a popular protocol for depositing an amount and withdrawing it from another account, but unfortunately the deposit amounts are predefined. Would you like to be able to deposit any amount in increments of 0.001 eth and withdraw that amount in one or more transactions.

Scroll sepolia address 0xda8c05c7f2783b0a8c1410636d379d0cd7cbd644

Subgraph repository

Noir with Vite and Hardhat

Netlify Status

This example uses Vite as the frontend framework, and Hardhat to deploy and test.

Getting Started

Want to get started in a pinch? Start your project in a free Github Codespace!

Start your project in a free Github Codespace!

In the meantime, follow these simple steps to work on your own machine:

  1. Install yarn (tested on yarn v1.22.19)

  2. Install Node.js >20.10 (latest LTS) (tested on v18.17.0)

  3. Install noirup with

    curl -L https://raw.githubusercontent.com/noir-lang/noirup/main/install | bash
  4. Install Nargo with

    noirup
  5. Install dependencies with

    yarn

Generate verifier contract

Contract

The deployment assumes a verifier contract has been generated by nargo. In order to do this, run:

cd circuits
nargo codegen-verifier

A file named plonk_vk.sol should appear in the circuits/contracts/with_foundry folder.

Test locally

  1. Copy vite-hardhat/.env.example to a new file vite-hardhat/.env.

  2. Start a local development EVM at http://localhost:8545 with

    npx hardhat node

    or if foundry is preferred, with

    anvil
  3. Run the example test file with

    yarn test

The test demonstrates basic usage of Noir in a TypeScript Node.js environment.

Deploy locally

  1. Copy vite-hardhat/.env.example to a new file vite-hardhat/.env.

  2. Start a local development EVM at http://localhost:8545 with

    npx hardhat node

    or if foundry is preferred, with

    anvil
  3. Build the project and deploy contracts to the local development chain with

    NETWORK=localhost yarn build

    Note: If the deployment fails, try removing yarn.lock and reinstalling dependencies with yarn.

  4. Once your contracts are deployed and the build is finished, you can preview the built website with

    yarn preview

Deploy on networks

You can choose any other network in hardhat.config.ts and deploy there using this NETWORK environment variable.

For example, NETWORK=mumbai yarn build or NETWORK=sepolia yarn build.

Make sure you:

  • Update the deployer private keys in vite-hardhat/.env
  • Have funds in the deployer account
  • Add keys for alchemy (to act as a node) in vite-hardhat/.env

Feel free to contribute with other networks in hardhat.config.ts

twister's People

Contributors

youtpout avatar

Watchers

 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.