Coder Social home page Coder Social logo

klimadao-solidity's Introduction

KlimaDAO contracts

Local Development

Install foundry:

https://book.getfoundry.sh/getting-started/installation

For Linux and MacOS users:

curl -L https://foundry.paradigm.xyz | bash

This will download foundryup. Then install Foundry by running:

foundryup

Deploy

These examples use a localhost fork running on the anvil command

Base Protocol Contracts

  • Deploy the Klima tokens (KLIMA, sKLIMA, wsKLIMA).

    forge script script/deployProtocolTokens.s.sol:DeployKlimaProtocolTokens --fork-url http://localhost:8545 --broadcast --ffi
    
  • Update .env with the KLIMA and sKLIMA addresses from the previous step and deploy the Klima treasury.

    forge script script/deployProtocolTreasury.s.sol:DeployKlimaTreasury --fork-url http://localhost:8545 --broadcast --ffi
    
  • Update .env with the treasury address from the previous step. Also, configure the desired parameters for the first epoch number, block, and epoch length in the deploy script below.

    forge script script/deployProtocolStaking.s.sol:DeployKlimaStaking --fork-url http://localhost:8545 --broadcast --ffi
    

Infinity Diamond Deployment

  • Deploy the base Diamond, facet implementations, and perform the diamon cut with the following script.
    forge script script/deployInfinity.s.sol:DeployInfinityScript --fork-url http://localhost:8545 --broadcast --ffi
    

Deprecated Contracts

Note that the AlphaKlimaRedeemUpgradeable will fail to get built by default, and therefore has been marked deprecated.

In order to compile this contract, you will need to manually update the @openzeppelin/contracts-upgradeable contracts that are downloaded in your node_modules by changing _trustedForwarder in metatx/ERC2771ContextUpgradeable.sol from a private to a public address.

There is another issue related to the _trustedForwarder in that contract that has not yet been resolved.

Since aKLIMA was a prelaunch coupon and the existing deployed versino of the redemption contract works as expected, this contract is no longer needed.

klimadao-solidity's People

Contributors

0xaurelius avatar 0xmichalis avatar archimedescrypto avatar chazschmidt avatar cujowolf avatar

Stargazers

 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.