{"id":18263708,"url":"https://github.com/yearn/tokenized-strategy","last_synced_at":"2025-04-04T18:04:39.444Z","repository":{"id":107048184,"uuid":"599287778","full_name":"yearn/tokenized-strategy","owner":"yearn","description":"Contains the Contracts for the Yearn V3 Tokenized Strategy Implementation","archived":false,"fork":false,"pushed_at":"2024-10-31T21:07:25.000Z","size":1013,"stargazers_count":126,"open_issues_count":2,"forks_count":50,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-03-28T17:07:56.481Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Solidity","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yearn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":"audits/06-2023-Yearn-Vault-V3_yAcademy_Reports.pdf","citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-02-08T20:42:41.000Z","updated_at":"2025-03-20T07:58:52.000Z","dependencies_parsed_at":"2024-02-05T00:30:18.486Z","dependency_job_id":"87e7be1b-bf62-4c3b-ad96-7bb1581041f8","html_url":"https://github.com/yearn/tokenized-strategy","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yearn%2Ftokenized-strategy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yearn%2Ftokenized-strategy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yearn%2Ftokenized-strategy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yearn%2Ftokenized-strategy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yearn","download_url":"https://codeload.github.com/yearn/tokenized-strategy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247226213,"owners_count":20904465,"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":[],"created_at":"2024-11-05T11:12:23.486Z","updated_at":"2025-04-04T18:04:39.421Z","avatar_url":"https://github.com/yearn.png","language":"Solidity","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# Yearn Tokenized Strategy\n\nThis repository contains the base code for the Yearn V3 \"Tokenized Strategy\" implementation. The V3 strategy implementation utilizes an immutable proxy pattern to allow anyone to easily create their own single strategy 4626 vault. All Tokenized Strategies will use the logic held within the `TokenizedStrategy` for their redundant and high risk code. The implementation holds all ERC-20, ERC-4626, profit locking and reporting functionality to make any strategy that uses it a fully permissionless vault without holding any of this logic itself. \n\nThe implementation address that calls are delegated to is pre-set to a constant and can never be changed post deployment. The implementation contract itself is ownerless and can never be updated in any way.\n\nNOTE: The master branch has these pre-set addresses set based on the deterministic address that testing on a local device will render. These contracts should NOT be used in production and any live versions should use an official [release](https://github.com/yearn/tokenized-strategy/releases).\n\nA Strategy contract can become a fully ERC-4626 compliant vault by inheriting the `BaseStrategy` contract, that uses the fallback function to delegateCall the previously deployed version of `TokenizedStrategy`. A strategist then only needs to override three simple functions in their specific strategy.\n\n[TokenizedStrategy](https://github.com/yearn/tokenized-strategy/blob/master/src/TokenizedStrategy.sol) - The implementation contract that holds all logic for every strategy.\n\n[BaseStrategy](https://github.com/yearn/tokenized-strategy/blob/master/src/BaseStrategy.sol) - Abstract contract to inherit that communicates with the `TokenizedStrategy`.\n\nFull tech spech can be found [here](https://github.com/yearn/tokenized-strategy/blob/master/SPECIFICATION.md)\n\n## Installation and Setup\n\n1. First you will need to install [Foundry](https://book.getfoundry.sh/getting-started/installation).\nNOTE: If you are on a windows machine it is recommended to use [WSL](https://learn.microsoft.com/en-us/windows/wsl/install)\n\n2. Fork this repository (easier) or create a new repository using it as template. [Create from template](https://docs.github.com/en/repositories/creating-and-managing-repositories/creating-a-repository-from-a-template)\n\n3. Clone your newly created repository recursively to include modules.\n\n```sh\ngit clone --recursive https://github.com/myuser/tokenized-strategy\n\ncd tokenized-strategy\n```\n\nNOTE: if you create from template you may need to run the following command to fetch the git sub modules (.gitmodules for exact releases) `git submodule init \u0026\u0026 git submodule update`\n\n4. Build the project.\n\n```sh\nmake build\n```\nTo print the size of each contract\n```sh\nmake size\n```\n\n5. Run tests\nNOTE: Tests will take a significant period of time since the fuzzer is set to 10,000 runs.\n```sh\nmake test\n```\n\n## Testing\n\nRun all tests run on a local chain\n\n```sh\nmake test\n```\nRun all tests with traces (very useful)\n\n```sh\nmake trace\n```\nRun all tests with gas outputs\n\n```sh\nmake gas\n```\nRun specific test contract with traces (e.g. `test/StrategyOperation.t.sol`)\n\n```sh\nmake trace-contract contract=StrategyOperationsTest\n```\nRun specific test with traces (e.g. `test/StrategyOperation.t.sol::testStrategy`)\n\n```sh\nmake trace-test test=testStrategy\n```\n\nSee here for some tips on testing [`Testing Tips`](https://book.getfoundry.sh/forge/tests.html)\n\n## Storage Layout\n\nTo print out the storage layout of any contract (e.g 'test/MockStrategy.sol')\n\n```sh\nmake inspect contract=MockStrategy\n```\n\n## Deployment\n\nDeployments of the TokenizedStrategy are done using create2 to be at a deterministic address on any EVM chain.\n\nCheck the [docs](https://docs.yearn.fi/developers/v3/overview) for the most updated deployment address.\n\nDeployments on new chains can be done permissionlessly by anyone using the included script. First follow the steps to deploy the vault factory from the [Vaults V3](https://github.com/yearn/yearn-vaults-v3/) repo.\n\nYou can then deploy the TokenizedStrategy using the provided script.\n\n```\nforge script script/Deploy.s.sol:Deploy --account ACCOUNT_NAME --rpc-url YOUR_RPC_URL --broadcast\n```\n\nIf the deployments do not end at the same address you can also manually send the calldata used in the previous deployments on other chains.\n\n### To make contributions please follow the [Contribution Guidelines](https://github.com/yearn/tokenized-strategy/blob/master/CONTRIBUTING.md)\n\n# Resources\n\n- [Getting help on Foundry](https://github.com/gakonst/foundry#getting-help)\n- [Forge Standard Lib](https://github.com/brockelmore/forge-std)\n- [Awesome Foundry](https://github.com/crisgarner/awesome-foundry)\n- [Foundry Book](https://book.getfoundry.sh/)\n- [Learn Foundry Tutorial](https://www.youtube.com/watch?v=Rp_V7bYiTCM)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyearn%2Ftokenized-strategy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyearn%2Ftokenized-strategy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyearn%2Ftokenized-strategy/lists"}