kamiweb3-sdk
Version:
TypeScript SDK for KAMI721-C, KAMI721-AC, and KAMI1155-C smart contracts
61 lines (60 loc) • 3.03 kB
TypeScript
import { Signer, BigNumberish, AddressLike } from 'ethers';
import { ERC721CWrapper } from '../contracts/ERC721CWrapper';
import { SignerOrProvider } from '../types';
/**
* Arguments required for deploying the standard ERC721C contract.
*/
export interface ERC721CDeployArgs {
usdcAddress: string;
name: string;
symbol: string;
baseURI: string;
initialMintPrice: BigNumberish;
platformAddress: string;
platformCommissionPercentage: BigNumberish;
}
/**
* Arguments required for initializing the upgradeable ERC721C contract.
* Matches the DeployArgs for the standard version in this case.
*/
export type ERC721CInitializeArgs = ERC721CDeployArgs;
export declare class ERC721CFactory {
/**
* Attaches to an existing standard ERC721C contract.
* @param address The address of the deployed ERC721C contract.
* @param signerOrProvider A Signer (for transactions) or Provider (for read-only).
* @returns An ERC721CWrapper instance using the standard ABI.
*/
static attach(address: string, signerOrProvider: SignerOrProvider): ERC721CWrapper;
/**
* Attaches to an existing upgradeable ERC721C contract (proxy).
* @param proxyAddress The address of the deployed proxy contract.
* @param signerOrProvider A Signer (for transactions) or Provider (for read-only).
* @returns An ERC721CWrapper instance using the upgradeable ABI.
*/
static attachUpgradeable(proxyAddress: string, signerOrProvider: SignerOrProvider): ERC721CWrapper;
/**
* Deploys a new standard (non-upgradeable) ERC721C contract.
* @param args The deployment arguments based on the contract constructor.
* @param signer The signer to use for deployment.
* @returns A Promise resolving to an ERC721CWrapper instance of the deployed contract.
*/
static deploy(args: ERC721CDeployArgs, signer: Signer): Promise<ERC721CWrapper>;
/**
* Deploys a new upgradeable ERC721C contract using the Transparent Proxy pattern.
* @param initArgs The arguments for the initializer function.
* @param signer The signer to use for deployment.
* @param proxyAdminOwner (Optional) The address that will own the ProxyAdmin. Defaults to the signer.
* @returns A Promise resolving to an ERC721CWrapper instance attached to the proxy address.
*/
static deployUpgradeable(initArgs: ERC721CInitializeArgs, signer: Signer, proxyAdminOwner?: AddressLike): Promise<ERC721CWrapper>;
/**
* Initiates an upgrade of a transparent proxy to a new implementation contract.
* Note: This only deploys the new implementation. The actual upgrade call must be made
* via the ProxyAdmin contract, typically by the ProxyAdmin owner.
* @param proxyAddress The address of the proxy contract to upgrade.
* @param signer The signer to deploy the new implementation.
* @returns The address of the newly deployed implementation contract.
*/
static deployNewImplementation(signer: Signer): Promise<string>;
}