Deploying contracts
To deploy contracts, you will first need to instantiate the SDK with a valid signer.
const sdk = await ThirdwebSDK.fromWallet(wallet, "sepolia");
const address = await sdk.deployer.deployBuiltInContract(
"nft-collection",
{
name: "My NFT Contract",
primary_sale_recipient: "0x...",
},
);
console.log("Deployed at", address);
Deploy methods
You can then use the sdk.deployer
object to deploy different kind of contracts.
Deploy type | Function | Notes |
---|---|---|
Prebuilt | deployBuiltInContract | Deploy thirdweb's prebuilt contracts, handles uploading metadata for you |
Published | deployPublishedContract | Deploy any published contract, handling proxy/factory deployment on any EVM chain |
Proxy | deployViaProxy | Deploy a proxy of an implementation contract |
Factory | deployViaFactory | Deploy a contract via the given factory contract |
ABI / Bytecode | deployContractWithAbi | Deploy a contract from its bytecode and ABI |