PayoutPool
Source: contracts/peripherals/PayoutPool.sol · Guide: settlement · Upgradeable (UUPS proxy)
Functions that change state
Function
Who can call
Also
distributeCarry()Anyone
drawForDueClaim()Anyone
fund(uint256 amount)onlyRole(FUNDER_ROLE)grantRole(bytes32 role, address account)The role's admin role (
DEFAULT_ADMIN_ROLE unless set otherwise)initialize(address admin, address _stableCredit, address _reserveToken, address _merchantRegistry, address _coopTreasury)Once, when the proxy is initialised
payNext()Anyone
payQueue(uint256 maxClaims)Anyone
payRefund(address member, uint256 amount)Checked inside the function
payRefundsOwed()Anyone
receiveRepayment(uint256 amount)Checked inside the function
redeem(uint256 amount)Anyone; acts on the caller's own account
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)setBondVault(address vault)onlyRole(OPERATOR_ROLE)setCoopIncomeRecipient(address recipient)onlyRole(OPERATOR_ROLE)setCoopTreasury(address treasury)onlyRole(OPERATOR_ROLE)setLenders(address yieldPool_, address reserve_)onlyRole(OPERATOR_ROLE)upgradeTo(address newImplementation)onlyRole(DEFAULT_ADMIN_ROLE) (via _authorizeUpgrade)upgradeToAndCall(address newImplementation, bytes data)onlyRole(DEFAULT_ADMIN_ROLE) (via _authorizeUpgrade)payable
withdrawCapital(uint256 amount, address to)Anyone; acts on the caller's own account
withdrawCoopIncome(uint256 amount)onlyRole(OPERATOR_ROLE)Read functions
Anyone can call these; they change nothing.
Function
Returns
advancedOf(address)uint256
advancedTotal()uint256
bondVault()address
borrowed()uint256
borrowedFromReserve()uint256
borrowedFromVault()uint256
borrowedFromYield()uint256
canPayNext()bool
capitalOf(address)uint256
carryEarned()uint256
claimAt(uint256 claimId)address merchant, uint256 amount, uint64 claimedAt, uint64 dueBy, bool paid
claimCount()uint256
claimsOwnedBy(address merchant)uint256[]
coopIncomeRecipient()address
coopTreasury()address
DEFAULT_ADMIN_ROLE()bytes32
distributableCarry()uint256
FUNDER_ROLE()bytes32
fundersWithCapital()address[]
getRoleAdmin(bytes32 role)bytes32
hasRole(bytes32 role, address account)bool
held()uint256
idleCapitalOf(address funder)uint256
inFlight()uint256
memberFunded()uint256
merchantRegistry()address
nextUnpaid()uint256
OPERATOR_ROLE()bytes32
proxiableUUID()bytes32
queuedTotal()uint256
redeemableOf(address merchant)uint256
refundOwedOf(address member)uint256
refundsOwed()uint256
reserve()address
reserveToken()address
shortfall()uint256
stableCredit()address
supportsInterface(bytes4 interfaceId)bool
treasuryAvailable()uint256
unencumbered()uint256
yieldPool()address
Events
Event
AdminChanged(address previousAdmin, address newAdmin)BeaconUpgraded(address beacon indexed)BondVaultUpdated(address bondVault indexed)CapitalWithdrawn(address funder indexed, address to indexed, uint256 amount)CarryPaid(address to indexed, uint256 amount)ClaimPaid(uint256 claimId indexed, address merchant indexed, uint256 amount)CoopIncomeRecipientUpdated(address recipient indexed)CoopIncomeWithdrawn(address paidTo indexed, uint256 amount)DrewFromBondVault(uint256 amount)DrewFromReserve(uint256 amount)DrewFromTreasury(uint256 amount)DrewFromYieldPool(uint256 amount)Funded(address from indexed, uint256 amount)Initialized(uint8 version)InterestPaid(address lender indexed, uint256 amount)LendersUpdated(address yieldPool indexed, address reserve indexed)PositionAdvanced(address funder indexed, uint256 amount)PositionSettled(uint256 amount)Redeemed(address merchant indexed, uint256 amount, bool paidNow, uint256 claimId)RefundPaid(address member indexed, uint256 amount)RefundQueued(address member indexed, uint256 amount)RepaidBondVault(uint256 amount)RepaidReserve(uint256 amount)RepaidYieldPool(uint256 amount)RoleAdminChanged(bytes32 role indexed, bytes32 previousAdminRole indexed, bytes32 newAdminRole indexed)RoleGranted(bytes32 role indexed, address account indexed, address sender indexed)RoleRevoked(bytes32 role indexed, address account indexed, address sender indexed)ShortfallReported(uint256 shortfall)Upgraded(address implementation indexed)Errors
Error
PayoutPoolClaimAlreadyPaid(uint256 claimId)PayoutPoolClaimNotDue(uint256 claimId, uint64 dueBy)PayoutPoolInsufficientFunds(uint256 held, uint256 required)PayoutPoolInvalidAddress()PayoutPoolMerchantInactive(address merchant)PayoutPoolNothingToRedeem(address merchant)PayoutPoolOutOfOrder(uint256 claimId, uint256 expected)