Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/wolfy-nft/magicdrop into ad…
Browse files Browse the repository at this point in the history
…am/contract_factory

Signed-off-by: Adam Wolf <wolfynft@gmail.com>
  • Loading branch information
wolfy-nft committed Nov 28, 2024
2 parents abb28cd + dcd115e commit 1dd8e8c
Show file tree
Hide file tree
Showing 4 changed files with 89 additions and 2 deletions.
15 changes: 15 additions & 0 deletions hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,11 @@ const config: HardhatUserConfig = {
accountsBalance: '1000000000000000000000',
},
},
apechain: {
url: 'https://apechain.calderachain.xyz/http',
accounts:
process.env.PRIVATE_KEY !== undefined ? [process.env.PRIVATE_KEY] : [],
},
base: {
url: process.env.BASE_URL || 'https://mainnet.base.org',
accounts:
Expand Down Expand Up @@ -130,6 +135,16 @@ const config: HardhatUserConfig = {
},
etherscan: {
apiKey: process.env.ETHERSCAN_API_KEY,
customChains: [
{
network: "apechain",
chainId: 33139,
urls: {
apiURL: "https://api.apescan.io/api",
browserURL: "https://apescan.io/"
}
}
]
},
sourcify: {
enabled: true,
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@
"solidity-coverage": "^0.8.11",
"ts-node": "^10.7.0",
"typechain": "^8.1.0",
"typescript": "^4.6.4"
"typescript": "^5.6.3",
"viem": "^2.21.37"
},
"lint-staged": {
"*.{js,ts}": [
Expand Down
9 changes: 8 additions & 1 deletion scripts/utils/helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,13 +110,18 @@ export const estimateGas = async (

const getTokenName = (hre: HardhatRuntimeEnvironment) => {
switch (hre.network.name) {
case 'base':
case 'mainnet':
case 'sepolia':
case 'goerli':
return 'ETH';
case 'polygon':
case 'mumbai':
return 'MATIC';
case 'apechain':
return 'APE';
case 'arbitrum':
return 'ARB';
default:
return 'ETH';
}
Expand Down Expand Up @@ -204,4 +209,6 @@ export const cleanWhitelist = async (whitelistPath: string, writeToFile: boolean
}
console.log(`=========================================`);
return wallets;
}
}

export const ensureArray = (value: any) => Array.isArray(value) ? value : [value];
64 changes: 64 additions & 0 deletions scripts/utils/validator.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
const LIMITBREAK_TRANSFER_VALIDATOR_V3 =
'0x721C0078c2328597Ca70F5451ffF5A7B38D4E947';
const ME_TRANSFER_VALIDATOR_V3 = '0x721C00D4FB075b22a5469e9CF2440697F729aA13';

export const APPLY_LIST_TO_COLLECTION_ABI = [
{
inputs: [
{
internalType: 'address',
name: 'collection',
type: 'address',
},
{
internalType: 'uint120',
name: 'id',
type: 'uint120',
},
],
name: 'applyListToCollection',
outputs: [],
stateMutability: 'nonpayable',
type: 'function',
},
];

export type TransferValidatorSetting = {
validatorAddress: string;
listId: number;
};

// ME owned list id on transfer validator v3
const NETWORK_VALIDATOR_LIST_ID: Record<string, TransferValidatorSetting> = {
// ME owned listId = 1, 2, 3 on ME owned validator
'apechain': {
validatorAddress: ME_TRANSFER_VALIDATOR_V3,
listId: 1,
},
// ME owned listId = 3, 4, 5 on LB owned validator
'arbitrum': {
validatorAddress: LIMITBREAK_TRANSFER_VALIDATOR_V3,
listId: 1,
},
// ME owned listId = 1, 2, 3 on LB owned validator
'base': {
validatorAddress: LIMITBREAK_TRANSFER_VALIDATOR_V3,
listId: 1,
},
// ME owned listId = 3, 4, 5 on LB owned validator
'mainnet': {
validatorAddress: LIMITBREAK_TRANSFER_VALIDATOR_V3,
listId: 1,
},
// ME owned listId = 3, 4, 5 on LB owned validator
'polygon': {
validatorAddress: LIMITBREAK_TRANSFER_VALIDATOR_V3,
listId: 3,
},
};

export function getTargetListOnValidatorV3(
network: string,
): TransferValidatorSetting {
return NETWORK_VALIDATOR_LIST_ID[network];
}

0 comments on commit 1dd8e8c

Please sign in to comment.