Skip to content

IBoundlessMarket

Functions

addProverToAppnetAllowlist

Add a prover to the lock-in allowlist, for use during the appnet phase of testing.

function addProverToAppnetAllowlist(address prover) external;

removeProverFromAppnetAllowlist

Remove a prover from the lock-in allowlist, for use during the appnet phase of testing.

function removeProverFromAppnetAllowlist(address prover) external;

requestIsLocked

Check if the given request has been locked (i.e. accepted) by a prover.

When a request is locked, only the prover it is locked to can be paid to fulfill the job.

function requestIsLocked(uint256 requestId) external view returns (bool);

requestIsFulfilled

Check if the given request has been fulfilled (i.e. a proof was delivered).

function requestIsFulfilled(uint256 requestId) external view returns (bool);

requestDeadline

Return when the given request expires.

function requestDeadline(uint256 requestId) external view returns (uint64);

deposit

Deposit Ether into the market to pay for proof and/or lockin stake.

Value deposited is msg.value and it is credited to the account of msg.sender.

function deposit() external payable;

withdraw

Withdraw Ether from the market.

Value is debited from msg.sender.

function withdraw(uint256 value) external;

balanceOf

Check the deposited balance, in Ether, of the given account.

function balanceOf(address addr) external view returns (uint256);

submitRequest

Submit a request such that it is publicly available for provers to evaluate and bid on. Any msg.value sent with the call will be added to the balance of msg.sender.

Submitting the transaction only broadcasting it, and is not a required step. This method does not validate the signature or store any state related to the request.

function submitRequest(ProofRequest calldata request, bytes calldata clientSignature) external payable;

lockin

Lock the request to the prover, giving them exclusive rights to be paid to fulfill this request, and also making them subject to slashing penalties if they fail to deliver. At this point, the price for fulfillment is also set, based on the reverse Dutch auction parameters and the block at which this transaction is processed.

This method should be called from the address of the prover.

function lockin(ProofRequest calldata request, bytes calldata clientSignature) external;

lockinWithSig

Lock the request to the prover, giving them exclusive rights to be paid to fulfill this request, and also making them subject to slashing penalties if they fail to deliver. At this point, the price for fulfillment is also set, based on the reverse Dutch auction parameters and the block at which this transaction is processed.

This method uses the provided signature to authenticate the prover.

function lockinWithSig(ProofRequest calldata request, bytes calldata clientSignature, bytes calldata proverSignature)
    external;

fulfill

Fulfill a request by delivering the proof for the application. If the order is locked, only the prover that locked the order may receive payment. If another prover delivers a proof for an order that is locked, this method will revert unless paymentRequired is set to false on the Fulfillment struct.

function fulfill(Fulfillment calldata fill, bytes calldata assessorSeal, address prover) external;
Parameters
NameTypeDescription
fillFulfillmentThe fulfillment information, including the journal and seal.
assessorSealbytesThe seal from the Assessor guest, which is verified to confirm the request's requirements are met.
proveraddressThe address of the prover that produced the fulfillment. Note that this can differ from the address of the prover that locked the request. Only the locked-in prover can receive payment.

fulfillBatch

Fulfills a batch of requests. See IBoundlessMarket.fulfill for more information.

function fulfillBatch(Fulfillment[] calldata fills, bytes calldata assessorSeal, address prover) external;

priceRequest

Checks the validity of the request and then writes the current auction price to transient storage.

When called within the same transaction, this method can be used to fulfill a request that is not locked. This is useful when the prover wishes to fulfill a request, but does not want to issue a lock transaction e.g. because the stake is to high or to save money by avoiding the gas costs of the lock transaction.

function priceRequest(ProofRequest calldata request, bytes calldata clientSignature) external;

priceAndFulfillBatch

A combined call to IBoundlessMarket.priceRequest and IBoundlessMarket.fulfillBatch. The caller should provide the signed request and signature for each unlocked request they want to fulfill. Payment for unlocked requests will go to the provided prover address.

function priceAndFulfillBatch(
    ProofRequest[] calldata requests,
    bytes[] calldata clientSignatures,
    Fulfillment[] calldata fills,
    bytes calldata assessorSeal,
    address prover
) external;

submitRootAndFulfillBatch

Combined function to submit a new merkle root to the set-verifier and call fulfillBatch.

Useful to reduce the transaction count for fulfillments

function submitRootAndFulfillBatch(
    bytes32 root,
    bytes calldata seal,
    Fulfillment[] calldata fills,
    bytes calldata assessorSeal,
    address prover
) external;

slash

When a prover fails to fulfill a request by the deadline, this method can be used to burn the associated prover stake.

function slash(uint256 requestId) external;

eip712DomainSeparator

EIP 712 domain separator getter

function eip712DomainSeparator() external view returns (bytes32);

imageInfo

Returns the assessor imageId and its url.

function imageInfo() external view returns (bytes32, string memory);

Events

RequestSubmitted

Event logged when a new proof request is submitted by a client.

Note that the signature is not verified by the contract and should instead be verified by the receiver of the event.

event RequestSubmitted(uint256 indexed requestId, ProofRequest request, bytes clientSignature);

RequestLockedin

Event logged when a request is locked in by the given prover.

event RequestLockedin(uint256 indexed requestId, address prover);

RequestFulfilled

Event logged when a request is fulfilled.

event RequestFulfilled(uint256 indexed requestId);

ProofDelivered

Event logged when a proof is delivered that satisfies the requests requirements.

It is possible for this event to be logged multiple times for a single request. This is usually logged as part of order fulfillment, however it can also be logged by a prover sending the proof without payment.

event ProofDelivered(uint256 indexed requestId, bytes journal, bytes seal);

ProverSlashed

Event when prover stake is slashed for failing to fulfill a request by the deadline. Part of the stake is burned, and part is transferred to the client as compensation.

event ProverSlashed(uint256 indexed requestId, uint256 stakeBurned, uint256 stakeTransferred);

Deposit

Event when a deposit is made to the market.

event Deposit(address indexed account, uint256 value);

Withdrawal

Event when a withdrawal is made from the market.

event Withdrawal(address indexed account, uint256 value);

Upgraded

Contract upgraded to a new version.

event Upgraded(uint64 indexed version);

PaymentRequirementsFailed

Event emitted during fulfillment if a request was fulfilled, but payment was not transferred because at least one condition was not met. See the documentation on IBoundlessMarket.fulfillBatch for more information. If there is an unexpired lock on the request, the order, the prover holding the lock may still be able to / transfer payment sending another transaction.

The payload of the event is an ABI encoded error, from the errors on this contract.

event PaymentRequirementsFailed(bytes error);

Errors

RequestIsLocked

Request is locked when it was not required to be.

error RequestIsLocked(uint256 requestId);

RequestIsNotPriced

Request is not priced when it was required to be. Either locking the request, or calling the IBoundlessMarket.priceRequest function in the same transaction will satisfy this requirement.

error RequestIsNotPriced(uint256 requestId);

RequestIsNotLocked

Request is not locked when it was required to be.

error RequestIsNotLocked(uint256 requestId);

RequestIsFulfilled

Request is fulfilled when it was not required to be.

error RequestIsFulfilled(uint256 requestId);

RequestIsExpired

Request is no longer valid, as the deadline has passed.

error RequestIsExpired(uint256 requestId, uint64 deadline);

RequestIsNotExpired

Request is still valid, as the deadline has yet to pass.

error RequestIsNotExpired(uint256 requestId, uint64 deadline);

RequestLockFingerprintDoesNotMatch

Request fingerprint (shortened digest) doesn't match the value that is locked.

This can happen if a client signs multiple requests with the same ID (i.e. multiple versions of the same request) and a prover locks one version but the tries to call fulfill using a different version.

error RequestLockFingerprintDoesNotMatch(uint256 requestId, bytes8 provided, bytes8 locked);

InsufficientBalance

Unable to complete request because of insufficient balance.

error InsufficientBalance(address account);

InvalidSignature

A signature did not pass verification checks.

error InvalidSignature();

InvalidRequest

Request is malformed or internally inconsistent.

error InvalidRequest();

TransferFailed

Error when transfer of funds to an external address fails.

error TransferFailed();

ProverNotInAppnetLockinAllowList

Error for when a prover not on the allowed lists tries to lock-in an order. In order to focus on application developers, public prover participation is limited. In particular, only the provers in the allow-list are able to lock-in jobs. This restriction will be lifted, and this error removed, during the public testnet.

error ProverNotInAppnetLockinAllowList(address account);