Skip to content
ClearClear
Docs
Protocol/EarnControls

EarnControls

Source: contracts/peripherals/EarnControls.sol · Upgradeable (UUPS proxy)

6 min readView source

On this page
Network
Chain id
Address
Base Sepolia
84532

Functions that change state

Function
Who can call
Also
applyRung(uint32 termDays)
Not in the current source
applyRungs(uint32[] termDays)
Not in the current source
approveSuccessorTransfer(address from, address to, bytes32 evidenceHash)
Not in the current source
attestEligibility(address account, bytes attestation)
Anyone
cancelPaymentSuccessor()
Not in the current source
checkPurchase(address payer, address holder, uint256 purchasePrice, uint256 maturityAmount, uint32 termDays, bytes attestation)
onlyRole(BOND_ROLE)
checkSubscription(address payer, address receiver, uint256 assets, bytes attestation)
Checked inside the function
grantRoleByResolution(bytes32 role, address account, bytes32 resolutionHash)
Not in the current source
initialize((address,uint8,address,uint256,bytes32,uint16,uint256,uint256,uint256) s)
Once, when the proxy is initialised
postOtherIndebtedness(uint256 amount, bytes32 evidenceHash)
Anyone; acts on the caller's own account
recordBondExit(address holder, uint256 purchasePrice)
onlyRole(BOND_ROLE)
registerPaymentSuccessor(address holder, address payee, bytes32 evidenceHash)
Not in the current source
renounceRole(bytes32 role, address account)
Only the account renouncing its own role
renounceRole(bytes32 role, address account)
Only the account renouncing its own role
revokeRole(bytes32 role, address account)
The role's admin role (DEFAULT_ADMIN_ROLE unless set otherwise)
revokeRole(bytes32 role, address account)
The role's admin role (DEFAULT_ADMIN_ROLE unless set otherwise)
scheduleHolderCapFloor(uint256 floor)
Not in the current source
scheduleRung(uint32 termDays, uint32 yieldBps, bool offered)
Not in the current source
scheduleRungs(uint32[] termDays, uint32[] yieldBps, bool[] offered)
Not in the current source
setBondBooks(address[] books)
Not in the current source
setFundingLimit(uint256 limit, bytes32 resolutionHash, uint16 fiscalYear)
Not in the current source
setHolderCapBps(uint256 bps)
Not in the current source
setHolderIneligible(address holder, bool ineligible, bytes32 evidenceHash)
Not in the current source
setHousehold(address account, bytes32 household)
Not in the current source
setMaxTermMonths(uint8 months)
Not in the current source
setOfferingLimits(uint256 cap, uint256 capacity, bytes32 resolutionHash)
Not in the current source
setPauseFlag(uint8 flag, bool on, bytes32 reasonHash)
Anyone; acts on the caller's own account
setRefused(address account, bool isRefused)
Not in the current source
setRung(uint32 termDays, uint32 yieldBps, bool offered)
Not in the current source
setSources(address membership_, address yieldPool_, address reserveStatus_, address collateralAgent_, address reserveHook_)
Not in the current source
upgradeTo(address newImplementation)
onlyRole(DEFAULT_ADMIN_ROLE) (via _authorizeUpgrade)
upgradeTo(address newImplementation)
onlyRole(DEFAULT_ADMIN_ROLE) (via _authorizeUpgrade)
upgradeToAndCall(address newImplementation, bytes data)
onlyRole(DEFAULT_ADMIN_ROLE) (via _authorizeUpgrade)
payable
upgradeToAndCall(address newImplementation, bytes data)
onlyRole(DEFAULT_ADMIN_ROLE) (via _authorizeUpgrade)
payable

Read functions

Anyone can call these; they change nothing.

Function
Returns
adminModule()
address
ATTESTATION_TYPEHASH()
bytes32
attestationDigest(address account, bytes32 exemptionCode, uint256 netWorth, uint64 issuedAt, uint64 validUntil)
bytes32
ATTESTER_ROLE()
bytes32
ATTESTER_ROLE()
bytes32
BOND_ROLE()
bytes32
BOND_ROLE()
bytes32
bondBooks()
address[]
collateralAgent()
address
collateralAgent()
address
DEFAULT_ADMIN_ROLE()
bytes32
DEFAULT_ADMIN_ROLE()
bytes32
DEFAULT_MAX_TERM_MONTHS()
uint32
earnCostOf(address account)
(uint128,uint128,uint256)
eip712Domain()
bytes1 fields, string name, string version, uint256 chainId, address verifyingContract, bytes32 salt, uint256[] extensions
eip712Domain()
bytes1 fields, string name, string version, uint256 chainId, address verifyingContract, bytes32 salt, uint256[] extensions
ELIGIBILITY_ROLE()
bytes32
ELIGIBILITY_ROLE()
bytes32
eligibilityOf(address account)
(bytes32,address,uint64,uint64,uint256)
eligibleCode(address account)
bytes32
EQUITY_CUSHION()
uint8
EQUITY_CUSHION()
uint8
extensionKind()
bytes32
FUNDING_ROLE()
bytes32
FUNDING_ROLE()
bytes32
fundingLimit()
uint256
fundingLimit()
uint256
fundingLimitFiscalYear()
uint16
fundingLimitFiscalYear()
uint16
fundingLimitResolution()
bytes32
fundingLimitResolution()
bytes32
fundingUsed()
uint256 used
getRoleAdmin(bytes32 role)
bytes32
getRoleAdmin(bytes32 role)
bytes32
grantRole(bytes32, address)
—
grantRole(bytes32, address)
—
hasRole(bytes32 role, address account)
bool
hasRole(bytes32 role, address account)
bool
HOLDER_CAP_FLOOR_DELAY()
uint64
HOLDER_CAP_FLOOR_DELAY()
uint64
holderCapBps()
uint256
holderCapBps()
uint256
holderCapFloor()
uint256
holderIneligible(address)
bool
holderIneligible(address)
bool
householdMembers(bytes32 household)
address[]
householdOf(uint256)
bytes32
householdOf(uint256)
bytes32
isTermOffered(uint32 termDays)
bool
LADDER_DELAY()
uint64
LADDER_DELAY()
uint64
LADDER_ROLE()
bytes32
LADDER_ROLE()
bytes32
ladderTerms()
uint32[]
ladderYieldBps(uint32 termDays)
uint32
LIMIT_TERM_MONTHS()
uint32
LOW_UTILIZATION_RULE()
uint8
LOW_UTILIZATION_RULE()
uint8
LOW_UTILIZATION_WINDOW()
uint64
MAX_ATTESTATION_LIFE()
uint64
MAX_ATTESTATION_LIFE()
uint64
MAX_BOND_BOOKS()
uint256
MAX_HOUSEHOLD()
uint256
MAX_LADDER_TERMS()
uint256
MAX_TERM_DAYS()
uint32
MAX_YIELD_BPS()
uint32
maxTermMonths()
uint32
memberKeyOf(address account)
uint256
memberKeyOf(address account)
uint256
membership()
address
membership()
address
memberWalletsOf(address account)
address[] wallets
memberWalletsOf(address account)
address[] wallets
MIN_PURCHASE_DOLLARS()
uint256
MIN_TERM_MONTHS()
uint32
monthsToDays(uint32 months)
uint32
NET_WORTH_LIMIT_BPS()
uint256
offeringCap()
uint256
offeringCap()
uint256
offeringTaken()
uint256
offeringTaken()
uint256
otherIndebtedness()
uint256
otherIndebtedness()
uint256
otherIndebtednessEvidence()
bytes32
otherIndebtednessEvidence()
bytes32
PAUSE_ROLE()
bytes32
PAUSE_ROLE()
bytes32
pauseFlags()
uint8
pauseFlags()
uint8
PAYEE_DELAY()
uint64
PAYEE_DELAY()
uint64
payeeOf(address holder)
address
paymentSuccessorOf(address holder)
(address,uint64,bytes32)
pendingHolderCapFloor()
uint256 floor, uint64 effectiveAt
pendingRung(uint32 termDays)
uint32 yieldBps, bool offered, uint64 effectiveAt
poolCapacity()
uint256
poolCapacity()
uint256
proxiableUUID()
bytes32
proxiableUUID()
bytes32
purchasesPaused()
bool
refused(address)
bool
refused(address)
bool
RESERVE_SHORTFALL()
uint8
RESERVE_SHORTFALL()
uint8
reserveHook()
address
reserveHook()
address
reserveStatus()
address
reserveStatus()
address
rollAllowed()
bool
rollTermFor(uint32 termDays)
uint32 best
rollYieldFor(uint32 rollTerm, uint32 noticeYieldBps)
uint32
rungAt(uint32 termDays, uint64 at)
uint32 yieldBps, bool offered
sameHolder(address a, address b)
bool
sameHolder(address a, address b)
bool
subscriptionsPaused()
bool
SUCCESSOR_ROLE()
bytes32
SUCCESSOR_ROLE()
bytes32
SUCCESSOR_WINDOW()
uint64
SUCCESSOR_WINDOW()
uint64
successorTransfer(address from, address to)
(uint64,bytes32)
supportsInterface(bytes4 interfaceId)
bool
supportsInterface(bytes4 interfaceId)
bool
transferAllowed(address from, address to)
bool
unit()
uint256
unit()
uint256
walletsOf(address account)
address[] all
yieldPool()
address
yieldPool()
address

Events

Event
ActionApproved(bytes32 action indexed, address proposer indexed, address approver indexed)
ActionApproved(bytes32 action indexed, address proposer indexed, address approver indexed)
ActionProposed(bytes32 action indexed, address proposer indexed)
ActionProposed(bytes32 action indexed, address proposer indexed)
AdminChanged(address previousAdmin, address newAdmin)
AdminChanged(address previousAdmin, address newAdmin)
BeaconUpgraded(address beacon indexed)
BeaconUpgraded(address beacon indexed)
BondBooksSet(address[] books)
BondBooksSet(address[] books)
EarnCostRecorded(uint256 memberKey indexed, uint256 poolCost, uint256 bondCost)
EarnCostRecorded(uint256 memberKey indexed, uint256 poolCost, uint256 bondCost)
EIP712DomainChanged()
EIP712DomainChanged()
EligibilityAttested(address account indexed, address attester indexed, bytes32 exemptionCode, uint256 netWorth, uint64 issuedAt, uint64 validUntil)
EligibilityAttested(address account indexed, address attester indexed, bytes32 exemptionCode, uint256 netWorth, uint64 issuedAt, uint64 validUntil)
HolderCapFloorScheduled(uint256 current, uint256 next, uint64 effectiveAt)
HolderCapFloorScheduled(uint256 current, uint256 next, uint64 effectiveAt)
HolderIneligibleSet(address holder indexed, bool ineligible, bytes32 evidenceHash)
HolderIneligibleSet(address holder indexed, bool ineligible, bytes32 evidenceHash)
HouseholdSet(uint256 memberKey indexed, address account indexed, bytes32 household indexed)
HouseholdSet(uint256 memberKey indexed, address account indexed, bytes32 household indexed)
Initialized(uint8 version)
Initialized(uint8 version)
OfferingTaken(address holder indexed, bool pool indexed, uint256 amount, uint256 taken)
OfferingTaken(address holder indexed, bool pool indexed, uint256 amount, uint256 taken)
OtherIndebtednessPosted(uint256 amount, bytes32 evidenceHash, address proposer, address approver)
OtherIndebtednessPosted(uint256 amount, bytes32 evidenceHash, address proposer, address approver)
PauseFlagSet(uint8 flag indexed, bool on, bytes32 reasonHash, address proposer, address approver)
PauseFlagSet(uint8 flag indexed, bool on, bytes32 reasonHash, address proposer, address approver)
PaymentSuccessorCancelled(address holder indexed, address payee indexed)
PaymentSuccessorCancelled(address holder indexed, address payee indexed)
PaymentSuccessorRegistered(address holder indexed, address payee indexed, bytes32 evidenceHash, uint64 effectiveAt)
PaymentSuccessorRegistered(address holder indexed, address payee indexed, bytes32 evidenceHash, uint64 effectiveAt)
RefusedSet(address account indexed, bool refused)
RefusedSet(address account indexed, bool refused)
RoleAdminChanged(bytes32 role indexed, bytes32 previousAdminRole indexed, bytes32 newAdminRole indexed)
RoleAdminChanged(bytes32 role indexed, bytes32 previousAdminRole indexed, bytes32 newAdminRole indexed)
RoleGranted(bytes32 role indexed, address account indexed, address sender indexed)
RoleGranted(bytes32 role indexed, address account indexed, address sender indexed)
RoleGrantedByResolution(bytes32 role indexed, address account indexed, bytes32 resolutionHash indexed)
RoleGrantedByResolution(bytes32 role indexed, address account indexed, bytes32 resolutionHash indexed)
RoleRevoked(bytes32 role indexed, address account indexed, address sender indexed)
RoleRevoked(bytes32 role indexed, address account indexed, address sender indexed)
RungScheduled(uint32 termDays indexed, uint32 yieldBps, bool offered, uint64 effectiveAt, address proposer, address approver)
RungScheduled(uint32 termDays indexed, uint32 yieldBps, bool offered, uint64 effectiveAt, address proposer, address approver)
RungSet(uint32 termDays indexed, uint32 yieldBps, bool offered)
RungSet(uint32 termDays indexed, uint32 yieldBps, bool offered)
SettingsSet(bytes32 what indexed, uint256 value, bytes32 resolutionHash)
SettingsSet(bytes32 what indexed, uint256 value, bytes32 resolutionHash)
SourcesSet(address membership, address yieldPool, address reserveStatus, address collateralAgent, address reserveHook)
SourcesSet(address membership, address yieldPool, address reserveStatus, address collateralAgent, address reserveHook)
SuccessorTransferApproved(address from indexed, address to indexed, bytes32 evidenceHash, uint64 openUntil)
SuccessorTransferApproved(address from indexed, address to indexed, bytes32 evidenceHash, uint64 openUntil)
Upgraded(address implementation indexed)
Upgraded(address implementation indexed)

Errors

Error
EarnControlsBadAttestation()
EarnControlsBadAttestation()
EarnControlsBelowMinimum(uint256 purchasePrice)
EarnControlsBelowMinimum(uint256 purchasePrice)
EarnControlsHolderCap(address receiver, uint256 held, uint256 limit)
EarnControlsHolderCap(address receiver, uint256 held, uint256 limit)
EarnControlsIneligible(address account)
EarnControlsIneligible(address account)
EarnControlsInvalidAddress()
EarnControlsInvalidAddress()
EarnControlsInvalidValue()
EarnControlsInvalidValue()
EarnControlsLadderOrder(uint32 shorterTerm, uint32 longerTerm)
EarnControlsLadderOrder(uint32 shorterTerm, uint32 longerTerm)
EarnControlsLimit(bytes32 what, uint256 used, uint256 adding, uint256 limit)
EarnControlsLimit(bytes32 what, uint256 used, uint256 adding, uint256 limit)
EarnControlsModuleMismatch()
EarnControlsModuleMismatch()
EarnControlsNotAuthorized(address caller)
EarnControlsNotAuthorized(address caller)
EarnControlsNothingToCancel(address holder)
EarnControlsNothingToCancel(address holder)
EarnControlsNotSameHolder(address payer, address receiver)
EarnControlsNotSameHolder(address payer, address receiver)
EarnControlsNotYet(uint64 effectiveAt)
EarnControlsNotYet(uint64 effectiveAt)
EarnControlsPaused()
EarnControlsPaused()
EarnControlsRefused(address account)
EarnControlsRefused(address account)
EarnControlsSameSigner(address signer)
EarnControlsSameSigner(address signer)
EarnControlsTermNotOffered(uint32 termDays)
EarnControlsTermNotOffered(uint32 termDays)
EarnControlsUseResolution()
EarnControlsUseResolution()