IOVMGateway

Git Source

The OVMGateway contract interface.

Functions

sendRequest

Sends a request to execute a task.

function sendRequest(
    address requester,
    address callbackAddress,
    bool deterministic,
    bytes calldata data
) external payable returns (bytes32 requestId);

Parameters

NameTypeDescription
requesteraddressThe address of the requester.
callbackAddressaddressThe address of the contract to receive the callback.
deterministicboolWhether the request is deterministic.
databytesThe data to be passed to the callback function. msg.value is the payment for the task.

Returns

NameTypeDescription
requestIdbytes32The unique identifier for the request.

cancelRequest

Cancels a request.

function cancelRequest(bytes32 requestId) external;

Parameters

NameTypeDescription
requestIdbytes32The request ID to cancel.

setResponse

Sets the response for a given requestId.

function setResponse(bytes32 requestId, bytes calldata data) external;

Parameters

NameTypeDescription
requestIdbytes32The unique identifier for the request.
databytesThe response data to be set.

getSpecification

Gets the specification of the callback contract.

function getSpecification(address callbackAddress) external view returns (Specification memory);

Parameters

NameTypeDescription
callbackAddressaddressThe address of the callback contract.

Returns

NameTypeDescription
<none>Specificationspecification The specification of the callback contract.

getCommitments

Gets the commitments of a request.

function getCommitments(bytes32 requestId) external view returns (Commitment memory);

Parameters

NameTypeDescription
requestIdbytes32The request ID to get the commitments for.

Returns

NameTypeDescription
<none>Commitmentcommitments The commitments of the request.

getRequestsCount

Gets the number of requests.

function getRequestsCount() external view returns (uint256);

Returns

NameTypeDescription
<none>uint256count The number of requests.