Commit 136ea178 authored by Kelvin Fichter's avatar Kelvin Fichter

feat(ctb): make SUBMISSION_INTERVAL modifiable

Updates the L2OutputOracle so that SUBMISSION_INTERVAL can be modified.
This is a relatively significant refactor that makes the l2Outputs
mapping keyed by index rather than L2 block number.
parent 66f7de23
---
'@eth-optimism/contracts-bedrock': patch
'@eth-optimism/core-utils': patch
'@eth-optimism/sdk': patch
---
Refactors the L2OutputOracle to key the l2Outputs mapping by index instead of by L2 block number.
...@@ -204,6 +204,12 @@ func TestBedrockIndexer(t *testing.T) { ...@@ -204,6 +204,12 @@ func TestBedrockIndexer(t *testing.T) {
wParams, err := withdrawals.ProveWithdrawalParameters(context.Background(), proofCl, receiptCl, wdTx.Hash(), finHeader) wParams, err := withdrawals.ProveWithdrawalParameters(context.Background(), proofCl, receiptCl, wdTx.Hash(), finHeader)
require.NoError(t, err) require.NoError(t, err)
oracle, err := bindings.NewL2OutputOracleCaller(predeploys.DevL2OutputOracleAddr, l1Client)
require.Nil(t, err)
l2OutputIndex, err := oracle.GetL2OutputIndexAfter(&bind.CallOpts{}, wParams.BlockNumber)
require.Nil(t, err)
l1Opts.Value = big.NewInt(0) l1Opts.Value = big.NewInt(0)
// Prove our withdrawal // Prove our withdrawal
proveTx, err := portal.ProveWithdrawalTransaction( proveTx, err := portal.ProveWithdrawalTransaction(
...@@ -216,7 +222,7 @@ func TestBedrockIndexer(t *testing.T) { ...@@ -216,7 +222,7 @@ func TestBedrockIndexer(t *testing.T) {
GasLimit: wParams.GasLimit, GasLimit: wParams.GasLimit,
Data: wParams.Data, Data: wParams.Data,
}, },
wParams.BlockNumber, l2OutputIndex,
wParams.OutputRootProof, wParams.OutputRootProof,
wParams.WithdrawalProof, wParams.WithdrawalProof,
) )
......
...@@ -32,12 +32,13 @@ var ( ...@@ -32,12 +32,13 @@ var (
type TypesOutputProposal struct { type TypesOutputProposal struct {
OutputRoot [32]byte OutputRoot [32]byte
Timestamp *big.Int Timestamp *big.Int
L2BlockNumber *big.Int
} }
// L2OutputOracleMetaData contains all meta data concerning the L2OutputOracle contract. // L2OutputOracleMetaData contains all meta data concerning the L2OutputOracle contract.
var L2OutputOracleMetaData = &bind.MetaData{ var L2OutputOracleMetaData = &bind.MetaData{
ABI: "[{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_submissionInterval\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_l2BlockTime\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_startingBlockNumber\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_startingTimestamp\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"_proposer\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_challenger\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"outputRoot\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"l1Timestamp\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"l2BlockNumber\",\"type\":\"uint256\"}],\"name\":\"OutputProposed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"l2BlockNumber\",\"type\":\"uint256\"}],\"name\":\"OutputsDeleted\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"CHALLENGER\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"L2_BLOCK_TIME\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"PROPOSER\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"SUBMISSION_INTERVAL\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_l2BlockNumber\",\"type\":\"uint256\"}],\"name\":\"computeL2Timestamp\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_l2BlockNumber\",\"type\":\"uint256\"}],\"name\":\"deleteL2Outputs\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_l2BlockNumber\",\"type\":\"uint256\"}],\"name\":\"getL2Output\",\"outputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"outputRoot\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"timestamp\",\"type\":\"uint256\"}],\"internalType\":\"structTypes.OutputProposal\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_startingBlockNumber\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_startingTimestamp\",\"type\":\"uint256\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"latestBlockNumber\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"nextBlockNumber\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_outputRoot\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"_l2BlockNumber\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"_l1Blockhash\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"_l1BlockNumber\",\"type\":\"uint256\"}],\"name\":\"proposeL2Output\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"startingBlockNumber\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"startingTimestamp\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"version\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", ABI: "[{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_submissionInterval\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_l2BlockTime\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_startingBlockNumber\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_startingTimestamp\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"_proposer\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_challenger\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"outputRoot\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"l2OutputIndex\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"l2BlockNumber\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"l1Timestamp\",\"type\":\"uint256\"}],\"name\":\"OutputProposed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"prevNextOutputIndex\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"newNextOutputIndex\",\"type\":\"uint256\"}],\"name\":\"OutputsDeleted\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"CHALLENGER\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"L2_BLOCK_TIME\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"PROPOSER\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"SUBMISSION_INTERVAL\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_l2BlockNumber\",\"type\":\"uint256\"}],\"name\":\"computeL2Timestamp\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_l2OutputIndex\",\"type\":\"uint256\"}],\"name\":\"deleteL2Outputs\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_l2OutputIndex\",\"type\":\"uint256\"}],\"name\":\"getL2Output\",\"outputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"outputRoot\",\"type\":\"bytes32\"},{\"internalType\":\"uint128\",\"name\":\"timestamp\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"l2BlockNumber\",\"type\":\"uint128\"}],\"internalType\":\"structTypes.OutputProposal\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_l2BlockNumber\",\"type\":\"uint256\"}],\"name\":\"getL2OutputAfter\",\"outputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"outputRoot\",\"type\":\"bytes32\"},{\"internalType\":\"uint128\",\"name\":\"timestamp\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"l2BlockNumber\",\"type\":\"uint128\"}],\"internalType\":\"structTypes.OutputProposal\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_l2BlockNumber\",\"type\":\"uint256\"}],\"name\":\"getL2OutputIndexAfter\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_startingBlockNumber\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_startingTimestamp\",\"type\":\"uint256\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"latestBlockNumber\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"latestOutputIndex\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"nextBlockNumber\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"nextOutputIndex\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_outputRoot\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"_l2BlockNumber\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"_l1BlockHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"_l1BlockNumber\",\"type\":\"uint256\"}],\"name\":\"proposeL2Output\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"startingBlockNumber\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"startingTimestamp\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"version\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]",
Bin: "0x6101606040523480156200001257600080fd5b506040516200169938038062001699833981016040819052620000359162000267565b6000608081905260a052600160c05260e08690526101008590526001600160a01b03808316610140528116610120526200007084846200007c565b505050505050620002c4565b600054610100900460ff16158080156200009d5750600054600160ff909116105b80620000cd5750620000ba306200023b60201b62000f001760201c565b158015620000cd575060005460ff166001145b620001365760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084015b60405180910390fd5b6000805460ff1916600117905580156200015a576000805461ff0019166101001790555b42821115620001e05760405162461bcd60e51b8152602060048201526044602482018190527f4c324f75747075744f7261636c653a207374617274696e67204c322074696d65908201527f7374616d70206d757374206265206c657373207468616e2063757272656e742060648201526374696d6560e01b608482015260a4016200012d565b600282905560018390556003839055801562000236576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050565b6001600160a01b03163b151590565b80516001600160a01b03811681146200026257600080fd5b919050565b60008060008060008060c087890312156200028157600080fd5b86519550602087015194506040870151935060608701519250620002a8608088016200024a565b9150620002b860a088016200024a565b90509295509295509295565b60805160a05160c05160e05161010051610120516101405161134a6200034f6000396000818161029b01526106450152600081816101a601526103cd01526000818160f30152610c2f015260008181610150015281816105d701528181610aeb01528181610b320152610c7d0152600061036b0152600061034201526000610319015261134a6000f3fe6080604052600436106100dc5760003560e01c806389c44cbb1161007f578063bffa7f0f11610059578063bffa7f0f14610289578063d1de856c146102bd578063dcec3348146102dd578063e4a30116146102f257600080fd5b806389c44cbb146102195780639aaab6481461023b578063a25ae5571461024e57600080fd5b806354fd4d50116100bb57806354fd4d50146101725780636b4d98dd1461019457806370872aa5146101ed578063887862721461020357600080fd5b80622134cc146100e15780634599c78814610128578063529933df1461013e575b600080fd5b3480156100ed57600080fd5b506101157f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b34801561013457600080fd5b5061011560035481565b34801561014a57600080fd5b506101157f000000000000000000000000000000000000000000000000000000000000000081565b34801561017e57600080fd5b50610187610312565b60405161011f9190611081565b3480156101a057600080fd5b506101c87f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200161011f565b3480156101f957600080fd5b5061011560015481565b34801561020f57600080fd5b5061011560025481565b34801561022557600080fd5b506102396102343660046110d2565b6103b5565b005b6102396102493660046110eb565b61062d565b34801561025a57600080fd5b5061026e6102693660046110d2565b610a1b565b6040805182518152602092830151928101929092520161011f565b34801561029557600080fd5b506101c87f000000000000000000000000000000000000000000000000000000000000000081565b3480156102c957600080fd5b506101156102d83660046110d2565b610c2b565b3480156102e957600080fd5b50610115610c79565b3480156102fe57600080fd5b5061023961030d36600461111d565b610cae565b606061033d7f0000000000000000000000000000000000000000000000000000000000000000610f1c565b6103667f0000000000000000000000000000000000000000000000000000000000000000610f1c565b61038f7f0000000000000000000000000000000000000000000000000000000000000000610f1c565b6040516020016103a19392919061113f565b604051602081830303815290604052905090565b3373ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000161461047f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603e60248201527f4c324f75747075744f7261636c653a206f6e6c7920746865206368616c6c656e60448201527f67657220616464726573732063616e2064656c657465206f757470757473000060648201526084015b60405180910390fd5b60008181526004602052604090205461051a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603360248201527f4c324f75747075744f7261636c653a2063616e6e6f742064656c65746520612060448201527f6e6f6e2d6578697374656e74206f7574707574000000000000000000000000006064820152608401610476565b6003548111156105d2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604360248201527f4c324f75747075744f7261636c653a2063616e6e6f742064656c657465206f7560448201527f747075747320616674657220746865206c617465737420626c6f636b206e756d60648201527f6265720000000000000000000000000000000000000000000000000000000000608482015260a401610476565b6105fc7f0000000000000000000000000000000000000000000000000000000000000000826111e4565b60035560405181907f21cbfd8ae20a7662b0a8aa9162fc9428f52c94b2e0ac268312628ea47f3f17eb90600090a250565b3373ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001614610718576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604160248201527f4c324f75747075744f7261636c653a206f6e6c79207468652070726f706f736560448201527f7220616464726573732063616e2070726f706f7365206e6577206f757470757460648201527f7300000000000000000000000000000000000000000000000000000000000000608482015260a401610476565b610720610c79565b83146107d4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604860248201527f4c324f75747075744f7261636c653a20626c6f636b206e756d626572206d757360448201527f7420626520657175616c20746f206e65787420657870656374656420626c6f6360648201527f6b206e756d626572000000000000000000000000000000000000000000000000608482015260a401610476565b426107de84610c2b565b1061086b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603660248201527f4c324f75747075744f7261636c653a2063616e6e6f742070726f706f7365204c60448201527f32206f757470757420696e2074686520667574757265000000000000000000006064820152608401610476565b836108f8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603a60248201527f4c324f75747075744f7261636c653a204c32206f75747075742070726f706f7360448201527f616c2063616e6e6f7420626520746865207a65726f20686173680000000000006064820152608401610476565b81156109b457818140146109b4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604860248201527f4c324f75747075744f7261636c653a20626c6f636b6861736820646f6573206e60448201527f6f74206d6174636820746865206861736820617420746865206578706563746560648201527f6420686569676874000000000000000000000000000000000000000000000000608482015260a401610476565b8242857fc120f5e881491e6e212befa39e36b8f57d5eca31915f2e5d60a420f418caa6df60405160405180910390a4505060408051808201825292835242602080850191825260008481526004909152919091209251835551600190920191909155600355565b6040805180820190915260008082526020820152600354821115610ae7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604b60248201527f4c324f75747075744f7261636c653a20626c6f636b206e756d6265722063616e60448201527f6e6f742062652067726561746572207468616e20746865206c6174657374206260648201527f6c6f636b206e756d626572000000000000000000000000000000000000000000608482015260a401610476565b60007f000000000000000000000000000000000000000000000000000000000000000060015484610b1891906111e4565b610b22919061122a565b905060008115610b6557610b56827f00000000000000000000000000000000000000000000000000000000000000006111e4565b610b60908561123e565b610b67565b835b600081815260046020908152604091829020825180840190935280548084526001909101549183019190915291925090610c23576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603a60248201527f4c324f75747075744f7261636c653a206e6f206f757470757420666f756e642060448201527f666f722074686520676976656e20626c6f636b206e756d6265720000000000006064820152608401610476565b949350505050565b60007f000000000000000000000000000000000000000000000000000000000000000060015483610c5c91906111e4565b610c669190611256565b600254610c73919061123e565b92915050565b60007f0000000000000000000000000000000000000000000000000000000000000000600354610ca9919061123e565b905090565b600054610100900460ff1615808015610cce5750600054600160ff909116105b80610ce85750303b158015610ce8575060005460ff166001145b610d74576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152608401610476565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790558015610dd257600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b42821115610e89576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526044602482018190527f4c324f75747075744f7261636c653a207374617274696e67204c322074696d65908201527f7374616d70206d757374206265206c657373207468616e2063757272656e742060648201527f74696d6500000000000000000000000000000000000000000000000000000000608482015260a401610476565b6002829055600183905560038390558015610efb57600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050565b73ffffffffffffffffffffffffffffffffffffffff163b151590565b606081600003610f5f57505060408051808201909152600181527f3000000000000000000000000000000000000000000000000000000000000000602082015290565b8160005b8115610f895780610f7381611293565b9150610f829050600a836112cb565b9150610f63565b60008167ffffffffffffffff811115610fa457610fa46112df565b6040519080825280601f01601f191660200182016040528015610fce576020820181803683370190505b5090505b8415610c2357610fe36001836111e4565b9150610ff0600a8661122a565b610ffb90603061123e565b60f81b8183815181106110105761101061130e565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535061104a600a866112cb565b9450610fd2565b60005b8381101561106c578181015183820152602001611054565b8381111561107b576000848401525b50505050565b60208152600082518060208401526110a0816040850160208701611051565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169190910160400192915050565b6000602082840312156110e457600080fd5b5035919050565b6000806000806080858703121561110157600080fd5b5050823594602084013594506040840135936060013592509050565b6000806040838503121561113057600080fd5b50508035926020909101359150565b60008451611151818460208901611051565b80830190507f2e00000000000000000000000000000000000000000000000000000000000000808252855161118d816001850160208a01611051565b600192019182015283516111a8816002840160208801611051565b0160020195945050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000828210156111f6576111f66111b5565b500390565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600082611239576112396111fb565b500690565b60008219821115611251576112516111b5565b500190565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561128e5761128e6111b5565b500290565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036112c4576112c46111b5565b5060010190565b6000826112da576112da6111fb565b500490565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fdfea164736f6c634300080f000a", Bin: "0x6101606040523480156200001257600080fd5b506040516200188b3803806200188b833981016040819052620000359162000262565b6000608081905260a052600160c05260e08690526101008590526001600160a01b03808316610140528116610120526200007084846200007c565b505050505050620002bf565b600054610100900460ff16158080156200009d5750600054600160ff909116105b80620000cd5750620000ba306200023660201b620011031760201c565b158015620000cd575060005460ff166001145b620001365760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084015b60405180910390fd5b6000805460ff1916600117905580156200015a576000805461ff0019166101001790555b42821115620001e05760405162461bcd60e51b8152602060048201526044602482018190527f4c324f75747075744f7261636c653a207374617274696e67204c322074696d65908201527f7374616d70206d757374206265206c657373207468616e2063757272656e742060648201526374696d6560e01b608482015260a4016200012d565b60028290556001839055801562000231576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050565b6001600160a01b03163b151590565b80516001600160a01b03811681146200025d57600080fd5b919050565b60008060008060008060c087890312156200027c57600080fd5b86519550602087015194506040870151935060608701519250620002a36080880162000245565b9150620002b360a0880162000245565b90509295509295509295565b60805160a05160c05160e0516101005161012051610140516115556200033660003960008181610351015261090001526000818161021b015261074101526000818161013f0152610e3701526000818161019b0152610e85015260006104b40152600061048b0152600061046201526115556000f3fe6080604052600436106101285760003560e01c806388786272116100a5578063bffa7f0f11610074578063d1de856c11610059578063d1de856c14610393578063dcec3348146103b3578063e4a30116146103c857600080fd5b8063bffa7f0f1461033f578063cf8e5cf01461037357600080fd5b8063887862721461029857806389c44cbb146102ae5780639aaab648146102d0578063a25ae557146102e357600080fd5b806369f16eec116100fc5780636b4d98dd116100e15780636b4d98dd1461020957806370872aa5146102625780637f0064201461027857600080fd5b806369f16eec146101df5780636abcf563146101f457600080fd5b80622134cc1461012d5780634599c78814610174578063529933df1461018957806354fd4d50146101bd575b600080fd5b34801561013957600080fd5b506101617f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b34801561018057600080fd5b506101616103e8565b34801561019557600080fd5b506101617f000000000000000000000000000000000000000000000000000000000000000081565b3480156101c957600080fd5b506101d261045b565b60405161016b919061128c565b3480156101eb57600080fd5b506101616104fe565b34801561020057600080fd5b50600354610161565b34801561021557600080fd5b5061023d7f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200161016b565b34801561026e57600080fd5b5061016160015481565b34801561028457600080fd5b506101616102933660046112dd565b610510565b3480156102a457600080fd5b5061016160025481565b3480156102ba57600080fd5b506102ce6102c93660046112dd565b610729565b005b6102ce6102de3660046112f6565b6108e8565b3480156102ef57600080fd5b506103036102fe3660046112dd565b610d67565b60408051825181526020808401516fffffffffffffffffffffffffffffffff90811691830191909152928201519092169082015260600161016b565b34801561034b57600080fd5b5061023d7f000000000000000000000000000000000000000000000000000000000000000081565b34801561037f57600080fd5b5061030361038e3660046112dd565b610dfb565b34801561039f57600080fd5b506101616103ae3660046112dd565b610e33565b3480156103bf57600080fd5b50610161610e81565b3480156103d457600080fd5b506102ce6103e3366004611328565b610eb6565b60035460009015610452576003805461040390600190611379565b8154811061041357610413611390565b600091825260209091206002909102016001015470010000000000000000000000000000000090046fffffffffffffffffffffffffffffffff16919050565b6001545b905090565b60606104867f000000000000000000000000000000000000000000000000000000000000000061111f565b6104af7f000000000000000000000000000000000000000000000000000000000000000061111f565b6104d87f000000000000000000000000000000000000000000000000000000000000000061111f565b6040516020016104ea939291906113bf565b604051602081830303815290604052905090565b60035460009061045690600190611379565b600061051a6103e8565b8211156105d4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604860248201527f4c324f75747075744f7261636c653a2063616e6e6f7420676574206f7574707560448201527f7420666f72206120626c6f636b207468617420686173206e6f74206265656e2060648201527f70726f706f736564000000000000000000000000000000000000000000000000608482015260a4015b60405180910390fd5b600354610689576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604660248201527f4c324f75747075744f7261636c653a2063616e6e6f7420676574206f7574707560448201527f74206173206e6f206f7574707574732068617665206265656e2070726f706f7360648201527f6564207965740000000000000000000000000000000000000000000000000000608482015260a4016105cb565b6003546000905b8082101561072257600060026106a68385611435565b6106b0919061147c565b905084600382815481106106c6576106c6611390565b600091825260209091206002909102016001015470010000000000000000000000000000000090046fffffffffffffffffffffffffffffffff16101561071857610711816001611435565b925061071c565b8091505b50610690565b5092915050565b3373ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016146107ee576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603e60248201527f4c324f75747075744f7261636c653a206f6e6c7920746865206368616c6c656e60448201527f67657220616464726573732063616e2064656c657465206f757470757473000060648201526084016105cb565b60035481106108a5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604360248201527f4c324f75747075744f7261636c653a2063616e6e6f742064656c657465206f7560448201527f747075747320616674657220746865206c6174657374206f757470757420696e60648201527f6465780000000000000000000000000000000000000000000000000000000000608482015260a4016105cb565b60006108b060035490565b90508160035581817f4ee37ac2c786ec85e87592d3c5c8a1dd66f8496dda3f125d9ea8ca5f657629b660405160405180910390a35050565b3373ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016146109d3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604160248201527f4c324f75747075744f7261636c653a206f6e6c79207468652070726f706f736560448201527f7220616464726573732063616e2070726f706f7365206e6577206f757470757460648201527f7300000000000000000000000000000000000000000000000000000000000000608482015260a4016105cb565b6109db610e81565b8314610a8f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604860248201527f4c324f75747075744f7261636c653a20626c6f636b206e756d626572206d757360448201527f7420626520657175616c20746f206e65787420657870656374656420626c6f6360648201527f6b206e756d626572000000000000000000000000000000000000000000000000608482015260a4016105cb565b42610a9984610e33565b10610b26576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603660248201527f4c324f75747075744f7261636c653a2063616e6e6f742070726f706f7365204c60448201527f32206f757470757420696e20746865206675747572650000000000000000000060648201526084016105cb565b83610bb3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603a60248201527f4c324f75747075744f7261636c653a204c32206f75747075742070726f706f7360448201527f616c2063616e6e6f7420626520746865207a65726f206861736800000000000060648201526084016105cb565b8115610c6f5781814014610c6f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604960248201527f4c324f75747075744f7261636c653a20626c6f636b206861736820646f65732060448201527f6e6f74206d61746368207468652068617368206174207468652065787065637460648201527f6564206865696768740000000000000000000000000000000000000000000000608482015260a4016105cb565b42610c7960035490565b857fa7aaf2512769da4e444e3de247be2564225c2e7a8f74cfe528e46e17d24868e286604051610cab91815260200190565b60405180910390a45050604080516060810182529283526fffffffffffffffffffffffffffffffff4281166020850190815292811691840191825260038054600181018255600091909152935160029094027fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b810194909455915190518216700100000000000000000000000000000000029116177fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85c90910155565b604080516060810182526000808252602082018190529181019190915260038281548110610d9757610d97611390565b600091825260209182902060408051606081018252600290930290910180548352600101546fffffffffffffffffffffffffffffffff8082169484019490945270010000000000000000000000000000000090049092169181019190915292915050565b60408051606081018252600080825260208201819052918101919091526003610e2383610510565b81548110610d9757610d97611390565b60007f000000000000000000000000000000000000000000000000000000000000000060015483610e649190611379565b610e6e9190611490565b600254610e7b9190611435565b92915050565b60007f0000000000000000000000000000000000000000000000000000000000000000610eac6103e8565b6104569190611435565b600054610100900460ff1615808015610ed65750600054600160ff909116105b80610ef05750303b158015610ef0575060005460ff166001145b610f7c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a656400000000000000000000000000000000000060648201526084016105cb565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790558015610fda57600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b42821115611091576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526044602482018190527f4c324f75747075744f7261636c653a207374617274696e67204c322074696d65908201527f7374616d70206d757374206265206c657373207468616e2063757272656e742060648201527f74696d6500000000000000000000000000000000000000000000000000000000608482015260a4016105cb565b6002829055600183905580156110fe57600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050565b73ffffffffffffffffffffffffffffffffffffffff163b151590565b60608160000361116257505060408051808201909152600181527f3000000000000000000000000000000000000000000000000000000000000000602082015290565b8160005b811561118c5780611176816114cd565b91506111859050600a8361147c565b9150611166565b60008167ffffffffffffffff8111156111a7576111a7611505565b6040519080825280601f01601f1916602001820160405280156111d1576020820181803683370190505b5090505b8415611254576111e6600183611379565b91506111f3600a86611534565b6111fe906030611435565b60f81b81838151811061121357611213611390565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535061124d600a8661147c565b94506111d5565b949350505050565b60005b8381101561127757818101518382015260200161125f565b83811115611286576000848401525b50505050565b60208152600082518060208401526112ab81604085016020870161125c565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169190910160400192915050565b6000602082840312156112ef57600080fd5b5035919050565b6000806000806080858703121561130c57600080fd5b5050823594602084013594506040840135936060013592509050565b6000806040838503121561133b57600080fd5b50508035926020909101359150565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60008282101561138b5761138b61134a565b500390565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600084516113d181846020890161125c565b80830190507f2e00000000000000000000000000000000000000000000000000000000000000808252855161140d816001850160208a0161125c565b6001920191820152835161142881600284016020880161125c565b0160020195945050505050565b600082198211156114485761144861134a565b500190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60008261148b5761148b61144d565b500490565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156114c8576114c861134a565b500290565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036114fe576114fe61134a565b5060010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000826115435761154361144d565b50069056fea164736f6c634300080f000a",
} }
// L2OutputOracleABI is the input ABI used to generate the binding from. // L2OutputOracleABI is the input ABI used to generate the binding from.
...@@ -364,10 +365,10 @@ func (_L2OutputOracle *L2OutputOracleCallerSession) ComputeL2Timestamp(_l2BlockN ...@@ -364,10 +365,10 @@ func (_L2OutputOracle *L2OutputOracleCallerSession) ComputeL2Timestamp(_l2BlockN
// GetL2Output is a free data retrieval call binding the contract method 0xa25ae557. // GetL2Output is a free data retrieval call binding the contract method 0xa25ae557.
// //
// Solidity: function getL2Output(uint256 _l2BlockNumber) view returns((bytes32,uint256)) // Solidity: function getL2Output(uint256 _l2OutputIndex) view returns((bytes32,uint128,uint128))
func (_L2OutputOracle *L2OutputOracleCaller) GetL2Output(opts *bind.CallOpts, _l2BlockNumber *big.Int) (TypesOutputProposal, error) { func (_L2OutputOracle *L2OutputOracleCaller) GetL2Output(opts *bind.CallOpts, _l2OutputIndex *big.Int) (TypesOutputProposal, error) {
var out []interface{} var out []interface{}
err := _L2OutputOracle.contract.Call(opts, &out, "getL2Output", _l2BlockNumber) err := _L2OutputOracle.contract.Call(opts, &out, "getL2Output", _l2OutputIndex)
if err != nil { if err != nil {
return *new(TypesOutputProposal), err return *new(TypesOutputProposal), err
...@@ -381,16 +382,78 @@ func (_L2OutputOracle *L2OutputOracleCaller) GetL2Output(opts *bind.CallOpts, _l ...@@ -381,16 +382,78 @@ func (_L2OutputOracle *L2OutputOracleCaller) GetL2Output(opts *bind.CallOpts, _l
// GetL2Output is a free data retrieval call binding the contract method 0xa25ae557. // GetL2Output is a free data retrieval call binding the contract method 0xa25ae557.
// //
// Solidity: function getL2Output(uint256 _l2BlockNumber) view returns((bytes32,uint256)) // Solidity: function getL2Output(uint256 _l2OutputIndex) view returns((bytes32,uint128,uint128))
func (_L2OutputOracle *L2OutputOracleSession) GetL2Output(_l2BlockNumber *big.Int) (TypesOutputProposal, error) { func (_L2OutputOracle *L2OutputOracleSession) GetL2Output(_l2OutputIndex *big.Int) (TypesOutputProposal, error) {
return _L2OutputOracle.Contract.GetL2Output(&_L2OutputOracle.CallOpts, _l2BlockNumber) return _L2OutputOracle.Contract.GetL2Output(&_L2OutputOracle.CallOpts, _l2OutputIndex)
} }
// GetL2Output is a free data retrieval call binding the contract method 0xa25ae557. // GetL2Output is a free data retrieval call binding the contract method 0xa25ae557.
// //
// Solidity: function getL2Output(uint256 _l2BlockNumber) view returns((bytes32,uint256)) // Solidity: function getL2Output(uint256 _l2OutputIndex) view returns((bytes32,uint128,uint128))
func (_L2OutputOracle *L2OutputOracleCallerSession) GetL2Output(_l2BlockNumber *big.Int) (TypesOutputProposal, error) { func (_L2OutputOracle *L2OutputOracleCallerSession) GetL2Output(_l2OutputIndex *big.Int) (TypesOutputProposal, error) {
return _L2OutputOracle.Contract.GetL2Output(&_L2OutputOracle.CallOpts, _l2BlockNumber) return _L2OutputOracle.Contract.GetL2Output(&_L2OutputOracle.CallOpts, _l2OutputIndex)
}
// GetL2OutputAfter is a free data retrieval call binding the contract method 0xcf8e5cf0.
//
// Solidity: function getL2OutputAfter(uint256 _l2BlockNumber) view returns((bytes32,uint128,uint128))
func (_L2OutputOracle *L2OutputOracleCaller) GetL2OutputAfter(opts *bind.CallOpts, _l2BlockNumber *big.Int) (TypesOutputProposal, error) {
var out []interface{}
err := _L2OutputOracle.contract.Call(opts, &out, "getL2OutputAfter", _l2BlockNumber)
if err != nil {
return *new(TypesOutputProposal), err
}
out0 := *abi.ConvertType(out[0], new(TypesOutputProposal)).(*TypesOutputProposal)
return out0, err
}
// GetL2OutputAfter is a free data retrieval call binding the contract method 0xcf8e5cf0.
//
// Solidity: function getL2OutputAfter(uint256 _l2BlockNumber) view returns((bytes32,uint128,uint128))
func (_L2OutputOracle *L2OutputOracleSession) GetL2OutputAfter(_l2BlockNumber *big.Int) (TypesOutputProposal, error) {
return _L2OutputOracle.Contract.GetL2OutputAfter(&_L2OutputOracle.CallOpts, _l2BlockNumber)
}
// GetL2OutputAfter is a free data retrieval call binding the contract method 0xcf8e5cf0.
//
// Solidity: function getL2OutputAfter(uint256 _l2BlockNumber) view returns((bytes32,uint128,uint128))
func (_L2OutputOracle *L2OutputOracleCallerSession) GetL2OutputAfter(_l2BlockNumber *big.Int) (TypesOutputProposal, error) {
return _L2OutputOracle.Contract.GetL2OutputAfter(&_L2OutputOracle.CallOpts, _l2BlockNumber)
}
// GetL2OutputIndexAfter is a free data retrieval call binding the contract method 0x7f006420.
//
// Solidity: function getL2OutputIndexAfter(uint256 _l2BlockNumber) view returns(uint256)
func (_L2OutputOracle *L2OutputOracleCaller) GetL2OutputIndexAfter(opts *bind.CallOpts, _l2BlockNumber *big.Int) (*big.Int, error) {
var out []interface{}
err := _L2OutputOracle.contract.Call(opts, &out, "getL2OutputIndexAfter", _l2BlockNumber)
if err != nil {
return *new(*big.Int), err
}
out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int)
return out0, err
}
// GetL2OutputIndexAfter is a free data retrieval call binding the contract method 0x7f006420.
//
// Solidity: function getL2OutputIndexAfter(uint256 _l2BlockNumber) view returns(uint256)
func (_L2OutputOracle *L2OutputOracleSession) GetL2OutputIndexAfter(_l2BlockNumber *big.Int) (*big.Int, error) {
return _L2OutputOracle.Contract.GetL2OutputIndexAfter(&_L2OutputOracle.CallOpts, _l2BlockNumber)
}
// GetL2OutputIndexAfter is a free data retrieval call binding the contract method 0x7f006420.
//
// Solidity: function getL2OutputIndexAfter(uint256 _l2BlockNumber) view returns(uint256)
func (_L2OutputOracle *L2OutputOracleCallerSession) GetL2OutputIndexAfter(_l2BlockNumber *big.Int) (*big.Int, error) {
return _L2OutputOracle.Contract.GetL2OutputIndexAfter(&_L2OutputOracle.CallOpts, _l2BlockNumber)
} }
// LatestBlockNumber is a free data retrieval call binding the contract method 0x4599c788. // LatestBlockNumber is a free data retrieval call binding the contract method 0x4599c788.
...@@ -424,6 +487,37 @@ func (_L2OutputOracle *L2OutputOracleCallerSession) LatestBlockNumber() (*big.In ...@@ -424,6 +487,37 @@ func (_L2OutputOracle *L2OutputOracleCallerSession) LatestBlockNumber() (*big.In
return _L2OutputOracle.Contract.LatestBlockNumber(&_L2OutputOracle.CallOpts) return _L2OutputOracle.Contract.LatestBlockNumber(&_L2OutputOracle.CallOpts)
} }
// LatestOutputIndex is a free data retrieval call binding the contract method 0x69f16eec.
//
// Solidity: function latestOutputIndex() view returns(uint256)
func (_L2OutputOracle *L2OutputOracleCaller) LatestOutputIndex(opts *bind.CallOpts) (*big.Int, error) {
var out []interface{}
err := _L2OutputOracle.contract.Call(opts, &out, "latestOutputIndex")
if err != nil {
return *new(*big.Int), err
}
out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int)
return out0, err
}
// LatestOutputIndex is a free data retrieval call binding the contract method 0x69f16eec.
//
// Solidity: function latestOutputIndex() view returns(uint256)
func (_L2OutputOracle *L2OutputOracleSession) LatestOutputIndex() (*big.Int, error) {
return _L2OutputOracle.Contract.LatestOutputIndex(&_L2OutputOracle.CallOpts)
}
// LatestOutputIndex is a free data retrieval call binding the contract method 0x69f16eec.
//
// Solidity: function latestOutputIndex() view returns(uint256)
func (_L2OutputOracle *L2OutputOracleCallerSession) LatestOutputIndex() (*big.Int, error) {
return _L2OutputOracle.Contract.LatestOutputIndex(&_L2OutputOracle.CallOpts)
}
// NextBlockNumber is a free data retrieval call binding the contract method 0xdcec3348. // NextBlockNumber is a free data retrieval call binding the contract method 0xdcec3348.
// //
// Solidity: function nextBlockNumber() view returns(uint256) // Solidity: function nextBlockNumber() view returns(uint256)
...@@ -455,6 +549,37 @@ func (_L2OutputOracle *L2OutputOracleCallerSession) NextBlockNumber() (*big.Int, ...@@ -455,6 +549,37 @@ func (_L2OutputOracle *L2OutputOracleCallerSession) NextBlockNumber() (*big.Int,
return _L2OutputOracle.Contract.NextBlockNumber(&_L2OutputOracle.CallOpts) return _L2OutputOracle.Contract.NextBlockNumber(&_L2OutputOracle.CallOpts)
} }
// NextOutputIndex is a free data retrieval call binding the contract method 0x6abcf563.
//
// Solidity: function nextOutputIndex() view returns(uint256)
func (_L2OutputOracle *L2OutputOracleCaller) NextOutputIndex(opts *bind.CallOpts) (*big.Int, error) {
var out []interface{}
err := _L2OutputOracle.contract.Call(opts, &out, "nextOutputIndex")
if err != nil {
return *new(*big.Int), err
}
out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int)
return out0, err
}
// NextOutputIndex is a free data retrieval call binding the contract method 0x6abcf563.
//
// Solidity: function nextOutputIndex() view returns(uint256)
func (_L2OutputOracle *L2OutputOracleSession) NextOutputIndex() (*big.Int, error) {
return _L2OutputOracle.Contract.NextOutputIndex(&_L2OutputOracle.CallOpts)
}
// NextOutputIndex is a free data retrieval call binding the contract method 0x6abcf563.
//
// Solidity: function nextOutputIndex() view returns(uint256)
func (_L2OutputOracle *L2OutputOracleCallerSession) NextOutputIndex() (*big.Int, error) {
return _L2OutputOracle.Contract.NextOutputIndex(&_L2OutputOracle.CallOpts)
}
// StartingBlockNumber is a free data retrieval call binding the contract method 0x70872aa5. // StartingBlockNumber is a free data retrieval call binding the contract method 0x70872aa5.
// //
// Solidity: function startingBlockNumber() view returns(uint256) // Solidity: function startingBlockNumber() view returns(uint256)
...@@ -550,23 +675,23 @@ func (_L2OutputOracle *L2OutputOracleCallerSession) Version() (string, error) { ...@@ -550,23 +675,23 @@ func (_L2OutputOracle *L2OutputOracleCallerSession) Version() (string, error) {
// DeleteL2Outputs is a paid mutator transaction binding the contract method 0x89c44cbb. // DeleteL2Outputs is a paid mutator transaction binding the contract method 0x89c44cbb.
// //
// Solidity: function deleteL2Outputs(uint256 _l2BlockNumber) returns() // Solidity: function deleteL2Outputs(uint256 _l2OutputIndex) returns()
func (_L2OutputOracle *L2OutputOracleTransactor) DeleteL2Outputs(opts *bind.TransactOpts, _l2BlockNumber *big.Int) (*types.Transaction, error) { func (_L2OutputOracle *L2OutputOracleTransactor) DeleteL2Outputs(opts *bind.TransactOpts, _l2OutputIndex *big.Int) (*types.Transaction, error) {
return _L2OutputOracle.contract.Transact(opts, "deleteL2Outputs", _l2BlockNumber) return _L2OutputOracle.contract.Transact(opts, "deleteL2Outputs", _l2OutputIndex)
} }
// DeleteL2Outputs is a paid mutator transaction binding the contract method 0x89c44cbb. // DeleteL2Outputs is a paid mutator transaction binding the contract method 0x89c44cbb.
// //
// Solidity: function deleteL2Outputs(uint256 _l2BlockNumber) returns() // Solidity: function deleteL2Outputs(uint256 _l2OutputIndex) returns()
func (_L2OutputOracle *L2OutputOracleSession) DeleteL2Outputs(_l2BlockNumber *big.Int) (*types.Transaction, error) { func (_L2OutputOracle *L2OutputOracleSession) DeleteL2Outputs(_l2OutputIndex *big.Int) (*types.Transaction, error) {
return _L2OutputOracle.Contract.DeleteL2Outputs(&_L2OutputOracle.TransactOpts, _l2BlockNumber) return _L2OutputOracle.Contract.DeleteL2Outputs(&_L2OutputOracle.TransactOpts, _l2OutputIndex)
} }
// DeleteL2Outputs is a paid mutator transaction binding the contract method 0x89c44cbb. // DeleteL2Outputs is a paid mutator transaction binding the contract method 0x89c44cbb.
// //
// Solidity: function deleteL2Outputs(uint256 _l2BlockNumber) returns() // Solidity: function deleteL2Outputs(uint256 _l2OutputIndex) returns()
func (_L2OutputOracle *L2OutputOracleTransactorSession) DeleteL2Outputs(_l2BlockNumber *big.Int) (*types.Transaction, error) { func (_L2OutputOracle *L2OutputOracleTransactorSession) DeleteL2Outputs(_l2OutputIndex *big.Int) (*types.Transaction, error) {
return _L2OutputOracle.Contract.DeleteL2Outputs(&_L2OutputOracle.TransactOpts, _l2BlockNumber) return _L2OutputOracle.Contract.DeleteL2Outputs(&_L2OutputOracle.TransactOpts, _l2OutputIndex)
} }
// Initialize is a paid mutator transaction binding the contract method 0xe4a30116. // Initialize is a paid mutator transaction binding the contract method 0xe4a30116.
...@@ -592,23 +717,23 @@ func (_L2OutputOracle *L2OutputOracleTransactorSession) Initialize(_startingBloc ...@@ -592,23 +717,23 @@ func (_L2OutputOracle *L2OutputOracleTransactorSession) Initialize(_startingBloc
// ProposeL2Output is a paid mutator transaction binding the contract method 0x9aaab648. // ProposeL2Output is a paid mutator transaction binding the contract method 0x9aaab648.
// //
// Solidity: function proposeL2Output(bytes32 _outputRoot, uint256 _l2BlockNumber, bytes32 _l1Blockhash, uint256 _l1BlockNumber) payable returns() // Solidity: function proposeL2Output(bytes32 _outputRoot, uint256 _l2BlockNumber, bytes32 _l1BlockHash, uint256 _l1BlockNumber) payable returns()
func (_L2OutputOracle *L2OutputOracleTransactor) ProposeL2Output(opts *bind.TransactOpts, _outputRoot [32]byte, _l2BlockNumber *big.Int, _l1Blockhash [32]byte, _l1BlockNumber *big.Int) (*types.Transaction, error) { func (_L2OutputOracle *L2OutputOracleTransactor) ProposeL2Output(opts *bind.TransactOpts, _outputRoot [32]byte, _l2BlockNumber *big.Int, _l1BlockHash [32]byte, _l1BlockNumber *big.Int) (*types.Transaction, error) {
return _L2OutputOracle.contract.Transact(opts, "proposeL2Output", _outputRoot, _l2BlockNumber, _l1Blockhash, _l1BlockNumber) return _L2OutputOracle.contract.Transact(opts, "proposeL2Output", _outputRoot, _l2BlockNumber, _l1BlockHash, _l1BlockNumber)
} }
// ProposeL2Output is a paid mutator transaction binding the contract method 0x9aaab648. // ProposeL2Output is a paid mutator transaction binding the contract method 0x9aaab648.
// //
// Solidity: function proposeL2Output(bytes32 _outputRoot, uint256 _l2BlockNumber, bytes32 _l1Blockhash, uint256 _l1BlockNumber) payable returns() // Solidity: function proposeL2Output(bytes32 _outputRoot, uint256 _l2BlockNumber, bytes32 _l1BlockHash, uint256 _l1BlockNumber) payable returns()
func (_L2OutputOracle *L2OutputOracleSession) ProposeL2Output(_outputRoot [32]byte, _l2BlockNumber *big.Int, _l1Blockhash [32]byte, _l1BlockNumber *big.Int) (*types.Transaction, error) { func (_L2OutputOracle *L2OutputOracleSession) ProposeL2Output(_outputRoot [32]byte, _l2BlockNumber *big.Int, _l1BlockHash [32]byte, _l1BlockNumber *big.Int) (*types.Transaction, error) {
return _L2OutputOracle.Contract.ProposeL2Output(&_L2OutputOracle.TransactOpts, _outputRoot, _l2BlockNumber, _l1Blockhash, _l1BlockNumber) return _L2OutputOracle.Contract.ProposeL2Output(&_L2OutputOracle.TransactOpts, _outputRoot, _l2BlockNumber, _l1BlockHash, _l1BlockNumber)
} }
// ProposeL2Output is a paid mutator transaction binding the contract method 0x9aaab648. // ProposeL2Output is a paid mutator transaction binding the contract method 0x9aaab648.
// //
// Solidity: function proposeL2Output(bytes32 _outputRoot, uint256 _l2BlockNumber, bytes32 _l1Blockhash, uint256 _l1BlockNumber) payable returns() // Solidity: function proposeL2Output(bytes32 _outputRoot, uint256 _l2BlockNumber, bytes32 _l1BlockHash, uint256 _l1BlockNumber) payable returns()
func (_L2OutputOracle *L2OutputOracleTransactorSession) ProposeL2Output(_outputRoot [32]byte, _l2BlockNumber *big.Int, _l1Blockhash [32]byte, _l1BlockNumber *big.Int) (*types.Transaction, error) { func (_L2OutputOracle *L2OutputOracleTransactorSession) ProposeL2Output(_outputRoot [32]byte, _l2BlockNumber *big.Int, _l1BlockHash [32]byte, _l1BlockNumber *big.Int) (*types.Transaction, error) {
return _L2OutputOracle.Contract.ProposeL2Output(&_L2OutputOracle.TransactOpts, _outputRoot, _l2BlockNumber, _l1Blockhash, _l1BlockNumber) return _L2OutputOracle.Contract.ProposeL2Output(&_L2OutputOracle.TransactOpts, _outputRoot, _l2BlockNumber, _l1BlockHash, _l1BlockNumber)
} }
// L2OutputOracleInitializedIterator is returned from FilterInitialized and is used to iterate over the raw logs and unpacked data for Initialized events raised by the L2OutputOracle contract. // L2OutputOracleInitializedIterator is returned from FilterInitialized and is used to iterate over the raw logs and unpacked data for Initialized events raised by the L2OutputOracle contract.
...@@ -815,55 +940,56 @@ func (it *L2OutputOracleOutputProposedIterator) Close() error { ...@@ -815,55 +940,56 @@ func (it *L2OutputOracleOutputProposedIterator) Close() error {
// L2OutputOracleOutputProposed represents a OutputProposed event raised by the L2OutputOracle contract. // L2OutputOracleOutputProposed represents a OutputProposed event raised by the L2OutputOracle contract.
type L2OutputOracleOutputProposed struct { type L2OutputOracleOutputProposed struct {
OutputRoot [32]byte OutputRoot [32]byte
L1Timestamp *big.Int L2OutputIndex *big.Int
L2BlockNumber *big.Int L2BlockNumber *big.Int
L1Timestamp *big.Int
Raw types.Log // Blockchain specific contextual infos Raw types.Log // Blockchain specific contextual infos
} }
// FilterOutputProposed is a free log retrieval operation binding the contract event 0xc120f5e881491e6e212befa39e36b8f57d5eca31915f2e5d60a420f418caa6df. // FilterOutputProposed is a free log retrieval operation binding the contract event 0xa7aaf2512769da4e444e3de247be2564225c2e7a8f74cfe528e46e17d24868e2.
// //
// Solidity: event OutputProposed(bytes32 indexed outputRoot, uint256 indexed l1Timestamp, uint256 indexed l2BlockNumber) // Solidity: event OutputProposed(bytes32 indexed outputRoot, uint256 indexed l2OutputIndex, uint256 indexed l2BlockNumber, uint256 l1Timestamp)
func (_L2OutputOracle *L2OutputOracleFilterer) FilterOutputProposed(opts *bind.FilterOpts, outputRoot [][32]byte, l1Timestamp []*big.Int, l2BlockNumber []*big.Int) (*L2OutputOracleOutputProposedIterator, error) { func (_L2OutputOracle *L2OutputOracleFilterer) FilterOutputProposed(opts *bind.FilterOpts, outputRoot [][32]byte, l2OutputIndex []*big.Int, l2BlockNumber []*big.Int) (*L2OutputOracleOutputProposedIterator, error) {
var outputRootRule []interface{} var outputRootRule []interface{}
for _, outputRootItem := range outputRoot { for _, outputRootItem := range outputRoot {
outputRootRule = append(outputRootRule, outputRootItem) outputRootRule = append(outputRootRule, outputRootItem)
} }
var l1TimestampRule []interface{} var l2OutputIndexRule []interface{}
for _, l1TimestampItem := range l1Timestamp { for _, l2OutputIndexItem := range l2OutputIndex {
l1TimestampRule = append(l1TimestampRule, l1TimestampItem) l2OutputIndexRule = append(l2OutputIndexRule, l2OutputIndexItem)
} }
var l2BlockNumberRule []interface{} var l2BlockNumberRule []interface{}
for _, l2BlockNumberItem := range l2BlockNumber { for _, l2BlockNumberItem := range l2BlockNumber {
l2BlockNumberRule = append(l2BlockNumberRule, l2BlockNumberItem) l2BlockNumberRule = append(l2BlockNumberRule, l2BlockNumberItem)
} }
logs, sub, err := _L2OutputOracle.contract.FilterLogs(opts, "OutputProposed", outputRootRule, l1TimestampRule, l2BlockNumberRule) logs, sub, err := _L2OutputOracle.contract.FilterLogs(opts, "OutputProposed", outputRootRule, l2OutputIndexRule, l2BlockNumberRule)
if err != nil { if err != nil {
return nil, err return nil, err
} }
return &L2OutputOracleOutputProposedIterator{contract: _L2OutputOracle.contract, event: "OutputProposed", logs: logs, sub: sub}, nil return &L2OutputOracleOutputProposedIterator{contract: _L2OutputOracle.contract, event: "OutputProposed", logs: logs, sub: sub}, nil
} }
// WatchOutputProposed is a free log subscription operation binding the contract event 0xc120f5e881491e6e212befa39e36b8f57d5eca31915f2e5d60a420f418caa6df. // WatchOutputProposed is a free log subscription operation binding the contract event 0xa7aaf2512769da4e444e3de247be2564225c2e7a8f74cfe528e46e17d24868e2.
// //
// Solidity: event OutputProposed(bytes32 indexed outputRoot, uint256 indexed l1Timestamp, uint256 indexed l2BlockNumber) // Solidity: event OutputProposed(bytes32 indexed outputRoot, uint256 indexed l2OutputIndex, uint256 indexed l2BlockNumber, uint256 l1Timestamp)
func (_L2OutputOracle *L2OutputOracleFilterer) WatchOutputProposed(opts *bind.WatchOpts, sink chan<- *L2OutputOracleOutputProposed, outputRoot [][32]byte, l1Timestamp []*big.Int, l2BlockNumber []*big.Int) (event.Subscription, error) { func (_L2OutputOracle *L2OutputOracleFilterer) WatchOutputProposed(opts *bind.WatchOpts, sink chan<- *L2OutputOracleOutputProposed, outputRoot [][32]byte, l2OutputIndex []*big.Int, l2BlockNumber []*big.Int) (event.Subscription, error) {
var outputRootRule []interface{} var outputRootRule []interface{}
for _, outputRootItem := range outputRoot { for _, outputRootItem := range outputRoot {
outputRootRule = append(outputRootRule, outputRootItem) outputRootRule = append(outputRootRule, outputRootItem)
} }
var l1TimestampRule []interface{} var l2OutputIndexRule []interface{}
for _, l1TimestampItem := range l1Timestamp { for _, l2OutputIndexItem := range l2OutputIndex {
l1TimestampRule = append(l1TimestampRule, l1TimestampItem) l2OutputIndexRule = append(l2OutputIndexRule, l2OutputIndexItem)
} }
var l2BlockNumberRule []interface{} var l2BlockNumberRule []interface{}
for _, l2BlockNumberItem := range l2BlockNumber { for _, l2BlockNumberItem := range l2BlockNumber {
l2BlockNumberRule = append(l2BlockNumberRule, l2BlockNumberItem) l2BlockNumberRule = append(l2BlockNumberRule, l2BlockNumberItem)
} }
logs, sub, err := _L2OutputOracle.contract.WatchLogs(opts, "OutputProposed", outputRootRule, l1TimestampRule, l2BlockNumberRule) logs, sub, err := _L2OutputOracle.contract.WatchLogs(opts, "OutputProposed", outputRootRule, l2OutputIndexRule, l2BlockNumberRule)
if err != nil { if err != nil {
return nil, err return nil, err
} }
...@@ -895,9 +1021,9 @@ func (_L2OutputOracle *L2OutputOracleFilterer) WatchOutputProposed(opts *bind.Wa ...@@ -895,9 +1021,9 @@ func (_L2OutputOracle *L2OutputOracleFilterer) WatchOutputProposed(opts *bind.Wa
}), nil }), nil
} }
// ParseOutputProposed is a log parse operation binding the contract event 0xc120f5e881491e6e212befa39e36b8f57d5eca31915f2e5d60a420f418caa6df. // ParseOutputProposed is a log parse operation binding the contract event 0xa7aaf2512769da4e444e3de247be2564225c2e7a8f74cfe528e46e17d24868e2.
// //
// Solidity: event OutputProposed(bytes32 indexed outputRoot, uint256 indexed l1Timestamp, uint256 indexed l2BlockNumber) // Solidity: event OutputProposed(bytes32 indexed outputRoot, uint256 indexed l2OutputIndex, uint256 indexed l2BlockNumber, uint256 l1Timestamp)
func (_L2OutputOracle *L2OutputOracleFilterer) ParseOutputProposed(log types.Log) (*L2OutputOracleOutputProposed, error) { func (_L2OutputOracle *L2OutputOracleFilterer) ParseOutputProposed(log types.Log) (*L2OutputOracleOutputProposed, error) {
event := new(L2OutputOracleOutputProposed) event := new(L2OutputOracleOutputProposed)
if err := _L2OutputOracle.contract.UnpackLog(event, "OutputProposed", log); err != nil { if err := _L2OutputOracle.contract.UnpackLog(event, "OutputProposed", log); err != nil {
...@@ -976,38 +1102,47 @@ func (it *L2OutputOracleOutputsDeletedIterator) Close() error { ...@@ -976,38 +1102,47 @@ func (it *L2OutputOracleOutputsDeletedIterator) Close() error {
// L2OutputOracleOutputsDeleted represents a OutputsDeleted event raised by the L2OutputOracle contract. // L2OutputOracleOutputsDeleted represents a OutputsDeleted event raised by the L2OutputOracle contract.
type L2OutputOracleOutputsDeleted struct { type L2OutputOracleOutputsDeleted struct {
L2BlockNumber *big.Int PrevNextOutputIndex *big.Int
NewNextOutputIndex *big.Int
Raw types.Log // Blockchain specific contextual infos Raw types.Log // Blockchain specific contextual infos
} }
// FilterOutputsDeleted is a free log retrieval operation binding the contract event 0x21cbfd8ae20a7662b0a8aa9162fc9428f52c94b2e0ac268312628ea47f3f17eb. // FilterOutputsDeleted is a free log retrieval operation binding the contract event 0x4ee37ac2c786ec85e87592d3c5c8a1dd66f8496dda3f125d9ea8ca5f657629b6.
// //
// Solidity: event OutputsDeleted(uint256 indexed l2BlockNumber) // Solidity: event OutputsDeleted(uint256 indexed prevNextOutputIndex, uint256 indexed newNextOutputIndex)
func (_L2OutputOracle *L2OutputOracleFilterer) FilterOutputsDeleted(opts *bind.FilterOpts, l2BlockNumber []*big.Int) (*L2OutputOracleOutputsDeletedIterator, error) { func (_L2OutputOracle *L2OutputOracleFilterer) FilterOutputsDeleted(opts *bind.FilterOpts, prevNextOutputIndex []*big.Int, newNextOutputIndex []*big.Int) (*L2OutputOracleOutputsDeletedIterator, error) {
var l2BlockNumberRule []interface{} var prevNextOutputIndexRule []interface{}
for _, l2BlockNumberItem := range l2BlockNumber { for _, prevNextOutputIndexItem := range prevNextOutputIndex {
l2BlockNumberRule = append(l2BlockNumberRule, l2BlockNumberItem) prevNextOutputIndexRule = append(prevNextOutputIndexRule, prevNextOutputIndexItem)
}
var newNextOutputIndexRule []interface{}
for _, newNextOutputIndexItem := range newNextOutputIndex {
newNextOutputIndexRule = append(newNextOutputIndexRule, newNextOutputIndexItem)
} }
logs, sub, err := _L2OutputOracle.contract.FilterLogs(opts, "OutputsDeleted", l2BlockNumberRule) logs, sub, err := _L2OutputOracle.contract.FilterLogs(opts, "OutputsDeleted", prevNextOutputIndexRule, newNextOutputIndexRule)
if err != nil { if err != nil {
return nil, err return nil, err
} }
return &L2OutputOracleOutputsDeletedIterator{contract: _L2OutputOracle.contract, event: "OutputsDeleted", logs: logs, sub: sub}, nil return &L2OutputOracleOutputsDeletedIterator{contract: _L2OutputOracle.contract, event: "OutputsDeleted", logs: logs, sub: sub}, nil
} }
// WatchOutputsDeleted is a free log subscription operation binding the contract event 0x21cbfd8ae20a7662b0a8aa9162fc9428f52c94b2e0ac268312628ea47f3f17eb. // WatchOutputsDeleted is a free log subscription operation binding the contract event 0x4ee37ac2c786ec85e87592d3c5c8a1dd66f8496dda3f125d9ea8ca5f657629b6.
// //
// Solidity: event OutputsDeleted(uint256 indexed l2BlockNumber) // Solidity: event OutputsDeleted(uint256 indexed prevNextOutputIndex, uint256 indexed newNextOutputIndex)
func (_L2OutputOracle *L2OutputOracleFilterer) WatchOutputsDeleted(opts *bind.WatchOpts, sink chan<- *L2OutputOracleOutputsDeleted, l2BlockNumber []*big.Int) (event.Subscription, error) { func (_L2OutputOracle *L2OutputOracleFilterer) WatchOutputsDeleted(opts *bind.WatchOpts, sink chan<- *L2OutputOracleOutputsDeleted, prevNextOutputIndex []*big.Int, newNextOutputIndex []*big.Int) (event.Subscription, error) {
var l2BlockNumberRule []interface{} var prevNextOutputIndexRule []interface{}
for _, l2BlockNumberItem := range l2BlockNumber { for _, prevNextOutputIndexItem := range prevNextOutputIndex {
l2BlockNumberRule = append(l2BlockNumberRule, l2BlockNumberItem) prevNextOutputIndexRule = append(prevNextOutputIndexRule, prevNextOutputIndexItem)
}
var newNextOutputIndexRule []interface{}
for _, newNextOutputIndexItem := range newNextOutputIndex {
newNextOutputIndexRule = append(newNextOutputIndexRule, newNextOutputIndexItem)
} }
logs, sub, err := _L2OutputOracle.contract.WatchLogs(opts, "OutputsDeleted", l2BlockNumberRule) logs, sub, err := _L2OutputOracle.contract.WatchLogs(opts, "OutputsDeleted", prevNextOutputIndexRule, newNextOutputIndexRule)
if err != nil { if err != nil {
return nil, err return nil, err
} }
...@@ -1039,9 +1174,9 @@ func (_L2OutputOracle *L2OutputOracleFilterer) WatchOutputsDeleted(opts *bind.Wa ...@@ -1039,9 +1174,9 @@ func (_L2OutputOracle *L2OutputOracleFilterer) WatchOutputsDeleted(opts *bind.Wa
}), nil }), nil
} }
// ParseOutputsDeleted is a log parse operation binding the contract event 0x21cbfd8ae20a7662b0a8aa9162fc9428f52c94b2e0ac268312628ea47f3f17eb. // ParseOutputsDeleted is a log parse operation binding the contract event 0x4ee37ac2c786ec85e87592d3c5c8a1dd66f8496dda3f125d9ea8ca5f657629b6.
// //
// Solidity: event OutputsDeleted(uint256 indexed l2BlockNumber) // Solidity: event OutputsDeleted(uint256 indexed prevNextOutputIndex, uint256 indexed newNextOutputIndex)
func (_L2OutputOracle *L2OutputOracleFilterer) ParseOutputsDeleted(log types.Log) (*L2OutputOracleOutputsDeleted, error) { func (_L2OutputOracle *L2OutputOracleFilterer) ParseOutputsDeleted(log types.Log) (*L2OutputOracleOutputsDeleted, error) {
event := new(L2OutputOracleOutputsDeleted) event := new(L2OutputOracleOutputsDeleted)
if err := _L2OutputOracle.contract.UnpackLog(event, "OutputsDeleted", log); err != nil { if err := _L2OutputOracle.contract.UnpackLog(event, "OutputsDeleted", log); err != nil {
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -13,7 +13,7 @@ const OptimismPortalStorageLayoutJSON = "{\"storage\":[{\"astId\":1000,\"contrac ...@@ -13,7 +13,7 @@ const OptimismPortalStorageLayoutJSON = "{\"storage\":[{\"astId\":1000,\"contrac
var OptimismPortalStorageLayout = new(solc.StorageLayout) var OptimismPortalStorageLayout = new(solc.StorageLayout)
var OptimismPortalDeployedBin = "0x6080604052600436106101475760003560e01c80638c3152e9116100c0578063cd7c978911610074578063e965084c11610059578063e965084c14610429578063e9e05c42146104b5578063f4daa291146104c857600080fd5b8063cd7c978914610373578063cff0ab961461038857600080fd5b8063a14238e7116100a5578063a14238e7146102fe578063c4fc47981461033e578063ca3e99ba1461035e57600080fd5b80638c3152e9146102b15780639bf62d82146102d157600080fd5b806364b79208116101175780638129fc1c116100fc5780638129fc1c14610286578063867ead131461029b5780638b4c40b01461016c57600080fd5b806364b792081461024c5780636bb0291e1461027157600080fd5b80621c2ff61461017357806313620abd146101d15780634870496f1461020a57806354fd4d501461022a57600080fd5b3661016e5761016c3334620186a06000604051806020016040528060008152506104fc565b005b600080fd5b34801561017f57600080fd5b506101a77f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b3480156101dd57600080fd5b506101e9633b9aca0081565b6040516fffffffffffffffffffffffffffffffff90911681526020016101c8565b34801561021657600080fd5b5061016c6102253660046143ff565b6109c9565b34801561023657600080fd5b5061023f610e69565b6040516101c89190614555565b34801561025857600080fd5b50610263627a120081565b6040519081526020016101c8565b34801561027d57600080fd5b50610263600481565b34801561029257600080fd5b5061016c610f0c565b3480156102a757600080fd5b5061026361271081565b3480156102bd57600080fd5b5061016c6102cc366004614568565b6110ca565b3480156102dd57600080fd5b506032546101a79073ffffffffffffffffffffffffffffffffffffffff1681565b34801561030a57600080fd5b5061032e61031936600461459d565b60336020526000908152604090205460ff1681565b60405190151581526020016101c8565b34801561034a57600080fd5b5061032e61035936600461459d565b611923565b34801561036a57600080fd5b506102636119e7565b34801561037f57600080fd5b50610263600881565b34801561039457600080fd5b506001546103f0906fffffffffffffffffffffffffffffffff81169067ffffffffffffffff7001000000000000000000000000000000008204811691780100000000000000000000000000000000000000000000000090041683565b604080516fffffffffffffffffffffffffffffffff909416845267ffffffffffffffff92831660208501529116908201526060016101c8565b34801561043557600080fd5b5061048761044436600461459d565b603460205260009081526040902080546001909101546fffffffffffffffffffffffffffffffff8082169170010000000000000000000000000000000090041683565b604080519384526fffffffffffffffffffffffffffffffff92831660208501529116908201526060016101c8565b61016c6104c33660046145b6565b6104fc565b3480156104d457600080fd5b506102637f000000000000000000000000000000000000000000000000000000000000000081565b8260005a905083156105b35773ffffffffffffffffffffffffffffffffffffffff8716156105b357604080517f08c379a00000000000000000000000000000000000000000000000000000000081526020600482015260248101919091527f4f7074696d69736d506f7274616c3a206d7573742073656e6420746f2061646460448201527f72657373283029207768656e206372656174696e67206120636f6e747261637460648201526084015b60405180910390fd5b333281146105d4575033731111000000000000000000000000000000001111015b600034888888886040516020016105ef959493929190614643565b604051602081830303815290604052905060008973ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fb3813568d9991fc951961fcb4c784893574240a28925604d09fc577c55bb7c328460405161065f9190614555565b60405180910390a4505060015460009061069f907801000000000000000000000000000000000000000000000000900467ffffffffffffffff16436146d7565b905080156108285760006106b76004627a120061471d565b6001546106e29190700100000000000000000000000000000000900467ffffffffffffffff16614785565b9050600060086106f66004627a120061471d565b6001546107169085906fffffffffffffffffffffffffffffffff166147f9565b610720919061471d565b61072a919061471d565b60015490915060009061077690610760906107589085906fffffffffffffffffffffffffffffffff166148b5565b612710611a14565b6fffffffffffffffffffffffffffffffff611a2d565b905060018411156107e9576107e6610760670de0b6b3a76400006107d261079e60088361471d565b6107b090670de0b6b3a7640000614785565b6107bb60018a6146d7565b6107cd90670de0b6b3a7640000614929565b611a3c565b6107dc90856147f9565b610758919061471d565b90505b6fffffffffffffffffffffffffffffffff16780100000000000000000000000000000000000000000000000067ffffffffffffffff4316021760015550505b6001805484919060109061085b908490700100000000000000000000000000000000900467ffffffffffffffff16614966565b92506101000a81548167ffffffffffffffff021916908367ffffffffffffffff160217905550627a1200600160000160109054906101000a900467ffffffffffffffff1667ffffffffffffffff161315610937576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603e60248201527f5265736f757263654d65746572696e673a2063616e6e6f7420627579206d6f7260448201527f6520676173207468616e20617661696c61626c6520676173206c696d6974000060648201526084016105aa565b600154600090610963906fffffffffffffffffffffffffffffffff1667ffffffffffffffff8616614992565b6fffffffffffffffffffffffffffffffff169050600061098748633b9aca00611a6d565b61099190836149ca565b905060005a6109a090866146d7565b9050808211156109bc576109bc6109b782846146d7565b611a7d565b5050505050505050505050565b3073ffffffffffffffffffffffffffffffffffffffff16856040015173ffffffffffffffffffffffffffffffffffffffff1603610a88576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603f60248201527f4f7074696d69736d506f7274616c3a20796f752063616e6e6f742073656e642060448201527f6d6573736167657320746f2074686520706f7274616c20636f6e74726163740060648201526084016105aa565b6040517fa25ae557000000000000000000000000000000000000000000000000000000008152600481018590526000907f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff169063a25ae557906024016040805180830381865afa158015610b15573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b3991906149de565b519050610b53610b4e36869003860186614a2d565b611aab565b8114610be1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602960248201527f4f7074696d69736d506f7274616c3a20696e76616c6964206f7574707574207260448201527f6f6f742070726f6f66000000000000000000000000000000000000000000000060648201526084016105aa565b6000610bec87611b07565b6000818152603460209081526040918290208251606081018452815481526001909101546fffffffffffffffffffffffffffffffff8082169383018490527001000000000000000000000000000000009091041692810192909252919250901580610c78575080604001516fffffffffffffffffffffffffffffffff1687148015610c78575080518314155b610d04576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603760248201527f4f7074696d69736d506f7274616c3a207769746864726177616c20686173682060448201527f68617320616c7265616479206265656e2070726f76656e00000000000000000060648201526084016105aa565b610d1c826040880135610d178789614a93565b611b37565b610da8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603260248201527f4f7074696d69736d506f7274616c3a20696e76616c696420776974686472617760448201527f616c20696e636c7573696f6e2070726f6f66000000000000000000000000000060648201526084016105aa565b604080516060810182528481526fffffffffffffffffffffffffffffffff42811660208084019182528b831684860190815260008881526034835286812095518655925190518416700100000000000000000000000000000000029316929092176001909301929092558a830151908b0151925173ffffffffffffffffffffffffffffffffffffffff918216939091169185917f67a6208cfcc0801d50f6cbe764733f4fddf66ac0b04442061a8a8c0cb6b63f629190a45050505050505050565b6060610e947f0000000000000000000000000000000000000000000000000000000000000000611bfe565b610ebd7f0000000000000000000000000000000000000000000000000000000000000000611bfe565b610ee67f0000000000000000000000000000000000000000000000000000000000000000611bfe565b604051602001610ef893929190614b17565b604051602081830303815290604052905090565b600054610100900460ff1615808015610f2c5750600054600160ff909116105b80610f465750303b158015610f46575060005460ff166001145b610fd2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a656400000000000000000000000000000000000060648201526084016105aa565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055801561103057600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b603280547fffffffffffffffffffffffff00000000000000000000000000000000000000001661dead179055611064611d3b565b80156110c757600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50565b60325473ffffffffffffffffffffffffffffffffffffffff1661dead14611173576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603f60248201527f4f7074696d69736d506f7274616c3a2063616e206f6e6c79207472696767657260448201527f206f6e65207769746864726177616c20706572207472616e73616374696f6e0060648201526084016105aa565b600061117e82611b07565b60008181526034602090815260408083208151606081018352815481526001909101546fffffffffffffffffffffffffffffffff80821694830185905270010000000000000000000000000000000090910416918101919091529293509003611269576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f4f7074696d69736d506f7274616c3a207769746864726177616c20686173206e60448201527f6f74206265656e2070726f76656e00000000000000000000000000000000000060648201526084016105aa565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663887862726040518163ffffffff1660e01b8152600401602060405180830381865afa1580156112d4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112f89190614b8d565b81602001516fffffffffffffffffffffffffffffffff1610156113c3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604b60248201527f4f7074696d69736d506f7274616c3a207769746864726177616c2074696d657360448201527f74616d70206c657373207468616e204c32204f7261636c65207374617274696e60648201527f672074696d657374616d70000000000000000000000000000000000000000000608482015260a4016105aa565b6113e281602001516fffffffffffffffffffffffffffffffff16611e1e565b611494576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604560248201527f4f7074696d69736d506f7274616c3a2070726f76656e2077697468647261776160448201527f6c2066696e616c697a6174696f6e20706572696f6420686173206e6f7420656c60648201527f6170736564000000000000000000000000000000000000000000000000000000608482015260a4016105aa565b60408181015190517fa25ae5570000000000000000000000000000000000000000000000000000000081526fffffffffffffffffffffffffffffffff90911660048201526000907f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff169063a25ae557906024016040805180830381865afa158015611538573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061155c91906149de565b8251815191925014611616576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604960248201527f4f7074696d69736d506f7274616c3a206f757470757420726f6f742070726f7660448201527f656e206973206e6f74207468652073616d652061732063757272656e74206f7560648201527f7470757420726f6f740000000000000000000000000000000000000000000000608482015260a4016105aa565b6116238160200151611e1e565b6116d5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604360248201527f4f7074696d69736d506f7274616c3a206f75747075742070726f706f73616c2060448201527f66696e616c697a6174696f6e20706572696f6420686173206e6f7420656c617060648201527f7365640000000000000000000000000000000000000000000000000000000000608482015260a4016105aa565b60008381526033602052604090205460ff1615611774576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603560248201527f4f7074696d69736d506f7274616c3a207769746864726177616c20686173206160448201527f6c7265616479206265656e2066696e616c697a6564000000000000000000000060648201526084016105aa565b600083815260336020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600117905560808401516117bd90614e2090614ba6565b5a101561184c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603760248201527f4f7074696d69736d506f7274616c3a20696e73756666696369656e742067617360448201527f20746f2066696e616c697a65207769746864726177616c00000000000000000060648201526084016105aa565b8360200151603260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060006118af8560400151866080015187606001518860a00151611e52565b603280547fffffffffffffffffffffffff00000000000000000000000000000000000000001661dead17905560405190915084907fdb5c7652857aa163daadd670e116628fb42e869d8ac4251ef8971d9e5727df1b9061191490841515815260200190565b60405180910390a25050505050565b6040517fa25ae557000000000000000000000000000000000000000000000000000000008152600481018290526000906119e19073ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000169063a25ae557906024016040805180830381865afa1580156119b4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119d891906149de565b60200151611e1e565b92915050565b6119f56004627a120061471d565b81565b73ffffffffffffffffffffffffffffffffffffffff163b151590565b600081831215611a245781611a26565b825b9392505050565b6000818312611a245781611a26565b6000611a26670de0b6b3a764000083611a5486611e6c565b611a5e91906147f9565b611a68919061471d565b6120b0565b600081831015611a245781611a26565b6000805a90505b825a611a9090836146d7565b1015611aa657611a9f82614bbe565b9150611a84565b505050565b60008160000151826020015183604001518460600151604051602001611aea949392919093845260208401929092526040830152606082015260800190565b604051602081830303815290604052805190602001209050919050565b80516020808301516040808501516060860151608087015160a08801519351600097611aea979096959101614bf6565b604080516020810185905260009181018290528190606001604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081840301815282825280516020918201209083018190529250611bf59101604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152828201909152600182527f010000000000000000000000000000000000000000000000000000000000000060208301529085876122ef565b95945050505050565b606081600003611c4157505060408051808201909152600181527f3000000000000000000000000000000000000000000000000000000000000000602082015290565b8160005b8115611c6b5780611c5581614bbe565b9150611c649050600a836149ca565b9150611c45565b60008167ffffffffffffffff811115611c8657611c86614225565b6040519080825280601f01601f191660200182016040528015611cb0576020820181803683370190505b5090505b8415611d3357611cc56001836146d7565b9150611cd2600a86614c4d565b611cdd906030614ba6565b60f81b818381518110611cf257611cf2614c61565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350611d2c600a866149ca565b9450611cb4565b949350505050565b600054610100900460ff16611dd2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e6700000000000000000000000000000000000000000060648201526084016105aa565b60408051606081018252633b9aca00808252600060208301524367ffffffffffffffff169190920181905278010000000000000000000000000000000000000000000000000217600155565b6000611e4a7f000000000000000000000000000000000000000000000000000000000000000083614ba6565b421192915050565b600080600080845160208601878a8af19695505050505050565b6000808213611ed7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f554e444546494e4544000000000000000000000000000000000000000000000060448201526064016105aa565b60006060611ee484612313565b03609f8181039490941b90931c6c465772b2bbbb5f824b15207a3081018102606090811d6d0388eaa27412d5aca026815d636e018202811d6d0df99ac502031bf953eff472fdcc018202811d6d13cdffb29d51d99322bdff5f2211018202811d6d0a0f742023def783a307a986912e018202811d6d01920d8043ca89b5239253284e42018202811d6c0b7a86d7375468fac667a0a527016c29508e458543d8aa4df2abee7883018302821d6d0139601a2efabe717e604cbb4894018302821d6d02247f7a7b6594320649aa03aba1018302821d7fffffffffffffffffffffffffffffffffffffff73c0c716a594e00d54e3c4cbc9018302821d7ffffffffffffffffffffffffffffffffffffffdc7b88c420e53a9890533129f6f01830290911d7fffffffffffffffffffffffffffffffffffffff465fda27eb4d63ded474e5f832019091027ffffffffffffffff5f6af8f7b3396644f18e157960000000000000000000000000105711340daa0d5f769dba1915cef59f0815a5506027d0267a36c0c95b3975ab3ee5b203a7614a3f75373f047d803ae7b6687f2b393909302929092017d57115e47018c7177eebf7cd370a3356a1b7863008a5ae8028c72b88642840160ae1d92915050565b60007ffffffffffffffffffffffffffffffffffffffffffffffffdb731c958f34d94c182136120e157506000919050565b680755bf798b4a1bf1e58212612153576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f4558505f4f564552464c4f57000000000000000000000000000000000000000060448201526064016105aa565b6503782dace9d9604e83901b059150600060606bb17217f7d1cf79abc9e3b39884821b056b80000000000000000000000001901d6bb17217f7d1cf79abc9e3b39881029093037fffffffffffffffffffffffffffffffffffffffdbf3ccf1604d263450f02a550481018102606090811d6d0277594991cfc85f6e2461837cd9018202811d7fffffffffffffffffffffffffffffffffffffe5adedaa1cb095af9e4da10e363c018202811d6db1bbb201f443cf962f1a1d3db4a5018202811d7ffffffffffffffffffffffffffffffffffffd38dc772608b0ae56cce01296c0eb018202811d6e05180bb14799ab47a8a8cb2a527d57016d02d16720577bd19bf614176fe9ea6c10fe68e7fd37d0007b713f765084018402831d9081019084017ffffffffffffffffffffffffffffffffffffffe2c69812cf03b0763fd454a8f7e010290911d6e0587f503bb6ea29d25fcb7401964500190910279d835ebba824c98fb31b83b2ca45c000000000000000000000000010574029d9dc38563c32e5c2f6dc192ee70ef65f9978af30260c3939093039290921c92915050565b6000806122fb866123e9565b90506123098186868661241b565b9695505050505050565b600080821161237e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f554e444546494e4544000000000000000000000000000000000000000000000060448201526064016105aa565b5060016fffffffffffffffffffffffffffffffff821160071b82811c67ffffffffffffffff1060061b1782811c63ffffffff1060051b1782811c61ffff1060041b1782811c60ff10600390811b90911783811c600f1060021b1783811c909110821b1791821c111790565b6060818051906020012060405160200161240591815260200190565b6040516020818303038152906040529050919050565b600080600061242b878686612458565b9150915081801561244d57508051602080830191909120875191880191909120145b979650505050505050565b60006060600061246785612576565b90506000806000612479848a89612665565b8151929550909350915015808061248d5750815b612519576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f4d65726b6c65547269653a2070726f76696465642070726f6f6620697320696e60448201527f76616c696400000000000000000000000000000000000000000000000000000060648201526084016105aa565b6000816125355760405180602001604052806000815250612561565b612561866125446001886146d7565b8151811061255457612554614c61565b6020026020010151612d69565b805115159c909b509950505050505050505050565b805160609060008167ffffffffffffffff81111561259657612596614225565b6040519080825280602002602001820160405280156125db57816020015b60408051808201909152606080825260208201528152602001906001900390816125b45790505b50905060005b8281101561265d57604051806040016040528086838151811061260657612606614c61565b6020026020010151815260200161263587848151811061262857612628614c61565b6020026020010151612da0565b81525082828151811061264a5761264a614c61565b60209081029190910101526001016125e1565b509392505050565b6000606081808061267587612db3565b905060008660405160200161268c91815260200190565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152828201909152606080835260208301529150600090819060005b8c51811015612ceb578c81815181106126ec576126ec614c61565b6020026020010151915082846127029190614ba6565b935061270f600188614ba6565b9650836000036127ca578151805160209182012060405161275f9261273992910190815260200190565b604051602081830303815290604052868051602091820120825192909101919091201490565b6127c5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f4d65726b6c65547269653a20696e76616c696420726f6f74206861736800000060448201526064016105aa565b612921565b81515160201161288057815180516020918201206040516127f49261273992910190815260200190565b6127c5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602760248201527f4d65726b6c65547269653a20696e76616c6964206c6172676520696e7465726e60448201527f616c20686173680000000000000000000000000000000000000000000000000060648201526084016105aa565b815185516020808801919091208251919092012014612921576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4d65726b6c65547269653a20696e76616c696420696e7465726e616c206e6f6460448201527f652068617368000000000000000000000000000000000000000000000000000060648201526084016105aa565b61292d60106001614ba6565b8260200151510361299f5785518414612ceb57600086858151811061295457612954614c61565b602001015160f81c60f81b60f81c9050600083602001518260ff168151811061297f5761297f614c61565b6020026020010151905061299281612f4e565b9650600194505050612cd9565b600282602001515103612c515760006129b783612f73565b90506000816000815181106129ce576129ce614c61565b016020015160f81c905060006129e5600283614c90565b6129f0906002614cb2565b90506000612a01848360ff16612f97565b90506000612a0f8b8a612f97565b90506000612a1d8383612fcd565b9050825182511015612ab1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603960248201527f4d65726b6c65547269653a20696e76616c6964206b6579206c656e677468206660448201527f6f72206c656166206f7220657874656e73696f6e206e6f64650000000000000060648201526084016105aa565b60ff851660021480612ac6575060ff85166003145b15612b3057808351148015612adb5750808251145b15612aed57612aea818b614ba6565b99505b6040518060400160405280600181526020017f80000000000000000000000000000000000000000000000000000000000000008152509a50505050505050612ceb565b60ff85161580612b43575060ff85166001145b15612bc95782518114612b93576040518060400160405280600181526020017f80000000000000000000000000000000000000000000000000000000000000008152509a50505050505050612ceb565b612bba8860200151600181518110612bad57612bad614c61565b6020026020010151612f4e565b9a509750612cd9945050505050565b6040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603260248201527f4d65726b6c65547269653a2072656365697665642061206e6f6465207769746860448201527f20616e20756e6b6e6f776e20707265666978000000000000000000000000000060648201526084016105aa565b6040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602860248201527f4d65726b6c65547269653a20726563656976656420616e20756e70617273656160448201527f626c65206e6f646500000000000000000000000000000000000000000000000060648201526084016105aa565b80612ce381614bbe565b9150506126d1565b5085612cf78685612f97565b60408051808201909152600181527f80000000000000000000000000000000000000000000000000000000000000006020918201528651908701207f56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b4211498509850985050505050505093509350939050565b602081015180516060916119e191612d83906001906146d7565b81518110612d9357612d93614c61565b602002602001015161307c565b60606119e1612dae836131dc565b6132c5565b80516060906000612dc5826002614929565b67ffffffffffffffff811115612ddd57612ddd614225565b6040519080825280601f01601f191660200182016040528015612e07576020820181803683370190505b5090506000805b83811015612f4457858181518110612e2857612e28614c61565b6020910101517fff000000000000000000000000000000000000000000000000000000000000008116925060041c7f0ff00000000000000000000000000000000000000000000000000000000000001683612e84836002614929565b81518110612e9457612e94614c61565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f0f00000000000000000000000000000000000000000000000000000000000000821683612ef2836002614929565b612efd906001614ba6565b81518110612f0d57612f0d614c61565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600101612e0e565b5090949350505050565b60606020826000015110612f6a57612f658261307c565b6119e1565b6119e182613529565b60606119e1612f928360200151600081518110612d9357612d93614c61565b612db3565b606082518210612fb657506040805160208101909152600081526119e1565b611a268383848651612fc891906146d7565b61353f565b60008060008351855110612fe2578351612fe5565b84515b90505b808210801561306c575083828151811061300457613004614c61565b602001015160f81c60f81b7effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191685838151811061304357613043614c61565b01602001517fff0000000000000000000000000000000000000000000000000000000000000016145b1561265d57816001019150612fe8565b6060600080600061308c85613717565b9194509250905060008160018111156130a7576130a7614cd5565b14613134576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603960248201527f524c505265616465723a206465636f646564206974656d207479706520666f7260448201527f206279746573206973206e6f7420612064617461206974656d0000000000000060648201526084016105aa565b61313e8284614ba6565b8551146131cd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603460248201527f524c505265616465723a2062797465732076616c756520636f6e7461696e732060448201527f616e20696e76616c69642072656d61696e64657200000000000000000000000060648201526084016105aa565b611bf585602001518484614184565b604080518082019091526000808252602082015260008251116132a7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604a60248201527f524c505265616465723a206c656e677468206f6620616e20524c50206974656d60448201527f206d7573742062652067726561746572207468616e207a65726f20746f20626560648201527f206465636f6461626c6500000000000000000000000000000000000000000000608482015260a4016105aa565b50604080518082019091528151815260209182019181019190915290565b606060008060006132d585613717565b9194509250905060018160018111156132f0576132f0614cd5565b1461337d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603860248201527f524c505265616465723a206465636f646564206974656d207479706520666f7260448201527f206c697374206973206e6f742061206c697374206974656d000000000000000060648201526084016105aa565b84516133898385614ba6565b14613416576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603260248201527f524c505265616465723a206c697374206974656d2068617320616e20696e766160448201527f6c696420646174612072656d61696e646572000000000000000000000000000060648201526084016105aa565b6040805160208082526104208201909252600091816020015b604080518082019091526000808252602082015281526020019060019003908161342f5790505090506000845b875181101561351d576000806134a26040518060400160405280858d6000015161348691906146d7565b8152602001858d6020015161349b9190614ba6565b9052613717565b5091509150604051806040016040528083836134be9190614ba6565b8152602001848c602001516134d39190614ba6565b8152508585815181106134e8576134e8614c61565b60209081029190910101526134fe600185614ba6565b935061350a8183614ba6565b6135149084614ba6565b9250505061345c565b50815295945050505050565b60606119e1826020015160008460000151614184565b60608182601f0110156135ae576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600e60248201527f736c6963655f6f766572666c6f7700000000000000000000000000000000000060448201526064016105aa565b82828401101561361a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600e60248201527f736c6963655f6f766572666c6f7700000000000000000000000000000000000060448201526064016105aa565b81830184511015613687576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f736c6963655f6f75744f66426f756e647300000000000000000000000000000060448201526064016105aa565b6060821580156136a6576040519150600082526020820160405261370e565b6040519150601f8416801560200281840101858101878315602002848b0101015b818310156136df5780518352602092830192016136c7565b5050858452601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016604052505b50949350505050565b6000806000808460000151116137d5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604a60248201527f524c505265616465723a206c656e677468206f6620616e20524c50206974656d60448201527f206d7573742062652067726561746572207468616e207a65726f20746f20626560648201527f206465636f6461626c6500000000000000000000000000000000000000000000608482015260a4016105aa565b6020840151805160001a607f81116137fa57600060016000945094509450505061417d565b60b78111613a0857600061380f6080836146d7565b9050808760000151116138ca576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604e60248201527f524c505265616465723a206c656e677468206f6620636f6e74656e74206d757360448201527f742062652067726561746572207468616e20737472696e67206c656e6774682060648201527f2873686f727420737472696e6729000000000000000000000000000000000000608482015260a4016105aa565b6001838101517fff0000000000000000000000000000000000000000000000000000000000000016908214158061394357507f80000000000000000000000000000000000000000000000000000000000000007fff00000000000000000000000000000000000000000000000000000000000000821610155b6139f5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604d60248201527f524c505265616465723a20696e76616c6964207072656669782c2073696e676c60448201527f652062797465203c203078383020617265206e6f74207072656669786564202860648201527f73686f727420737472696e672900000000000000000000000000000000000000608482015260a4016105aa565b506001955093506000925061417d915050565b60bf8111613d56576000613a1d60b7836146d7565b905080876000015111613ad8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152605160248201527f524c505265616465723a206c656e677468206f6620636f6e74656e74206d757360448201527f74206265203e207468616e206c656e677468206f6620737472696e67206c656e60648201527f67746820286c6f6e6720737472696e6729000000000000000000000000000000608482015260a4016105aa565b60018301517fff00000000000000000000000000000000000000000000000000000000000000166000819003613bb6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604a60248201527f524c505265616465723a206c656e677468206f6620636f6e74656e74206d757360448201527f74206e6f74206861766520616e79206c656164696e67207a65726f7320286c6f60648201527f6e6720737472696e672900000000000000000000000000000000000000000000608482015260a4016105aa565b600184015160088302610100031c60378111613c7a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604860248201527f524c505265616465723a206c656e677468206f6620636f6e74656e74206d757360448201527f742062652067726561746572207468616e20353520627974657320286c6f6e6760648201527f20737472696e6729000000000000000000000000000000000000000000000000608482015260a4016105aa565b613c848184614ba6565b895111613d39576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604c60248201527f524c505265616465723a206c656e677468206f6620636f6e74656e74206d757360448201527f742062652067726561746572207468616e20746f74616c206c656e677468202860648201527f6c6f6e6720737472696e67290000000000000000000000000000000000000000608482015260a4016105aa565b613d44836001614ba6565b975095506000945061417d9350505050565b60f78111613e37576000613d6b60c0836146d7565b905080876000015111613e26576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604a60248201527f524c505265616465723a206c656e677468206f6620636f6e74656e74206d757360448201527f742062652067726561746572207468616e206c697374206c656e67746820287360648201527f686f7274206c6973742900000000000000000000000000000000000000000000608482015260a4016105aa565b60019550935084925061417d915050565b6000613e4460f7836146d7565b905080876000015111613eff576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604d60248201527f524c505265616465723a206c656e677468206f6620636f6e74656e74206d757360448201527f74206265203e207468616e206c656e677468206f66206c697374206c656e677460648201527f6820286c6f6e67206c6973742900000000000000000000000000000000000000608482015260a4016105aa565b60018301517fff00000000000000000000000000000000000000000000000000000000000000166000819003613fdd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604860248201527f524c505265616465723a206c656e677468206f6620636f6e74656e74206d757360448201527f74206e6f74206861766520616e79206c656164696e67207a65726f7320286c6f60648201527f6e67206c69737429000000000000000000000000000000000000000000000000608482015260a4016105aa565b600184015160088302610100031c603781116140a1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604660248201527f524c505265616465723a206c656e677468206f6620636f6e74656e74206d757360448201527f742062652067726561746572207468616e20353520627974657320286c6f6e6760648201527f206c697374290000000000000000000000000000000000000000000000000000608482015260a4016105aa565b6140ab8184614ba6565b895111614160576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604a60248201527f524c505265616465723a206c656e677468206f6620636f6e74656e74206d757360448201527f742062652067726561746572207468616e20746f74616c206c656e677468202860648201527f6c6f6e67206c6973742900000000000000000000000000000000000000000000608482015260a4016105aa565b61416b836001614ba6565b975095506001945061417d9350505050565b9193909250565b606060008267ffffffffffffffff8111156141a1576141a1614225565b6040519080825280601f01601f1916602001820160405280156141cb576020820181803683370190505b509050826000036141dd579050611a26565b60006141e98587614ba6565b90506020820160005b8581101561420a5782810151828201526020016141f2565b85811115614219576000868301525b50919695505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff8111828210171561429b5761429b614225565b604052919050565b803573ffffffffffffffffffffffffffffffffffffffff811681146142c757600080fd5b919050565b600082601f8301126142dd57600080fd5b813567ffffffffffffffff8111156142f7576142f7614225565b61432860207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f84011601614254565b81815284602083860101111561433d57600080fd5b816020850160208301376000918101602001919091529392505050565b600060c0828403121561436c57600080fd5b60405160c0810167ffffffffffffffff828210818311171561439057614390614225565b81604052829350843583526143a7602086016142a3565b60208401526143b8604086016142a3565b6040840152606085013560608401526080850135608084015260a08501359150808211156143e557600080fd5b506143f2858286016142cc565b60a0830152505092915050565b600080600080600085870360e081121561441857600080fd5b863567ffffffffffffffff8082111561443057600080fd5b61443c8a838b0161435a565b97506020890135965060807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc08401121561447557600080fd5b60408901955060c089013592508083111561448f57600080fd5b828901925089601f8401126144a357600080fd5b82359150808211156144b457600080fd5b508860208260051b84010111156144ca57600080fd5b959894975092955050506020019190565b60005b838110156144f65781810151838201526020016144de565b83811115614505576000848401525b50505050565b600081518084526145238160208601602086016144db565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b602081526000611a26602083018461450b565b60006020828403121561457a57600080fd5b813567ffffffffffffffff81111561459157600080fd5b611d338482850161435a565b6000602082840312156145af57600080fd5b5035919050565b600080600080600060a086880312156145ce57600080fd5b6145d7866142a3565b945060208601359350604086013567ffffffffffffffff80821682146145fc57600080fd5b909350606087013590811515821461461357600080fd5b9092506080870135908082111561462957600080fd5b50614636888289016142cc565b9150509295509295909350565b8581528460208201527fffffffffffffffff0000000000000000000000000000000000000000000000008460c01b16604082015282151560f81b6048820152600082516146978160498501602087016144db565b919091016049019695505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000828210156146e9576146e96146a8565b500390565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60008261472c5761472c6146ee565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff83147f800000000000000000000000000000000000000000000000000000000000000083141615614780576147806146a8565b500590565b6000808312837f8000000000000000000000000000000000000000000000000000000000000000018312811516156147bf576147bf6146a8565b837f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0183138116156147f3576147f36146a8565b50500390565b60007f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff60008413600084138583048511828216161561483a5761483a6146a8565b7f80000000000000000000000000000000000000000000000000000000000000006000871286820588128184161615614875576148756146a8565b60008712925087820587128484161615614891576148916146a8565b878505871281841616156148a7576148a76146a8565b505050929093029392505050565b6000808212827f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038413811516156148ef576148ef6146a8565b827f8000000000000000000000000000000000000000000000000000000000000000038412811615614923576149236146a8565b50500190565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615614961576149616146a8565b500290565b600067ffffffffffffffff808316818516808303821115614989576149896146a8565b01949350505050565b60006fffffffffffffffffffffffffffffffff808316818516818304811182151516156149c1576149c16146a8565b02949350505050565b6000826149d9576149d96146ee565b500490565b6000604082840312156149f057600080fd5b6040516040810181811067ffffffffffffffff82111715614a1357614a13614225565b604052825181526020928301519281019290925250919050565b600060808284031215614a3f57600080fd5b6040516080810181811067ffffffffffffffff82111715614a6257614a62614225565b8060405250823581526020830135602082015260408301356040820152606083013560608201528091505092915050565b600067ffffffffffffffff80841115614aae57614aae614225565b8360051b6020614abf818301614254565b868152918501918181019036841115614ad757600080fd5b865b84811015614b0b57803586811115614af15760008081fd5b614afd36828b016142cc565b845250918301918301614ad9565b50979650505050505050565b60008451614b298184602089016144db565b80830190507f2e000000000000000000000000000000000000000000000000000000000000008082528551614b65816001850160208a016144db565b60019201918201528351614b808160028401602088016144db565b0160020195945050505050565b600060208284031215614b9f57600080fd5b5051919050565b60008219821115614bb957614bb96146a8565b500190565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203614bef57614bef6146a8565b5060010190565b868152600073ffffffffffffffffffffffffffffffffffffffff808816602084015280871660408401525084606083015283608083015260c060a0830152614c4160c083018461450b565b98975050505050505050565b600082614c5c57614c5c6146ee565b500690565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600060ff831680614ca357614ca36146ee565b8060ff84160691505092915050565b600060ff821660ff841680821015614ccc57614ccc6146a8565b90039392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fdfea164736f6c634300080f000a" var OptimismPortalDeployedBin = "0x6080604052600436106101475760003560e01c80638b4c40b0116100c0578063cd7c978911610074578063e965084c11610059578063e965084c14610429578063e9e05c42146104b5578063f4daa291146104c857600080fd5b8063cd7c978914610373578063cff0ab961461038857600080fd5b80639bf62d82116100a55780639bf62d8214610301578063a14238e71461032e578063ca3e99ba1461035e57600080fd5b80638b4c40b01461016c5780638c3152e9146102e157600080fd5b806364b79208116101175780636dbffb78116100fc5780636dbffb78146102865780638129fc1c146102b6578063867ead13146102cb57600080fd5b806364b792081461024c5780636bb0291e1461027157600080fd5b80621c2ff61461017357806313620abd146101d15780634870496f1461020a57806354fd4d501461022a57600080fd5b3661016e5761016c3334620186a06000604051806020016040528060008152506104fc565b005b600080fd5b34801561017f57600080fd5b506101a77f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b3480156101dd57600080fd5b506101e9633b9aca0081565b6040516fffffffffffffffffffffffffffffffff90911681526020016101c8565b34801561021657600080fd5b5061016c610225366004614426565b6109c9565b34801561023657600080fd5b5061023f610e6a565b6040516101c8919061457c565b34801561025857600080fd5b50610263627a120081565b6040519081526020016101c8565b34801561027d57600080fd5b50610263600481565b34801561029257600080fd5b506102a66102a136600461458f565b610f0d565b60405190151581526020016101c8565b3480156102c257600080fd5b5061016c610fe4565b3480156102d757600080fd5b5061026361271081565b3480156102ed57600080fd5b5061016c6102fc3660046145a8565b6111a2565b34801561030d57600080fd5b506032546101a79073ffffffffffffffffffffffffffffffffffffffff1681565b34801561033a57600080fd5b506102a661034936600461458f565b60336020526000908152604090205460ff1681565b34801561036a57600080fd5b50610263611a0e565b34801561037f57600080fd5b50610263600881565b34801561039457600080fd5b506001546103f0906fffffffffffffffffffffffffffffffff81169067ffffffffffffffff7001000000000000000000000000000000008204811691780100000000000000000000000000000000000000000000000090041683565b604080516fffffffffffffffffffffffffffffffff909416845267ffffffffffffffff92831660208501529116908201526060016101c8565b34801561043557600080fd5b5061048761044436600461458f565b603460205260009081526040902080546001909101546fffffffffffffffffffffffffffffffff8082169170010000000000000000000000000000000090041683565b604080519384526fffffffffffffffffffffffffffffffff92831660208501529116908201526060016101c8565b61016c6104c33660046145dd565b6104fc565b3480156104d457600080fd5b506102637f000000000000000000000000000000000000000000000000000000000000000081565b8260005a905083156105b35773ffffffffffffffffffffffffffffffffffffffff8716156105b357604080517f08c379a00000000000000000000000000000000000000000000000000000000081526020600482015260248101919091527f4f7074696d69736d506f7274616c3a206d7573742073656e6420746f2061646460448201527f72657373283029207768656e206372656174696e67206120636f6e747261637460648201526084015b60405180910390fd5b333281146105d4575033731111000000000000000000000000000000001111015b600034888888886040516020016105ef95949392919061466a565b604051602081830303815290604052905060008973ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fb3813568d9991fc951961fcb4c784893574240a28925604d09fc577c55bb7c328460405161065f919061457c565b60405180910390a4505060015460009061069f907801000000000000000000000000000000000000000000000000900467ffffffffffffffff16436146fe565b905080156108285760006106b76004627a1200614744565b6001546106e29190700100000000000000000000000000000000900467ffffffffffffffff166147ac565b9050600060086106f66004627a1200614744565b6001546107169085906fffffffffffffffffffffffffffffffff16614820565b6107209190614744565b61072a9190614744565b60015490915060009061077690610760906107589085906fffffffffffffffffffffffffffffffff166148dc565b612710611a3b565b6fffffffffffffffffffffffffffffffff611a54565b905060018411156107e9576107e6610760670de0b6b3a76400006107d261079e600883614744565b6107b090670de0b6b3a76400006147ac565b6107bb60018a6146fe565b6107cd90670de0b6b3a7640000614950565b611a63565b6107dc9085614820565b6107589190614744565b90505b6fffffffffffffffffffffffffffffffff16780100000000000000000000000000000000000000000000000067ffffffffffffffff4316021760015550505b6001805484919060109061085b908490700100000000000000000000000000000000900467ffffffffffffffff1661498d565b92506101000a81548167ffffffffffffffff021916908367ffffffffffffffff160217905550627a1200600160000160109054906101000a900467ffffffffffffffff1667ffffffffffffffff161315610937576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603e60248201527f5265736f757263654d65746572696e673a2063616e6e6f7420627579206d6f7260448201527f6520676173207468616e20617661696c61626c6520676173206c696d6974000060648201526084016105aa565b600154600090610963906fffffffffffffffffffffffffffffffff1667ffffffffffffffff86166149b9565b6fffffffffffffffffffffffffffffffff169050600061098748633b9aca00611a94565b61099190836149f1565b905060005a6109a090866146fe565b9050808211156109bc576109bc6109b782846146fe565b611aa4565b5050505050505050505050565b3073ffffffffffffffffffffffffffffffffffffffff16856040015173ffffffffffffffffffffffffffffffffffffffff1603610a88576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603f60248201527f4f7074696d69736d506f7274616c3a20796f752063616e6e6f742073656e642060448201527f6d6573736167657320746f2074686520706f7274616c20636f6e74726163740060648201526084016105aa565b6040517fa25ae557000000000000000000000000000000000000000000000000000000008152600481018590526000907f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff169063a25ae55790602401606060405180830381865afa158015610b16573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b3a9190614a25565b519050610b54610b4f36869003860186614a8a565b611ad2565b8114610be2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602960248201527f4f7074696d69736d506f7274616c3a20696e76616c6964206f7574707574207260448201527f6f6f742070726f6f66000000000000000000000000000000000000000000000060648201526084016105aa565b6000610bed87611b2e565b6000818152603460209081526040918290208251606081018452815481526001909101546fffffffffffffffffffffffffffffffff8082169383018490527001000000000000000000000000000000009091041692810192909252919250901580610c79575080604001516fffffffffffffffffffffffffffffffff1687148015610c79575080518314155b610d05576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603760248201527f4f7074696d69736d506f7274616c3a207769746864726177616c20686173682060448201527f68617320616c7265616479206265656e2070726f76656e00000000000000000060648201526084016105aa565b610d1d826040880135610d188789614af0565b611b5e565b610da9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603260248201527f4f7074696d69736d506f7274616c3a20696e76616c696420776974686472617760448201527f616c20696e636c7573696f6e2070726f6f66000000000000000000000000000060648201526084016105aa565b604080516060810182528481526fffffffffffffffffffffffffffffffff42811660208084019182528b831684860190815260008881526034835286812095518655925190518416700100000000000000000000000000000000029316929092176001909301929092558a830151908b0151925173ffffffffffffffffffffffffffffffffffffffff918216939091169185917f67a6208cfcc0801d50f6cbe764733f4fddf66ac0b04442061a8a8c0cb6b63f629190a45050505050505050565b6060610e957f0000000000000000000000000000000000000000000000000000000000000000611c25565b610ebe7f0000000000000000000000000000000000000000000000000000000000000000611c25565b610ee77f0000000000000000000000000000000000000000000000000000000000000000611c25565b604051602001610ef993929190614b74565b604051602081830303815290604052905090565b6040517fa25ae55700000000000000000000000000000000000000000000000000000000815260048101829052600090610fde9073ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000169063a25ae55790602401606060405180830381865afa158015610f9f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fc39190614a25565b602001516fffffffffffffffffffffffffffffffff16611d62565b92915050565b600054610100900460ff16158080156110045750600054600160ff909116105b8061101e5750303b15801561101e575060005460ff166001145b6110aa576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a656400000000000000000000000000000000000060648201526084016105aa565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055801561110857600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b603280547fffffffffffffffffffffffff00000000000000000000000000000000000000001661dead17905561113c611d96565b801561119f57600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50565b60325473ffffffffffffffffffffffffffffffffffffffff1661dead1461124b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603f60248201527f4f7074696d69736d506f7274616c3a2063616e206f6e6c79207472696767657260448201527f206f6e65207769746864726177616c20706572207472616e73616374696f6e0060648201526084016105aa565b600061125682611b2e565b60008181526034602090815260408083208151606081018352815481526001909101546fffffffffffffffffffffffffffffffff80821694830185905270010000000000000000000000000000000090910416918101919091529293509003611341576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f4f7074696d69736d506f7274616c3a207769746864726177616c20686173206e60448201527f6f74206265656e2070726f76656e00000000000000000000000000000000000060648201526084016105aa565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663887862726040518163ffffffff1660e01b8152600401602060405180830381865afa1580156113ac573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113d09190614bea565b81602001516fffffffffffffffffffffffffffffffff16101561149b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604b60248201527f4f7074696d69736d506f7274616c3a207769746864726177616c2074696d657360448201527f74616d70206c657373207468616e204c32204f7261636c65207374617274696e60648201527f672074696d657374616d70000000000000000000000000000000000000000000608482015260a4016105aa565b6114ba81602001516fffffffffffffffffffffffffffffffff16611d62565b61156c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604560248201527f4f7074696d69736d506f7274616c3a2070726f76656e2077697468647261776160448201527f6c2066696e616c697a6174696f6e20706572696f6420686173206e6f7420656c60648201527f6170736564000000000000000000000000000000000000000000000000000000608482015260a4016105aa565b60408181015190517fa25ae5570000000000000000000000000000000000000000000000000000000081526fffffffffffffffffffffffffffffffff90911660048201526000907f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff169063a25ae55790602401606060405180830381865afa158015611611573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116359190614a25565b82518151919250146116ef576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604960248201527f4f7074696d69736d506f7274616c3a206f757470757420726f6f742070726f7660448201527f656e206973206e6f74207468652073616d652061732063757272656e74206f7560648201527f7470757420726f6f740000000000000000000000000000000000000000000000608482015260a4016105aa565b61170e81602001516fffffffffffffffffffffffffffffffff16611d62565b6117c0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604360248201527f4f7074696d69736d506f7274616c3a206f75747075742070726f706f73616c2060448201527f66696e616c697a6174696f6e20706572696f6420686173206e6f7420656c617060648201527f7365640000000000000000000000000000000000000000000000000000000000608482015260a4016105aa565b60008381526033602052604090205460ff161561185f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603560248201527f4f7074696d69736d506f7274616c3a207769746864726177616c20686173206160448201527f6c7265616479206265656e2066696e616c697a6564000000000000000000000060648201526084016105aa565b600083815260336020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600117905560808401516118a890614e2090614c03565b5a1015611937576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603760248201527f4f7074696d69736d506f7274616c3a20696e73756666696369656e742067617360448201527f20746f2066696e616c697a65207769746864726177616c00000000000000000060648201526084016105aa565b8360200151603260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600061199a8560400151866080015187606001518860a00151611e79565b603280547fffffffffffffffffffffffff00000000000000000000000000000000000000001661dead17905560405190915084907fdb5c7652857aa163daadd670e116628fb42e869d8ac4251ef8971d9e5727df1b906119ff90841515815260200190565b60405180910390a25050505050565b611a1c6004627a1200614744565b81565b73ffffffffffffffffffffffffffffffffffffffff163b151590565b600081831215611a4b5781611a4d565b825b9392505050565b6000818312611a4b5781611a4d565b6000611a4d670de0b6b3a764000083611a7b86611e93565b611a859190614820565b611a8f9190614744565b6120d7565b600081831015611a4b5781611a4d565b6000805a90505b825a611ab790836146fe565b1015611acd57611ac682614c1b565b9150611aab565b505050565b60008160000151826020015183604001518460600151604051602001611b11949392919093845260208401929092526040830152606082015260800190565b604051602081830303815290604052805190602001209050919050565b80516020808301516040808501516060860151608087015160a08801519351600097611b11979096959101614c53565b604080516020810185905260009181018290528190606001604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081840301815282825280516020918201209083018190529250611c1c9101604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152828201909152600182527f01000000000000000000000000000000000000000000000000000000000000006020830152908587612316565b95945050505050565b606081600003611c6857505060408051808201909152600181527f3000000000000000000000000000000000000000000000000000000000000000602082015290565b8160005b8115611c925780611c7c81614c1b565b9150611c8b9050600a836149f1565b9150611c6c565b60008167ffffffffffffffff811115611cad57611cad61424c565b6040519080825280601f01601f191660200182016040528015611cd7576020820181803683370190505b5090505b8415611d5a57611cec6001836146fe565b9150611cf9600a86614caa565b611d04906030614c03565b60f81b818381518110611d1957611d19614cbe565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350611d53600a866149f1565b9450611cdb565b949350505050565b6000611d8e7f000000000000000000000000000000000000000000000000000000000000000083614c03565b421192915050565b600054610100900460ff16611e2d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e6700000000000000000000000000000000000000000060648201526084016105aa565b60408051606081018252633b9aca00808252600060208301524367ffffffffffffffff169190920181905278010000000000000000000000000000000000000000000000000217600155565b600080600080845160208601878a8af19695505050505050565b6000808213611efe576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f554e444546494e4544000000000000000000000000000000000000000000000060448201526064016105aa565b60006060611f0b8461233a565b03609f8181039490941b90931c6c465772b2bbbb5f824b15207a3081018102606090811d6d0388eaa27412d5aca026815d636e018202811d6d0df99ac502031bf953eff472fdcc018202811d6d13cdffb29d51d99322bdff5f2211018202811d6d0a0f742023def783a307a986912e018202811d6d01920d8043ca89b5239253284e42018202811d6c0b7a86d7375468fac667a0a527016c29508e458543d8aa4df2abee7883018302821d6d0139601a2efabe717e604cbb4894018302821d6d02247f7a7b6594320649aa03aba1018302821d7fffffffffffffffffffffffffffffffffffffff73c0c716a594e00d54e3c4cbc9018302821d7ffffffffffffffffffffffffffffffffffffffdc7b88c420e53a9890533129f6f01830290911d7fffffffffffffffffffffffffffffffffffffff465fda27eb4d63ded474e5f832019091027ffffffffffffffff5f6af8f7b3396644f18e157960000000000000000000000000105711340daa0d5f769dba1915cef59f0815a5506027d0267a36c0c95b3975ab3ee5b203a7614a3f75373f047d803ae7b6687f2b393909302929092017d57115e47018c7177eebf7cd370a3356a1b7863008a5ae8028c72b88642840160ae1d92915050565b60007ffffffffffffffffffffffffffffffffffffffffffffffffdb731c958f34d94c1821361210857506000919050565b680755bf798b4a1bf1e5821261217a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f4558505f4f564552464c4f57000000000000000000000000000000000000000060448201526064016105aa565b6503782dace9d9604e83901b059150600060606bb17217f7d1cf79abc9e3b39884821b056b80000000000000000000000001901d6bb17217f7d1cf79abc9e3b39881029093037fffffffffffffffffffffffffffffffffffffffdbf3ccf1604d263450f02a550481018102606090811d6d0277594991cfc85f6e2461837cd9018202811d7fffffffffffffffffffffffffffffffffffffe5adedaa1cb095af9e4da10e363c018202811d6db1bbb201f443cf962f1a1d3db4a5018202811d7ffffffffffffffffffffffffffffffffffffd38dc772608b0ae56cce01296c0eb018202811d6e05180bb14799ab47a8a8cb2a527d57016d02d16720577bd19bf614176fe9ea6c10fe68e7fd37d0007b713f765084018402831d9081019084017ffffffffffffffffffffffffffffffffffffffe2c69812cf03b0763fd454a8f7e010290911d6e0587f503bb6ea29d25fcb7401964500190910279d835ebba824c98fb31b83b2ca45c000000000000000000000000010574029d9dc38563c32e5c2f6dc192ee70ef65f9978af30260c3939093039290921c92915050565b60008061232286612410565b905061233081868686612442565b9695505050505050565b60008082116123a5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f554e444546494e4544000000000000000000000000000000000000000000000060448201526064016105aa565b5060016fffffffffffffffffffffffffffffffff821160071b82811c67ffffffffffffffff1060061b1782811c63ffffffff1060051b1782811c61ffff1060041b1782811c60ff10600390811b90911783811c600f1060021b1783811c909110821b1791821c111790565b6060818051906020012060405160200161242c91815260200190565b6040516020818303038152906040529050919050565b600080600061245287868661247f565b9150915081801561247457508051602080830191909120875191880191909120145b979650505050505050565b60006060600061248e8561259d565b905060008060006124a0848a8961268c565b815192955090935091501580806124b45750815b612540576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f4d65726b6c65547269653a2070726f76696465642070726f6f6620697320696e60448201527f76616c696400000000000000000000000000000000000000000000000000000060648201526084016105aa565b60008161255c5760405180602001604052806000815250612588565b6125888661256b6001886146fe565b8151811061257b5761257b614cbe565b6020026020010151612d90565b805115159c909b509950505050505050505050565b805160609060008167ffffffffffffffff8111156125bd576125bd61424c565b60405190808252806020026020018201604052801561260257816020015b60408051808201909152606080825260208201528152602001906001900390816125db5790505b50905060005b8281101561268457604051806040016040528086838151811061262d5761262d614cbe565b6020026020010151815260200161265c87848151811061264f5761264f614cbe565b6020026020010151612dc7565b81525082828151811061267157612671614cbe565b6020908102919091010152600101612608565b509392505050565b6000606081808061269c87612dda565b90506000866040516020016126b391815260200190565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152828201909152606080835260208301529150600090819060005b8c51811015612d12578c818151811061271357612713614cbe565b6020026020010151915082846127299190614c03565b9350612736600188614c03565b9650836000036127f157815180516020918201206040516127869261276092910190815260200190565b604051602081830303815290604052868051602091820120825192909101919091201490565b6127ec576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f4d65726b6c65547269653a20696e76616c696420726f6f74206861736800000060448201526064016105aa565b612948565b8151516020116128a7578151805160209182012060405161281b9261276092910190815260200190565b6127ec576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602760248201527f4d65726b6c65547269653a20696e76616c6964206c6172676520696e7465726e60448201527f616c20686173680000000000000000000000000000000000000000000000000060648201526084016105aa565b815185516020808801919091208251919092012014612948576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4d65726b6c65547269653a20696e76616c696420696e7465726e616c206e6f6460448201527f652068617368000000000000000000000000000000000000000000000000000060648201526084016105aa565b61295460106001614c03565b826020015151036129c65785518414612d1257600086858151811061297b5761297b614cbe565b602001015160f81c60f81b60f81c9050600083602001518260ff16815181106129a6576129a6614cbe565b602002602001015190506129b981612f75565b9650600194505050612d00565b600282602001515103612c785760006129de83612f9a565b90506000816000815181106129f5576129f5614cbe565b016020015160f81c90506000612a0c600283614ced565b612a17906002614d0f565b90506000612a28848360ff16612fbe565b90506000612a368b8a612fbe565b90506000612a448383612ff4565b9050825182511015612ad8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603960248201527f4d65726b6c65547269653a20696e76616c6964206b6579206c656e677468206660448201527f6f72206c656166206f7220657874656e73696f6e206e6f64650000000000000060648201526084016105aa565b60ff851660021480612aed575060ff85166003145b15612b5757808351148015612b025750808251145b15612b1457612b11818b614c03565b99505b6040518060400160405280600181526020017f80000000000000000000000000000000000000000000000000000000000000008152509a50505050505050612d12565b60ff85161580612b6a575060ff85166001145b15612bf05782518114612bba576040518060400160405280600181526020017f80000000000000000000000000000000000000000000000000000000000000008152509a50505050505050612d12565b612be18860200151600181518110612bd457612bd4614cbe565b6020026020010151612f75565b9a509750612d00945050505050565b6040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603260248201527f4d65726b6c65547269653a2072656365697665642061206e6f6465207769746860448201527f20616e20756e6b6e6f776e20707265666978000000000000000000000000000060648201526084016105aa565b6040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602860248201527f4d65726b6c65547269653a20726563656976656420616e20756e70617273656160448201527f626c65206e6f646500000000000000000000000000000000000000000000000060648201526084016105aa565b80612d0a81614c1b565b9150506126f8565b5085612d1e8685612fbe565b60408051808201909152600181527f80000000000000000000000000000000000000000000000000000000000000006020918201528651908701207f56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b4211498509850985050505050505093509350939050565b60208101518051606091610fde91612daa906001906146fe565b81518110612dba57612dba614cbe565b60200260200101516130a3565b6060610fde612dd583613203565b6132ec565b80516060906000612dec826002614950565b67ffffffffffffffff811115612e0457612e0461424c565b6040519080825280601f01601f191660200182016040528015612e2e576020820181803683370190505b5090506000805b83811015612f6b57858181518110612e4f57612e4f614cbe565b6020910101517fff000000000000000000000000000000000000000000000000000000000000008116925060041c7f0ff00000000000000000000000000000000000000000000000000000000000001683612eab836002614950565b81518110612ebb57612ebb614cbe565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f0f00000000000000000000000000000000000000000000000000000000000000821683612f19836002614950565b612f24906001614c03565b81518110612f3457612f34614cbe565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600101612e35565b5090949350505050565b60606020826000015110612f9157612f8c826130a3565b610fde565b610fde82613550565b6060610fde612fb98360200151600081518110612dba57612dba614cbe565b612dda565b606082518210612fdd5750604080516020810190915260008152610fde565b611a4d8383848651612fef91906146fe565b613566565b6000806000835185511061300957835161300c565b84515b90505b8082108015613093575083828151811061302b5761302b614cbe565b602001015160f81c60f81b7effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191685838151811061306a5761306a614cbe565b01602001517fff0000000000000000000000000000000000000000000000000000000000000016145b156126845781600101915061300f565b606060008060006130b38561373e565b9194509250905060008160018111156130ce576130ce614d32565b1461315b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603960248201527f524c505265616465723a206465636f646564206974656d207479706520666f7260448201527f206279746573206973206e6f7420612064617461206974656d0000000000000060648201526084016105aa565b6131658284614c03565b8551146131f4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603460248201527f524c505265616465723a2062797465732076616c756520636f6e7461696e732060448201527f616e20696e76616c69642072656d61696e64657200000000000000000000000060648201526084016105aa565b611c1c856020015184846141ab565b604080518082019091526000808252602082015260008251116132ce576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604a60248201527f524c505265616465723a206c656e677468206f6620616e20524c50206974656d60448201527f206d7573742062652067726561746572207468616e207a65726f20746f20626560648201527f206465636f6461626c6500000000000000000000000000000000000000000000608482015260a4016105aa565b50604080518082019091528151815260209182019181019190915290565b606060008060006132fc8561373e565b91945092509050600181600181111561331757613317614d32565b146133a4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603860248201527f524c505265616465723a206465636f646564206974656d207479706520666f7260448201527f206c697374206973206e6f742061206c697374206974656d000000000000000060648201526084016105aa565b84516133b08385614c03565b1461343d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603260248201527f524c505265616465723a206c697374206974656d2068617320616e20696e766160448201527f6c696420646174612072656d61696e646572000000000000000000000000000060648201526084016105aa565b6040805160208082526104208201909252600091816020015b60408051808201909152600080825260208201528152602001906001900390816134565790505090506000845b8751811015613544576000806134c96040518060400160405280858d600001516134ad91906146fe565b8152602001858d602001516134c29190614c03565b905261373e565b5091509150604051806040016040528083836134e59190614c03565b8152602001848c602001516134fa9190614c03565b81525085858151811061350f5761350f614cbe565b6020908102919091010152613525600185614c03565b93506135318183614c03565b61353b9084614c03565b92505050613483565b50815295945050505050565b6060610fde8260200151600084600001516141ab565b60608182601f0110156135d5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600e60248201527f736c6963655f6f766572666c6f7700000000000000000000000000000000000060448201526064016105aa565b828284011015613641576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600e60248201527f736c6963655f6f766572666c6f7700000000000000000000000000000000000060448201526064016105aa565b818301845110156136ae576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f736c6963655f6f75744f66426f756e647300000000000000000000000000000060448201526064016105aa565b6060821580156136cd5760405191506000825260208201604052613735565b6040519150601f8416801560200281840101858101878315602002848b0101015b818310156137065780518352602092830192016136ee565b5050858452601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016604052505b50949350505050565b6000806000808460000151116137fc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604a60248201527f524c505265616465723a206c656e677468206f6620616e20524c50206974656d60448201527f206d7573742062652067726561746572207468616e207a65726f20746f20626560648201527f206465636f6461626c6500000000000000000000000000000000000000000000608482015260a4016105aa565b6020840151805160001a607f81116138215760006001600094509450945050506141a4565b60b78111613a2f5760006138366080836146fe565b9050808760000151116138f1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604e60248201527f524c505265616465723a206c656e677468206f6620636f6e74656e74206d757360448201527f742062652067726561746572207468616e20737472696e67206c656e6774682060648201527f2873686f727420737472696e6729000000000000000000000000000000000000608482015260a4016105aa565b6001838101517fff0000000000000000000000000000000000000000000000000000000000000016908214158061396a57507f80000000000000000000000000000000000000000000000000000000000000007fff00000000000000000000000000000000000000000000000000000000000000821610155b613a1c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604d60248201527f524c505265616465723a20696e76616c6964207072656669782c2073696e676c60448201527f652062797465203c203078383020617265206e6f74207072656669786564202860648201527f73686f727420737472696e672900000000000000000000000000000000000000608482015260a4016105aa565b50600195509350600092506141a4915050565b60bf8111613d7d576000613a4460b7836146fe565b905080876000015111613aff576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152605160248201527f524c505265616465723a206c656e677468206f6620636f6e74656e74206d757360448201527f74206265203e207468616e206c656e677468206f6620737472696e67206c656e60648201527f67746820286c6f6e6720737472696e6729000000000000000000000000000000608482015260a4016105aa565b60018301517fff00000000000000000000000000000000000000000000000000000000000000166000819003613bdd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604a60248201527f524c505265616465723a206c656e677468206f6620636f6e74656e74206d757360448201527f74206e6f74206861766520616e79206c656164696e67207a65726f7320286c6f60648201527f6e6720737472696e672900000000000000000000000000000000000000000000608482015260a4016105aa565b600184015160088302610100031c60378111613ca1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604860248201527f524c505265616465723a206c656e677468206f6620636f6e74656e74206d757360448201527f742062652067726561746572207468616e20353520627974657320286c6f6e6760648201527f20737472696e6729000000000000000000000000000000000000000000000000608482015260a4016105aa565b613cab8184614c03565b895111613d60576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604c60248201527f524c505265616465723a206c656e677468206f6620636f6e74656e74206d757360448201527f742062652067726561746572207468616e20746f74616c206c656e677468202860648201527f6c6f6e6720737472696e67290000000000000000000000000000000000000000608482015260a4016105aa565b613d6b836001614c03565b97509550600094506141a49350505050565b60f78111613e5e576000613d9260c0836146fe565b905080876000015111613e4d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604a60248201527f524c505265616465723a206c656e677468206f6620636f6e74656e74206d757360448201527f742062652067726561746572207468616e206c697374206c656e67746820287360648201527f686f7274206c6973742900000000000000000000000000000000000000000000608482015260a4016105aa565b6001955093508492506141a4915050565b6000613e6b60f7836146fe565b905080876000015111613f26576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604d60248201527f524c505265616465723a206c656e677468206f6620636f6e74656e74206d757360448201527f74206265203e207468616e206c656e677468206f66206c697374206c656e677460648201527f6820286c6f6e67206c6973742900000000000000000000000000000000000000608482015260a4016105aa565b60018301517fff00000000000000000000000000000000000000000000000000000000000000166000819003614004576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604860248201527f524c505265616465723a206c656e677468206f6620636f6e74656e74206d757360448201527f74206e6f74206861766520616e79206c656164696e67207a65726f7320286c6f60648201527f6e67206c69737429000000000000000000000000000000000000000000000000608482015260a4016105aa565b600184015160088302610100031c603781116140c8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604660248201527f524c505265616465723a206c656e677468206f6620636f6e74656e74206d757360448201527f742062652067726561746572207468616e20353520627974657320286c6f6e6760648201527f206c697374290000000000000000000000000000000000000000000000000000608482015260a4016105aa565b6140d28184614c03565b895111614187576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604a60248201527f524c505265616465723a206c656e677468206f6620636f6e74656e74206d757360448201527f742062652067726561746572207468616e20746f74616c206c656e677468202860648201527f6c6f6e67206c6973742900000000000000000000000000000000000000000000608482015260a4016105aa565b614192836001614c03565b97509550600194506141a49350505050565b9193909250565b606060008267ffffffffffffffff8111156141c8576141c861424c565b6040519080825280601f01601f1916602001820160405280156141f2576020820181803683370190505b50905082600003614204579050611a4d565b60006142108587614c03565b90506020820160005b85811015614231578281015182820152602001614219565b85811115614240576000868301525b50919695505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff811182821017156142c2576142c261424c565b604052919050565b803573ffffffffffffffffffffffffffffffffffffffff811681146142ee57600080fd5b919050565b600082601f83011261430457600080fd5b813567ffffffffffffffff81111561431e5761431e61424c565b61434f60207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8401160161427b565b81815284602083860101111561436457600080fd5b816020850160208301376000918101602001919091529392505050565b600060c0828403121561439357600080fd5b60405160c0810167ffffffffffffffff82821081831117156143b7576143b761424c565b81604052829350843583526143ce602086016142ca565b60208401526143df604086016142ca565b6040840152606085013560608401526080850135608084015260a085013591508082111561440c57600080fd5b50614419858286016142f3565b60a0830152505092915050565b600080600080600085870360e081121561443f57600080fd5b863567ffffffffffffffff8082111561445757600080fd5b6144638a838b01614381565b97506020890135965060807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc08401121561449c57600080fd5b60408901955060c08901359250808311156144b657600080fd5b828901925089601f8401126144ca57600080fd5b82359150808211156144db57600080fd5b508860208260051b84010111156144f157600080fd5b959894975092955050506020019190565b60005b8381101561451d578181015183820152602001614505565b8381111561452c576000848401525b50505050565b6000815180845261454a816020860160208601614502565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b602081526000611a4d6020830184614532565b6000602082840312156145a157600080fd5b5035919050565b6000602082840312156145ba57600080fd5b813567ffffffffffffffff8111156145d157600080fd5b611d5a84828501614381565b600080600080600060a086880312156145f557600080fd5b6145fe866142ca565b945060208601359350604086013567ffffffffffffffff808216821461462357600080fd5b909350606087013590811515821461463a57600080fd5b9092506080870135908082111561465057600080fd5b5061465d888289016142f3565b9150509295509295909350565b8581528460208201527fffffffffffffffff0000000000000000000000000000000000000000000000008460c01b16604082015282151560f81b6048820152600082516146be816049850160208701614502565b919091016049019695505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600082821015614710576147106146cf565b500390565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60008261475357614753614715565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff83147f8000000000000000000000000000000000000000000000000000000000000000831416156147a7576147a76146cf565b500590565b6000808312837f8000000000000000000000000000000000000000000000000000000000000000018312811516156147e6576147e66146cf565b837f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01831381161561481a5761481a6146cf565b50500390565b60007f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600084136000841385830485118282161615614861576148616146cf565b7f8000000000000000000000000000000000000000000000000000000000000000600087128682058812818416161561489c5761489c6146cf565b600087129250878205871284841616156148b8576148b86146cf565b878505871281841616156148ce576148ce6146cf565b505050929093029392505050565b6000808212827f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03841381151615614916576149166146cf565b827f800000000000000000000000000000000000000000000000000000000000000003841281161561494a5761494a6146cf565b50500190565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615614988576149886146cf565b500290565b600067ffffffffffffffff8083168185168083038211156149b0576149b06146cf565b01949350505050565b60006fffffffffffffffffffffffffffffffff808316818516818304811182151516156149e8576149e86146cf565b02949350505050565b600082614a0057614a00614715565b500490565b80516fffffffffffffffffffffffffffffffff811681146142ee57600080fd5b600060608284031215614a3757600080fd5b6040516060810181811067ffffffffffffffff82111715614a5a57614a5a61424c565b60405282518152614a6d60208401614a05565b6020820152614a7e60408401614a05565b60408201529392505050565b600060808284031215614a9c57600080fd5b6040516080810181811067ffffffffffffffff82111715614abf57614abf61424c565b8060405250823581526020830135602082015260408301356040820152606083013560608201528091505092915050565b600067ffffffffffffffff80841115614b0b57614b0b61424c565b8360051b6020614b1c81830161427b565b868152918501918181019036841115614b3457600080fd5b865b84811015614b6857803586811115614b4e5760008081fd5b614b5a36828b016142f3565b845250918301918301614b36565b50979650505050505050565b60008451614b86818460208901614502565b80830190507f2e000000000000000000000000000000000000000000000000000000000000008082528551614bc2816001850160208a01614502565b60019201918201528351614bdd816002840160208801614502565b0160020195945050505050565b600060208284031215614bfc57600080fd5b5051919050565b60008219821115614c1657614c166146cf565b500190565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203614c4c57614c4c6146cf565b5060010190565b868152600073ffffffffffffffffffffffffffffffffffffffff808816602084015280871660408401525084606083015283608083015260c060a0830152614c9e60c0830184614532565b98975050505050505050565b600082614cb957614cb9614715565b500690565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600060ff831680614d0057614d00614715565b8060ff84160691505092915050565b600060ff821660ff841680821015614d2957614d296146cf565b90039392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fdfea164736f6c634300080f000a"
func init() { func init() {
if err := json.Unmarshal([]byte(OptimismPortalStorageLayoutJSON), OptimismPortalStorageLayout); err != nil { if err := json.Unmarshal([]byte(OptimismPortalStorageLayoutJSON), OptimismPortalStorageLayout); err != nil {
......
...@@ -73,7 +73,7 @@ func TestProposer(gt *testing.T) { ...@@ -73,7 +73,7 @@ func TestProposer(gt *testing.T) {
outputOracleContract, err := bindings.NewL2OutputOracle(sd.DeploymentsL1.L2OutputOracleProxy, miner.EthClient()) outputOracleContract, err := bindings.NewL2OutputOracle(sd.DeploymentsL1.L2OutputOracleProxy, miner.EthClient())
require.NoError(t, err) require.NoError(t, err)
block := sequencer.SyncStatus().FinalizedL2 block := sequencer.SyncStatus().FinalizedL2
outputOnL1, err := outputOracleContract.GetL2Output(nil, new(big.Int).SetUint64(block.Number)) outputOnL1, err := outputOracleContract.GetL2OutputAfter(nil, new(big.Int).SetUint64(block.Number))
require.NoError(t, err) require.NoError(t, err)
require.Less(t, block.Time, outputOnL1.Timestamp.Uint64(), "output is registered with L1 timestamp of proposal tx, past L2 block") require.Less(t, block.Time, outputOnL1.Timestamp.Uint64(), "output is registered with L1 timestamp of proposal tx, past L2 block")
outputComputed, err := sequencer.RollupClient().OutputAtBlock(t.Ctx(), block.Number) outputComputed, err := sequencer.RollupClient().OutputAtBlock(t.Ctx(), block.Number)
......
...@@ -397,6 +397,8 @@ func (s *CrossLayerUser) ProveWithdrawal(t Testing, l2TxHash common.Hash) common ...@@ -397,6 +397,8 @@ func (s *CrossLayerUser) ProveWithdrawal(t Testing, l2TxHash common.Hash) common
require.NoError(t, err) require.NoError(t, err)
l2OutputBlock, err := s.L2.env.EthCl.BlockByNumber(t.Ctx(), l2OutputBlockNr) l2OutputBlock, err := s.L2.env.EthCl.BlockByNumber(t.Ctx(), l2OutputBlockNr)
require.NoError(t, err) require.NoError(t, err)
l2OutputIndex, err := s.L1.env.Bindings.L2OutputOracle.GetL2OutputIndexAfter(&bind.CallOpts{}, l2OutputBlockNr)
require.NoError(t, err)
// Check if the L2 output is even old enough to include the withdrawal // Check if the L2 output is even old enough to include the withdrawal
if l2OutputBlock.NumberU64() < l2WithdrawalBlock.NumberU64() { if l2OutputBlock.NumberU64() < l2WithdrawalBlock.NumberU64() {
...@@ -421,7 +423,7 @@ func (s *CrossLayerUser) ProveWithdrawal(t Testing, l2TxHash common.Hash) common ...@@ -421,7 +423,7 @@ func (s *CrossLayerUser) ProveWithdrawal(t Testing, l2TxHash common.Hash) common
GasLimit: params.GasLimit, GasLimit: params.GasLimit,
Data: params.Data, Data: params.Data,
}, },
params.BlockNumber, l2OutputIndex,
params.OutputRootProof, params.OutputRootProof,
params.WithdrawalProof, params.WithdrawalProof,
) )
......
...@@ -104,7 +104,7 @@ func TestL2OutputSubmitter(t *testing.T) { ...@@ -104,7 +104,7 @@ func TestL2OutputSubmitter(t *testing.T) {
// timestamp set in the contract constructor. // timestamp set in the contract constructor.
if l2ooBlockNumber.Cmp(initialOutputBlockNumber) > 0 { if l2ooBlockNumber.Cmp(initialOutputBlockNumber) > 0 {
// Retrieve the l2 output committed at this updated timestamp. // Retrieve the l2 output committed at this updated timestamp.
committedL2Output, err := l2OutputOracle.GetL2Output(&bind.CallOpts{}, l2ooBlockNumber) committedL2Output, err := l2OutputOracle.GetL2OutputAfter(&bind.CallOpts{}, l2ooBlockNumber)
require.NotEqual(t, [32]byte{}, committedL2Output.OutputRoot, "Empty L2 Output") require.NotEqual(t, [32]byte{}, committedL2Output.OutputRoot, "Empty L2 Output")
require.Nil(t, err) require.Nil(t, err)
...@@ -842,6 +842,12 @@ func TestWithdrawals(t *testing.T) { ...@@ -842,6 +842,12 @@ func TestWithdrawals(t *testing.T) {
portal, err := bindings.NewOptimismPortal(predeploys.DevOptimismPortalAddr, l1Client) portal, err := bindings.NewOptimismPortal(predeploys.DevOptimismPortalAddr, l1Client)
require.Nil(t, err) require.Nil(t, err)
oracle, err := bindings.NewL2OutputOracleCaller(predeploys.DevL2OutputOracleAddr, l1Client)
require.Nil(t, err)
l2OutputIndex, err := oracle.GetL2OutputIndexAfter(&bind.CallOpts{}, params.BlockNumber)
require.Nil(t, err)
opts.Value = nil opts.Value = nil
// Prove withdrawal // Prove withdrawal
...@@ -855,7 +861,7 @@ func TestWithdrawals(t *testing.T) { ...@@ -855,7 +861,7 @@ func TestWithdrawals(t *testing.T) {
GasLimit: params.GasLimit, GasLimit: params.GasLimit,
Data: params.Data, Data: params.Data,
}, },
params.BlockNumber, l2OutputIndex,
params.OutputRootProof, params.OutputRootProof,
params.WithdrawalProof, params.WithdrawalProof,
) )
......
...@@ -91,7 +91,7 @@ loop: ...@@ -91,7 +91,7 @@ loop:
} }
// Now wait for it to be finalized // Now wait for it to be finalized
output, err := l2OO.GetL2Output(opts, l2BlockNumber) output, err := l2OO.GetL2OutputAfter(opts, l2BlockNumber)
if err != nil { if err != nil {
return 0, err return 0, err
} }
......
...@@ -5,7 +5,7 @@ GasBenchMark_L1StandardBridge_Deposit:test_depositERC20_benchmark_1() (gas: 1122 ...@@ -5,7 +5,7 @@ GasBenchMark_L1StandardBridge_Deposit:test_depositERC20_benchmark_1() (gas: 1122
GasBenchMark_L1StandardBridge_Deposit:test_depositETH_benchmark_0() (gas: 348176) GasBenchMark_L1StandardBridge_Deposit:test_depositETH_benchmark_0() (gas: 348176)
GasBenchMark_L1StandardBridge_Deposit:test_depositETH_benchmark_1() (gas: 112253) GasBenchMark_L1StandardBridge_Deposit:test_depositETH_benchmark_1() (gas: 112253)
GasBenchMark_L1StandardBridge_Finalize:test_finalizeETHWithdrawal_benchmark() (gas: 40502) GasBenchMark_L1StandardBridge_Finalize:test_finalizeETHWithdrawal_benchmark() (gas: 40502)
GasBenchMark_L2OutputOracle:test_proposeL2Output_benchmark() (gas: 70685) GasBenchMark_L2OutputOracle:test_proposeL2Output_benchmark() (gas: 88513)
GasBenchMark_OptimismPortal:test_depositTransaction_benchmark() (gas: 74956) GasBenchMark_OptimismPortal:test_depositTransaction_benchmark() (gas: 74956)
GasBenchMark_OptimismPortal:test_depositTransaction_benchmark_1() (gas: 35693) GasBenchMark_OptimismPortal:test_depositTransaction_benchmark_1() (gas: 35693)
CrossDomainMessenger_Test:testFuzz_baseGas(uint32) (runs: 256, μ: 20196, ~: 20196) CrossDomainMessenger_Test:testFuzz_baseGas(uint32) (runs: 256, μ: 20196, ~: 20196)
...@@ -44,10 +44,10 @@ L1CrossDomainMessenger_Test:testCannot_L1MessengerPause() (gas: 24538) ...@@ -44,10 +44,10 @@ L1CrossDomainMessenger_Test:testCannot_L1MessengerPause() (gas: 24538)
L1CrossDomainMessenger_Test:testCannot_L1MessengerUnpause() (gas: 24496) L1CrossDomainMessenger_Test:testCannot_L1MessengerUnpause() (gas: 24496)
L1CrossDomainMessenger_Test:test_L1MessengerMessageVersion() (gas: 24715) L1CrossDomainMessenger_Test:test_L1MessengerMessageVersion() (gas: 24715)
L1CrossDomainMessenger_Test:test_L1MessengerPause() (gas: 52920) L1CrossDomainMessenger_Test:test_L1MessengerPause() (gas: 52920)
L1CrossDomainMessenger_Test:test_L1MessengerRelayMessageFirstStuckSecondSucceeds() (gas: 197247) L1CrossDomainMessenger_Test:test_L1MessengerRelayMessageFirstStuckSecondSucceeds() (gas: 197224)
L1CrossDomainMessenger_Test:test_L1MessengerRelayMessageRevertsOnReentrancy() (gas: 190936) L1CrossDomainMessenger_Test:test_L1MessengerRelayMessageRevertsOnReentrancy() (gas: 190913)
L1CrossDomainMessenger_Test:test_L1MessengerRelayMessageSucceeds() (gas: 73672) L1CrossDomainMessenger_Test:test_L1MessengerRelayMessageSucceeds() (gas: 73649)
L1CrossDomainMessenger_Test:test_L1MessengerRelayMessageToSystemContract() (gas: 65881) L1CrossDomainMessenger_Test:test_L1MessengerRelayMessageToSystemContract() (gas: 65858)
L1CrossDomainMessenger_Test:test_L1MessengerRelayMessageV0Fails() (gas: 33236) L1CrossDomainMessenger_Test:test_L1MessengerRelayMessageV0Fails() (gas: 33236)
L1CrossDomainMessenger_Test:test_L1MessengerRelayShouldRevertIfPaused() (gas: 60475) L1CrossDomainMessenger_Test:test_L1MessengerRelayShouldRevertIfPaused() (gas: 60475)
L1CrossDomainMessenger_Test:test_L1MessengerReplayMessageWithValue() (gas: 38192) L1CrossDomainMessenger_Test:test_L1MessengerReplayMessageWithValue() (gas: 38192)
...@@ -55,7 +55,7 @@ L1CrossDomainMessenger_Test:test_L1MessengerSendMessage() (gas: 299569) ...@@ -55,7 +55,7 @@ L1CrossDomainMessenger_Test:test_L1MessengerSendMessage() (gas: 299569)
L1CrossDomainMessenger_Test:test_L1MessengerTwiceSendMessage() (gas: 1490463) L1CrossDomainMessenger_Test:test_L1MessengerTwiceSendMessage() (gas: 1490463)
L1CrossDomainMessenger_Test:test_L1MessengerUnpause() (gas: 45186) L1CrossDomainMessenger_Test:test_L1MessengerUnpause() (gas: 45186)
L1CrossDomainMessenger_Test:test_L1MessengerXDomainSenderReverts() (gas: 24232) L1CrossDomainMessenger_Test:test_L1MessengerXDomainSenderReverts() (gas: 24232)
L1CrossDomainMessenger_Test:test_L1MessengerxDomainMessageSenderResets() (gas: 84079) L1CrossDomainMessenger_Test:test_L1MessengerxDomainMessageSenderResets() (gas: 84056)
L1StandardBridge_DepositERC20To_Test:test_depositERC20To_success() (gas: 575965) L1StandardBridge_DepositERC20To_Test:test_depositERC20To_success() (gas: 575965)
L1StandardBridge_DepositERC20_Test:test_depositERC20_succeeds() (gas: 573789) L1StandardBridge_DepositERC20_Test:test_depositERC20_succeeds() (gas: 573789)
L1StandardBridge_DepositERC20_TestFail:test_depositERC20_revert_notEoa() (gas: 22298) L1StandardBridge_DepositERC20_TestFail:test_depositERC20_revert_notEoa() (gas: 22298)
...@@ -85,28 +85,32 @@ L2CrossDomainMessenger_Test:test_L2MessengerSendMessage() (gas: 122423) ...@@ -85,28 +85,32 @@ L2CrossDomainMessenger_Test:test_L2MessengerSendMessage() (gas: 122423)
L2CrossDomainMessenger_Test:test_L2MessengerTwiceSendMessage() (gas: 134632) L2CrossDomainMessenger_Test:test_L2MessengerTwiceSendMessage() (gas: 134632)
L2CrossDomainMessenger_Test:test_L2MessengerXDomainSenderReverts() (gas: 10568) L2CrossDomainMessenger_Test:test_L2MessengerXDomainSenderReverts() (gas: 10568)
L2CrossDomainMessenger_Test:test_L2MessengerxDomainMessageSenderResets() (gas: 52615) L2CrossDomainMessenger_Test:test_L2MessengerxDomainMessageSenderResets() (gas: 52615)
L2OutputOracleTest:testCannot_ProposeWithUnmatchedBlockhash() (gas: 29072) L2OutputOracleTest:testCannot_ProposeWithUnmatchedBlockhash() (gas: 29434)
L2OutputOracleTest:testCannot_constructWithBadTimestamp() (gas: 70566) L2OutputOracleTest:testCannot_constructWithBadTimestamp() (gas: 70674)
L2OutputOracleTest:testCannot_deleteL2Outputs_afterLatest() (gas: 195025) L2OutputOracleTest:testCannot_deleteL2Outputs_afterLatest() (gas: 200324)
L2OutputOracleTest:testCannot_deleteL2Outputs_ifNotChallenger() (gas: 16716) L2OutputOracleTest:testCannot_deleteL2Outputs_ifNotChallenger() (gas: 18915)
L2OutputOracleTest:testCannot_deleteL2Outputs_nonExistent() (gas: 86795) L2OutputOracleTest:testCannot_deleteL2Outputs_nonExistent() (gas: 103509)
L2OutputOracleTest:testCannot_proposeEmptyOutput() (gas: 26359) L2OutputOracleTest:testCannot_proposeEmptyOutput() (gas: 26721)
L2OutputOracleTest:testCannot_proposeFutureTimetamp() (gas: 28316) L2OutputOracleTest:testCannot_proposeFutureTimetamp() (gas: 28678)
L2OutputOracleTest:testCannot_proposeL2Output_ifNotProposer() (gas: 25601) L2OutputOracleTest:testCannot_proposeL2Output_ifNotProposer() (gas: 25782)
L2OutputOracleTest:testCannot_proposeOnWrongFork() (gas: 28645) L2OutputOracleTest:testCannot_proposeOnWrongFork() (gas: 28941)
L2OutputOracleTest:testCannot_proposeUnexpectedBlockNumber() (gas: 28020) L2OutputOracleTest:testCannot_proposeUnexpectedBlockNumber() (gas: 28382)
L2OutputOracleTest:test_computeL2Timestamp() (gas: 37163) L2OutputOracleTest:test_computeL2Timestamp() (gas: 37185)
L2OutputOracleTest:test_constructor() (gas: 33592) L2OutputOracleTest:test_constructor() (gas: 33715)
L2OutputOracleTest:test_deleteOutputs_multipleOutputs() (gas: 258025) L2OutputOracleTest:test_deleteOutputs_multipleOutputs() (gas: 286718)
L2OutputOracleTest:test_deleteOutputs_singleOutput() (gas: 148182) L2OutputOracleTest:test_deleteOutputs_singleOutput() (gas: 173018)
L2OutputOracleTest:test_getL2Output() (gas: 87205) L2OutputOracleTest:test_getL2Output() (gas: 101700)
L2OutputOracleTest:test_latestBlockNumber() (gas: 78460) L2OutputOracleTest:test_getL2OutputIndexAfter_multipleOutputsExist() (gas: 267181)
L2OutputOracleTest:test_nextBlockNumber() (gas: 15143) L2OutputOracleTest:test_getL2OutputIndexAfter_noOutputsExist() (gas: 17938)
L2OutputOracleTest:test_proposeWithBlockhashAndHeight() (gas: 77309) L2OutputOracleTest:test_getL2OutputIndexAfter_previousBlock_succeeds() (gas: 96086)
L2OutputOracleTest:test_proposingAnotherOutput() (gas: 79089) L2OutputOracleTest:test_getL2OutputIndexAfter_sameBlock_succeeds() (gas: 95994)
L2OutputOracleTest:test_latestBlockNumber() (gas: 96937)
L2OutputOracleTest:test_nextBlockNumber() (gas: 17468)
L2OutputOracleTest:test_proposeWithBlockhashAndHeight() (gas: 95251)
L2OutputOracleTest:test_proposingAnotherOutput() (gas: 97175)
L2OutputOracleUpgradeable_Test:test_cannotInitImpl() (gas: 15171) L2OutputOracleUpgradeable_Test:test_cannotInitImpl() (gas: 15171)
L2OutputOracleUpgradeable_Test:test_cannotInitProxy() (gas: 20152) L2OutputOracleUpgradeable_Test:test_cannotInitProxy() (gas: 20152)
L2OutputOracleUpgradeable_Test:test_initValuesOnProxy() (gas: 26095) L2OutputOracleUpgradeable_Test:test_initValuesOnProxy() (gas: 26052)
L2OutputOracleUpgradeable_Test:test_upgrading() (gas: 180457) L2OutputOracleUpgradeable_Test:test_upgrading() (gas: 180457)
L2StandardBridge_Test:test_cannotWithdrawEthWithoutSendingIt() (gas: 19621) L2StandardBridge_Test:test_cannotWithdrawEthWithoutSendingIt() (gas: 19621)
L2StandardBridge_Test:test_finalizeBridgeETH_incorrectValueReverts() (gas: 23733) L2StandardBridge_Test:test_finalizeBridgeETH_incorrectValueReverts() (gas: 23733)
...@@ -145,40 +149,40 @@ OptimismMintableTokenFactory_Test:test_bridge() (gas: 7577) ...@@ -145,40 +149,40 @@ OptimismMintableTokenFactory_Test:test_bridge() (gas: 7577)
OptimismMintableTokenFactory_Test:test_createStandardL2Token() (gas: 1095274) OptimismMintableTokenFactory_Test:test_createStandardL2Token() (gas: 1095274)
OptimismMintableTokenFactory_Test:test_createStandardL2TokenSameTwice() (gas: 2176691) OptimismMintableTokenFactory_Test:test_createStandardL2TokenSameTwice() (gas: 2176691)
OptimismMintableTokenFactory_Test:test_createStandardL2TokenShouldRevertIfRemoteIsZero() (gas: 9413) OptimismMintableTokenFactory_Test:test_createStandardL2TokenShouldRevertIfRemoteIsZero() (gas: 9413)
OptimismPortalUpgradeable_Test:test_initialize_cannotInitImpl_reverts() (gas: 10791) OptimismPortalUpgradeable_Test:test_initialize_cannotInitImpl_reverts() (gas: 10813)
OptimismPortalUpgradeable_Test:test_initialize_cannotInitProxy_reverts() (gas: 15767) OptimismPortalUpgradeable_Test:test_initialize_cannotInitProxy_reverts() (gas: 15789)
OptimismPortalUpgradeable_Test:test_params_initValuesOnProxy_success() (gas: 16010) OptimismPortalUpgradeable_Test:test_params_initValuesOnProxy_success() (gas: 16010)
OptimismPortalUpgradeable_Test:test_upgradeToAndCall_upgrading_success() (gas: 180435) OptimismPortalUpgradeable_Test:test_upgradeToAndCall_upgrading_success() (gas: 180435)
OptimismPortal_FinalizeWithdrawal_Test:test_finalizeWithdrawalTransaction_ifOutputRootChanges_reverts() (gas: 199455) OptimismPortal_FinalizeWithdrawal_Test:test_finalizeWithdrawalTransaction_ifOutputRootChanges_reverts() (gas: 199749)
OptimismPortal_FinalizeWithdrawal_Test:test_finalizeWithdrawalTransaction_ifOutputTimestampIsNotFinalized_reverts() (gas: 201655) OptimismPortal_FinalizeWithdrawal_Test:test_finalizeWithdrawalTransaction_ifOutputTimestampIsNotFinalized_reverts() (gas: 202002)
OptimismPortal_FinalizeWithdrawal_Test:test_finalizeWithdrawalTransaction_ifWithdrawalNotProven_reverts() (gas: 39634) OptimismPortal_FinalizeWithdrawal_Test:test_finalizeWithdrawalTransaction_ifWithdrawalNotProven_reverts() (gas: 39656)
OptimismPortal_FinalizeWithdrawal_Test:test_finalizeWithdrawalTransaction_ifWithdrawalProofNotOldEnough_reverts() (gas: 197131) OptimismPortal_FinalizeWithdrawal_Test:test_finalizeWithdrawalTransaction_ifWithdrawalProofNotOldEnough_reverts() (gas: 197091)
OptimismPortal_FinalizeWithdrawal_Test:test_finalizeWithdrawalTransaction_onInsufficientGas_reverts() (gas: 195340) OptimismPortal_FinalizeWithdrawal_Test:test_finalizeWithdrawalTransaction_onInsufficientGas_reverts() (gas: 197813)
OptimismPortal_FinalizeWithdrawal_Test:test_finalizeWithdrawalTransaction_onRecentWithdrawal_reverts() (gas: 175375) OptimismPortal_FinalizeWithdrawal_Test:test_finalizeWithdrawalTransaction_onRecentWithdrawal_reverts() (gas: 177828)
OptimismPortal_FinalizeWithdrawal_Test:test_finalizeWithdrawalTransaction_onReentrancy_reverts() (gas: 235617) OptimismPortal_FinalizeWithdrawal_Test:test_finalizeWithdrawalTransaction_onReentrancy_reverts() (gas: 236176)
OptimismPortal_FinalizeWithdrawal_Test:test_finalizeWithdrawalTransaction_onReplay_reverts() (gas: 239873) OptimismPortal_FinalizeWithdrawal_Test:test_finalizeWithdrawalTransaction_onReplay_reverts() (gas: 237807)
OptimismPortal_FinalizeWithdrawal_Test:test_finalizeWithdrawalTransaction_provenWithdrawalHash_success() (gas: 231564) OptimismPortal_FinalizeWithdrawal_Test:test_finalizeWithdrawalTransaction_provenWithdrawalHash_success() (gas: 229533)
OptimismPortal_FinalizeWithdrawal_Test:test_finalizeWithdrawalTransaction_targetFails_fails() (gas: 334179) OptimismPortal_FinalizeWithdrawal_Test:test_finalizeWithdrawalTransaction_targetFails_fails() (gas: 332148)
OptimismPortal_FinalizeWithdrawal_Test:test_finalizeWithdrawalTransaction_timestampLessThanL2OracleStart_reverts() (gas: 195745) OptimismPortal_FinalizeWithdrawal_Test:test_finalizeWithdrawalTransaction_timestampLessThanL2OracleStart_reverts() (gas: 193771)
OptimismPortal_FinalizeWithdrawal_Test:test_proveWithdrawalTransaction_onInvalidOutputRootProof_reverts() (gas: 85517) OptimismPortal_FinalizeWithdrawal_Test:test_proveWithdrawalTransaction_onInvalidOutputRootProof_reverts() (gas: 83520)
OptimismPortal_FinalizeWithdrawal_Test:test_proveWithdrawalTransaction_onSelfCall_reverts() (gas: 50754) OptimismPortal_FinalizeWithdrawal_Test:test_proveWithdrawalTransaction_onSelfCall_reverts() (gas: 50754)
OptimismPortal_FinalizeWithdrawal_Test:test_proveWithdrawalTransaction_oninvalidWithdrawalProof_reverts() (gas: 138775) OptimismPortal_FinalizeWithdrawal_Test:test_proveWithdrawalTransaction_oninvalidWithdrawalProof_reverts() (gas: 136780)
OptimismPortal_FinalizeWithdrawal_Test:test_proveWithdrawalTransaction_replayProveChangedOutputRoot_success() (gas: 279092) OptimismPortal_FinalizeWithdrawal_Test:test_proveWithdrawalTransaction_replayProveChangedOutputRoot_success() (gas: 277100)
OptimismPortal_FinalizeWithdrawal_Test:test_proveWithdrawalTransaction_replayProve_reverts() (gas: 191154) OptimismPortal_FinalizeWithdrawal_Test:test_proveWithdrawalTransaction_replayProve_reverts() (gas: 189161)
OptimismPortal_FinalizeWithdrawal_Test:test_proveWithdrawalTransaction_validWithdrawalProof_success() (gas: 181342) OptimismPortal_FinalizeWithdrawal_Test:test_proveWithdrawalTransaction_validWithdrawalProof_success() (gas: 179346)
OptimismPortal_Test:test_OptimismPortalConstructor() (gas: 17298) OptimismPortal_Test:test_OptimismPortalConstructor() (gas: 17253)
OptimismPortal_Test:test_OptimismPortalReceiveEth_success() (gas: 127483) OptimismPortal_Test:test_OptimismPortalReceiveEth_success() (gas: 127483)
OptimismPortal_Test:test_depositTransaction_NoValueContract_success() (gas: 76706) OptimismPortal_Test:test_depositTransaction_NoValueContract_success() (gas: 76684)
OptimismPortal_Test:test_depositTransaction_NoValueEOA_success() (gas: 76984) OptimismPortal_Test:test_depositTransaction_NoValueEOA_success() (gas: 76984)
OptimismPortal_Test:test_depositTransaction_contractCreation_reverts() (gas: 14245) OptimismPortal_Test:test_depositTransaction_contractCreation_reverts() (gas: 14245)
OptimismPortal_Test:test_depositTransaction_createWithZeroValueForContract_success() (gas: 76710) OptimismPortal_Test:test_depositTransaction_createWithZeroValueForContract_success() (gas: 76710)
OptimismPortal_Test:test_depositTransaction_createWithZeroValueForEOA_success() (gas: 77032) OptimismPortal_Test:test_depositTransaction_createWithZeroValueForEOA_success() (gas: 77032)
OptimismPortal_Test:test_depositTransaction_withEthValueAndContractContractCreation_success() (gas: 83712) OptimismPortal_Test:test_depositTransaction_withEthValueAndContractContractCreation_success() (gas: 83712)
OptimismPortal_Test:test_depositTransaction_withEthValueAndEOAContractCreation_success() (gas: 75852) OptimismPortal_Test:test_depositTransaction_withEthValueAndEOAContractCreation_success() (gas: 75875)
OptimismPortal_Test:test_depositTransaction_withEthValueFromContract_success() (gas: 83370) OptimismPortal_Test:test_depositTransaction_withEthValueFromContract_success() (gas: 83414)
OptimismPortal_Test:test_depositTransaction_withEthValueFromEOA_success() (gas: 83964) OptimismPortal_Test:test_depositTransaction_withEthValueFromEOA_success() (gas: 83942)
OptimismPortal_Test:test_isBlockFinalized_success() (gas: 107478) OptimismPortal_Test:test_isOutputFinalized_success() (gas: 119473)
OptimismPortal_Test:test_simple_isBlockFinalized_success() (gas: 24142) OptimismPortal_Test:test_simple_isOutputFinalized_success() (gas: 24186)
Proxy_Test:test_clashingFunctionSignatures() (gas: 101347) Proxy_Test:test_clashingFunctionSignatures() (gas: 101347)
Proxy_Test:test_implementationKey() (gas: 20887) Proxy_Test:test_implementationKey() (gas: 20887)
Proxy_Test:test_implementationProxyCallIfNotAdmin() (gas: 29963) Proxy_Test:test_implementationProxyCallIfNotAdmin() (gas: 29963)
......
...@@ -64,21 +64,19 @@ ...@@ -64,21 +64,19 @@
➡ contracts/L1/L2OutputOracle.sol:L2OutputOracle ➡ contracts/L1/L2OutputOracle.sol:L2OutputOracle
======================= =======================
+---------------------+-------------------------------------------------+------+--------+-------+------------------------------------------------+ +---------------------+-------------------------------+------+--------+-------+------------------------------------------------+
| Name | Type | Slot | Offset | Bytes | Contract | | Name | Type | Slot | Offset | Bytes | Contract |
+================================================================================================================================================+ +==============================================================================================================================+
| _initialized | uint8 | 0 | 0 | 1 | contracts/L1/L2OutputOracle.sol:L2OutputOracle | | _initialized | uint8 | 0 | 0 | 1 | contracts/L1/L2OutputOracle.sol:L2OutputOracle |
|---------------------+-------------------------------------------------+------+--------+-------+------------------------------------------------| |---------------------+-------------------------------+------+--------+-------+------------------------------------------------|
| _initializing | bool | 0 | 1 | 1 | contracts/L1/L2OutputOracle.sol:L2OutputOracle | | _initializing | bool | 0 | 1 | 1 | contracts/L1/L2OutputOracle.sol:L2OutputOracle |
|---------------------+-------------------------------------------------+------+--------+-------+------------------------------------------------| |---------------------+-------------------------------+------+--------+-------+------------------------------------------------|
| startingBlockNumber | uint256 | 1 | 0 | 32 | contracts/L1/L2OutputOracle.sol:L2OutputOracle | | startingBlockNumber | uint256 | 1 | 0 | 32 | contracts/L1/L2OutputOracle.sol:L2OutputOracle |
|---------------------+-------------------------------------------------+------+--------+-------+------------------------------------------------| |---------------------+-------------------------------+------+--------+-------+------------------------------------------------|
| startingTimestamp | uint256 | 2 | 0 | 32 | contracts/L1/L2OutputOracle.sol:L2OutputOracle | | startingTimestamp | uint256 | 2 | 0 | 32 | contracts/L1/L2OutputOracle.sol:L2OutputOracle |
|---------------------+-------------------------------------------------+------+--------+-------+------------------------------------------------| |---------------------+-------------------------------+------+--------+-------+------------------------------------------------|
| latestBlockNumber | uint256 | 3 | 0 | 32 | contracts/L1/L2OutputOracle.sol:L2OutputOracle | | l2Outputs | struct Types.OutputProposal[] | 3 | 0 | 32 | contracts/L1/L2OutputOracle.sol:L2OutputOracle |
|---------------------+-------------------------------------------------+------+--------+-------+------------------------------------------------| +---------------------+-------------------------------+------+--------+-------+------------------------------------------------+
| l2Outputs | mapping(uint256 => struct Types.OutputProposal) | 4 | 0 | 32 | contracts/L1/L2OutputOracle.sol:L2OutputOracle |
+---------------------+-------------------------------------------------+------+--------+-------+------------------------------------------------+
======================= =======================
➡ contracts/L1/OptimismPortal.sol:OptimismPortal ➡ contracts/L1/OptimismPortal.sol:OptimismPortal
......
...@@ -15,12 +15,13 @@ import { Types } from "../libraries/Types.sol"; ...@@ -15,12 +15,13 @@ import { Types } from "../libraries/Types.sol";
// slither-disable-next-line locked-ether // slither-disable-next-line locked-ether
contract L2OutputOracle is Initializable, Semver { contract L2OutputOracle is Initializable, Semver {
/** /**
* @notice The interval in L2 blocks at which checkpoints must be submitted. * @notice The interval in L2 blocks at which checkpoints must be submitted. Although this is
* immutable, it can safely be modified by upgrading the implementation contract.
*/ */
uint256 public immutable SUBMISSION_INTERVAL; uint256 public immutable SUBMISSION_INTERVAL;
/** /**
* @notice The time between L2 blocks in seconds. * @notice The time between L2 blocks in seconds. Once set, this value MUST NOT be modified.
*/ */
uint256 public immutable L2_BLOCK_TIME; uint256 public immutable L2_BLOCK_TIME;
...@@ -45,36 +46,32 @@ contract L2OutputOracle is Initializable, Semver { ...@@ -45,36 +46,32 @@ contract L2OutputOracle is Initializable, Semver {
uint256 public startingTimestamp; uint256 public startingTimestamp;
/** /**
* @notice The number of the most recent L2 block recorded in this contract. * @notice Array of L2 output proposals.
*/ */
uint256 public latestBlockNumber; Types.OutputProposal[] internal l2Outputs;
/**
* @notice A mapping from L2 block numbers to the respective output root. Note that these
* outputs should not be considered finalized until the finalization period (as defined
* in the Optimism Portal) has passed.
*/
mapping(uint256 => Types.OutputProposal) internal l2Outputs;
/** /**
* @notice Emitted when an output is proposed. * @notice Emitted when an output is proposed.
* *
* @param outputRoot The output root. * @param outputRoot The output root.
* @param l1Timestamp The L1 timestamp when proposed. * @param l2OutputIndex The index of the output in the l2Outputs array.
* @param l2BlockNumber The L2 block number of the output root. * @param l2BlockNumber The L2 block number of the output root.
* @param l1Timestamp The L1 timestamp when proposed.
*/ */
event OutputProposed( event OutputProposed(
bytes32 indexed outputRoot, bytes32 indexed outputRoot,
uint256 indexed l1Timestamp, uint256 indexed l2OutputIndex,
uint256 indexed l2BlockNumber uint256 indexed l2BlockNumber,
uint256 l1Timestamp
); );
/** /**
* @notice Emitted when outputs are deleted. * @notice Emitted when outputs are deleted.
* *
* @param l2BlockNumber First L2 block number deleted. * @param prevNextOutputIndex Next L2 output index before the deletion.
* @param newNextOutputIndex Next L2 output index after the deletion.
*/ */
event OutputsDeleted(uint256 indexed l2BlockNumber); event OutputsDeleted(uint256 indexed prevNextOutputIndex, uint256 indexed newNextOutputIndex);
/** /**
* @custom:semver 0.0.1 * @custom:semver 0.0.1
...@@ -119,43 +116,36 @@ contract L2OutputOracle is Initializable, Semver { ...@@ -119,43 +116,36 @@ contract L2OutputOracle is Initializable, Semver {
startingTimestamp = _startingTimestamp; startingTimestamp = _startingTimestamp;
startingBlockNumber = _startingBlockNumber; startingBlockNumber = _startingBlockNumber;
latestBlockNumber = _startingBlockNumber;
} }
/** /**
* @notice Deletes all output proposals after and including the proposal that corresponds to * @notice Deletes all output proposals after and including the proposal that corresponds to
* the given block number. Only the challenger address can delete outputs. * the given output index. Only the challenger address can delete outputs.
* *
* @param _l2BlockNumber L2 block number of the first output root to delete. * @param _l2OutputIndex Index of the first L2 output to be deleted. All outputs after this
* output will also be deleted.
*/ */
// solhint-disable-next-line ordering // solhint-disable-next-line ordering
function deleteL2Outputs(uint256 _l2BlockNumber) external { function deleteL2Outputs(uint256 _l2OutputIndex) external {
require( require(
msg.sender == CHALLENGER, msg.sender == CHALLENGER,
"L2OutputOracle: only the challenger address can delete outputs" "L2OutputOracle: only the challenger address can delete outputs"
); );
// Simple check that accomplishes two things: // Make sure we're not *increasing* the length of the array.
// 1. Prevents deleting anything before (and including) the starting block.
// 2. Prevents deleting anything other than a checkpoint block.
require( require(
l2Outputs[_l2BlockNumber].outputRoot != bytes32(0), _l2OutputIndex < l2Outputs.length,
"L2OutputOracle: cannot delete a non-existent output" "L2OutputOracle: cannot delete outputs after the latest output index"
); );
// Prevent deleting beyond latest block number. Above check will miss this case if we uint256 prevNextL2OutputIndex = nextOutputIndex();
// already deleted an output and then the user tries to delete a later output.
require(
_l2BlockNumber <= latestBlockNumber,
"L2OutputOracle: cannot delete outputs after the latest block number"
);
// We're setting the latest block number back to the checkpoint block before the given L2 // Use assembly to delete the array elements because Solidity doesn't allow it.
// block number. Next proposal will overwrite the deleted output and following proposals assembly {
// will delete any outputs after that. sstore(l2Outputs.slot, _l2OutputIndex)
latestBlockNumber = _l2BlockNumber - SUBMISSION_INTERVAL; }
emit OutputsDeleted(_l2BlockNumber); emit OutputsDeleted(prevNextL2OutputIndex, _l2OutputIndex);
} }
/** /**
...@@ -165,13 +155,13 @@ contract L2OutputOracle is Initializable, Semver { ...@@ -165,13 +155,13 @@ contract L2OutputOracle is Initializable, Semver {
* *
* @param _outputRoot The L2 output of the checkpoint block. * @param _outputRoot The L2 output of the checkpoint block.
* @param _l2BlockNumber The L2 block number that resulted in _outputRoot. * @param _l2BlockNumber The L2 block number that resulted in _outputRoot.
* @param _l1Blockhash A block hash which must be included in the current chain. * @param _l1BlockHash A block hash which must be included in the current chain.
* @param _l1BlockNumber The block number with the specified block hash. * @param _l1BlockNumber The block number with the specified block hash.
*/ */
function proposeL2Output( function proposeL2Output(
bytes32 _outputRoot, bytes32 _outputRoot,
uint256 _l2BlockNumber, uint256 _l2BlockNumber,
bytes32 _l1Blockhash, bytes32 _l1BlockHash,
uint256 _l1BlockNumber uint256 _l1BlockNumber
) external payable { ) external payable {
require( require(
...@@ -194,7 +184,7 @@ contract L2OutputOracle is Initializable, Semver { ...@@ -194,7 +184,7 @@ contract L2OutputOracle is Initializable, Semver {
"L2OutputOracle: L2 output proposal cannot be the zero hash" "L2OutputOracle: L2 output proposal cannot be the zero hash"
); );
if (_l1Blockhash != bytes32(0)) { if (_l1BlockHash != bytes32(0)) {
// This check allows the proposer to propose an output based on a given L1 block, // This check allows the proposer to propose an output based on a given L1 block,
// without fear that it will be reorged out. // without fear that it will be reorged out.
// It will also revert if the blockheight provided is more than 256 blocks behind the // It will also revert if the blockheight provided is more than 256 blocks behind the
...@@ -204,59 +194,129 @@ contract L2OutputOracle is Initializable, Semver { ...@@ -204,59 +194,129 @@ contract L2OutputOracle is Initializable, Semver {
// blockhash value, and delay submission until it is confident that the L1 block is // blockhash value, and delay submission until it is confident that the L1 block is
// finalized. // finalized.
require( require(
blockhash(_l1BlockNumber) == _l1Blockhash, blockhash(_l1BlockNumber) == _l1BlockHash,
"L2OutputOracle: blockhash does not match the hash at the expected height" "L2OutputOracle: block hash does not match the hash at the expected height"
); );
} }
emit OutputProposed(_outputRoot, block.timestamp, _l2BlockNumber); emit OutputProposed(_outputRoot, nextOutputIndex(), block.timestamp, _l2BlockNumber);
l2Outputs[_l2BlockNumber] = Types.OutputProposal(_outputRoot, block.timestamp); l2Outputs.push(
latestBlockNumber = _l2BlockNumber; Types.OutputProposal({
outputRoot: _outputRoot,
timestamp: uint128(block.timestamp),
l2BlockNumber: uint128(_l2BlockNumber)
})
);
} }
/** /**
* @notice Returns the L2 output proposal associated with a target L2 block number. If the * @notice Returns an output by index. Exists because Solidity's array access will return a
* L2 block number provided is between checkpoints, this function will rerutn the next * tuple instead of a struct.
* proposal for the next checkpoint.
* Reverts if the output proposal is either not found, or predates
* the startingBlockNumber.
* *
* @param _l2BlockNumber The L2 block number of the target block. * @param _l2OutputIndex Index of the output to return.
*
* @return The output at the given index.
*/ */
function getL2Output(uint256 _l2BlockNumber) function getL2Output(uint256 _l2OutputIndex)
external external
view view
returns (Types.OutputProposal memory) returns (Types.OutputProposal memory)
{ {
return l2Outputs[_l2OutputIndex];
}
/**
* @notice Returns the index of the L2 output that checkpoints a given L2 block number. Uses a
* binary search to find the first output greater than or equal to the given block.
*
* @param _l2BlockNumber L2 block number to find a checkpoint for.
*
* @return Index of the first checkpoint that commits to the given L2 block number.
*/
function getL2OutputIndexAfter(uint256 _l2BlockNumber) public view returns (uint256) {
// Make sure an output for this block number has actually been proposed.
require( require(
_l2BlockNumber <= latestBlockNumber, _l2BlockNumber <= latestBlockNumber(),
"L2OutputOracle: block number cannot be greater than the latest block number" "L2OutputOracle: cannot get output for a block that has not been proposed"
); );
// Find the distance between _l2BlockNumber, and the checkpoint block before it. // Make sure there's at least one output proposed.
uint256 offset = (_l2BlockNumber - startingBlockNumber) % SUBMISSION_INTERVAL;
// If the offset is zero, then the _l2BlockNumber should be checkpointed.
// Otherwise, we'll look up the next block that will be checkpointed.
uint256 lookupBlockNumber = offset == 0
? _l2BlockNumber
: _l2BlockNumber + (SUBMISSION_INTERVAL - offset);
Types.OutputProposal memory output = l2Outputs[lookupBlockNumber];
require( require(
output.outputRoot != bytes32(0), l2Outputs.length > 0,
"L2OutputOracle: no output found for the given block number" "L2OutputOracle: cannot get output as no outputs have been proposed yet"
); );
return output; // Find the output via binary search, guaranteed to exist.
uint256 lo = 0;
uint256 hi = l2Outputs.length;
while (lo < hi) {
uint256 mid = (lo + hi) / 2;
if (l2Outputs[mid].l2BlockNumber < _l2BlockNumber) {
lo = mid + 1;
} else {
hi = mid;
}
}
return lo;
}
/**
* @notice Returns the L2 output proposal that checkpoints a given L2 block number. Uses a
* binary search to find the first output greater than or equal to the given block.
*
* @param _l2BlockNumber L2 block number to find a checkpoint for.
*
* @return First checkpoint that commits to the given L2 block number.
*/
function getL2OutputAfter(uint256 _l2BlockNumber)
external
view
returns (Types.OutputProposal memory)
{
return l2Outputs[getL2OutputIndexAfter(_l2BlockNumber)];
}
/**
* @notice Returns the number of outputs that have been proposed. Will revert if no outputs
* have been proposed yet.
*
* @return The number of outputs that have been proposed.
*/
function latestOutputIndex() external view returns (uint256) {
return l2Outputs.length - 1;
}
/**
* @notice Returns the index of the next output to be proposed.
*
* @return The index of the next output to be proposed.
*/
function nextOutputIndex() public view returns (uint256) {
return l2Outputs.length;
}
/**
* @notice Returns the block number of the latest submitted L2 output proposal. If no proposals
* been submitted yet then this function will return the starting block number.
*
* @return Latest submitted L2 block number.
*/
function latestBlockNumber() public view returns (uint256) {
return
l2Outputs.length == 0
? startingBlockNumber
: l2Outputs[l2Outputs.length - 1].l2BlockNumber;
} }
/** /**
* @notice Computes the block number of the next L2 block that needs to be checkpointed. * @notice Computes the block number of the next L2 block that needs to be checkpointed.
*
* @return Next L2 block number.
*/ */
function nextBlockNumber() public view returns (uint256) { function nextBlockNumber() public view returns (uint256) {
return latestBlockNumber + SUBMISSION_INTERVAL; return latestBlockNumber() + SUBMISSION_INTERVAL;
} }
/** /**
...@@ -265,6 +325,8 @@ contract L2OutputOracle is Initializable, Semver { ...@@ -265,6 +325,8 @@ contract L2OutputOracle is Initializable, Semver {
* timestamp of the previous checkpoint. * timestamp of the previous checkpoint.
* *
* @param _l2BlockNumber The L2 block number of the target block. * @param _l2BlockNumber The L2 block number of the target block.
*
* @return L2 timestamp of the given block.
*/ */
function computeL2Timestamp(uint256 _l2BlockNumber) public view returns (uint256) { function computeL2Timestamp(uint256 _l2BlockNumber) public view returns (uint256) {
return startingTimestamp + ((_l2BlockNumber - startingBlockNumber) * L2_BLOCK_TIME); return startingTimestamp + ((_l2BlockNumber - startingBlockNumber) * L2_BLOCK_TIME);
......
...@@ -25,7 +25,7 @@ contract OptimismPortal is Initializable, ResourceMetering, Semver { ...@@ -25,7 +25,7 @@ contract OptimismPortal is Initializable, ResourceMetering, Semver {
struct ProvenWithdrawal { struct ProvenWithdrawal {
bytes32 outputRoot; bytes32 outputRoot;
uint128 timestamp; uint128 timestamp;
uint128 l2BlockNumber; uint128 l2OutputIndex;
} }
/** /**
...@@ -153,13 +153,13 @@ contract OptimismPortal is Initializable, ResourceMetering, Semver { ...@@ -153,13 +153,13 @@ contract OptimismPortal is Initializable, ResourceMetering, Semver {
* @notice Proves a withdrawal transaction. * @notice Proves a withdrawal transaction.
* *
* @param _tx Withdrawal transaction to finalize. * @param _tx Withdrawal transaction to finalize.
* @param _l2BlockNumber L2 block number of the outputRoot. * @param _l2OutputIndex L2 output index to prove against.
* @param _outputRootProof Inclusion proof of the L2ToL1MessagePasser contract's storage root. * @param _outputRootProof Inclusion proof of the L2ToL1MessagePasser contract's storage root.
* @param _withdrawalProof Inclusion proof of the withdrawal in L2ToL1MessagePasser contract. * @param _withdrawalProof Inclusion proof of the withdrawal in L2ToL1MessagePasser contract.
*/ */
function proveWithdrawalTransaction( function proveWithdrawalTransaction(
Types.WithdrawalTransaction memory _tx, Types.WithdrawalTransaction memory _tx,
uint256 _l2BlockNumber, uint256 _l2OutputIndex,
Types.OutputRootProof calldata _outputRootProof, Types.OutputRootProof calldata _outputRootProof,
bytes[] calldata _withdrawalProof bytes[] calldata _withdrawalProof
) external { ) external {
...@@ -177,7 +177,7 @@ contract OptimismPortal is Initializable, ResourceMetering, Semver { ...@@ -177,7 +177,7 @@ contract OptimismPortal is Initializable, ResourceMetering, Semver {
// Get the output root and load onto the stack to prevent multiple mloads. This will // Get the output root and load onto the stack to prevent multiple mloads. This will
// fail if there is no output root for the given block number. // fail if there is no output root for the given block number.
bytes32 outputRoot = L2_ORACLE.getL2Output(_l2BlockNumber).outputRoot; bytes32 outputRoot = L2_ORACLE.getL2Output(_l2OutputIndex).outputRoot;
// Verify that the output root can be generated with the elements in the proof. // Verify that the output root can be generated with the elements in the proof.
require( require(
...@@ -195,7 +195,7 @@ contract OptimismPortal is Initializable, ResourceMetering, Semver { ...@@ -195,7 +195,7 @@ contract OptimismPortal is Initializable, ResourceMetering, Semver {
// Only allow re-proving a withdrawal transaction if the output root has changed. // Only allow re-proving a withdrawal transaction if the output root has changed.
require( require(
provenWithdrawal.timestamp == 0 || provenWithdrawal.timestamp == 0 ||
(_l2BlockNumber == provenWithdrawal.l2BlockNumber && (_l2OutputIndex == provenWithdrawal.l2OutputIndex &&
outputRoot != provenWithdrawal.outputRoot), outputRoot != provenWithdrawal.outputRoot),
"OptimismPortal: withdrawal hash has already been proven" "OptimismPortal: withdrawal hash has already been proven"
); );
...@@ -219,7 +219,7 @@ contract OptimismPortal is Initializable, ResourceMetering, Semver { ...@@ -219,7 +219,7 @@ contract OptimismPortal is Initializable, ResourceMetering, Semver {
provenWithdrawals[withdrawalHash] = ProvenWithdrawal({ provenWithdrawals[withdrawalHash] = ProvenWithdrawal({
outputRoot: outputRoot, outputRoot: outputRoot,
timestamp: uint128(block.timestamp), timestamp: uint128(block.timestamp),
l2BlockNumber: uint128(_l2BlockNumber) l2OutputIndex: uint128(_l2OutputIndex)
}); });
// Emit a `WithdrawalProven` event. // Emit a `WithdrawalProven` event.
...@@ -263,7 +263,7 @@ contract OptimismPortal is Initializable, ResourceMetering, Semver { ...@@ -263,7 +263,7 @@ contract OptimismPortal is Initializable, ResourceMetering, Semver {
// Grab the OutputProposal from the L2 Oracle // Grab the OutputProposal from the L2 Oracle
Types.OutputProposal memory proposal = L2_ORACLE.getL2Output( Types.OutputProposal memory proposal = L2_ORACLE.getL2Output(
provenWithdrawal.l2BlockNumber provenWithdrawal.l2OutputIndex
); );
// Check that the output proposal hasn't been updated. // Check that the output proposal hasn't been updated.
...@@ -313,13 +313,13 @@ contract OptimismPortal is Initializable, ResourceMetering, Semver { ...@@ -313,13 +313,13 @@ contract OptimismPortal is Initializable, ResourceMetering, Semver {
} }
/** /**
* @notice Determine if a given block number is finalized. Reverts if the call to * @notice Determine if a given output is finalized. Reverts if the call to
* L2_ORACLE.getL2Output reverts. Returns a boolean otherwise. * L2_ORACLE.getL2Output reverts. Returns a boolean otherwise.
* *
* @param _l2BlockNumber The number of the L2 block. * @param _l2OutputIndex Index of the L2 output to check.
*/ */
function isBlockFinalized(uint256 _l2BlockNumber) external view returns (bool) { function isOutputFinalized(uint256 _l2OutputIndex) external view returns (bool) {
return _isFinalizationPeriodElapsed(L2_ORACLE.getL2Output(_l2BlockNumber).timestamp); return _isFinalizationPeriodElapsed(L2_ORACLE.getL2Output(_l2OutputIndex).timestamp);
} }
/** /**
......
...@@ -13,7 +13,8 @@ library Types { ...@@ -13,7 +13,8 @@ library Types {
*/ */
struct OutputProposal { struct OutputProposal {
bytes32 outputRoot; bytes32 outputRoot;
uint256 timestamp; uint128 timestamp;
uint128 l2BlockNumber;
} }
/** /**
......
...@@ -129,10 +129,7 @@ contract L2OutputOracle_Initializer is CommonTest { ...@@ -129,10 +129,7 @@ contract L2OutputOracle_Initializer is CommonTest {
vm.prank(multisig); vm.prank(multisig);
proxy.upgradeToAndCall( proxy.upgradeToAndCall(
address(oracleImpl), address(oracleImpl),
abi.encodeCall( abi.encodeCall(L2OutputOracle.initialize, (startingBlockNumber, startingTimestamp))
L2OutputOracle.initialize,
(startingBlockNumber, startingTimestamp)
)
); );
oracle = L2OutputOracle(address(proxy)); oracle = L2OutputOracle(address(proxy));
vm.label(address(oracle), "L2OutputOracle"); vm.label(address(oracle), "L2OutputOracle");
......
...@@ -55,28 +55,89 @@ contract L2OutputOracleTest is L2OutputOracle_Initializer { ...@@ -55,28 +55,89 @@ contract L2OutputOracleTest is L2OutputOracle_Initializer {
// Test: getL2Output() should return the correct value // Test: getL2Output() should return the correct value
function test_getL2Output() external { function test_getL2Output() external {
uint256 nextBlockNumber = oracle.nextBlockNumber(); uint256 nextBlockNumber = oracle.nextBlockNumber();
uint256 nextOutputIndex = oracle.nextOutputIndex();
warpToProposeTime(nextBlockNumber); warpToProposeTime(nextBlockNumber);
vm.prank(proposer); vm.prank(proposer);
oracle.proposeL2Output(proposedOutput1, nextBlockNumber, 0, 0); oracle.proposeL2Output(proposedOutput1, nextBlockNumber, 0, 0);
Types.OutputProposal memory proposal = oracle.getL2Output(nextBlockNumber); Types.OutputProposal memory proposal = oracle.getL2Output(nextOutputIndex);
assertEq(proposal.outputRoot, proposedOutput1); assertEq(proposal.outputRoot, proposedOutput1);
assertEq(proposal.timestamp, block.timestamp); assertEq(proposal.timestamp, block.timestamp);
// Handles a block number that is between checkpoints: // The block number is larger than the latest proposed output:
proposal = oracle.getL2Output(nextBlockNumber - 1); vm.expectRevert(stdError.indexOOBError);
assertEq(proposal.outputRoot, proposedOutput1); oracle.getL2Output(nextOutputIndex + 1);
assertEq(proposal.timestamp, block.timestamp); }
// The block number is too low: // Test: getL2OutputIndexAfter() returns correct value when input is exact block
vm.expectRevert(stdError.arithmeticError); function test_getL2OutputIndexAfter_sameBlock_succeeds() external {
oracle.getL2Output(0); bytes32 output1 = keccak256(abi.encode(1));
uint256 nextBlockNumber1 = oracle.nextBlockNumber();
warpToProposeTime(nextBlockNumber1);
vm.prank(proposer);
oracle.proposeL2Output(output1, nextBlockNumber1, 0, 0);
// The block number is larger than the latest proposed output: // Querying with exact same block as proposed returns the proposal.
vm.expectRevert( uint256 index1 = oracle.getL2OutputIndexAfter(nextBlockNumber1);
"L2OutputOracle: block number cannot be greater than the latest block number" assertEq(index1, 0);
); }
oracle.getL2Output(nextBlockNumber + 1);
// Test: getL2OutputIndexAfter() returns correct value when input is previous block
function test_getL2OutputIndexAfter_previousBlock_succeeds() external {
bytes32 output1 = keccak256(abi.encode(1));
uint256 nextBlockNumber1 = oracle.nextBlockNumber();
warpToProposeTime(nextBlockNumber1);
vm.prank(proposer);
oracle.proposeL2Output(output1, nextBlockNumber1, 0, 0);
// Querying with previous block returns the proposal too.
uint256 index1 = oracle.getL2OutputIndexAfter(nextBlockNumber1 - 1);
assertEq(index1, 0);
}
// Test: getL2OutputIndexAfter() returns correct value during binary search
function test_getL2OutputIndexAfter_multipleOutputsExist() external {
bytes32 output1 = keccak256(abi.encode(1));
uint256 nextBlockNumber1 = oracle.nextBlockNumber();
warpToProposeTime(nextBlockNumber1);
vm.prank(proposer);
oracle.proposeL2Output(output1, nextBlockNumber1, 0, 0);
bytes32 output2 = keccak256(abi.encode(2));
uint256 nextBlockNumber2 = oracle.nextBlockNumber();
warpToProposeTime(nextBlockNumber2);
vm.prank(proposer);
oracle.proposeL2Output(output2, nextBlockNumber2, 0, 0);
bytes32 output3 = keccak256(abi.encode(3));
uint256 nextBlockNumber3 = oracle.nextBlockNumber();
warpToProposeTime(nextBlockNumber3);
vm.prank(proposer);
oracle.proposeL2Output(output3, nextBlockNumber3, 0, 0);
bytes32 output4 = keccak256(abi.encode(4));
uint256 nextBlockNumber4 = oracle.nextBlockNumber();
warpToProposeTime(nextBlockNumber4);
vm.prank(proposer);
oracle.proposeL2Output(output4, nextBlockNumber4, 0, 0);
// Querying with a block number between the first and second proposal
uint256 index1 = oracle.getL2OutputIndexAfter(nextBlockNumber1 + 1);
assertEq(index1, 1);
// Querying with a block number between the second and third proposal
uint256 index2 = oracle.getL2OutputIndexAfter(nextBlockNumber2 + 1);
assertEq(index2, 2);
// Querying with a block number between the third and fourth proposal
uint256 index3 = oracle.getL2OutputIndexAfter(nextBlockNumber3 + 1);
assertEq(index3, 3);
}
// Test: getL2OutputIndexAfter() reverts when no output exists yet
function test_getL2OutputIndexAfter_noOutputsExist() external {
vm.expectRevert("L2OutputOracle: cannot get output as no outputs have been proposed yet");
oracle.getL2OutputIndexAfter(0);
} }
// Test: nextBlockNumber() should return the correct value // Test: nextBlockNumber() should return the correct value
...@@ -192,7 +253,9 @@ contract L2OutputOracleTest is L2OutputOracle_Initializer { ...@@ -192,7 +253,9 @@ contract L2OutputOracleTest is L2OutputOracle_Initializer {
uint256 nextBlockNumber = oracle.nextBlockNumber(); uint256 nextBlockNumber = oracle.nextBlockNumber();
warpToProposeTime(nextBlockNumber); warpToProposeTime(nextBlockNumber);
vm.prank(proposer); vm.prank(proposer);
vm.expectRevert("L2OutputOracle: blockhash does not match the hash at the expected height"); vm.expectRevert(
"L2OutputOracle: block hash does not match the hash at the expected height"
);
oracle.proposeL2Output( oracle.proposeL2Output(
nonZeroHash, nonZeroHash,
nextBlockNumber, nextBlockNumber,
...@@ -216,7 +279,9 @@ contract L2OutputOracleTest is L2OutputOracle_Initializer { ...@@ -216,7 +279,9 @@ contract L2OutputOracleTest is L2OutputOracle_Initializer {
vm.prank(proposer); vm.prank(proposer);
// This will fail when foundry no longer returns zerod block hashes // This will fail when foundry no longer returns zerod block hashes
vm.expectRevert("L2OutputOracle: blockhash does not match the hash at the expected height"); vm.expectRevert(
"L2OutputOracle: block hash does not match the hash at the expected height"
);
oracle.proposeL2Output(nonZeroHash, nextBlockNumber, l1BlockHash, l1BlockNumber - 1); oracle.proposeL2Output(nonZeroHash, nextBlockNumber, l1BlockHash, l1BlockNumber - 1);
} }
...@@ -224,28 +289,28 @@ contract L2OutputOracleTest is L2OutputOracle_Initializer { ...@@ -224,28 +289,28 @@ contract L2OutputOracleTest is L2OutputOracle_Initializer {
* Delete Tests - Happy Path * * Delete Tests - Happy Path *
*****************************/ *****************************/
event OutputsDeleted(uint256 indexed l2BlockNumber); event OutputsDeleted(uint256 indexed prevNextOutputIndex, uint256 indexed newNextOutputIndex);
function test_deleteOutputs_singleOutput() external { function test_deleteOutputs_singleOutput() external {
test_proposingAnotherOutput(); test_proposingAnotherOutput();
test_proposingAnotherOutput(); test_proposingAnotherOutput();
uint256 latestBlockNumber = oracle.latestBlockNumber(); uint256 latestBlockNumber = oracle.latestBlockNumber();
Types.OutputProposal memory newLatestOutput = oracle.getL2Output( uint256 latestOutputIndex = oracle.latestOutputIndex();
latestBlockNumber - submissionInterval Types.OutputProposal memory newLatestOutput = oracle.getL2Output(latestOutputIndex - 1);
);
vm.prank(owner); vm.prank(owner);
vm.expectEmit(true, true, false, false); vm.expectEmit(true, true, false, false);
emit OutputsDeleted(latestBlockNumber); emit OutputsDeleted(latestOutputIndex + 1, latestOutputIndex);
oracle.deleteL2Outputs(latestBlockNumber); oracle.deleteL2Outputs(latestOutputIndex);
// validate latestBlockNumber has been reduced // validate latestBlockNumber has been reduced
uint256 latestBlockNumberAfter = oracle.latestBlockNumber(); uint256 latestBlockNumberAfter = oracle.latestBlockNumber();
uint256 latestOutputIndexAfter = oracle.latestOutputIndex();
assertEq(latestBlockNumber - submissionInterval, latestBlockNumberAfter); assertEq(latestBlockNumber - submissionInterval, latestBlockNumberAfter);
// validate that the new latest output is as expected. // validate that the new latest output is as expected.
Types.OutputProposal memory proposal = oracle.getL2Output(latestBlockNumberAfter); Types.OutputProposal memory proposal = oracle.getL2Output(latestOutputIndexAfter);
assertEq(newLatestOutput.outputRoot, proposal.outputRoot); assertEq(newLatestOutput.outputRoot, proposal.outputRoot);
assertEq(newLatestOutput.timestamp, proposal.timestamp); assertEq(newLatestOutput.timestamp, proposal.timestamp);
} }
...@@ -257,21 +322,21 @@ contract L2OutputOracleTest is L2OutputOracle_Initializer { ...@@ -257,21 +322,21 @@ contract L2OutputOracleTest is L2OutputOracle_Initializer {
test_proposingAnotherOutput(); test_proposingAnotherOutput();
uint256 latestBlockNumber = oracle.latestBlockNumber(); uint256 latestBlockNumber = oracle.latestBlockNumber();
Types.OutputProposal memory newLatestOutput = oracle.getL2Output( uint256 latestOutputIndex = oracle.latestOutputIndex();
latestBlockNumber - submissionInterval * 3 Types.OutputProposal memory newLatestOutput = oracle.getL2Output(latestOutputIndex - 3);
);
vm.prank(owner); vm.prank(owner);
vm.expectEmit(true, true, false, false); vm.expectEmit(true, true, false, false);
emit OutputsDeleted(latestBlockNumber - submissionInterval * 2); emit OutputsDeleted(latestOutputIndex + 1, latestOutputIndex - 2);
oracle.deleteL2Outputs(latestBlockNumber - submissionInterval * 2); oracle.deleteL2Outputs(latestOutputIndex - 2);
// validate latestBlockNumber has been reduced // validate latestBlockNumber has been reduced
uint256 latestBlockNumberAfter = oracle.latestBlockNumber(); uint256 latestBlockNumberAfter = oracle.latestBlockNumber();
uint256 latestOutputIndexAfter = oracle.latestOutputIndex();
assertEq(latestBlockNumber - submissionInterval * 3, latestBlockNumberAfter); assertEq(latestBlockNumber - submissionInterval * 3, latestBlockNumberAfter);
// validate that the new latest output is as expected. // validate that the new latest output is as expected.
Types.OutputProposal memory proposal = oracle.getL2Output(latestBlockNumberAfter); Types.OutputProposal memory proposal = oracle.getL2Output(latestOutputIndexAfter);
assertEq(newLatestOutput.outputRoot, proposal.outputRoot); assertEq(newLatestOutput.outputRoot, proposal.outputRoot);
assertEq(newLatestOutput.timestamp, proposal.timestamp); assertEq(newLatestOutput.timestamp, proposal.timestamp);
} }
...@@ -293,7 +358,7 @@ contract L2OutputOracleTest is L2OutputOracle_Initializer { ...@@ -293,7 +358,7 @@ contract L2OutputOracleTest is L2OutputOracle_Initializer {
uint256 latestBlockNumber = oracle.latestBlockNumber(); uint256 latestBlockNumber = oracle.latestBlockNumber();
vm.prank(owner); vm.prank(owner);
vm.expectRevert("L2OutputOracle: cannot delete a non-existent output"); vm.expectRevert("L2OutputOracle: cannot delete outputs after the latest output index");
oracle.deleteL2Outputs(latestBlockNumber + 1); oracle.deleteL2Outputs(latestBlockNumber + 1);
} }
...@@ -304,14 +369,14 @@ contract L2OutputOracleTest is L2OutputOracle_Initializer { ...@@ -304,14 +369,14 @@ contract L2OutputOracleTest is L2OutputOracle_Initializer {
test_proposingAnotherOutput(); test_proposingAnotherOutput();
// Delete the latest two outputs // Delete the latest two outputs
uint256 latestBlockNumber = oracle.latestBlockNumber(); uint256 latestOutputIndex = oracle.latestOutputIndex();
vm.prank(owner); vm.prank(owner);
oracle.deleteL2Outputs(latestBlockNumber - submissionInterval * 2); oracle.deleteL2Outputs(latestOutputIndex - 2);
// Now try to delete the same output again // Now try to delete the same output again
vm.prank(owner); vm.prank(owner);
vm.expectRevert("L2OutputOracle: cannot delete outputs after the latest block number"); vm.expectRevert("L2OutputOracle: cannot delete outputs after the latest output index");
oracle.deleteL2Outputs(latestBlockNumber - submissionInterval * 2); oracle.deleteL2Outputs(latestOutputIndex - 2);
} }
} }
...@@ -335,18 +400,12 @@ contract L2OutputOracleUpgradeable_Test is L2OutputOracle_Initializer { ...@@ -335,18 +400,12 @@ contract L2OutputOracleUpgradeable_Test is L2OutputOracle_Initializer {
function test_cannotInitProxy() external { function test_cannotInitProxy() external {
vm.expectRevert("Initializable: contract is already initialized"); vm.expectRevert("Initializable: contract is already initialized");
L2OutputOracle(payable(proxy)).initialize( L2OutputOracle(payable(proxy)).initialize(startingBlockNumber, startingTimestamp);
startingBlockNumber,
startingTimestamp
);
} }
function test_cannotInitImpl() external { function test_cannotInitImpl() external {
vm.expectRevert("Initializable: contract is already initialized"); vm.expectRevert("Initializable: contract is already initialized");
L2OutputOracle(oracleImpl).initialize( L2OutputOracle(oracleImpl).initialize(startingBlockNumber, startingTimestamp);
startingBlockNumber,
startingTimestamp
);
} }
function test_upgrading() external { function test_upgrading() external {
......
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
pragma solidity 0.8.15; pragma solidity 0.8.15;
import { stdError } from "forge-std/Test.sol";
import { Portal_Initializer, CommonTest, NextImpl } from "./CommonTest.t.sol"; import { Portal_Initializer, CommonTest, NextImpl } from "./CommonTest.t.sol";
import { AddressAliasHelper } from "../vendor/AddressAliasHelper.sol"; import { AddressAliasHelper } from "../vendor/AddressAliasHelper.sol";
import { L2OutputOracle } from "../L1/L2OutputOracle.sol"; import { L2OutputOracle } from "../L1/L2OutputOracle.sol";
...@@ -214,23 +215,28 @@ contract OptimismPortal_Test is Portal_Initializer { ...@@ -214,23 +215,28 @@ contract OptimismPortal_Test is Portal_Initializer {
assertEq(address(op).balance, NON_ZERO_VALUE); assertEq(address(op).balance, NON_ZERO_VALUE);
} }
function test_simple_isBlockFinalized_success() external { function test_simple_isOutputFinalized_success() external {
uint256 ts = block.timestamp;
vm.mockCall( vm.mockCall(
address(op.L2_ORACLE()), address(op.L2_ORACLE()),
abi.encodeWithSelector(L2OutputOracle.getL2Output.selector), abi.encodeWithSelector(L2OutputOracle.getL2Output.selector),
abi.encode(Types.OutputProposal(bytes32(uint256(1)), startingBlockNumber)) abi.encode(
Types.OutputProposal(bytes32(uint256(1)), uint128(ts), uint128(startingBlockNumber))
)
); );
// warp to the finalization period // warp to the finalization period
vm.warp(startingBlockNumber + op.FINALIZATION_PERIOD_SECONDS()); vm.warp(ts + op.FINALIZATION_PERIOD_SECONDS());
assertEq(op.isBlockFinalized(startingBlockNumber), false); assertEq(op.isOutputFinalized(0), false);
// warp past the finalization period // warp past the finalization period
vm.warp(startingBlockNumber + op.FINALIZATION_PERIOD_SECONDS() + 1); vm.warp(ts + op.FINALIZATION_PERIOD_SECONDS() + 1);
assertEq(op.isBlockFinalized(startingBlockNumber), true); assertEq(op.isOutputFinalized(0), true);
} }
function test_isBlockFinalized_success() external { function test_isOutputFinalized_success() external {
uint256 checkpoint = oracle.nextBlockNumber(); uint256 checkpoint = oracle.nextBlockNumber();
uint256 nextOutputIndex = oracle.nextOutputIndex();
vm.roll(checkpoint); vm.roll(checkpoint);
vm.warp(oracle.computeL2Timestamp(checkpoint) + 1); vm.warp(oracle.computeL2Timestamp(checkpoint) + 1);
vm.prank(oracle.PROPOSER()); vm.prank(oracle.PROPOSER());
...@@ -240,27 +246,18 @@ contract OptimismPortal_Test is Portal_Initializer { ...@@ -240,27 +246,18 @@ contract OptimismPortal_Test is Portal_Initializer {
uint256 finalizationHorizon = block.timestamp + op.FINALIZATION_PERIOD_SECONDS(); uint256 finalizationHorizon = block.timestamp + op.FINALIZATION_PERIOD_SECONDS();
vm.warp(finalizationHorizon); vm.warp(finalizationHorizon);
// The checkpointed block should not be finalized until 1 second from now. // The checkpointed block should not be finalized until 1 second from now.
assertEq(op.isBlockFinalized(checkpoint), false); assertEq(op.isOutputFinalized(nextOutputIndex), false);
// Nor should a block after it // Nor should a block after it
vm.expectRevert( vm.expectRevert(stdError.indexOOBError);
"L2OutputOracle: block number cannot be greater than the latest block number" assertEq(op.isOutputFinalized(nextOutputIndex + 1), false);
);
assertEq(op.isBlockFinalized(checkpoint + 1), false);
// Nor a block before it, even though the finalization period has passed, there is
// not yet a checkpoint block on top of it for which that is true.
assertEq(op.isBlockFinalized(checkpoint - 1), false);
// warp past the finalization period // warp past the finalization period
vm.warp(finalizationHorizon + 1); vm.warp(finalizationHorizon + 1);
// It should now be finalized. // It should now be finalized.
assertEq(op.isBlockFinalized(checkpoint), true); assertEq(op.isOutputFinalized(nextOutputIndex), true);
// So should the block before it.
assertEq(op.isBlockFinalized(checkpoint - 1), true);
// But not the block after it. // But not the block after it.
vm.expectRevert( vm.expectRevert(stdError.indexOOBError);
"L2OutputOracle: block number cannot be greater than the latest block number" assertEq(op.isOutputFinalized(nextOutputIndex + 1), false);
);
assertEq(op.isBlockFinalized(checkpoint + 1), false);
} }
} }
...@@ -268,6 +265,7 @@ contract OptimismPortal_FinalizeWithdrawal_Test is Portal_Initializer { ...@@ -268,6 +265,7 @@ contract OptimismPortal_FinalizeWithdrawal_Test is Portal_Initializer {
// Reusable default values for a test withdrawal // Reusable default values for a test withdrawal
Types.WithdrawalTransaction _defaultTx; Types.WithdrawalTransaction _defaultTx;
uint256 _proposedOutputIndex;
uint256 _proposedBlockNumber; uint256 _proposedBlockNumber;
bytes32 _stateRoot; bytes32 _stateRoot;
bytes32 _storageRoot; bytes32 _storageRoot;
...@@ -306,6 +304,7 @@ contract OptimismPortal_FinalizeWithdrawal_Test is Portal_Initializer { ...@@ -306,6 +304,7 @@ contract OptimismPortal_FinalizeWithdrawal_Test is Portal_Initializer {
latestBlockhash: bytes32(uint256(0)) latestBlockhash: bytes32(uint256(0))
}); });
_proposedBlockNumber = oracle.nextBlockNumber(); _proposedBlockNumber = oracle.nextBlockNumber();
_proposedOutputIndex = oracle.nextOutputIndex();
} }
// Get the system into a nice ready-to-use state. // Get the system into a nice ready-to-use state.
...@@ -317,7 +316,7 @@ contract OptimismPortal_FinalizeWithdrawal_Test is Portal_Initializer { ...@@ -317,7 +316,7 @@ contract OptimismPortal_FinalizeWithdrawal_Test is Portal_Initializer {
// Warp beyond the finalization period for the block we've proposed. // Warp beyond the finalization period for the block we've proposed.
vm.warp( vm.warp(
oracle.getL2Output(_proposedBlockNumber).timestamp + oracle.getL2Output(_proposedOutputIndex).timestamp +
op.FINALIZATION_PERIOD_SECONDS() + op.FINALIZATION_PERIOD_SECONDS() +
1 1
); );
...@@ -342,7 +341,7 @@ contract OptimismPortal_FinalizeWithdrawal_Test is Portal_Initializer { ...@@ -342,7 +341,7 @@ contract OptimismPortal_FinalizeWithdrawal_Test is Portal_Initializer {
vm.expectRevert("OptimismPortal: you cannot send messages to the portal contract"); vm.expectRevert("OptimismPortal: you cannot send messages to the portal contract");
op.proveWithdrawalTransaction( op.proveWithdrawalTransaction(
_defaultTx, _defaultTx,
_proposedBlockNumber, _proposedOutputIndex,
_outputRootProof, _outputRootProof,
_withdrawalProof _withdrawalProof
); );
...@@ -355,7 +354,7 @@ contract OptimismPortal_FinalizeWithdrawal_Test is Portal_Initializer { ...@@ -355,7 +354,7 @@ contract OptimismPortal_FinalizeWithdrawal_Test is Portal_Initializer {
vm.expectRevert("OptimismPortal: invalid output root proof"); vm.expectRevert("OptimismPortal: invalid output root proof");
op.proveWithdrawalTransaction( op.proveWithdrawalTransaction(
_defaultTx, _defaultTx,
_proposedBlockNumber, _proposedOutputIndex,
_outputRootProof, _outputRootProof,
_withdrawalProof _withdrawalProof
); );
...@@ -369,7 +368,7 @@ contract OptimismPortal_FinalizeWithdrawal_Test is Portal_Initializer { ...@@ -369,7 +368,7 @@ contract OptimismPortal_FinalizeWithdrawal_Test is Portal_Initializer {
vm.expectRevert("OptimismPortal: invalid withdrawal inclusion proof"); vm.expectRevert("OptimismPortal: invalid withdrawal inclusion proof");
op.proveWithdrawalTransaction( op.proveWithdrawalTransaction(
_defaultTx, _defaultTx,
_proposedBlockNumber, _proposedOutputIndex,
_outputRootProof, _outputRootProof,
_withdrawalProof _withdrawalProof
); );
...@@ -382,7 +381,7 @@ contract OptimismPortal_FinalizeWithdrawal_Test is Portal_Initializer { ...@@ -382,7 +381,7 @@ contract OptimismPortal_FinalizeWithdrawal_Test is Portal_Initializer {
emit WithdrawalProven(_withdrawalHash, alice, bob); emit WithdrawalProven(_withdrawalHash, alice, bob);
op.proveWithdrawalTransaction( op.proveWithdrawalTransaction(
_defaultTx, _defaultTx,
_proposedBlockNumber, _proposedOutputIndex,
_outputRootProof, _outputRootProof,
_withdrawalProof _withdrawalProof
); );
...@@ -390,7 +389,7 @@ contract OptimismPortal_FinalizeWithdrawal_Test is Portal_Initializer { ...@@ -390,7 +389,7 @@ contract OptimismPortal_FinalizeWithdrawal_Test is Portal_Initializer {
vm.expectRevert("OptimismPortal: withdrawal hash has already been proven"); vm.expectRevert("OptimismPortal: withdrawal hash has already been proven");
op.proveWithdrawalTransaction( op.proveWithdrawalTransaction(
_defaultTx, _defaultTx,
_proposedBlockNumber, _proposedOutputIndex,
_outputRootProof, _outputRootProof,
_withdrawalProof _withdrawalProof
); );
...@@ -403,7 +402,7 @@ contract OptimismPortal_FinalizeWithdrawal_Test is Portal_Initializer { ...@@ -403,7 +402,7 @@ contract OptimismPortal_FinalizeWithdrawal_Test is Portal_Initializer {
emit WithdrawalProven(_withdrawalHash, alice, bob); emit WithdrawalProven(_withdrawalHash, alice, bob);
op.proveWithdrawalTransaction( op.proveWithdrawalTransaction(
_defaultTx, _defaultTx,
_proposedBlockNumber, _proposedOutputIndex,
_outputRootProof, _outputRootProof,
_withdrawalProof _withdrawalProof
); );
...@@ -430,7 +429,7 @@ contract OptimismPortal_FinalizeWithdrawal_Test is Portal_Initializer { ...@@ -430,7 +429,7 @@ contract OptimismPortal_FinalizeWithdrawal_Test is Portal_Initializer {
emit WithdrawalProven(_withdrawalHash, alice, bob); emit WithdrawalProven(_withdrawalHash, alice, bob);
op.proveWithdrawalTransaction( op.proveWithdrawalTransaction(
_defaultTx, _defaultTx,
_proposedBlockNumber, _proposedOutputIndex,
_outputRootProof, _outputRootProof,
_withdrawalProof _withdrawalProof
); );
...@@ -446,7 +445,7 @@ contract OptimismPortal_FinalizeWithdrawal_Test is Portal_Initializer { ...@@ -446,7 +445,7 @@ contract OptimismPortal_FinalizeWithdrawal_Test is Portal_Initializer {
emit WithdrawalProven(_withdrawalHash, alice, bob); emit WithdrawalProven(_withdrawalHash, alice, bob);
op.proveWithdrawalTransaction( op.proveWithdrawalTransaction(
_defaultTx, _defaultTx,
_proposedBlockNumber, _proposedOutputIndex,
_outputRootProof, _outputRootProof,
_withdrawalProof _withdrawalProof
); );
...@@ -460,7 +459,7 @@ contract OptimismPortal_FinalizeWithdrawal_Test is Portal_Initializer { ...@@ -460,7 +459,7 @@ contract OptimismPortal_FinalizeWithdrawal_Test is Portal_Initializer {
emit WithdrawalProven(_withdrawalHash, alice, bob); emit WithdrawalProven(_withdrawalHash, alice, bob);
op.proveWithdrawalTransaction( op.proveWithdrawalTransaction(
_defaultTx, _defaultTx,
_proposedBlockNumber, _proposedOutputIndex,
_outputRootProof, _outputRootProof,
_withdrawalProof _withdrawalProof
); );
...@@ -491,7 +490,7 @@ contract OptimismPortal_FinalizeWithdrawal_Test is Portal_Initializer { ...@@ -491,7 +490,7 @@ contract OptimismPortal_FinalizeWithdrawal_Test is Portal_Initializer {
emit WithdrawalProven(_withdrawalHash, alice, bob); emit WithdrawalProven(_withdrawalHash, alice, bob);
op.proveWithdrawalTransaction( op.proveWithdrawalTransaction(
_defaultTx, _defaultTx,
_proposedBlockNumber, _proposedOutputIndex,
_outputRootProof, _outputRootProof,
_withdrawalProof _withdrawalProof
); );
...@@ -520,7 +519,7 @@ contract OptimismPortal_FinalizeWithdrawal_Test is Portal_Initializer { ...@@ -520,7 +519,7 @@ contract OptimismPortal_FinalizeWithdrawal_Test is Portal_Initializer {
emit WithdrawalProven(_withdrawalHash, alice, bob); emit WithdrawalProven(_withdrawalHash, alice, bob);
op.proveWithdrawalTransaction( op.proveWithdrawalTransaction(
_defaultTx, _defaultTx,
_proposedBlockNumber, _proposedOutputIndex,
_outputRootProof, _outputRootProof,
_withdrawalProof _withdrawalProof
); );
...@@ -555,7 +554,7 @@ contract OptimismPortal_FinalizeWithdrawal_Test is Portal_Initializer { ...@@ -555,7 +554,7 @@ contract OptimismPortal_FinalizeWithdrawal_Test is Portal_Initializer {
emit WithdrawalProven(_withdrawalHash, alice, bob); emit WithdrawalProven(_withdrawalHash, alice, bob);
op.proveWithdrawalTransaction( op.proveWithdrawalTransaction(
_defaultTx, _defaultTx,
_proposedBlockNumber, _proposedOutputIndex,
_outputRootProof, _outputRootProof,
_withdrawalProof _withdrawalProof
); );
...@@ -568,7 +567,13 @@ contract OptimismPortal_FinalizeWithdrawal_Test is Portal_Initializer { ...@@ -568,7 +567,13 @@ contract OptimismPortal_FinalizeWithdrawal_Test is Portal_Initializer {
vm.mockCall( vm.mockCall(
address(op.L2_ORACLE()), address(op.L2_ORACLE()),
abi.encodeWithSelector(L2OutputOracle.getL2Output.selector), abi.encodeWithSelector(L2OutputOracle.getL2Output.selector),
abi.encode(Types.OutputProposal(bytes32(uint256(0)), _proposedBlockNumber)) abi.encode(
Types.OutputProposal(
bytes32(uint256(0)),
uint128(block.timestamp),
uint128(_proposedBlockNumber)
)
)
); );
// Attempt to finalize the withdrawal // Attempt to finalize the withdrawal
...@@ -591,7 +596,7 @@ contract OptimismPortal_FinalizeWithdrawal_Test is Portal_Initializer { ...@@ -591,7 +596,7 @@ contract OptimismPortal_FinalizeWithdrawal_Test is Portal_Initializer {
emit WithdrawalProven(_withdrawalHash, alice, bob); emit WithdrawalProven(_withdrawalHash, alice, bob);
op.proveWithdrawalTransaction( op.proveWithdrawalTransaction(
_defaultTx, _defaultTx,
_proposedBlockNumber, _proposedOutputIndex,
_outputRootProof, _outputRootProof,
_withdrawalProof _withdrawalProof
); );
...@@ -604,7 +609,13 @@ contract OptimismPortal_FinalizeWithdrawal_Test is Portal_Initializer { ...@@ -604,7 +609,13 @@ contract OptimismPortal_FinalizeWithdrawal_Test is Portal_Initializer {
vm.mockCall( vm.mockCall(
address(op.L2_ORACLE()), address(op.L2_ORACLE()),
abi.encodeWithSelector(L2OutputOracle.getL2Output.selector), abi.encodeWithSelector(L2OutputOracle.getL2Output.selector),
abi.encode(Types.OutputProposal(_outputRoot, block.timestamp + 1)) abi.encode(
Types.OutputProposal(
_outputRoot,
uint128(block.timestamp + 1),
uint128(_proposedBlockNumber)
)
)
); );
// Attempt to finalize the withdrawal // Attempt to finalize the withdrawal
...@@ -625,7 +636,7 @@ contract OptimismPortal_FinalizeWithdrawal_Test is Portal_Initializer { ...@@ -625,7 +636,7 @@ contract OptimismPortal_FinalizeWithdrawal_Test is Portal_Initializer {
emit WithdrawalProven(_withdrawalHash, alice, bob); emit WithdrawalProven(_withdrawalHash, alice, bob);
op.proveWithdrawalTransaction( op.proveWithdrawalTransaction(
_defaultTx, _defaultTx,
_proposedBlockNumber, _proposedOutputIndex,
_outputRootProof, _outputRootProof,
_withdrawalProof _withdrawalProof
); );
...@@ -645,12 +656,18 @@ contract OptimismPortal_FinalizeWithdrawal_Test is Portal_Initializer { ...@@ -645,12 +656,18 @@ contract OptimismPortal_FinalizeWithdrawal_Test is Portal_Initializer {
vm.mockCall( vm.mockCall(
address(op.L2_ORACLE()), address(op.L2_ORACLE()),
abi.encodeWithSelector(L2OutputOracle.getL2Output.selector), abi.encodeWithSelector(L2OutputOracle.getL2Output.selector),
abi.encode(_outputRoot, recentTimestamp) abi.encode(
Types.OutputProposal(
_outputRoot,
uint128(recentTimestamp),
uint128(_proposedBlockNumber)
)
)
); );
op.proveWithdrawalTransaction( op.proveWithdrawalTransaction(
_defaultTx, _defaultTx,
_proposedBlockNumber, _proposedOutputIndex,
_outputRootProof, _outputRootProof,
_withdrawalProof _withdrawalProof
); );
...@@ -665,7 +682,7 @@ contract OptimismPortal_FinalizeWithdrawal_Test is Portal_Initializer { ...@@ -665,7 +682,7 @@ contract OptimismPortal_FinalizeWithdrawal_Test is Portal_Initializer {
emit WithdrawalProven(_withdrawalHash, alice, bob); emit WithdrawalProven(_withdrawalHash, alice, bob);
op.proveWithdrawalTransaction( op.proveWithdrawalTransaction(
_defaultTx, _defaultTx,
_proposedBlockNumber, _proposedOutputIndex,
_outputRootProof, _outputRootProof,
_withdrawalProof _withdrawalProof
); );
...@@ -705,12 +722,18 @@ contract OptimismPortal_FinalizeWithdrawal_Test is Portal_Initializer { ...@@ -705,12 +722,18 @@ contract OptimismPortal_FinalizeWithdrawal_Test is Portal_Initializer {
vm.mockCall( vm.mockCall(
address(op.L2_ORACLE()), address(op.L2_ORACLE()),
abi.encodeWithSelector(L2OutputOracle.getL2Output.selector), abi.encodeWithSelector(L2OutputOracle.getL2Output.selector),
abi.encode(Hashing.hashOutputRootProof(outputRootProof), _proposedBlockNumber) abi.encode(
Types.OutputProposal(
Hashing.hashOutputRootProof(outputRootProof),
uint128(block.timestamp),
uint128(_proposedBlockNumber)
)
)
); );
op.proveWithdrawalTransaction( op.proveWithdrawalTransaction(
insufficientGasTx, insufficientGasTx,
_proposedBlockNumber, _proposedOutputIndex,
outputRootProof, outputRootProof,
withdrawalProof withdrawalProof
); );
...@@ -751,7 +774,13 @@ contract OptimismPortal_FinalizeWithdrawal_Test is Portal_Initializer { ...@@ -751,7 +774,13 @@ contract OptimismPortal_FinalizeWithdrawal_Test is Portal_Initializer {
vm.mockCall( vm.mockCall(
address(op.L2_ORACLE()), address(op.L2_ORACLE()),
abi.encodeWithSelector(L2OutputOracle.getL2Output.selector), abi.encodeWithSelector(L2OutputOracle.getL2Output.selector),
abi.encode(Types.OutputProposal(outputRoot, finalizedTimestamp)) abi.encode(
Types.OutputProposal(
outputRoot,
uint128(finalizedTimestamp),
uint128(_proposedBlockNumber)
)
)
); );
vm.expectEmit(true, true, true, true); vm.expectEmit(true, true, true, true);
......
...@@ -17,6 +17,7 @@ export interface BedrockOutputData { ...@@ -17,6 +17,7 @@ export interface BedrockOutputData {
outputRoot: string outputRoot: string
l1Timestamp: number l1Timestamp: number
l2BlockNumber: number l2BlockNumber: number
l2OutputIndex: number
} }
/** /**
......
...@@ -962,37 +962,36 @@ export class CrossChainMessenger { ...@@ -962,37 +962,36 @@ export class CrossChainMessenger {
throw new Error(`cannot get a state root for an L1 to L2 message`) throw new Error(`cannot get a state root for an L1 to L2 message`)
} }
const l2OutputOracleParameters = await this.getL2OutputOracleParameters() // Try to find the output index that corresponds to the block number attached to the message.
// We'll explicitly handle "cannot get output" errors as a null return value, but anything else
// TODO: better way to do this // needs to get thrown. Might need to revisit this in the future to be a little more robust
let number = // when connected to RPCs that don't return nice error messages.
resolved.blockNumber - l2OutputOracleParameters.startingBlockNumber let l2OutputIndex: BigNumber
while (number % l2OutputOracleParameters.submissionInterval !== 0) { try {
number++ l2OutputIndex =
} await this.contracts.l1.L2OutputOracle.getL2OutputIndexAfter(
resolved.blockNumber
// TODO: Handle old messages from before Bedrock upgrade.
const events = await this.contracts.l1.L2OutputOracle.queryFilter(
this.contracts.l1.L2OutputOracle.filters.OutputProposed(
undefined,
undefined,
number
)
) )
} catch (err) {
if (events.length === 0) { if (err.message.includes('L2OutputOracle: cannot get output')) {
return null return null
} else {
throw err
} }
// Should not happen
if (events.length > 1) {
throw new Error(`multiple output roots found for message`)
} }
// Now pull the proposal out given the output index. Should always work as long as the above
// codepath completed successfully.
const proposal = await this.contracts.l1.L2OutputOracle.getL2Output(
l2OutputIndex
)
// Format everything and return it nicely.
return { return {
outputRoot: events[0].args.l2Output, outputRoot: proposal.outputRoot,
l1Timestamp: events[0].args.l1Timestamp.toNumber(), l1Timestamp: proposal.timestamp.toNumber(),
l2BlockNumber: events[0].args.l2BlockNumber.toNumber(), l2BlockNumber: proposal.l2BlockNumber.toNumber(),
l2OutputIndex: l2OutputIndex.toNumber(),
} }
} }
...@@ -1774,7 +1773,7 @@ export class CrossChainMessenger { ...@@ -1774,7 +1773,7 @@ export class CrossChainMessenger {
withdrawalTx.minGasLimit, withdrawalTx.minGasLimit,
withdrawalTx.message, withdrawalTx.message,
], ],
output.l2BlockNumber, output.l2OutputIndex,
[ [
proof.outputRootProof.version, proof.outputRootProof.version,
proof.outputRootProof.stateRoot, proof.outputRootProof.stateRoot,
......
...@@ -124,7 +124,7 @@ function deleteL2Output(bytes32 _l2Output) external ...@@ -124,7 +124,7 @@ function deleteL2Output(bytes32 _l2Output) external
/** /**
* @notice Computes the block number of the next L2 block that needs to be checkpointed. * @notice Computes the block number of the next L2 block that needs to be checkpointed.
*/ */
function nextBlockNumber() public view returns (uint256) { function getNextBlockNumber() public view returns (uint256) {
``` ```
## Security Considerations ## Security Considerations
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment