setContractURI
/**
* setContractURI function: Set the "contractURI" metadata for the specified contract
* @param {string} contractURI ContractURI for the contract
* (URI to a JSON file describing the contract's metadata)
* @notice Warning: This method will consume gas (35000 gas estimated)
* @returns {Promise<ethers.providers.TransactionResponse>} Transaction
*/
async setContractURI({ contractURI }) {
if (!this.#contractDeployed && !this.contractAddress) {
throw new Error(
'[ERC721Mintable.setContractURI] A contract should be deployed or loaded first!',
);
}
if (!contractURI) {
throw new Error('[ERC721Mintable.setContractURI] A valid contract uri is required!');
}
try {
return await this.#contractDeployed.setContractURI(contractURI);
} catch (error) {
const { message, type } = networkErrorHandler(error);
throw new Error(`${type}[ERC721Mintable.setContractURI] An error occured: ${message}`);
}
}
Copy link