diff --git a/contracts/pair_contract.py b/contracts/pair_contract.py index 57bced1..602d75b 100644 --- a/contracts/pair_contract.py +++ b/contracts/pair_contract.py @@ -417,6 +417,14 @@ def resume(self, deployer: Account, proxy: ProxyNetworkProvider): sc_args = [] return endpoint_call(proxy, gas_limit, deployer, Address(self.address), "resume", sc_args) + def set_active_no_swaps(self, deployer: Account, proxy: ProxyNetworkProvider): + function_purpose = f"Set pair active no swaps" + logger.info(function_purpose) + + gas_limit = 10000000 + sc_args = [] + return endpoint_call(proxy, gas_limit, deployer, Address(self.address), "setStateActiveNoSwaps", sc_args) + def contract_start(self, deployer: Account, proxy: ProxyNetworkProvider, args: list = []): _ = self.resume(deployer, proxy) diff --git a/tools/contracts_upgrader.py b/tools/contracts_upgrader.py index 46f5c44..257ddd5 100644 --- a/tools/contracts_upgrader.py +++ b/tools/contracts_upgrader.py @@ -483,6 +483,12 @@ def resume_pair_contracts(dex_owner: Account, network_providers: NetworkProvider if not network_providers.check_simple_tx_status(tx_hash, f"resume pair contract: {pair_address}"): if not get_user_continue(config.FORCE_CONTINUE_PROMPT): return + elif contract_states[pair_address] == 2: + pair_contract = PairContract("", "", PairContractVersion.V2, address=pair_address) + tx_hash = pair_contract.set_active_no_swaps(dex_owner, network_providers.proxy) + if not network_providers.check_simple_tx_status(tx_hash, f"set active no swaps on pair contract: {pair_address}"): + if not get_user_continue(config.FORCE_CONTINUE_PROMPT): + return else: print(f"Contract {pair_address} wasn't touched because of initial state: {contract_states[pair_address]}")