{"id":18263748,"url":"https://github.com/yearn/yearn-recycle","last_synced_at":"2025-08-30T09:38:43.862Z","repository":{"id":43922464,"uuid":"288709657","full_name":"yearn/yearn-recycle","owner":"yearn","description":"dai/usdc/usdt/tusd/ycrv ➝ yusd","archived":false,"fork":false,"pushed_at":"2020-09-08T17:53:49.000Z","size":16,"stargazers_count":56,"open_issues_count":2,"forks_count":33,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-04-04T20:36:38.330Z","etag":null,"topics":["dai","ethereum","vyper","yearn-finance"],"latest_commit_sha":null,"homepage":"","language":"Python","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/yearn.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":"2020-08-19T11:08:33.000Z","updated_at":"2024-07-28T20:03:33.000Z","dependencies_parsed_at":"2022-09-15T17:02:04.335Z","dependency_job_id":null,"html_url":"https://github.com/yearn/yearn-recycle","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/yearn/yearn-recycle","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yearn%2Fyearn-recycle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yearn%2Fyearn-recycle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yearn%2Fyearn-recycle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yearn%2Fyearn-recycle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yearn","download_url":"https://codeload.github.com/yearn/yearn-recycle/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yearn%2Fyearn-recycle/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272833294,"owners_count":25000870,"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-08-30T02:00:09.474Z","response_time":77,"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":["dai","ethereum","vyper","yearn-finance"],"created_at":"2024-11-05T11:12:30.014Z","updated_at":"2025-08-30T09:38:43.843Z","avatar_url":"https://github.com/yearn.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Yearn Recycle\n\nA contract that recycles all your [DAI, USDC, USDT, TUSD, yCRV] into yCRV and further into yUSD vault.\n\n## Usage\n\nYou need to grant allowances on up to five tokens to this contract before using it. This needs to be done for all non-zero amount and it only needs to be done once.\n\n### Using Brownie\n\nUse the Brownie script to automatically set all approvals and recycle all your coins into yUSD.\n\n```python\n$ brownie accounts import user keystore.json\n$ brownie run recycle --network mainnet\n```\n\n### Using Etherscan\n\n1. Call `approve(0x5F07257145fDd889c6E318F99828E68A449A5c7A, 115792089237316195423570985008687907853269984665640564039457584007913129639935)` for all non-zero balances:\n- [DAI](https://etherscan.io/address/0x6B175474E89094C44Da98b954EedeAC495271d0F#writeContract)\n- [USDC](https://etherscan.io/address/0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48#writeProxyContract)\n- [USDT](https://etherscan.io/address/0xdAC17F958D2ee523a2206206994597C13D831ec7#writeContract)\n- [TUSD](https://etherscan.io/address/0x0000000000085d4780B73119b644AE5ecd22b376#writeProxyContract)\n- [yCRV](https://etherscan.io/address/0xdF5e0e81Dff6FAF3A7e52BA697820c5e32D806A8#writeContract)\n\n2. Call `recycle()` [here](https://etherscan.io/address/0x5F07257145fDd889c6E318F99828E68A449A5c7A#writeContract).\n\n## Deployments\n\n### v0.2.0\n`0x5F07257145fDd889c6E318F99828E68A449A5c7A`\n\n- Add support for yCRV deposits\n- Add a Brownie script to set the needed approvals and recycle\n- Honor allowances in `recycle()`, deposit `min(balance, allowance)`\n- Add an ability to recycle custom amounts with `recycle_exact(dai, usdc, usdt, tusd, ycrv)`\n\nReviewed by:\n- @iamdefinitelyahuman\n\n### v0.1.0\n`0x78e307F6e8584DaA0D85aDD918c0e3e4dD469A9C`\n\nInitial release, features `recycle()` function which converts [DAI, USDC, USDT, TUSD] to yUSD.\n\nReviewed by:\n- @samczsun\n- @andrecronje\n- @vshvsh\n\n## Frontends\n\nTBD\n\n### Integration caveats\n\nCheck for `token.balanceOf(user)` and `token.allowance(user, recycle)` for each of DAI, USDC, USDT, TUSD, yCRV\n\nFor tokens with non-zero balances and `balance \u003e allowance`, call `token.approve(recycle, MAX_UINT256)`\n\nAt this point you can call `recycle.recycle()`\n\nYou can get the exact amounts in and out from the transaction receipt event called `Recycled(user, sent_dai, sent_usdc, sent_usdt, sent_tusd, sent_ycrv, received_yusd)`\n\nYou can also allow depositing partial amounts (sliders?) or skipping some of the coins (checkboxes?). For this you need to calculate the exact amounts and pass them into `recycle.recycle_exact(dai, usdc, usdt, tusd, ycrv)`\n\nNote that USDT is not ERC20-compliant, it doesn't return bool for `approve` and also requires first resetting the `allowance` to zero before changing it to another value.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyearn%2Fyearn-recycle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyearn%2Fyearn-recycle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyearn%2Fyearn-recycle/lists"}