Maximillion
Maximillion is a helper contract for repaying ETH (CEther) borrows in full without leaving dust behind.
Introduction
Why Maximillion exists
Because interest accrues every block, repaying an ETH borrow with the exact outstanding balance always under-pays by the interest accrued in the same block. Maximillion solves this by accepting an over-payment: it forwards the borrower's outstanding balance to the underlying CEther market and refunds any excess ETH back to the caller.
The CapyFi UI uses Maximillion when a user toggles "repay max" for their native ETH debt on networks where it is deployed.
Interface
Methods exposed by Maximillion
Constructor
constructor(address cEther)Deployed against the CEther market it repays into.
cLac()
function cLac() view returns (address)Returns the CEther market this Maximillion is bound to. (Named cLac for legacy reasons; semantically it's the cEther address.)
repayBehalf(address borrower)
function repayBehalf(address borrower) payableborrower: The account whose ETH borrow shall be repaid.
msg.value: ETH amount sent in (must be >= outstanding borrow). Excess is refunded to msg.sender.
repayBehalfExplicit(address borrower, address cEther)
function repayBehalfExplicit(address borrower, address cEther) payableSame as repayBehalf but lets the caller pass the target CEther market explicitly.
Deployed Addresses
Per-network deployments
0xF43cFfA839B35e0a48AE73800A2d8FF7973E05490x511E89CADa24C562277b880153fBB6E43dCb11a7Maximillion is a stateless helper — anyone can call it directly with the borrower's address and enough ETH. Integrators may surface it conditionally per network depending on their UX needs.