RequestManager

This contract manages things related to fund requests such as role controls, reguest location controls, approval checks, creating the request and so on.

Function Calls

RequestManager Contract Function Calls

functiondefinition
createRequestInitiates a request with requested amount from the fund, token address, ultimate recipient of the funds requested, id of the funds requested from, a short description of the request, coordinates pointing to request location. Returns the id of the initiated request which is a _createRequest function call.
approveCheckChecks if fund is approvable or if fund is open. If not reverts. Checks for approver role. If not reverts. Checks if request’s pending check count 0, if so sets the status of request with one of Pending, Approved, Finalized, Excuted. If status is executed at the beginning of the function, it reverts. If status is Approved at the end of function request will be finalized. Returns a Boolean indicating the result of the operation.
getStatusGets a request id as an input parameter and returns the status of request with this id.
getPendingChecksCountGets a request id as an input parameter and returns pending check count parameter’s value. It shows remaining checks for a request.
getSignerGets a request id and check id as input parameters and returns the signer address of that check for this request.
callOracleXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
_isApprovableReturns true if a request’s status is Pending and approval status of request’s signature for a specific check is false.
_isFundOpenGets a FundV1 clone as an input parameter and returns the result of isOpen function of clone. It is a Boolean indicator shows that if a fund is donatable or not.
_hasFundRoleGets a clone contracts and a role as input parameters and returns a Boolean indicator that shows if message.sender account has been granted role input.
_createRequestGets parameters from createRequest function. Allocates storage location for the new request and assign new request with parameters to the storage location. Emits a RequestCreated event with parameters and request checks. Returns request id.
_approveCheckGets a request, check id and success as input parameters, requires pending check count is greater than 0. If success is true, decreases pending check count value by 1. Signs the request for that specific check.
_bumpStatusChecks if status of request is reached at maximum index, which is executed. If not, increases the status index, pending-to-approved, approved-to-finalized or finalized-to-executed.
_getFundGets a fund id as an input parameter. Initialize a fund address value for fund manager. Returns a clone of FundV1 contract that has a fund address as an input parameter.
_copyChecksFromFundGets a FundV1 contract as an input parameter. Returns all checks for that fund.
_patchRequestWithCheckGets request id and check id as input parameters and returns encoded request id, status, location informations, recipient of request, fund id, amount and token.
Modifiers
RequestCreateddef
Signeddef
OracleRequestdef
StatusChangedef

Inheritance Flow

RequestManager Contract Inheritance Relations

Contracts Description Table

ContractTypeBases
Function NameVisibilityMutabilityModifiers
RequestManagerImplementationAccessControl, Registered
createRequestPublic ❗️🛑NO❗️
approveCheckPublic ❗️🛑NO❗️
getStatusExternal ❗️NO❗️
getPendingChecksCountExternal ❗️NO❗️
getSignerExternal ❗️NO❗️
callOracleExternal ❗️🛑NO❗️
_isApprovableInternal 🔒
_isFundOpenInternal 🔒
_hasFundRoleInternal 🔒
_createRequestInternal 🔒🛑
_approveCheckInternal 🔒🛑
_bumpStatusInternal 🔒🛑
_getFundInternal 🔒
_copyChecksFromFundInternal 🔒
_packRequestWithCheckPublic ❗️NO❗️

Legend

SymbolMeaning
🛑Function can modify state
💵Function is payable