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