From 93fb3acb044fa240d64b638141239dfa81459a9c Mon Sep 17 00:00:00 2001 From: Thrilok kumar Date: Wed, 3 Jul 2024 20:16:10 -0400 Subject: [PATCH] added small condition to avoid race condition --- contracts/payloads/IGP31/PayloadIGP31.sol | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/contracts/payloads/IGP31/PayloadIGP31.sol b/contracts/payloads/IGP31/PayloadIGP31.sol index 1cdddde..a53207d 100644 --- a/contracts/payloads/IGP31/PayloadIGP31.sol +++ b/contracts/payloads/IGP31/PayloadIGP31.sol @@ -326,6 +326,8 @@ interface IFluidVaultT1Factory { function readFromStorage( bytes32 slot_ ) external view returns (uint256 result_); + + function totalVaults() external view returns (uint256); } interface IFluidVaultT1DeploymentLogic { @@ -476,6 +478,10 @@ contract PayloadIGP31 { /// @notice Action 1: Deploy wBTC/ETH and ETH/wBTC vaults. function action1() internal { + { + require(VAULT_T1_FACTORY.totalVaults() == 22, "total-vaults-doesn't-match"); + } + VaultConfig memory vaultConfig = VaultConfig({ // user supply config for the vault on Liquidity Layer. supplyToken: address(0),