Skip to content

Commit

Permalink
Add merkle root to merkledrop sale schedule (#59)
Browse files Browse the repository at this point in the history
  • Loading branch information
vigneshka committed Sep 8, 2022
1 parent 828e34f commit ee0184d
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
5 changes: 5 additions & 0 deletions .changeset/thick-phones-sell.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@soundxyz/sdk': patch
---

Add merkle root to merkledrop sale schedule
3 changes: 2 additions & 1 deletion packages/sdk/src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ export function SoundClient({
contractAddress: mintConfig.minterAddress,
calldata: minterInterface.encodeFunctionData('createEditionMint', [
editionAddress,
mintConfig.merkleRootHash,
mintConfig.merkleRoot,
mintConfig.price,
mintConfig.startTime,
mintConfig.endTime,
Expand Down Expand Up @@ -499,6 +499,7 @@ export function SoundClient({
return {
mintType: 'MerkleDrop',
mintId: mintId.toNumber(),
merkleRoot: mintSchedule.merkleRootHash,
editionAddress,
minterAddress,
startTime: mintSchedule.startTime,
Expand Down
3 changes: 2 additions & 1 deletion packages/sdk/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ export type RangeEditionSchedule = MintScheduleBase & {
export type MerkleDropSchedule = MintScheduleBase & {
mintType: 'MerkleDrop'
maxMintable: number
merkleRoot: string
}

export type FixedPriceSignatureSchedule = MintScheduleBase & {
Expand Down Expand Up @@ -113,7 +114,7 @@ export type MintConfigBase = {
*/
export type MerkleDropConfig = MintConfigBase & {
mintType: 'MerkleDrop'
merkleRootHash: string
merkleRoot: string
maxMintable: BigNumberish
maxMintablePerAccount: BigNumberish
}
Expand Down
6 changes: 3 additions & 3 deletions packages/sdk/test/client.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -631,7 +631,7 @@ describe('createEditionWithMintSchedules', () => {
const mint1MaxMintablePerAccount = 2
const mint3MaxMintablePerAccount = 3
const merkleTestHelper = MerkleTestHelper()
const merkleRootHash = merkleTestHelper.getMerkleRoot(merkleTestHelper.getMerkleTree())
const merkleRoot = merkleTestHelper.getMerkleRoot(merkleTestHelper.getMerkleTree())

const mintConfigs: MintConfig[] = [
{
Expand Down Expand Up @@ -660,7 +660,7 @@ describe('createEditionWithMintSchedules', () => {
mintType: 'MerkleDrop' as const,
minterAddress: merkleDropMinter.address,
price: PRICE,
merkleRootHash,
merkleRoot,
startTime: mint3StartTime,
endTime: mint3StartTime + ONE_HOUR,
maxMintable: 9,
Expand Down Expand Up @@ -724,7 +724,7 @@ describe('createEditionWithMintSchedules', () => {
const mintSchedule = await minter.mintInfo(precomputedEditionAddress, MINT_ID)
expect(mintSchedule.startTime).to.equal(mint3StartTime)
expect(mintSchedule.endTime).to.equal(mint3StartTime + ONE_HOUR)
expect(mintSchedule.merkleRootHash).to.equal(merkleRootHash)
expect(mintSchedule.merkleRootHash).to.equal(merkleRoot)
expect(mintSchedule.maxMintablePerAccount).to.equal(mint3MaxMintablePerAccount)
break
}
Expand Down

0 comments on commit ee0184d

Please sign in to comment.