import { Address } from '@btc-vision/transaction'; import { CallResult } from '../../../../contracts/CallResult.js'; import { OPNetEvent } from '../../../../contracts/OPNetEvent.js'; import { IOP20SContract } from '../opnet/IOP20SContract.js'; export type MintedEventStable = { readonly to: Address; readonly amount: bigint; }; export type BurnedEventStable = { readonly from: Address; readonly amount: bigint; }; export type BlacklistedEventStable = { readonly account: Address; readonly blacklister: Address; }; export type UnblacklistedEventStable = { readonly account: Address; readonly blacklister: Address; }; export type PausedEventStable = { readonly pauser: Address; }; export type UnpausedEventStable = { readonly pauser: Address; }; export type OwnershipTransferStartedEventStable = { readonly currentOwner: Address; readonly pendingOwner: Address; }; export type OwnershipTransferredEventStable = { readonly previousOwner: Address; readonly newOwner: Address; }; export type MinterChangedEventStable = { readonly previousMinter: Address; readonly newMinter: Address; }; export type BlacklisterChangedEventStable = { readonly previousBlacklister: Address; readonly newBlacklister: Address; }; export type PauserChangedEventStable = { readonly previousPauser: Address; readonly newPauser: Address; }; export type MintStable = CallResult<{}, [OPNetEvent]>; export type BurnFromStable = CallResult<{}, [OPNetEvent]>; export type BlacklistStable = CallResult<{}, [OPNetEvent]>; export type UnblacklistStable = CallResult<{}, [OPNetEvent]>; export type IsBlacklistedStable = CallResult<{ blacklisted: boolean }, []>; export type PauseStable = CallResult<{}, [OPNetEvent]>; export type UnpauseStable = CallResult<{}, [OPNetEvent]>; export type IsPausedStable = CallResult<{ paused: boolean }, []>; export type TransferOwnershipStable = CallResult< {}, [OPNetEvent] >; export type AcceptOwnershipStable = CallResult<{}, [OPNetEvent]>; export type SetMinterStable = CallResult<{}, [OPNetEvent]>; export type SetBlacklisterStable = CallResult<{}, [OPNetEvent]>; export type SetPauserStable = CallResult<{}, [OPNetEvent]>; export type OwnerStable = CallResult<{ owner: Address }, []>; export type MinterStable = CallResult<{ minter: Address }, []>; export type BlacklisterStable = CallResult<{ blacklister: Address }, []>; export type PauserStable = CallResult<{ pauser: Address }, []>; /** * @description This interface represents the MyStableCoin contract, * extending OP20S with managed stablecoin functionality including * blacklisting, pausing, and role-based access control. * * @interface IStableCoinContract * @extends {IOP20SContract} * @category Contracts */ export interface IStableCoinContract extends IOP20SContract { /** * @description Mints tokens to the specified address. Only callable by minter. * @param to - The address to mint tokens to. * @param amount - The amount of tokens to mint. * @returns {Promise} */ mint(to: Address, amount: bigint): Promise; /** * @description Burns tokens from the specified address. Only callable by minter. * @param from - The address to burn tokens from. * @param amount - The amount of tokens to burn. * @returns {Promise} */ burnFrom(from: Address, amount: bigint): Promise; /** * @description Blacklists an account. Only callable by blacklister. * @param account - The address to blacklist. * @returns {Promise} */ blacklist(account: Address): Promise; /** * @description Removes an account from the blacklist. Only callable by blacklister. * @param account - The address to unblacklist. * @returns {Promise} */ unblacklist(account: Address): Promise; /** * @description Checks if an account is blacklisted. * @param account - The address to check. * @returns {Promise} */ isBlacklisted(account: Address): Promise; /** * @description Pauses the contract. Only callable by pauser. * @returns {Promise} */ pause(): Promise; /** * @description Unpauses the contract. Only callable by pauser. * @returns {Promise} */ unpause(): Promise; /** * @description Checks if the contract is paused. * @returns {Promise} */ isPaused(): Promise; /** * @description Initiates ownership transfer. Only callable by owner. * @param newOwner - The new owner address. * @returns {Promise} */ transferOwnership(newOwner: Address): Promise; /** * @description Accepts pending ownership transfer. Only callable by pending owner. * @returns {Promise} */ acceptOwnership(): Promise; /** * @description Sets a new minter. Only callable by owner. * @param newMinter - The new minter address. * @returns {Promise} */ setMinter(newMinter: Address): Promise; /** * @description Sets a new blacklister. Only callable by owner. * @param newBlacklister - The new blacklister address. * @returns {Promise} */ setBlacklister(newBlacklister: Address): Promise; /** * @description Sets a new pauser. Only callable by owner. * @param newPauser - The new pauser address. * @returns {Promise} */ setPauser(newPauser: Address): Promise; /** * @description Gets the current owner address. * @returns {Promise} */ owner(): Promise; /** * @description Gets the current minter address. * @returns {Promise} */ minter(): Promise; /** * @description Gets the current blacklister address. * @returns {Promise} */ blacklister(): Promise; /** * @description Gets the current pauser address. * @returns {Promise} */ pauser(): Promise; }