Skip to content

Commit

Permalink
Merge pull request #190 from balancer/Aave-Mainnet-BasicERC4626RatePr…
Browse files Browse the repository at this point in the history
…oviders

Aave-Mainnet-BasicERC4626RateProviders
  • Loading branch information
mkflow27 authored Dec 9, 2024
2 parents 0955ff3 + 68bb59d commit 2e72a1f
Show file tree
Hide file tree
Showing 3 changed files with 356 additions and 0 deletions.
69 changes: 69 additions & 0 deletions rate-providers/MorphoERC4626RateProviders.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# Rate Provider: `ERC4626RateProvider`

## Details
- Reviewed by: @mkflow27
- Checked by: @danielmkm
- Deployed at:
- Steakhouse USDC [ethereum:0xc81D60E39e065146c6dE186fFC5B39e4CA2189Cf](https://etherscan.io/address/0xc81D60E39e065146c6dE186fFC5B39e4CA2189Cf#code)
- Steakhouse USDT [ethereum:0x50A72232c5370321aa78036BaDe8e9d5eB89cbAF](https://etherscan.io/address/0x50A72232c5370321aa78036BaDe8e9d5eB89cbAF#code)
- Steakhouse wUSDL - csUSDL [ethereum:0xbEc8a14233e68C02e803B999DbA3D0f9C5076394](https://etherscan.io/address/0xbEc8a14233e68C02e803B999DbA3D0f9C5076394#code)
- Gauntlet Prime wETH [ethereum:0x0A25a2C62e3bA90F1e6F08666862df50cdAAB1F5](https://etherscan.io/address/0x0A25a2C62e3bA90F1e6F08666862df50cdAAB1F5#code)


- Audit report(s):
- [Security Reviews & Formal Verifications](https://docs.morpho.org/security-reviews/)
- [MetaMorpho Spearbit Audit](https://github.com/morpho-org/metamorpho/blob/main/audits/2023-11-14-metamorpho-cantina-managed-review.pdf)

## Context
The ERC4626 RateProvider fetches the rate of MetaMorpho Vault tokens in terms of the underlying asset. The exchange rate is provided via the conversion between totalAssets and totalSupply. The Morpho contract only determines the potential market parameters, assets, collaterals, beneficiary, owner, fee, and cooldown periods related to the vault curator. There are no entry or exit fees, and no time locks for users to deposit and withdraw from this vault.

## Review Checklist: Bare Minimum Compatibility
Each of the items below represents an absolute requirement for the Rate Provider. If any of these is unchecked, the Rate Provider is unfit to use.

- [x] Implements the [`IRateProvider`](https://github.com/balancer/balancer-v2-monorepo/blob/bc3b3fee6e13e01d2efe610ed8118fdb74dfc1f2/pkg/interfaces/contracts/pool-utils/IRateProvider.sol) interface.
- [x] `getRate` returns an 18-decimal fixed point number (i.e., 1 == 1e18) regardless of underlying token decimals.

## Review Checklist: Common Findings
Each of the items below represents a common red flag found in Rate Provider contracts.

If none of these is checked, then this might be a pretty great Rate Provider! If any of these is checked, we must thoroughly elaborate on the conditions that lead to the potential issue. Decision points are not binary; a Rate Provider can be safe despite these boxes being checked. A check simply indicates that thorough vetting is required in a specific area, and this vetting should be used to inform a holistic analysis of the Rate Provider.

### Administrative Privileges
- [ ] The Rate Provider is upgradeable (e.g., via a proxy architecture or an `onlyOwner` function that updates the price source address).

- [x] Some other portion of the price pipeline is upgradeable (e.g., the token itself, an oracle, or some piece of a larger system that tracks the price).
Part of the rate computation relies of `totalAssets` being calculated. This function iterates over a list of Ids. This list of Ids can be changed by the Allocator role. The potential impact has not been thoroughly investigated. There are however protections in place to protect against invalid changes such as
- `revert ErrorsLib.DuplicateMarket(id);`
- `revert ErrorsLib.InvalidMarketRemovalNonZeroCap(id);`
- `revert ErrorsLib.PendingCap(id);`
- `ErrorsLib.InvalidMarketRemovalNonZeroSupply(id);`
- `ErrorsLib.InvalidMarketRemovalTimelockNotElapsed(id);`

#### Steakhouse USDC
For [Steakhouse USDC](https://etherscan.io/address/0xBEEF01735c132Ada46AA9aA4c54623cAA92A64CB) some allocators are eoas.
- 0x0D61C8b6CA9669A36F351De3AE335e9689dd9C5b
- 0xcC771952fdE840E30C6802734e5ad20479c2959f
- 0xfd32fA2ca22c76dD6E550706Ad913FC6CE91c75D
- 0xfeed46c11F57B7126a773EeC6ae9cA7aE1C03C9a
#### Steakhouse USDT
For [Steakhouse USDT](https://etherscan.io/address/0xbEef047a543E45807105E51A8BBEFCc5950fcfBa) some allocators are eoas.
- 0xfeed46c11F57B7126a773EeC6ae9cA7aE1C03C9a
- 0xfd32fA2ca22c76dD6E550706Ad913FC6CE91c75D
- 0x29d4CDFee8F533af8529A9e1517b580E022874f7
#### Gauntlet Prime wETH
For [Gauntlet Prime wETH](https://etherscan.io/address/0x2371e134e3455e0593363cBF89d3b6cf53740618) some allocators are eoas.
- 0xfd32fA2ca22c76dD6E550706Ad913FC6CE91c75D
- 0x959d73CB5a1C1ad7EbCE3eC93FAD3b2f9a25432E

### Oracles
- [ ] Price data is provided by an off-chain source (e.g., a Chainlink oracle, a multisig, or a network of nodes).

- [ ] Price data is expected to be volatile (e.g., because it represents an open market price instead of a (mostly) monotonically increasing price).

### Common Manipulation Vectors
- [ ] The Rate Provider is susceptible to donation attacks.

## Conclusion
**Summary judgment: USABLE**

The Rate Providers should work well with Balancer pools. The underlying contracts have been audited and been in production for an extended period of time.
168 changes: 168 additions & 0 deletions rate-providers/registry.json
Original file line number Diff line number Diff line change
Expand Up @@ -1676,6 +1676,78 @@
"factory": "",
"upgradeableComponents": []
},
"0xBe7bE04807762Bc433911dD927fD54a385Fa91d6": {
"asset": "0x0bfc9d54Fc184518A81162F8fB99c2eACa081202",
"name": "ERC4626RateProvider",
"summary": "safe",
"review": "./statATokenv2RateProvider.md",
"warnings": [""],
"factory": "0xFC541f8d8c5e907E236C8931F0Df9F58e0C259Ec",
"upgradeableComponents": [
{
"entrypoint": "0x0bfc9d54Fc184518A81162F8fB99c2eACa081202",
"implementationReviewed": "0x487c2C53c0866F0A73ae317bD1A28F63ADcD9aD1"
},
{
"entrypoint": "0x87870Bca3F3fD6335C3F4ce8392D69350B4fA4E2",
"implementationReviewed": "0xeF434E4573b90b6ECd4a00f4888381e4D0CC5Ccd"
}
]
},
"0x8f4E8439b970363648421C692dd897Fb9c0Bd1D9": {
"asset": "0xD4fa2D31b7968E448877f69A96DE69f5de8cD23E",
"name": "ERC4626RateProvider",
"summary": "safe",
"review": "./statATokenv2RateProvider.md",
"warnings": [""],
"factory": "0xFC541f8d8c5e907E236C8931F0Df9F58e0C259Ec",
"upgradeableComponents": [
{
"entrypoint": "0xD4fa2D31b7968E448877f69A96DE69f5de8cD23E",
"implementationReviewed": "0x487c2C53c0866F0A73ae317bD1A28F63ADcD9aD1"
},
{
"entrypoint": "0x87870Bca3F3fD6335C3F4ce8392D69350B4fA4E2",
"implementationReviewed": "0xeF434E4573b90b6ECd4a00f4888381e4D0CC5Ccd"
}
]
},
"0xEdf63cce4bA70cbE74064b7687882E71ebB0e988": {
"asset": "0x7Bc3485026Ac48b6cf9BaF0A377477Fff5703Af8",
"name": "ERC4626RateProvider",
"summary": "safe",
"review": "./statATokenv2RateProvider.md",
"warnings": [""],
"factory": "0xFC541f8d8c5e907E236C8931F0Df9F58e0C259Ec",
"upgradeableComponents": [
{
"entrypoint": "0x7Bc3485026Ac48b6cf9BaF0A377477Fff5703Af8",
"implementationReviewed": "0x487c2C53c0866F0A73ae317bD1A28F63ADcD9aD1"
},
{
"entrypoint": "0x87870Bca3F3fD6335C3F4ce8392D69350B4fA4E2",
"implementationReviewed": "0xeF434E4573b90b6ECd4a00f4888381e4D0CC5Ccd"
}
]
},
"0xf4b5D1C22F35a460b91edD7F33Cefe619E2fAaF4": {
"asset": "0x0FE906e030a44eF24CA8c7dC7B7c53A6C4F00ce9",
"name": "ERC4626RateProvider",
"summary": "safe",
"review": "./statATokenv2RateProvider.md",
"warnings": [""],
"factory": "0xFC541f8d8c5e907E236C8931F0Df9F58e0C259Ec",
"upgradeableComponents": [
{
"entrypoint": "0x0FE906e030a44eF24CA8c7dC7B7c53A6C4F00ce9",
"implementationReviewed": "0x487c2C53c0866F0A73ae317bD1A28F63ADcD9aD1"
},
{
"entrypoint": "0x87870Bca3F3fD6335C3F4ce8392D69350B4fA4E2",
"implementationReviewed": "0xeF434E4573b90b6ECd4a00f4888381e4D0CC5Ccd"
}
]
},
"0xdDDF909076B641C51f22ACD4b134C54adad51e68": {
"asset": "0x657e8C867D8B37dCC18fA4Caead9C45EB088C642",
"name": "eBtcRateProvider",
Expand Down Expand Up @@ -1706,6 +1778,48 @@
"implementationReviewed": "0x3f258821a5ad28391e9Bb0B69A705fdf545BCab0"
}
]
},
"0xc81D60E39e065146c6dE186fFC5B39e4CA2189Cf": {
"asset": "0xBEEF01735c132Ada46AA9aA4c54623cAA92A64CB",
"name": "ERC4626RateProvider",
"summary": "safe",
"review": "./MorphoERC4626RateProviders.md",
"warnings": ["eoaUpgradeable"],
"factory": "0xFC541f8d8c5e907E236C8931F0Df9F58e0C259Ec",
"upgradeableComponents": [
{
"entrypoint": "0xBEEF01735c132Ada46AA9aA4c54623cAA92A64CB",
"implementationReviewed": "0xBEEF01735c132Ada46AA9aA4c54623cAA92A64CB"
}
]
},
"0x50A72232c5370321aa78036BaDe8e9d5eB89cbAF": {
"asset": "0xbEef047a543E45807105E51A8BBEFCc5950fcfBa",
"name": "ERC4626RateProvider",
"summary": "safe",
"review": "./MorphoERC4626RateProviders.md",
"warnings": ["eoaUpgradeable"],
"factory": "0xFC541f8d8c5e907E236C8931F0Df9F58e0C259Ec",
"upgradeableComponents": [
{
"entrypoint": "0xbEef047a543E45807105E51A8BBEFCc5950fcfBa",
"implementationReviewed": "0xbEef047a543E45807105E51A8BBEFCc5950fcfBa"
}
]
},
"0x0A25a2C62e3bA90F1e6F08666862df50cdAAB1F5": {
"asset": "0x2371e134e3455e0593363cBF89d3b6cf53740618",
"name": "ERC4626RateProvider",
"summary": "safe",
"review": "./MorphoERC4626RateProviders.md",
"warnings": ["eoaUpgradeable"],
"factory": "0xFC541f8d8c5e907E236C8931F0Df9F58e0C259Ec",
"upgradeableComponents": [
{
"entrypoint": "0x2371e134e3455e0593363cBF89d3b6cf53740618",
"implementationReviewed": "0x2371e134e3455e0593363cBF89d3b6cf53740618"
}
]
}
},
"fantom": {
Expand Down Expand Up @@ -1899,6 +2013,60 @@
"warnings": ["donation"],
"factory": "",
"upgradeableComponents": []
},
"0x0008A59C1d2E5922790C929ea432ed02D4D3323A": {
"asset": "0x57f664882F762FA37903FC864e2B633D384B411A",
"name": "ERC4626RateProvider",
"summary": "safe",
"review": "./statATokenv2RateProvider.md",
"warnings": [],
"factory": "",
"upgradeableComponents": [
{
"entrypoint": "0x57f664882F762FA37903FC864e2B633D384B411A",
"implementationReviewed": "0x7CB7fdeEB5E71f322F8E39Be67959C32a6A3aAA3"
},
{
"entrypoint": "0xb50201558B00496A145fE76f7424749556E326D8",
"implementationReviewed": "0xF2C312BfAF4CF0429DB4DA15a0cf5F770Ea3E770"
}
]
},
"0xbbb4966335677Ea24F7B86DC19a423412390e1fb": {
"asset": "0x7c16F0185A26Db0AE7a9377f23BC18ea7ce5d644",
"name": "ERC4626RateProvider",
"summary": "safe",
"review": "./statATokenv2RateProvider.md",
"warnings": [],
"factory": "",
"upgradeableComponents": [
{
"entrypoint": "0x7c16F0185A26Db0AE7a9377f23BC18ea7ce5d644",
"implementationReviewed": "0x7CB7fdeEB5E71f322F8E39Be67959C32a6A3aAA3"
},
{
"entrypoint": "0xb50201558B00496A145fE76f7424749556E326D8",
"implementationReviewed": "0xF2C312BfAF4CF0429DB4DA15a0cf5F770Ea3E770"
}
]
},
"0x1529f6Af353E180867F257820843425B49B1b478": {
"asset": "0x51350d88c1bd32Cc6A79368c9Fb70373Fb71F375",
"name": "ERC4626RateProvider",
"summary": "safe",
"review": "./statATokenv2RateProvider.md",
"warnings": [],
"factory": "",
"upgradeableComponents": [
{
"entrypoint": "0x51350d88c1bd32Cc6A79368c9Fb70373Fb71F375",
"implementationReviewed": "0x7CB7fdeEB5E71f322F8E39Be67959C32a6A3aAA3"
},
{
"entrypoint": "0xb50201558B00496A145fE76f7424749556E326D8",
"implementationReviewed": "0xF2C312BfAF4CF0429DB4DA15a0cf5F770Ea3E770"
}
]
}
},
"mode": {
Expand Down
Loading

0 comments on commit 2e72a1f

Please sign in to comment.