UNPKG

@mantleio/contracts

Version:
606 lines 131 kB
{ "address": "0x291dc3819b863e19b0a9b9809F8025d2EB4aaE93", "abi": [ { "inputs": [ { "internalType": "address", "name": "_libAddressManager", "type": "address" }, { "internalType": "uint256", "name": "_maxTransactionGasLimit", "type": "uint256" }, { "internalType": "uint256", "name": "_l2GasDiscountDivisor", "type": "uint256" }, { "internalType": "uint256", "name": "_enqueueGasCost", "type": "uint256" } ], "stateMutability": "nonpayable", "type": "constructor" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "uint256", "name": "_batchIndex", "type": "uint256" }, { "indexed": false, "internalType": "uint40", "name": "_nextqIndex", "type": "uint40" }, { "indexed": false, "internalType": "uint40", "name": "_totalElement", "type": "uint40" }, { "indexed": false, "internalType": "uint40", "name": "_batchSize", "type": "uint40" }, { "indexed": false, "internalType": "uint40", "name": "_numQueuedTransactions", "type": "uint40" }, { "indexed": false, "internalType": "uint40", "name": "_timestamp", "type": "uint40" }, { "indexed": false, "internalType": "uint40", "name": "_blockNumber", "type": "uint40" } ], "name": "CTCBatchReset", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": false, "internalType": "uint256", "name": "l2GasDiscountDivisor", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "enqueueGasCost", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "enqueueL2GasPrepaid", "type": "uint256" } ], "name": "L2GasParamsUpdated", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": false, "internalType": "uint256", "name": "_startingQueueIndex", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "_numQueueElements", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "_totalElements", "type": "uint256" } ], "name": "QueueBatchAppended", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": false, "internalType": "uint256", "name": "_startingQueueIndex", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "_numQueueElements", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "_totalElements", "type": "uint256" } ], "name": "SequencerBatchAppended", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "uint256", "name": "_batchIndex", "type": "uint256" }, { "indexed": false, "internalType": "bytes32", "name": "_batchRoot", "type": "bytes32" }, { "indexed": false, "internalType": "uint256", "name": "_batchSize", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "_prevTotalElements", "type": "uint256" }, { "indexed": false, "internalType": "bytes", "name": "_signature", "type": "bytes" }, { "indexed": false, "internalType": "bytes", "name": "_extraData", "type": "bytes" } ], "name": "TransactionBatchAppended", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "_l1TxOrigin", "type": "address" }, { "indexed": true, "internalType": "address", "name": "_target", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "_gasLimit", "type": "uint256" }, { "indexed": false, "internalType": "bytes", "name": "_data", "type": "bytes" }, { "indexed": true, "internalType": "uint256", "name": "_queueIndex", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "_timestamp", "type": "uint256" } ], "name": "TransactionEnqueued", "type": "event" }, { "inputs": [], "name": "MAX_ROLLUP_TX_SIZE", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "MIN_ROLLUP_TX_GAS", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "appendSequencerBatch", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "batches", "outputs": [ { "internalType": "contract IChainStorageContainer", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "_target", "type": "address" }, { "internalType": "uint256", "name": "_gasLimit", "type": "uint256" }, { "internalType": "bytes", "name": "_data", "type": "bytes" } ], "name": "enqueue", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "enqueueGasCost", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "enqueueL2GasPrepaid", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "getLastBlockNumber", "outputs": [ { "internalType": "uint40", "name": "", "type": "uint40" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "getLastTimestamp", "outputs": [ { "internalType": "uint40", "name": "", "type": "uint40" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "getNextQueueIndex", "outputs": [ { "internalType": "uint40", "name": "", "type": "uint40" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "getNumPendingQueueElements", "outputs": [ { "internalType": "uint40", "name": "", "type": "uint40" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "_index", "type": "uint256" } ], "name": "getQueueElement", "outputs": [ { "components": [ { "internalType": "bytes32", "name": "transactionHash", "type": "bytes32" }, { "internalType": "uint40", "name": "timestamp", "type": "uint40" }, { "internalType": "uint40", "name": "blockNumber", "type": "uint40" } ], "internalType": "struct Lib_BVMCodec.QueueElement", "name": "_element", "type": "tuple" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "getQueueLength", "outputs": [ { "internalType": "uint40", "name": "", "type": "uint40" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "getTotalBatches", "outputs": [ { "internalType": "uint256", "name": "_totalBatches", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "getTotalElements", "outputs": [ { "internalType": "uint256", "name": "_totalElements", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "l2GasDiscountDivisor", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "libAddressManager", "outputs": [ { "internalType": "contract Lib_AddressManager", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "maxTransactionGasLimit", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "_batchIndex", "type": "uint256" }, { "internalType": "uint40", "name": "_totalElement", "type": "uint40" }, { "internalType": "uint40", "name": "_batchSize", "type": "uint40" }, { "internalType": "uint40", "name": "_nextqIndex", "type": "uint40" }, { "internalType": "uint40", "name": "_numQueuedTransactions", "type": "uint40" }, { "internalType": "uint40", "name": "_timestamp", "type": "uint40" }, { "internalType": "uint40", "name": "_blockNumber", "type": "uint40" } ], "name": "resetIndex", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "string", "name": "_name", "type": "string" } ], "name": "resolve", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "_l2GasDiscountDivisor", "type": "uint256" }, { "internalType": "uint256", "name": "_enqueueGasCost", "type": "uint256" } ], "name": "setGasParams", "outputs": [], "stateMutability": "nonpayable", "type": "function" } ], "transactionHash": "0x01bcd410b781f29d0540880b09131269aa7de0acb52b7dcd6ef0de9f60edc301", "receipt": { "to": null, "from": "0x2A2954F3989a83Cc43DD58B0f038D5F276f21333", "contractAddress": "0x291dc3819b863e19b0a9b9809F8025d2EB4aaE93", "transactionIndex": 8, "gasUsed": "1570658", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "blockHash": "0x8a635325cdee8719425c2eaa393812e9135647eb935f43f7c7c73c075f90dead", "transactionHash": "0x01bcd410b781f29d0540880b09131269aa7de0acb52b7dcd6ef0de9f60edc301", "logs": [], "blockNumber": 17577586, "cumulativeGasUsed": "2315342", "status": 1, "byzantium": true }, "args": [ "0x6968f3F16C3e64003F02E121cf0D5CCBf5625a42", 30000000, 32, 60000 ], "numDeployments": 1, "solcInputHash": "0880bfbb588e431d1b8d2ea014a7b450", "metadata": "{\"compiler\":{\"version\":\"0.8.9+commit.e5eed63a\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_libAddressManager\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_maxTransactionGasLimit\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_l2GasDiscountDivisor\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_enqueueGasCost\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_batchIndex\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint40\",\"name\":\"_nextqIndex\",\"type\":\"uint40\"},{\"indexed\":false,\"internalType\":\"uint40\",\"name\":\"_totalElement\",\"type\":\"uint40\"},{\"indexed\":false,\"internalType\":\"uint40\",\"name\":\"_batchSize\",\"type\":\"uint40\"},{\"indexed\":false,\"internalType\":\"uint40\",\"name\":\"_numQueuedTransactions\",\"type\":\"uint40\"},{\"indexed\":false,\"internalType\":\"uint40\",\"name\":\"_timestamp\",\"type\":\"uint40\"},{\"indexed\":false,\"internalType\":\"uint40\",\"name\":\"_blockNumber\",\"type\":\"uint40\"}],\"name\":\"CTCBatchReset\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"l2GasDiscountDivisor\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"enqueueGasCost\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"enqueueL2GasPrepaid\",\"type\":\"uint256\"}],\"name\":\"L2GasParamsUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_startingQueueIndex\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_numQueueElements\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_totalElements\",\"type\":\"uint256\"}],\"name\":\"QueueBatchAppended\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_startingQueueIndex\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_numQueueElements\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_totalElements\",\"type\":\"uint256\"}],\"name\":\"SequencerBatchAppended\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_batchIndex\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"_batchRoot\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_batchSize\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_prevTotalElements\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"_signature\",\"type\":\"bytes\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"_extraData\",\"type\":\"bytes\"}],\"name\":\"TransactionBatchAppended\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_l1TxOrigin\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_target\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_gasLimit\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"_queueIndex\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_timestamp\",\"type\":\"uint256\"}],\"name\":\"TransactionEnqueued\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"MAX_ROLLUP_TX_SIZE\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"MIN_ROLLUP_TX_GAS\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"appendSequencerBatch\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"batches\",\"outputs\":[{\"internalType\":\"contract IChainStorageContainer\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_target\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_gasLimit\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"enqueue\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"enqueueGasCost\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"enqueueL2GasPrepaid\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getLastBlockNumber\",\"outputs\":[{\"internalType\":\"uint40\",\"name\":\"\",\"type\":\"uint40\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getLastTimestamp\",\"outputs\":[{\"internalType\":\"uint40\",\"name\":\"\",\"type\":\"uint40\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getNextQueueIndex\",\"outputs\":[{\"internalType\":\"uint40\",\"name\":\"\",\"type\":\"uint40\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getNumPendingQueueElements\",\"outputs\":[{\"internalType\":\"uint40\",\"name\":\"\",\"type\":\"uint40\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_index\",\"type\":\"uint256\"}],\"name\":\"getQueueElement\",\"outputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"transactionHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint40\",\"name\":\"timestamp\",\"type\":\"uint40\"},{\"internalType\":\"uint40\",\"name\":\"blockNumber\",\"type\":\"uint40\"}],\"internalType\":\"struct Lib_BVMCodec.QueueElement\",\"name\":\"_element\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getQueueLength\",\"outputs\":[{\"internalType\":\"uint40\",\"name\":\"\",\"type\":\"uint40\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getTotalBatches\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"_totalBatches\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getTotalElements\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"_totalElements\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"l2GasDiscountDivisor\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"libAddressManager\",\"outputs\":[{\"internalType\":\"contract Lib_AddressManager\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"maxTransactionGasLimit\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_batchIndex\",\"type\":\"uint256\"},{\"internalType\":\"uint40\",\"name\":\"_totalElement\",\"type\":\"uint40\"},{\"internalType\":\"uint40\",\"name\":\"_batchSize\",\"type\":\"uint40\"},{\"internalType\":\"uint40\",\"name\":\"_nextqIndex\",\"type\":\"uint40\"},{\"internalType\":\"uint40\",\"name\":\"_numQueuedTransactions\",\"type\":\"uint40\"},{\"internalType\":\"uint40\",\"name\":\"_timestamp\",\"type\":\"uint40\"},{\"internalType\":\"uint40\",\"name\":\"_blockNumber\",\"type\":\"uint40\"}],\"name\":\"resetIndex\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"_name\",\"type\":\"string\"}],\"name\":\"resolve\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_l2GasDiscountDivisor\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_enqueueGasCost\",\"type\":\"uint256\"}],\"name\":\"setGasParams\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"details\":\"The Canonical Transaction Chain (CTC) contract is an append-only log of transactions which must be applied to the rollup state. It defines the ordering of rollup transactions by writing them to the 'CTC:batches' instance of the Chain Storage Container. The CTC also allows any account to 'enqueue' an L2 transaction, which will require that the Sequencer will eventually append it to the rollup state.\",\"kind\":\"dev\",\"methods\":{\"appendSequencerBatch()\":{\"details\":\"This function uses a custom encoding scheme for efficiency reasons. .param _shouldStartAtElement Specific batch we expect to start appending to. .param _totalElementsToAppend Total number of batch elements we expect to append. .param _contexts Array of batch contexts. .param _transactionDataFields Array of raw transaction data.\"},\"batches()\":{\"returns\":{\"_0\":\"Reference to the batch storage container.\"}},\"enqueue(address,uint256,bytes)\":{\"params\":{\"_data\":\"Transaction data.\",\"_gasLimit\":\"Gas limit for the enqueued L2 transaction.\",\"_target\":\"Target L2 contract to send the transaction to.\"}},\"getLastBlockNumber()\":{\"returns\":{\"_0\":\"Blocknumber for the last transaction.\"}},\"getLastTimestamp()\":{\"returns\":{\"_0\":\"Timestamp for the last transaction.\"}},\"getNextQueueIndex()\":{\"returns\":{\"_0\":\"Index for the next queue element.\"}},\"getNumPendingQueueElements()\":{\"returns\":{\"_0\":\"Number of pending queue elements.\"}},\"getQueueElement(uint256)\":{\"params\":{\"_index\":\"Index of the queue element to access.\"},\"returns\":{\"_element\":\"Queue element at the given index.\"}},\"getQueueLength()\":{\"returns\":{\"_0\":\"Length of the queue.\"}},\"getTotalBatches()\":{\"returns\":{\"_totalBatches\":\"Total submitted batches.\"}},\"getTotalElements()\":{\"returns\":{\"_totalElements\":\"Total submitted elements.\"}},\"resolve(string)\":{\"params\":{\"_name\":\"Name to resolve an address for.\"},\"returns\":{\"_0\":\"Address associated with the given name.\"}}},\"title\":\"CanonicalTransactionChain\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"appendSequencerBatch()\":{\"notice\":\"Allows the sequencer to append a batch of transactions.\"},\"batches()\":{\"notice\":\"Accesses the batch storage container.\"},\"enqueue(address,uint256,bytes)\":{\"notice\":\"Adds a transaction to the queue.\"},\"getLastBlockNumber()\":{\"notice\":\"Returns the blocknumber of the last transaction.\"},\"getLastTimestamp()\":{\"notice\":\"Returns the timestamp of the last transaction.\"},\"getNextQueueIndex()\":{\"notice\":\"Returns the index of the next element to be enqueued.\"},\"getNumPendingQueueElements()\":{\"notice\":\"Get the number of queue elements which have not yet been included.\"},\"getQueueElement(uint256)\":{\"notice\":\"Gets the queue element at a particular index.\"},\"getQueueLength()\":{\"notice\":\"Retrieves the length of the queue, including both pending and canonical transactions.\"},\"getTotalBatches()\":{\"notice\":\"Retrieves the total number of batches submitted.\"},\"getTotalElements()\":{\"notice\":\"Retrieves the total number of elements submitted.\"},\"resetIndex(uint256,uint40,uint40,uint40,uint40,uint40,uint40)\":{\"notice\":\"Reset the index when the ctc data is dirtyed\"},\"resolve(string)\":{\"notice\":\"Resolves the address associated with a given name.\"},\"setGasParams(uint256,uint256)\":{\"notice\":\"Allows the Burn Admin to update the parameters which determine the amount of gas to burn. The value of enqueueL2GasPrepaid is immediately updated as well.\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/L1/rollup/CanonicalTransactionChain.sol\":\"CanonicalTransactionChain\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/access/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract Ownable is Context {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n constructor() {\\n _setOwner(_msgSender());\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n _;\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n _setOwner(address(0));\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n _setOwner(newOwner);\\n }\\n\\n function _setOwner(address newOwner) private {\\n address oldOwner = _owner;\\n _owner = newOwner;\\n emit OwnershipTransferred(oldOwner, newOwner);\\n }\\n}\\n\",\"keccak256\":\"0x6bb804a310218875e89d12c053e94a13a4607cdf7cc2052f3e52bd32a0dc50a1\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0x90565a39ae45c80f0468dc96c7b20d0afc3055f344c8203a0c9258239f350b9f\",\"license\":\"MIT\"},\"contracts/L1/rollup/CanonicalTransactionChain.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.9;\\n\\n/* Library Imports */\\nimport { AddressAliasHelper } from \\\"../../standards/AddressAliasHelper.sol\\\";\\nimport { Lib_BVMCodec } from \\\"../../libraries/codec/Lib_BVMCodec.sol\\\";\\nimport { Lib_AddressResolver } from \\\"../../libraries/resolver/Lib_AddressResolver.sol\\\";\\n\\n/* Interface Imports */\\nimport { ICanonicalTransactionChain } from \\\"./ICanonicalTransactionChain.sol\\\";\\nimport { IChainStorageContainer } from \\\"./IChainStorageContainer.sol\\\";\\n\\n/**\\n * @title CanonicalTransactionChain\\n * @dev The Canonical Transaction Chain (CTC) contract is an append-only log of transactions\\n * which must be applied to the rollup state. It defines the ordering of rollup transactions by\\n * writing them to the 'CTC:batches' instance of the Chain Storage Container.\\n * The CTC also allows any account to 'enqueue' an L2 transaction, which will require that the\\n * Sequencer will eventually append it to the rollup state.\\n *\\n */\\ncontract CanonicalTransactionChain is ICanonicalTransactionChain, Lib_AddressResolver {\\n /*************\\n * Constants *\\n *************/\\n\\n // L2 tx gas-related\\n uint256 public constant MIN_ROLLUP_TX_GAS = 100000;\\n uint256 public constant MAX_ROLLUP_TX_SIZE = 50000;\\n\\n // The approximate cost of calling the enqueue function\\n uint256 public enqueueGasCost;\\n // The ratio of the cost of L1 gas to the cost of L2 gas\\n uint256 public l2GasDiscountDivisor;\\n // The amount of L2 gas which can be forwarded to L2 without spam prevention via 'gas burn'.\\n // Calculated as the product of l2GasDiscountDivisor * enqueueGasCost.\\n // See comments in enqueue() for further detail.\\n uint256 public enqueueL2GasPrepaid;\\n\\n // Encoding-related (all in bytes)\\n uint256 internal constant BATCH_CONTEXT_SIZE = 16;\\n // slither-disable-next-line unused-state\\n uint256 internal constant BATCH_CONTEXT_LENGTH_POS = 12;\\n uint256 internal constant BATCH_CONTEXT_START_POS = 15;\\n // slither-disable-next-line unused-state\\n uint256 internal constant TX_DATA_HEADER_SIZE = 3;\\n // slither-disable-next-line unused-state\\n uint256 internal constant BYTES_TILL_TX_DATA = 65;\\n\\n /*************\\n * Variables *\\n *************/\\n\\n uint256 public maxTransactionGasLimit;\\n\\n /***************\\n * Queue State *\\n ***************/\\n\\n uint40 private _nextQueueIndex; // index of the first queue element not yet included\\n Lib_BVMCodec.QueueElement[] queueElements;\\n\\n /***************\\n * Constructor *\\n ***************/\\n\\n constructor(\\n address _libAddressManager,\\n uint256 _maxTransactionGasLimit,\\n uint256 _l2GasDiscountDivisor,\\n uint256 _enqueueGasCost\\n ) Lib_AddressResolver(_libAddressManager) {\\n maxTransactionGasLimit = _maxTransactionGasLimit;\\n l2GasDiscountDivisor = _l2GasDiscountDivisor;\\n enqueueGasCost = _enqueueGasCost;\\n enqueueL2GasPrepaid = _l2GasDiscountDivisor * _enqueueGasCost;\\n }\\n\\n /**********************\\n * Function Modifiers *\\n **********************/\\n\\n /**\\n * Modifier to enforce that, if configured, only the Burn Admin may\\n * successfully call a method.\\n */\\n modifier onlyBurnAdmin() {\\n require(msg.sender == libAddressManager.owner(), \\\"Only callable by the Burn Admin.\\\");\\n _;\\n }\\n\\n /*******************************\\n * Authorized Setter Functions *\\n *******************************/\\n\\n /**\\n * Allows the Burn Admin to update the parameters which determine the amount of gas to burn.\\n * The value of enqueueL2GasPrepaid is immediately updated as well.\\n */\\n function setGasParams(uint256 _l2GasDiscountDivisor, uint256 _enqueueGasCost)\\n external\\n onlyBurnAdmin\\n {\\n enqueueGasCost = _enqueueGasCost;\\n l2GasDiscountDivisor = _l2GasDiscountDivisor;\\n // See the comment in enqueue() for the rationale behind this formula.\\n enqueueL2GasPrepaid = _l2GasDiscountDivisor * _enqueueGasCost;\\n\\n emit L2GasParamsUpdated(l2GasDiscountDivisor, enqueueGasCost, enqueueL2GasPrepaid);\\n }\\n\\n /********************\\n * Public Functions *\\n ********************/\\n\\n /**\\n * Accesses the batch storage container.\\n * @return Reference to the batch storage container.\\n */\\n function batches() public view returns (IChainStorageContainer) {\\n return IChainStorageContainer(resolve(\\\"ChainStorageContainer-CTC-batches\\\"));\\n }\\n\\n /**\\n * Retrieves the total number of elements submitted.\\n * @return _totalElements Total submitted elements.\\n */\\n function getTotalElements() public view returns (uint256 _totalElements) {\\n (uint40 totalElements, , , ) = _getBatchExtraData();\\n return uint256(totalElements);\\n }\\n\\n /**\\n * Retrieves the total number of batches submitted.\\n * @return _totalBatches Total submitted batches.\\n */\\n // slither-disable-next-line external-function\\n function getTotalBatches() public view returns (uint256 _totalBatches) {\\n return batches().length();\\n }\\n\\n /**\\n * Returns the index of the next element to be enqueued.\\n * @return Index for the next queue element.\\n */\\n // slither-disable-next-line external-function\\n function getNextQueueIndex() public view returns (uint40) {\\n return _nextQueueIndex;\\n }\\n\\n /**\\n * Returns the timestamp of the last transaction.\\n * @return Timestamp for the last transaction.\\n */\\n // slither-disable-next-line external-function\\n function getLastTimestamp() public view returns (uint40) {\\n (, , uint40 lastTimestamp, ) = _getBatchExtraData();\\n return lastTimestamp;\\n }\\n\\n /**\\n * Returns the blocknumber of the last transaction.\\n * @return Blocknumber for the last transaction.\\n */\\n // slither-disable-next-line external-function\\n function getLastBlockNumber() public view returns (uint40) {\\n (, , , uint40 lastBlockNumber) = _getBatchExtraData();\\n return lastBlockNumber;\\n }\\n\\n /**\\n * Gets the queue element at a particular index.\\n * @param _index Index of the queue element to access.\\n * @return _element Queue element at the given index.\\n */\\n // slither-disable-next-line external-function\\n function getQueueElement(uint256 _index)\\n public\\n view\\n returns (Lib_BVMCodec.QueueElement memory _element)\\n {\\n return queueElements[_index];\\n }\\n\\n /**\\n * Get the number of queue elements which have not yet been included.\\n * @return Number of pending queue elements.\\n */\\n // slither-disable-next-line external-function\\n function getNumPendingQueueElements() public view returns (uint40) {\\n return uint40(queueElements.length) - _nextQueueIndex;\\n }\\n\\n /**\\n * Retrieves the length of the queue, including\\n * both pending and canonical transactions.\\n * @return Length of the queue.\\n */\\n // slither-disable-next-line external-function\\n function getQueueLength() public view returns (uint40) {\\n return uint40(queueElements.length);\\n }\\n\\n /**\\n * Adds a transaction to the queue.\\n * @param _target Target L2 contract to send the transaction to.\\n * @param _gasLimit Gas limit for the enqueued L2 transaction.\\n * @param _data Transaction data.\\n */\\n function enqueue(\\n address _target,\\n uint256 _gasLimit,\\n bytes memory _data\\n ) external {\\n require(\\n _data.length <= MAX_ROLLUP_TX_SIZE,\\n \\\"Transaction data size exceeds maximum for rollup transaction.\\\"\\n );\\n\\n require(\\n _gasLimit <= maxTransactionGasLimit,\\n \\\"Transaction gas limit exceeds maximum for rollup transaction.\\\"\\n );\\n\\n require(_gasLimit >= MIN_ROLLUP_TX_GAS, \\\"Transaction gas limit too low to enqueue.\\\");\\n\\n // Transactions submitted to the queue lack a method for paying gas fees to the Sequencer.\\n // So we need to prevent spam attacks by ensuring that the cost of enqueueing a transaction\\n // from L1 to L2 is not underpriced. For transaction with a high L2 gas limit, we do this by\\n // burning some extra gas on L1. Of course there is also some intrinsic cost to enqueueing a\\n // transaction, so we want to make sure not to over-charge (by burning too much L1 gas).\\n // Therefore, we define 'enqueueL2GasPrepaid' as the L2 gas limit above which we must burn\\n // additional gas on L1. This threshold is the product of two inputs:\\n // 1. enqueueGasCost: the base cost of calling this function.\\n // 2. l2GasDiscountDivisor: the ratio between the cost of gas on L1 and L2. This is a\\n // positive integer, meaning we assume L2 gas is always less costly.\\n // The calculation below for gasToConsume can be seen as converting the difference (between\\n // the specified L2 gas limit and the prepaid L2 gas limit) to an L1 gas amount.\\n if (_gasLimit > enqueueL2GasPrepaid) {\\n uint256 gasToConsume = (_gasLimit - enqueueL2GasPrepaid) / l2GasDiscountDivisor;\\n uint256 startingGas = gasleft();\\n\\n // Although this check is not necessary (burn below will run out of gas if not true), it\\n // gives the user an explicit reason as to why the enqueue attempt failed.\\n require(startingGas > gasToConsume, \\\"Insufficient gas for L2 rate limiting burn.\\\");\\n\\n uint256 i;\\n while (startingGas - gasleft() < gasToConsume) {\\n i++;\\n }\\n }\\n\\n // Apply an aliasing unless msg.sender == tx.origin. This prevents an attack in which a\\n // contract on L1 has the same address as a contract on L2 but doesn't have the same code.\\n // We can safely ignore this for EOAs because they're guaranteed to have the same \\\"code\\\"\\n // (i.e. no code at all). This also makes it possible for users to interact with contracts\\n // on L2 even when the Sequencer is down.\\n address sender;\\n if (msg.sender == tx.origin) {\\n sender = msg.sender;\\n } else {\\n sender = AddressAliasHelper.applyL1ToL2Alias(msg.sender);\\n }\\n\\n bytes32 transactionHash = keccak256(abi.encode(sender, _target, _gasLimit, _data));\\n\\n queueElements.push(\\n Lib_BVMCodec.QueueElement({\\n transactionHash: transactionHash,\\n timestamp: uint40(block.timestamp),\\n blockNumber: uint40(block.number)\\n })\\n );\\n uint256 queueIndex = queueElements.length - 1;\\n emit TransactionEnqueued(sender, _target, _gasLimit, _data, queueIndex, block.timestamp);\\n }\\n\\n /**\\n * Allows the sequencer to append a batch of transactions.\\n * @dev This function uses a custom encoding scheme for efficiency reasons.\\n * .param _shouldStartAtElement Specific batch we expect to start appending to.\\n * .param _totalElementsToAppend Total number of batch elements we expect to append.\\n * .param _contexts Array of batch contexts.\\n * .param _transactionDataFields Array of raw transaction data.\\n */\\n function appendSequencerBatch() external {\\n uint40 shouldStartAtElement;\\n uint24 totalElementsToAppend;\\n uint24 numContexts;\\n assembly {\\n shouldStartAtElement := shr(216, calldataload(4))\\n totalElementsToAppend := shr(232, calldataload(9))\\n numContexts := shr(232, calldataload(12))\\n }\\n\\n require(\\n shouldStartAtElement == getTotalElements(),\\n \\\"Actual batch start index does not match expected start index.\\\"\\n );\\n\\n require(\\n msg.sender == resolve(\\\"BVM_Sequencer\\\"),\\n \\\"Function can only be called by the Sequencer.\\\"\\n );\\n\\n uint40 nextTransactionPtr = uint40(\\n BATCH_CONTEXT_START_POS + BATCH_CONTEXT_SIZE * numContexts\\n );\\n\\n require(msg.data.length >= nextTransactionPtr, \\\"Not enough BatchContexts provided.\\\");\\n\\n // Counter for number of sequencer transactions appended so far.\\n uint32 numSequencerTransactions = 0;\\n\\n // Cache the _nextQueueIndex storage variable to a temporary stack variable.\\n // This is safe as long as nothing reads or writes to the storage variable\\n // until it is updated by the temp variable.\\n uint40 nextQueueIndex = _nextQueueIndex;\\n\\n BatchContext memory curContext;\\n for (uint32 i = 0; i < numContexts; i++) {\\n BatchContext memory nextContext = _getBatchContext(i);\\n\\n // Now we can update our current context.\\n curContext = nextContext;\\n\\n // Process sequencer transactions first.\\n numSequencerTransactions += uint32(curContext.numSequencedTransactions);\\n\\n // Now process any subsequent queue transactions.\\n nextQueueIndex += uint40(curContext.numSubsequentQueueTransactions);\\n }\\n\\n require(\\n nextQueueIndex <= queueElements.length,\\n \\\"Attempted to append more elements than are available in the queue.\\\"\\n );\\n\\n // Generate the required metadata that we need to append this batch\\n uint40 numQueuedTransactions = totalElementsToAppend - numSequencerTransactions;\\n uint40 blockTimestamp;\\n uint40 blockNumber;\\n if (curContext.numSubsequentQueueTransactions == 0) {\\n // The last element is a sequencer tx, therefore pull timestamp and block number from\\n // the last context.\\n blockTimestamp = uint40(curContext.timestamp);\\n blockNumber = uint40(curContext.blockNumber);\\n } else {\\n // The last element is a queue tx, therefore pull timestamp and block number from the\\n // queue element.\\n // curContext.numSubsequentQueueTransactions > 0 which means that we've processed at\\n // least one queue element. We increment nextQueueIndex after processing each queue\\n // element, so the index of the last element we processed is nextQueueIndex - 1.\\n Lib_BVMCodec.QueueElement memory lastElement = queueElements[nextQueueIndex - 1];\\n\\n blockTimestamp = lastElement.timestamp;\\n blockNumber = lastElement.blockNumber;\\n }\\n\\n // Cache the previous blockhash to ensure all transaction data can be retrieved efficiently.\\n // slither-disable-next-line reentrancy-no-eth, reentrancy-events\\n _appendBatch(\\n blockhash(block.number - 1),\\n totalElementsToAppend,\\n numQueuedTransactions,\\n blockTimestamp,\\n blockNumber\\n );\\n\\n // slither-disable-next-line reentrancy-events\\n emit SequencerBatchAppended(\\n nextQueueIndex - numQueuedTransactions,\\n numQueuedTransactions,\\n getTotalElements()\\n );\\n\\n // Update the _nextQueueIndex storage variable.\\n // slither-disable-next-line reentrancy-no-eth\\n _nextQueueIndex = nextQueueIndex;\\n }\\n\\n /**********************\\n * Internal Functions *\\n **********************/\\n\\n /**\\n * Returns the BatchContext located at a particular index.\\n * @param _index The index of the BatchContext\\n * @return The BatchContext at the specified index.\\n */\\n function _getBatchContext(uint256 _index) internal pure returns (BatchContext memory) {\\n uint256 contextPtr = 15 + _index * BATCH_CONTEXT_SIZE;\\n // slither-disable-next-line similar-names\\n uint256 numSequencedTransactions;\\n uint256 numSubsequentQueueTransactions;\\n uint256 ctxTimestamp;\\n uint256 ctxBlockNumber;\\n\\n assembly {\\n numSequencedTransactions := shr(232, calldataload(contextPtr))\\n numSubsequentQueueTransactions := shr(232, calldataload(add(contextPtr, 3)))\\n ctxTimestamp := shr(216, calldataload(add(contextPtr, 6)))\\n ctxBlockNumber := shr(216, calldataload(add(contextPtr, 11)))\\n }\\n\\n return\\n BatchContext({\\n numSequencedTransactions: numSequencedTransactions,\\n numSubsequentQueueTransactions: numSubsequentQueueTransactions,\\n timestamp: ctxTimestamp,\\n blockNumber: ctxBlockNumber\\n });\\n }\\n\\n /**\\n * Parses the batch context from the extra data.\\n * @return Total number of elements submitted.\\n * @return Index of the next queue element.\\n */\\n function _getBatchExtraData()\\n internal\\n view\\n returns (\\n uint40,\\n uint40,\\n uint40,\\n uint40\\n )\\n {\\n bytes27 extraData = batches().getGlobalMetadata();\\n\\n uint40 totalElements;\\n uint40 nextQueueIndex;\\n uint40 lastTimestamp;\\n uint40 lastBlockNumber;\\n\\n // solhint-disable max-line-length\\n assembly {\\n extraData := shr(40, extraData)\\n totalElements := and(\\n extraData,\\n 0x000000000000000000000000000000000000000000000000000000FFFFFFFFFF\\n )\\n nextQueueIndex := shr(\\n 40,\\n and(extraData, 0x00000000000000000000000000000000000000000000FFFFFFFFFF0000000000)\\n )\\n lastTimestamp := shr(\\n 80,\\n and(extraData, 0x0000000000000000000000000000000000FFFFFFFFFF00000000000000000000)\\n )\\n lastBlockNumber := shr(\\n 120,\\n and(extraData, 0x000000000000000000000000FFFFFFFFFF000000000000000000000000000000)\\n )\\n }\\n // solhint-enable max-line-length\\n\\n return (totalElements, nextQueueIndex, lastTimestamp, lastBlockNumber);\\n }\\n\\n /**\\n * Encodes the batch context for the extra data.\\n * @param _totalElements Total number of elements submitted.\\n * @param _nextQueueIdx Index of the next queue element.\\n * @param _timestamp Timestamp for the last batch.\\n * @param _blockNumber Block number of the last batch.\\n * @return Encoded batch context.\\n */\\n function _makeBatchExtraData(\\n uint40 _totalElements,\\n uint40 _nextQueueIdx,\\n uint40 _timestamp,\\n uint40 _blockNumber\\n ) internal pure returns (bytes27) {\\n bytes27 extraData;\\n assembly {\\n extraData := _totalElements\\n extraData := or(extraData, shl(40, _nextQueueIdx))\\n extraData := or(extraData, shl(80, _timestamp))\\n extraData := or(extraData, shl(120, _blockNumber))\\n extraData := shl(40, extraData)\\n }\\n\\n return