1inch/farming ? reverse-engineered prompt
Reverse engineered prompt
Build me the 1inch style farming contracts project so I can reward users who hold or stake a token over time.
I want the contracts to let a token support farming through hooks, so users can just hold the token in their wallet and automatically earn rewards, and I also want the older pool based version where users deposit and withdraw tokens to participate. Please make the reward math work over time, handle users joining, leaving, and changing balances, and let rewards be claimed even after someone has exited.
Set it up with solid tests for the main farming flows, including starting a farm, adding and removing a farm, reward distribution across different periods, and claim behavior. Make sure the project is easy to install and use from another Solidity project, with a simple example of extending the hooked token contract. If you need current package or tooling details, look them up online and follow the repo conventions.
Are you gonna build this?
make sure you review the code using coderabbit