Commit c1153b27 authored by Mark Tyneway's avatar Mark Tyneway Committed by GitHub

Merge pull request #4876 from ethereum-optimism/clabby/ctb/l2oo-creation-check

fix(ctb): Add creation time check for `SUBMISSION_INTERVAL` > `L2_BLOCK_TIME`
parents e468b66e d648e97b
...@@ -38,7 +38,7 @@ type TypesOutputProposal struct { ...@@ -38,7 +38,7 @@ type TypesOutputProposal struct {
// 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\":\"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\"}]", 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: "0x6101606040523480156200001257600080fd5b506040516200188b3803806200188b833981016040819052620000359162000262565b6001608052600060a081905260c05260e08690526101008590526001600160a01b03808316610140528116610120526200007084846200007c565b505050505050620002bf565b600054610100900460ff16158080156200009d5750600054600160ff909116105b80620000cd5750620000ba306200023660201b620011031760201c565b158015620000cd575060005460ff166001145b620001365760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084015b60405180910390fd5b6000805460ff1916600117905580156200015a576000805461ff0019166101001790555b42821115620001e05760405162461bcd60e51b8152602060048201526044602482018190527f4c324f75747075744f7261636c653a207374617274696e67204c322074696d65908201527f7374616d70206d757374206265206c657373207468616e2063757272656e742060648201526374696d6560e01b608482015260a4016200012d565b60028290556001839055801562000231576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050565b6001600160a01b03163b151590565b80516001600160a01b03811681146200025d57600080fd5b919050565b60008060008060008060c087890312156200027c57600080fd5b86519550602087015194506040870151935060608701519250620002a36080880162000245565b9150620002b360a0880162000245565b90509295509295509295565b60805160a05160c05160e0516101005161012051610140516115556200033660003960008181610351015261090001526000818161021b015261074101526000818161013f0152610e3701526000818161019b0152610e85015260006104b40152600061048b0152600061046201526115556000f3fe6080604052600436106101285760003560e01c806388786272116100a5578063bffa7f0f11610074578063d1de856c11610059578063d1de856c14610393578063dcec3348146103b3578063e4a30116146103c857600080fd5b8063bffa7f0f1461033f578063cf8e5cf01461037357600080fd5b8063887862721461029857806389c44cbb146102ae5780639aaab648146102d0578063a25ae557146102e357600080fd5b806369f16eec116100fc5780636b4d98dd116100e15780636b4d98dd1461020957806370872aa5146102625780637f0064201461027857600080fd5b806369f16eec146101df5780636abcf563146101f457600080fd5b80622134cc1461012d5780634599c78814610174578063529933df1461018957806354fd4d50146101bd575b600080fd5b34801561013957600080fd5b506101617f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b34801561018057600080fd5b506101616103e8565b34801561019557600080fd5b506101617f000000000000000000000000000000000000000000000000000000000000000081565b3480156101c957600080fd5b506101d261045b565b60405161016b919061128c565b3480156101eb57600080fd5b506101616104fe565b34801561020057600080fd5b50600354610161565b34801561021557600080fd5b5061023d7f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200161016b565b34801561026e57600080fd5b5061016160015481565b34801561028457600080fd5b506101616102933660046112dd565b610510565b3480156102a457600080fd5b5061016160025481565b3480156102ba57600080fd5b506102ce6102c93660046112dd565b610729565b005b6102ce6102de3660046112f6565b6108e8565b3480156102ef57600080fd5b506103036102fe3660046112dd565b610d67565b60408051825181526020808401516fffffffffffffffffffffffffffffffff90811691830191909152928201519092169082015260600161016b565b34801561034b57600080fd5b5061023d7f000000000000000000000000000000000000000000000000000000000000000081565b34801561037f57600080fd5b5061030361038e3660046112dd565b610dfb565b34801561039f57600080fd5b506101616103ae3660046112dd565b610e33565b3480156103bf57600080fd5b50610161610e81565b3480156103d457600080fd5b506102ce6103e3366004611328565b610eb6565b60035460009015610452576003805461040390600190611379565b8154811061041357610413611390565b600091825260209091206002909102016001015470010000000000000000000000000000000090046fffffffffffffffffffffffffffffffff16919050565b6001545b905090565b60606104867f000000000000000000000000000000000000000000000000000000000000000061111f565b6104af7f000000000000000000000000000000000000000000000000000000000000000061111f565b6104d87f000000000000000000000000000000000000000000000000000000000000000061111f565b6040516020016104ea939291906113bf565b604051602081830303815290604052905090565b60035460009061045690600190611379565b600061051a6103e8565b8211156105d4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604860248201527f4c324f75747075744f7261636c653a2063616e6e6f7420676574206f7574707560448201527f7420666f72206120626c6f636b207468617420686173206e6f74206265656e2060648201527f70726f706f736564000000000000000000000000000000000000000000000000608482015260a4015b60405180910390fd5b600354610689576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604660248201527f4c324f75747075744f7261636c653a2063616e6e6f7420676574206f7574707560448201527f74206173206e6f206f7574707574732068617665206265656e2070726f706f7360648201527f6564207965740000000000000000000000000000000000000000000000000000608482015260a4016105cb565b6003546000905b8082101561072257600060026106a68385611435565b6106b0919061147c565b905084600382815481106106c6576106c6611390565b600091825260209091206002909102016001015470010000000000000000000000000000000090046fffffffffffffffffffffffffffffffff16101561071857610711816001611435565b925061071c565b8091505b50610690565b5092915050565b3373ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016146107ee576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603e60248201527f4c324f75747075744f7261636c653a206f6e6c7920746865206368616c6c656e60448201527f67657220616464726573732063616e2064656c657465206f757470757473000060648201526084016105cb565b60035481106108a5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604360248201527f4c324f75747075744f7261636c653a2063616e6e6f742064656c657465206f7560448201527f747075747320616674657220746865206c6174657374206f757470757420696e60648201527f6465780000000000000000000000000000000000000000000000000000000000608482015260a4016105cb565b60006108b060035490565b90508160035581817f4ee37ac2c786ec85e87592d3c5c8a1dd66f8496dda3f125d9ea8ca5f657629b660405160405180910390a35050565b3373ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016146109d3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604160248201527f4c324f75747075744f7261636c653a206f6e6c79207468652070726f706f736560448201527f7220616464726573732063616e2070726f706f7365206e6577206f757470757460648201527f7300000000000000000000000000000000000000000000000000000000000000608482015260a4016105cb565b6109db610e81565b8314610a8f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604860248201527f4c324f75747075744f7261636c653a20626c6f636b206e756d626572206d757360448201527f7420626520657175616c20746f206e65787420657870656374656420626c6f6360648201527f6b206e756d626572000000000000000000000000000000000000000000000000608482015260a4016105cb565b42610a9984610e33565b10610b26576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603660248201527f4c324f75747075744f7261636c653a2063616e6e6f742070726f706f7365204c60448201527f32206f757470757420696e20746865206675747572650000000000000000000060648201526084016105cb565b83610bb3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603a60248201527f4c324f75747075744f7261636c653a204c32206f75747075742070726f706f7360448201527f616c2063616e6e6f7420626520746865207a65726f206861736800000000000060648201526084016105cb565b8115610c6f5781814014610c6f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604960248201527f4c324f75747075744f7261636c653a20626c6f636b206861736820646f65732060448201527f6e6f74206d61746368207468652068617368206174207468652065787065637460648201527f6564206865696768740000000000000000000000000000000000000000000000608482015260a4016105cb565b82610c7960035490565b857fa7aaf2512769da4e444e3de247be2564225c2e7a8f74cfe528e46e17d24868e242604051610cab91815260200190565b60405180910390a45050604080516060810182529283526fffffffffffffffffffffffffffffffff4281166020850190815292811691840191825260038054600181018255600091909152935160029094027fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b810194909455915190518216700100000000000000000000000000000000029116177fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85c90910155565b604080516060810182526000808252602082018190529181019190915260038281548110610d9757610d97611390565b600091825260209182902060408051606081018252600290930290910180548352600101546fffffffffffffffffffffffffffffffff8082169484019490945270010000000000000000000000000000000090049092169181019190915292915050565b60408051606081018252600080825260208201819052918101919091526003610e2383610510565b81548110610d9757610d97611390565b60007f000000000000000000000000000000000000000000000000000000000000000060015483610e649190611379565b610e6e9190611490565b600254610e7b9190611435565b92915050565b60007f0000000000000000000000000000000000000000000000000000000000000000610eac6103e8565b6104569190611435565b600054610100900460ff1615808015610ed65750600054600160ff909116105b80610ef05750303b158015610ef0575060005460ff166001145b610f7c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a656400000000000000000000000000000000000060648201526084016105cb565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790558015610fda57600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b42821115611091576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526044602482018190527f4c324f75747075744f7261636c653a207374617274696e67204c322074696d65908201527f7374616d70206d757374206265206c657373207468616e2063757272656e742060648201527f74696d6500000000000000000000000000000000000000000000000000000000608482015260a4016105cb565b6002829055600183905580156110fe57600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050565b73ffffffffffffffffffffffffffffffffffffffff163b151590565b60608160000361116257505060408051808201909152600181527f3000000000000000000000000000000000000000000000000000000000000000602082015290565b8160005b811561118c5780611176816114cd565b91506111859050600a8361147c565b9150611166565b60008167ffffffffffffffff8111156111a7576111a7611505565b6040519080825280601f01601f1916602001820160405280156111d1576020820181803683370190505b5090505b8415611254576111e6600183611379565b91506111f3600a86611534565b6111fe906030611435565b60f81b81838151811061121357611213611390565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535061124d600a8661147c565b94506111d5565b949350505050565b60005b8381101561127757818101518382015260200161125f565b83811115611286576000848401525b50505050565b60208152600082518060208401526112ab81604085016020870161125c565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169190910160400192915050565b6000602082840312156112ef57600080fd5b5035919050565b6000806000806080858703121561130c57600080fd5b5050823594602084013594506040840135936060013592509050565b6000806040838503121561133b57600080fd5b50508035926020909101359150565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60008282101561138b5761138b61134a565b500390565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600084516113d181846020890161125c565b80830190507f2e00000000000000000000000000000000000000000000000000000000000000808252855161140d816001850160208a0161125c565b6001920191820152835161142881600284016020880161125c565b0160020195945050505050565b600082198211156114485761144861134a565b500190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60008261148b5761148b61144d565b500490565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156114c8576114c861134a565b500290565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036114fe576114fe61134a565b5060010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000826115435761154361144d565b50069056fea164736f6c634300080f000a", Bin: "0x6101606040523480156200001257600080fd5b50604051620019863803806200198683398101604081905262000035916200035d565b6001608081905260a052600060c05284620000bd5760405162461bcd60e51b815260206004820152603460248201527f4c324f75747075744f7261636c653a204c3220626c6f636b2074696d65206d7560448201527f73742062652067726561746572207468616e203000000000000000000000000060648201526084015b60405180910390fd5b848611620001435760405162461bcd60e51b815260206004820152604660248201527f4c324f75747075744f7261636c653a207375626d697373696f6e20696e74657260448201527f76616c206d7573742062652067726561746572207468616e204c3220626c6f636064820152656b2074696d6560d01b608482015260a401620000b4565b60e08690526101008590526001600160a01b03808316610140528116610120526200016f84846200017b565b505050505050620003ba565b600054610100900460ff16158080156200019c5750600054600160ff909116105b80620001cc5750620001b9306200033160201b620011031760201c565b158015620001cc575060005460ff166001145b620002315760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401620000b4565b6000805460ff19166001179055801562000255576000805461ff0019166101001790555b42821115620002db5760405162461bcd60e51b8152602060048201526044602482018190527f4c324f75747075744f7261636c653a207374617274696e67204c322074696d65908201527f7374616d70206d757374206265206c657373207468616e2063757272656e742060648201526374696d6560e01b608482015260a401620000b4565b6002829055600183905580156200032c576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050565b6001600160a01b03163b151590565b80516001600160a01b03811681146200035857600080fd5b919050565b60008060008060008060c087890312156200037757600080fd5b865195506020870151945060408701519350606087015192506200039e6080880162000340565b9150620003ae60a0880162000340565b90509295509295509295565b60805160a05160c05160e0516101005161012051610140516115556200043160003960008181610351015261090001526000818161021b015261074101526000818161013f0152610e3701526000818161019b0152610e85015260006104b40152600061048b0152600061046201526115556000f3fe6080604052600436106101285760003560e01c806388786272116100a5578063bffa7f0f11610074578063d1de856c11610059578063d1de856c14610393578063dcec3348146103b3578063e4a30116146103c857600080fd5b8063bffa7f0f1461033f578063cf8e5cf01461037357600080fd5b8063887862721461029857806389c44cbb146102ae5780639aaab648146102d0578063a25ae557146102e357600080fd5b806369f16eec116100fc5780636b4d98dd116100e15780636b4d98dd1461020957806370872aa5146102625780637f0064201461027857600080fd5b806369f16eec146101df5780636abcf563146101f457600080fd5b80622134cc1461012d5780634599c78814610174578063529933df1461018957806354fd4d50146101bd575b600080fd5b34801561013957600080fd5b506101617f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b34801561018057600080fd5b506101616103e8565b34801561019557600080fd5b506101617f000000000000000000000000000000000000000000000000000000000000000081565b3480156101c957600080fd5b506101d261045b565b60405161016b919061128c565b3480156101eb57600080fd5b506101616104fe565b34801561020057600080fd5b50600354610161565b34801561021557600080fd5b5061023d7f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200161016b565b34801561026e57600080fd5b5061016160015481565b34801561028457600080fd5b506101616102933660046112dd565b610510565b3480156102a457600080fd5b5061016160025481565b3480156102ba57600080fd5b506102ce6102c93660046112dd565b610729565b005b6102ce6102de3660046112f6565b6108e8565b3480156102ef57600080fd5b506103036102fe3660046112dd565b610d67565b60408051825181526020808401516fffffffffffffffffffffffffffffffff90811691830191909152928201519092169082015260600161016b565b34801561034b57600080fd5b5061023d7f000000000000000000000000000000000000000000000000000000000000000081565b34801561037f57600080fd5b5061030361038e3660046112dd565b610dfb565b34801561039f57600080fd5b506101616103ae3660046112dd565b610e33565b3480156103bf57600080fd5b50610161610e81565b3480156103d457600080fd5b506102ce6103e3366004611328565b610eb6565b60035460009015610452576003805461040390600190611379565b8154811061041357610413611390565b600091825260209091206002909102016001015470010000000000000000000000000000000090046fffffffffffffffffffffffffffffffff16919050565b6001545b905090565b60606104867f000000000000000000000000000000000000000000000000000000000000000061111f565b6104af7f000000000000000000000000000000000000000000000000000000000000000061111f565b6104d87f000000000000000000000000000000000000000000000000000000000000000061111f565b6040516020016104ea939291906113bf565b604051602081830303815290604052905090565b60035460009061045690600190611379565b600061051a6103e8565b8211156105d4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604860248201527f4c324f75747075744f7261636c653a2063616e6e6f7420676574206f7574707560448201527f7420666f72206120626c6f636b207468617420686173206e6f74206265656e2060648201527f70726f706f736564000000000000000000000000000000000000000000000000608482015260a4015b60405180910390fd5b600354610689576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604660248201527f4c324f75747075744f7261636c653a2063616e6e6f7420676574206f7574707560448201527f74206173206e6f206f7574707574732068617665206265656e2070726f706f7360648201527f6564207965740000000000000000000000000000000000000000000000000000608482015260a4016105cb565b6003546000905b8082101561072257600060026106a68385611435565b6106b0919061147c565b905084600382815481106106c6576106c6611390565b600091825260209091206002909102016001015470010000000000000000000000000000000090046fffffffffffffffffffffffffffffffff16101561071857610711816001611435565b925061071c565b8091505b50610690565b5092915050565b3373ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016146107ee576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603e60248201527f4c324f75747075744f7261636c653a206f6e6c7920746865206368616c6c656e60448201527f67657220616464726573732063616e2064656c657465206f757470757473000060648201526084016105cb565b60035481106108a5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604360248201527f4c324f75747075744f7261636c653a2063616e6e6f742064656c657465206f7560448201527f747075747320616674657220746865206c6174657374206f757470757420696e60648201527f6465780000000000000000000000000000000000000000000000000000000000608482015260a4016105cb565b60006108b060035490565b90508160035581817f4ee37ac2c786ec85e87592d3c5c8a1dd66f8496dda3f125d9ea8ca5f657629b660405160405180910390a35050565b3373ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016146109d3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604160248201527f4c324f75747075744f7261636c653a206f6e6c79207468652070726f706f736560448201527f7220616464726573732063616e2070726f706f7365206e6577206f757470757460648201527f7300000000000000000000000000000000000000000000000000000000000000608482015260a4016105cb565b6109db610e81565b8314610a8f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604860248201527f4c324f75747075744f7261636c653a20626c6f636b206e756d626572206d757360448201527f7420626520657175616c20746f206e65787420657870656374656420626c6f6360648201527f6b206e756d626572000000000000000000000000000000000000000000000000608482015260a4016105cb565b42610a9984610e33565b10610b26576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603660248201527f4c324f75747075744f7261636c653a2063616e6e6f742070726f706f7365204c60448201527f32206f757470757420696e20746865206675747572650000000000000000000060648201526084016105cb565b83610bb3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603a60248201527f4c324f75747075744f7261636c653a204c32206f75747075742070726f706f7360448201527f616c2063616e6e6f7420626520746865207a65726f206861736800000000000060648201526084016105cb565b8115610c6f5781814014610c6f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604960248201527f4c324f75747075744f7261636c653a20626c6f636b206861736820646f65732060448201527f6e6f74206d61746368207468652068617368206174207468652065787065637460648201527f6564206865696768740000000000000000000000000000000000000000000000608482015260a4016105cb565b82610c7960035490565b857fa7aaf2512769da4e444e3de247be2564225c2e7a8f74cfe528e46e17d24868e242604051610cab91815260200190565b60405180910390a45050604080516060810182529283526fffffffffffffffffffffffffffffffff4281166020850190815292811691840191825260038054600181018255600091909152935160029094027fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b810194909455915190518216700100000000000000000000000000000000029116177fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85c90910155565b604080516060810182526000808252602082018190529181019190915260038281548110610d9757610d97611390565b600091825260209182902060408051606081018252600290930290910180548352600101546fffffffffffffffffffffffffffffffff8082169484019490945270010000000000000000000000000000000090049092169181019190915292915050565b60408051606081018252600080825260208201819052918101919091526003610e2383610510565b81548110610d9757610d97611390565b60007f000000000000000000000000000000000000000000000000000000000000000060015483610e649190611379565b610e6e9190611490565b600254610e7b9190611435565b92915050565b60007f0000000000000000000000000000000000000000000000000000000000000000610eac6103e8565b6104569190611435565b600054610100900460ff1615808015610ed65750600054600160ff909116105b80610ef05750303b158015610ef0575060005460ff166001145b610f7c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a656400000000000000000000000000000000000060648201526084016105cb565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790558015610fda57600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b42821115611091576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526044602482018190527f4c324f75747075744f7261636c653a207374617274696e67204c322074696d65908201527f7374616d70206d757374206265206c657373207468616e2063757272656e742060648201527f74696d6500000000000000000000000000000000000000000000000000000000608482015260a4016105cb565b6002829055600183905580156110fe57600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050565b73ffffffffffffffffffffffffffffffffffffffff163b151590565b60608160000361116257505060408051808201909152600181527f3000000000000000000000000000000000000000000000000000000000000000602082015290565b8160005b811561118c5780611176816114cd565b91506111859050600a8361147c565b9150611166565b60008167ffffffffffffffff8111156111a7576111a7611505565b6040519080825280601f01601f1916602001820160405280156111d1576020820181803683370190505b5090505b8415611254576111e6600183611379565b91506111f3600a86611534565b6111fe906030611435565b60f81b81838151811061121357611213611390565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535061124d600a8661147c565b94506111d5565b949350505050565b60005b8381101561127757818101518382015260200161125f565b83811115611286576000848401525b50505050565b60208152600082518060208401526112ab81604085016020870161125c565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169190910160400192915050565b6000602082840312156112ef57600080fd5b5035919050565b6000806000806080858703121561130c57600080fd5b5050823594602084013594506040840135936060013592509050565b6000806040838503121561133b57600080fd5b50508035926020909101359150565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60008282101561138b5761138b61134a565b500390565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600084516113d181846020890161125c565b80830190507f2e00000000000000000000000000000000000000000000000000000000000000808252855161140d816001850160208a0161125c565b6001920191820152835161142881600284016020880161125c565b0160020195945050505050565b600082198211156114485761144861134a565b500190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60008261148b5761148b61144d565b500490565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156114c8576114c861134a565b500290565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036114fe576114fe61134a565b5060010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000826115435761154361144d565b50069056fea164736f6c634300080f000a",
} }
// L2OutputOracleABI is the input ABI used to generate the binding from. // L2OutputOracleABI is the input ABI used to generate the binding from.
......
...@@ -139,29 +139,30 @@ L2ERC721Bridge_Test:test_finalizeBridgeERC721_notFromRemoteMessenger_reverts() ( ...@@ -139,29 +139,30 @@ L2ERC721Bridge_Test:test_finalizeBridgeERC721_notFromRemoteMessenger_reverts() (
L2ERC721Bridge_Test:test_finalizeBridgeERC721_notViaLocalMessenger_reverts() (gas: 16148) L2ERC721Bridge_Test:test_finalizeBridgeERC721_notViaLocalMessenger_reverts() (gas: 16148)
L2ERC721Bridge_Test:test_finalizeBridgeERC721_selfToken_reverts() (gas: 17637) L2ERC721Bridge_Test:test_finalizeBridgeERC721_selfToken_reverts() (gas: 17637)
L2ERC721Bridge_Test:test_finalizeBridgeERC721_succeeds() (gas: 168905) L2ERC721Bridge_Test:test_finalizeBridgeERC721_succeeds() (gas: 168905)
L2OutputOracleTest:test_computeL2Timestamp_succeeds() (gas: 37184) L2OutputOracleTest:test_computeL2Timestamp_succeeds() (gas: 37206)
L2OutputOracleTest:test_constructor_badTimestamp_reverts() (gas: 70717) L2OutputOracleTest:test_constructor_badTimestamp_reverts() (gas: 70767)
L2OutputOracleTest:test_constructor_succeeds() (gas: 33760) L2OutputOracleTest:test_constructor_l2BlockTimeZero_reverts() (gas: 45786)
L2OutputOracleTest:test_deleteL2Outputs_afterLatest_reverts() (gas: 211900) L2OutputOracleTest:test_constructor_succeeds() (gas: 33695)
L2OutputOracleTest:test_deleteL2Outputs_afterLatest_reverts() (gas: 211855)
L2OutputOracleTest:test_deleteL2Outputs_ifNotChallenger_reverts() (gas: 18883) L2OutputOracleTest:test_deleteL2Outputs_ifNotChallenger_reverts() (gas: 18883)
L2OutputOracleTest:test_deleteL2Outputs_nonExistent_reverts() (gas: 107292) L2OutputOracleTest:test_deleteL2Outputs_nonExistent_reverts() (gas: 107292)
L2OutputOracleTest:test_deleteOutputs_multipleOutputs_succeeds() (gas: 302121) L2OutputOracleTest:test_deleteOutputs_multipleOutputs_succeeds() (gas: 302143)
L2OutputOracleTest:test_deleteOutputs_singleOutput_succeeds() (gas: 180656) L2OutputOracleTest:test_deleteOutputs_singleOutput_succeeds() (gas: 180700)
L2OutputOracleTest:test_getL2OutputIndexAfter_multipleOutputsExist_succeeds() (gas: 267182) L2OutputOracleTest:test_getL2OutputIndexAfter_multipleOutputsExist_succeeds() (gas: 267226)
L2OutputOracleTest:test_getL2OutputIndexAfter_noOutputsExis_reverts() (gas: 17914) L2OutputOracleTest:test_getL2OutputIndexAfter_noOutputsExis_reverts() (gas: 17936)
L2OutputOracleTest:test_getL2OutputIndexAfter_previousBlock_succeeds() (gas: 96086) L2OutputOracleTest:test_getL2OutputIndexAfter_previousBlock_succeeds() (gas: 96042)
L2OutputOracleTest:test_getL2OutputIndexAfter_sameBlock_succeeds() (gas: 95994) L2OutputOracleTest:test_getL2OutputIndexAfter_sameBlock_succeeds() (gas: 96016)
L2OutputOracleTest:test_getL2Output_succeeds() (gas: 101699) L2OutputOracleTest:test_getL2Output_succeeds() (gas: 101721)
L2OutputOracleTest:test_latestBlockNumber_succeeds() (gas: 96983) L2OutputOracleTest:test_latestBlockNumber_succeeds() (gas: 96960)
L2OutputOracleTest:test_nextBlockNumber_succeeds() (gas: 17468) L2OutputOracleTest:test_nextBlockNumber_succeeds() (gas: 17490)
L2OutputOracleTest:test_proposeL2Output_emptyOutput_reverts() (gas: 26688) L2OutputOracleTest:test_proposeL2Output_emptyOutput_reverts() (gas: 26710)
L2OutputOracleTest:test_proposeL2Output_futureTimetamp_reverts() (gas: 28646) L2OutputOracleTest:test_proposeL2Output_futureTimetamp_reverts() (gas: 28690)
L2OutputOracleTest:test_proposeL2Output_notProposer_reverts() (gas: 25782) L2OutputOracleTest:test_proposeL2Output_notProposer_reverts() (gas: 25826)
L2OutputOracleTest:test_proposeL2Output_proposeAnotherOutput_succeeds() (gas: 101027) L2OutputOracleTest:test_proposeL2Output_proposeAnotherOutput_succeeds() (gas: 101049)
L2OutputOracleTest:test_proposeL2Output_unexpectedBlockNumber_reverts() (gas: 28402) L2OutputOracleTest:test_proposeL2Output_unexpectedBlockNumber_reverts() (gas: 28402)
L2OutputOracleTest:test_proposeL2Output_unmatchedBlockhash_reverts() (gas: 29446) L2OutputOracleTest:test_proposeL2Output_unmatchedBlockhash_reverts() (gas: 29402)
L2OutputOracleTest:test_proposeL2Output_wrongFork_reverts() (gas: 29005) L2OutputOracleTest:test_proposeL2Output_wrongFork_reverts() (gas: 29005)
L2OutputOracleTest:test_proposeWithBlockhashAndHeight_succeeds() (gas: 95296) L2OutputOracleTest:test_proposeWithBlockhashAndHeight_succeeds() (gas: 95318)
L2OutputOracleUpgradeable_Test:test_initValuesOnProxy_succeeds() (gas: 26093) L2OutputOracleUpgradeable_Test:test_initValuesOnProxy_succeeds() (gas: 26093)
L2OutputOracleUpgradeable_Test:test_initializeImpl_alreadyInitialized_reverts() (gas: 15149) L2OutputOracleUpgradeable_Test:test_initializeImpl_alreadyInitialized_reverts() (gas: 15149)
L2OutputOracleUpgradeable_Test:test_initializeProxy_alreadyInitialized_reverts() (gas: 20131) L2OutputOracleUpgradeable_Test:test_initializeProxy_alreadyInitialized_reverts() (gas: 20131)
......
...@@ -73,7 +73,7 @@ contract L2OutputOracle is Initializable, Semver { ...@@ -73,7 +73,7 @@ contract L2OutputOracle is Initializable, Semver {
event OutputsDeleted(uint256 indexed prevNextOutputIndex, uint256 indexed newNextOutputIndex); event OutputsDeleted(uint256 indexed prevNextOutputIndex, uint256 indexed newNextOutputIndex);
/** /**
* @custom:semver 1.0.0 * @custom:semver 1.1.0
* *
* @param _submissionInterval Interval in blocks at which checkpoints must be submitted. * @param _submissionInterval Interval in blocks at which checkpoints must be submitted.
* @param _l2BlockTime The time per L2 block, in seconds. * @param _l2BlockTime The time per L2 block, in seconds.
...@@ -89,7 +89,13 @@ contract L2OutputOracle is Initializable, Semver { ...@@ -89,7 +89,13 @@ contract L2OutputOracle is Initializable, Semver {
uint256 _startingTimestamp, uint256 _startingTimestamp,
address _proposer, address _proposer,
address _challenger address _challenger
) Semver(1, 0, 0) { ) Semver(1, 1, 0) {
require(_l2BlockTime > 0, "L2OutputOracle: L2 block time must be greater than 0");
require(
_submissionInterval > _l2BlockTime,
"L2OutputOracle: submission interval must be greater than L2 block time"
);
SUBMISSION_INTERVAL = _submissionInterval; SUBMISSION_INTERVAL = _submissionInterval;
L2_BLOCK_TIME = _l2BlockTime; L2_BLOCK_TIME = _l2BlockTime;
PROPOSER = _proposer; PROPOSER = _proposer;
......
...@@ -44,6 +44,40 @@ contract L2OutputOracleTest is L2OutputOracle_Initializer { ...@@ -44,6 +44,40 @@ contract L2OutputOracleTest is L2OutputOracle_Initializer {
); );
} }
function test_constructor_l2BlockTimeZero_reverts() external {
vm.expectRevert("L2OutputOracle: L2 block time must be greater than 0");
new L2OutputOracle(
submissionInterval,
0,
startingBlockNumber,
block.timestamp,
proposer,
owner
);
}
function testFuzz_constructor_submissionIntervalLteL2BlockTime_reverts(
uint256 _submissionInterval,
uint256 _l2BlockTime
) external {
// Bound the _l2blockTime to be in the range of [1, type(uint256).max]
_l2BlockTime = bound(_l2BlockTime, 1, type(uint256).max);
// Roll the block number to _l2blockTime (the starting L2 timestamp must be less than or equal to the current time)
vm.roll(_l2BlockTime);
// Bound _submissionInterval to be less than or equal to _l2BlockTime
_submissionInterval = bound(_submissionInterval, 0, _l2BlockTime);
vm.expectRevert("L2OutputOracle: submission interval must be greater than L2 block time");
new L2OutputOracle(
_submissionInterval,
_l2BlockTime,
startingBlockNumber,
block.timestamp,
proposer,
owner
);
}
/**************** /****************
* Getter Tests * * Getter Tests *
****************/ ****************/
......
...@@ -5,6 +5,19 @@ import '@nomiclabs/hardhat-ethers' ...@@ -5,6 +5,19 @@ import '@nomiclabs/hardhat-ethers'
import { assertContractVariable, deploy } from '../src/deploy-utils' import { assertContractVariable, deploy } from '../src/deploy-utils'
const deployFn: DeployFunction = async (hre) => { const deployFn: DeployFunction = async (hre) => {
if (hre.deployConfig.l2BlockTime === 0) {
throw new Error(
'L2OutputOracle deployment: l2BlockTime must be greater than 0'
)
} else if (
hre.deployConfig.l2OutputOracleSubmissionInterval <=
hre.deployConfig.l2BlockTime
) {
throw new Error(
'L2OutputOracle deployment: submissionInterval must be greater than the l2BlockTime'
)
}
await deploy({ await deploy({
hre, hre,
name: 'L2OutputOracle', name: 'L2OutputOracle',
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
"build:forge": "forge build", "build:forge": "forge build",
"build:with-metadata": "FOUNDRY_PROFILE=echidna yarn build:forge", "build:with-metadata": "FOUNDRY_PROFILE=echidna yarn build:forge",
"build:differential": "tsc scripts/differential-testing.ts --outDir dist --moduleResolution node --esModuleInterop", "build:differential": "tsc scripts/differential-testing.ts --outDir dist --moduleResolution node --esModuleInterop",
"build:fuzz": "go build -o test-case-generator test-case-generator/cmd/fuzz.go", "build:fuzz": "(cd test-case-generator && go build ./cmd/fuzz.go)",
"prebuild": "yarn ts-node scripts/verify-foundry-install.ts", "prebuild": "yarn ts-node scripts/verify-foundry-install.ts",
"build": "hardhat compile && yarn autogen:artifacts && yarn build:ts && yarn typechain", "build": "hardhat compile && yarn autogen:artifacts && yarn build:ts && yarn typechain",
"build:ts": "tsc -p tsconfig.build.json", "build:ts": "tsc -p tsconfig.build.json",
......
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