diff --git a/deploy/01_deploy_mastercopy_ERC721Tokenbound.ts b/deploy/01_deploy_mastercopy_ERC721Tokenbound.ts index 1be0e8c..46c78dd 100644 --- a/deploy/01_deploy_mastercopy_ERC721Tokenbound.ts +++ b/deploy/01_deploy_mastercopy_ERC721Tokenbound.ts @@ -35,8 +35,8 @@ const deployMastercopyERC721Tokenbound: DeployFunction = async (hre) => { if (await deployerClient.extend(publicActions).getBytecode({ address })) { console.log(` ✔ Contract is already deployed at ${address}`) } else { - await deployERC721TokenboundMechMastercopy(deployerClient) - console.log(` ✔ Contract deployed at ${address}`) + const txHash = await deployERC721TokenboundMechMastercopy(deployerClient) + console.log(` ✔ Contract deployed at ${address} (tx hash: ${txHash})`) } try { diff --git a/sdk/src/deploy/deployERC1155TokenboundMech.ts b/sdk/src/deploy/deployERC1155TokenboundMech.ts index 9f4bcb7..a0d39bd 100644 --- a/sdk/src/deploy/deployERC1155TokenboundMech.ts +++ b/sdk/src/deploy/deployERC1155TokenboundMech.ts @@ -1,8 +1,14 @@ -import { encodeFunctionData, getCreate2Address, WalletClient } from "viem" +import { + encodeFunctionData, + getContract, + getCreate2Address, + WalletClient, +} from "viem" import { ERC1155TokenboundMech__factory } from "../../../typechain-types" import { DEFAULT_SALT, + ERC2470_SINGLETON_FACTORY_ABI, ERC2470_SINGLETON_FACTORY_ADDRESS, ERC6551_REGISTRY_ABI, ERC6551_REGISTRY_ADDRESS, @@ -113,8 +119,16 @@ export const deployERC1155TokenboundMech = async ( export const deployERC1155TokenboundMechMastercopy = async ( walletClient: WalletClient ) => { - return await deployMastercopy( + const singletonFactory = getContract({ + address: ERC2470_SINGLETON_FACTORY_ADDRESS, + abi: ERC2470_SINGLETON_FACTORY_ABI, walletClient, - ERC1155TokenboundMech__factory.bytecode + }) + + return await singletonFactory.write.deploy( + [ERC1155TokenboundMech__factory.bytecode, DEFAULT_SALT], + { + gas: 2000000, + } ) } diff --git a/sdk/src/deploy/deployERC721TokenboundMech.ts b/sdk/src/deploy/deployERC721TokenboundMech.ts index 11c21f3..7d8c74f 100644 --- a/sdk/src/deploy/deployERC721TokenboundMech.ts +++ b/sdk/src/deploy/deployERC721TokenboundMech.ts @@ -1,8 +1,14 @@ -import { encodeFunctionData, getCreate2Address, WalletClient } from "viem" +import { + encodeFunctionData, + getContract, + getCreate2Address, + WalletClient, +} from "viem" import { ERC721TokenboundMech__factory } from "../../../typechain-types" import { DEFAULT_SALT, + ERC2470_SINGLETON_FACTORY_ABI, ERC2470_SINGLETON_FACTORY_ADDRESS, ERC6551_REGISTRY_ABI, ERC6551_REGISTRY_ADDRESS, @@ -113,8 +119,16 @@ export const deployERC721TokenboundMech = async ( export const deployERC721TokenboundMechMastercopy = async ( walletClient: WalletClient ) => { - return await deployMastercopy( + const singletonFactory = getContract({ + address: ERC2470_SINGLETON_FACTORY_ADDRESS, + abi: ERC2470_SINGLETON_FACTORY_ABI, walletClient, - ERC721TokenboundMech__factory.bytecode + }) + + return await singletonFactory.write.deploy( + [ERC721TokenboundMech__factory.bytecode, DEFAULT_SALT], + { + gas: 2000000, + } ) }