Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

dai/usdc/usdt/tusd/ycrv ➝ yusd

License

NotificationsYou must be signed in to change notification settings

yearn/yearn-recycle

Repository files navigation

A contract that recycles all your [DAI, USDC, USDT, TUSD, yCRV] into yCRV and further into yUSD vault.

Usage

You 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.

Using Brownie

Use the Brownie script to automatically set all approvals and recycle all your coins into yUSD.

$brownieaccountsimportuserkeystore.json$brownierunrecycle--networkmainnet

Using Etherscan

  1. Callapprove(0x5F07257145fDd889c6E318F99828E68A449A5c7A, 115792089237316195423570985008687907853269984665640564039457584007913129639935) for all non-zero balances:
  1. Callrecycle()here.

Deployments

v0.2.0

0x5F07257145fDd889c6E318F99828E68A449A5c7A

  • Add support for yCRV deposits
  • Add a Brownie script to set the needed approvals and recycle
  • Honor allowances inrecycle(), depositmin(balance, allowance)
  • Add an ability to recycle custom amounts withrecycle_exact(dai, usdc, usdt, tusd, ycrv)

Reviewed by:

  • @iamdefinitelyahuman

v0.1.0

0x78e307F6e8584DaA0D85aDD918c0e3e4dD469A9C

Initial release, featuresrecycle() function which converts [DAI, USDC, USDT, TUSD] to yUSD.

Reviewed by:

  • @samczsun
  • @andrecronje
  • @vshvsh

Frontends

TBD

Integration caveats

Check fortoken.balanceOf(user) andtoken.allowance(user, recycle) for each of DAI, USDC, USDT, TUSD, yCRV

For tokens with non-zero balances andbalance > allowance, calltoken.approve(recycle, MAX_UINT256)

At this point you can callrecycle.recycle()

You can get the exact amounts in and out from the transaction receipt event calledRecycled(user, sent_dai, sent_usdc, sent_usdt, sent_tusd, sent_ycrv, received_yusd)

You 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 intorecycle.recycle_exact(dai, usdc, usdt, tusd, ycrv)

Note that USDT is not ERC20-compliant, it doesn't return bool forapprove and also requires first resetting theallowance to zero before changing it to another value.

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp