{"id":30810432,"url":"https://github.com/pushchain/pc-yield-contracts","last_synced_at":"2025-09-06T05:12:31.694Z","repository":{"id":312889636,"uuid":"1037553274","full_name":"pushchain/pc-yield-contracts","owner":"pushchain","description":"Yield Farm contracts for PC Token","archived":false,"fork":false,"pushed_at":"2025-09-02T15:33:58.000Z","size":18,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-02T17:30:35.292Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Solidity","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pushchain.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-08-13T18:44:37.000Z","updated_at":"2025-09-02T15:34:01.000Z","dependencies_parsed_at":"2025-09-02T17:30:39.527Z","dependency_job_id":"4f1bdbab-af46-41d4-a9e3-c9794d7cc12d","html_url":"https://github.com/pushchain/pc-yield-contracts","commit_stats":null,"previous_names":["pushchain/pc-yield-contracts"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/pushchain/pc-yield-contracts","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pushchain%2Fpc-yield-contracts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pushchain%2Fpc-yield-contracts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pushchain%2Fpc-yield-contracts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pushchain%2Fpc-yield-contracts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pushchain","download_url":"https://codeload.github.com/pushchain/pc-yield-contracts/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pushchain%2Fpc-yield-contracts/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273858876,"owners_count":25180772,"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","status":"online","status_checked_at":"2025-09-06T02:00:13.247Z","response_time":2576,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2025-09-06T05:12:28.578Z","updated_at":"2025-09-06T05:12:31.683Z","avatar_url":"https://github.com/pushchain.png","language":"Solidity","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PC Yield Contracts\n\nSmart contracts for yield farming on Push Chain (PC) token ecosystem.\n\n## Architecture\n\nThree staking contracts for different yield farming scenarios:\n\n1. **MigrationYieldFarm** - Epoch-based staking with migration incentives\n2. **RewardSeasonsYieldFarm** - Seasonal staking with snapshot-based rewards  \n3. **LPYield/UniswapV3Staker** - LP position staking for Uniswap V3\n\n## Prerequisites\n\n```bash\n# Install Foundry\ncurl -L https://foundry.paradigm.xyz | bash\nfoundryup\n\n# Install Node.js dependencies for Merkle tree generation\nnpm install\n```\n\n## Setup\n\n```bash\n# Install Foundry dependencies\nforge install\n\n# Build all contracts\nforge build\n\n# Run all tests\nforge test\n```\n\n## Contract Specifications\n\n### MigrationYieldFarm\n- Lock period: 90 days (3 months)\n- Epoch duration: 21 days\n- Cooldown: 1 epoch (21 days)\n- Features: Merkle whitelist, epoch-based rewards, migration tracking, upgradeable\n\n### RewardSeasonsYieldFarm\n- Season duration: 90 days (3 months)\n- Lock period: Full season (no early unstaking)\n- Cooldown: 7 days (configurable)\n- Features: Merkle whitelist with multipliers, season-end snapshot, combined harvest+unstake\n\n### LPYield/UniswapV3Staker\n- Incentive duration: Up to 90 days\n- Features: Real-time rewards, time-weighted distribution, multiple incentives, direct LP staking\n\n## Deployment\n\n### MigrationYieldFarm\n```bash\n# Update script/DeployMigrationYieldFarm.s.sol with:\n# - merkleRoot: Whitelist merkle root\n# - owner_: Admin address\n# - lockDays: Lock period (default: 90)\n# - cooldownEpochs: Cooldown in epochs (default: 1)\n# - rewardsDays: Epoch duration (default: 21)\n\nforge script script/DeployMigrationYieldFarm.s.sol \\\n  --rpc-url \u003cyour-rpc-url\u003e \\\n  --private-key \u003cyour-private-key\u003e \\\n  --broadcast\n```\n\n### RewardSeasonsYieldFarm\n```bash\n# Update script/DeployRewardSeasonsYieldFarm.s.sol with:\n# - merkleRoot: Whitelist merkle root\n# - owner_: Admin address\n# - lockPeriod: Season duration (default: 90 days)\n# - cooldownPeriod: Cooldown period (default: 7 days)\n\nforge script script/DeployRewardSeasonsYieldFarm.s.sol \\\n  --rpc-url \u003cyour-rpc-url\u003e \\\n  --private-key \u003cyour-private-key\u003e \\\n  --broadcast\n```\n\n### LPYield/UniswapV3Staker\n```bash\n# Update script/DeployLPYield.s.sol with:\n# - factory: Push Chain Uniswap V3 Factory address\n# - positionManager: Push Chain Position Manager address\n# - maxIncentiveStartLeadTime: Max advance notice (default: 30 days)\n# - maxIncentiveDuration: Max incentive duration (default: 90 days)\n\nforge script script/DeployLPYield.s.sol \\\n  --rpc-url \u003cyour-rpc-url\u003e \\\n  --private-key \u003cyour-private-key\u003e \\\n  --broadcast\n```\n\n## Testing\n\n### Run All Tests\n```bash\nforge test\nforge test -v\nforge test --gas-report\n```\n\n### Contract-Specific Tests\n```bash\n# MigrationYieldFarm\nforge test --match-contract MigrationYieldFarmTest\n\n# RewardSeasonsYieldFarm\nforge test --match-contract RewardSeasonsYieldFarmTest\n\n# LPYield/UniswapV3Staker\nforge test --match-contract UniswapV3StakerForkTest\n```\n\n### Function-Specific Tests\n```bash\nforge test --match-test test_Stake_NewUser\nforge test --match-test test_CompleteRealLifecycleStaking\nforge test --match-test test_ReentrancyProtection_Complete\n\n# Pattern matching\nforge test --match-test \"test_Stake*\"\nforge test --match-test \"*Security*\"\n```\n\n### Fork Testing\nLPYield tests use real Push Chain testnet fork and take longer due to network interaction.\n\n## Merkle Tree Generation\n\n### MigrationYieldFarm Whitelist\n```bash\ncd scripts\nnode generate-merkle.js\n```\n\n### RewardSeasonsYieldFarm Whitelist\n```bash\ncd scripts\nnode generate-reward-merkle.js\n```\n\n### Customize Whitelist\nEdit the `claims` array in the respective script files:\n```javascript\nconst claims = [\n  {\n    address: \"0x...\", // User address\n    amount: \"1000000000000000000\", // Stake amount (wei)\n    epoch: 1 // Migration epoch\n  }\n  // Add more users...\n];\n```\n\n## Development Commands\n\n### Build\n```bash\nforge build\nforge build --contracts src/MigrationYieldFarm.sol\nforge build --use solc:0.8.23\n```\n\n### Code Quality\n```bash\nforge lint\nforge fmt\nforge inspect --pretty\n```\n\n### Gas Analysis\n```bash\nforge test --match-contract RewardSeasonsYieldFarmTest --gas-report\nforge snapshot\n```\n\n## Production Deployment\n\n### Pre-Deployment Checklist\n- [ ] Update merkle root in deployment scripts\n- [ ] Set correct owner address\n- [ ] Verify RPC endpoint and network\n- [ ] Test deployment on testnet first\n- [ ] Verify contract addresses on explorer\n- [ ] Test all admin functions\n- [ ] Verify merkle proof verification\n\n### Post-Deployment\n- [ ] Verify contract initialization\n- [ ] Test staking with valid merkle proofs\n- [ ] Test reward distribution\n- [ ] Test admin functions\n- [ ] Monitor for any issues\n- [ ] Document deployed addresses\n\n## Repository Structure\n\n```\n├── src/\n│   ├── MigrationYieldFarm.sol          # Epoch-based staking\n│   ├── RewardSeasonsYieldFarm.sol      # Seasonal staking\n│   └── LPYield/\n│       ├── UniswapV3Staker.sol         # LP position staking\n│       ├── interfaces/                  # Contract interfaces\n│       └── libraries/                   # Utility libraries\n├── script/\n│   ├── DeployMigrationYieldFarm.s.sol  # Migration deployment\n│   ├── DeployRewardSeasonsYieldFarm.s.sol # Seasonal deployment\n│   └── DeployLPYield.s.sol             # LP staking deployment\n├── test/\n│   ├── MigrationYieldFarm.t.sol        # Migration tests\n│   ├── RewardSeasonsYieldFarm.t.sol    # Seasonal tests\n│   └── UniswapV3StakerFork.t.sol      # LP staking tests\n├── scripts/\n│   ├── generate-merkle.js              # Migration whitelist\n│   └── generate-reward-merkle.js       # Seasonal whitelist\n└── foundry.toml                        # Foundry configuration\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpushchain%2Fpc-yield-contracts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpushchain%2Fpc-yield-contracts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpushchain%2Fpc-yield-contracts/lists"}