Skip to content

Commit

Permalink
add check for the validity of the componentToken
Browse files Browse the repository at this point in the history
  • Loading branch information
ungaro committed Dec 5, 2024
1 parent ae513f7 commit f4deb45
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 our list
if (!_getAggregateTokenStorage().componentTokenMap[componentToken]) {
revert ComponentTokenNotListed(componentToken);
}
IERC20(componentToken.asset()).approve(address(componentToken), amount);
}

Expand Down

0 comments on commit f4deb45

Please sign in to comment.