From e2fb27b4a7c0cddf25986bb0e05f8994fc1446ae Mon Sep 17 00:00:00 2001 From: Denis Fadeev Date: Wed, 6 Sep 2023 13:08:21 +0900 Subject: [PATCH] add odd/even back --- messaging/warriors/contracts/CrossChainWarriors.sol | 5 +++-- messaging/warriors/tasks/deploy.ts | 11 +++++++---- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/messaging/warriors/contracts/CrossChainWarriors.sol b/messaging/warriors/contracts/CrossChainWarriors.sol index 4424bd8a..890cb45c 100644 --- a/messaging/warriors/contracts/CrossChainWarriors.sol +++ b/messaging/warriors/contracts/CrossChainWarriors.sol @@ -32,13 +32,14 @@ contract CrossChainWarriors is constructor( address connectorAddress, address zetaTokenAddress, - address zetaConsumerAddress + address zetaConsumerAddress, + bool useEven ) ZetaInteractor(connectorAddress) { _zetaToken = IERC20(zetaTokenAddress); _zetaConsumer = ZetaTokenConsumer(zetaConsumerAddress); tokenIds.increment(); - tokenIds.increment(); + if (useEven) tokenIds.increment(); } function mint(address to) public returns (uint256) { diff --git a/messaging/warriors/tasks/deploy.ts b/messaging/warriors/tasks/deploy.ts index bd8fe706..7262617c 100644 --- a/messaging/warriors/tasks/deploy.ts +++ b/messaging/warriors/tasks/deploy.ts @@ -11,8 +11,9 @@ const main = async (args: any, hre: HardhatRuntimeEnvironment) => { // A mapping between network names and deployed contract addresses. const contracts: { [key: string]: string } = {}; await Promise.all( - networks.map(async (networkName: string) => { - contracts[networkName] = await deployContract(hre, networkName); + networks.map(async (networkName: string, i: number) => { + const parity = i % 2 == 0; + contracts[networkName] = await deployContract(hre, networkName, parity); }) ); @@ -36,7 +37,8 @@ const initWallet = (hre: HardhatRuntimeEnvironment, networkName: string) => { // that factory. const deployContract = async ( hre: HardhatRuntimeEnvironment, - networkName: string + networkName: string, + parity: boolean ) => { const wallet = initWallet(hre, networkName); @@ -56,7 +58,8 @@ const deployContract = async ( const contract = await factory.deploy( connector, zetaToken, - zetaTokenConsumerUniV2 || zetaTokenConsumerUniV3 + zetaTokenConsumerUniV2 || zetaTokenConsumerUniV3, + parity ); await contract.deployed();