Check if existing/new whitelist start time = minting start time
This commit is contained in:
parent
b4848506f3
commit
75c77e5a53
@ -369,6 +369,10 @@ const CollectionCreationPage: NextPage = () => {
|
|||||||
const contract = whitelistContract?.use(whitelistDetails.contractAddress)
|
const contract = whitelistContract?.use(whitelistDetails.contractAddress)
|
||||||
//check if the address belongs to a whitelist contract (see performChecks())
|
//check if the address belongs to a whitelist contract (see performChecks())
|
||||||
const config = await contract?.config()
|
const config = await contract?.config()
|
||||||
|
if (Number(config?.start_time) !== Number(mintingDetails?.startTime)) {
|
||||||
|
const whitelistStartDate = new Date(Number(config?.start_time) / 1000000)
|
||||||
|
throw Error(`Whitelist start time (${whitelistStartDate.toLocaleString()}) does not match minting start time`)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else if (whitelistDetails.whitelistType === 'new') {
|
} else if (whitelistDetails.whitelistType === 'new') {
|
||||||
if (whitelistDetails.members?.length === 0) throw new Error('Whitelist member list cannot be empty')
|
if (whitelistDetails.members?.length === 0) throw new Error('Whitelist member list cannot be empty')
|
||||||
@ -381,6 +385,8 @@ const CollectionCreationPage: NextPage = () => {
|
|||||||
if (whitelistDetails.memberLimit === 0) throw new Error('Member limit is required')
|
if (whitelistDetails.memberLimit === 0) throw new Error('Member limit is required')
|
||||||
if (Number(whitelistDetails.startTime) > Number(whitelistDetails.endTime))
|
if (Number(whitelistDetails.startTime) > Number(whitelistDetails.endTime))
|
||||||
throw new Error('Whitelist start time cannot be later than whitelist end time')
|
throw new Error('Whitelist start time cannot be later than whitelist end time')
|
||||||
|
if (Number(whitelistDetails.startTime) !== Number(mintingDetails?.startTime))
|
||||||
|
throw new Error('Whitelist start time must be the same as the minting start time')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user