From 9f3fc993895d673c655f122332803cc3c1501140 Mon Sep 17 00:00:00 2001 From: albert Date: Tue, 5 Mar 2024 16:47:50 +0100 Subject: [PATCH] chore: add deployment usdt --- scripts/deploy_contracts.py | 9 +++++++++ tests/deploy.py | 19 +++++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/scripts/deploy_contracts.py b/scripts/deploy_contracts.py index 9d8efcf6..43ea13fb 100644 --- a/scripts/deploy_contracts.py +++ b/scripts/deploy_contracts.py @@ -13,6 +13,7 @@ StateChainGateway, FLIP, MockUSDC, + MockUSDT, DeployerContract, AddressChecker, CFTester, @@ -21,6 +22,7 @@ from deploy import ( deploy_Chainflip_contracts, deploy_usdc_contract, + deploy_usdt_contract, deploy_new_cfReceiver, deploy_contracts_secondary_evm, ) @@ -179,6 +181,11 @@ def deploy_optional_contracts(cf, addressDump): cf.cfTester = deploy_new_cfReceiver(deployer, CFTester, cf.vault.address) addressDump["CF_TESTER"] = cf.cfTester.address + # Keeping the order to not change the final addresses + if chain.id in [arb_localnet, eth_localnet, hardhat]: + cf.mockUSDT = deploy_usdt_contract(deployer, MockUSDT, cf_accs[0:10]) + addressDump["USDT_ADDRESS"] = cf.mockUSDT.address + def display_common_deployment_params(chain_id, deployer, govKey, commKey, aggKey): print(f" Chain: {chain_id}") @@ -218,6 +225,8 @@ def display_deployed_contracts(cf): # Contracts dependant on localnet/testnet/mainnet if hasattr(cf, "mockUSDC"): print(f" USDC: {cf.mockUSDC.address}") + if hasattr(cf, "mockUSDC"): + print(f" USDT: {cf.mockUSDT.address}") if hasattr(cf, "cfTester"): print(f" CFTester: {cf.cfTester.address}") diff --git a/tests/deploy.py b/tests/deploy.py index 9517d959..dec851d6 100644 --- a/tests/deploy.py +++ b/tests/deploy.py @@ -237,6 +237,25 @@ def deploy_usdc_contract(deployer, MockUSDC, accounts): return mockUsdc +# Deploy USDCT mock token +def deploy_usdt_contract(deployer, MockUSDT, accounts): + # Set the priority fee for all transactions and the required number of confirmations. + required_confs = transaction_params() + + mockUsdt = MockUSDT.deploy( + "Tether USD", + "USDT", + INIT_USDC_SUPPLY, + {"from": deployer, "required_confs": required_confs}, + ) + # Distribute tokens to other accounts + for account in accounts: + if account != deployer and mockUsdt.balanceOf(deployer) >= INIT_USDC_ACCOUNT: + mockUsdt.transfer(account, INIT_USDC_ACCOUNT, {"from": deployer}) + + return mockUsdt + + def deploy_addressHolder( deployer, AddressHolder,