Skip to content

shapeshift/fox-staking-unified-history

Repository files navigation

Staker

Farming contract based on https://github.com/Uniswap/liquidity-staker; currently deployed at 0xc54B9F82C1c54E9D4d274d633c7523f2299c42A0 on Ethereum Mainnet. The contract code is immutable, and there are no special access privileges (i.e. contract ownership) that would permit them to be altered or the rewards shut down.

Each deployment of a contract instance runs for a fixed time period (135 days for the current instance). This helps limit the damage that any attacker can cause, while also ensuring those who stake their tokens that the funds designated for rewards are fully committed to that purpose and cannot be revoked or reclaimed by the deployer. In the event of any emergency, users should unstake their tokens, after which they may choose to re-stake them in a newly-deployed, fixed contract instance.

Docs / Test Coverage

  1. install truffle globally npm install -g truffle
  2. Populate .env variables
  3. run yarn
  4. run yarn deploy:testnet OR yarn deploy:mainnet to deploy the factory contract and a farming contract using values specified in .env
    • Make note of the deployed StakingRewardsFactory contract address and the logged stakingContractInfo which has the deployed StakingRewards contract address

*** IMPORTANT ***

  • Wait for the stakingRewardsGenesis time to pass before sending any fox.
  • Verify that the genesis time has passed before sending any funds
  1. Send at least the amount of fox specified in .env (REWARD_AMOUNT) to the StakingRewardsFactory contract address from step 4
  2. run yarn fund:testnet OR yarn fund:mainnet to instruct the factory contract to send its fox to and initialize the farming contract launched in step 4