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

Merge pull request #6651 from ethereum-optimism/feat/forge-fmt-2

feat: forge fmt
parents 40d9266a eb203036
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -31,7 +31,7 @@ var ( ...@@ -31,7 +31,7 @@ var (
// L1BlockNumberMetaData contains all meta data concerning the L1BlockNumber contract. // L1BlockNumberMetaData contains all meta data concerning the L1BlockNumber contract.
var L1BlockNumberMetaData = &bind.MetaData{ var L1BlockNumberMetaData = &bind.MetaData{
ABI: "[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"inputs\":[],\"name\":\"getL1BlockNumber\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"version\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}]", ABI: "[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"inputs\":[],\"name\":\"getL1BlockNumber\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"version\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}]",
Bin: "0x60e060405234801561001057600080fd5b5060016080819052600060a081905260c08290528161059461004a8339600061018d015260006101640152600061013b01526105946000f3fe60806040526004361061002d5760003560e01c806354fd4d5014610052578063b9b3efe91461007d57610048565b3661004857600061003c6100a0565b90508060005260206000f35b600061003c6100a0565b34801561005e57600080fd5b50610067610134565b6040516100749190610344565b60405180910390f35b34801561008957600080fd5b506100926100a0565b604051908152602001610074565b600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16638381f58a6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610101573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101259190610395565b67ffffffffffffffff16905090565b606061015f7f00000000000000000000000000000000000000000000000000000000000000006101d7565b6101887f00000000000000000000000000000000000000000000000000000000000000006101d7565b6101b17f00000000000000000000000000000000000000000000000000000000000000006101d7565b6040516020016101c3939291906103c6565b604051602081830303815290604052905090565b60608160000361021a57505060408051808201909152600181527f3000000000000000000000000000000000000000000000000000000000000000602082015290565b8160005b8115610244578061022e8161046b565b915061023d9050600a836104d2565b915061021e565b60008167ffffffffffffffff81111561025f5761025f6104e6565b6040519080825280601f01601f191660200182016040528015610289576020820181803683370190505b5090505b841561030c5761029e600183610515565b91506102ab600a8661052c565b6102b6906030610540565b60f81b8183815181106102cb576102cb610558565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350610305600a866104d2565b945061028d565b949350505050565b60005b8381101561032f578181015183820152602001610317565b8381111561033e576000848401525b50505050565b6020815260008251806020840152610363816040850160208701610314565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169190910160400192915050565b6000602082840312156103a757600080fd5b815167ffffffffffffffff811681146103bf57600080fd5b9392505050565b600084516103d8818460208901610314565b80830190507f2e000000000000000000000000000000000000000000000000000000000000008082528551610414816001850160208a01610314565b6001920191820152835161042f816002840160208801610314565b0160020195945050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361049c5761049c61043c565b5060010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000826104e1576104e16104a3565b500490565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000828210156105275761052761043c565b500390565b60008261053b5761053b6104a3565b500690565b600082198211156105535761055361043c565b500190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fdfea164736f6c634300080f000a", Bin: "0x60e060405234801561001057600080fd5b506001608052600060a052600260c05260805160a05160c05161059461004f600039600061018d015260006101640152600061013b01526105946000f3fe60806040526004361061002d5760003560e01c806354fd4d5014610052578063b9b3efe91461007d57610048565b3661004857600061003c6100a0565b90508060005260206000f35b600061003c6100a0565b34801561005e57600080fd5b50610067610134565b6040516100749190610344565b60405180910390f35b34801561008957600080fd5b506100926100a0565b604051908152602001610074565b600073420000000000000000000000000000000000001573ffffffffffffffffffffffffffffffffffffffff16638381f58a6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610101573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101259190610395565b67ffffffffffffffff16905090565b606061015f7f00000000000000000000000000000000000000000000000000000000000000006101d7565b6101887f00000000000000000000000000000000000000000000000000000000000000006101d7565b6101b17f00000000000000000000000000000000000000000000000000000000000000006101d7565b6040516020016101c3939291906103c6565b604051602081830303815290604052905090565b60608160000361021a57505060408051808201909152600181527f3000000000000000000000000000000000000000000000000000000000000000602082015290565b8160005b8115610244578061022e8161046b565b915061023d9050600a836104d2565b915061021e565b60008167ffffffffffffffff81111561025f5761025f6104e6565b6040519080825280601f01601f191660200182016040528015610289576020820181803683370190505b5090505b841561030c5761029e600183610515565b91506102ab600a8661052c565b6102b6906030610540565b60f81b8183815181106102cb576102cb610558565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350610305600a866104d2565b945061028d565b949350505050565b60005b8381101561032f578181015183820152602001610317565b8381111561033e576000848401525b50505050565b6020815260008251806020840152610363816040850160208701610314565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169190910160400192915050565b6000602082840312156103a757600080fd5b815167ffffffffffffffff811681146103bf57600080fd5b9392505050565b600084516103d8818460208901610314565b80830190507f2e000000000000000000000000000000000000000000000000000000000000008082528551610414816001850160208a01610314565b6001920191820152835161042f816002840160208801610314565b0160020195945050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361049c5761049c61043c565b5060010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000826104e1576104e16104a3565b500490565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000828210156105275761052761043c565b500390565b60008261053b5761053b6104a3565b500690565b600082198211156105535761055361043c565b500190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fdfea164736f6c634300080f000a",
} }
// L1BlockNumberABI is the input ABI used to generate the binding from. // L1BlockNumberABI is the input ABI used to generate the binding from.
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -31,7 +31,7 @@ var ( ...@@ -31,7 +31,7 @@ var (
// LegacyMessagePasserMetaData contains all meta data concerning the LegacyMessagePasser contract. // LegacyMessagePasserMetaData contains all meta data concerning the LegacyMessagePasser contract.
var LegacyMessagePasserMetaData = &bind.MetaData{ var LegacyMessagePasserMetaData = &bind.MetaData{
ABI: "[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"_message\",\"type\":\"bytes\"}],\"name\":\"passMessageToL1\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"sentMessages\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"version\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", ABI: "[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"_message\",\"type\":\"bytes\"}],\"name\":\"passMessageToL1\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"sentMessages\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"version\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]",
Bin: "0x60e060405234801561001057600080fd5b5060016080819052600060a081905260c082905281610698610048833960006101050152600060dc0152600060b301526106986000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c806354fd4d501461004657806382e3702d14610064578063cafa81dc14610097575b600080fd5b61004e6100ac565b60405161005b9190610347565b60405180910390f35b610087610072366004610398565b60006020819052908152604090205460ff1681565b604051901515815260200161005b565b6100aa6100a53660046103e0565b61014f565b005b60606100d77f00000000000000000000000000000000000000000000000000000000000000006101da565b6101007f00000000000000000000000000000000000000000000000000000000000000006101da565b6101297f00000000000000000000000000000000000000000000000000000000000000006101da565b60405160200161013b939291906104af565b604051602081830303815290604052905090565b60016000808333604051602001610167929190610525565b604080518083037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe001815291815281516020928301208352908201929092520160002080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001691151591909117905550565b60608160000361021d57505060408051808201909152600181527f3000000000000000000000000000000000000000000000000000000000000000602082015290565b8160005b811561024757806102318161059e565b91506102409050600a83610605565b9150610221565b60008167ffffffffffffffff811115610262576102626103b1565b6040519080825280601f01601f19166020018201604052801561028c576020820181803683370190505b5090505b841561030f576102a1600183610619565b91506102ae600a86610630565b6102b9906030610644565b60f81b8183815181106102ce576102ce61065c565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350610308600a86610605565b9450610290565b949350505050565b60005b8381101561033257818101518382015260200161031a565b83811115610341576000848401525b50505050565b6020815260008251806020840152610366816040850160208701610317565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169190910160400192915050565b6000602082840312156103aa57600080fd5b5035919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000602082840312156103f257600080fd5b813567ffffffffffffffff8082111561040a57600080fd5b818401915084601f83011261041e57600080fd5b813581811115610430576104306103b1565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f01168101908382118183101715610476576104766103b1565b8160405282815287602084870101111561048f57600080fd5b826020860160208301376000928101602001929092525095945050505050565b600084516104c1818460208901610317565b80830190507f2e0000000000000000000000000000000000000000000000000000000000000080825285516104fd816001850160208a01610317565b60019201918201528351610518816002840160208801610317565b0160020195945050505050565b60008351610537818460208801610317565b60609390931b7fffffffffffffffffffffffffffffffffffffffff000000000000000000000000169190920190815260140192915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036105cf576105cf61056f565b5060010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600082610614576106146105d6565b500490565b60008282101561062b5761062b61056f565b500390565b60008261063f5761063f6105d6565b500690565b600082198211156106575761065761056f565b500190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fdfea164736f6c634300080f000a", Bin: "0x60e060405234801561001057600080fd5b506001608052600060a052600260c05260805160a05160c05161069861004d60003960006101050152600060dc0152600060b301526106986000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c806354fd4d501461004657806382e3702d14610064578063cafa81dc14610097575b600080fd5b61004e6100ac565b60405161005b9190610347565b60405180910390f35b610087610072366004610398565b60006020819052908152604090205460ff1681565b604051901515815260200161005b565b6100aa6100a53660046103e0565b61014f565b005b60606100d77f00000000000000000000000000000000000000000000000000000000000000006101da565b6101007f00000000000000000000000000000000000000000000000000000000000000006101da565b6101297f00000000000000000000000000000000000000000000000000000000000000006101da565b60405160200161013b939291906104af565b604051602081830303815290604052905090565b60016000808333604051602001610167929190610525565b604080518083037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe001815291815281516020928301208352908201929092520160002080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001691151591909117905550565b60608160000361021d57505060408051808201909152600181527f3000000000000000000000000000000000000000000000000000000000000000602082015290565b8160005b811561024757806102318161059e565b91506102409050600a83610605565b9150610221565b60008167ffffffffffffffff811115610262576102626103b1565b6040519080825280601f01601f19166020018201604052801561028c576020820181803683370190505b5090505b841561030f576102a1600183610619565b91506102ae600a86610630565b6102b9906030610644565b60f81b8183815181106102ce576102ce61065c565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350610308600a86610605565b9450610290565b949350505050565b60005b8381101561033257818101518382015260200161031a565b83811115610341576000848401525b50505050565b6020815260008251806020840152610366816040850160208701610317565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169190910160400192915050565b6000602082840312156103aa57600080fd5b5035919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000602082840312156103f257600080fd5b813567ffffffffffffffff8082111561040a57600080fd5b818401915084601f83011261041e57600080fd5b813581811115610430576104306103b1565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f01168101908382118183101715610476576104766103b1565b8160405282815287602084870101111561048f57600080fd5b826020860160208301376000928101602001929092525095945050505050565b600084516104c1818460208901610317565b80830190507f2e0000000000000000000000000000000000000000000000000000000000000080825285516104fd816001850160208a01610317565b60019201918201528351610518816002840160208801610317565b0160020195945050505050565b60008351610537818460208801610317565b60609390931b7fffffffffffffffffffffffffffffffffffffffff000000000000000000000000169190920190815260140192915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036105cf576105cf61056f565b5060010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600082610614576106146105d6565b500490565b60008282101561062b5761062b61056f565b500390565b60008261063f5761063f6105d6565b500690565b600082198211156106575761065761056f565b500190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fdfea164736f6c634300080f000a",
} }
// LegacyMessagePasserABI is the input ABI used to generate the binding from. // LegacyMessagePasserABI is the input ABI used to generate the binding from.
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -5,6 +5,5 @@ lib ...@@ -5,6 +5,5 @@ lib
artifacts artifacts
forge-artifacts forge-artifacts
cache cache
typechain
coverage* coverage*
deployments deployments
This diff is collapsed.
This diff is collapsed.
module.exports = {
...require('../../.prettierrc.js'),
}
This diff is collapsed.
# Deps and test files
node_modules
lib
contracts/test/*.t.sol
contracts/vendor/*.sol
# MIPS.sol has special VM formatting, not like other contracts.
contracts/cannon/MIPS.sol
This diff is collapsed.
This diff is collapsed.
...@@ -106,7 +106,7 @@ contract DeployConfig is Script { ...@@ -106,7 +106,7 @@ contract DeployConfig is Script {
} catch { } catch {
try vm.parseJsonUint(_json, "$.l1StartingBlockTag") returns (uint256 tag) { try vm.parseJsonUint(_json, "$.l1StartingBlockTag") returns (uint256 tag) {
return _getBlockByTag(vm.toString(tag)); return _getBlockByTag(vm.toString(tag));
} catch {} } catch { }
} }
} }
revert("l1StartingBlockTag must be a bytes32, string or uint256 or cannot fetch l1StartingBlockTag"); revert("l1StartingBlockTag must be a bytes32, string or uint256 or cannot fetch l1StartingBlockTag");
......
...@@ -39,7 +39,7 @@ contract DeployL2 is Deployer { ...@@ -39,7 +39,7 @@ contract DeployL2 is Deployer {
} }
/// @notice Deploy the EAS implementation. /// @notice Deploy the EAS implementation.
function deployEAS() broadcast() public returns (address) { function deployEAS() public broadcast returns (address) {
EAS eas = new EAS(); EAS eas = new EAS();
ISchemaRegistry registry = eas.getSchemaRegistry(); ISchemaRegistry registry = eas.getSchemaRegistry();
...@@ -55,7 +55,7 @@ contract DeployL2 is Deployer { ...@@ -55,7 +55,7 @@ contract DeployL2 is Deployer {
} }
/// @notice Deploy the SchemaManager implementation. /// @notice Deploy the SchemaManager implementation.
function deploySchemaRegistry() broadcast() public returns (address) { function deploySchemaRegistry() public broadcast returns (address) {
SchemaRegistry registry = new SchemaRegistry(); SchemaRegistry registry = new SchemaRegistry();
save("SchemaRegistry", address(registry)); save("SchemaRegistry", address(registry));
...@@ -67,4 +67,3 @@ contract DeployL2 is Deployer { ...@@ -67,4 +67,3 @@ contract DeployL2 is Deployer {
return address(registry); return address(registry);
} }
} }
...@@ -54,13 +54,7 @@ contract FaultDisputeGameViz is Script, FaultDisputeGame_Init { ...@@ -54,13 +54,7 @@ contract FaultDisputeGameViz is Script, FaultDisputeGame_Init {
uint256 numClaims = uint256(vm.load(address(gameProxy), bytes32(uint256(1)))); uint256 numClaims = uint256(vm.load(address(gameProxy), bytes32(uint256(1))));
IFaultDisputeGame.ClaimData[] memory gameData = new IFaultDisputeGame.ClaimData[](numClaims); IFaultDisputeGame.ClaimData[] memory gameData = new IFaultDisputeGame.ClaimData[](numClaims);
for (uint256 i = 0; i < numClaims; i++) { for (uint256 i = 0; i < numClaims; i++) {
( (uint32 parentIndex, bool countered, Claim claim, Position position, Clock clock) = gameProxy.claimData(i);
uint32 parentIndex,
bool countered,
Claim claim,
Position position,
Clock clock
) = gameProxy.claimData(i);
gameData[i] = IFaultDisputeGame.ClaimData({ gameData[i] = IFaultDisputeGame.ClaimData({
parentIndex: parentIndex, parentIndex: parentIndex,
......
...@@ -31,11 +31,7 @@ contract SemverLock is Script { ...@@ -31,11 +31,7 @@ contract SemverLock is Script {
commands = new string[](3); commands = new string[](3);
commands[0] = "bash"; commands[0] = "bash";
commands[1] = "-c"; commands[1] = "-c";
commands[2] = string.concat( commands[2] = string.concat("echo \"", _files[i], "\"| sed -E \'s|src/.*/(.+)\\.sol|\\1|\'");
"echo \"",
_files[i],
"\"| sed -E \'s|src/.*/(.+)\\.sol|\\1|\'"
);
string memory contractName = string(vm.ffi(commands)); string memory contractName = string(vm.ffi(commands));
commands[0] = "bash"; commands[0] = "bash";
...@@ -44,14 +40,8 @@ contract SemverLock is Script { ...@@ -44,14 +40,8 @@ contract SemverLock is Script {
string memory artifactsDir = string(vm.ffi(commands)); string memory artifactsDir = string(vm.ffi(commands));
// Parse the artifact to get the contract's initcode hash. // Parse the artifact to get the contract's initcode hash.
bytes memory initCode = vm.getCode(string.concat( bytes memory initCode =
artifactsDir, vm.getCode(string.concat(artifactsDir, "/", contractName, ".sol/", contractName, ".json"));
"/",
contractName,
".sol/",
contractName,
".json"
));
// Serialize the source hash in JSON. // Serialize the source hash in JSON.
string memory j = vm.serializeBytes32(out, _files[i], keccak256(abi.encodePacked(fileContents, initCode))); string memory j = vm.serializeBytes32(out, _files[i], keccak256(abi.encodePacked(fileContents, initCode)));
......
...@@ -68,7 +68,7 @@ contract DeleteOutput is SafeBuilder { ...@@ -68,7 +68,7 @@ contract DeleteOutput is SafeBuilder {
} }
/// @notice Test coverage of the script. /// @notice Test coverage of the script.
function test_script_succeeds() skipWhenNotForking external { function test_script_succeeds() external skipWhenNotForking {
uint256 _index = getLatestIndex(); uint256 _index = getLatestIndex();
require(_index != 0, "DeleteOutput: No outputs to delete."); require(_index != 0, "DeleteOutput: No outputs to delete.");
...@@ -103,10 +103,7 @@ contract DeleteOutput is SafeBuilder { ...@@ -103,10 +103,7 @@ contract DeleteOutput is SafeBuilder {
calls[0] = IMulticall3.Call3({ calls[0] = IMulticall3.Call3({
target: oracle, target: oracle,
allowFailure: false, allowFailure: false,
callData: abi.encodeCall( callData: abi.encodeCall(L2OutputOracle.deleteL2Outputs, (index))
L2OutputOracle.deleteL2Outputs,
(index)
)
}); });
return abi.encodeCall(IMulticall3.aggregate3, (calls)); return abi.encodeCall(IMulticall3.aggregate3, (calls));
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -2,9 +2,7 @@ ...@@ -2,9 +2,7 @@
pragma solidity 0.8.19; pragma solidity 0.8.19;
import { Semver } from "../universal/Semver.sol"; import { Semver } from "../universal/Semver.sol";
import { ISchemaResolver } from "./resolver/ISchemaResolver.sol"; import { ISchemaResolver } from "./resolver/ISchemaResolver.sol";
import { EMPTY_UID, MAX_GAP } from "./Common.sol"; import { EMPTY_UID, MAX_GAP } from "./Common.sol";
import { ISchemaRegistry, SchemaRecord } from "./ISchemaRegistry.sol"; import { ISchemaRegistry, SchemaRecord } from "./ISchemaRegistry.sol";
...@@ -22,16 +20,12 @@ contract SchemaRegistry is ISchemaRegistry, Semver { ...@@ -22,16 +20,12 @@ contract SchemaRegistry is ISchemaRegistry, Semver {
uint256[MAX_GAP - 1] private __gap; uint256[MAX_GAP - 1] private __gap;
/// @dev Creates a new SchemaRegistry instance. /// @dev Creates a new SchemaRegistry instance.
constructor() Semver(1, 0, 1) {} constructor() Semver(1, 0, 2) { }
/// @inheritdoc ISchemaRegistry /// @inheritdoc ISchemaRegistry
function register(string calldata schema, ISchemaResolver resolver, bool revocable) external returns (bytes32) { function register(string calldata schema, ISchemaResolver resolver, bool revocable) external returns (bytes32) {
SchemaRecord memory schemaRecord = SchemaRecord({ SchemaRecord memory schemaRecord =
uid: EMPTY_UID, SchemaRecord({ uid: EMPTY_UID, schema: schema, resolver: resolver, revocable: revocable });
schema: schema,
resolver: resolver,
revocable: revocable
});
bytes32 uid = _getUID(schemaRecord); bytes32 uid = _getUID(schemaRecord);
if (_registry[uid].uid != EMPTY_UID) { if (_registry[uid].uid != EMPTY_UID) {
......
...@@ -20,7 +20,8 @@ import { EIP712Signature, InvalidSignature, MAX_GAP, stringToBytes32, bytes32ToS ...@@ -20,7 +20,8 @@ import { EIP712Signature, InvalidSignature, MAX_GAP, stringToBytes32, bytes32ToS
/// @notice The EIP712 typed signatures verifier for EAS delegated attestations. /// @notice The EIP712 typed signatures verifier for EAS delegated attestations.
abstract contract EIP712Verifier is EIP712 { abstract contract EIP712Verifier is EIP712 {
// The hash of the data type used to relay calls to the attest function. It's the value of // The hash of the data type used to relay calls to the attest function. It's the value of
// keccak256("Attest(bytes32 schema,address recipient,uint64 expirationTime,bool revocable,bytes32 refUID,bytes data,uint256 nonce)"). // keccak256("Attest(bytes32 schema,address recipient,uint64 expirationTime,bool revocable,bytes32 refUID,bytes
// data,uint256 nonce)").
bytes32 private constant ATTEST_TYPEHASH = 0xdbfdf8dc2b135c26253e00d5b6cbe6f20457e003fd526d97cea183883570de61; bytes32 private constant ATTEST_TYPEHASH = 0xdbfdf8dc2b135c26253e00d5b6cbe6f20457e003fd526d97cea183883570de61;
// The hash of the data type used to relay calls to the revoke function. It's the value of // The hash of the data type used to relay calls to the revoke function. It's the value of
......
...@@ -22,7 +22,10 @@ interface ISchemaResolver { ...@@ -22,7 +22,10 @@ interface ISchemaResolver {
function multiAttest( function multiAttest(
Attestation[] calldata attestations, Attestation[] calldata attestations,
uint256[] calldata values uint256[] calldata values
) external payable returns (bool); )
external
payable
returns (bool);
/// @notice Processes an attestation revocation and verifies if it can be revoked. /// @notice Processes an attestation revocation and verifies if it can be revoked.
/// @param attestation The existing attestation to be revoked. /// @param attestation The existing attestation to be revoked.
...@@ -36,5 +39,8 @@ interface ISchemaResolver { ...@@ -36,5 +39,8 @@ interface ISchemaResolver {
function multiRevoke( function multiRevoke(
Attestation[] calldata attestations, Attestation[] calldata attestations,
uint256[] calldata values uint256[] calldata values
) external payable returns (bool); )
external
payable
returns (bool);
} }
...@@ -18,9 +18,9 @@ contract L1CrossDomainMessenger is CrossDomainMessenger, Semver { ...@@ -18,9 +18,9 @@ contract L1CrossDomainMessenger is CrossDomainMessenger, Semver {
/// @custom:legacy /// @custom:legacy
OptimismPortal public PORTAL; OptimismPortal public PORTAL;
/// @custom:semver 1.5.0 /// @custom:semver 1.5.1
/// @notice Constructs the L1CrossDomainMessenger contract. /// @notice Constructs the L1CrossDomainMessenger contract.
constructor() Semver(1, 5, 0) CrossDomainMessenger(Predeploys.L2_CROSS_DOMAIN_MESSENGER) { constructor() Semver(1, 5, 1) CrossDomainMessenger(Predeploys.L2_CROSS_DOMAIN_MESSENGER) {
initialize({ _portal: OptimismPortal(payable(0)) }); initialize({ _portal: OptimismPortal(payable(0)) });
} }
...@@ -37,12 +37,7 @@ contract L1CrossDomainMessenger is CrossDomainMessenger, Semver { ...@@ -37,12 +37,7 @@ contract L1CrossDomainMessenger is CrossDomainMessenger, Semver {
} }
/// @inheritdoc CrossDomainMessenger /// @inheritdoc CrossDomainMessenger
function _sendMessage( function _sendMessage(address _to, uint64 _gasLimit, uint256 _value, bytes memory _data) internal override {
address _to,
uint64 _gasLimit,
uint256 _value,
bytes memory _data
) internal override {
PORTAL.depositTransaction{ value: _value }(_to, _value, _gasLimit, false, _data); PORTAL.depositTransaction{ value: _value }(_to, _value, _gasLimit, false, _data);
} }
......
...@@ -76,16 +76,16 @@ abstract contract ResourceMetering is Initializable { ...@@ -76,16 +76,16 @@ abstract contract ResourceMetering is Initializable {
uint256 blockDiff = block.number - params.prevBlockNum; uint256 blockDiff = block.number - params.prevBlockNum;
ResourceConfig memory config = _resourceConfig(); ResourceConfig memory config = _resourceConfig();
int256 targetResourceLimit = int256(uint256(config.maxResourceLimit)) / int256 targetResourceLimit =
int256(uint256(config.elasticityMultiplier)); int256(uint256(config.maxResourceLimit)) / int256(uint256(config.elasticityMultiplier));
if (blockDiff > 0) { if (blockDiff > 0) {
// Handle updating EIP-1559 style gas parameters. We use EIP-1559 to restrict the rate // Handle updating EIP-1559 style gas parameters. We use EIP-1559 to restrict the rate
// at which deposits can be created and therefore limit the potential for deposits to // at which deposits can be created and therefore limit the potential for deposits to
// spam the L2 system. Fee scheme is very similar to EIP-1559 with minor changes. // spam the L2 system. Fee scheme is very similar to EIP-1559 with minor changes.
int256 gasUsedDelta = int256(uint256(params.prevBoughtGas)) - targetResourceLimit; int256 gasUsedDelta = int256(uint256(params.prevBoughtGas)) - targetResourceLimit;
int256 baseFeeDelta = (int256(uint256(params.prevBaseFee)) * gasUsedDelta) / int256 baseFeeDelta = (int256(uint256(params.prevBaseFee)) * gasUsedDelta)
(targetResourceLimit * int256(uint256(config.baseFeeMaxChangeDenominator))); / (targetResourceLimit * int256(uint256(config.baseFeeMaxChangeDenominator)));
// Update base fee by adding the base fee delta and clamp the resulting value between // Update base fee by adding the base fee delta and clamp the resulting value between
// min and max. // min and max.
...@@ -155,10 +155,6 @@ abstract contract ResourceMetering is Initializable { ...@@ -155,10 +155,6 @@ abstract contract ResourceMetering is Initializable {
/// child contract. /// child contract.
// solhint-disable-next-line func-name-mixedcase // solhint-disable-next-line func-name-mixedcase
function __ResourceMetering_init() internal onlyInitializing { function __ResourceMetering_init() internal onlyInitializing {
params = ResourceParams({ params = ResourceParams({ prevBaseFee: 1 gwei, prevBoughtGas: 0, prevBlockNum: uint64(block.number) });
prevBaseFee: 1 gwei,
prevBoughtGas: 0,
prevBlockNum: uint64(block.number)
});
} }
} }
...@@ -9,7 +9,7 @@ import { FeeVault } from "../universal/FeeVault.sol"; ...@@ -9,7 +9,7 @@ import { FeeVault } from "../universal/FeeVault.sol";
/// @title BaseFeeVault /// @title BaseFeeVault
/// @notice The BaseFeeVault accumulates the base fee that is paid by transactions. /// @notice The BaseFeeVault accumulates the base fee that is paid by transactions.
contract BaseFeeVault is FeeVault, Semver { contract BaseFeeVault is FeeVault, Semver {
/// @custom:semver 1.3.0 /// @custom:semver 1.3.1
/// @notice Constructs the BaseFeeVault contract. /// @notice Constructs the BaseFeeVault contract.
/// @param _recipient Wallet that will receive the fees. /// @param _recipient Wallet that will receive the fees.
/// @param _minWithdrawalAmount Minimum balance for withdrawals. /// @param _minWithdrawalAmount Minimum balance for withdrawals.
...@@ -18,5 +18,8 @@ contract BaseFeeVault is FeeVault, Semver { ...@@ -18,5 +18,8 @@ contract BaseFeeVault is FeeVault, Semver {
address _recipient, address _recipient,
uint256 _minWithdrawalAmount, uint256 _minWithdrawalAmount,
WithdrawalNetwork _withdrawalNetwork WithdrawalNetwork _withdrawalNetwork
) FeeVault(_recipient, _minWithdrawalAmount, _withdrawalNetwork) Semver(1, 3, 0) {} )
FeeVault(_recipient, _minWithdrawalAmount, _withdrawalNetwork)
Semver(1, 3, 1)
{ }
} }
...@@ -14,8 +14,7 @@ abstract contract CrossDomainOwnable is Ownable { ...@@ -14,8 +14,7 @@ abstract contract CrossDomainOwnable is Ownable {
/// `msg.sender` is the owner of the contract. /// `msg.sender` is the owner of the contract.
function _checkOwner() internal view override { function _checkOwner() internal view override {
require( require(
owner() == AddressAliasHelper.undoL1ToL2Alias(msg.sender), owner() == AddressAliasHelper.undoL1ToL2Alias(msg.sender), "CrossDomainOwnable: caller is not the owner"
"CrossDomainOwnable: caller is not the owner"
); );
} }
} }
...@@ -15,18 +15,10 @@ abstract contract CrossDomainOwnable2 is Ownable { ...@@ -15,18 +15,10 @@ abstract contract CrossDomainOwnable2 is Ownable {
/// `xDomainMessageSender` is the owner of the contract. This value is set to the caller /// `xDomainMessageSender` is the owner of the contract. This value is set to the caller
/// of the L1CrossDomainMessenger. /// of the L1CrossDomainMessenger.
function _checkOwner() internal view override { function _checkOwner() internal view override {
L2CrossDomainMessenger messenger = L2CrossDomainMessenger( L2CrossDomainMessenger messenger = L2CrossDomainMessenger(Predeploys.L2_CROSS_DOMAIN_MESSENGER);
Predeploys.L2_CROSS_DOMAIN_MESSENGER
);
require( require(msg.sender == address(messenger), "CrossDomainOwnable2: caller is not the messenger");
msg.sender == address(messenger),
"CrossDomainOwnable2: caller is not the messenger"
);
require( require(owner() == messenger.xDomainMessageSender(), "CrossDomainOwnable2: caller is not the owner");
owner() == messenger.xDomainMessageSender(),
"CrossDomainOwnable2: caller is not the owner"
);
} }
} }
...@@ -23,9 +23,9 @@ contract GasPriceOracle is Semver { ...@@ -23,9 +23,9 @@ contract GasPriceOracle is Semver {
/// @notice Number of decimals used in the scalar. /// @notice Number of decimals used in the scalar.
uint256 public constant DECIMALS = 6; uint256 public constant DECIMALS = 6;
/// @custom:semver 1.0.1 /// @custom:semver 1.0.2
/// @notice Constructs the GasPriceOracle contract. /// @notice Constructs the GasPriceOracle contract.
constructor() Semver(1, 0, 1) {} constructor() Semver(1, 0, 2) { }
/// @notice Computes the L1 portion of the fee based on the size of the rlp encoded input /// @notice Computes the L1 portion of the fee based on the size of the rlp encoded input
/// transaction, the current L1 base fee, and the various dynamic parameters. /// transaction, the current L1 base fee, and the various dynamic parameters.
...@@ -34,7 +34,7 @@ contract GasPriceOracle is Semver { ...@@ -34,7 +34,7 @@ contract GasPriceOracle is Semver {
function getL1Fee(bytes memory _data) external view returns (uint256) { function getL1Fee(bytes memory _data) external view returns (uint256) {
uint256 l1GasUsed = getL1GasUsed(_data); uint256 l1GasUsed = getL1GasUsed(_data);
uint256 l1Fee = l1GasUsed * l1BaseFee(); uint256 l1Fee = l1GasUsed * l1BaseFee();
uint256 divisor = 10**DECIMALS; uint256 divisor = 10 ** DECIMALS;
uint256 unscaled = l1Fee * scalar(); uint256 unscaled = l1Fee * scalar();
uint256 scaled = unscaled / divisor; uint256 scaled = unscaled / divisor;
return scaled; return scaled;
......
...@@ -48,9 +48,9 @@ contract L2ToL1MessagePasser is Semver { ...@@ -48,9 +48,9 @@ contract L2ToL1MessagePasser is Semver {
/// @param amount Amount of ETh that was burned. /// @param amount Amount of ETh that was burned.
event WithdrawerBalanceBurnt(uint256 indexed amount); event WithdrawerBalanceBurnt(uint256 indexed amount);
/// @custom:semver 1.0.1 /// @custom:semver 1.0.2
/// @notice Constructs the L2ToL1MessagePasser contract. /// @notice Constructs the L2ToL1MessagePasser contract.
constructor() Semver(1, 0, 1) {} constructor() Semver(1, 0, 2) { }
/// @notice Allows users to withdraw ETH by sending directly to this contract. /// @notice Allows users to withdraw ETH by sending directly to this contract.
receive() external payable { receive() external payable {
...@@ -71,11 +71,7 @@ contract L2ToL1MessagePasser is Semver { ...@@ -71,11 +71,7 @@ contract L2ToL1MessagePasser is Semver {
/// @param _target Address to call on L1 execution. /// @param _target Address to call on L1 execution.
/// @param _gasLimit Minimum gas limit for executing the message on L1. /// @param _gasLimit Minimum gas limit for executing the message on L1.
/// @param _data Data to forward to L1 target. /// @param _data Data to forward to L1 target.
function initiateWithdrawal( function initiateWithdrawal(address _target, uint256 _gasLimit, bytes memory _data) public payable {
address _target,
uint256 _gasLimit,
bytes memory _data
) public payable {
bytes32 withdrawalHash = Hashing.hashWithdrawal( bytes32 withdrawalHash = Hashing.hashWithdrawal(
Types.WithdrawalTransaction({ Types.WithdrawalTransaction({
nonce: messageNonce(), nonce: messageNonce(),
...@@ -89,15 +85,7 @@ contract L2ToL1MessagePasser is Semver { ...@@ -89,15 +85,7 @@ contract L2ToL1MessagePasser is Semver {
sentMessages[withdrawalHash] = true; sentMessages[withdrawalHash] = true;
emit MessagePassed( emit MessagePassed(messageNonce(), msg.sender, _target, msg.value, _gasLimit, _data, withdrawalHash);
messageNonce(),
msg.sender,
_target,
msg.value,
_gasLimit,
_data,
withdrawalHash
);
unchecked { unchecked {
++msgNonce; ++msgNonce;
......
...@@ -9,10 +9,7 @@ interface IPreimageOracle { ...@@ -9,10 +9,7 @@ interface IPreimageOracle {
/// @param _offset The offset of the preimage to read. /// @param _offset The offset of the preimage to read.
/// @return dat_ The preimage data. /// @return dat_ The preimage data.
/// @return datLen_ The length of the preimage data. /// @return datLen_ The length of the preimage data.
function readPreimage(bytes32 _key, uint256 _offset) function readPreimage(bytes32 _key, uint256 _offset) external view returns (bytes32 dat_, uint256 datLen_);
external
view
returns (bytes32 dat_, uint256 datLen_);
/// @notice Loads of local data part into the preimage oracle. /// @notice Loads of local data part into the preimage oracle.
/// @param _ident The identifier of the local data. /// @param _ident The identifier of the local data.
...@@ -38,7 +35,9 @@ interface IPreimageOracle { ...@@ -38,7 +35,9 @@ interface IPreimageOracle {
bytes32 _word, bytes32 _word,
uint256 _size, uint256 _size,
uint256 _partOffset uint256 _partOffset
) external returns (bytes32 key_); )
external
returns (bytes32 key_);
/// @notice Prepares a preimage to be read by keccak256 key, starting at /// @notice Prepares a preimage to be read by keccak256 key, starting at
/// the given offset and up to 32 bytes (clipped at preimage length, if out of data). /// the given offset and up to 32 bytes (clipped at preimage length, if out of data).
......
...@@ -30,9 +30,7 @@ interface IBigStepper { ...@@ -30,9 +30,7 @@ interface IBigStepper {
/// @param _stateData The preimage of the prestate hash. /// @param _stateData The preimage of the prestate hash.
/// @param _proof A proof for the inclusion of the prestate's memory in the merkle tree. /// @param _proof A proof for the inclusion of the prestate's memory in the merkle tree.
/// @return postState_ The poststate hash after the instruction step. /// @return postState_ The poststate hash after the instruction step.
function step(bytes calldata _stateData, bytes calldata _proof) function step(bytes calldata _stateData, bytes calldata _proof) external returns (bytes32 postState_);
external
returns (bytes32 postState_);
/// @notice Returns the preimage oracle used by the stepper. /// @notice Returns the preimage oracle used by the stepper.
function oracle() external view returns (IPreimageOracle oracle_); function oracle() external view returns (IPreimageOracle oracle_);
......
...@@ -30,11 +30,7 @@ interface IBondManager { ...@@ -30,11 +30,7 @@ interface IBondManager {
/// @param _bondOwner is the address that owns the bond. /// @param _bondOwner is the address that owns the bond.
/// @param _minClaimHold is the minimum amount of time the owner /// @param _minClaimHold is the minimum amount of time the owner
/// must wait before reclaiming their bond. /// must wait before reclaiming their bond.
function post( function post(bytes32 _bondId, address _bondOwner, uint128 _minClaimHold) external payable;
bytes32 _bondId,
address _bondOwner,
uint128 _minClaimHold
) external payable;
/// @notice Seizes the bond with the given id. /// @notice Seizes the bond with the given id.
/// @dev This function will revert if there is no bond at the given id. /// @dev This function will revert if there is no bond at the given id.
......
...@@ -56,12 +56,5 @@ interface IDisputeGame is IInitializable { ...@@ -56,12 +56,5 @@ interface IDisputeGame is IInitializable {
/// @return gameType_ The type of proof system being used. /// @return gameType_ The type of proof system being used.
/// @return rootClaim_ The root claim of the DisputeGame. /// @return rootClaim_ The root claim of the DisputeGame.
/// @return extraData_ Any extra data supplied to the dispute game contract by the creator. /// @return extraData_ Any extra data supplied to the dispute game contract by the creator.
function gameData() function gameData() external view returns (GameType gameType_, Claim rootClaim_, bytes memory extraData_);
external
view
returns (
GameType gameType_,
Claim rootClaim_,
bytes memory extraData_
);
} }
...@@ -6,7 +6,6 @@ import "src/libraries/DisputeTypes.sol"; ...@@ -6,7 +6,6 @@ import "src/libraries/DisputeTypes.sol";
/// @title Hashing /// @title Hashing
/// @notice This library contains all of the hashing utilities used in the Cannon contracts. /// @notice This library contains all of the hashing utilities used in the Cannon contracts.
library LibHashing { library LibHashing {
/// @notice Hashes a claim and a position together. /// @notice Hashes a claim and a position together.
/// @param _claim A Claim type. /// @param _claim A Claim type.
/// @param _position The position of `claim`. /// @param _position The position of `claim`.
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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