diff --git a/cli-typescript/src/abis/index.ts b/cli-typescript/src/abis/index.ts index 808e63ad..6ffa88cd 100644 --- a/cli-typescript/src/abis/index.ts +++ b/cli-typescript/src/abis/index.ts @@ -20,9 +20,9 @@ export const APPLY_LIST_TO_COLLECTION_ABI = { type: 'address', }, { - internalType: 'uint120', + internalType: 'uint48', name: 'id', - type: 'uint120', + type: 'uint48', }, ], name: 'applyListToCollection', diff --git a/cli-typescript/src/utils/ContractManager.ts b/cli-typescript/src/utils/ContractManager.ts index e942cc72..97890ac4 100644 --- a/cli-typescript/src/utils/ContractManager.ts +++ b/cli-typescript/src/utils/ContractManager.ts @@ -283,7 +283,7 @@ export class ContractManager { public async setTransferValidator(contractAddress: Hex): Promise { try { // Get the transfer validator address for the given chain ID - const tfAddress = getTransferValidatorAddress(this.chainId); + const tfAddress = getTransferValidatorAddress(); console.log(`Setting transfer validator to ${tfAddress}...`); const data = encodeFunctionData({ @@ -321,7 +321,7 @@ export class ContractManager { console.log(`Setting transfer list to list ID ${tfListId}...`); // Get the transfer validator address - const tfAddress = getTransferValidatorAddress(this.chainId) as Hex; + const tfAddress = getTransferValidatorAddress() as Hex; const data = encodeFunctionData({ abi: [APPLY_LIST_TO_COLLECTION_ABI], diff --git a/cli-typescript/src/utils/constants.ts b/cli-typescript/src/utils/constants.ts index ed18eabd..e549bc8f 100644 --- a/cli-typescript/src/utils/constants.ts +++ b/cli-typescript/src/utils/constants.ts @@ -24,14 +24,8 @@ export const DEFAULT_COLLECTION_DIR = path.resolve( '../../collections', ); -export const ME_TRANSFER_VALIDATOR_V3 = - '0x721C00D4FB075b22a5469e9CF2440697F729aA13'; -export const LIMITBREAK_TRANSFER_VALIDATOR_V3 = - '0x721C0078c2328597Ca70F5451ffF5A7B38D4E947'; -export const LIMITBREAK_TRANSFER_VALIDATOR_V3_ABSTRACT = - '0x3203c3f64312AF9344e42EF8Aa45B97C9DFE4594'; -export const LIMITBREAK_TRANSFER_VALIDATOR_V3_BERACHAIN = - '0x721c002b0059009a671d00ad1700c9748146cd1b'; +export const LIMIT_BREAK_TRANSFER_VALIDATOR_V5 = + "0x721C008fdff27BF06E7E123956E2Fe03B63342e3" export const ABSTRACT_FACTORY_ADDRESS = '0x4a08d3F6881c4843232EFdE05baCfb5eAaB35d19'; @@ -47,11 +41,9 @@ export const ICREATOR_TOKEN_INTERFACE_ID = '0xad0d7f6c'; // type(ICreatorToken). export const TRUE_HEX = '0x0000000000000000000000000000000000000000000000000000000000000001'; -// Used on chains where we don't have a custom list +// The standard Limit Break owned list is 0 +// This should support SeaPort (and thus Magic Eden) by default export const DEFAULT_LIST_ID = 0; -export const MAGIC_EDEN_DEFAULT_LIST_ID = 1; -// We use list 3 for Polygon because list 1 was already taken. -export const MAGIC_EDEN_POLYGON_LIST_ID = 3; export const DEFAULT_IMPL_ID = 0; diff --git a/cli-typescript/src/utils/getters.ts b/cli-typescript/src/utils/getters.ts index d1592b32..322f62d1 100644 --- a/cli-typescript/src/utils/getters.ts +++ b/cli-typescript/src/utils/getters.ts @@ -8,12 +8,7 @@ import { DEFAULT_LIST_ID, DEFAULT_REGISTRY_ADDRESS, explorerUrls, - LIMITBREAK_TRANSFER_VALIDATOR_V3, - LIMITBREAK_TRANSFER_VALIDATOR_V3_ABSTRACT, - LIMITBREAK_TRANSFER_VALIDATOR_V3_BERACHAIN, - MAGIC_EDEN_DEFAULT_LIST_ID, - MAGIC_EDEN_POLYGON_LIST_ID, - ME_TRANSFER_VALIDATOR_V3, + LIMIT_BREAK_TRANSFER_VALIDATOR_V5, SUPPORTED_CHAINS, supportedChainNames, TOKEN_STANDARD, @@ -37,31 +32,13 @@ import { Hex } from 'viem'; import { setBaseDir } from './setters'; /** - * Retrieves the transfer validator address based on the network (chain ID). - * @param chainId The chain ID of the network. - * @returns The transfer validator address for the given network. + * Retrieves the transfer validator address + * @returns The transfer validator address */ -export const getTransferValidatorAddress = (chainId: SUPPORTED_CHAINS): Hex => { - switch (chainId) { - case SUPPORTED_CHAINS.APECHAIN: - case SUPPORTED_CHAINS.SEI: - return ME_TRANSFER_VALIDATOR_V3; - - case SUPPORTED_CHAINS.ARBITRUM: - case SUPPORTED_CHAINS.BASE: - case SUPPORTED_CHAINS.ETHEREUM: - case SUPPORTED_CHAINS.SEPOLIA: - return LIMITBREAK_TRANSFER_VALIDATOR_V3; - - case SUPPORTED_CHAINS.ABSTRACT: - return LIMITBREAK_TRANSFER_VALIDATOR_V3_ABSTRACT; - - case SUPPORTED_CHAINS.BERACHAIN: - return LIMITBREAK_TRANSFER_VALIDATOR_V3_BERACHAIN; - - default: - return LIMITBREAK_TRANSFER_VALIDATOR_V3; - } +export const getTransferValidatorAddress = (): Hex => { + // Limit Break CreatorTokenTransferValidator is deployed to the same + // Address on all of our mainnet production EVM chains + return LIMIT_BREAK_TRANSFER_VALIDATOR_V5; }; export const getZksyncFlag = (chainId: SUPPORTED_CHAINS): string => { @@ -161,23 +138,13 @@ export const getViemChainByChainId = (chainId: SUPPORTED_CHAINS) => { }; /** - * Retrieves the transfer validator list ID based on the network (chain ID). - * @param chainId The chain ID of the network. - * @returns The transfer validator list ID for the given network. + * Retrieves the transfer validator list ID + * @returns The transfer validator list ID */ -export const getTransferValidatorListId = ( - chainId: SUPPORTED_CHAINS, -): number => { - switch (chainId) { - case SUPPORTED_CHAINS.BERACHAIN: - return DEFAULT_LIST_ID; - - case SUPPORTED_CHAINS.POLYGON: - return MAGIC_EDEN_POLYGON_LIST_ID; - - default: - return MAGIC_EDEN_DEFAULT_LIST_ID; - } +export const getTransferValidatorListId = (): number => { + // The standard Limit Break owned list is 0 + // This should support SeaPort (and thus Magic Eden) by default + return DEFAULT_LIST_ID; }; /** diff --git a/cli/cmds/const b/cli/cmds/const index 02d0eb79..222fab19 100644 --- a/cli/cmds/const +++ b/cli/cmds/const @@ -19,19 +19,12 @@ MAGIC_DROP_KEYSTORE="MAGIC_DROP_KEYSTORE" MAGIC_DROP_KEYSTORE_FILE="$HOME/.foundry/keystores/$MAGIC_DROP_KEYSTORE" export ETH_KEYSTORE_ACCOUNT=$MAGIC_DROP_KEYSTORE -ME_TRANSFER_VALIDATOR_V3="0x721C00D4FB075b22a5469e9CF2440697F729aA13" -LIMITBREAK_TRANSFER_VALIDATOR_V3="0x721C0078c2328597Ca70F5451ffF5A7B38D4E947" -LIMITBREAK_TRANSFER_VALIDATOR_V3_ABSTRACT="0x3203c3f64312AF9344e42EF8Aa45B97C9DFE4594" -LIMITBREAK_TRANSFER_VALIDATOR_V3_BERACHAIN="0x721c002b0059009a671d00ad1700c9748146cd1b" +LIMIT_BREAK_TRANSFER_VALIDATOR_V5="0x721C008fdff27BF06E7E123956E2Fe03B63342e3" ICREATOR_TOKEN_INTERFACE_ID="0xad0d7f6c" # type(ICreatorToken).interfaceId TRUE_HEX="0x0000000000000000000000000000000000000000000000000000000000000001" -# Used on chains where we don't have a custom list DEFAULT_LIST_ID="0" -MAGIC_EDEN_DEFAULT_LIST_ID="1" -# We use list 3 for Polygon because list 1 was already taken. -MAGIC_EDEN_POLYGON_LIST_ID="3" DEFAULT_IMPL_ID="0" @@ -68,7 +61,7 @@ get_impl_id() { echo "10" # ethereum elif [ "$chain_id" == "80094" ]; then echo "5" # berachain - elif [ "$chain_id" == "10143"]; then + elif [ "$chain_id" == "10143" ]; then echo "5" # monad testnet elif [ "$chain_id" == "43114" ]; then echo "6" # avalanche diff --git a/cli/cmds/contract b/cli/cmds/contract index 111d751a..5c727717 100644 --- a/cli/cmds/contract +++ b/cli/cmds/contract @@ -105,7 +105,7 @@ set_transfer_validator() { set_transfer_list() { tf_list_id=$(get_transfer_validator_list_id $chain_id) echo "Setting transfer list to list ID $tf_list_id..." - output=$(cast send $tf_address "applyListToCollection(address,uint120)" $contract_address $tf_list_id $password $(zksync_flag) --rpc-url "$RPC_URL" --json) + output=$(cast send $tf_address "applyListToCollection(address,uint48)" $contract_address $tf_list_id $password $(zksync_flag) --rpc-url "$RPC_URL" --json) print_transaction_hash $output echo "Transfer list set." echo "" diff --git a/cli/cmds/getters b/cli/cmds/getters index 84fa3ff9..38411343 100644 --- a/cli/cmds/getters +++ b/cli/cmds/getters @@ -74,40 +74,16 @@ select_chain() { echo "$chain_id:$chain" } +# Limit Break CreatorTokenTransferValidator is deployed to the same +# Address on all of our mainnet production EVM chains get_transfer_validator_address() { - local network="$1" - case $network in - "33139"|"1329") - echo "$ME_TRANSFER_VALIDATOR_V3" - ;; - "42161"|"8453"|"1"|"11155111") - echo "$LIMITBREAK_TRANSFER_VALIDATOR_V3" - ;; - "2741") - echo "$LIMITBREAK_TRANSFER_VALIDATOR_V3_ABSTRACT" - ;; - "80094") - echo "$LIMITBREAK_TRANSFER_VALIDATOR_V3_BERACHAIN" - ;; - *) - echo "$LIMITBREAK_TRANSFER_VALIDATOR_V3" - ;; - esac + echo "$LIMIT_BREAK_TRANSFER_VALIDATOR_V5" } +# The standard Limit Break owned list is 0 +# This should support SeaPort (and thus Magic Eden) by default get_transfer_validator_list_id() { - local network="$1" - case $network in - "80094") - echo $DEFAULT_LIST_ID - ;; - "137") - echo $MAGIC_EDEN_POLYGON_LIST_ID - ;; - *) - echo $MAGIC_EDEN_DEFAULT_LIST_ID - ;; - esac + echo "$DEFAULT_LIST_ID" } is_number() {