diff --git a/src/periphery/contracts/static-a-token/StataTokenV2.sol b/src/periphery/contracts/static-a-token/StataTokenV2.sol index cab1c6ba..0653a683 100644 --- a/src/periphery/contracts/static-a-token/StataTokenV2.sol +++ b/src/periphery/contracts/static-a-token/StataTokenV2.sol @@ -2,9 +2,11 @@ pragma solidity ^0.8.0; import {ERC20Upgradeable, ERC20PermitUpgradeable} from 'openzeppelin-contracts-upgradeable/contracts/token/ERC20/extensions/ERC20PermitUpgradeable.sol'; +import {IERC20Metadata} from '@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol'; import {PausableUpgradeable} from 'openzeppelin-contracts-upgradeable/contracts/utils/PausableUpgradeable.sol'; import {IPermissionlessRescuable, PermissionlessRescuable} from 'solidity-utils/contracts/utils/PermissionlessRescuable.sol'; import {IRescuableBase, RescuableBase} from 'solidity-utils/contracts/utils/RescuableBase.sol'; +import {IERC20Permit} from '@openzeppelin/contracts/token/ERC20/extensions/IERC20Permit.sol'; import {IACLManager} from '../../../core/contracts/interfaces/IACLManager.sol'; import {ERC4626Upgradeable, ERC4626StataTokenUpgradeable, IPool, Math, IERC20} from './ERC4626StataTokenUpgradeable.sol'; @@ -80,7 +82,20 @@ contract StataTokenV2 is return IACLManager(POOL_ADDRESSES_PROVIDER.getACLManager()).isEmergencyAdmin(actor); } - function decimals() public view override(ERC20Upgradeable, ERC4626Upgradeable) returns (uint8) { + ///@inheritdoc IERC20Permit + function nonces( + address owner + ) public view virtual override(ERC20PermitUpgradeable, IERC20Permit) returns (uint256) { + return super.nonces(owner); + } + + ///@inheritdoc IERC20Metadata + function decimals() + public + view + override(IERC20Metadata, ERC20Upgradeable, ERC4626Upgradeable) + returns (uint8) + { /// @notice The initialization of ERC4626Upgradeable already assures that decimal are /// the same as the underlying asset of the StataTokenV2, e.g. decimals of WETH for stataWETH return ERC4626Upgradeable.decimals(); diff --git a/src/periphery/contracts/static-a-token/interfaces/IStataTokenV2.sol b/src/periphery/contracts/static-a-token/interfaces/IStataTokenV2.sol index 6c5227a8..2561d31a 100644 --- a/src/periphery/contracts/static-a-token/interfaces/IStataTokenV2.sol +++ b/src/periphery/contracts/static-a-token/interfaces/IStataTokenV2.sol @@ -3,8 +3,10 @@ pragma solidity ^0.8.0; import {IERC4626StataToken} from './IERC4626StataToken.sol'; import {IERC20AaveLM} from './IERC20AaveLM.sol'; +import {IERC4626} from '@openzeppelin/contracts/interfaces/IERC4626.sol'; +import {IERC20Permit} from '@openzeppelin/contracts/token/ERC20/extensions/IERC20Permit.sol'; -interface IStataTokenV2 is IERC4626StataToken, IERC20AaveLM { +interface IStataTokenV2 is IERC4626, IERC20Permit, IERC4626StataToken, IERC20AaveLM { /** * @notice Checks if the passed actor is permissioned emergency admin. * @param actor The reward to claim diff --git a/tests/periphery/static-a-token/ERC4626StataTokenUpgradeable.t.sol b/tests/periphery/static-a-token/ERC4626StataTokenUpgradeable.t.sol index 3dbe4fcd..47461697 100644 --- a/tests/periphery/static-a-token/ERC4626StataTokenUpgradeable.t.sol +++ b/tests/periphery/static-a-token/ERC4626StataTokenUpgradeable.t.sol @@ -60,7 +60,7 @@ contract ERC4626StataTokenUpgradeableTest is TestnetProcedures { assertEq(erc4626Upgradeable.previewRedeem(shares), assets); } - function test_totalAssets_shouldbeZeroOnZeroSupply() external { + function test_totalAssets_shouldbeZeroOnZeroSupply() external view { assertEq(erc4626Upgradeable.totalAssets(), 0); }