Skip to main content

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

NameType
callsBytesbytes (calldata)
returnsBytesbytes (calldata)
associatedDatabytes (calldata)
hintdicesbytes (calldata)

getReturnValue

Returns a value from the record of return values given the input.

Parameters

NameType
inputbytes (calldata)

Returns

NameType
returnvaluebytes (memory)

fetchFromAssociatedDataStore

Fetches the value associated with a given key from the associatedDataStore.

Parameters

NameType
keybytes32

Returns

NameType
valuebytes (memory)

Events

EnterPortal

Emitted when the (enterPortal function)[TODO] is called.

Parameters

NameType
callObjCallObject
returnvalueReturnObject
indexuint256

Tip

Emitted when a tip is received.

Parameters

NameType
fromaddress (indexed)
toaddress (indexed)
amountuint256

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.