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

[NES-295] [Fix] overrides in aggregatetoken #123

Merged
merged 1 commit into from
Dec 10, 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
13 changes: 6 additions & 7 deletions nest/src/AggregateToken.sol
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.25;

import { ERC4626Upgradeable } from "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/ERC4626Upgradeable.sol";
import { IERC20 } from "@openzeppelin/contracts/interfaces/IERC20.sol";
import { IERC4626 } from "@openzeppelin/contracts/interfaces/IERC4626.sol";
import { ERC1155Holder } from "@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol";
import { IERC20Metadata } from "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
import { StorageSlot } from "@openzeppelin/contracts/utils/StorageSlot.sol";

import { ComponentToken } from "./ComponentToken.sol";
import { IAggregateToken } from "./interfaces/IAggregateToken.sol";
Expand Down Expand Up @@ -174,7 +173,7 @@ contract AggregateToken is ComponentToken, IAggregateToken, ERC1155Holder {
uint256 assets,
address receiver,
address controller
) public override(ComponentToken, IComponentToken) returns (uint256 shares) {
) public override(ComponentToken, IComponentToken) nonReentrant returns (uint256 shares) {
if (_getAggregateTokenStorage().paused) {
revert DepositPaused();
}
Expand All @@ -191,7 +190,7 @@ contract AggregateToken is ComponentToken, IAggregateToken, ERC1155Holder {
function deposit(
uint256 assets,
address receiver
) public virtual override(ERC4626Upgradeable) returns (uint256 shares) {
) public override(ERC4626Upgradeable, IERC4626) nonReentrant returns (uint256 shares) {
if (_getAggregateTokenStorage().paused) {
revert DepositPaused();
}
Expand All @@ -210,7 +209,7 @@ contract AggregateToken is ComponentToken, IAggregateToken, ERC1155Holder {
uint256 shares,
address receiver,
address controller
) public virtual override(ComponentToken) returns (uint256 assets) {
) public override(ComponentToken) nonReentrant returns (uint256 assets) {
if (_getAggregateTokenStorage().paused) {
revert DepositPaused();
}
Expand All @@ -227,7 +226,7 @@ contract AggregateToken is ComponentToken, IAggregateToken, ERC1155Holder {
function mint(
uint256 shares,
address receiver
) public virtual override(ERC4626Upgradeable) returns (uint256 assets) {
) public override(ERC4626Upgradeable, IERC4626) nonReentrant returns (uint256 assets) {
if (_getAggregateTokenStorage().paused) {
revert DepositPaused();
}
Expand All @@ -239,7 +238,7 @@ contract AggregateToken is ComponentToken, IAggregateToken, ERC1155Holder {
uint256 shares,
address receiver,
address controller
) public override(ComponentToken, IComponentToken) returns (uint256 assets) {
) public override(ComponentToken, IComponentToken) nonReentrant returns (uint256 assets) {
return super.redeem(shares, receiver, controller);
}

Expand Down
Loading