diff --git a/.history/README_20240317034304.md b/.history/README_20240317034304.md new file mode 100644 index 0000000..65948c8 --- /dev/null +++ b/.history/README_20240317034304.md @@ -0,0 +1,58 @@ +# Smart Contract Challenge + +## A) Challenge + +### 1) Setup a project and create a contract + +#### Summary + +ETHPool provides a service where people can deposit ETH and they will receive weekly rewards. Users must be able to take out their deposits along with their portion of rewards at any time. New rewards are deposited manually into the pool by the ETHPool team each week using a contract function. + +#### Requirements + +- Only the team can deposit rewards. +- Deposited rewards go to the pool of users, not to individual users. +- Users should be able to withdraw their deposits along with their share of rewards considering the time when they deposited. + +Example: + +> Let say we have user **A** and **B** and team **T**. +> +> **A** deposits 100, and **B** deposits 300 for a total of 400 in the pool. Now **A** has 25% of the pool and **B** has 75%. When **T** deposits 200 rewards, **A** should be able to withdraw 150 and **B** 450. +> +> What if the following happens? **A** deposits then **T** 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 sent to the pool before they participated. + +#### Goal + +Design and code a contract for ETHPool, take all the assumptions you need to move forward. + +You can use any development tools you prefer: Hardhat, Truffle, Brownie, Solidity, Vyper. + +Useful resources: + +- Solidity Docs: https://docs.soliditylang.org/en/v0.8.4 +- Educational Resource: https://github.com/austintgriffith/scaffold-eth +- Project Starter: https://github.com/abarmat/solidity-starter + +### 2) Write tests + +Make sure that all your code is tested properly + +### 3) Deploy your contract + +Deploy the contract to any Ethereum testnet of your preference. Keep record of the deployed address. + +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. + +_You can use any library you prefer: Ethers.js, Web3.js, Web3.py, eth-brownie_ + +### 5) Contact +If you want to apply to this position, please share your solution to our Solidity Challenge to the following email: jobs@exact.ly diff --git a/.history/README_20240317034603.md b/.history/README_20240317034603.md new file mode 100644 index 0000000..383aad5 --- /dev/null +++ b/.history/README_20240317034603.md @@ -0,0 +1,40 @@ +This is a [Next.js](https://nextjs.org/) project solving the solidity challenge (https://github.com/exactly/solidity-challenge), which I transformed into somekind of ETH Pool marketplace. + +Many more features to come in the future: stay tuned! + +## Overview + +Project has dependencies on multiple technologies. + +- [Pinata](https://app.pinata.cloud/) - store images, and ETH Pool metadata +- [Ganache](https://trufflesuite.com/ganache/) - private Blockchain, to run application localy + +## How To + +1. Clone the repository code. + +2. cd to the root directory of the project and run npm install. + +3. Configure the .env.development or .env.production file properly. + +4. Since we are deploying the demo on Sepolia Test Network, make sure you register for one and configure the file keys.json properly. + +5. I used Ganache to test the smart contracts locally: therefore remember to link truffle with your Ganache. + +6. While at the root directory of the project, use truffle to migrate and deploy the smart contracts on the Sepolia Test Network of the Ethereum blockchain. + +7. Then, use npm build to build the app. + +8. Finally, deploy the app and start enjoying your ETH Pool marketplace. + +## In Action + +![GAC Logo](https://geniusandcourage.com/favicon.ico) + +ETH Pool Market Place by [GAC DEV](https://geniusandcourage.com) + +![ETH Pool Market Place](https://hlwsdtech.com:8081/images/ETHPool.jpg) + +### 6) Where is the code? + +Email jobs@exact.ly or letmaf307@gmail.com to get the code. diff --git a/.history/README_20240317034620.md b/.history/README_20240317034620.md new file mode 100644 index 0000000..da0ff9b --- /dev/null +++ b/.history/README_20240317034620.md @@ -0,0 +1,40 @@ +This is a [Next.js](https://nextjs.org/) project solving the solidity challenge (https://github.com/exactly/solidity-challenge), which I transformed into somekind of ETH Pool marketplace. + +Many more features to come in the future: stay tuned! + +## Overview + +Project has dependencies on multiple technologies. + +- [Pinata](https://app.pinata.cloud/) - store images, and ETH Pool metadata +- [Ganache](https://trufflesuite.com/ganache/) - private Blockchain, to run application localy + +## How To + +1. Clone the repository code. + +2. cd to the root directory of the project and run npm install. + +3. Configure the .env.development or .env.production file properly. + +4. Since we are deploying the demo on Sepolia Test Network, make sure you register for one and configure the file keys.json properly. + +5. I used Ganache to test the smart contracts locally: therefore remember to link truffle with your Ganache. + +6. While at the root directory of the project, use truffle to migrate and deploy the smart contracts on the Sepolia Test Network of the Ethereum blockchain. + +7. Then, use npm build to build the app. + +8. Finally, deploy the app and start enjoying your ETH Pool marketplace. + +## In Action + +![GAC Logo](https://geniusandcourage.com/favicon.ico) + +ETH Pool Market Place by [GAC DEV](https://geniusandcourage.com) + +![ETH Pool Market Place](https://hlwsdtech.com:8081/images/ETHPool.jpg) + +### Where is the code? + +Email jobs@exact.ly or letmaf307@gmail.com to get the code. diff --git a/.history/README_20240317093719.md b/.history/README_20240317093719.md new file mode 100644 index 0000000..6696b96 --- /dev/null +++ b/.history/README_20240317093719.md @@ -0,0 +1,46 @@ +This is a [Next.js](https://nextjs.org/) project solving the solidity challenge (https://github.com/exactly/solidity-challenge), which I transformed into somekind of ETH Pool marketplace. + +## Contract Details + +Contract deployed on Euthereum Sepolia Test Network. + +transaction hash: 0x053f4d857be021a5a526f10dd364fb5d04234bf60f6c60a7f7cc6f667d5006e8 + +Many more features to come in the future: stay tuned! + +## Overview + +Project has dependencies on multiple technologies. + +- [Pinata](https://app.pinata.cloud/) - store images, and ETH Pool metadata +- [Ganache](https://trufflesuite.com/ganache/) - private Blockchain, to run application localy + +## How To + +1. Clone the repository code. + +2. cd to the root directory of the project and run npm install. + +3. Configure the .env.development or .env.production file properly. + +4. Since we are deploying the demo on Sepolia Test Network, make sure you register for one and configure the file keys.json properly. + +5. I used Ganache to test the smart contracts locally: therefore remember to link truffle with your Ganache. + +6. While at the root directory of the project, use truffle to migrate and deploy the smart contracts on the Sepolia Test Network of the Ethereum blockchain. + +7. Then, use npm build to build the app. + +8. Finally, deploy the app and start enjoying your ETH Pool marketplace. + +## In Action + +![GAC Logo](https://geniusandcourage.com/favicon.ico) + +ETH Pool Market Place by [GAC DEV](https://geniusandcourage.com) + +![ETH Pool Market Place](https://hlwsdtech.com:8081/images/ETHPool.jpg) + +### Where is the code? + +Email jobs@exact.ly or letmaf307@gmail.com to get the code. diff --git a/.history/README_20240317102300.md b/.history/README_20240317102300.md new file mode 100644 index 0000000..f970490 --- /dev/null +++ b/.history/README_20240317102300.md @@ -0,0 +1,46 @@ +This is a [Next.js](https://nextjs.org/) project solving the solidity challenge (https://github.com/exactly/solidity-challenge), which I transformed into somekind of ETH Pool marketplace. + +## Contract Details + +Contract deployed on Euthereum Sepolia Test Network and verified on Etherscan: https://sepolia.etherscan.io/ + +transaction hash: 0x053f4d857be021a5a526f10dd364fb5d04234bf60f6c60a7f7cc6f667d5006e8 + +Many more features to come in the future: stay tuned! + +## Overview + +Project has dependencies on multiple technologies. + +- [Pinata](https://app.pinata.cloud/) - store images, and ETH Pool metadata +- [Ganache](https://trufflesuite.com/ganache/) - private Blockchain, to run application localy + +## How To + +1. Clone the repository code. + +2. cd to the root directory of the project and run npm install. + +3. Configure the .env.development or .env.production file properly. + +4. Since we are deploying the demo on Sepolia Test Network, make sure you register for one and configure the file keys.json properly. + +5. I used Ganache to test the smart contracts locally: therefore remember to link truffle with your Ganache. + +6. While at the root directory of the project, use truffle to migrate and deploy the smart contracts on the Sepolia Test Network of the Ethereum blockchain. + +7. Then, use npm build to build the app. + +8. Finally, deploy the app and start enjoying your ETH Pool marketplace. + +## In Action + +![GAC Logo](https://geniusandcourage.com/favicon.ico) + +ETH Pool Market Place by [GAC DEV](https://geniusandcourage.com) + +![ETH Pool Market Place](https://hlwsdtech.com:8081/images/ETHPool.jpg) + +### Where is the code? + +Email jobs@exact.ly or letmaf307@gmail.com to get the code. diff --git a/.history/README_20240317111245.md b/.history/README_20240317111245.md new file mode 100644 index 0000000..84ab710 --- /dev/null +++ b/.history/README_20240317111245.md @@ -0,0 +1,46 @@ +This is a [Next.js](https://nextjs.org/) project solving the solidity challenge (https://github.com/exactly/solidity-challenge), which I transformed into somekind of ETH Pool marketplace. + +## Contract Details + +Contract deployed on Euthereum Sepolia Test Network and verified on Etherscan: https://sepolia.etherscan.io/ + +Contract: 0x57F5a2cF6127240257c953E2237f52e2F17E62a5 + +Many more features to come in the future: stay tuned! + +## Overview + +Project has dependencies on multiple technologies. + +- [Pinata](https://app.pinata.cloud/) - store images, and ETH Pool metadata +- [Ganache](https://trufflesuite.com/ganache/) - private Blockchain, to run application localy + +## How To + +1. Clone the repository code. + +2. cd to the root directory of the project and run npm install. + +3. Configure the .env.development or .env.production file properly. + +4. Since we are deploying the demo on Sepolia Test Network, make sure you register for one and configure the file keys.json properly. + +5. I used Ganache to test the smart contracts locally: therefore remember to link truffle with your Ganache. + +6. While at the root directory of the project, use truffle to migrate and deploy the smart contracts on the Sepolia Test Network of the Ethereum blockchain. + +7. Then, use npm build to build the app. + +8. Finally, deploy the app and start enjoying your ETH Pool marketplace. + +## In Action + +![GAC Logo](https://geniusandcourage.com/favicon.ico) + +ETH Pool Market Place by [GAC DEV](https://geniusandcourage.com) + +![ETH Pool Market Place](https://hlwsdtech.com:8081/images/ETHPool.jpg) + +### Where is the code? + +Email jobs@exact.ly or letmaf307@gmail.com to get the code. diff --git a/.history/README_20240317111817.md b/.history/README_20240317111817.md new file mode 100644 index 0000000..84ab710 --- /dev/null +++ b/.history/README_20240317111817.md @@ -0,0 +1,46 @@ +This is a [Next.js](https://nextjs.org/) project solving the solidity challenge (https://github.com/exactly/solidity-challenge), which I transformed into somekind of ETH Pool marketplace. + +## Contract Details + +Contract deployed on Euthereum Sepolia Test Network and verified on Etherscan: https://sepolia.etherscan.io/ + +Contract: 0x57F5a2cF6127240257c953E2237f52e2F17E62a5 + +Many more features to come in the future: stay tuned! + +## Overview + +Project has dependencies on multiple technologies. + +- [Pinata](https://app.pinata.cloud/) - store images, and ETH Pool metadata +- [Ganache](https://trufflesuite.com/ganache/) - private Blockchain, to run application localy + +## How To + +1. Clone the repository code. + +2. cd to the root directory of the project and run npm install. + +3. Configure the .env.development or .env.production file properly. + +4. Since we are deploying the demo on Sepolia Test Network, make sure you register for one and configure the file keys.json properly. + +5. I used Ganache to test the smart contracts locally: therefore remember to link truffle with your Ganache. + +6. While at the root directory of the project, use truffle to migrate and deploy the smart contracts on the Sepolia Test Network of the Ethereum blockchain. + +7. Then, use npm build to build the app. + +8. Finally, deploy the app and start enjoying your ETH Pool marketplace. + +## In Action + +![GAC Logo](https://geniusandcourage.com/favicon.ico) + +ETH Pool Market Place by [GAC DEV](https://geniusandcourage.com) + +![ETH Pool Market Place](https://hlwsdtech.com:8081/images/ETHPool.jpg) + +### Where is the code? + +Email jobs@exact.ly or letmaf307@gmail.com to get the code. diff --git a/.history/README_20240317111900.md b/.history/README_20240317111900.md new file mode 100644 index 0000000..84ab710 --- /dev/null +++ b/.history/README_20240317111900.md @@ -0,0 +1,46 @@ +This is a [Next.js](https://nextjs.org/) project solving the solidity challenge (https://github.com/exactly/solidity-challenge), which I transformed into somekind of ETH Pool marketplace. + +## Contract Details + +Contract deployed on Euthereum Sepolia Test Network and verified on Etherscan: https://sepolia.etherscan.io/ + +Contract: 0x57F5a2cF6127240257c953E2237f52e2F17E62a5 + +Many more features to come in the future: stay tuned! + +## Overview + +Project has dependencies on multiple technologies. + +- [Pinata](https://app.pinata.cloud/) - store images, and ETH Pool metadata +- [Ganache](https://trufflesuite.com/ganache/) - private Blockchain, to run application localy + +## How To + +1. Clone the repository code. + +2. cd to the root directory of the project and run npm install. + +3. Configure the .env.development or .env.production file properly. + +4. Since we are deploying the demo on Sepolia Test Network, make sure you register for one and configure the file keys.json properly. + +5. I used Ganache to test the smart contracts locally: therefore remember to link truffle with your Ganache. + +6. While at the root directory of the project, use truffle to migrate and deploy the smart contracts on the Sepolia Test Network of the Ethereum blockchain. + +7. Then, use npm build to build the app. + +8. Finally, deploy the app and start enjoying your ETH Pool marketplace. + +## In Action + +![GAC Logo](https://geniusandcourage.com/favicon.ico) + +ETH Pool Market Place by [GAC DEV](https://geniusandcourage.com) + +![ETH Pool Market Place](https://hlwsdtech.com:8081/images/ETHPool.jpg) + +### Where is the code? + +Email jobs@exact.ly or letmaf307@gmail.com to get the code. diff --git a/README.md b/README.md index 65948c8..84ab710 100644 --- a/README.md +++ b/README.md @@ -1,58 +1,46 @@ -# Smart Contract Challenge +This is a [Next.js](https://nextjs.org/) project solving the solidity challenge (https://github.com/exactly/solidity-challenge), which I transformed into somekind of ETH Pool marketplace. -## A) Challenge +## Contract Details -### 1) Setup a project and create a contract +Contract deployed on Euthereum Sepolia Test Network and verified on Etherscan: https://sepolia.etherscan.io/ -#### Summary +Contract: 0x57F5a2cF6127240257c953E2237f52e2F17E62a5 -ETHPool provides a service where people can deposit ETH and they will receive weekly rewards. Users must be able to take out their deposits along with their portion of rewards at any time. New rewards are deposited manually into the pool by the ETHPool team each week using a contract function. +Many more features to come in the future: stay tuned! -#### Requirements +## Overview -- Only the team can deposit rewards. -- Deposited rewards go to the pool of users, not to individual users. -- Users should be able to withdraw their deposits along with their share of rewards considering the time when they deposited. +Project has dependencies on multiple technologies. -Example: +- [Pinata](https://app.pinata.cloud/) - store images, and ETH Pool metadata +- [Ganache](https://trufflesuite.com/ganache/) - private Blockchain, to run application localy -> Let say we have user **A** and **B** and team **T**. -> -> **A** deposits 100, and **B** deposits 300 for a total of 400 in the pool. Now **A** has 25% of the pool and **B** has 75%. When **T** deposits 200 rewards, **A** should be able to withdraw 150 and **B** 450. -> -> What if the following happens? **A** deposits then **T** 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 sent to the pool before they participated. +## How To -#### Goal +1. Clone the repository code. -Design and code a contract for ETHPool, take all the assumptions you need to move forward. +2. cd to the root directory of the project and run npm install. -You can use any development tools you prefer: Hardhat, Truffle, Brownie, Solidity, Vyper. +3. Configure the .env.development or .env.production file properly. -Useful resources: +4. Since we are deploying the demo on Sepolia Test Network, make sure you register for one and configure the file keys.json properly. -- Solidity Docs: https://docs.soliditylang.org/en/v0.8.4 -- Educational Resource: https://github.com/austintgriffith/scaffold-eth -- Project Starter: https://github.com/abarmat/solidity-starter +5. I used Ganache to test the smart contracts locally: therefore remember to link truffle with your Ganache. -### 2) Write tests +6. While at the root directory of the project, use truffle to migrate and deploy the smart contracts on the Sepolia Test Network of the Ethereum blockchain. -Make sure that all your code is tested properly +7. Then, use npm build to build the app. -### 3) Deploy your contract +8. Finally, deploy the app and start enjoying your ETH Pool marketplace. -Deploy the contract to any Ethereum testnet of your preference. Keep record of the deployed address. +## In Action -Bonus: +![GAC Logo](https://geniusandcourage.com/favicon.ico) -- Verify the contract in Etherscan +ETH Pool Market Place by [GAC DEV](https://geniusandcourage.com) -### 4) Interact with the contract +![ETH Pool Market Place](https://hlwsdtech.com:8081/images/ETHPool.jpg) -Create a script (or a Hardhat task) to query the total amount of ETH held in the contract. +### Where is the code? -_You can use any library you prefer: Ethers.js, Web3.js, Web3.py, eth-brownie_ - -### 5) Contact -If you want to apply to this position, please share your solution to our Solidity Challenge to the following email: jobs@exact.ly +Email jobs@exact.ly or letmaf307@gmail.com to get the code.