Platform: Code4rena
Start Date: 18/10/2023
Pot Size: $36,500 USDC
Total HM: 17
Participants: 77
Period: 7 days
Judge: MiloTruck
Total Solo HM: 5
Id: 297
League: ETH
Rank: 51/77
Findings: 1
Award: $41.97
🌟 Selected for report: 0
🚀 Solo Findings: 0
🌟 Selected for report: hunter_w3b
Also found by: 0xbrett8571, 0xweb3boy, JCK, Myd, SAAJ, ZanyBonzy, clara, fouzantanveer, jauvany, wei3erHase
41.9716 USDC - $41.97
Open Dollar is a decentralized stablecoin protocol that aims to maintain a soft peg to $1.00 USD. It utilizes a collateralized debt position (CDP) model where users deposit collateral assets into isolated positions called "vaults" to mint the Open Dollar stablecoin.
Open Dollar has modified the standard CDP model by tying vault positions to non-fungible tokens (NFTs). This allows the vaults to be freely tradable. The protocol is designed to be used on Arbitrum for scalability.
The core contracts in the Open Dollar protocol are:
Each user has an ODProxy contract that handles their wallet interactions. Vaults are created via the ODSafeManager and assigned a unique ERC-721 token ID minted by Vault721. This ties the vault ownership to the NFT.
The NFTs can be freely traded, transferring control and ownership of the vaults. The proxy architecture enables the protocol to enforce controls on vault usage while keeping NFT ownership transferable.
The Vault721 owner role has centralized control: #L18, #L133-L135, #L40-L43
// Vault721.sol address public governor; function setNftRenderer(address renderer) external onlyGovernor { // Set critical contract logic } modifier onlyGovernor() { if (msg.sender != governor) revert NotGovernor(); _; } // ... }
The governor can set arbitrary contract implementations like the NftRenderer.
Liquidation ratios are set in the SAFEEngine:
// SAFEEngine.sol uint constant LIQ_RATIO = 1.5; // 150% function liquidate(uint safe) external { if (getCollateralRatio(safe) < LIQ_RATIO) { // Liquidate } }
The 1.5 ratio could be too high or low. Testing is needed to set proper levels.
External calls made before modifiers: Rent
// ODSafeManager.sol function transferCollateral(uint safe, address dst, uint amt) external { SAFEEngine(engine).transferCollateral(safe, dst, amt); authenticated(safe); // Modifier after external call }
This could allow reentrancy attacks.
Users can deposit supported collateral assets into their vault to mint Open Dollar stablecoins against their collateral. This allows leveraging the collateral to access liquidity.
The ratio of collateral to generated stablecoins must be maintained to avoid liquidation. If the collateral ratio drops too low, the vault position can be liquidated.
To maintain the peg, stability fees are charged on debt positions. This incentivizes closing debt positions to avoid paying growing fees. The protocol also implements discount rates on collateral redemption to encourage maintaining positions.
The Open Dollar protocol represents an interesting new model for collateralized stablecoins. The architecture using NFT vaults enables powerful new use cases around trading and transferring positions.
However, the added complexity also increases the chance of unforeseen edge cases that could threaten stability. Formal verification of the core mechanisms would give higher assurance. Overall the system shows promise but requires extensive real-world testing and monitoring before considering large-scale adoption.
4 hours
#0 - c4-pre-sort
2023-10-27T01:46:59Z
raymondfam marked the issue as sufficient quality report
#1 - c4-judge
2023-11-03T17:23:52Z
MiloTruck marked the issue as grade-b