Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions cli-typescript/src/abis/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
4 changes: 2 additions & 2 deletions cli-typescript/src/utils/ContractManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ export class ContractManager {
public async setTransferValidator(contractAddress: Hex): Promise<Hex> {
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({
Expand Down Expand Up @@ -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],
Expand Down
16 changes: 4 additions & 12 deletions cli-typescript/src/utils/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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;

Expand Down
59 changes: 13 additions & 46 deletions cli-typescript/src/utils/getters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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 => {
Expand Down Expand Up @@ -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;
};

/**
Expand Down
11 changes: 2 additions & 9 deletions cli/cmds/const
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion cli/cmds/contract
Original file line number Diff line number Diff line change
Expand Up @@ -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 ""
Expand Down
36 changes: 6 additions & 30 deletions cli/cmds/getters
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down