EscrowBits
The EscrowBits
library provides utility functions for handling and interpreting escrow-related outcomes within the Atlas Protocol. It defines constants representing various solver outcomes and offers functions to determine the execution status based on these outcomes. This library is integral for managing escrow reconciliations and ensuring that funds are appropriately handled in different solver scenarios.
State Variables
Variable | Type | Description |
---|---|---|
_NO_REFUND | uint256 | Represents scenarios where no gas refund is owed to the solver. |
_PARTIAL_REFUND | uint256 | Represents scenarios where a partial gas refund is owed to the solver. |
_FULL_REFUND | uint256 | Represents scenarios where a full gas refund is owed to the solver after execution. |
Functions
canExecute
Signature:
function canExecute(uint256 result) internal pure returns (bool)
Parameters:
Name | Type | Description |
---|---|---|
result | uint256 | The outcome result code to evaluate. |
Returns:
Name | Type | Description |
---|---|---|
bool | bool | Indicates if the operation can be executed. |
partialRefund
Signature:
function partialRefund(uint256 result) internal pure returns (bool)
Parameters:
Name | Type | Description |
---|---|---|
result | uint256 | The outcome result code to evaluate. |
function partialRefund(uint256 result) internal pure returns (bool) |
Parameters:
Name | Type | Description |
---|---|---|
result | uint256 | The outcome result code to evaluate. |
Returns:
Name | Type | Description |
---|---|---|
bool | bool | Indicates if a partial refund is required. |
executionSuccessful
Signature:
function executionSuccessful(uint256 result) internal pure returns (bool)
Parameters:
Name | Type | Description |
---|---|---|
result | uint256 | The outcome result code to evaluate. |
Returns:
Name | Type | Description |
---|---|---|
bool | bool | Indicates if the execution was successful. |
executedWithError
Signature:
function executedWithError(uint256 result) internal pure returns (bool)
Parameters:
Name | Type | Description |
---|---|---|
result | uint256 | The outcome result code to evaluate. |
Returns:
Name | Type | Description |
---|---|---|
bool | bool | Indicates if the execution resulted in an error. |
bundlersFault
Signature:
function bundlersFault(uint256 result) internal pure returns (bool)
Parameters:
Name | Type | Description |
---|---|---|
result | uint256 | The outcome result code to evaluate. |
Returns:
Name | Type | Description |
---|---|---|
bool | bool | Indicates if the fault is due to the bundler and no solver refund is required. |