Verified contractExactBUSL-1.1
ConservativeExitImpairmentSource
Address0x43854ee26d293d9f5e4b01045ed4c2013964e8cc
- Balance
0 ETH
- Transactions
1
- Compiler
solc 0.8.30
- Same code
Only this contract
Details
- Compiler
- solc 0.8.30+commit.73712a01
- Language
- solidity
- Optimization
- Yes, 100 runs
- EVM version
- cancun
- License
- BUSL-1.1
- Match
- Exactcreation code: yes, runtime code: yes
- Verified on Sourcify
- Created in block
- 26,459,524
- Creation transaction
- 0xb42ef37b29…425e88ed9e
2 files
src/ConservativeExitImpairmentSource.sol
// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.30;
import {IImpairmentSource} from "./interfaces/IImpairmentSource.sol";
interface IAssessedBaseSource is IImpairmentSource {
/// @notice Conservative credit book to which this assessment currently refers.
function baseSource() external view returns (address);
}
/// @notice Prices every sUSDfr exit at the zero-recovery senior mark while retaining
/// an independently assessed performance-fee mark where it is safe to do so.
/// @dev An immutable adapter for sUSDfr.setImpairmentSource. It does not change the
/// existing assessment proxy or grant a new role. If governance repoints the
/// assessment to another base, fee accounting falls back to this base; exits
/// continue to read this base directly. No funds or approvals are held here.
contract ConservativeExitImpairmentSource is IImpairmentSource {
/// @notice Permanent conservative credit book used for every exit mark.
IImpairmentSource public immutable base;
/// @notice Assessment source used only for this book's performance-fee mark.
IAssessedBaseSource public immutable assessed;
/// @notice Both configured sources must be deployed contracts.
error ConservativeExit_ZeroOrCodelessSource();
/// @notice The assessment is bound to a different conservative credit book.
/// @param expected The configured conservative source.
/// @param actual The assessment's reported base source.
error ConservativeExit_AssessmentBaseMismatch(address expected, address actual);
/// @notice Binds immutable conservative and assessed source contracts for this vault.
/// @param base_ The manager supplying the conservative senior and gross fee marks.
/// @param assessed_ The existing assessment source, initially bound to base_.
constructor(address base_, address assessed_) {
if (base_ == address(0) || assessed_ == address(0) || base_.code.length == 0 || assessed_.code.length == 0) {
revert ConservativeExit_ZeroOrCodelessSource();
}
address actual = IAssessedBaseSource(assessed_).baseSource();
if (actual != base_) revert ConservativeExit_AssessmentBaseMismatch(base_, actual);
base = IImpairmentSource(base_);
assessed = IAssessedBaseSource(assessed_);
}
/// @inheritdoc IImpairmentSource
function unresolvedPastDueExposure() external view returns (uint256) {
return base.unresolvedPastDueExposure();
}
/// @inheritdoc IImpairmentSource
function pendingSeniorImpairment() external view returns (uint256) {
return base.pendingSeniorImpairment();
}
/// @inheritdoc IImpairmentSource
function performanceFeeImpairment() external view returns (uint256) {
uint256 conservative = base.pendingSeniorImpairment();
uint256 fee = base.performanceFeeImpairment();
// A deliberately repointed assessment no longer belongs to this vault's credit
// book. An unreadable assessment fails loudly, as does the original fee source.
if (assessed.baseSource() == address(base)) fee = assessed.performanceFeeImpairment();
return fee < conservative ? conservative : fee;
}
}
src/interfaces/IImpairmentSource.sol
// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.30;
/// @title IImpairmentSource — declared-but-unrealized senior impairment (ADR-0022 Option Y)
/// @notice The minimal surface the senior vault needs to price redemptions conservatively
/// and keep junior-capital changes out of performance-fee profit. Deliberately narrow:
/// the token layer must not depend on the whole credit layer, and a future implementation
/// (a governance-set manual mark or an aggregator over several credit books) can satisfy
/// this without being a DefaultManager.
/// @dev `pendingSeniorImpairment` is the senior (`sUSDfr`) principal impaired AFTER the junior
/// cascade layers absorb in strict order. `performanceFeeImpairment` removes any temporary
/// uplift supplied by those junior layers from the performance-fee base. See ADR-0022 §Y
/// and ADR-0031.
interface IImpairmentSource {
/// @notice Reversible, unattested past-due face that forbids destructive sUSDfr settlement.
/// @dev Zero only after verified servicing/cure or conversion to an attested legal default.
/// Price and oracle reads remain available while this value is nonzero.
function unresolvedPastDueExposure() external view returns (uint256);
/// @notice Senior principal impaired by declared-but-unrealized defaults, net of junior capacity.
/// @return The impairment in USDfr (18 decimals); zero when the junior layers fully cover.
function pendingSeniorImpairment() external view returns (uint256);
/// @notice Impairment deducted when measuring protocol-level performance-fee profit.
/// @dev Must be greater than or equal to `pendingSeniorImpairment()`. The difference is
/// fee-neutral junior-capital or valuation credit: it can improve redemption protection
/// but cannot itself be charged as senior investment performance. A professional
/// assessment may snapshot a lower value that recognizes supported recovery while
/// preserving the junior-capital credit standing when that assessment was published.
/// @return The performance-fee impairment in USDfr (18 decimals).
function performanceFeeImpairment() external view returns (uint256);
}
Compiler settingsShow
{
"metadata": {
"bytecodeHash": "ipfs"
},
"libraries": {},
"optimizer": {
"runs": 100,
"enabled": true
},
"evmVersion": "cancun",
"remappings": [
"@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/",
"@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/",
"erc4626-tests/=lib/openzeppelin-contracts-upgradeable/lib/erc4626-tests/",
"forge-std/=lib/forge-std/src/",
"halmos-cheatcodes/=lib/openzeppelin-contracts-upgradeable/lib/halmos-cheatcodes/src/",
"openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/",
"openzeppelin-contracts/=lib/openzeppelin-contracts/",
"solady/=lib/solady/src/"
]
}Source code and metadata: Sourcify.
The source code belongs to the authors of the contract.