Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ENG-35] allow ComponentTokens to spend assets from the AggregateToken #88

Merged
merged 1 commit into from
Nov 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions nest/src/AggregateToken.sol
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,16 @@ contract AggregateToken is ComponentToken, IAggregateToken {

// Admin Functions

/**
* @notice Approve the given ComponentToken to spend the given amount of `asset`
* @dev Only the owner can call this function
* @param componentToken ComponentToken to approve
* @param amount Amount of `asset` to approve
*/
function approveComponentToken(IComponentToken componentToken, uint256 amount) external onlyRole(ADMIN_ROLE) {
IERC20(componentToken.asset()).approve(address(componentToken), 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