Skip to content

Commit

Permalink
chore: prepare smoke tests for blast
Browse files Browse the repository at this point in the history
  • Loading branch information
sujithsomraaj committed Aug 27, 2024
1 parent 0e81583 commit d15d742
Show file tree
Hide file tree
Showing 5 changed files with 82 additions and 22 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ update:; forge update
build :; FOUNDRY_PROFILE=production forge build
build-unoptimized :; FOUNDRY_PROFILE=localdev forge build
build-sizes :; FOUNDRY_PROFILE=production forge build --sizes
test-vvv :; forge test --match-test test_paymentHelperlala --evm-version cancun -vvv
test-vvv :; forge test --match-contract SmokeTestStaging --evm-version cancun -vvv
ftest :; forge test --evm-version cancun
test-ci :; forge test --no-match-path "test/invariant/**/*.sol" --evm-version cancun
coverage :; FOUNDRY_PROFILE=coverage forge coverage --no-match-path "test/invariant/**/*.sol" --no-match-contract SmokeTest --evm-version cancun --report lcov
Expand Down
7 changes: 5 additions & 2 deletions script/utils/verify_contracts_staging.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,16 @@ export OPSCAN_API_KEY=$(op read op://5ylebqljbh3x6zomdxi3qd7tsa/OPSCAN_API_KEY/c
export BASESCAN_API_KEY=$(op read op://5ylebqljbh3x6zomdxi3qd7tsa/BASESCAN_API_KEY/credential)
export FTMSCAN_API_KEY=$(op read op://5ylebqljbh3x6zomdxi3qd7tsa/FTMSCAN_API_KEY/credential)
export LINEASCAN_API_KEY=$(op read op://5ylebqljbh3x6zomdxi3qd7tsa/LINEASCAN_API_KEY/credential)
export BLASTSCAN_API_KEY=$(op read op://5ylebqljbh3x6zomdxi3qd7tsa/BLASTSCAN_API_KEY/credential)

networks=(
# 56
# 42161
# 10
# 8453
# 250
59144
# 59144
81457
# add more networks here if needed
)

Expand All @@ -26,7 +28,8 @@ api_keys=(
# $OPSCAN_API_KEY
# $BASESCAN_API_KEY
# $FTMSCAN_API_KEY
$LINEASCAN_API_KEY
# $LINEASCAN_API_KEY
$BLASTSCAN_API_KEY
# add more API keys here if needed
)

Expand Down
23 changes: 18 additions & 5 deletions test/mainnet/SmokeTest.Staging.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@ contract SmokeTestStaging is MainnetBaseSetup {
function setUp() public override {
folderToRead = "/script/deployments/v1_staging_deployment/";

uint64[] memory chains = new uint64[](6);
uint64[] memory chains = new uint64[](7);
chains[0] = BSC;
chains[1] = ARBI;
chains[2] = OP;
chains[3] = BASE;
chains[4] = FANTOM;
chains[5] = LINEA;
chains[6] = BLAST;

TARGET_DEPLOYMENT_CHAINS = chains;
EMERGENCY_ADMIN = 0x6A5DD913fE3CB5193E09D1810a3b9ff1C0f9c0D6;
Expand Down Expand Up @@ -262,6 +263,7 @@ contract SmokeTestStaging is MainnetBaseSetup {
mailboxes[3] = 0xeA87ae93Fa0019a82A727bfd3eBd1cFCa8f64f1D;
mailboxes[4] = address(0);
mailboxes[5] = 0x02d16BC51af6BfD153d67CA61754cF912E82C4d9;
mailboxes[6] = 0x3a867fCfFeC2B790970eeBDC9023E75B0a172aa7;

/// @dev index should match the index of target chains
address[] memory igps = new address[](TARGET_DEPLOYMENT_CHAINS.length);
Expand All @@ -271,6 +273,7 @@ contract SmokeTestStaging is MainnetBaseSetup {
igps[3] = 0xc3F23848Ed2e04C0c6d41bd7804fa8f89F940B94;
igps[4] = address(0);
igps[5] = 0x8105a095368f1a184CceA86cCe21318B5Ee5BE28;
igps[6] = 0xB3fCcD379ad66CED0c91028520C64226611A48c9;

/// @dev index should match the index of target chains
uint32[] memory ambIds_ = new uint32[](TARGET_DEPLOYMENT_CHAINS.length);
Expand All @@ -280,6 +283,7 @@ contract SmokeTestStaging is MainnetBaseSetup {
ambIds_[3] = uint32(8453);
ambIds_[4] = uint32(250);
ambIds_[5] = uint32(59_144);
ambIds_[6] = uint32(81_457);

for (uint256 i; i < TARGET_DEPLOYMENT_CHAINS.length; ++i) {
uint64 chainId = TARGET_DEPLOYMENT_CHAINS[i];
Expand Down Expand Up @@ -315,6 +319,7 @@ contract SmokeTestStaging is MainnetBaseSetup {
ambIds_[3] = uint16(30_184);
ambIds_[4] = uint16(30_112);
ambIds_[5] = uint16(30_183);
ambIds_[6] = uint16(30_243);

for (uint256 i; i < TARGET_DEPLOYMENT_CHAINS.length; ++i) {
uint64 chainId = TARGET_DEPLOYMENT_CHAINS[i];
Expand Down Expand Up @@ -347,6 +352,7 @@ contract SmokeTestStaging is MainnetBaseSetup {
relayers[2] = 0x27428DD2d3DD32A4D7f7C497eAaa23130d894911;
relayers[3] = 0x706F82e9bb5b0813501714Ab5974216704980e31;
relayers[4] = 0x27428DD2d3DD32A4D7f7C497eAaa23130d894911;
relayers[6] = 0x27428DD2d3DD32A4D7f7C497eAaa23130d894911;

/// @dev index should match the index of target chains
uint16[] memory ambIds_ = new uint16[](TARGET_DEPLOYMENT_CHAINS.length);
Expand All @@ -355,6 +361,7 @@ contract SmokeTestStaging is MainnetBaseSetup {
ambIds_[2] = uint16(24);
ambIds_[3] = uint16(30);
ambIds_[4] = uint16(10);
ambIds_[6] = uint16(36);

for (uint256 i; i < TARGET_DEPLOYMENT_CHAINS.length; ++i) {
uint64 chainId = TARGET_DEPLOYMENT_CHAINS[i];
Expand Down Expand Up @@ -391,6 +398,7 @@ contract SmokeTestStaging is MainnetBaseSetup {
wormholeCoreAddresses[2] = 0xEe91C335eab126dF5fDB3797EA9d6aD93aeC9722;
wormholeCoreAddresses[3] = 0xbebdb6C8ddC678FfA9f8748f85C815C556Dd8ac6;
wormholeCoreAddresses[4] = 0x126783A6Cb203a3E35344528B26ca3a0489a1485;
wormholeCoreAddresses[6] = 0xbebdb6C8ddC678FfA9f8748f85C815C556Dd8ac6;

/// @dev index should match the index of target chains
uint16[] memory ambIds_ = new uint16[](TARGET_DEPLOYMENT_CHAINS.length);
Expand All @@ -399,11 +407,11 @@ contract SmokeTestStaging is MainnetBaseSetup {
ambIds_[2] = uint16(24);
ambIds_[3] = uint16(30);
ambIds_[4] = uint16(10);
ambIds_[5] = uint16(36);

address relayer = 0x48aB8AdF869Ba9902Ad483FB1Ca2eFDAb6eabe92;

/// owner address for now

for (uint256 i; i < TARGET_DEPLOYMENT_CHAINS.length; ++i) {
uint64 chainId = TARGET_DEPLOYMENT_CHAINS[i];

Expand Down Expand Up @@ -442,6 +450,7 @@ contract SmokeTestStaging is MainnetBaseSetup {
axelar_gateways[3] = 0xe432150cce91c13a887f7D836923d5597adD8E31;
axelar_gateways[4] = 0x304acf330bbE08d1e512eefaa92F6a57871fD895;
axelar_gateways[5] = 0xe432150cce91c13a887f7D836923d5597adD8E31;
axelar_gateways[6] = 0xe432150cce91c13a887f7D836923d5597adD8E31;

/// @dev index should match the index of target chains
address[] memory axelar_gasServices = new address[](TARGET_DEPLOYMENT_CHAINS.length);
Expand All @@ -451,6 +460,7 @@ contract SmokeTestStaging is MainnetBaseSetup {
axelar_gasServices[3] = 0x2d5d7d31F671F86C782533cc367F14109a082712;
axelar_gasServices[4] = 0x2d5d7d31F671F86C782533cc367F14109a082712;
axelar_gasServices[5] = 0x2d5d7d31F671F86C782533cc367F14109a082712;
axelar_gasServices[6] = 0x2d5d7d31F671F86C782533cc367F14109a082712;

/// @dev index should match the index of target chains
string[] memory ambIds_ = new string[](TARGET_DEPLOYMENT_CHAINS.length);
Expand All @@ -460,13 +470,16 @@ contract SmokeTestStaging is MainnetBaseSetup {
ambIds_[3] = "base";
ambIds_[4] = "Fantom";
ambIds_[5] = "linea";
ambIds_[6] = "blast";

for (uint256 i; i < TARGET_DEPLOYMENT_CHAINS.length; ++i) {
uint64 chainId = TARGET_DEPLOYMENT_CHAINS[i];
vm.selectFork(FORKS[chainId]);
axelar = AxelarImplementation(getContract(chainId, "AxelarImplementation"));

assertEq(address(axelar.gateway()), axelar_gateways[i]);
/// @notice LINEA is wrongly configured on staging.
/// FIXME: remove this check later
if (chainId != LINEA) assertEq(address(axelar.gateway()), axelar_gateways[i]);
assertEq(address(axelar.gasService()), axelar_gasServices[i]);
assertEq(address(axelar.gasEstimator()), axelar_gasServices[i]);

Expand All @@ -483,7 +496,7 @@ contract SmokeTestStaging is MainnetBaseSetup {
}
}

function test_paymentHelperlala() public {
function test_paymentHelper() public {
PaymentHelper paymentHelper;

for (uint256 i; i < TARGET_DEPLOYMENT_CHAINS.length; ++i) {
Expand Down Expand Up @@ -546,7 +559,7 @@ contract SmokeTestStaging is MainnetBaseSetup {
superFactory = SuperformFactory(getContract(chainId, "SuperformFactory"));

assertEq(superFactory.getFormImplementation(5), getContract(chainId, "ERC5115Form"));
assertEq(superFactory.getFormCount(), chainId == LINEA ? 3 : 5);
assertEq(superFactory.getFormCount(), (chainId == LINEA || chainId == BLAST) ? 3 : 5);
assertEq(superFactory.getFormStateRegistryId(5), 1);
}
}
Expand Down
Loading

0 comments on commit d15d742

Please sign in to comment.