Skip to content

Commit

Permalink
forge fmt tests
Browse files Browse the repository at this point in the history
fmt
  • Loading branch information
clabby committed Dec 9, 2023
1 parent 0a7104c commit ef4b116
Show file tree
Hide file tree
Showing 14 changed files with 38 additions and 74 deletions.
30 changes: 10 additions & 20 deletions packages/contracts-bedrock/scripts/Deploy.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -380,9 +380,7 @@ contract Deploy is Deployer {
/// @notice Deploy the ProxyAdmin
function deployProxyAdmin() public broadcast returns (address addr_) {
console.log("Deploying ProxyAdmin");
ProxyAdmin admin = new ProxyAdmin({
_owner: msg.sender
});
ProxyAdmin admin = new ProxyAdmin({ _owner: msg.sender });
require(admin.owner() == msg.sender);

AddressManager addressManager = AddressManager(mustGetAddress("AddressManager"));
Expand Down Expand Up @@ -440,9 +438,7 @@ contract Deploy is Deployer {
function deployERC1967Proxy(string memory _name) public broadcast returns (address addr_) {
console.log(string.concat("Deploying ERC1967 proxy for", _name, ""));
address proxyAdmin = mustGetAddress("ProxyAdmin");
Proxy proxy = new Proxy({
_admin: proxyAdmin
});
Proxy proxy = new Proxy({ _admin: proxyAdmin });

address admin = address(uint160(uint256(vm.load(address(proxy), OWNER_KEY))));
require(admin == proxyAdmin);
Expand Down Expand Up @@ -472,9 +468,8 @@ contract Deploy is Deployer {
function deployL1CrossDomainMessenger() public broadcast returns (address addr_) {
console.log("Deploying L1CrossDomainMessenger implementation");
address portal = mustGetAddress("OptimismPortalProxy");
L1CrossDomainMessenger messenger = new L1CrossDomainMessenger{ salt: _implSalt() }({
_portal: OptimismPortal(payable(portal))
});
L1CrossDomainMessenger messenger =
new L1CrossDomainMessenger{ salt: _implSalt() }({ _portal: OptimismPortal(payable(portal)) });

save("L1CrossDomainMessenger", address(messenger));
console.log("L1CrossDomainMessenger deployed at %s", address(messenger));
Expand All @@ -498,10 +493,8 @@ contract Deploy is Deployer {
L2OutputOracle l2OutputOracle = L2OutputOracle(mustGetAddress("L2OutputOracleProxy"));
SystemConfig systemConfig = SystemConfig(mustGetAddress("SystemConfigProxy"));

OptimismPortal portal = new OptimismPortal{ salt: _implSalt() }({
_l2Oracle: l2OutputOracle,
_systemConfig: systemConfig
});
OptimismPortal portal =
new OptimismPortal{ salt: _implSalt() }({ _l2Oracle: l2OutputOracle, _systemConfig: systemConfig });

save("OptimismPortal", address(portal));
console.log("OptimismPortal deployed at %s", address(portal));
Expand Down Expand Up @@ -551,7 +544,7 @@ contract Deploy is Deployer {
console.log("Deploying OptimismMintableERC20Factory implementation");
address l1standardBridgeProxy = mustGetAddress("L1StandardBridgeProxy");
OptimismMintableERC20Factory factory =
new OptimismMintableERC20Factory{ salt: _implSalt() }({_bridge: l1standardBridgeProxy});
new OptimismMintableERC20Factory{ salt: _implSalt() }({ _bridge: l1standardBridgeProxy });

save("OptimismMintableERC20Factory", address(factory));
console.log("OptimismMintableERC20Factory deployed at %s", address(factory));
Expand Down Expand Up @@ -660,9 +653,8 @@ contract Deploy is Deployer {
console.log("Deploying L1StandardBridge implementation");
address l1CrossDomainMessengerProxy = mustGetAddress("L1CrossDomainMessengerProxy");

L1StandardBridge bridge = new L1StandardBridge{ salt: _implSalt() }({
_messenger: payable(l1CrossDomainMessengerProxy)
});
L1StandardBridge bridge =
new L1StandardBridge{ salt: _implSalt() }({ _messenger: payable(l1CrossDomainMessengerProxy) });

save("L1StandardBridge", address(bridge));
console.log("L1StandardBridge deployed at %s", address(bridge));
Expand All @@ -681,9 +673,7 @@ contract Deploy is Deployer {
function deployL1ERC721Bridge() public broadcast returns (address addr_) {
console.log("Deploying L1ERC721Bridge implementation");
address l1CrossDomainMessengerProxy = mustGetAddress("L1CrossDomainMessengerProxy");
L1ERC721Bridge bridge = new L1ERC721Bridge{ salt: _implSalt() }({
_messenger: l1CrossDomainMessengerProxy
});
L1ERC721Bridge bridge = new L1ERC721Bridge{ salt: _implSalt() }({ _messenger: l1CrossDomainMessengerProxy });

save("L1ERC721Bridge", address(bridge));
console.log("L1ERC721Bridge deployed at %s", address(bridge));
Expand Down
8 changes: 2 additions & 6 deletions packages/contracts-bedrock/scripts/DeployPeriphery.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,7 @@ contract DeployPeriphery is Deployer {
save("ProxyAdmin", preComputedAddress);
addr_ = preComputedAddress;
} else {
ProxyAdmin admin = new ProxyAdmin{ salt: salt }({
_owner: msg.sender
});
ProxyAdmin admin = new ProxyAdmin{ salt: salt }({ _owner: msg.sender });
require(admin.owner() == msg.sender);

save("ProxyAdmin", address(admin));
Expand All @@ -114,9 +112,7 @@ contract DeployPeriphery is Deployer {
save("FaucetProxy", preComputedAddress);
addr_ = preComputedAddress;
} else {
Proxy proxy = new Proxy{ salt: salt }({
_admin: proxyAdmin
});
Proxy proxy = new Proxy{ salt: salt }({ _admin: proxyAdmin });
address admin = address(uint160(uint256(vm.load(address(proxy), OWNER_KEY))));
require(admin == proxyAdmin);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ contract OptimismMintableERC20Factory is ISemver {

bytes32 salt = keccak256(abi.encode(_remoteToken, _name, _symbol, _decimals));
address localToken =
address(new OptimismMintableERC20{salt: salt}(BRIDGE, _remoteToken, _name, _symbol, _decimals));
address(new OptimismMintableERC20{ salt: salt }(BRIDGE, _remoteToken, _name, _symbol, _decimals));

// Emit the old event too for legacy support.
emit StandardL2TokenCreated(_remoteToken, localToken);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ contract OptimismMintableERC721Factory is ISemver {

bytes32 salt = keccak256(abi.encode(_remoteToken, _name, _symbol));
address localToken =
address(new OptimismMintableERC721{salt: salt}(BRIDGE, REMOTE_CHAIN_ID, _remoteToken, _name, _symbol));
address(new OptimismMintableERC721{ salt: salt }(BRIDGE, REMOTE_CHAIN_ID, _remoteToken, _name, _symbol));

isOptimismMintableERC721[localToken] = true;
emit OptimismMintableERC721Created(localToken, _remoteToken, msg.sender);
Expand Down
2 changes: 1 addition & 1 deletion packages/contracts-bedrock/test/L1/L2OutputOracle.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ contract L2OutputOracle_constructor_Test is CommonTest {
new L2OutputOracle({
_submissionInterval: 0,
_l2BlockTime: l2BlockTime,
_startingBlockNumber: startingBlockNumber,
_startingBlockNumber: startingBlockNumber,
_startingTimestamp: block.timestamp,
_proposer: proposer,
_challenger: challenger,
Expand Down
6 changes: 5 additions & 1 deletion packages/contracts-bedrock/test/L2/SequencerFeeVault.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,11 @@ contract SequencerFeeVault_L2Withdrawal_Test is CommonTest {
vm.etch(
EIP1967Helper.getImplementation(Predeploys.SEQUENCER_FEE_WALLET),
address(
new SequencerFeeVault(deploy.cfg().sequencerFeeVaultRecipient(), deploy.cfg().sequencerFeeVaultMinimumWithdrawalAmount(), FeeVault.WithdrawalNetwork.L2)
new SequencerFeeVault(
deploy.cfg().sequencerFeeVaultRecipient(),
deploy.cfg().sequencerFeeVaultMinimumWithdrawalAmount(),
FeeVault.WithdrawalNetwork.L2
)
).code
);

Expand Down
12 changes: 6 additions & 6 deletions packages/contracts-bedrock/test/Safe/LivenessModule.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -371,12 +371,12 @@ contract LivenessModule_RemoveOwnersFuzz_Test is LivenessModule_TestInit {
safeInstance = _setupSafe(keys, threshold);
livenessGuard = new LivenessGuard(safeInstance.safe);
livenessModule = new LivenessModule({
_safe: safeInstance.safe,
_livenessGuard: livenessGuard,
_livenessInterval: livenessInterval,
_minOwners: minOwners_,
_fallbackOwner: fallbackOwner
});
_safe: safeInstance.safe,
_livenessGuard: livenessGuard,
_livenessInterval: livenessInterval,
_minOwners: minOwners_,
_fallbackOwner: fallbackOwner
});
safeInstance.setGuard(address(livenessGuard));
safeInstance.enableModule(address(livenessModule));

Expand Down
12 changes: 2 additions & 10 deletions packages/contracts-bedrock/test/dispute/FaultDisputeGame.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -992,11 +992,7 @@ contract FaultDisputeGame_ResolvesCorrectly_IncorrectRootFuzz is OneVsOne_Arena
uint256 snapshot = vm.snapshot();

GamePlayer honest = new HonestPlayer(ABSOLUTE_PRESTATE);
GamePlayer dishonest = new VariableDivergentPlayer(
ABSOLUTE_PRESTATE,
_dishonestTraceLength,
i
);
GamePlayer dishonest = new VariableDivergentPlayer(ABSOLUTE_PRESTATE, _dishonestTraceLength, i);
super.init(dishonest, honest, _dishonestTraceLength - 1);

// Play the game until a step is forced.
Expand All @@ -1023,11 +1019,7 @@ contract FaultDisputeGame_ResolvesCorrectly_CorrectRootFuzz is OneVsOne_Arena {
uint256 snapshot = vm.snapshot();

GamePlayer honest = new HonestPlayer(ABSOLUTE_PRESTATE);
GamePlayer dishonest = new VariableDivergentPlayer(
ABSOLUTE_PRESTATE,
_dishonestTraceLength,
i
);
GamePlayer dishonest = new VariableDivergentPlayer(ABSOLUTE_PRESTATE, _dishonestTraceLength, i);
super.init(honest, dishonest, 15);

// Play the game until a step is forced.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ contract OutputBisectionGame_Init is DisputeGameFactory_Init {
_absolutePrestate: absolutePrestate,
_genesisBlockNumber: GENESIS_BLOCK_NUMBER,
_genesisOutputRoot: GENESIS_OUTPUT_ROOT,
_maxGameDepth: 2**3,
_splitDepth: 2**2,
_maxGameDepth: 2 ** 3,
_splitDepth: 2 ** 2,
_gameDuration: Duration.wrap(7 days),
_vm: _vm
});
Expand Down Expand Up @@ -111,7 +111,7 @@ contract OutputBisectionGame_Test is OutputBisectionGame_Init {
_absolutePrestate: ABSOLUTE_PRESTATE,
_genesisBlockNumber: GENESIS_BLOCK_NUMBER,
_genesisOutputRoot: GENESIS_OUTPUT_ROOT,
_maxGameDepth: 2**3,
_maxGameDepth: 2 ** 3,
_splitDepth: _splitDepth,
_gameDuration: Duration.wrap(7 days),
_vm: alphabetVM
Expand All @@ -127,7 +127,7 @@ contract OutputBisectionGame_Test is OutputBisectionGame_Init {
_absolutePrestate: ABSOLUTE_PRESTATE,
_genesisBlockNumber: GENESIS_BLOCK_NUMBER,
_genesisOutputRoot: GENESIS_OUTPUT_ROOT,
_maxGameDepth: 2**3,
_maxGameDepth: 2 ** 3,
_splitDepth: _splitDepth,
_gameDuration: Duration.wrap(7 days),
_vm: alphabetVM
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,7 @@ contract Faucet_Initializer is Test {
vm.deal(address(faucetContractAdmin), 5 ether);
vm.deal(address(nonAdmin), 5 ether);

optimistNftFam = new AdminFaucetAuthModule(
faucetAuthAdmin,
optimistNftFamName,
optimistNftFamVersion
);
optimistNftFam = new AdminFaucetAuthModule(faucetAuthAdmin, optimistNftFamName, optimistNftFamVersion);
githubFam = new AdminFaucetAuthModule(faucetAuthAdmin, githubFamName, githubFamVersion);

faucetHelper = new FaucetHelper();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,10 +173,8 @@ contract Optimist_Initializer is Test {
vm.expectEmit(true, true, false, false);
emit Initialized(1);

optimistInviter = new OptimistInviter({
_inviteGranter: eve_inviteGranter,
_attestationStation: attestationStation
});
optimistInviter =
new OptimistInviter({ _inviteGranter: eve_inviteGranter, _attestationStation: attestationStation });

optimistInviter.initialize("OptimistInviter");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,7 @@ contract OptimistAllowlist_Initializer is Test {
optimistInviter.initialize("OptimistInviter");

optimistAllowlist = new OptimistAllowlist(
attestationStation,
alice_allowlistAttestor,
sally_coinbaseQuestAttestor,
address(optimistInviter)
attestationStation, alice_allowlistAttestor, sally_coinbaseQuestAttestor, address(optimistInviter)
);

optimistInviterHelper = new OptimistInviterHelper(optimistInviter, "OptimistInviter");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,7 @@ contract OptimismMintableERC721_Test is Bridge_Initializer {

// Set up the token pair.
L1NFT = new ERC721("L1NFT", "L1T");
L2NFT = new OptimismMintableERC721(
address(l2ERC721Bridge),
1,
address(L1NFT),
"L2NFT",
"L2T"
);
L2NFT = new OptimismMintableERC721(address(l2ERC721Bridge), 1, address(L1NFT), "L2NFT", "L2T");

// Label the addresses for nice traces.
vm.label(address(L1NFT), "L1ERC721Token");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,7 @@ contract StandardBridge_Stateless_Test is CommonTest {
function setUp() public override {
super.setUp();

bridge = new StandardBridgeTester({
_messenger: payable(address(0)),
_otherBridge: payable(address(0))
});
bridge = new StandardBridgeTester({ _messenger: payable(address(0)), _otherBridge: payable(address(0)) });

mintable = new OptimismMintableERC20({
_bridge: address(0),
Expand Down

0 comments on commit ef4b116

Please sign in to comment.