ScrollChain
ScrollChain
This contract maintains data for the Scroll rollup.
Methods
addProver
Add an account to the prover list.
Parameters
| Name |
Type |
Description |
| _account |
address |
The address of account to add. |
addSequencer
Add an account to the sequencer list.
Parameters
| Name |
Type |
Description |
| _account |
address |
The address of account to add. |
commitBatch
Commit a batch of transactions on layer 1.
Parameters
| Name |
Type |
Description |
| _version |
uint8 |
undefined |
| _parentBatchHeader |
bytes |
undefined |
| _chunks |
bytes[] |
undefined |
| _skippedL1MessageBitmap |
bytes |
undefined |
committedBatches
Return the batch hash of a committed batch.
Parameters
| Name |
Type |
Description |
| _0 |
uint256 |
undefined |
Returns
| Name |
Type |
Description |
| _0 |
bytes32 |
undefined |
finalizeBatchWithProof
Finalize a committed batch on layer 1.
Parameters
| Name |
Type |
Description |
| _batchHeader |
bytes |
undefined |
| _prevStateRoot |
bytes32 |
undefined |
| _postStateRoot |
bytes32 |
undefined |
| _withdrawRoot |
bytes32 |
undefined |
| _aggrProof |
bytes |
undefined |
finalizedStateRoots
Return the state root of a committed batch.
Parameters
| Name |
Type |
Description |
| _0 |
uint256 |
undefined |
Returns
| Name |
Type |
Description |
| _0 |
bytes32 |
undefined |
importGenesisBatch
Import layer 2 genesis block
Parameters
| Name |
Type |
Description |
| _batchHeader |
bytes |
undefined |
| _stateRoot |
bytes32 |
undefined |
initialize
Initialize the storage of ScrollChain.
The parameters _messageQueue are no longer used.
Parameters
| Name |
Type |
Description |
| _messageQueue |
address |
The address of L1MessageQueue contract. |
| _verifier |
address |
The address of zkevm verifier contract. |
| _maxNumTxInChunk |
uint256 |
The maximum number of transactions allowed in each chunk. |
isBatchFinalized
Return whether the batch is finalized by batch index.
Parameters
| Name |
Type |
Description |
| _batchIndex |
uint256 |
undefined |
Returns
| Name |
Type |
Description |
| _0 |
bool |
undefined |
isProver
Whether an account is a prover.
Parameters
| Name |
Type |
Description |
| _0 |
address |
undefined |
Returns
| Name |
Type |
Description |
| _0 |
bool |
undefined |
isSequencer
Whether an account is a sequencer.
Parameters
| Name |
Type |
Description |
| _0 |
address |
undefined |
Returns
| Name |
Type |
Description |
| _0 |
bool |
undefined |
lastFinalizedBatchIndex
The latest finalized batch index.
Returns
| Name |
Type |
Description |
| _0 |
uint256 |
undefined |
layer2ChainId
The chain id of the corresponding layer 2 chain.
Returns
| Name |
Type |
Description |
| _0 |
uint64 |
undefined |
maxNumTxInChunk
The maximum number of transactions allowed in each chunk.
Returns
| Name |
Type |
Description |
| _0 |
uint256 |
undefined |
messageQueue
The address of L1MessageQueue contract.
Returns
| Name |
Type |
Description |
| _0 |
address |
undefined |
owner
Returns the address of the current owner.
Returns
| Name |
Type |
Description |
| _0 |
address |
undefined |
paused
Returns true if the contract is paused, and false otherwise.
Returns
| Name |
Type |
Description |
| _0 |
bool |
undefined |
removeProver
Add an account from the prover list.
Parameters
| Name |
Type |
Description |
| _account |
address |
The address of account to remove. |
removeSequencer
Remove an account from the sequencer list.
Parameters
| Name |
Type |
Description |
| _account |
address |
The address of account to remove. |
renounceOwnership
Leaves the contract without owner. It will not be possible to call onlyOwner functions. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby disabling any functionality that is only available to the owner.
revertBatch
Revert a pending batch.
If the owner want to revert a sequence of batches by sending multiple transactions, make sure to revert recent batches first.
Parameters
| Name |
Type |
Description |
| _batchHeader |
bytes |
undefined |
| _count |
uint256 |
undefined |
setPause
Pause the contract
Parameters
| Name |
Type |
Description |
| _status |
bool |
The pause status to update. |
transferOwnership
Transfers ownership of the contract to a new account (newOwner). Can only be called by the current owner.
Parameters
| Name |
Type |
Description |
| newOwner |
address |
undefined |
updateMaxNumTxInChunk
Update the value of maxNumTxInChunk.
Parameters
| Name |
Type |
Description |
| _maxNumTxInChunk |
uint256 |
The new value of maxNumTxInChunk. |
verifier
The address of RollupVerifier.
Returns
| Name |
Type |
Description |
| _0 |
address |
undefined |
withdrawRoots
Return the message root of a committed batch.
Parameters
| Name |
Type |
Description |
| _0 |
uint256 |
undefined |
Returns
| Name |
Type |
Description |
| _0 |
bytes32 |
undefined |
Events
CommitBatch
Emitted when a new batch is committed.
Parameters
| Name |
Type |
Description |
batchIndex indexed |
uint256 |
undefined |
batchHash indexed |
bytes32 |
undefined |
FinalizeBatch
Emitted when a batch is finalized.
Parameters
| Name |
Type |
Description |
batchIndex indexed |
uint256 |
undefined |
batchHash indexed |
bytes32 |
undefined |
| stateRoot |
bytes32 |
undefined |
| withdrawRoot |
bytes32 |
undefined |
Initialized
Parameters
| Name |
Type |
Description |
| version |
uint8 |
undefined |
OwnershipTransferred
Parameters
| Name |
Type |
Description |
previousOwner indexed |
address |
undefined |
newOwner indexed |
address |
undefined |
Paused
Parameters
| Name |
Type |
Description |
| account |
address |
undefined |
RevertBatch
revert a pending batch.
Parameters
| Name |
Type |
Description |
batchIndex indexed |
uint256 |
undefined |
batchHash indexed |
bytes32 |
undefined |
Unpaused
Parameters
| Name |
Type |
Description |
| account |
address |
undefined |
UpdateMaxNumTxInChunk
Emitted when the value of maxNumTxInChunk is updated.
Parameters
| Name |
Type |
Description |
| oldMaxNumTxInChunk |
uint256 |
The old value of maxNumTxInChunk. |
| newMaxNumTxInChunk |
uint256 |
The new value of maxNumTxInChunk. |
UpdateProver
Emitted when owner updates the status of prover.
Parameters
| Name |
Type |
Description |
account indexed |
address |
The address of account updated. |
| status |
bool |
The status of the account updated. |
UpdateSequencer
Emitted when owner updates the status of sequencer.
Parameters
| Name |
Type |
Description |
account indexed |
address |
The address of account updated. |
| status |
bool |
The status of the account updated. |
Errors
ErrorZeroAddress
Thrown when the given address is address(0).