/withdrawal-manager-cyclical

Repo for doing smart contracts research for PoolV2

Primary LanguageSolidityOtherNOASSERTION

Withdrawal Manager

Foundry CI GitBook - Documentation Foundry License: BUSL 1.1

Overview

The WithdrawalManager is an upgradable contract used by the Maple V2 protocol to facilitate withdrawals of liquidity from a Maple pool via a cyclical withdrawal mechanism. It also enables pro-rata distribution of cash in the event of insufficient liquidity.

Dependencies/Inheritance

Contracts in this repo inherit and import code from:

Contracts inherit and import code in the following ways:

  • WithdrawalManager uses ERC20Helper for token interactions.
  • WithdrawalManager inherits MapleProxiedInternals for proxy logic.
  • WithdrawalManagerFactory inherits MapleProxyFactory for proxy deployment and management.

Versions of dependencies can be checked with git submodule status.

Setup

This project was built using Foundry. Refer to installation instructions here.

git clone git@github.com:maple-labs/withdrawal-manager-cyclical.git
cd withdrawal-manager-cyclical
forge install

Running Tests

  • To run all tests: forge test
  • To run specific tests: forge test --match <test_name>

./scripts/test.sh is used to enable Foundry profile usage with the -p flag. Profiles are used to specify the number of fuzz runs.

Audit Reports

Auditor Report Link
Trail of Bits 2022-08-24 - Trail of Bits Report
Spearbit 2022-10-17 - Spearbit Report
Three Sigma 2022-10-24 - Three Sigma Report
Three Sigma 2023-11-06 - Three Sigma Report
0xMacro 2023-11-27 - 0xMacro Report

Bug Bounty

For all information related to the ongoing bug bounty for these contracts run by Immunefi, please visit this site.

About Maple

Maple Finance is a decentralized corporate credit market. Maple provides capital to institutional borrowers through globally accessible fixed-income yield opportunities.