{"id":17596265,"url":"https://github.com/saucepoint/super-erc4626-example","last_synced_at":"2025-09-02T01:33:16.404Z","repository":{"id":65411723,"uuid":"588251965","full_name":"saucepoint/super-ERC4626-example","owner":"saucepoint","description":"Experimental hybrid/cross-chain ERC4626 vaults","archived":false,"fork":false,"pushed_at":"2023-01-20T01:36:17.000Z","size":119,"stargazers_count":51,"open_issues_count":0,"forks_count":5,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-30T06:43:33.706Z","etag":null,"topics":["4626","arbitrum","erc4626","l2","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/saucepoint.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}},"created_at":"2023-01-12T17:27:04.000Z","updated_at":"2025-04-29T04:44:51.000Z","dependencies_parsed_at":"2023-02-11T23:01:22.500Z","dependency_job_id":null,"html_url":"https://github.com/saucepoint/super-ERC4626-example","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":"transmissions11/foundry-template","purl":"pkg:github/saucepoint/super-ERC4626-example","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saucepoint%2Fsuper-ERC4626-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saucepoint%2Fsuper-ERC4626-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saucepoint%2Fsuper-ERC4626-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saucepoint%2Fsuper-ERC4626-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/saucepoint","download_url":"https://codeload.github.com/saucepoint/super-ERC4626-example/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saucepoint%2Fsuper-ERC4626-example/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273218428,"owners_count":25065913,"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-01T02:00:09.058Z","response_time":120,"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":["4626","arbitrum","erc4626","l2","solidity"],"created_at":"2024-10-22T08:24:39.190Z","updated_at":"2025-09-02T01:33:16.351Z","avatar_url":"https://github.com/saucepoint.png","language":"Solidity","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Super ERC-4626 • [![CI](https://github.com/saucepoint/super-ERC4626-example/actions/workflows/tests.yml/badge.svg)](https://github.com/saucepoint/super-ERC4626-example/actions/workflows/tests.yml)\n\nSupercharging ERC-4626 tokens on Arbitrum:\n\n1) Underlying assets \u0026 value accrual live on L1 (mainnet)\n    1) L1 can offer diverse and robust yield opportunities\n\n2) Tokens are *canonically L2* (Arbitrum) for **affordable** utilization:\n    1) **Deposit into the vaults from L2**\n    1) Transfer, trade, and exchange the tokens on L2\n    1) Exchange rate is correctly observable on L2 (with some latency)\n    1) Ideally use vaults in composable systems -- i.e. lending (?)\n\n---\n\nThis repo is intended to be an educational application of Arbitrum's cross-chain messaging (L1 \u003c--\u003e L2); you should reference their [tutorial](https://github.com/OffchainLabs/arbitrum-tutorials/tree/master/packages/greeter) as an additional example\n\nMain difference is:\n\n1) **This repo uses on `foundry` (forge + cast) instead of javascript**\n\n2) This repo offers clearer distinction between L1-to-L2 and L2-to-L1 messaging. 4626 Vaults also offer of a real world use-case of cross-chain messaging.\n\n\u003e Note: this example does not contain mechanisms to guarantee ERC-4626 redemption liquidity. Proceed with caution when using in production\n\n---\n\n## Note on Cross-chain Testing in Foundry\nCross-chain messaging is handled at the node level (nitro nodes know to communicate to a corresponding L1 node), the core messaging logic *cannot* be tested with `forge test`\n\nInstead, run Arbitrum local dev node(s) (nitro + geth) to execute `forge scripts` against the two nodes\n```\nRun L1 + L2 local nodes with Docker: https://developer.arbitrum.io/node-running/local-dev-node\n```\n\n1. Messaging occurs over the course of a few blocks, so testing the functionality will occur over multiple scripts. **See `scripts/` and `/scripts/local.sh`**\n\n2. L2-to-L1 messages takes 7 days (on mainnet / production)\n    - Modify the confirmation time of our local nodes to be 1 block instead\n        `scripts/local.sh`\n        ```bash\n        # Set the challenge period to be 1 block for testing L2 --\u003e L1 messages\n        # (normally its a week!)\n        cast send 0x65a59d67da8e710ef9a01eca37f83f84aedec416 \"setConfirmPeriodBlocks(uint64)\" 1 \\\n            --rpc-url $mainnetRPC \\\n            --private-key $rollupPK\n        ```\n\n2. Custom opcodes by Arbitrum (i.e. `arbsys.withdrawEth()`) are not supported within `forge scripts`. Contract functions which send messages from L2 to L1 are handled with `cast`\n    \n    `scripts/local.sh`\n    ```bash\n    # Simulating L2 --\u003e L1 message (sweepToL1)\n    # Need to use cast since arbsys.withdrawEth uses a custom opcode\n    # which foundry EVM does not recognize\n    cast send $ARB_VAULT \"sweepToL1()\" \\\n        --rpc-url $arbitrumRPC \\\n        --private-key $arbPK\n    ```\n\n## Testing\n\nRun Cross-chain messaging tests \u0026 integration\n```bash\n# start the L1 geth and L2 nitro dev nodes\n# (in the offchainlabs/nitro repository)\n./test-node.bash\n\n# Execute forge scripts \u0026 cast calls, from the repository root\n# Non-blocking script, so you should monitor the output for errors\n./scripts/local.sh\n```\n\nRun solidity/vault tests\n```\nforge test\n```\n\n---\n\n## Contributing \u0026 Setup\n\nYou will need a copy of [Foundry](https://github.com/foundry-rs/foundry) installed before proceeding. See the [installation guide](https://github.com/foundry-rs/foundry#installation) for details.\n\n```sh\ngit clone https://github.com/saucepoint/super-ERC4626-example\ncd super-ERC4626-example\n\nforge install\n\n# Recommended to use node v16 to install arbitrum dependencies\nnpm install\n\n# install jq on Linux\nsudo apt install jq\n\n# install jq on Mac\nbrew install jq\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaucepoint%2Fsuper-erc4626-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsaucepoint%2Fsuper-erc4626-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaucepoint%2Fsuper-erc4626-example/lists"}