Code Monkey home page Code Monkey logo

litnodecontracts's Introduction

These contracts govern the Lit Nodes and various PKP things. Currently in testnet only.

Learn more here: https://developer.litprotocol.com/docs/litactionsandpkps/whatarelitactionsandpkps/

TODO

  • Tests for the token reward in the staking contracts (Staking.sol and Staking.js)
  • Make it so that the nodes can't accidently kick eachother to below the threshold. Limit the number of nodes that can be kicked per epoch? Have the ability to rejoin if kicked and recovered?

How to verify contracts

npx hardhat verify --network celo 0x5Ef8A5e3b74DE013d608740F934c14109ae12a81 \
  "0x0008a7B1Ce657E78b4eDC6FC40078ce8bf08329A"

The second param is any constructor params.

Deploying

Prepare (you only need to run this once):

make setup

Then to perform the deploy:

./deployEverything.sh <env> [resolver_address] [chain]
  • env: Environment (dev, test or prod).
  • resolver_address: Address of the ContractResolver (optional).
  • chain: Chain (optional, defaults to mumbai).

Use the deployEverything.sh script to deploy all the contracts and create config files for the nodes. You should set the ENV var LIT_MUMBAI_DEPLOYER_PRIVATE_KEY to the private key of the account you want to deploy from. It should have Polygon Mumbai testnet tokens in it for gas. You can get them from the Polygon Mumbai faucet or from the Alchemy mumbai faucet or if you need even more ask Chris on slack.

Note: The deploy script will set the ownership of each contract to the newOwner address defined in scripts/deploy_everything.js. If you need to call owner / admin functions on the contracts after they're deployed, you can set that newOwner address to something you control. If you're just using the contracts with the nodes you probably don't need to do this.

Once this script is done running, there will be config files for you generated in /node_configs of this repo. You can copy these to the /config folder of the lit_node_rust repo.

ContractResolver.sol

This file lives in the lit-os repo. Run "make setup" to pull it in here. If you need to edit it, edit it in the lit-os repo.

litnodecontracts's People

Contributors

glitch003 avatar jasonmorton avatar rhomber avatar gtc6244 avatar hwrdtm avatar raymondfeng avatar enu-kuro avatar rahul-ramesh 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.