Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
mkflow27 committed Dec 17, 2024
2 parents de8988a + 4231016 commit fba0aac
Show file tree
Hide file tree
Showing 4 changed files with 134 additions and 5 deletions.
45 changes: 40 additions & 5 deletions erc4626/StatATokenV2Review.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,12 @@
- [gnosis:0x773cda0cade2a3d86e6d4e30699d40bb95174ff2](https://gnosisscan.io/address/0x773cda0cade2a3d86e6d4e30699d40bb95174ff2#code)
- [gnosis:0x7c16f0185a26db0ae7a9377f23bc18ea7ce5d644](https://gnosisscan.io/address/0x7c16f0185a26db0ae7a9377f23bc18ea7ce5d644)
- [gnosis:0x51350d88c1bd32cc6a79368c9fb70373fb71f375](https://gnosisscan.io/address/0x51350d88c1bd32cc6a79368c9fb70373fb71f375)
- [ethereum:0x487c2C53c0866F0A73ae317bD1A28F63ADcD9aD1](https://etherscan.io/address/0x487c2c53c0866f0a73ae317bd1a28f63adcd9ad1#code)
- [gnosis:0x57f664882F762FA37903FC864e2B633D384B411A](https://gnosisscan.io/token/0x57f664882f762fa37903fc864e2b633d384b411a)
- [ethereum:0xD4fa2D31b7968E448877f69A96DE69f5de8cD23E](https://etherscan.io/address/0xD4fa2D31b7968E448877f69A96DE69f5de8cD23E)
- [ethereum:0x0bfc9d54Fc184518A81162F8fB99c2eACa081202](https://etherscan.io/address/0x0bfc9d54Fc184518A81162F8fB99c2eACa081202)
- [ethereum:0x7Bc3485026Ac48b6cf9BaF0A377477Fff5703Af8](https://etherscan.io/address/0x7bc3485026ac48b6cf9baf0a377477fff5703af8#readProxyContract)
- [ethereum:0x0FE906e030a44eF24CA8c7dC7B7c53A6C4F00ce9](https://etherscan.io/token/0x0fe906e030a44ef24ca8c7dc7b7c53a6c4f00ce9#readProxyContract)
- [ethereum:0x775F661b0bD1739349b9A2A3EF60be277c5d2D29](https://etherscan.io/token/0x775f661b0bd1739349b9a2a3ef60be277c5d2d29#readProxyContract)
- Audit report(s):
- [StatATokenV2 audits](https://github.com/aave-dao/aave-v3-origin/blob/067d29eb75115179501edc4316d125d9773f7928/audits/11-09-2024_Certora_StataTokenV2.pdf)

Expand Down Expand Up @@ -60,6 +63,31 @@ If none of these is checked, then this might be a pretty great Rate Provider! If
- admin type: Aave governance system.
- multisig timelock? YES: 24 hours.

#### Wrapped Aave Ethereum WETH - 0x0bfc9d54Fc184518A81162F8fB99c2eACa081202
- upgradeable component: `StataTokenV2` ([ethereum:0x0bfc9d54Fc184518A81162F8fB99c2eACa081202](https://etherscan.io/address/0x0bfc9d54fc184518a81162f8fb99c2eaca081202#readProxyContract))
- admin address: [ethereum:0x5300A1a15135EA4dc7aD5a167152C01EFc9b192A](https://etherscan.io/address/0x5300A1a15135EA4dc7aD5a167152C01EFc9b192A#code)
- admin type: Aave governance system.
- multisig timelock? YES: 24 hours.

#### Wrapped Aave Ethereum USDT - 0x7Bc3485026Ac48b6cf9BaF0A377477Fff5703Af8
- upgradeable component: `StataTokenV2` ([ethereum:0x7Bc3485026Ac48b6cf9BaF0A377477Fff5703Af8](https://etherscan.io/address/0x7bc3485026ac48b6cf9baf0a377477fff5703af8#readProxyContract))
- admin address: [ethereum:0x5300A1a15135EA4dc7aD5a167152C01EFc9b192A](https://etherscan.io/address/0x5300A1a15135EA4dc7aD5a167152C01EFc9b192A#code)
- admin type: Aave governance system.
- multisig timelock? YES: 24 hours.

#### Wrapped Aave Ethereum Lido WETH - 0x0FE906e030a44eF24CA8c7dC7B7c53A6C4F00ce9
- upgradeable component: `StataTokenV2` ([ethereum:0x0FE906e030a44eF24CA8c7dC7B7c53A6C4F00ce9](https://etherscan.io/address/0x0FE906e030a44eF24CA8c7dC7B7c53A6C4F00ce9))
- admin address: [ethereum:0x5300A1a15135EA4dc7aD5a167152C01EFc9b192A](https://etherscan.io/address/0x5300A1a15135EA4dc7aD5a167152C01EFc9b192A#code)
- admin type: Aave governance system.
- multisig timelock? YES: 24 hours.

#### Wrapped Aave Ethereum Lido wstETH - 0x775F661b0bD1739349b9A2A3EF60be277c5d2D29
- upgradeable component: `StataTokenV2` ([ethereum:0x775F661b0bD1739349b9A2A3EF60be277c5d2D29](https://etherscan.io/address/0x775F661b0bD1739349b9A2A3EF60be277c5d2D29#code))
- admin address: [ethereum:0x5300A1a15135EA4dc7aD5a167152C01EFc9b192A](https://etherscan.io/address/0x5300A1a15135EA4dc7aD5a167152C01EFc9b192A#code)
- admin type: Aave governance system.
- multisig timelock? YES: 24 hours.


### Common Manipulation Vectors
- [ ] The ERC4626 Vault is susceptible to donation attacks.

Expand All @@ -70,7 +98,14 @@ To save time, we do not bother pointing out low-severity/informational issues or
**Summary judgment: USABLE**

The outlined ERC4626 Vaults should work well with Balancer pools. Upgradeability is guarded by Aave governance and the Vaults implement the required interfaces with fork tests passing as can be seen here:
- [Aave's GNO](https://github.com/balancer/balancer-v3-erc4626-tests/blob/main/test/gnosis/ERC4626GnosisAaveGno.t.sol)
- [Aave's WstEth](https://github.com/balancer/balancer-v3-erc4626-tests/blob/main/test/gnosis/ERC4626GnosisAaveWstEth.t.sol)
- [Aave's USDC.e](https://github.com/balancer/balancer-v3-erc4626-tests/blob/main/test/gnosis/ERC4626GnosisAaveUsdce.t.sol)
- [Aave's aUsdc](https://github.com/balancer/balancer-v3-erc4626-tests/pull/1/files)
- [0x773cda0cade2a3d86e6d4e30699d40bb95174ff2](https://github.com/balancer/balancer-v3-erc4626-tests/blob/main/test/gnosis/ERC4626GnosisAaveGno.t.sol)
- [0x7c16F0185A26Db0AE7a9377f23BC18ea7ce5d644](https://github.com/balancer/balancer-v3-erc4626-tests/blob/365ee17e8904f4654990434cc3bbc273478d95ef/test/gnosis/ERC4626GnosisAaveGno.t.sol#L20)
- [0x51350d88c1bd32cc6a79368c9fb70373fb71f375](https://github.com/balancer/balancer-v3-erc4626-tests/blob/365ee17e8904f4654990434cc3bbc273478d95ef/test/gnosis/ERC4626GnosisAaveUsdce.t.sol#L20)
- [0x57f664882F762FA37903FC864e2B633D384B411A](https://github.com/balancer/balancer-v3-erc4626-tests/blob/365ee17e8904f4654990434cc3bbc273478d95ef/test/gnosis/ERC4626GnosisAaveWeth.t.sol#L17)
- [0xD4fa2D31b7968E448877f69A96DE69f5de8cD23E](https://github.com/balancer/balancer-v3-erc4626-tests/blob/365ee17e8904f4654990434cc3bbc273478d95ef/test/mainnet/ERC4626MainnetAaveUsdcV2.t.sol#L20)
- [0x0bfc9d54Fc184518A81162F8fB99c2eACa081202](https://github.com/balancer/balancer-v3-erc4626-tests/blob/365ee17e8904f4654990434cc3bbc273478d95ef/test/mainnet/ERC4626MainnetAaveWeth.t.sol#L20)
- [0x7Bc3485026Ac48b6cf9BaF0A377477Fff5703Af8](https://github.com/balancer/balancer-v3-erc4626-tests/blob/365ee17e8904f4654990434cc3bbc273478d95ef/test/mainnet/ERC4626MainnetAaveUsdt2.t.sol#L20)
- [0x0FE906e030a44eF24CA8c7dC7B7c53A6C4F00ce9](https://github.com/balancer/balancer-v3-erc4626-tests/blob/365ee17e8904f4654990434cc3bbc273478d95ef/test/mainnet/ERC4626MainnetAaveLidoWeth.t.sol#L20)
- [0x775F661b0bD1739349b9A2A3EF60be277c5d2D29](https://github.com/balancer/balancer-v3-erc4626-tests/blob/365ee17e8904f4654990434cc3bbc273478d95ef/test/mainnet/ERC4626MainnetAaveLidoWstEth.t.sol#L20)


28 changes: 28 additions & 0 deletions erc4626/registry.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,34 @@
"summary": "safe",
"review": "./StatATokenV2Review.md",
"warnings": []
},
"0x0bfc9d54Fc184518A81162F8fB99c2eACa081202": {
"asset": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
"name": "Wrapped Aave Ethereum WETH",
"summary": "safe",
"review": "./StatATokenV2Review.md",
"warnings": []
},
"0x7Bc3485026Ac48b6cf9BaF0A377477Fff5703Af8": {
"asset": "0xdAC17F958D2ee523a2206206994597C13D831ec7",
"name": "Wrapped Aave Ethereum USDT",
"summary": "safe",
"review": "./StatATokenV2Review.md",
"warnings": []
},
"0x0FE906e030a44eF24CA8c7dC7B7c53A6C4F00ce9": {
"asset": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
"name": "Wrapped Aave Ethereum Lido WETH",
"summary": "safe",
"review": "./StatATokenV2Review.md",
"warnings": []
},
"0x775F661b0bD1739349b9A2A3EF60be277c5d2D29": {
"asset": "0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0",
"name": "Wrapped Aave Ethereum Lido wstETH",
"summary": "safe",
"review": "./StatATokenV2Review.md",
"warnings": []
}
},
"gnosis": {
Expand Down
9 changes: 9 additions & 0 deletions rate-providers/registry.json
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,15 @@
"implementationReviewed": "0xF393cf22308C3B0dE868ec125834A9F065C11CeC"
}
]
},
"0xDA967592898c584966AAf765C1acfd09F6e1aEAA": {
"asset": "0x7788A3538C5fc7F9c7C8A74EAC4c898fC8d87d92",
"name": "ERC4626RateProvider",
"summary": "safe",
"review": "./sUSDXRateProviderReview.md",
"warnings": [],
"factory": "0xe548a29631f9E49830bE8edc22d407b2D2915F31",
"upgradeableComponents": []
}
},
"avalanche": {
Expand Down
57 changes: 57 additions & 0 deletions rate-providers/sUSDXRateProviderReview.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Rate Provider: `ERC4626RateProvider`

## Details
- Reviewed by: @mkflow27
- Checked by: @danielmkm
- Deployed at:
- [arbitrum:0xDA967592898c584966AAf765C1acfd09F6e1aEAA](https://arbiscan.io/address/0xDA967592898c584966AAf765C1acfd09F6e1aEAA#code)

- Audit report(s):
- [usdx audits](https://docs.usdx.money/informaiton/audit)

## Context
Staking is controlled by the StakedUSDX smart contract. Stakers can interact with it directly.
When staking, a user transfers USDX into the contract and receives sUSDX (staked USDX), another ERC20 token that represents a fractional interest in the USDX in the contract. Over time, a portion of protocol revenue accumulates in the staking contract as additional USDX is transferred in. When unstaking, sUSDX is burned in exchange for a proportionate USDX amount. Staking rewards accrual is a function of the protocol's generated yield from earning the funding and basis spread from the delta hedging derivatives position and BTC (re)staking yield in the future.

## 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).

- [ ] 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).

### 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
- [x] The Rate Provider is susceptible to donation attacks.

Part of the rate calculation depends on the vault' `asset`, where the balance is fetched. It is implemented as
```solidity
/**
* @notice Returns the amount of USDX tokens that are vested in the contract.
*/
function totalAssets() public view override returns (uint256) {
return IERC20(asset()).balanceOf(address(this)) - getUnvestedAmount();
}
```

## Additional Findings
To save time, we do not bother pointing out low-severity/informational issues or gas optimizations (unless the gas usage is particularly egregious). Instead, we focus only on high- and medium-severity findings which materially impact the contract's functionality and could harm users.


## Conclusion
**Summary judgment: Usable**

This rate provider should work well with Balancer pools. Role management which gives access to certain function is based on a 3/5 [multisig](https://arbiscan.io/address/0xe0d810FD0f40257F5dFAb72fd170a4800D847408#code).

0 comments on commit fba0aac

Please sign in to comment.