publishContract

Prepares a transaction to call the "publishContract" function on the contract.

Example

import { sendTransaction } from "thirdweb";
import { publishContract } from "thirdweb/extensions/thirdweb";
const transaction = publishContract({
contract,
publisher: ...,
contractId: ...,
publishMetadataUri: ...,
compilerMetadataUri: ...,
bytecodeHash: ...,
implementation: ...,
overrides: {
...
}
});
// Send the transaction
await sendTransaction({ transaction, account });
function publishContract(
| { asyncParams: () => Promise<PublishContractParams> }
>,

Parameters

The options for the "publishContract" function.

Type

| { asyncParams: () => Promise<PublishContractParams> }
>;

Returns

let returnType: PreparedTransaction<
any,
AbiFunction,
>;

A prepared transaction object.