pause
The pause
method applies to ERC-721 tokens that feature the "Pausable" capability. This function empowers the contract's owner or designated pausers to temporarily suspend specific actions within the contract, such as token transfers or minting. It serves as a safeguard during emergencies or maintenance periods. The pause method is an integral component of the ERC721Instance
object, accessible through suitable methods from the client library (e.g., ZkyugaClient
or equivalent).
Method Signature
async pause(signer: WalletSigner): Promise<TransactionResponse>
Parameters
signer
WalletSigner
An instance of the wallet signer responsible for initiating the transaction. This signer should possess the authority to pause the contract, typically the contract's owner or a designated pauser.
Returns
A
Promise
resolving to aTransactionResponse
object, furnishing comprehensive details regarding the transaction, including its status and transaction hash.
Usage Example
Commence by initializing the desired ERC-721 token contract:
const erc721 = zkyugaClient.getERC721Instance("your ERC-721 contract address here");
Subsequently, employ the pause
method to temporarily suspend certain functionalities of the contract:
const signer = zkyugaClient.createWalletSigner("your private key");
const transactionResponse = await erc721.pause(signer);
console.log(`Pause Transaction Hash: ${transactionResponse.hash}`);
Notes
Only addresses endowed with appropriate permissions can invoke the
pause
function. Unauthorized attempts will result in failed transactions.Pausing the contract can temporarily halt various functionalities, including minting and transferring tokens. Ensure you comprehend the implications and communicate any pauses to token holders or stakeholders.
Always rigorously manage your private keys. When utilizing the
signer
, uphold the security of your environment and refrain from exposing private keys.
Last updated