bitcoinwarrior1 / Solidity-Challenge

Home Page:https://goerli.etherscan.io/address/0x4A60c0bf93b2b3a3D20720a773E5Da8C80C427ac#code

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Solidity Challenge

1) Setup a project and create a contract

Summary

ERC20Pool provides a service where users can deposit ERC-20 tokens and recieve weekly rewards. Users must be able to take out their tokens and rewards at any time. Staking rewards are deposited into the pool weekly by the the team, this is a manual process.

Requirements

  • Only the team address has permission to deposit rewards.
  • Rewards depositied got to the pool and not the individual users.
  • Users can withdraw their tokens and token rewards at any time this takes into consideration the time when the user deposited tokens.
  • Solidity must be used

Example:

User A deposits 1000, and User B deposits 3000 for a total of 4000. Now A has 25% of the pool and B has 75%. When Team deposits 2000 rewards, A should be able to withdraw 1500 and B 4500.

Consider the scenario A deposits then Team deposits then B deposits then A withdraws and finally B withdraws. A should get their deposit + all the rewards. B should only get their deposit because rewards were deposited after they participated.

Goal

Design and code a contract for ERC20Pool, email amos@perion.gg with any questions.

Useful resources:

2) Write tests for your code

:)

3) Deploy your contract

Deploy the contract to any Ethereum testnet. Keep record of the deployed address and network.

Bonus:

  • Verify the contract in Etherscan

4) Interact with the contract

Create a script (or a Hardhat task) to query the total amount of ETH held in the contract.

About

https://goerli.etherscan.io/address/0x4A60c0bf93b2b3a3D20720a773E5Da8C80C427ac#code


Languages

Language:TypeScript 56.3%Language:Solidity 43.4%Language:Shell 0.3%