Skip to content

Commit

Permalink
Merge pull request #39 from web3-nomad/feature/erc4626
Browse files Browse the repository at this point in the history
add fee exist check and update factory address
  • Loading branch information
maksimKrukovich authored Jun 6, 2024
2 parents a58f00e + d714b77 commit edfad34
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion contracts/erc4626/Vault.sol
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,7 @@ contract HederaVault is IERC4626, FeeConfiguration, Ownable, ReentrancyGuard {
*/
function claimAllReward(uint256 _startPosition) public payable returns (uint256, uint256) {
uint256 rewardTokensSize = rewardTokens.length;
address _token = feeConfig.token;

for (uint256 i = _startPosition; i < rewardTokensSize && i < _startPosition + 10; i++) {
uint256 reward;
Expand All @@ -441,7 +442,7 @@ contract HederaVault is IERC4626, FeeConfiguration, Ownable, ReentrancyGuard {
.mulDivDown(1, userContribution[msg.sender].sharesAmount);
userContribution[msg.sender].lastClaimedAmountT[token] = tokensRewardInfo[token].amount;
SafeHTS.safeTransferToken(token, address(this), msg.sender, int64(uint64(reward)));
_deductFee(reward);
if (_token != address(0)) _deductFee(reward);
}
return (_startPosition, rewardTokensSize);
}
Expand Down
2 changes: 1 addition & 1 deletion data/deployments/chain-296.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
},
"vault": {
"HederaVault": "0xe95E635753a8A233cB736c5CB0dF181Bb865a90b",
"VaultFactory": "0x4097b8cDe36d20E442B59F78f468eBcA16B9482E",
"VaultFactory": "0x376AFd1bc4df43c7Ab7B4Ead41da2067093077D9",
"StakingToken": "0x0000000000000000000000000000000000423251",
"Share": "0x0000000000000000000000000000000000423255",
"RewardToken": "0x0000000000000000000000000000000000423252"
Expand Down

0 comments on commit edfad34

Please sign in to comment.