Skip to main content

The blocklog Contract

The blocklog contract is one of the core contracts on each IOTA Smart Contracts chain.

The blocklog contract keeps track of the blocks of requests processed by the chain, providing views to get request status, receipts, block, and event details.

To avoid having a monotonically increasing state size, only the latest N blocks (and their events and receipts) are stored. This parameter can be configured when deploying the chain.

Views

getBlockInfo

Returns information about the block with index blockIndex.

Parameters

NameTypeOptionalDescription
blockIndexu32YesThe block index. Default: the latest block

Returns

NameTypeDescription
blockIndexu32The block Index
blockInfo*BlockInfoThe information about the block

getRequestIDsForBlock

Returns a list with all request IDs in the block with block index n.

Parameters

NameTypeOptionalDescription
blockIndexu32YesThe block index. The default value is the latest block

Returns

NameTypeDescription
blockIndexu32The block Index
requestIDsInBlock[[u8; 32]]The ISC Request IDs

getRequestReceipt

Returns the receipt for the request with the given ID.

Parameters

NameTypeOptionalDescription
requestID[u8; 32]NoThe request ID

Returns

NameTypeDescription
requestReceiptRequestReceiptThe request receipt

getRequestReceiptsForBlock

Returns all the receipts in the block with index blockIndex.

Parameters

NameTypeOptionalDescription
blockIndexu32YesThe block index. Defaults to the latest block

Response

NameTypeDescription
requestReceiptsRequestReceiptsResponseThe request receipt response

isRequestProcessed

Returns whether the request with ID u has been processed.

Parameters

NameTypeOptionalDescription
requestID[u8; 32]NoThe request ID

Returns

NameTypeDescription
isProcessedboolWhether the request was processed or not

getEventsForRequest

Returns the list of events triggered during the execution of the request with ID requestID.

Parameters

NameTypeOptionalDescription
requestID[u8; 32]NoThe request ID

Returns

NameTypeDescription
events[Event]List of events

getEventsForBlock

Returns the list of events triggered during the execution of all requests in the block with index blockIndex.

Parameters

NameTypeOptionalDescription
blockIndexu32YesThe block index. Defaults to the latest block

Returns

NameTypeDescription
blockIndexu32The block index
events[Event]List of events