Skip to main content

pause

The pause method is relevant to ERC-721 tokens that incorporate the "Pausable" functionality. This function allows the contract's owner or designated pausers to temporarily halt certain actions within the contract, such as transferring or minting tokens. This can be useful in emergency scenarios or for maintenance. The pause method is part of the ERC721Instance object, which can be obtained via appropriate methods from the client library (e.g., EdexaClient or similar).

Method Signature

async pause(signer: WalletSigner): Promise<TransactionResponse>

Parameters

ParameterTypeDescription
signerWalletSignerAn instance of the wallet signer responsible for initiating the transaction. Should have the authority to pause the contract, typically the contract's owner or a designated pauser.

Returns

  • A Promise that resolves to a TransactionResponse object. This object provides details about the transaction, such as its status, transaction hash, and more.

Usage Example

First, instantiate the desired ERC-721 token contract:

const erc721 = edexaClient.getERC721Instance("your ERC-721 contract address here");

Then, use the pause method to halt certain functionalities of the contract:

const signer = edexaClient.createWalletSigner("your private key");
const transactionResponse = await erc721.pause(signer);
console.log(`Pause Transaction Hash: ${transactionResponse.hash}`);

Notes

  • Only addresses with appropriate permissions can call the pause function. Attempting to invoke this function without the correct permissions will result in a failed transaction.

  • Pausing the contract might halt various functionalities, like minting, transferring, and more. Ensure you're aware of the implications and have communicated any pauses to token holders or stakeholders.

  • Always securely manage your private keys. When using the signer, ensure the security of your environment and avoid exposing private keys.