{"id":23390485,"url":"https://github.com/rootulp/eth-pool","last_synced_at":"2025-06-13T18:08:50.504Z","repository":{"id":77614921,"uuid":"472120344","full_name":"rootulp/eth-pool","owner":"rootulp","description":"Solidity learning exercise","archived":false,"fork":false,"pushed_at":"2022-03-22T04:05:08.000Z","size":40,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-08T14:21:24.427Z","etag":null,"topics":["solidity"],"latest_commit_sha":null,"homepage":"","language":"Solidity","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rootulp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-03-20T22:41:19.000Z","updated_at":"2022-03-23T01:59:09.000Z","dependencies_parsed_at":null,"dependency_job_id":"8f1fe8b0-98dc-4b81-bb4b-67b88fa2cfe9","html_url":"https://github.com/rootulp/eth-pool","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/rootulp/eth-pool","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rootulp%2Feth-pool","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rootulp%2Feth-pool/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rootulp%2Feth-pool/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rootulp%2Feth-pool/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rootulp","download_url":"https://codeload.github.com/rootulp/eth-pool/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rootulp%2Feth-pool/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259695307,"owners_count":22897513,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["solidity"],"created_at":"2024-12-22T03:31:36.660Z","updated_at":"2025-06-13T18:08:50.482Z","avatar_url":"https://github.com/rootulp.png","language":"Solidity","funding_links":[],"categories":[],"sub_categories":[],"readme":"# eth-pool\n\n[![License](https://img.shields.io/:license-mit-blue.svg)](https://rootulp.mit-license.org)\n\nEthPool is a learning exercise motivated by this [challenge](./challenge.md). The goal is to write a contract (named \"EthPool\") that allows users to deposit and withdraw ETH from. Occasionally, a pool operator will deposit rewards (also denominated in ETH) into the pool. Rewards are distributed to depositors based on their percentage share of the pool.\n\n## Examples\n\n### Example 1\n1. Alice deposits 1 ETH.\n1. Bob deposits 1 ETH.\n1. Operator deposits 1 ETH of rewards in the pool. Since Alice and Bob both have 50% ownership of the pool, they both receive 50% of the rewards (.5 ETH).\n1. Alice can withdraw 1.5 ETH and Bob can withdraw 1.5 ETH.\n\n### Example 2\n\n1. Alice deposits 1 ETH.\n1. Bob deposits 3 ETH.\n1. Operator deposits 1 ETH of rewards in the pool. Alice recieves .25 ETH and Bob receives .75 ETH.\n1. Alice can withdraw 1.25 ETH and Bob can withdraw 3.75 ETH.\n\n## Local Development\n\n### Prerequisites\n\n1. Clone this repo\n1. Create a project on [Alchemy](https://www.alchemy.com/)\n1. Create an API key on [Etherscan](https://etherscan.io/myapikey)\n\n### Initial Setup\n\n```sh\n# Install git submodule dependencies\nforge install\n\n# Copy the default .env file\ncp .env.default .env\n\n# Populate .env with ETH_RPC_URL from Alchemy and PRIVATE_KEY from a testnet wallet\nvim .env\n\n# Source the .env file\nsource .env\n```\n\n### Helpful Commands\n\n```sh\n# Build\nforge build\n\n# Test\nforge test\n\n# Deploy contract\nforge create --rpc-url $ETH_RPC_URL --private-key $PRIVATE_KEY src/EthPool.sol:EthPool\n\n# Verify on Etherscan\nforge verify-contract --chain-id $CHAIN_ID --num-of-optimizations 200 --compiler-version $COMPILER_VERSION $CONTRACT_ADDRESS src/EthPool.sol:EthPool $ETHERSCAN_API_KEY\n```\n\n## Deployments\n\nNetwork | Address\n------- | -------\nGoerli  | 0x69727e6c77dff8d16537887b8ebe0609f8548c35\n\n## To-do\n\n- [ ] Consider refactoring EthPool to not use a dynamically sized array\n\n## Contribute\n\nI'd appreciate any feedback via [issues](https://github.com/rootulp/eth-pool/issues/new).\n\n## Acknowledgements\n\n- https://github.com/gakonst/foundry\n- https://github.com/OpenZeppelin/openzeppelin-contracts\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frootulp%2Feth-pool","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frootulp%2Feth-pool","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frootulp%2Feth-pool/lists"}