Skip to content

Commit

Permalink
chore: update quantities
Browse files Browse the repository at this point in the history
  • Loading branch information
cinnabarhorse committed Sep 13, 2024
1 parent 7eba1c8 commit 81a190e
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 4 deletions.
4 changes: 2 additions & 2 deletions data/itemTypes/gotchigangwearables.ts
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ export const itemTypes: ItemTypeInputNew[] = [
allowedCollaterals: [],
minLevel: 1,
ghstPrice: 0,
maxQuantity: 10,
maxQuantity: 50,
traitModifiers: [0, 0, 0, -5, 0, 0],
canPurchaseWithGhst: false,
slotPositions: "face",
Expand All @@ -284,7 +284,7 @@ export const itemTypes: ItemTypeInputNew[] = [
allowedCollaterals: [],
minLevel: 1,
ghstPrice: 0,
maxQuantity: 10,
maxQuantity: 50,
traitModifiers: [2, 0, 0, -3, 0, 0],
canPurchaseWithGhst: false,
slotPositions: "pet",
Expand Down
4 changes: 2 additions & 2 deletions data/itemTypes/itemTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7858,7 +7858,7 @@ export const itemTypes: ItemTypeInput[] = [
allowedCollaterals: [],
minLevel: 1,
ghstPrice: 0,
maxQuantity: 10,
maxQuantity: 50,
traitModifiers: [0, 0, 0, -5, 0, 0],
canPurchaseWithGhst: false,
slotPositions: "face",
Expand All @@ -7878,7 +7878,7 @@ export const itemTypes: ItemTypeInput[] = [
allowedCollaterals: [],
minLevel: 1,
ghstPrice: 0,
maxQuantity: 10,
maxQuantity: 50,
traitModifiers: [2, 0, 0, -3, 0, 0],
canPurchaseWithGhst: false,
slotPositions: "pet",
Expand Down
58 changes: 58 additions & 0 deletions scripts/fixes/updateMaxQty.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
import { ethers, network } from "hardhat";
import { Signer } from "@ethersproject/abstract-signer";

import {
gasPrice,
itemManagerAlt,
maticDiamondAddress,
} from "../helperFunctions";

export async function main() {
const ids: number[] = [416, 417];
const maxQty: number[] = [50, 50];

let signer: Signer;

const testing = ["hardhat", "localhost"].includes(network.name);

if (testing) {
await network.provider.request({
method: "hardhat_impersonateAccount",
params: [itemManagerAlt],
});
signer = await ethers.getSigner(itemManagerAlt);
} else if (network.name === "matic") {
const accounts = await ethers.getSigners();
signer = accounts[0];

console.log("signer:", signer);
} else {
throw Error("Incorrect network selected");
}

const daoFacet = await ethers.getContractAt(
"DAOFacet",
maticDiamondAddress,
signer
);

//Update max quantity
let tx;
let receipt;
console.log("Update ItemTypeMaxQuantities");
tx = await daoFacet.updateItemTypeMaxQuantity(ids, maxQty, {
gasPrice: gasPrice,
});
receipt = await tx.wait();
if (!receipt.status) {
throw Error(`Not Sent: ${tx.hash}`);
}
console.log("Updated ItemTypeMaxQuantities successfully");
}

main()
.then(() => process.exit(0))
.catch((error) => {
console.error(error);
process.exit(1);
});

0 comments on commit 81a190e

Please sign in to comment.