-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Expand file tree
/
Copy path4-set-claim-condition.js
More file actions
29 lines (26 loc) · 1.08 KB
/
4-set-claim-condition.js
File metadata and controls
29 lines (26 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import sdk from "./1-initialize-sdk.js";
import { MaxUint256 } from "@ethersproject/constants";
const editionDrop = sdk.getEditionDrop("0x6288757CC1d20E19d48Fc44C99Eb222C3A2cEAD5");
(async () => {
try {
// We define our claim conditions, this is an array of objects because
// we can have multiple phases starting at different times if we want to
const claimConditions = [{
// When people are gonna be able to start claiming the NFTs (now)
startTime: new Date(),
// The maximum number of NFTs that can be claimed.
maxQuantity: 50_000,
// The price of our NFT (free)
price: 0,
// The amount of NFTs people can claim in one transaction.
quantityLimitPerTransaction: 1,
// We set the wait between transactions to MaxUint256, which means
// people are only allowed to claim once.
waitInSeconds: MaxUint256,
}]
await editionDrop.claimConditions.set("0", claimConditions);
console.log("✅ Sucessfully set claim condition!");
} catch (error) {
console.error("Failed to set claim condition", error);
}
})();