{"id":22416287,"url":"https://github.com/bunsdev/chainlink-hooks","last_synced_at":"2026-03-10T05:31:06.453Z","repository":{"id":254678194,"uuid":"846382421","full_name":"BunsDev/chainlink-hooks","owner":"BunsDev","description":null,"archived":false,"fork":false,"pushed_at":"2024-08-25T07:50:02.000Z","size":54,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-12T14:37:32.969Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BunsDev.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":"2024-08-23T05:01:26.000Z","updated_at":"2024-09-08T13:16:49.000Z","dependencies_parsed_at":"2024-08-25T10:04:07.861Z","dependency_job_id":null,"html_url":"https://github.com/BunsDev/chainlink-hooks","commit_stats":null,"previous_names":["bunsdev/chainlink-hooks"],"tags_count":0,"template":false,"template_full_name":"BunsDev/v4-hooks-template","purl":"pkg:github/BunsDev/chainlink-hooks","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BunsDev%2Fchainlink-hooks","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BunsDev%2Fchainlink-hooks/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BunsDev%2Fchainlink-hooks/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BunsDev%2Fchainlink-hooks/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BunsDev","download_url":"https://codeload.github.com/BunsDev/chainlink-hooks/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BunsDev%2Fchainlink-hooks/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30326058,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-10T05:25:20.737Z","status":"ssl_error","status_checked_at":"2026-03-10T05:25:17.430Z","response_time":106,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":"2024-12-05T15:15:37.750Z","updated_at":"2026-03-10T05:31:06.407Z","avatar_url":"https://github.com/BunsDev.png","language":"Solidity","funding_links":[],"categories":[],"sub_categories":[],"readme":"# v4-template\n### **A template for writing Uniswap v4 Hooks 🦄**\n\n[`Use this Template`](https://github.com/uniswapfoundation/v4-template/generate)\n\n1. The example hook [SwapHook.sol](src/SwapHook.sol) demonstrates the `beforeSwap()` and `afterSwap()` hooks\n2. The test template [SwapHook.t.sol](test/SwapHook.t.sol) preconfigures the v4 pool manager, test tokens, and test liquidity.\n\n\u003cdetails\u003e\n\u003csummary\u003eUpdating to v4-template:latest\u003c/summary\u003e\n\nThis template is actively maintained -- you can update the v4 dependencies, scripts, and helpers: \n```bash\ngit remote add template https://github.com/uniswapfoundation/v4-template\ngit fetch template\ngit merge template/main \u003cBRANCH\u003e --allow-unrelated-histories\n```\n\n\u003c/details\u003e\n\n---\n\n## Check Forge Installation\n*Ensure that you have correctly installed Foundry (Forge) and that it's up to date. You can update Foundry by running:*\n\n```\nfoundryup\n```\n\n## Setup\n\n*requires [foundry](https://book.getfoundry.sh)*\n\n```\nforge install\nforge test\n```\n\n### Local Development (Anvil)\n\nOther than writing unit tests (recommended!), you can only deploy \u0026 test hooks on [anvil](https://book.getfoundry.sh/anvil/)\n\n```bash\n# start anvil, a local EVM chain\nanvil\n\n# in a new terminal\nforge script script/Anvil.s.sol \\\n    --rpc-url http://localhost:8545 \\\n    --private-key 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 \\\n    --broadcast\n```\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003ch3\u003eTestnets\u003c/h3\u003e\u003c/summary\u003e\n\nNOTE: 11/21/2023, the Goerli deployment is out of sync with the latest v4. **It is recommend to use local testing instead**\n\n~~For testing on Goerli Testnet the Uniswap Foundation team has deployed a slimmed down version of the V4 contract (due to current contract size limits) on the network.~~\n\n~~The relevant addresses for testing on Goerli are the ones below~~\n\n```bash\nPOOL_MANAGER = 0x0\nPOOL_MODIFY_POSITION_TEST = 0x0\nSWAP_ROUTER = 0x0\n```\n\nUpdate the following command with your own private key:\n\n```\nforge script script/00_Counter.s.sol \\\n--rpc-url https://rpc.ankr.com/eth_goerli \\\n--private-key [your_private_key_on_goerli_here] \\\n--broadcast\n```\n\n### *Deploying your own Tokens For Testing*\n\nBecause V4 is still in testing mode, most networks don't have liquidity pools live on V4 testnets. We recommend launching your own test tokens and expirementing with them that. We've included in the templace a Mock UNI and Mock USDC contract for easier testing. You can deploy the contracts and when you do you'll have 1 million mock tokens to test with for each contract. See deployment commands below\n\n```\nforge create script/mocks/mUNI.sol:MockUNI \\\n--rpc-url [your_rpc_url_here] \\\n--private-key [your_private_key_on_goerli_here]\n```\n\n```\nforge create script/mocks/mUSDC.sol:MockUSDC \\\n--rpc-url [your_rpc_url_here] \\\n--private-key [your_private_key_on_goerli_here]\n```\n\n\u003c/details\u003e\n\n---\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003ch2\u003eTroubleshooting\u003c/h2\u003e\u003c/summary\u003e\n\n\n\n### *Permission Denied*\n\nWhen installing dependencies with `forge install`, Github may throw a `Permission Denied` error\n\nTypically caused by missing Github SSH keys, and can be resolved by following the steps [here](https://docs.github.com/en/github/authenticating-to-github/connecting-to-github-with-ssh) \n\nOr [adding the keys to your ssh-agent](https://docs.github.com/en/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent#adding-your-ssh-key-to-the-ssh-agent), if you have already uploaded SSH keys\n\n### Hook deployment failures\n\nHook deployment failures are caused by incorrect flags or incorrect salt mining\n\n1. Verify the flags are in agreement:\n    * `getHookCalls()` returns the correct flags\n    * `flags` provided to `HookMiner.find(...)`\n2. Verify salt mining is correct:\n    * In **forge test**: the *deploye*r for: `new Hook{salt: salt}(...)` and `HookMiner.find(deployer, ...)` are the same. This will be `address(this)`. If using `vm.prank`, the deployer will be the pranking address\n    * In **forge script**: the deployer must be the CREATE2 Proxy: `0x4e59b44847b379578588920cA78FbF26c0B4956C`\n        * If anvil does not have the CREATE2 deployer, your foundry may be out of date. You can update it with `foundryup`\n\n\u003c/details\u003e\n\n---\n\nAdditional resources:\n\n[v4-periphery](https://github.com/uniswap/v4-periphery) contains advanced hook implementations that serve as a great reference\n\n[v4-core](https://github.com/uniswap/v4-core)\n\n[v4-by-example](https://v4-by-example.org)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbunsdev%2Fchainlink-hooks","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbunsdev%2Fchainlink-hooks","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbunsdev%2Fchainlink-hooks/lists"}