From 46ab9b26faa08540b922c03c61340d3b25bb909a Mon Sep 17 00:00:00 2001 From: Maksim Date: Tue, 11 Jun 2024 15:49:28 +0200 Subject: [PATCH] replace safe-hts association to IHRC --- contracts/common/hedera/IHRC.sol | 8 ++++++++ contracts/erc4626/Vault.sol | 3 ++- 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 contracts/common/hedera/IHRC.sol diff --git a/contracts/common/hedera/IHRC.sol b/contracts/common/hedera/IHRC.sol new file mode 100644 index 0000000..8c6d684 --- /dev/null +++ b/contracts/common/hedera/IHRC.sol @@ -0,0 +1,8 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity ^0.8.7; + +interface IHRC { + function associate() external returns (uint256 responseCode); + + function dissociate() external returns (uint256 responseCode); +} diff --git a/contracts/erc4626/Vault.sol b/contracts/erc4626/Vault.sol index 61452ff..db8df61 100644 --- a/contracts/erc4626/Vault.sol +++ b/contracts/erc4626/Vault.sol @@ -4,6 +4,7 @@ pragma abicoder v2; import {ERC20} from "./ERC20.sol"; import {IERC4626} from "./IERC4626.sol"; +import {IHRC} from "../common/hedera/IHRC.sol"; import {FeeConfiguration} from "../common/FeeConfiguration.sol"; @@ -254,7 +255,7 @@ contract HederaVault is IERC4626, FeeConfiguration, Ownable, ReentrancyGuard { for (uint256 i; i < rewardTokensSize; i++) { address token = rewardTokens[i]; userContribution[msg.sender].lastClaimedAmountT[token] = tokensRewardInfo[token].amount; - SafeHTS.safeAssociateToken(token, msg.sender); + IHRC(token).associate(); } userContribution[msg.sender].sharesAmount = _amount; userContribution[msg.sender].exist = true;