SystemContext

Abstract

0x000000000000000000000000000000000000800b

Solidity v0.8.20+commit.a1b79de6

🤖
通过你的 AI 查询此合约
引用: 0x000000000000000000000000000000000000800b
示例提示词: "Tell me the current state of abstract/0x000000000000000000000000000000000000800b"
还没有接入 AI?→ mcp.smarts.md
Abstract 在 Smarts 上是仅文档链:源代码和 ABI 已索引,但当前不提供实时链上数据(状态、最新事件、管理员画像)。AI 代理仍可通过 MCP 调用 get_contract_info 和 get_contract_source。

概览

读取函数
20
写入函数
11
事件
0

读取函数

baseFee() view

Returns the current protocol base fee used to calculate transaction gas prices.✨ AI

返回值

名称 类型 描述
uint256 The current base fee in wei (uint256) used for gas price calculations.✨ AI
blockGasLimit() view

Returns the current block gas limit.✨ AI

返回值

名称 类型 描述
uint256 The current block gas limit (maximum gas allowed for a block) as a uint256.✨ AI
blockHash(_blockNumber: uint256) view

Returns the hash of the given batch.

开发者: Deprecated in favor of getBatchHash.

参数

名称 类型 描述
_blockNumber uint256

返回值

名称 类型 描述
hash bytes32
chainId() view

Return the current chain ID.✨ AI

返回值

名称 类型 描述
uint256 The chain ID of the current blockchain as a uint256.✨ AI
coinbase() view

Return the address of the current block miner (coinbase).✨ AI

返回值

名称 类型 描述
address The address of the miner or validator for the current block (equivalent to block.coinbase).✨ AI
currentBlockInfo() view

Returns the current batch's number and timestamp.

开发者: Deprecated in favor of getBatchNumberAndTimestamp.

返回值

名称 类型 描述
blockInfo uint256
difficulty() view

Return the current block difficulty as reported by the execution environment.✨ AI

返回值

名称 类型 描述
uint256 Current block difficulty metric for the executing block, represented as a uint256.✨ AI
gasPerPubdataByte() view

Returns the configured gas cost charged per byte of public data (pubdata).✨ AI

返回值

名称 类型 描述
uint256 The gas cost, as a uint256, charged for each byte of public calldata (pubdata).✨ AI
gasPrice() view

Returns the current gas price (in wei) from the system context.✨ AI

返回值

名称 类型 描述
uint256 The current gas price in wei as a uint256.✨ AI
getBatchHash(_batchNumber: uint256) view

Returns the hash of the given batch.

参数

名称 类型 描述
_batchNumber uint256 The number of the batch.

返回值

名称 类型 描述
hash bytes32 hash The hash of the batch.
getBatchNumberAndTimestamp() view

Returns the current batch's number and timestamp.

返回值

名称 类型 描述
batchNumber uint128 batchNumber and batchTimestamp tuple of the current batch's number and the current batch's timestamp
batchTimestamp uint128
getBlockHashEVM(_block: uint256) view

The method that emulates `blockhash` opcode in EVM.

开发者: Since zksolc compiler calls this method to emulate `blockhash`, its signature can not be changed to `getL2BlockHashEVM`.

参数

名称 类型 描述
_block uint256

返回值

名称 类型 描述
hash bytes32 hash The blockhash of the block with the given number.
getBlockNumber() view

Returns the current L2 block's number.

开发者: Since zksolc compiler calls this method to emulate `block.number`, its signature can not be changed to `getL2BlockNumber`.

返回值

名称 类型 描述
uint128 blockNumber The current L2 block's number.
getBlockNumberAndTimestamp() view

Returns the current batch's number and timestamp.

开发者: Deprecated in favor of getBatchNumberAndTimestamp.

返回值

名称 类型 描述
blockNumber uint256
blockTimestamp uint256
getBlockTimestamp() view

Returns the current L2 block's timestamp.

开发者: Since zksolc compiler calls this method to emulate `block.timestamp`, its signature can not be changed to `getL2BlockTimestamp`.

返回值

名称 类型 描述
uint128 timestamp The current L2 block's timestamp.
getCurrentPubdataCost() view

Returns the current pubdata cost used to calculate transaction fees.✨ AI

返回值

名称 类型 描述
uint256 Current pubdata cost as a uint256 value denominated in wei for fee computation.✨ AI
getCurrentPubdataSpent() view

Return the amount of public data (pubdata) spent so far in the current transaction.✨ AI

返回值

名称 类型 描述
uint256 Total pubdata consumed so far in the current transaction, expressed as a uint256 number of bytes.✨ AI
getL2BlockNumberAndTimestamp() view

Returns the current block's number and timestamp.

返回值

名称 类型 描述
blockNumber uint128 blockNumber and blockTimestamp tuple of the current L2 block's number and the current block's timestamp
blockTimestamp uint128
origin() view

Returns the address that originated the current transaction.✨ AI

返回值

名称 类型 描述
address The address that originated the transaction (tx.origin).✨ AI
txNumberInBlock() view

Return the transaction's index within the current block as a uint16.✨ AI

返回值

名称 类型 描述
uint16 The transaction's index within the current block as a uint16 value.✨ AI

写入函数

appendTransactionToCurrentL2Block(_txHash: bytes32) nonpayable

Appends the transaction hash to the rolling hash of the current L2 block.

参数

名称 类型 描述
_txHash bytes32 The hash of the transaction.
incrementTxNumberInBatch() nonpayable

Increment the transaction number tracked for the current batch.✨ AI

publishTimestampDataToL1() nonpayable

Publishes L2->L1 logs needed to verify the validity of this batch on L1.

开发者: Should be called at the end of the current batch.
resetTxNumberInBatch() nonpayable

Reset the transaction number counter for the current batch.✨ AI

setChainId(_newChainId: uint256) nonpayable

Set the chainId origin.

参数

名称 类型 描述
_newChainId uint256 The chainId
setGasPrice(_gasPrice: uint256) nonpayable

Set the the current gas price.

参数

名称 类型 描述
_gasPrice uint256 The new tx gasPrice.
setL2Block(_l2BlockNumber: uint128, _l2BlockTimestamp: uint128, _expectedPrevL2BlockHash: bytes32, _isFirstInBatch: bool, _maxVirtualBlocksToCreate: uint128) nonpayable

Sets the current block number and timestamp of the L2 block.

开发者: It is also enforced that the number of the current virtual L2 block can not exceed the number of the L2 block.

参数

名称 类型 描述
_l2BlockNumber uint128 The number of the new L2 block.
_l2BlockTimestamp uint128 The timestamp of the new L2 block.
_expectedPrevL2BlockHash bytes32 The expected hash of the previous L2 block.
_isFirstInBatch bool Whether this method is called for the first time in the batch.
_maxVirtualBlocksToCreate uint128 The maximum number of virtual block to create with this L2 block.
setNewBatch(_prevBatchHash: bytes32, _newTimestamp: uint128, _expectedNewNumber: uint128, _baseFee: uint256) nonpayable

Increments the current batch number and sets the new timestamp

开发者: The correctness of the _prevBatchHash and _newTimestamp should be enforced on L1.

参数

名称 类型 描述
_prevBatchHash bytes32 The hash of the previous batch.
_newTimestamp uint128 The timestamp of the new batch.
_expectedNewNumber uint128 The new batch's number.
_baseFee uint256 The new batch's base fee
setPubdataInfo(_gasPerPubdataByte: uint256, _basePubdataSpent: uint256) nonpayable

Sets the number of L2 gas that is needed to pay a single byte of pubdata.

开发者: This value does not have any impact on the execution and purely serves as a way for users to access the current gas price for the pubdata.

参数

名称 类型 描述
_gasPerPubdataByte uint256 The amount L2 gas that the operator charge the user for single byte of pubdata.
_basePubdataSpent uint256 The number of pubdata spent as of the start of the transaction.
setTxOrigin(_newOrigin: address) nonpayable

Set the current tx origin.

参数

名称 类型 描述
_newOrigin address The new tx origin.
unsafeOverrideBatch(_newTimestamp: uint256, _number: uint256, _baseFee: uint256) nonpayable

A testing method that manually sets the current blocks' number and timestamp.

开发者: Should be used only for testing / ethCalls and should never be used in production.

参数

名称 类型 描述
_newTimestamp uint256
_number uint256
_baseFee uint256