CallBreaker
CallBreaker.sol allows transactions to be queued and executed under specific conditions, such as external states or contract interactions.
Key Features:
- Queuing of Transactions: Facilitates the queuing of multiple transactions.
- Conditional Execution: Transactions are executed when predefined conditions are met.
- Event Emission: Emits events for significant actions.
How to Use in a Contract
To use the CallBreaker contract, import it and create an instance of it in your contract. Here's an example:
import "path-to/CallBreaker.sol";
contract ExampleContract {
CallBreaker private _callBreaker;
constructor(address callBreakerAddress) {
_callBreaker = CallBreaker(callBreakerAddress);
}
}
Functions
executeAndVerify
Verifies that the given calls, when executed, give the correct return values. It is only callable when the portal is closed and requires the caller to be an External Owned Account (EOA).
Parameters
Name | Type |
---|---|
callsBytes | bytes (calldata) |
returnsBytes | bytes (calldata) |
associatedData | bytes (calldata) |
hintdices | bytes (calldata) |
getReturnValue
Returns a value from the record of return values given the input.
Parameters
Name | Type |
---|---|
input | bytes (calldata) |
Returns
Name | Type |
---|---|
returnvalue | bytes (memory) |
fetchFromAssociatedDataStore
Fetches the value associated with a given key from the associatedDataStore.
Parameters
Name | Type |
---|---|
key | bytes32 |
Returns
Name | Type |
---|---|
value | bytes (memory) |
Events
EnterPortal
Emitted when the (enterPortal
function)[TODO] is called.
Parameters
Name | Type |
---|---|
callObj | CallObject |
returnvalue | ReturnObject |
index | uint256 |
Tip
Emitted when a tip is received.
Parameters
Name | Type |
---|---|
from | address (indexed) |
to | address (indexed) |
amount | uint256 |
VerifyStxn
Emitted when the verifyStxn function is called, indicating the completion of the verification process.
Modifiers
ensureTurnerOpen
This checks if the portal is open. If the portal is not open, the modifier will revert the transaction.
onlyPortalClosed
This is the opposite from ensureTurnerOpen
and checks that certain functions can only be called when the portal is closed.