Skip to content

DavNej/europool-contract

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EuropPool contract - Staking Contract

EuroPool is a simple staking contract. This contract enables users to perform the following actions :

  • Deposit a given token and earn rewards based on their deposit

  • Withdraw their deposits and earned rewards at any time

  • Withdraw their initial deposit and their proportionate share of rewards based on the timing of their deposit

  • At any time, the contract's deployer (only) can add funds to the rewards pool via the funRewardsPool function

  • Unit tests are included to verify the correctness of the contract

  • Contract inspired by: Staking Rewards

  • Assumptions made:

    • The contract generates 100 wei per second to be distributed among the stakers. The more token staked, the less reward per token
    • Generated rewards are in the same token as the token staked. Hence, the amount of token owned by the contract should always be greater than the total staked + total rewards owed to stakers.

Technologies used:

  • Foundry
  • Solidity

Contract Deployment and Verification

  • Includes a deployment script to deploy 'EuroPool' locally and to Ethereum Sepolia, Polygon Mumbai and Celo Alfajores testnets
  • Address of the deployed contract and of the Deployer of the contract can be found in .env.example
  • Contract is verified on

Usage

Setup

$ make all

Deploy

Locally

$ make anvil

then generate the deploy command:

$ make deploy-command

Mumbai

To generate the deploy command for Mumbai:

$ make deploy-command ARGS="--network mumbai"

Available networks are: Mumbai, Sepolia and Alfajores

About

A simple staking contract

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published