From 7e7a27f081c6d3cfea3773da6accc3ff6591d369 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alp=20G=C3=BCneysel?= Date: Fri, 6 Dec 2024 11:13:46 -0500 Subject: [PATCH] [NES-267] [Fix:] [N7] add check for the validity of the componentToken (#111) * add check for the validity of the componentToken * formatting --- nest/src/AggregateToken.sol | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/nest/src/AggregateToken.sol b/nest/src/AggregateToken.sol index 4baffab..2ac2144 100644 --- a/nest/src/AggregateToken.sol +++ b/nest/src/AggregateToken.sol @@ -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); }