Commit d19d1137 authored by Mark Tyneway's avatar Mark Tyneway

nits: cleanup

parent 7168db67
...@@ -26,7 +26,6 @@ ...@@ -26,7 +26,6 @@
"build:fuzz": "(cd test-case-generator && go build ./cmd/fuzz.go)", "build:fuzz": "(cd test-case-generator && go build ./cmd/fuzz.go)",
"autogen:artifacts": "ts-node scripts/generate-artifacts.ts", "autogen:artifacts": "ts-node scripts/generate-artifacts.ts",
"autogen:invariant-docs": "ts-node scripts/invariant-doc-gen.ts", "autogen:invariant-docs": "ts-node scripts/invariant-doc-gen.ts",
"deploy": "hardhat deploy",
"test": "yarn build:differential && yarn build:fuzz && forge test", "test": "yarn build:differential && yarn build:fuzz && forge test",
"coverage": "yarn build:differential && yarn build:fuzz && forge coverage", "coverage": "yarn build:differential && yarn build:fuzz && forge coverage",
"coverage:lcov": "yarn build:differential && yarn build:fuzz && forge coverage --report lcov", "coverage:lcov": "yarn build:differential && yarn build:fuzz && forge coverage --report lcov",
......
...@@ -191,7 +191,9 @@ contract Deploy is Deployer { ...@@ -191,7 +191,9 @@ contract Deploy is Deployer {
/// @notice Deploy the OptimismMintableERC20FactoryProxy /// @notice Deploy the OptimismMintableERC20FactoryProxy
function deployOptimismMintableERC20FactoryProxy() broadcast() public returns (address) { function deployOptimismMintableERC20FactoryProxy() broadcast() public returns (address) {
address proxyAdmin = mustGetAddress("ProxyAdmin"); address proxyAdmin = mustGetAddress("ProxyAdmin");
Proxy proxy = new Proxy(proxyAdmin); Proxy proxy = new Proxy({
_admin: proxyAdmin
});
address admin = address(uint160(uint256(vm.load(address(proxy), OWNER_KEY)))); address admin = address(uint160(uint256(vm.load(address(proxy), OWNER_KEY))));
require(admin == proxyAdmin); require(admin == proxyAdmin);
......
...@@ -88,21 +88,13 @@ contract DeployConfig is Script { ...@@ -88,21 +88,13 @@ contract DeployConfig is Script {
return tag; return tag;
} catch { } catch {
try vm.parseJsonString(_json, "$.l1StartingBlockTag") returns (string memory tag) { try vm.parseJsonString(_json, "$.l1StartingBlockTag") returns (string memory tag) {
string[] memory cmd = new string[](3); return _getBlockByTag(tag);
cmd[0] = "/usr/bin/bash";
cmd[1] = "-c";
cmd[2] = string.concat("cast block ", tag, " --json | jq -r .hash");
bytes memory res = vm.ffi(cmd);
return abi.decode(res, (bytes32));
} catch { } catch {
try vm.parseJsonUint(_json, "$.l1StartingBlockTag") returns (uint256 tag) { try vm.parseJsonUint(_json, "$.l1StartingBlockTag") returns (uint256 tag) {
string[] memory cmd = new string[](3); return _getBlockByTag(vm.toString(tag));
cmd[0] = "/usr/bin/bash"; } catch {
cmd[1] = "-c"; revert("cannot fetch l1StartingBlockTag");
cmd[2] = string.concat("cast block ", vm.toString(tag), " --json | jq -r .hash"); }
bytes memory res = vm.ffi(cmd);
return abi.decode(res, (bytes32));
} catch {}
} }
} }
revert("l1StartingBlockTag must be a bytes32, string or uint256"); revert("l1StartingBlockTag must be a bytes32, string or uint256");
...@@ -120,4 +112,13 @@ contract DeployConfig is Script { ...@@ -120,4 +112,13 @@ contract DeployConfig is Script {
} }
return uint256(_l2OutputOracleStartingTimestamp); return uint256(_l2OutputOracleStartingTimestamp);
} }
function _getBlockByTag(string memory _tag) internal returns (bytes32) {
string[] memory cmd = new string[](3);
cmd[0] = "/usr/bin/bash";
cmd[1] = "-c";
cmd[2] = string.concat("cast block ", _tag, " --json | jq -r .hash");
bytes memory res = vm.ffi(cmd);
return abi.decode(res, (bytes32));
}
} }
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