Skip to content

Cyfrin/2025-01-diva

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AaveDIVAWrapper

Prize Pool

  • Total Pool - $15,000

  • H/M - $14,000

  • Low - $1,000

  • Starts: January 24, 2025 Noon UTC

  • Ends: January 31, 2025 Noon UTC

  • nSLOC: 519

About

AaveDIVAWrapper is a smart contract that acts as a connector between DIVA Protocol and Aave V3, allowing assets deposited into DIVA Protocol pools to generate yield by supplying them on Aave V3. The generated yield is claimable by the owner of the AaveDIVAWrapper contract.

The AaveDIVAWrapper contract was originally designed for DIVA Donate on Arbitrum, a parametric conditional donations platform, which aims to use the yield to purchase insurance policies to increase donation payouts beyond users' initial contributions. However, the contract can be utilized for any other use case enabled by DIVA Protocol (e.g., prediction markets, structured products, etc.).

Relevant links

AaveDIVAWrapper:

DIVA Donate:

DIVA Protocol:

Aave:

Actors

Actors:

  • Users: Can create pools, add/remove liquidity, redeem position tokens, and convert wrapped collateral tokens back to the original token.
  • Owner: Can register collateral tokens and claim yield generated from Aave deposits.
  • Data providers/oracles: Resolve pools by reporting the outcome via DIVA Protocol.

Scope (contracts)

The following contracts in contracts/src/ are in scope:

src/
├── AaveDIVAWrapper.sol
├── AaveDIVAWrapperCore.sol
├── WToken.sol
├── interfaces
   └── IAave.sol
   └── IAaveDIVAWrapper.sol
   └── IDIVA.sol
   └── IWToken.sol

Compatibilities

AaveDIVAWrapper contract will be deployed on EVM-compatible chains where both DIVA Protocol and Aave V3 are available. These include:

  • Ethereum Mainnet
  • Polygon
  • Arbitrum One
  • Gnosis Chain
  • Ethereum Sepolia (Testnet)

Supported collateral tokens:

  • Any ERC20 token supported by Aave V3, but mainly stablecoins like USDC, USDT are expected to be used for DIVA Donate.
  • Fee-on-transfer and rebaseable tokens are NOT supported.
  • Tokens must have between 6-18 decimals.

Setup

Install pnpm (if not already installed):

npm install -g pnpm

Build:

pnpm install

Configuration:

npx hardhat vars set PRIVATE_KEY

Tests:

pnpm test:hh

Known Issues

  • The AaveDIVAWrapper contract becomes useable only after the owner has registered collateral tokens post contract deployment.
  • Aave V3 is upgradeable and could introduce breaking changes, though the risk is deemed low as AaveDIVAWrapper only uses core functions.
  • Integration risk with both Aave V3 and DIVA Protocol - vulnerabilities in either protocol may affect AaveDIVAWrapper.
  • Fee-on-transfer and rebaseable tokens are not supported but also not prevented on code level (same as in Aave V3).
  • Direct ETH deposits are not supported (requires wrapper contract).
  • Yield rounding issues could temporarily prevent yield claims if aToken balance becomes smaller than wToken supply.

Additional Known Issues detected by LightChaser are available here.

About

No description, website, or topics provided.

Resources

License

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published