diff --git a/scripts/addItemTypes/itemTypes/rfSzn5Bdgs.ts b/scripts/addItemTypes/itemTypes/rfSzn5Bdgs.ts new file mode 100644 index 000000000..5afee857d --- /dev/null +++ b/scripts/addItemTypes/itemTypes/rfSzn5Bdgs.ts @@ -0,0 +1,356 @@ +import { ItemTypeInputNew } from "../../itemTypeHelpers"; + +export const itemTypes: ItemTypeInputNew[] = [ + { + name: "CHAAMPION of Rarity Farming SZN5 (Rarity)", + description: + "Scored across all four rounds, this Aavegotchi is the ultimate chaampion of RARITY for Rarity Farming SZN 5. FANTASTIC! From January 31st to March 28th, 2023, the fifth season of Rarity Farming distributed 1.5 million GHST over 8 weeks. Each of the 3 leaderboards has 7500 winning gotchis each round!", + svgId: 388, + minLevel: 0, + canBeTransferred: false, + rarityLevel: "godlike", + maxQuantity: 1, + totalQuantity: 0, + setId: [], + author: "xibot", + dimensions: { x: 0, y: 0, width: 0, height: 0 }, + allowedCollaterals: [], + ghstPrice: 0, + traitModifiers: [0, 0, 0, 0, 0, 0], + slotPositions: "none", + category: 1, + experienceBonus: 0, + kinshipBonus: 0, + canPurchaseWithGhst: false, + }, + { + name: "CHAAMPION of Rarity Farming SZN5 (Kinship)", + description: + "Scored across all four rounds, this Aavegotchi is the ultimate chaampion of KINSHIP for Rarity Farming SZN 5. FANTASTIC! From January 31st to March 28th, 2023, the fifth season of Rarity Farming distributed 1.5 million GHST over 8 weeks. Each of the 3 leaderboards has 7500 winning gotchis each round!", + svgId: 389, + minLevel: 0, + canBeTransferred: false, + rarityLevel: "godlike", + maxQuantity: 1, + totalQuantity: 0, + setId: [], + author: "xibot", + dimensions: { x: 0, y: 0, width: 0, height: 0 }, + allowedCollaterals: [], + ghstPrice: 0, + traitModifiers: [0, 0, 0, 0, 0, 0], + slotPositions: "none", + category: 1, + experienceBonus: 0, + kinshipBonus: 0, + canPurchaseWithGhst: false, + }, + { + name: "CHAAMPION of Rarity Farming SZN5 (XP)", + description: + "Scored across all four rounds, this Aavegotchi is the ultimate chaampion of XP for Rarity Farming SZN 5. FANTASTIC! From January 31st to March 28th, 2023, the fifth season of Rarity Farming distributed 1.5 million GHST over 8 weeks. Each of the 3 leaderboards has 7500 winning gotchis each round!", + svgId: 390, + minLevel: 0, + canBeTransferred: false, + rarityLevel: "godlike", + maxQuantity: 1, + totalQuantity: 0, + setId: [], + author: "xibot", + dimensions: { x: 0, y: 0, width: 0, height: 0 }, + allowedCollaterals: [], + ghstPrice: 0, + traitModifiers: [0, 0, 0, 0, 0, 0], + slotPositions: "none", + category: 1, + experienceBonus: 0, + kinshipBonus: 0, + canPurchaseWithGhst: false, + }, + { + name: "Rarity Farming SZN5 RARITY 2nd Place", + description: + "Scored across all four rounds, this Aavegotchi is the 2nd highest ranked of all RARITY for Rarity Farming SZN 5. Incredible! From January 31st to March 28th, 2023, the fifth season of Rarity Farming distributed 1.5 million GHST over 8 weeks. Each of the 3 leaderboards has 7500 winning gotchis each round!", + svgId: 391, + minLevel: 0, + canBeTransferred: false, + rarityLevel: "godlike", + maxQuantity: 1, + totalQuantity: 0, + setId: [], + author: "xibot", + dimensions: { x: 0, y: 0, width: 0, height: 0 }, + allowedCollaterals: [], + ghstPrice: 0, + traitModifiers: [0, 0, 0, 0, 0, 0], + slotPositions: "none", + category: 1, + experienceBonus: 0, + kinshipBonus: 0, + canPurchaseWithGhst: false, + }, + { + name: "Rarity Farming SZN5 KINSHIP 2nd Place", + description: + "Scored across all four rounds, this Aavegotchi is the 2nd highest ranked of all KINSHIP for Rarity Farming SZN 5. Incredible! From January 31st to March 28th, 2023, the fifth season of Rarity Farming distributed 1.5 million GHST over 8 weeks. Each of the 3 leaderboards has 7500 winning gotchis each round!", + svgId: 392, + minLevel: 0, + canBeTransferred: false, + rarityLevel: "godlike", + maxQuantity: 1, + totalQuantity: 0, + setId: [], + author: "xibot", + dimensions: { x: 0, y: 0, width: 0, height: 0 }, + allowedCollaterals: [], + ghstPrice: 0, + traitModifiers: [0, 0, 0, 0, 0, 0], + slotPositions: "none", + category: 1, + experienceBonus: 0, + kinshipBonus: 0, + canPurchaseWithGhst: false, + }, + { + name: "Rarity Farming SZN5 XP 2nd Place", + description: + "Scored across all four rounds, this Aavegotchi is the 2nd highest ranked of all XP for Rarity Farming SZN 5. Incredible! From January 31st to March 28th, 2023, the fifth season of Rarity Farming distributed 1.5 million GHST over 8 weeks. Each of the 3 leaderboards has 5k to 7500 winning gotchis each round!", + svgId: 393, + minLevel: 0, + canBeTransferred: false, + rarityLevel: "godlike", + maxQuantity: 1, + totalQuantity: 0, + setId: [], + author: "xibot", + dimensions: { x: 0, y: 0, width: 0, height: 0 }, + allowedCollaterals: [], + ghstPrice: 0, + traitModifiers: [0, 0, 0, 0, 0, 0], + slotPositions: "none", + category: 1, + experienceBonus: 0, + kinshipBonus: 0, + canPurchaseWithGhst: false, + }, + { + name: "Rarity Farming SZN5 RARITY 3rd Place", + description: + "Scored across all four rounds, this Aavegotchi is the 3rd highest ranked of all RARITY for Rarity Farming SZN 5. Impressive! From January 31st to March 28th, 2023, the fifth season of Rarity Farming distributed 1.5 million GHST over 8 weeks. Each of the 3 leaderboards has 7500 winning gotchis each round!", + svgId: 394, + minLevel: 0, + canBeTransferred: false, + rarityLevel: "godlike", + maxQuantity: 1, + totalQuantity: 0, + setId: [], + author: "xibot", + dimensions: { x: 0, y: 0, width: 0, height: 0 }, + allowedCollaterals: [], + ghstPrice: 0, + traitModifiers: [0, 0, 0, 0, 0, 0], + slotPositions: "none", + category: 1, + experienceBonus: 0, + kinshipBonus: 0, + canPurchaseWithGhst: false, + }, + { + name: "Rarity Farming SZN5 KINSHIP 3rd Place", + description: + "Scored across all four rounds, this Aavegotchi is the 3rd highest ranked of all KINSHIP for Rarity Farming SZN 5. Impressive! From January 31st to March 28th, 2023, the fifth season of Rarity Farming distributed 1.5 million GHST over 8 weeks. Each of the 3 leaderboards has 7500 winning gotchis each round!", + svgId: 395, + minLevel: 0, + canBeTransferred: false, + rarityLevel: "godlike", + maxQuantity: 1, + totalQuantity: 0, + setId: [], + author: "xibot", + dimensions: { x: 0, y: 0, width: 0, height: 0 }, + allowedCollaterals: [], + ghstPrice: 0, + traitModifiers: [0, 0, 0, 0, 0, 0], + slotPositions: "none", + category: 1, + experienceBonus: 0, + kinshipBonus: 0, + canPurchaseWithGhst: false, + }, + { + name: "Rarity Farming SZN5 XP 3rd Place", + description: + "Scored across all four rounds, this Aavegotchi is the 3rd highest ranked of all XP for Rarity Farming SZN 5. Impressive! From January 31st to March 28th, 2023, the fifth season of Rarity Farming distributed 1.5 million GHST over 8 weeks. Each of the 3 leaderboards has 7500 winning gotchis each round!", + svgId: 396, + minLevel: 0, + canBeTransferred: false, + rarityLevel: "godlike", + maxQuantity: 1, + totalQuantity: 0, + setId: [], + author: "xibot", + dimensions: { x: 0, y: 0, width: 0, height: 0 }, + allowedCollaterals: [], + ghstPrice: 0, + traitModifiers: [0, 0, 0, 0, 0, 0], + slotPositions: "none", + category: 1, + experienceBonus: 0, + kinshipBonus: 0, + canPurchaseWithGhst: false, + }, + { + name: "Rarity Farming SZN5 Raanked", + description: + "This Aavegotchi achieved leaderboard ranking in at least one category during the fifth season of Rarity Farming. From January 31st to March 28th, 2023, the fifth season of Rarity Farming distributed 1.5 million GHST over 8 weeks. Each of the 3 leaderboards has 7500 winning gotchis each round!", + svgId: 397, + minLevel: 0, + canBeTransferred: false, + rarityLevel: "common", + maxQuantity: 12809, + totalQuantity: 0, + setId: [], + author: "xibot", + dimensions: { x: 0, y: 0, width: 0, height: 0 }, + allowedCollaterals: [], + ghstPrice: 0, + traitModifiers: [0, 0, 0, 0, 0, 0], + slotPositions: "none", + category: 1, + experienceBonus: 0, + kinshipBonus: 0, + canPurchaseWithGhst: false, + }, + { + name: "Rarity Farming SZN5 RARITY Top 10", + description: + "This Aavegotchi achieved a rank in the top 10 of RARITY for Rarity Farming SZN 5. From January 31st to March 28th, 2023, the fifth season of Rarity Farming distributed 1.5 million GHST over 8 weeks. Each of the 3 leaderboards has 7500 winning gotchis each round!", + svgId: 398, + minLevel: 0, + canBeTransferred: false, + rarityLevel: "mythical", + maxQuantity: 7, + totalQuantity: 0, + setId: [], + author: "xibot", + dimensions: { x: 0, y: 0, width: 0, height: 0 }, + allowedCollaterals: [], + ghstPrice: 0, + traitModifiers: [0, 0, 0, 0, 0, 0], + slotPositions: "none", + category: 1, + experienceBonus: 0, + kinshipBonus: 0, + canPurchaseWithGhst: false, + }, + { + name: "Rarity Farming SZN5 KINSHIP Top 10", + description: + "This Aavegotchi achieved a rank in the top 10 of KINSHIP for Rarity Farming SZN 5. From January 31st to March 28th, 2023, the fifth season of Rarity Farming distributed 1.5 million GHST over 8 weeks. Each of the 3 leaderboards has 7500 winning gotchis each round!", + svgId: 399, + minLevel: 0, + canBeTransferred: false, + rarityLevel: "mythical", + maxQuantity: 7, + totalQuantity: 0, + setId: [], + author: "xibot", + dimensions: { x: 0, y: 0, width: 0, height: 0 }, + allowedCollaterals: [], + ghstPrice: 0, + traitModifiers: [0, 0, 0, 0, 0, 0], + slotPositions: "none", + category: 1, + experienceBonus: 0, + kinshipBonus: 0, + canPurchaseWithGhst: false, + }, + { + name: "Rarity Farming SZN5 XP Top 10", + description: + "This Aavegotchi achieved a rank in the top 10 of XP for Rarity Farming SZN 5. From January 31st to March 28th, 2023, the fifth season of Rarity Farming distributed 1.5 million GHST over 8 weeks. Each of the 3 leaderboards has 7500 winning gotchis each round!", + svgId: 400, + minLevel: 0, + canBeTransferred: false, + rarityLevel: "mythical", + maxQuantity: 7, + totalQuantity: 0, + setId: [], + author: "xibot", + dimensions: { x: 0, y: 0, width: 0, height: 0 }, + allowedCollaterals: [], + ghstPrice: 0, + traitModifiers: [0, 0, 0, 0, 0, 0], + slotPositions: "none", + category: 1, + experienceBonus: 0, + kinshipBonus: 0, + canPurchaseWithGhst: false, + }, + { + name: "Rarity Farming SZN5 RARITY Top 100", + description: + "This Aavegotchi achieved a rank in the top 100 of RARITY for Rarity Farming SZN 5. From January 31st to March 28th, 2023, the fifth season of Rarity Farming distributed 1.5 million GHST over 8 weeks. Each of the 3 leaderboards has 7500 winning gotchis each round!", + svgId: 401, + minLevel: 0, + canBeTransferred: false, + rarityLevel: "legendary", + maxQuantity: 90, + totalQuantity: 0, + setId: [], + author: "xibot", + dimensions: { x: 0, y: 0, width: 0, height: 0 }, + allowedCollaterals: [], + ghstPrice: 0, + traitModifiers: [0, 0, 0, 0, 0, 0], + slotPositions: "none", + category: 1, + experienceBonus: 0, + kinshipBonus: 0, + canPurchaseWithGhst: false, + }, + { + name: "Rarity Farming SZN5 KINSHIP Top 100", + description: + "This Aavegotchi achieved a rank in the top 100 of KINSHIP for Rarity Farming SZN 5. From January 31st to March 28th, 2023, the fifth season of Rarity Farming distributed 1.5 million GHST over 8 weeks. Each of the 3 leaderboards has 7500 winning gotchis each round!", + svgId: 402, + minLevel: 0, + canBeTransferred: false, + rarityLevel: "legendary", + maxQuantity: 90, + totalQuantity: 0, + setId: [], + author: "xibot", + dimensions: { x: 0, y: 0, width: 0, height: 0 }, + allowedCollaterals: [], + ghstPrice: 0, + traitModifiers: [0, 0, 0, 0, 0, 0], + slotPositions: "none", + category: 1, + experienceBonus: 0, + kinshipBonus: 0, + canPurchaseWithGhst: false, + }, + { + name: "Rarity Farming SZN5 XP Top 100", + description: + "This Aavegotchi achieved a rank in the top 100 of XP for Rarity Farming SZN 5. From January 31st to March 28th, 2023, the fifth season of Rarity Farming distributed 1.5 million GHST over 8 weeks. Each of the 3 leaderboards has 7500 winning gotchis each round!", + svgId: 403, + minLevel: 0, + canBeTransferred: false, + rarityLevel: "legendary", + maxQuantity: 90, + totalQuantity: 0, + setId: [], + author: "xibot", + dimensions: { x: 0, y: 0, width: 0, height: 0 }, + allowedCollaterals: [], + ghstPrice: 0, + traitModifiers: [0, 0, 0, 0, 0, 0], + slotPositions: "none", + category: 1, + experienceBonus: 0, + kinshipBonus: 0, + canPurchaseWithGhst: false, + }, +]; diff --git a/scripts/airdrops/rfSzn5BdgsAirdrop.ts b/scripts/airdrops/rfSzn5BdgsAirdrop.ts new file mode 100644 index 000000000..ed3c88019 --- /dev/null +++ b/scripts/airdrops/rfSzn5BdgsAirdrop.ts @@ -0,0 +1,244 @@ +import { run } from "hardhat"; +import { itemTypes } from "../../scripts/addItemTypes/itemTypes/rfSzn5Bdgs"; +import { + updateBaadgeTaskForSvgType, + mintSvgTaskForBaadges, + airdropTaskForBaadges, +} from "../../scripts/svgHelperFunctions"; + +import { + getRfSznTypeRanking, + getPlaayersIds, + hasDuplicateGotchiIds, +} from "../../scripts/helperFunctions"; + +import { dataArgs as dataArgs1 } from "../../data/airdrops/rarityfarming/szn5/rnd1"; +import { dataArgs as dataArgs2 } from "../../data/airdrops/rarityfarming/szn5/rnd2"; +import { dataArgs as dataArgs3 } from "../../data/airdrops/rarityfarming/szn5/rnd3"; +import { dataArgs as dataArgs4 } from "../../data/airdrops/rarityfarming/szn5/rnd4"; + +export async function main() { + const baadges: string[] = [ + "Aavegotchi-RF-SZN5-Trophy-1ST-PLACE-RARITY", //388 + "Aavegotchi-RF-SZN5-Trophy-1ST-PLACE-KINSHIP", //389 + "Aavegotchi-RF-SZN5-Trophy-1ST-PLACE-XP", //390 + "Aavegotchi-RF-SZN5-Trophy-2ND-PLACE-RARITY", //391 + "Aavegotchi-RF-SZN5-Trophy-2ND-PLACE-KINSHIP", //392 + "Aavegotchi-RF-SZN5-Trophy-2ND-PLACE-XP", //393 + "Aavegotchi-RF-SZN5-Trophy-3RD-PLACE-RARITY", //394 + "Aavegotchi-RF-SZN5-Trophy-3RD-PLACE-KINSHIP", //395 + "Aavegotchi-RF-SZN5-Trophy-3RD-PLACE-XP", //396 + + "Aavegotchi-RF-SZN5-Baadge-TOP-RAANKED-PLAAYER", //397 + "Aavegotchi-RF-SZN5-Baadge-TOP-10-RARITY", //398 + "Aavegotchi-RF-SZN5-Baadge-TOP-10-KINSHIP", //399 + "Aavegotchi-RF-SZN5-Baadge-TOP-10-XP", //400 + "Aavegotchi-RF-SZN5-Baadge-TOP-100-RARITY", //401 + "Aavegotchi-RF-SZN5-Baadge-TOP-100-KINSHIP", //402 + "Aavegotchi-RF-SZN5-Baadge-TOP-100-XP", //403 + ]; + + //Upload SVGs + let ids: number[] = []; + for (let i = 388; i <= 403; i++) { + ids.push(i); + } + let upload = await updateBaadgeTaskForSvgType(baadges, "sZN5Baadges", ids); + + await run("updateSvgs", upload); + + //Mint baadge item types + let mint = await mintSvgTaskForBaadges("rfSzn5Bdgs"); + + console.log("mint:", mint); + await run("mintBaadgeSvgs", mint); + + //Airdrop + const rarityArray = [ + dataArgs1.rarityGotchis, + dataArgs2.rarityGotchis, + dataArgs3.rarityGotchis, + dataArgs4.rarityGotchis, + ]; + const kinshipArray = [ + dataArgs1.kinshipGotchis, + dataArgs2.kinshipGotchis, + dataArgs3.kinshipGotchis, + dataArgs4.kinshipGotchis, + ]; + const xpArray = [ + dataArgs1.xpGotchis, + dataArgs2.xpGotchis, + dataArgs3.xpGotchis, + dataArgs4.xpGotchis, + ]; + + const rarityRFSzn5 = await getRfSznTypeRanking(rarityArray, "rarity"); + console.log("Rarity: ", rarityRFSzn5); + const top10rarity = rarityRFSzn5.slice(3, 10); + console.log("Top 10 Rarity", top10rarity); + const top100rarity = rarityRFSzn5.slice(10, 100); + console.log("Top 100 Rarity", top100rarity); + console.log("Top 100 Rarity Array Length", top100rarity.length); + + const kinshipRFSzn5 = await getRfSznTypeRanking(kinshipArray, "kinship"); + console.log("Kinship: ", kinshipRFSzn5); + const top10kinship = kinshipRFSzn5.slice(3, 10); + console.log("Top 10 Kinship", top10kinship); + const top100kinship = kinshipRFSzn5.slice(10, 100); + console.log("Top 100 Kinship", top100kinship); + + const xpRFSzn5 = await getRfSznTypeRanking(xpArray, "xp"); + console.log("XP: ", xpRFSzn5); + const top10xp = xpRFSzn5.slice(3, 10); + console.log("Top 10 XP", top10xp); + const top100xp = xpRFSzn5.slice(10, 100); + console.log("Top 100 XP", top100xp); + console.log("Top 10 XP Array Length", top10xp.length); + console.log("Top 100 XP Array Length", top100xp.length); + + const rarityPlaayers = await getPlaayersIds(rarityArray); + const kinshipPlaayers = await getPlaayersIds(kinshipArray); + const xpPlaayers = await getPlaayersIds(xpArray); + + const plaayers = [rarityPlaayers, kinshipPlaayers, xpPlaayers]; + const totalPlaayers = await getPlaayersIds(plaayers); + console.log("Total amount of players: ", totalPlaayers.length); + console.log("Max Rank Baadge amount: ", itemTypes[9].maxQuantity); + + console.log( + "Does totalPlaayers Array Have Duplicates: ", + await hasDuplicateGotchiIds(totalPlaayers) + ); + + console.log(itemTypes[0].name); + console.log("Rarity Chaamp: ", rarityRFSzn5[0]); + const rarityChaampion = await airdropTaskForBaadges( + [itemTypes[0]], + [rarityRFSzn5[0]] + ); + await run("airdropBaadges", rarityChaampion); + + console.log(itemTypes[1].name); + const kinshipChaampion = await airdropTaskForBaadges( + [itemTypes[1]], + [kinshipRFSzn5[0]] + ); + await run("airdropBaadges", kinshipChaampion); + + console.log(itemTypes[2].name); + console.log("XP Chaampion: ", xpRFSzn5[0]); + const xpChaampion = await airdropTaskForBaadges( + [itemTypes[2]], + [xpRFSzn5[0]] + ); + await run("airdropBaadges", xpChaampion); + + console.log(itemTypes[3].name); + const rarity2nd = await airdropTaskForBaadges( + [itemTypes[3]], + [rarityRFSzn5[1]] + ); + await run("airdropBaadges", rarity2nd); + + console.log(itemTypes[4].name); + const kinship2nd = await airdropTaskForBaadges( + [itemTypes[4]], + [kinshipRFSzn5[1]] + ); + await run("airdropBaadges", kinship2nd); + + console.log(itemTypes[5].name); + const xp2nd = await airdropTaskForBaadges([itemTypes[5]], [xpRFSzn5[1]]); + await run("airdropBaadges", xp2nd); + + console.log(itemTypes[6].name); + const rarity3rd = await airdropTaskForBaadges( + [itemTypes[6]], + [rarityRFSzn5[2]] + ); + await run("airdropBaadges", rarity3rd); + + console.log(itemTypes[7].name); + const kinship3rd = await airdropTaskForBaadges( + [itemTypes[7]], + [kinshipRFSzn5[2]] + ); + await run("airdropBaadges", kinship3rd); + + console.log(itemTypes[8].name); + const xp3rd = await airdropTaskForBaadges([itemTypes[8]], [xpRFSzn5[2]]); + await run("airdropBaadges", xp3rd); + + console.log(itemTypes[10].name); + const rarityTop10 = await airdropTaskForBaadges([itemTypes[10]], top10rarity); + await run("airdropBaadges", rarityTop10); + + console.log(itemTypes[11].name); + const kinshipTop10 = await airdropTaskForBaadges( + [itemTypes[11]], + top10kinship + ); + await run("airdropBaadges", kinshipTop10); + + console.log(itemTypes[12].name); + const xpTop10 = await airdropTaskForBaadges([itemTypes[12]], top10xp); + await run("airdropBaadges", xpTop10); + + console.log(itemTypes[13].name); + const rarityTop100 = await airdropTaskForBaadges( + [itemTypes[13]], + top100rarity + ); + await run("airdropBaadges", rarityTop100); + + console.log(itemTypes[14].name); + const kinshipTop100 = await airdropTaskForBaadges( + [itemTypes[14]], + top100kinship + ); + await run("airdropBaadges", kinshipTop100); + + console.log(itemTypes[15].name); + const xpTop100 = await airdropTaskForBaadges([itemTypes[15]], top100xp); + await run("airdropBaadges", xpTop100); + + console.log(itemTypes[9].name); + + const raankingNumbersArray: number[] = []; + for (let x = 0; x < totalPlaayers.length; x++) { + raankingNumbersArray.push(Number(totalPlaayers[x])); + } + + const perBatch = 200; + const batches = Math.ceil(raankingNumbersArray.length / perBatch); + + console.log("Begin airdrops!"); + + //comment out for testing + // for (let index = 0; index < batches; index++) { + // console.log("Airdropping batch:", index); + // let gotchiBatch = raankingNumbersArray.slice( + // index * perBatch, + // (index + 1) * perBatch + // ); + + // let plaayerAirdrop = await airdropTaskForBaadges( + // [itemTypes[9]], + // gotchiBatch + // ); + + // await run("airdropBaadges", plaayerAirdrop); + // console.log("Complete Airdropping batch:", index); + // } +} + +if (require.main === module) { + main() + .then(() => process.exit(0)) + // .then(() => console.log('upgrade completed') /* process.exit(0) */) + .catch((error) => { + console.error(error); + process.exit(1); + }); +} diff --git a/scripts/helperFunctions.ts b/scripts/helperFunctions.ts index d77f27be9..853ca01aa 100644 --- a/scripts/helperFunctions.ts +++ b/scripts/helperFunctions.ts @@ -135,6 +135,10 @@ export async function getDiamondSigner( method: "hardhat_impersonateAccount", params: [override ? override : owner], }); + await hre.network.provider.request({ + method: "hardhat_setBalance", + params: [owner, "0x1000000000000000000000000"], + }); return await hre.ethers.getSigner(override ? override : owner); } else if (hre.network.name === "matic") { console.log("Diamond signer - Matic"); diff --git a/scripts/svgHelperFunctions.ts b/scripts/svgHelperFunctions.ts index 1854212ee..0b017c904 100644 --- a/scripts/svgHelperFunctions.ts +++ b/scripts/svgHelperFunctions.ts @@ -616,7 +616,7 @@ export async function mintSvgTaskForBaadges(fileName: string) { itemManager: itemManagerAlt, itemFile: fileName, uploadItemTypes: true, - sendToItemManager: true, + sendToRelayer: true, }; return taskArgs; diff --git a/svgs/sZN5Baadges/Aavegotchi-RF-SZN5-Baadge-TOP-10-KINSHIP.svg b/svgs/sZN5Baadges/Aavegotchi-RF-SZN5-Baadge-TOP-10-KINSHIP.svg new file mode 100644 index 000000000..9f73f9777 --- /dev/null +++ b/svgs/sZN5Baadges/Aavegotchi-RF-SZN5-Baadge-TOP-10-KINSHIP.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/svgs/sZN5Baadges/Aavegotchi-RF-SZN5-Baadge-TOP-10-RARITY.svg b/svgs/sZN5Baadges/Aavegotchi-RF-SZN5-Baadge-TOP-10-RARITY.svg new file mode 100644 index 000000000..4f391ed3f --- /dev/null +++ b/svgs/sZN5Baadges/Aavegotchi-RF-SZN5-Baadge-TOP-10-RARITY.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/svgs/sZN5Baadges/Aavegotchi-RF-SZN5-Baadge-TOP-10-XP.svg b/svgs/sZN5Baadges/Aavegotchi-RF-SZN5-Baadge-TOP-10-XP.svg new file mode 100644 index 000000000..e5c8181d9 --- /dev/null +++ b/svgs/sZN5Baadges/Aavegotchi-RF-SZN5-Baadge-TOP-10-XP.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/svgs/sZN5Baadges/Aavegotchi-RF-SZN5-Baadge-TOP-100-KINSHIP.svg b/svgs/sZN5Baadges/Aavegotchi-RF-SZN5-Baadge-TOP-100-KINSHIP.svg new file mode 100644 index 000000000..aca9549e9 --- /dev/null +++ b/svgs/sZN5Baadges/Aavegotchi-RF-SZN5-Baadge-TOP-100-KINSHIP.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/svgs/sZN5Baadges/Aavegotchi-RF-SZN5-Baadge-TOP-100-RARITY.svg b/svgs/sZN5Baadges/Aavegotchi-RF-SZN5-Baadge-TOP-100-RARITY.svg new file mode 100644 index 000000000..bf59b6bf2 --- /dev/null +++ b/svgs/sZN5Baadges/Aavegotchi-RF-SZN5-Baadge-TOP-100-RARITY.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/svgs/sZN5Baadges/Aavegotchi-RF-SZN5-Baadge-TOP-100-XP.svg b/svgs/sZN5Baadges/Aavegotchi-RF-SZN5-Baadge-TOP-100-XP.svg new file mode 100644 index 000000000..8cb9f42a9 --- /dev/null +++ b/svgs/sZN5Baadges/Aavegotchi-RF-SZN5-Baadge-TOP-100-XP.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/svgs/sZN5Baadges/Aavegotchi-RF-SZN5-Baadge-TOP-RAANKED-PLAAYER.svg b/svgs/sZN5Baadges/Aavegotchi-RF-SZN5-Baadge-TOP-RAANKED-PLAAYER.svg new file mode 100644 index 000000000..2aedf0df8 --- /dev/null +++ b/svgs/sZN5Baadges/Aavegotchi-RF-SZN5-Baadge-TOP-RAANKED-PLAAYER.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/svgs/sZN5Baadges/Aavegotchi-RF-SZN5-Trophy-1ST-PLACE-KINSHIP.svg b/svgs/sZN5Baadges/Aavegotchi-RF-SZN5-Trophy-1ST-PLACE-KINSHIP.svg new file mode 100644 index 000000000..41ed292ad --- /dev/null +++ b/svgs/sZN5Baadges/Aavegotchi-RF-SZN5-Trophy-1ST-PLACE-KINSHIP.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/svgs/sZN5Baadges/Aavegotchi-RF-SZN5-Trophy-1ST-PLACE-RARITY.svg b/svgs/sZN5Baadges/Aavegotchi-RF-SZN5-Trophy-1ST-PLACE-RARITY.svg new file mode 100644 index 000000000..7241c36b6 --- /dev/null +++ b/svgs/sZN5Baadges/Aavegotchi-RF-SZN5-Trophy-1ST-PLACE-RARITY.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/svgs/sZN5Baadges/Aavegotchi-RF-SZN5-Trophy-1ST-PLACE-XP.svg b/svgs/sZN5Baadges/Aavegotchi-RF-SZN5-Trophy-1ST-PLACE-XP.svg new file mode 100644 index 000000000..43f750471 --- /dev/null +++ b/svgs/sZN5Baadges/Aavegotchi-RF-SZN5-Trophy-1ST-PLACE-XP.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/svgs/sZN5Baadges/Aavegotchi-RF-SZN5-Trophy-2ND-PLACE-KINSHIP.svg b/svgs/sZN5Baadges/Aavegotchi-RF-SZN5-Trophy-2ND-PLACE-KINSHIP.svg new file mode 100644 index 000000000..26974c786 --- /dev/null +++ b/svgs/sZN5Baadges/Aavegotchi-RF-SZN5-Trophy-2ND-PLACE-KINSHIP.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/svgs/sZN5Baadges/Aavegotchi-RF-SZN5-Trophy-2ND-PLACE-RARITY.svg b/svgs/sZN5Baadges/Aavegotchi-RF-SZN5-Trophy-2ND-PLACE-RARITY.svg new file mode 100644 index 000000000..ee2088a57 --- /dev/null +++ b/svgs/sZN5Baadges/Aavegotchi-RF-SZN5-Trophy-2ND-PLACE-RARITY.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/svgs/sZN5Baadges/Aavegotchi-RF-SZN5-Trophy-2ND-PLACE-XP.svg b/svgs/sZN5Baadges/Aavegotchi-RF-SZN5-Trophy-2ND-PLACE-XP.svg new file mode 100644 index 000000000..72ce187db --- /dev/null +++ b/svgs/sZN5Baadges/Aavegotchi-RF-SZN5-Trophy-2ND-PLACE-XP.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/svgs/sZN5Baadges/Aavegotchi-RF-SZN5-Trophy-3RD-PLACE-KINSHIP.svg b/svgs/sZN5Baadges/Aavegotchi-RF-SZN5-Trophy-3RD-PLACE-KINSHIP.svg new file mode 100644 index 000000000..c1e50a87a --- /dev/null +++ b/svgs/sZN5Baadges/Aavegotchi-RF-SZN5-Trophy-3RD-PLACE-KINSHIP.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/svgs/sZN5Baadges/Aavegotchi-RF-SZN5-Trophy-3RD-PLACE-RARITY.svg b/svgs/sZN5Baadges/Aavegotchi-RF-SZN5-Trophy-3RD-PLACE-RARITY.svg new file mode 100644 index 000000000..1c23a9096 --- /dev/null +++ b/svgs/sZN5Baadges/Aavegotchi-RF-SZN5-Trophy-3RD-PLACE-RARITY.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/svgs/sZN5Baadges/Aavegotchi-RF-SZN5-Trophy-3RD-PLACE-XP.svg b/svgs/sZN5Baadges/Aavegotchi-RF-SZN5-Trophy-3RD-PLACE-XP.svg new file mode 100644 index 000000000..64df965a6 --- /dev/null +++ b/svgs/sZN5Baadges/Aavegotchi-RF-SZN5-Trophy-3RD-PLACE-XP.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/svgs/wearables-sides.ts b/svgs/wearables-sides.ts index 564fec32e..45d923413 100644 --- a/svgs/wearables-sides.ts +++ b/svgs/wearables-sides.ts @@ -396,6 +396,23 @@ export const wearablesRightSvgs = [ wearable("385_BlockScannersRight"), wearable("386_StaffCharmingRight"), wearable("387_RoflnogginRight"), + //szn 5 baadges + 388, + 389, + 390, + 391, + 392, + 393, + 394, + 395, + 396, + 397, + 398, + 399, + 400, + 401, + 402, + 403, ]; export const wearablesBackSvgs = [ @@ -792,6 +809,23 @@ export const wearablesBackSvgs = [ "385_BlockScanners", wearable("386_StaffCharmingBack"), wearable("387_RoflnogginBack"), + //szn 5 baadges + 388, + 389, + 390, + 391, + 392, + 393, + 394, + 395, + 396, + 397, + 398, + 399, + 400, + 401, + 402, + 403, ]; export const wearablesLeftSvgs = [ @@ -1188,6 +1222,23 @@ export const wearablesLeftSvgs = [ wearable("385_BlockScannersLeft"), wearable("386_StaffCharmingLeft"), wearable("387_RoflnogginLeft"), + //szn 5 baadges + 388, + 389, + 390, + 391, + 392, + 393, + 394, + 395, + 396, + 397, + 398, + 399, + 400, + 401, + 402, + 403, ]; export const wearablesLeftSleeveSvgs = [ diff --git a/svgs/wearables.ts b/svgs/wearables.ts index 918ab3f4e..a699fd977 100644 --- a/svgs/wearables.ts +++ b/svgs/wearables.ts @@ -395,6 +395,23 @@ export const wearablesSvgs = [ wearable("385_BlockScanners"), wearable("386_StaffCharming"), wearable("387_Roflnoggin"), + //szn 5 baadges + 388, + 389, + 390, + 391, + 392, + 393, + 394, + 395, + 396, + 397, + 398, + 399, + 400, + 401, + 402, + 403, ]; export const sleeveSvgs = [ diff --git a/tasks/baadgeAirdrop.ts b/tasks/baadgeAirdrop.ts index ec6401bfd..bdfa78d20 100644 --- a/tasks/baadgeAirdrop.ts +++ b/tasks/baadgeAirdrop.ts @@ -6,6 +6,8 @@ import { getDiamondSigner, itemManagerAlt, gasPrice, + getRelayerSigner, + xpRelayerAddress, } from "../scripts/helperFunctions"; import { ItemsTransferFacet } from "../typechain"; @@ -57,7 +59,7 @@ task( console.log("Batch Ids for airdrop: ", batchIds); console.log("tokenids:", tokenIds); - const signer: Signer = await getDiamondSigner(hre, itemManagerAlt, false); + const signer: Signer = await getRelayerSigner(hre); const itemsTransferFacet = (await hre.ethers.getContractAt( "ItemsTransferFacet", @@ -66,7 +68,7 @@ task( )) as ItemsTransferFacet; const tx = await itemsTransferFacet.batchBatchTransferToParent( - itemManagerAlt, + xpRelayerAddress, maticDiamondAddress, tokenIds, batchIds, diff --git a/tasks/mintBaadgeSvgs.ts b/tasks/mintBaadgeSvgs.ts index 6e784f45a..a26b75b75 100644 --- a/tasks/mintBaadgeSvgs.ts +++ b/tasks/mintBaadgeSvgs.ts @@ -6,6 +6,7 @@ import { getRelayerSigner, itemManagerAlt, maticDiamondAddress, + xpRelayerAddress, } from "../scripts/helperFunctions"; import { DAOFacet } from "../typechain/DAOFacet"; import { BigNumberish } from "@ethersproject/bignumber"; @@ -16,14 +17,14 @@ export interface MintBaadgeTaskArgs { itemManager: string; itemFile: string; uploadItemTypes: boolean; - sendToItemManager: boolean; + sendToRelayer: boolean; } task("mintBaadgeSvgs", "Adds itemTypes and SVGs") .addParam("itemManager", "Address of the item manager", "0") .addParam("itemFile", "File name of the items to add") .addFlag("uploadItemTypes", "Upload itemTypes") - .addFlag("sendToItemManager", "Mint and send the items to itemManager") + .addFlag("sendToRelayer", "Mint and send the items to itemManager") .setAction( async (taskArgs: MintBaadgeTaskArgs, hre: HardhatRuntimeEnvironment) => { @@ -34,8 +35,8 @@ task("mintBaadgeSvgs", "Adds itemTypes and SVGs") } const itemFile: string = taskArgs.itemFile; - const itemManager = taskArgs.itemManager; - const sendToItemManager = taskArgs.sendToItemManager; + + const sendToRelayer = taskArgs.sendToRelayer; const uploadItemTypes = taskArgs.uploadItemTypes; const { @@ -72,7 +73,7 @@ task("mintBaadgeSvgs", "Adds itemTypes and SVGs") console.log("Items were added:", tx.hash); } - if (sendToItemManager) { + if (sendToRelayer) { const itemIds: BigNumberish[] = []; const quantities: BigNumberish[] = []; currentItemTypes.forEach((itemType: ItemTypeOutput) => { @@ -82,9 +83,9 @@ task("mintBaadgeSvgs", "Adds itemTypes and SVGs") console.log("final quantities:", itemIds, quantities); - console.log(`Mint prize items to Item Manager ${itemManager}`); + console.log(`Mint prize items to Defender Relayer ${xpRelayerAddress}`); - tx = await daoFacet.mintItems(itemManager, itemIds, quantities, { + tx = await daoFacet.mintItems(xpRelayerAddress, itemIds, quantities, { gasPrice: gasPrice, }); receipt = await tx.wait(); diff --git a/test/szn5BaadgeAirdropTest.ts b/test/szn5BaadgeAirdropTest.ts new file mode 100644 index 000000000..691a83f61 --- /dev/null +++ b/test/szn5BaadgeAirdropTest.ts @@ -0,0 +1,202 @@ +import { ethers } from "hardhat"; +import { maticDiamondAddress } from "../scripts/helperFunctions"; +import { AavegotchiFacet } from "../typechain"; +import { Signer } from "@ethersproject/abstract-signer"; +import { expect } from "chai"; + +import { itemTypes } from "../scripts/addItemTypes/itemTypes/rfSzn5Bdgs"; +import { dataArgs as dataArgs1 } from "../data/airdrops/rarityfarming/szn5/rnd1"; +import { dataArgs as dataArgs2 } from "../data/airdrops/rarityfarming/szn5/rnd2"; +import { dataArgs as dataArgs3 } from "../data/airdrops/rarityfarming/szn5/rnd3"; +import { dataArgs as dataArgs4 } from "../data/airdrops/rarityfarming/szn5/rnd4"; + +import { getRfSznTypeRanking } from "../scripts/helperFunctions"; +import { main } from "../scripts/airdrops/rfSzn5BdgsAirdrop"; +describe("Airdrop SZN5 Baadges", async function () { + this.timeout(200000000); + + let aavegotchiFacet: AavegotchiFacet, + signer: Signer, + rarityRFSzn5: number[], + kinshipRFSzn5: number[], + xpRFSzn5: number[]; + + before(async function () { + signer = await ethers.getSigner(maticDiamondAddress); + + const rarityArray = [ + dataArgs1.rarityGotchis, + dataArgs2.rarityGotchis, + dataArgs3.rarityGotchis, + dataArgs4.rarityGotchis, + ]; + const kinshipArray = [ + dataArgs1.kinshipGotchis, + dataArgs2.kinshipGotchis, + dataArgs3.kinshipGotchis, + dataArgs4.kinshipGotchis, + ]; + const xpArray = [ + dataArgs1.xpGotchis, + dataArgs2.xpGotchis, + dataArgs3.xpGotchis, + dataArgs4.xpGotchis, + ]; + + aavegotchiFacet = (await ethers.getContractAt( + "contracts/Aavegotchi/facets/AavegotchiFacet.sol:AavegotchiFacet", + maticDiamondAddress, + signer + )) as AavegotchiFacet; + + rarityRFSzn5 = await getRfSznTypeRanking(rarityArray, "rarity"); + + kinshipRFSzn5 = await getRfSznTypeRanking(kinshipArray, "kinship"); + + xpRFSzn5 = await getRfSznTypeRanking(xpArray, "xp"); + + await main(); + }); + + it.only("Should airdrop szn5 champion baadges", async function () { + //rarity champ + let rarityChamp = await aavegotchiFacet.getAavegotchi(rarityRFSzn5[0]); + + let itemIds = getAavegotchiItemIds(rarityChamp); + + expect(exists(itemTypes[0].svgId.toString(), itemIds)).to.equal(true); + + //kinship champ + let kinshipChamp = await aavegotchiFacet.getAavegotchi(kinshipRFSzn5[0]); + itemIds = getAavegotchiItemIds(kinshipChamp); + + expect(exists(itemTypes[1].svgId.toString(), itemIds)).to.equal(true); + + //xp champ (tiebreaker) + let xpChamp = await aavegotchiFacet.getAavegotchi(xpRFSzn5[0]); + itemIds = getAavegotchiItemIds(xpChamp); + + expect(exists(itemTypes[2].svgId.toString(), itemIds)).to.equal(true); + }); + + it.only("Should airdrop szn5 2nd and 3rd place baadges", async function () { + //rarity 2nd + let rarity2nd = await aavegotchiFacet.getAavegotchi(rarityRFSzn5[1]); + let itemIds = getAavegotchiItemIds(rarity2nd); + + expect(exists(itemTypes[3].svgId.toString(), itemIds)).to.equal(true); + + //kinship 2nd + let kinship2nd = await aavegotchiFacet.getAavegotchi(kinshipRFSzn5[1]); + itemIds = getAavegotchiItemIds(kinship2nd); + + expect(exists(itemTypes[4].svgId.toString(), itemIds)).to.equal(true); + + // //xp 2nd + let xp2nd = await aavegotchiFacet.getAavegotchi(xpRFSzn5[1]); + itemIds = getAavegotchiItemIds(xp2nd); + + expect(exists(itemTypes[5].svgId.toString(), itemIds)).to.equal(true); + + //rarity 3rd + let rarity3rd = await aavegotchiFacet.getAavegotchi(rarityRFSzn5[2]); + itemIds = getAavegotchiItemIds(rarity3rd); + + expect(exists(itemTypes[6].svgId.toString(), itemIds)).to.equal(true); + + //kinship 3rd + let kinship3rd = await aavegotchiFacet.getAavegotchi(kinshipRFSzn5[2]); + itemIds = getAavegotchiItemIds(kinship3rd); + + expect(exists(itemTypes[7].svgId.toString(), itemIds)).to.equal(true); + + //xp 3rd + let xp3rd = await aavegotchiFacet.getAavegotchi(xpRFSzn5[2]); + itemIds = getAavegotchiItemIds(xp3rd); + + expect(exists(itemTypes[8].svgId.toString(), itemIds)).to.equal(true); + }); + + it.only("Should airdrop szn5 top10 baadges", async function () { + //rarity top 10 + let rarityTop10 = await aavegotchiFacet.getAavegotchi(rarityRFSzn5[3]); + let itemIds = getAavegotchiItemIds(rarityTop10); + + expect(exists(itemTypes[10].svgId.toString(), itemIds)).to.equal(true); + + rarityTop10 = await aavegotchiFacet.getAavegotchi(rarityRFSzn5[9]); + itemIds = getAavegotchiItemIds(rarityTop10); + + expect(exists(itemTypes[10].svgId.toString(), itemIds)).to.equal(true); + + //kinship top 10 + let kinshipTop10 = await aavegotchiFacet.getAavegotchi(kinshipRFSzn5[3]); + itemIds = getAavegotchiItemIds(kinshipTop10); + + expect(exists(itemTypes[11].svgId.toString(), itemIds)).to.equal(true); + + kinshipTop10 = await aavegotchiFacet.getAavegotchi(kinshipRFSzn5[9]); + itemIds = getAavegotchiItemIds(kinshipTop10); + + expect(exists(itemTypes[11].svgId.toString(), itemIds)).to.equal(true); + + //XP top 10 + let xpTop10 = await aavegotchiFacet.getAavegotchi(xpRFSzn5[3]); + itemIds = getAavegotchiItemIds(xpTop10); + + expect(exists(itemTypes[12].svgId.toString(), itemIds)).to.equal(true); + + xpTop10 = await aavegotchiFacet.getAavegotchi(xpRFSzn5[9]); + itemIds = getAavegotchiItemIds(xpTop10); + + expect(exists(itemTypes[12].svgId.toString(), itemIds)).to.equal(true); + }); + + it.only("Should airdrop szn5 top100 baadges", async function () { + //rarity top 100 + let rarityTop100 = await aavegotchiFacet.getAavegotchi(rarityRFSzn5[10]); + let itemIds = getAavegotchiItemIds(rarityTop100); + + expect(exists(itemTypes[13].svgId.toString(), itemIds)).to.equal(true); + + rarityTop100 = await aavegotchiFacet.getAavegotchi(rarityRFSzn5[99]); + itemIds = getAavegotchiItemIds(rarityTop100); + + expect(exists(itemTypes[13].svgId.toString(), itemIds)).to.equal(true); + + //kinship top 100 + let kinshipTop100 = await aavegotchiFacet.getAavegotchi(kinshipRFSzn5[10]); + itemIds = getAavegotchiItemIds(kinshipTop100); + + expect(exists(itemTypes[14].svgId.toString(), itemIds)).to.equal(true); + + kinshipTop100 = await aavegotchiFacet.getAavegotchi(kinshipRFSzn5[99]); + itemIds = getAavegotchiItemIds(kinshipTop100); + + expect(exists(itemTypes[14].svgId.toString(), itemIds)).to.equal(true); + + //XP top 100 + let xpTop100 = await aavegotchiFacet.getAavegotchi(xpRFSzn5[10]); + itemIds = getAavegotchiItemIds(xpTop100); + + expect(exists(itemTypes[15].svgId.toString(), itemIds)).to.equal(true); + + xpTop100 = await aavegotchiFacet.getAavegotchi(xpRFSzn5[99]); + itemIds = getAavegotchiItemIds(xpTop100); + + expect(exists(itemTypes[15].svgId.toString(), itemIds)).to.equal(true); + }); +}); + +function getAavegotchiItemIds(gotchi: any) { + let itemIds: string[] = []; + const allItems: any[] = gotchi.items; + allItems.forEach((item) => { + itemIds.push(item.itemId.toString()); + }); + return itemIds; +} + +function exists(itemId: string, itemIds: string[]) { + return itemIds.includes(itemId); +}