Skip to content

Commit

Permalink
chore(lint): apply lint
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxMustermann2 committed Jun 3, 2024
1 parent 74d91e6 commit 65c0671
Show file tree
Hide file tree
Showing 68 changed files with 1,662 additions and 1,682 deletions.
14 changes: 7 additions & 7 deletions script/10_DeployExocoreGatewayOnly.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import "forge-std/Script.sol";
import {BaseScript} from "./BaseScript.sol";

contract DeployExocoreGatewayOnly is BaseScript {

function setUp() public virtual override {
// load keys
super.setUp();
Expand Down Expand Up @@ -48,14 +47,15 @@ contract DeployExocoreGatewayOnly is BaseScript {
string memory exocoreContracts = "exocoreContracts";
vm.serializeAddress(exocoreContracts, "lzEndpoint", address(exocoreLzEndpoint));
vm.serializeAddress(exocoreContracts, "exocoreGatewayLogic", address(exocoreGatewayLogic));
string memory exocoreContractsOutput =
vm.serializeAddress(exocoreContracts, "exocoreGateway", address(exocoreGateway));
string memory exocoreContractsOutput = vm.serializeAddress(
exocoreContracts,
"exocoreGateway",
address(exocoreGateway)
);

string memory deployedContracts = "deployedContracts";
string memory finalJson =
vm.serializeString(deployedContracts, "exocore", exocoreContractsOutput);
string memory finalJson = vm.serializeString(deployedContracts, "exocore", exocoreContractsOutput);

vm.writeJson(finalJson, "script/deployedExocoreGatewayOnly.json");

}
}
}
7 changes: 3 additions & 4 deletions script/11_SetPeers.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,7 @@ contract SetPeersAndUpgrade is BaseScript {
uint256 i = 0;
uint256 tries = 5;
bool success;
while(i < tries) {

while (i < tries) {
vm.selectFork(exocore);
success = gateway.peers(clientChainId) == bootstrapAddr.toBytes32();

Expand Down Expand Up @@ -90,8 +89,8 @@ contract SetPeersAndUpgrade is BaseScript {
console.log(
"source .env && cast send --rpc-url $EXOCORE_TESETNET_RPC",
exocoreGatewayAddr,
"\"markBootstrapOnAllChains()\"",
'"markBootstrapOnAllChains()"',
"--private-key $TEST_ACCOUNT_THREE_PRIVATE_KEY"
);
}
}
}
33 changes: 12 additions & 21 deletions script/12_RedeployClientChainGateway.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -28,25 +28,17 @@ contract RedeployClientChainGateway is BaseScript {
stdJson.readAddress(prerequisiteContracts, ".clientChain.lzEndpoint")
);
require(address(clientChainLzEndpoint) != address(0), "client chain l0 endpoint should not be empty");
beaconOracle = EigenLayerBeaconOracle(
stdJson.readAddress(prerequisiteContracts, ".clientChain.beaconOracle")
);
beaconOracle = EigenLayerBeaconOracle(stdJson.readAddress(prerequisiteContracts, ".clientChain.beaconOracle"));
require(address(beaconOracle) != address(0), "beacon oracle should not be empty");
vaultBeacon = UpgradeableBeacon(
stdJson.readAddress(prerequisiteContracts, ".clientChain.vaultBeacon")
);
vaultBeacon = UpgradeableBeacon(stdJson.readAddress(prerequisiteContracts, ".clientChain.vaultBeacon"));
require(address(vaultBeacon) != address(0), "vault beacon should not be empty");
capsuleBeacon = UpgradeableBeacon(
stdJson.readAddress(prerequisiteContracts, ".clientChain.capsuleBeacon")
);
capsuleBeacon = UpgradeableBeacon(stdJson.readAddress(prerequisiteContracts, ".clientChain.capsuleBeacon"));
require(address(capsuleBeacon) != address(0), "capsule beacon should not be empty");
beaconProxyBytecode = BeaconProxyBytecode(
stdJson.readAddress(prerequisiteContracts, ".clientChain.beaconProxyBytecode")
);
require(address(beaconProxyBytecode) != address(0), "beacon proxy bytecode should not be empty");
bootstrap = Bootstrap(
stdJson.readAddress(prerequisiteContracts, ".clientChain.bootstrap")
);
bootstrap = Bootstrap(stdJson.readAddress(prerequisiteContracts, ".clientChain.bootstrap"));
require(address(bootstrap) != address(0), "bootstrap should not be empty");
clientChain = vm.createSelectFork(clientChainRPCURL);
}
Expand All @@ -69,20 +61,19 @@ contract RedeployClientChainGateway is BaseScript {
exocoreValidatorSet.addr,
emptyList
);
bootstrap.setClientChainGatewayLogic(
address(clientGatewayLogic),
initialization
);
bootstrap.setClientChainGatewayLogic(address(clientGatewayLogic), initialization);
vm.stopBroadcast();

string memory clientChainContracts = "clientChainContracts";
string memory clientChainContractsOutput =
vm.serializeAddress(clientChainContracts, "clientGatewayLogic", address(clientGatewayLogic));
string memory clientChainContractsOutput = vm.serializeAddress(
clientChainContracts,
"clientGatewayLogic",
address(clientGatewayLogic)
);

string memory deployedContracts = "deployedContracts";
string memory finalJson =
vm.serializeString(deployedContracts, "clientChain", clientChainContractsOutput);
string memory finalJson = vm.serializeString(deployedContracts, "clientChain", clientChainContractsOutput);

vm.writeJson(finalJson, "script/redeployClientChainGateway.json");
}
}
}
14 changes: 10 additions & 4 deletions script/1_Prerequisities.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,11 @@ contract PrerequisitiesScript is BaseScript {
string memory exocoreContracts = "exocoreContracts";
vm.serializeAddress(clientChainContracts, "lzEndpoint", address(clientChainLzEndpoint));
vm.serializeAddress(clientChainContracts, "beaconOracle", address(beaconOracle));
string memory clientChainContractsOutput =
vm.serializeAddress(clientChainContracts, "erc20Token", address(restakeToken));
string memory clientChainContractsOutput = vm.serializeAddress(
clientChainContracts,
"erc20Token",
address(restakeToken)
);

if (useExocorePrecompileMock) {
vm.serializeAddress(exocoreContracts, "depositPrecompileMock", depositMock);
Expand All @@ -66,8 +69,11 @@ contract PrerequisitiesScript is BaseScript {
vm.serializeAddress(exocoreContracts, "claimRewardPrecompileMock", claimRewardMock);
}

string memory exocoreContractsOutput =
vm.serializeAddress(exocoreContracts, "lzEndpoint", address(exocoreLzEndpoint));
string memory exocoreContractsOutput = vm.serializeAddress(
exocoreContracts,
"lzEndpoint",
address(exocoreLzEndpoint)
);

vm.serializeString(deployedContracts, "clientChain", clientChainContractsOutput);
string memory finalJson = vm.serializeString(deployedContracts, "exocore", exocoreContractsOutput);
Expand Down
28 changes: 20 additions & 8 deletions script/2_DeployBoth.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ contract DeployScript is BaseScript {

// deploy beacon chain oracle
beaconOracle = _deployBeaconOracle();

/// deploy vault implementation contract and capsule implementation contract
/// that has logics called by proxy
vaultImplementation = new Vault();
Expand Down Expand Up @@ -113,7 +113,11 @@ contract DeployScript is BaseScript {

if (useExocorePrecompileMock) {
ExocoreGatewayMock exocoreGatewayLogic = new ExocoreGatewayMock(
address(exocoreLzEndpoint), depositMock, withdrawMock, delegationMock, claimRewardMock
address(exocoreLzEndpoint),
depositMock,
withdrawMock,
delegationMock,
claimRewardMock
);
exocoreGateway = ExocoreGateway(
payable(
Expand All @@ -122,7 +126,8 @@ contract DeployScript is BaseScript {
address(exocoreGatewayLogic),
address(exocoreProxyAdmin),
abi.encodeWithSelector(
exocoreGatewayLogic.initialize.selector, payable(exocoreValidatorSet.addr)
exocoreGatewayLogic.initialize.selector,
payable(exocoreValidatorSet.addr)
)
)
)
Expand All @@ -137,7 +142,8 @@ contract DeployScript is BaseScript {
address(exocoreGatewayLogic),
address(exocoreProxyAdmin),
abi.encodeWithSelector(
exocoreGatewayLogic.initialize.selector, payable(exocoreValidatorSet.addr)
exocoreGatewayLogic.initialize.selector,
payable(exocoreValidatorSet.addr)
)
)
)
Expand All @@ -158,8 +164,11 @@ contract DeployScript is BaseScript {
vm.serializeAddress(clientChainContracts, "vaultBeacon", address(vaultBeacon));
vm.serializeAddress(clientChainContracts, "capsuleBeacon", address(capsuleBeacon));
vm.serializeAddress(clientChainContracts, "beaconProxyBytecode", address(beaconProxyBytecode));
string memory clientChainContractsOutput =
vm.serializeAddress(clientChainContracts, "proxyAdmin", address(clientChainProxyAdmin));
string memory clientChainContractsOutput = vm.serializeAddress(
clientChainContracts,
"proxyAdmin",
address(clientChainProxyAdmin)
);

vm.serializeAddress(exocoreContracts, "lzEndpoint", address(exocoreLzEndpoint));
vm.serializeAddress(exocoreContracts, "exocoreGateway", address(exocoreGateway));
Expand All @@ -171,8 +180,11 @@ contract DeployScript is BaseScript {
vm.serializeAddress(exocoreContracts, "claimRewardPrecompileMock", claimRewardMock);
}

string memory exocoreContractsOutput =
vm.serializeAddress(exocoreContracts, "proxyAdmin", address(exocoreProxyAdmin));
string memory exocoreContractsOutput = vm.serializeAddress(
exocoreContracts,
"proxyAdmin",
address(exocoreProxyAdmin)
);

vm.serializeString(deployedContracts, "clientChain", clientChainContractsOutput);
string memory finalJson = vm.serializeString(deployedContracts, "exocore", exocoreContractsOutput);
Expand Down
11 changes: 7 additions & 4 deletions script/3_Setup.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ contract SetupScript is BaseScript {

string memory deployedContracts = vm.readFile("script/deployedContracts.json");

clientGateway =
IClientChainGateway(payable(stdJson.readAddress(deployedContracts, ".clientChain.clientChainGateway")));
clientGateway = IClientChainGateway(
payable(stdJson.readAddress(deployedContracts, ".clientChain.clientChainGateway"))
);
require(address(clientGateway) != address(0), "clientGateway address should not be empty");

clientChainLzEndpoint = ILayerZeroEndpointV2(stdJson.readAddress(deployedContracts, ".clientChain.lzEndpoint"));
Expand Down Expand Up @@ -53,7 +54,8 @@ contract SetupScript is BaseScript {
// set the destination endpoint for corresponding destinations in endpoint mock if USE_ENDPOINT_MOCK is true
if (useEndpointMock) {
NonShortCircuitEndpointV2Mock(address(clientChainLzEndpoint)).setDestLzEndpoint(
address(exocoreGateway), address(exocoreLzEndpoint)
address(exocoreGateway),
address(exocoreLzEndpoint)
);
}

Expand All @@ -68,7 +70,8 @@ contract SetupScript is BaseScript {
// set the destination endpoint for corresponding destinations in endpoint mock if USE_ENDPOINT_MOCK is true
if (useEndpointMock) {
NonShortCircuitEndpointV2Mock(address(exocoreLzEndpoint)).setDestLzEndpoint(
address(clientGateway), address(clientChainLzEndpoint)
address(clientGateway),
address(clientChainLzEndpoint)
);
}
exocoreGateway.setPeer(clientChainId, address(clientGateway).toBytes32());
Expand Down
11 changes: 8 additions & 3 deletions script/4_Deposit.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@ contract DepositScript is BaseScript {

string memory deployedContracts = vm.readFile("script/deployedContracts.json");

clientGateway =
IClientChainGateway(payable(stdJson.readAddress(deployedContracts, ".clientChain.clientChainGateway")));
clientGateway = IClientChainGateway(
payable(stdJson.readAddress(deployedContracts, ".clientChain.clientChainGateway"))
);
require(address(clientGateway) != address(0), "clientGateway address should not be empty");

clientChainLzEndpoint = ILayerZeroEndpointV2(stdJson.readAddress(deployedContracts, ".clientChain.lzEndpoint"));
Expand Down Expand Up @@ -80,7 +81,11 @@ contract DepositScript is BaseScript {
Origin(clientChainId, address(clientGateway).toBytes32(), nonce),
address(exocoreGateway),
GUID.generate(
nonce, clientChainId, address(clientGateway), exocoreChainId, address(exocoreGateway).toBytes32()
nonce,
clientChainId,
address(clientGateway),
exocoreChainId,
address(exocoreGateway).toBytes32()
),
msg_,
bytes("")
Expand Down
11 changes: 8 additions & 3 deletions script/5_Withdraw.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ contract DepositScript is BaseScript {

string memory deployedContracts = vm.readFile("script/deployedContracts.json");

clientGateway =
IClientChainGateway(payable(stdJson.readAddress(deployedContracts, ".clientChain.clientChainGateway")));
clientGateway = IClientChainGateway(
payable(stdJson.readAddress(deployedContracts, ".clientChain.clientChainGateway"))
);
require(address(clientGateway) != address(0), "clientGateway address should not be empty");

clientChainLzEndpoint = ILayerZeroEndpointV2(stdJson.readAddress(deployedContracts, ".clientChain.lzEndpoint"));
Expand Down Expand Up @@ -79,7 +80,11 @@ contract DepositScript is BaseScript {
Origin(clientChainId, address(clientGateway).toBytes32(), nonce),
address(exocoreGateway),
GUID.generate(
nonce, clientChainId, address(clientGateway), exocoreChainId, address(exocoreGateway).toBytes32()
nonce,
clientChainId,
address(clientGateway),
exocoreChainId,
address(exocoreGateway).toBytes32()
),
msg_,
bytes("")
Expand Down
5 changes: 3 additions & 2 deletions script/6_CreateExoCapsule.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@ contract DepositScript is BaseScript {

string memory deployedContracts = vm.readFile("script/deployedContracts.json");

clientGateway =
IClientChainGateway(payable(stdJson.readAddress(deployedContracts, ".clientChain.clientChainGateway")));
clientGateway = IClientChainGateway(
payable(stdJson.readAddress(deployedContracts, ".clientChain.clientChainGateway"))
);
require(address(clientGateway) != address(0), "clientGateway address should not be empty");

if (!useExocorePrecompileMock) {
Expand Down
Loading

0 comments on commit 65c0671

Please sign in to comment.