Giter Club home page Giter Club logo

eth-vn-2024's Introduction

Quadratic Protocol

Product Introduction

https://docs.google.com/presentation/d/1ziJluSqy1616M_TsJ_zY1F85bj7mdnNOWi25B933YZI/edit?usp=sharing

Demo video

Setup

make install

Linting

make lint

Deployment

Local network

Run the local network:

make run.local-node

Deploy the contract to the local network:

make deploy-contract.local

If you want to re-deploy the contract, you need to reset the deployment:

make deploy-contract.reset network=localhost

Testnet

Deploy the contract to the Linea testnet:

make deploy-contract.linea.testnet

If you want to re-deploy the contract, you need to reset the deployment:

make deploy-contract.reset network=linea_testnet

Debug tutorial

We can import hardhat/console.sol to the contract to log messages to the console. For example, the following contract logs a message when the set function is called:

import "hardhat/console.sol";

contract Lock {
    uint256 public value;

    function set(uint256 _value) public {
        console.log("Setting value to", _value);
        value = _value;
    }
}

The log message will be showed in the local network console.

After adding the log messages, we can run the local node (check the Deployment section) and run a script to call the set function:

import hre from "hardhat";

async function main() {
  const contract = await hre.ethers.getContractFactory("QuadraticLendCompound");
  const deployedContract = await contract.deploy(arg1, arg2, ...);

  const res = await deployedContract.set(
    20, // _value
    {
      gasLimit: 15000000
    },
  );
}

main()
  .then(() => process.exit(0))
  .catch(error => {
    console.error(error);
    process.exit(1);
  });

Deployed contracts

Linea testnet

Contract Address
QuadraticBorrowCompound 0x25Eb3358553fBfef30d37Cd943688e9315A4Ae89
QuadraticLendCompound 0x9B6C05a91C1A8A768ED5cEE1B28CcDe28b0B1CcC
UniswapV3ChainLinkUsdOracle 0x20CFe720Dd5Ca56DB08FE3f8c80c46667C36a144
QuadraticBorrowCompoundProxy 0xC95B04023C426143174998a339Cdcd0A283C9c82
QuadraticLendCompoundProxy 0x6aA11c2ab021C4509244e3A3F07f7859986c0C1e
UniswapV3ChainLinkOracleProxy 0x51EFDFCbd095902B2A0F5811F3ff114EdDf003F9

Polygon ZK Cardona testnet

Table:

Contract Address
QuadraticBorrowCompound 0x239f947c98bC90247d63ACF66EDbba65d200b122
QuadraticLendCompound 0x6edB4eE4484D9B11D95270dfF88aCe5E85a83139
UniswapV3ChainLinkUsdOracle 0x32C497C9F8A60076209dfa21e50A5A9477FA66f1
QuadraticBorrowCompoundProxy 0x8D136BA56d165473257D366585B41257acD89b3a
QuadraticLendCompoundProxy 0x7BbE2Fa47d999F240540ba54C5f587409098924d
UniswapV3ChainLinkOracleProxy 0xf7C03A3f069fAc43AF81aEf3F3D3a69ac1444b68

Solidity Scan result

Image from iOS

Image from iOS (1)

eth-vn-2024's People

Contributors

dinosaurchi avatar fromstupig avatar masterhung0112 avatar scarlettep avatar

Watchers

 avatar  avatar  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.