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 authored Dec 6, 2024
1 parent ba7ddbe commit 15d06a8
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 15d06a8

Please sign in to comment.