I am encountering an error message SPENDER_DOES_NOT_HAVE_ALLOWANCE
while attempting to transfer HTS tokens from my wallet using a smart contract. Although I deployed my smart contract some time ago on the network, it appears to be malfunctioning as I am now receiving a CONTRACT_REVERT_EXECUTED
message each time I call my function.
I am sharing the code for my Solidity contract below and would appreciate your help in identifying the issue:
function myTransferToken(address token, address to, int64 amount) external {
int responseCode = HederaTokenService.transferToken(
token,
msg.sender,
to,
int64(amount)
);
require(
responseCode == HederaResponseCodes.SUCCESS,
"Failed to transfer token"
);
}
Thank you for your assistance.