Skip to content

Commit

Permalink
replace safe-hts association to IHRC
Browse files Browse the repository at this point in the history
  • Loading branch information
maksimKrukovich committed Jun 11, 2024
1 parent d714b77 commit 46ab9b2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
8 changes: 8 additions & 0 deletions contracts/common/hedera/IHRC.sol
Original file line number Diff line number Diff line change
@@ -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);
}
3 changes: 2 additions & 1 deletion contracts/erc4626/Vault.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 46ab9b2

Please sign in to comment.