Skip to content

Commit

Permalink
[NES-267] [Fix:] [N7] add check for the validity of the componentToken (
Browse files Browse the repository at this point in the history
#111)

* add check for the validity of the componentToken

* formatting
  • Loading branch information
ungaro committed Dec 12, 2024
1 parent 61fd69b commit 7e7a27f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions nest/src/AggregateToken.sol
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,10 @@ contract AggregateToken is ComponentToken, IAggregateToken, ERC1155Holder {
IComponentToken componentToken,
uint256 amount
) external nonReentrant onlyRole(ADMIN_ROLE) {
// Verify the componentToken is in componentTokenMap
if (!_getAggregateTokenStorage().componentTokenMap[componentToken]) {
revert ComponentTokenNotListed(componentToken);
}
IERC20(componentToken.asset()).approve(address(componentToken), amount);
}

Expand Down

0 comments on commit 7e7a27f

Please sign in to comment.