LubanCore Contract
LubanCore.sol
Manages preconfirmation requests, settles transactions, and handles the escrow system for the Taiyi protocol
Functions
batchSettleRequests
Settles multiple preconfirmation requests in a single transaction. This function processes a batch of preconfirmation requests, executing the associated transactions and handling the payment of tips. It’s designed to be called by the preconfirmer. Parameters:
Name | Type | Description |
---|---|---|
preconfReqs | PreconfRequest[] | An array of preconfirmation requests to be settled |
settleRequest
Settles a single PreconfRequest. This is the main function for validating and executing a preconfirmation request. The function will validate the request, execute the transaction, handle payments, and update the request status. Parameters:
Name | Type | Description |
---|---|---|
preconfReq | PreconfRequest | The PreconfRequest struct to be settled |
exhaust
Exhausts the gas to the point of gasLimit defined in TipTx iteratively, and transfers the prePayment to the preconfer. This function is used to prevent user “griefing” of the preconfer. It can only be called by the contract owner. Parameters:
Name | Type | Description |
---|---|---|
preconfReq | PreconfRequest | The PreconfRequest struct to be exhausted |
challengeRequests
hallenges multiple PreconfRequests in a single call. This function allows users to challenge PreconfRequests that may not have been properly executed or included in a block. Parameters:
Name | Type | Description |
---|---|---|
preconfReqs | PreconfRequest[] | An array of PreconfRequest structs to be challenged |
checkInclusion
Checks if a PreconfRequest has been included in a block. Returns:
Type | Description | |
---|---|---|
bool | True if the PreconfRequest has been included, false otherwise | |
Parameters: | ||
Name | Type | Description |
------ | ------ | ------------- |
preconfRequestHash | bytes32 | The hash of the PreconfRequest to check |
getPreconfRequestStatus
Gets the status of a PreconfRequest. Returns:
Type | Description | |
---|---|---|
PreconfRequestStatus | The current status of the PreconfRequest | |
Parameters: | ||
Name | Type | Description |
------ | ------ | ------------- |
preconferSignature | bytes32 | The signature of the PreconfRequest |
collectTip
Collects the tip for a settled PreconfRequest. This function allows the preconfer to collect their tip after a PreconfRequest has been successfully settled. Parameters:
Name | Type | Description |
---|---|---|
preconferSignature | bytes32 | The signature of the PreconfRequest for which to collect the tip |