AssurancePoolV2
Source: contracts/peripherals/AssurancePool.sol · Guide: reserve · Upgradeable (UUPS proxy)
Functions that change state
Function
Who can call
Also
addCompartment(bytes32 id)Anyone
approveAction(bytes32 action)Checked inside the function
approveDraw(uint256 drawId, uint256 approvedAmount)onlySignerdeposit(uint8 sourceTag, uint256 amount)Anyone; acts on the caller's own account
nonReentrantexecuteTransfer(uint256 transferId)onlySignerwhenNotPausedinitialize(address asset_, address governance_, address registry_, address[] signers_)Once, when the proxy is initialised
pause()Anyone; acts on the caller's own account
proposeTransfer(bytes32 from, bytes32 to, uint256 amount, bytes32 resolutionHash)onlySignerreleaseAssurance(bytes32 grantId, uint256 amount, bytes32 evidenceHash)Anyone
nonReentrantreleaseDraw(uint256 drawId)onlySignerwhenNotPaused, nonReentrantremoveCompartment(bytes32 id)Anyone
renewPause()Anyone; acts on the caller's own account
requestDraw(uint256 periodId, uint256 amount, bytes32 evidenceHash)Checked inside the function
setAllocation(uint16[] bps)Anyone
setAssuranceDisbursementAddress(address disbursement)Anyone
setExposureSources(address[] sources)Anyone
setFloorBps(uint256 floorBps_)Anyone
setFloorInputs(uint256 shortfall, uint256 cap, uint256 attestedBook, bytes32 evidenceHash)Checked inside the function
setGovernance(address governance_)Anyone
setLendingCoAddresses(address draw_, address lossReserve_)Anyone
setNetworkRegistry(address registry)Anyone
setPayer(address payer, uint256 sourceTagMask)Anyone
setSigner(address signer, bool allowed)Anyone
setTransferDelay(uint256 delay)Anyone
unpause()Anyone; acts on the caller's own account
upgradeTo(address newImplementation)Whoever
_authorizeUpgrade allowsupgradeToAndCall(address newImplementation, bytes data)Whoever
_authorizeUpgrade allowspayable
Read functions
Anyone can call these; they change nothing.
Function
Returns
allocationOf(bytes32 compartment)uint256
allocationYear()uint256
approvedAction(bytes32)bool
approvedUnpaidDraws()uint256
asset()address
assuranceDisbursementAddress()address
attestedCoveredBook()uint256
availableCoverage()uint256
backstopBalance()uint256
backstopFloor()uint256
balanceOf(bytes32 compartment)uint256
BPS()uint256
compartments()bytes32[]
coverageCap()uint256
coveredBookPrincipal()uint256 covered
CREDIT_BACKSTOP()bytes32
currentProgramYear()uint256
drawAddress()address
drawAt(uint256 drawId)(uint64,uint8,address,uint128,uint128,bytes32)
drawCount()uint256
drawOfPeriod(uint256)uint256
exposureSourceList()address[]
floorBps()uint256
floorEvidenceHash()bytes32
floorInputsAt()uint256
governance()address
grantPaid(bytes32)bool
isSigner(address)bool
lossReserveAddress()address
MAX_COMPARTMENTS()uint256
MAX_EXPOSURE_SOURCES()uint256
MEMBER_ASSURANCE()bytes32
MIN_GOVERNANCE_DELAY()uint256
MIN_SIGNERS()uint256
MIN_TRANSFER_DELAY()uint256
networkRegistry()address
nextDraw()uint256
PAUSE_WINDOW()uint256
paused()bool
pausedUntil()uint256
pauseEpoch()uint256
payerTags(address)uint256
pendingDrawRequests()uint256
PROGRAM_YEAR()uint256
programYearStart()uint256
proposerOf(bytes32)address
proxiableUUID()bytes32
signerCount()uint256
timingBufferShortfall()uint256
totalAccounted()uint256
transferAt(uint256 transferId)(bytes32,bytes32,uint256,bytes32,address,uint64,bool)
transferCount()uint256
transferDelay()uint256
Events
Event
ActionApproved(bytes32 action indexed, address proposer indexed, address approver indexed)ActionProposed(bytes32 action indexed, address proposer indexed)AdminChanged(address previousAdmin, address newAdmin)AllocationSet(uint256 programYear indexed, bytes32[] compartments, uint16[] bps)AssuranceDisbursementAddressSet(address disbursement indexed)AssuranceReleased(bytes32 grantId indexed, uint256 amount, bytes32 evidenceHash, address to indexed, address approver)BeaconUpgraded(address beacon indexed)CompartmentAdded(bytes32 compartment indexed)CompartmentCredited(uint8 sourceTag indexed, bytes32 compartment indexed, uint256 amount)CompartmentRemoved(bytes32 compartment indexed)DrawApproved(uint256 drawId indexed, uint256 approvedAmount, address approver indexed)DrawReleased(uint256 drawId indexed, uint256 amount, address to indexed, address releaser indexed)DrawRequested(uint256 drawId indexed, uint256 periodId indexed, uint256 amount, bytes32 evidenceHash)ExposureSourcesSet(address[] sources)FloorBpsSet(uint256 floorBps)FloorInputsSet(uint256 timingBufferShortfall, uint256 coverageCap, uint256 attestedCoveredBook, bytes32 evidenceHash indexed, address proposer, address approver)GovernanceSet(address governance indexed)Initialized(uint8 version)LendingCoAddressesSet(address drawAddress indexed, address lossReserveAddress indexed)NetworkRegistrySet(address registry indexed)PayerSet(address payer indexed, uint256 sourceTagMask)SecurityPaused(uint256 until, address proposer, address approver)SecurityUnpaused(address proposer, address approver)SignerSet(address signer indexed, bool allowed)TransferDelaySet(uint256 delay)TransferExecuted(uint256 transferId indexed, bytes32 from indexed, bytes32 to indexed, uint256 amount, address executor)TransferProposed(uint256 transferId indexed, bytes32 from indexed, bytes32 to indexed, uint256 amount, bytes32 resolutionHash, address proposer)Upgraded(address implementation indexed)Errors
Error
AssurancePoolAboveCoverage(uint256 amount, uint256 available)AssurancePoolBackstopShareLowered(uint256 current, uint256 proposed)AssurancePoolBadAllocation()AssurancePoolBadDrawState(uint256 drawId)AssurancePoolBadTransfer(uint256 transferId)AssurancePoolBelowFloor(uint256 backstopBalance, uint256 required)AssurancePoolCompartmentExists(bytes32 compartment)AssurancePoolCompartmentFixed(bytes32 compartment)AssurancePoolCompartmentNotEmpty(bytes32 compartment)AssurancePoolCompartmentShort(bytes32 compartment, uint256 balance, uint256 amount)AssurancePoolDrawOutOfOrder(uint256 drawId, uint256 next)AssurancePoolGovernanceDelayTooShort(uint256 delay)AssurancePoolGrantAlreadyPaid(bytes32 grantId)AssurancePoolInvalidAddress()AssurancePoolInvalidAmount()AssurancePoolMoneyPath(address account)AssurancePoolNotApproved(bytes32 action)AssurancePoolNotDrawAddress(address caller)AssurancePoolNotGovernance(address caller)AssurancePoolNotPaused()AssurancePoolNotPayer(address payer, uint8 sourceTag)AssurancePoolNotSigner(address caller)AssurancePoolPaused(uint256 until)AssurancePoolPeriodAlreadyDrawn(uint256 periodId)AssurancePoolRoleConflict(address account)AssurancePoolSameSigner(address signer)AssurancePoolTooFewSigners()AssurancePoolTooManyCompartments()AssurancePoolTransferTooEarly(uint256 executableAt)AssurancePoolUnknownCompartment(bytes32 compartment)