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.
- Website
- Whitepaper
- Infographic
- Roadmap
- LP program
- Discord
- Telegram
- Medium
- GitHub
- DAO Gnosis Safe
-
Make sure you have Truffle installed globally:
npm install -g truffle
. -
Optional: Create a
.env
file in the project root directory, runnpx 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
- 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 a local development blockchain in a separate tab:
truffle develop
- Run the test suite:
truffle test
- Run a local development blockchain in a separate tab:
truffle develop
- Optional: Compile the contracts
truffle compile
- Deploy the contracts locally:
truffle migrate
- Interact with them using the console:
truffle console
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.
- Choose an environment to deploy
- Optional: Create new mnemonics
npx mnemonics
and add them to the respective .env file - Get the first account address. In the console, run
web3.eth.getAccounts()
and copy the first address - Fund this address with 0.5 MATIC using the faucet in Mumbai testnet
- Deploy the contracts:
truffle migrate --network <network>
- Get the contract addresses:
truffle network
- Fund the Claim & Mint contracts with LINK using the faucet in Mumbai testnet
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.
- Carlo Pascoli (@cpascoli) for his lp-token-staking library. We highly modified it but it provided an awesome groundwork!