DISCLAIMER: This code has NOT been externally audited and is actively being developed. Please do not use in production without taking the appropriate steps to ensure maximum security.
DebtLocker is a smart contract that allows Pools to interact with different versions of Loans.
This contract has the following capabilities:
- Claim funds from a loan, accounting for interest and principal respectively.
- Accept terms of refinancing.
- Perform repossession of funds and collateral from a Loan that is in default, transferring the funds to a Liquidator contract.
- Set the allowed slippage and minimum price of collateral to be used by the liquidator contract.
- Claim recovered funds from a liquidation, accounting for the amount that was recovered as principal in the context of the Pool, and registering the shortfall.
The DebtLocker
contract is deployed using the MapleProxyFactory
, which can be found in the modules or on GitHub here.
MapleProxyFactory
inherits from the generic ProxyFactory
contract which can be found here.
git clone git@github.com:maple-labs/debt-locker.git
cd debt-locker
dapp update
- To run all tests:
make test
(runs./test.sh
) - To run a specific test function:
./test.sh -t <test_name>
(e.g.,./test.sh -t test_setAllowedSlippage
) - To run tests with a specified number of fuzz runs:
./test.sh -r <runs>
(e.g.,./test.sh -t test_setAllowedSlippage -r 10000
)
This project was built using dapptools.
- Governor: Controls all implementation-related logic in the DebtLocker, allowing for new versions of proxies to be deployed from the same factory and upgrade paths between versions to be allowed.
- Pool Delegate: Can perform the following actions:
- Claim funds
- Set allowed slippage and minimum price for liquidations
- Trigger default
- Set the auctioneer (dictates price for liquidations) to another contract
- Accept refinance terms
- Set
fundsToCapture
, a variable that represents extra funds in the DebtLocker that should be sent to the Pool and registered as interest.
Maple Finance is a decentralized corporate credit market. Maple provides capital to institutional borrowers through globally accessible fixed-income yield opportunities.
For all technical documentation related to the currently deployed Maple protocol, please refer to the maple-core GitHub wiki.