Skip to content

Commit

Permalink
add odd/even back
Browse files Browse the repository at this point in the history
  • Loading branch information
fadeev committed Sep 6, 2023
1 parent acb38d5 commit e2fb27b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
5 changes: 3 additions & 2 deletions messaging/warriors/contracts/CrossChainWarriors.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
11 changes: 7 additions & 4 deletions messaging/warriors/tasks/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
})
);

Expand All @@ -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);

Expand All @@ -56,7 +58,8 @@ const deployContract = async (
const contract = await factory.deploy(
connector,
zetaToken,
zetaTokenConsumerUniV2 || zetaTokenConsumerUniV3
zetaTokenConsumerUniV2 || zetaTokenConsumerUniV3,
parity
);

await contract.deployed();
Expand Down

0 comments on commit e2fb27b

Please sign in to comment.