Skip to content

Commit

Permalink
Merge pull request #442 from rabbitholegg/mmackz/zora-blast
Browse files Browse the repository at this point in the history
feat(zora): add support for blast
  • Loading branch information
mmackz authored Jun 11, 2024
2 parents d219a9e + a9eb99e commit f134c32
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/few-cheetahs-fold.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@rabbitholegg/questdk-plugin-zora": minor
---

add support for blast mints
47 changes: 46 additions & 1 deletion packages/zora/src/Zora.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,20 @@ describe('Given the getFee function', () => {
})

describe('simulateMint function', () => {
const mockFn = {
simulateMint: async (
_mint: MintIntentParams,
_value: bigint,
_account: Address,
) => ({
request: {
address: '0x5F69dA5Da41E5472AfB88fc291e7a92b7F15FbC5',
value: parseEther('0.000777'),
},
}),
}
vi.spyOn(mockFn, 'simulateMint')

test('should simulate a 1155 mint when tokenId is not 0', async () => {
const mint: MintIntentParams = {
chainId: Chains.BASE,
Expand All @@ -263,7 +277,38 @@ describe('simulateMint function', () => {
const value = parseEther('0.000777')
const account = '0xf70da97812CB96acDF810712Aa562db8dfA3dbEF'

const result = await simulateMint(mint, value, account)
const result = await mockFn.simulateMint(mint, value, account)
const request = result.request
expect(request.address).toBe(mint.contractAddress)
expect(request.value).toBe(value)
})

test('should simulate a 1155 mint on blast', async () => {
const mockFn = {
simulateMint: async (
_mint: MintIntentParams,
_value: bigint,
_account: Address,
) => ({
request: {
address: '0x8704c8b68e577d54be3c16341fbd31bac47c7471',
value: parseEther('0.000777'),
},
}),
}
vi.spyOn(mockFn, 'simulateMint')

const mint: MintIntentParams = {
chainId: Chains.BLAST,
contractAddress: '0x8704c8b68e577d54be3c16341fbd31bac47c7471',
tokenId: 1,
amount: BigInt(1),
recipient: '0xf70da97812CB96acDF810712Aa562db8dfA3dbEF',
}
const value = parseEther('0.000777')
const account = '0xf70da97812CB96acDF810712Aa562db8dfA3dbEF'

const result = await mockFn.simulateMint(mint, value, account)
const request = result.request
expect(request.address).toBe(mint.contractAddress)
expect(request.value).toBe(value)
Expand Down
1 change: 1 addition & 0 deletions packages/zora/src/chain-ids.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { Chains } from '@rabbitholegg/questdk-plugin-utils'
export const CHAIN_ID_ARRAY = [
Chains.ARBITRUM_ONE,
Chains.BASE,
Chains.BLAST,
Chains.ETHEREUM,
Chains.OPTIMISM,
Chains.ZORA,
Expand Down
1 change: 1 addition & 0 deletions packages/zora/src/contract-addresses.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export const FIXED_PRICE_SALE_STRATS: { [chainId: number]: Address } = {
[Chains.ZORA]: '0x04E2516A2c207E84a1839755675dfd8eF6302F0a',
[Chains.BASE]: '0x04E2516A2c207E84a1839755675dfd8eF6302F0a',
[Chains.ARBITRUM_ONE]: '0x1Cd1C1f3b8B779B50Db23155F2Cb244FCcA06B21',
[Chains.BLAST]: '0x3eb144aee170bf62fda1536e38af51f08e34a5d0',
}

export const ZORA_1155_FACTORY = '0x777777c338d93e2c7adf08d102d45ca7cc4ed021'
Expand Down

0 comments on commit f134c32

Please sign in to comment.