A collaboration between Notional and Index Coop to create fixed rate yield index tokens.
Platform: Code4rena
Start Date: 07/06/2022
End Date: 14/06/2022
Period: 7 days
Status: Completed
Pot Size: $75,000 USDC
Participants: 77
Reporter: itsmetechjay
Judge: gzeon
Id: 124
League: ETH
jonah1005 | 1/77 | $14,441.79 | 5 | 1 | 0 | 3 | 2 | - | 0 | 0 |
unforgiven | 2/77 | $12,608.65 | 4 | 0 | 0 | 3 | 2 | - | 0 | 0 |
xiaoming90 | 3/77 | $9,998.19 | 4 | 1 | 0 | 2 | 1 | - | 0 | 0 |
csanuragjain | 4/77 | $5,642.61 | 3 | 0 | 0 | 1 | 1 | - | - | 0 |
0xDjango | 5/77 | $5,595.18 | 2 | 0 | 0 | 1 | 1 | - | 0 | 0 |
berndartmueller | 6/77 | $5,204.37 | 4 | 1 | 0 | 1 | 0 | - | - | 0 |
GreyArt | 7/77 | $4,515.73 | 4 | 1 | 0 | 1 | 0 | - | - | 0 |
Meera | 8/77 | $2,804.01 | 3 | 0 | 0 | 1 | 0 | - | - | 0 |
minhquanym | 9/77 | $1,942.85 | 3 | 1 | 0 | 0 | 0 | - | - | 0 |
kenzo | 10/77 | $1,894.40 | 2 | 1 | 0 | 0 | 0 | - | 0 | 0 |
Auditor per page
This is a combined audit with code contributed by both Notional Finance and Index Coop.
Notional Wrapped fCash is a compatibility layer for ERC20 tokens and fCash. See details in notional-wrapped-fcash/README.md
. A link to the repo is here: https://github.com/notional-finance/wrapped-fcash, a technical walkthrough is here: https://www.youtube.com/watch?v=RvCYFR2Yjls
Notional is a protocol on Ethereum that facilitates fixed-rate, fixed-term crypto asset lending and borrowing through a novel financial instrument called fCash.
Set Protocol is a non-custodial protocol built on Ethereum that allows for the creation, management, and trading of Sets, ERC20 tokens that represent a portfolio or basket of underlying assets.
Index Coop is a DAO that leverages Set Protocol's technology to build products that make crypto investing simple for everyone.
The goal of this integration is to support Notionals fCash tokens as underlying positions of a SetToken in order to allow the creation of products that combine multiple fixed-rate lending positions across maturities and underlying currencies.
Since fCash tokens themselves are not ERC20 compatible this integration consists of two key components:
WrappedfCash
: An ERC20 compliant wrapper for fCash
developed by the notional team. (see here)NotionalTradeModule
: A new Module developed by IndexCoop to be added to the SetProtocol architecture in order to manage (wrapped) fCash positions on a SetToken. (see here)The Notional trade module has two main functions:
In general the scope of this contest covers the two contracts WrappedfCash and NotionalTradeModule as well as their interaction with the rest of the notional and set-protocol architecture.
Contract Name | Source Lines of Code | Libraries | External Calls |
---|---|---|---|
NotionalTradeModule | ~396 sLoC | OpenZeppelin | WrappedfCash, WrappedfCashFactory, SetToken, DebtIssuanceModule |
wfCashBase | 96 sLoC | OpenZeppelin v4.5.0 | NotionalV2 |
wfCashERC4626 | 180 sLoC | OpenZeppelin v4.5.0 | NotionalV2 |
wfCashLogic | 214 sLoC | OpenZeppelin v4.5.0 | NotionalV2 |
WrappedfCashFactory | 28 sLoC | OpenZeppelin v4.5.0 | NotionalV2 |
A description of Wrapped fCash is in this README. Key invariants include:
currencyId
and maturity
.convertToShares
and convertToAssets
ERC4626 methods can be relied on as oracle prices for fCash, they use Notional's internal TWAP oracle.currencyId
and maturity
) can be deployed at any time from the WrappedfCashFactory
.At a high level, the core invariants that we expect to be upheld are that:
currencyId
and maturity
) on behalf of the Set using either the asset or underlying token given that:
currencyId
and maturity
correspond to a valid and active (i.e. not matured) fCash token on the notional protocolNotionalTradeModule
has been added / registered in the correct way.currencyId
and maturity
correspond to a valid fCash token that has previously been added as a component to this set.NotionalTradeModule
has been added / registered in the correct way.redeemMaturedPositions
methodNotionalTradeModule
is removed from the set tokenThere are a number of known limitations that are explicitly out of scope for the context of the competition:
Owner
(not to be confused with the manager) of the Set token can add arbitrary logic as a new a set token module. This actor should be assumed to act in the protocols / users best interest and not collude in any attack or be otherwise compromised.