Skip to content

Commit

Permalink
fix: removing build warnings (#118)
Browse files Browse the repository at this point in the history
Signed-off-by: Mariusz Jasuwienas <mariusz.jasuwienas@arianelabs.com>
  • Loading branch information
arianejasuwienas committed Dec 19, 2024
1 parent 11b6c52 commit 0410981
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ pragma solidity ^0.8.0;
import {Vm} from "forge-std/Vm.sol";
import {IERC20} from "./IERC20.sol";
import {IHRC719} from "./IHRC719.sol";
import {IHederaTokenService} from "./IHederaTokenService.sol";
import {IHTSDefinitions} from "../contracts/IHTSDefinitions.sol";

contract HtsSystemContractLocalNode {
Vm private constant vm = Vm(address(uint160(uint256(keccak256("hevm cheat code")))));
Expand All @@ -30,10 +30,10 @@ contract HtsSystemContractLocalNode {
function _handleResult(bytes memory response) private {
bytes4 selector = bytes4(msg.data[0:4]);
if (
selector == IHederaTokenService.createFungibleToken.selector ||
selector == IHederaTokenService.createNonFungibleToken.selector ||
selector == IHederaTokenService.createFungibleTokenWithCustomFees.selector ||
selector == IHederaTokenService.createNonFungibleTokenWithCustomFees.selector
selector == IHTSDefinitions.createFungibleToken.selector ||
selector == IHTSDefinitions.createNonFungibleToken.selector ||
selector == IHTSDefinitions.createFungibleTokenWithCustomFees.selector ||
selector == IHTSDefinitions.createNonFungibleTokenWithCustomFees.selector
) {
(int responseCode, address tokenAddress) = abi.decode(response, (int, address));
if (responseCode == 22) {
Expand Down
6 changes: 3 additions & 3 deletions src/IHederaTokenService.sol → contracts/IHTSDefinitions.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
pragma solidity >=0.4.9 <0.9.0;
pragma experimental ABIEncoderV2;

interface IHederaTokenService {
interface IHTSDefinitions {

/// Transfers cryptocurrency among two or more accounts by making the desired adjustments to their
/// balances. Each transfer list can specify up to 10 adjustments. Each negative amount is withdrawn
Expand Down Expand Up @@ -807,12 +807,12 @@ interface IHederaTokenService {
/// @param fixedFees Set of fixed fees for `token`
/// @param fractionalFees Set of fractional fees for `token`
/// @return responseCode The response code for the status of the request. SUCCESS is 22.
function updateFungibleTokenCustomFees(address token, IHederaTokenService.FixedFee[] memory fixedFees, IHederaTokenService.FractionalFee[] memory fractionalFees) external returns (int64 responseCode);
function updateFungibleTokenCustomFees(address token, IHTSDefinitions.FixedFee[] memory fixedFees, IHTSDefinitions.FractionalFee[] memory fractionalFees) external returns (int64 responseCode);

/// Update the custom fees for a non-fungible token
/// @param token The token address
/// @param fixedFees Set of fixed fees for `token`
/// @param royaltyFees Set of royalty fees for `token`
/// @return responseCode The response code for the status of the request. SUCCESS is 22.
function updateNonFungibleTokenCustomFees(address token, IHederaTokenService.FixedFee[] memory fixedFees, IHederaTokenService.RoyaltyFee[] memory royaltyFees) external returns (int64 responseCode);
function updateNonFungibleTokenCustomFees(address token, IHTSDefinitions.FixedFee[] memory fixedFees, IHTSDefinitions.RoyaltyFee[] memory royaltyFees) external returns (int64 responseCode);
}
18 changes: 9 additions & 9 deletions test/LocalNodeToken.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
pragma solidity ^0.8.0;

import {Test, console} from "forge-std/Test.sol";
import {IERC20Events, IERC20} from "../src/IERC20.sol";
import {IHederaTokenService} from "../src/IHederaTokenService.sol";
import {IERC20Events, IERC20} from "../contracts/IERC20.sol";
import {IHTSDefinitions} from "../contracts/IHTSDefinitions.sol";
import {TestSetup} from "./lib/TestSetup.sol";

interface MethodNotSupported {
Expand All @@ -19,7 +19,7 @@ contract LocalNodeTokenTest is Test, TestSetup, IERC20Events {
vm.allowCheatcodes(HTS_ADDRESS);

(int responseCode, address tokenAddress) =
IHederaTokenService(HTS_ADDRESS).createFungibleToken(
IHTSDefinitions(HTS_ADDRESS).createFungibleToken(
tokenData("Some really really long name, just for testing purposes to prove it is not an issue", "SAMPLE"),
int64(1000),
int32(2)
Expand Down Expand Up @@ -60,13 +60,13 @@ contract LocalNodeTokenTest is Test, TestSetup, IERC20Events {
* }
*/

function tokenData(string memory name, string memory symbol) private pure returns (IHederaTokenService.HederaToken memory token)
function tokenData(string memory name, string memory symbol) private pure returns (IHTSDefinitions.HederaToken memory token)
{
address treasury = 0x67D8d32E9Bf1a9968a5ff53B87d777Aa8EBBEe69;
IHederaTokenService.TokenKey[] memory keys = new IHederaTokenService.TokenKey[](1);
IHederaTokenService.TokenKey memory key = IHederaTokenService.TokenKey(
IHTSDefinitions.TokenKey[] memory keys = new IHTSDefinitions.TokenKey[](1);
IHTSDefinitions.TokenKey memory key = IHTSDefinitions.TokenKey(
uint(1),
IHederaTokenService.KeyValue(
IHTSDefinitions.KeyValue(
false,
0x0000000000000000000000000000000000000000,
bytes(""),
Expand All @@ -75,10 +75,10 @@ contract LocalNodeTokenTest is Test, TestSetup, IERC20Events {
)
);
keys[0] = key;
IHederaTokenService.Expiry memory expiry = IHederaTokenService.Expiry(
IHTSDefinitions.Expiry memory expiry = IHTSDefinitions.Expiry(
int64(1672531200), treasury, int64(31536000)
);
return IHederaTokenService.HederaToken(
return IHTSDefinitions.HederaToken(
name,
symbol,
treasury,
Expand Down

0 comments on commit 0410981

Please sign in to comment.