From 80e83f3a1844866fcacc63225731a0764b1b37c6 Mon Sep 17 00:00:00 2001 From: Luis Mastrangelo Date: Fri, 20 Dec 2024 18:37:45 -0300 Subject: [PATCH] Change `getTokenInfo` to view Signed-off-by: Luis Mastrangelo --- .../hedera-token-service/HederaTokenService.sol | 2 +- .../hedera-token-service/IHederaTokenService.sol | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/contracts/system-contracts/hedera-token-service/HederaTokenService.sol b/contracts/system-contracts/hedera-token-service/HederaTokenService.sol index 92f47946d..f5df02caa 100644 --- a/contracts/system-contracts/hedera-token-service/HederaTokenService.sol +++ b/contracts/system-contracts/hedera-token-service/HederaTokenService.sol @@ -225,7 +225,7 @@ abstract contract HederaTokenService { /// @param token The ID of the token as a solidity address /// @dev This function reverts if the call is not successful function getTokenInfo(address token) internal returns (int responseCode, IHederaTokenService.TokenInfo memory tokenInfo) { - (bool success, bytes memory result) = precompileAddress.call( + (bool success, bytes memory result) = precompileAddress.staticcall( abi.encodeWithSelector(IHederaTokenService.getTokenInfo.selector, token)); IHederaTokenService.TokenInfo memory defaultTokenInfo; (responseCode, tokenInfo) = success ? abi.decode(result, (int32, IHederaTokenService.TokenInfo)) : (HederaResponseCodes.UNKNOWN, defaultTokenInfo); diff --git a/contracts/system-contracts/hedera-token-service/IHederaTokenService.sol b/contracts/system-contracts/hedera-token-service/IHederaTokenService.sol index 2df5b7485..3475fbd2f 100644 --- a/contracts/system-contracts/hedera-token-service/IHederaTokenService.sol +++ b/contracts/system-contracts/hedera-token-service/IHederaTokenService.sol @@ -689,7 +689,7 @@ interface IHederaTokenService { /// @return responseCode The response code for the status of the request. SUCCESS is 22. /// @return tokenInfo TokenInfo info for `token` function getTokenInfo(address token) - external + external view returns (int64 responseCode, TokenInfo memory tokenInfo); /// Query token KeyValue