New implementation for AMM and Controller in crvUSD

Audits revealed minor issues with deployed code which were fixed in these implementations. While not critical, it’s good to have these fixes applied in future markets:

  • Interest rate wasn’t compounding (reported by Chainsecurity)
  • DEAD_SHARES were not accounted for in get_sum_xy (reported by Mixbytes)
  • Repayment allowed to push a user to liquidation if liquidation discount was unexpectedly adjusted (reported by Chainsecurity)

The code for fixes can be found in this pull request: Audit fixes by michwill · Pull Request #39 · curvefi/curve-stablecoin · GitHub.

Etherscan doesn’t support blueprints as of now, so verification can only be done by comparing raw bytecode with code of blueprints as produced by deployment script [curve-stablecoin/ape-deploy-amm-controller.py at master · curvefi/curve-stablecoin · GitHub].

Deployed implementations

  • Controller: 0x9DFbf2b2aF574cA8Ba6dD3fD397287944269f720
  • AMM: 0x23208cA4F2B30d8f7D54bf2D5A822D1a2F876501

How to verify

Since Etherscan doesn’t support blueprints, one has to use this script to verify, for example: curve-stablecoin/ape-deploy-amm-controller.py at master · curvefi/curve-stablecoin · GitHub

$ ape run scripts/ape-deploy-amm-controller.py verify --network ethereum:mainnet:alchemy
Blueprints match the ones deployed on chain
3 Likes