pragma ever -solidity ^0.62.0; pragma AbiHeader expire; pragma AbiHeader pubkey; import "./TokenWalletBase.tsol"; import "../interfaces/ITokenRoot.tsol"; import "../interfaces/IDestroyable.tsol"; import "../libraries/TokenErrors.tsol"; import "../libraries/TokenMsgFlag.tsol"; /** * @dev Implementation of the {IDestroyable} interface. * * This abstraction extends the functionality of {TokenWalletBase} and adding * the ability to destroy the wallet. */ abstract contract TokenWalletDestroyableBase is TokenWalletBase, IDestroyable { /** * @dev See {IDestroyable-destroy}. * * Precondition: * * - The wallet balance must be empty. */ function destroy(address remainingGasTo) override external onlyOwner { require(balance_ == 0, TokenErrors.NON_EMPTY_BALANCE); remainingGasTo.transfer({ value: 0, flag: TokenMsgFlag.ALL_NOT_RESERVED + TokenMsgFlag.DESTROY_IF_ZERO, bounce: false }); } }