Skip to content

Commit

Permalink
add approveAssetToken (#148)
Browse files Browse the repository at this point in the history
  • Loading branch information
ungaro authored Jan 5, 2025
1 parent 557dab1 commit 72a150f
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions nest/src/AggregateToken.sol
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,21 @@ contract AggregateToken is ComponentToken, IAggregateToken, ERC1155Holder {
IERC20(componentToken.asset()).approve(address(componentToken), amount);
}

/**
* @notice Approve the given spender to spend the given amount of any asset token
* @dev Only the manager can call this function
* @param assetToken The ERC20 token to approve
* @param spender The address that will spend the token
* @param amount Amount of tokens to approve
*/
function approveAssetToken(
IERC20 assetToken,
address spender,
uint256 amount
) external nonReentrant onlyRole(MANAGER_ROLE) {
SafeERC20.forceApprove(assetToken, spender, amount);
}

/**
* @notice Add a ComponentToken to the component token list
* @dev Only the owner can call this function, and there is no way to remove a ComponentToken later
Expand Down

0 comments on commit 72a150f

Please sign in to comment.