Git Product home page Git Product logo

ratalert-lp's Introduction

RatAlert Liquidity Provider Program

The NFT game that lets you #train2earn higher rewards from your characters! Powered by the Polygon l2 blockchain.

This repository contains the Solidity smart contracts of the LP program.

Resources

Development

Initial Setup

  • Make sure you have Truffle installed globally: npm install -g truffle.

  • Optional: Create a .env file in the project root directory, run npx mnemonics and add the seed phrase in a new line:

    MNEMONIC="your twelve word seed phrase"
    TIMELOCK_MIN_DELAY="0" # Disable timelock in tests
    
  • Run npm install

Repository Structure

  • bin/ contains a Truffle CLI to interact with contracts
  • contracts/ contains all Solidity smart contract game logic
  • test/ contains the Mocha test suite
  • config.js contains the contract configuration

Run The Tests

  1. Run a local development blockchain in a separate tab: truffle develop
  2. Run the test suite: truffle test

Local Development

  1. Run a local development blockchain in a separate tab: truffle develop
  2. Optional: Compile the contracts truffle compile
  3. Deploy the contracts locally: truffle migrate
  4. Interact with them using the console: truffle console

Configuration

Each environment uses its own .env file:

  • .env for development & tests
  • .env.test for private integration testing
  • .env.beta for public beta testing
  • .env.main for the public live game

All contract configuration is in config.js but references the env variables from the respective .env file. This is where you make overrides.

Deployment

  1. Choose an environment to deploy
  2. Optional: Create new mnemonics npx mnemonics and add them to the respective .env file
  3. Get the first account address. In the console, run web3.eth.getAccounts() and copy the first address
  4. Fund this address with 0.5 MATIC using the faucet in Mumbai testnet
  5. Deploy the contracts: truffle migrate --network <network>
  6. Get the contract addresses: truffle network
  7. Fund the Claim & Mint contracts with LINK using the faucet in Mumbai testnet

RatAlert DAO

All contracts that carry game mechanics are upgradeable. The idea behind this is to enable the RatAlert DAO to agree upon and change parameters of the game if required.

Testnet Faucets

Rinkeby

Mumbai

Credits

  • Carlo Pascoli (@cpascoli) for his lp-token-staking library. We highly modified it but it provided an awesome groundwork!

ratalert-lp's People

Contributors

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