All files constants.ts

100% Statements 132/132
100% Branches 1/1
100% Functions 0/0
100% Lines 132/132

Press n or j to go to the next uncovered block, b, p or k for the previous block.

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 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 1331x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 5x 5x 5x 5x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x  
import { Chains } from '@rabbitholegg/questdk-plugin-utils'
import { type AbiFunction, type Address, getAbiItem } from 'viem'
 
const DROP_FACTORY_ETHEREUM = '0x53f451165ba6fdbe39a134673d13948261b2334a'
const DROP_FACTORY_BASE = '0x62037b26fff91929655aa3a060f327b47d1e2b3e'
 
export const CHAIN_TO_CONTRACT_ADDRESS: Record<number, Address> = {
  [Chains.ETHEREUM]: DROP_FACTORY_ETHEREUM,
  [Chains.BASE]: DROP_FACTORY_BASE,
}
 
const DROP_FACTORY_ABI = [
  {
    // 0x16da9864
    inputs: [
      { internalType: 'address', name: 'nftContract', type: 'address' },
      { internalType: 'uint256', name: 'count', type: 'uint256' },
      { internalType: 'address', name: 'nftRecipient', type: 'address' },
    ],
    name: 'mintFromDutchAuctionV2',
    outputs: [
      { internalType: 'uint256', name: 'firstTokenId', type: 'uint256' },
    ],
    stateMutability: 'payable',
    type: 'function',
  },
  {
    // 0x334965c2
    inputs: [
      { internalType: 'address', name: 'nftContract', type: 'address' },
      { internalType: 'uint16', name: 'count', type: 'uint16' },
      { internalType: 'address', name: 'nftRecipient', type: 'address' },
      { internalType: 'address payable', name: 'buyReferrer', type: 'address' },
    ],
    name: 'mintFromFixedPriceSaleV2',
    outputs: [
      { internalType: 'uint256', name: 'firstTokenId', type: 'uint256' },
    ],
    stateMutability: 'payable',
    type: 'function',
  },
  {
    // 0x0cafb113
    inputs: [
      { internalType: 'address', name: 'nftContract', type: 'address' },
      { internalType: 'uint256', name: 'count', type: 'uint256' },
      { internalType: 'address', name: 'nftRecipient', type: 'address' },
      { internalType: 'address payable', name: 'buyReferrer', type: 'address' },
      { internalType: 'bytes32[]', name: 'proof', type: 'bytes32[]' },
    ],
    name: 'mintFromFixedPriceSaleWithEarlyAccessAllowlistV2',
    outputs: [
      { internalType: 'uint256', name: 'firstTokenId', type: 'uint256' },
    ],
    stateMutability: 'payable',
    type: 'function',
  },
  {
    inputs: [{ internalType: 'address', name: 'nftContract', type: 'address' }],
    name: 'getFixedPriceSaleV2',
    outputs: [
      { internalType: 'address payable', name: 'seller', type: 'address' },
      { internalType: 'uint256', name: 'price', type: 'uint256' },
      { internalType: 'uint256', name: 'limitPerAccount', type: 'uint256' },
      {
        internalType: 'uint256',
        name: 'numberOfTokensAvailableToMint',
        type: 'uint256',
      },
      { internalType: 'bool', name: 'marketCanMint', type: 'bool' },
      {
        internalType: 'uint256',
        name: 'generalAvailabilityStartTime',
        type: 'uint256',
      },
      {
        internalType: 'uint256',
        name: 'earlyAccessStartTime',
        type: 'uint256',
      },
      { internalType: 'uint256', name: 'mintFeePerNftInWei', type: 'uint256' },
    ],
    stateMutability: 'view',
    type: 'function',
  },
  {
    inputs: [{ internalType: 'address', name: 'nftContract', type: 'address' }],
    name: 'getDutchAuctionV2',
    outputs: [
      { internalType: 'uint256', name: 'maxPrice', type: 'uint256' },
      { internalType: 'uint256', name: 'minPrice', type: 'uint256' },
      { internalType: 'uint256', name: 'limitPerAccount', type: 'uint256' },
      { internalType: 'uint256', name: 'startTime', type: 'uint256' },
      { internalType: 'uint256', name: 'endTime', type: 'uint256' },
      {
        internalType: 'uint256',
        name: 'totalAvailableSupply',
        type: 'uint256',
      },
      { internalType: 'uint256', name: 'totalMintedCount', type: 'uint256' },
      { internalType: 'uint256', name: 'lastSalePrice', type: 'uint256' },
      { internalType: 'uint256', name: 'currentPrice', type: 'uint256' },
      { internalType: 'uint256', name: 'mintFeePerNftInWei', type: 'uint256' },
    ],
    stateMutability: 'view',
    type: 'function',
  },
]
 
export const FIXED_PRICE_FRAGMENTS = DROP_FACTORY_ABI.filter(({ name }) =>
  [
    'mintFromFixedPriceSaleV2',
    'mintFromFixedPriceSaleWithEarlyAccessAllowlistV2',
  ].includes(name as string),
)
export const DUTCH_AUCTION_FRAGMENT = getAbiItem({
  abi: DROP_FACTORY_ABI,
  name: 'mintFromDutchAuctionV2',
}) as AbiFunction
 
export const GET_FIXED_PRICE = getAbiItem({
  abi: DROP_FACTORY_ABI,
  name: 'getFixedPriceSaleV2',
}) as AbiFunction
export const GET_DUTCH_AUCTION_PRICE = getAbiItem({
  abi: DROP_FACTORY_ABI,
  name: 'getDutchAuctionV2',
}) as AbiFunction
 
// for referrals
export const ZORA_DEPLOYER_ADDRESS =
  '0xe3bBA2A4F8E0F5C32EF5097F988a4d88075C8B48'