Platform: Code4rena
Start Date: 18/04/2024
End Date: 25/04/2024
Period: 7 days
Status: Completed
Pot Size: $36,500 USDC
Participants: 183
Reporter: thebrittfactor
Judge: Koolex
Id: 367
League: ETH
carrotsmuggler | 1/183 | $1,566.96 | 10 | 4 | 0 | 6 | 0 | 0 | 0 | 0 |
alix40 | 2/183 | $1,417.44 | 9 | 5 | 0 | 4 | 0 | 0 | 0 | 0 |
Emmanuel | 3/183 | $978.02 | 4 | 3 | 0 | 1 | 0 | 0 | 0 | 0 |
Al-Qa-qa | 4/183 | $933.49 | 7 | 3 | 0 | 3 | 0 | - | 0 | 0 |
ZanyBonzy | 5/183 | $814.80 | 5 | 3 | 0 | 1 | 0 | - | 0 | 0 |
adam-idarrha | 6/183 | $766.31 | 6 | 4 | 0 | 2 | 0 | 0 | 0 | 0 |
TheSavageTeddy | 7/183 | $763.89 | 6 | 4 | 0 | 2 | 0 | 0 | 0 | 0 |
lian886 | 8/183 | $761.33 | 4 | 3 | 0 | 1 | 0 | 0 | 0 | 0 |
TheFabled | 9/183 | $750.33 | 3 | 3 | 0 | 0 | 0 | 0 | 0 | 0 |
SBSecurity | 10/183 | $732.89 | 12 | 4 | 0 | 7 | 0 | - | 0 | 0 |
Auditor per page
The 4naly3er report can be found here.
Note for C4 wardens: Anything included in this Automated Findings / Publicly Known Issues
section is considered a publicly known issue and is ineligible for awards.
DYAD is the first truly capital efficient decentralized stablecoin. Traditionally, two costs make stablecoins inefficient: surplus collateral and DEX liquidity. DYAD minimizes both of these costs through Kerosene, a token that lowers the individual cost to mint DYAD.
core ├─ DNft — "A dNFT gives you the right to mint DYAD" ├─ Dyad — "Stablecoin backed by ETH" ├─ VaultManager - "Manage Vaults for DNfts" ├─ VaultManagerV2 - "VaultManager with flash loan protection" ├─ Vault - "Holds different collateral types" ├─ Licenser - "License VaultManagers or Vaults" ├─ KerosineManager - "Add/Remove Vaults to the Kerosene Calculation" staking ├─ Kerosine - "Kerosene ERC20" ├─ KerosineDenominator ├─ Staking - "Simple staking contract" periphery ├─ Payments
All on Ethereum Mainnet
Contract | Address |
---|---|
DYAD | 0x305B58c5F6B5b6606fb13edD11FbDD5e532d5A26 |
dNFT | 0xDc400bBe0B8B79C07A962EA99a642F5819e3b712 |
Vault Manager v1 | 0xfaa785c041181a54c700fD993CDdC61dbBfb420f |
wETH Vault | 0xcF97cEc1907CcF9d4A0DC4F492A3448eFc744F6c |
wstETH Vault | 0x7aE80418051b2897729Cbdf388b07C5158C557A1 |
The goal is to migrate from VaultManager to VaultManagerV2. The main reason is the need for a flash loan protection which makes it harder to manipulate the deterministic Kerosene price.
The whole migration is described in Deploy.V2.s.sol
. The only transaction that needs to be done by the multi-sig after the deployment is licensing the new Vault Manager.
See scope.txt
File | Logic Contracts | Interfaces | SLOC | Purpose | Libraries used |
---|---|---|---|---|---|
/src/staking/KerosineDenominator.sol | 1 | **** | 14 | ||
/src/core/VaultManagerV2.sol | 1 | **** | 166 | ||
/src/core/Vault.kerosine.sol | 1 | **** | 62 | @solmate/src/utils/SafeTransferLib.sol<br>@solmate/src/tokens/ERC20.sol<br>@solmate/src/auth/Owned.sol | |
/src/core/KerosineManager.sol | 1 | **** | 34 | @openzeppelin/contracts/utils/structs/EnumerableSet.sol<br>@solmate/src/auth/Owned.sol | |
/src/core/Vault.kerosine.bounded.sol | 1 | **** | 42 | @solmate/src/tokens/ERC20.sol | |
/src/core/Vault.kerosine.unbounded.sol | 1 | **** | 60 | @solmate/src/tokens/ERC20.sol<br>@solmate/src/utils/SafeTransferLib.sol | |
/script/deploy/Deploy.V2.s.sol | 1 | **** | 87 | forge-std/Script.sol<br>@solmate/src/tokens/ERC20.sol | |
Totals | 7 | **** | 465 |
See out_of_scope.txt
File |
---|
./script/Read.s.sol |
./script/deploy/DeployBase.s.sol |
./script/mock/transfer.wsteth.s.sol |
./src/core/DNft.sol |
./src/core/Dyad.sol |
./src/core/Licenser.sol |
./src/core/Vault.sol |
./src/core/Vault.wsteth.sol |
./src/interfaces/IAggregatorV3.sol |
./src/interfaces/IDNft.sol |
./src/interfaces/IDyad.sol |
./src/interfaces/IStaking.sol |
./src/interfaces/IVault.sol |
./src/interfaces/IVaultManager.sol |
./src/interfaces/IWETH.sol |
./src/interfaces/IWstETH.sol |
./src/params/DNftParameters.sol |
./src/params/Parameters.sol |
./src/periphery/Payments.sol |
./src/staking/Kerosine.sol |
./src/staking/Staking.sol |
./test/BaseTest.sol |
./test/ERC20Mock.sol |
./test/OracleMock.sol |
./test/Payments.t.sol |
./test/Vault.wsteth.t.sol |
./test/VaultManager.t.sol |
./test/VaultManagerHelper.t.sol |
./test/WETH.sol |
./test/fork/v2.t.sol |
./src/core/VaultManager.sol |
Totals: 31 |
Question | Answer |
---|---|
ERC20 used by the protocol | Kerosene, weth, wseth |
Test coverage | 33.64% |
ERC721 used by the protocol | DNFT |
ERC777 used by the protocol | None |
ERC1155 used by the protocol | None |
Chains the protocol will be deployed on | Ethereum |
Question | Answer |
---|---|
Enabling/disabling fees (e.g. Blur disables/enables fees) | No |
Pausability (e.g. Uniswap pool gets paused) | Yes |
Upgradeability (e.g. Uniswap gets upgraded) | Yes |
None
Manipulation of Kerosene Price.
Flash Loan attacks.
DYAD Multisig: 0xDeD796De6a14E255487191963dEe436c45995813
Role | Description |
---|---|
DYAD Multisig | Ability to: License new Vault Manager, License new Vaults, Change the kerosene denominator contract, Add new vaults to the Kerosene Manager |
None
git clone https://github.com/code-423n4/2024-04-dyad.git git submodule update --init --recursive cd 2024-04-dyad forge install forge test
To run code coverage
forge coverage
To run gas benchmarks
forge test --gas-report
Employees of DYAD and employees' family members are ineligible to participate in this audit.