diff --git a/src/periphery/contracts/static-a-token/ERC4626StataTokenUpgradeable.sol b/src/periphery/contracts/static-a-token/ERC4626StataTokenUpgradeable.sol index 097e22c5..4f1b2d56 100644 --- a/src/periphery/contracts/static-a-token/ERC4626StataTokenUpgradeable.sol +++ b/src/periphery/contracts/static-a-token/ERC4626StataTokenUpgradeable.sol @@ -74,7 +74,7 @@ abstract contract ERC4626StataTokenUpgradeable is ERC4626Upgradeable, IERC4626St } ///@inheritdoc IERC4626StataToken - function depositATokens(uint256 assets, address receiver) public returns (uint256) { + function depositATokens(uint256 assets, address receiver) external returns (uint256) { uint256 shares = previewDeposit(assets); _deposit(_msgSender(), receiver, assets, shares, false); @@ -88,7 +88,7 @@ abstract contract ERC4626StataTokenUpgradeable is ERC4626Upgradeable, IERC4626St uint256 deadline, SignatureParams memory sig, bool depositToAave - ) public returns (uint256) { + ) external returns (uint256) { IERC20Permit assetToDeposit = IERC20Permit( depositToAave ? asset() : address(_getERC4626StataTokenStorage()._aToken) ); @@ -103,7 +103,11 @@ abstract contract ERC4626StataTokenUpgradeable is ERC4626Upgradeable, IERC4626St } ///@inheritdoc IERC4626StataToken - function redeemATokens(uint256 shares, address receiver, address owner) public returns (uint256) { + function redeemATokens( + uint256 shares, + address receiver, + address owner + ) external returns (uint256) { uint256 assets = previewRedeem(shares); _withdraw(_msgSender(), receiver, owner, assets, shares, false); @@ -111,7 +115,7 @@ abstract contract ERC4626StataTokenUpgradeable is ERC4626Upgradeable, IERC4626St } ///@inheritdoc IERC4626StataToken - function aToken() public view returns (IERC20) { + function aToken() external view returns (IERC20) { ERC4626StataTokenStorage storage $ = _getERC4626StataTokenStorage(); return $._aToken; } diff --git a/src/periphery/contracts/static-a-token/StataTokenFactory.sol b/src/periphery/contracts/static-a-token/StataTokenFactory.sol index f8343ba6..e7ba0929 100644 --- a/src/periphery/contracts/static-a-token/StataTokenFactory.sol +++ b/src/periphery/contracts/static-a-token/StataTokenFactory.sol @@ -19,33 +19,33 @@ contract StataTokenFactory is Initializable, IStataTokenFactory { IPool public immutable POOL; address public immutable PROXY_ADMIN; ITransparentProxyFactory public immutable TRANSPARENT_PROXY_FACTORY; - address public immutable STATIC_A_TOKEN_IMPL; + address public immutable STATA_TOKEN_IMPL; - mapping(address => address) internal _underlyingToStaticAToken; - address[] internal _staticATokens; + mapping(address => address) internal _underlyingToStataToken; + address[] internal _stataTokens; - event StaticTokenCreated(address indexed staticAToken, address indexed underlying); + event StataTokenCreated(address indexed stataToken, address indexed underlying); constructor( IPool pool, address proxyAdmin, ITransparentProxyFactory transparentProxyFactory, - address staticATokenImpl + address stataTokenImpl ) { POOL = pool; PROXY_ADMIN = proxyAdmin; TRANSPARENT_PROXY_FACTORY = transparentProxyFactory; - STATIC_A_TOKEN_IMPL = staticATokenImpl; + STATA_TOKEN_IMPL = stataTokenImpl; } function initialize() external initializer {} ///@inheritdoc IStataTokenFactory function createStataTokens(address[] memory underlyings) external returns (address[] memory) { - address[] memory staticATokens = new address[](underlyings.length); + address[] memory stataTokens = new address[](underlyings.length); for (uint256 i = 0; i < underlyings.length; i++) { - address cachedStaticAToken = _underlyingToStaticAToken[underlyings[i]]; - if (cachedStaticAToken == address(0)) { + address cachedStataToken = _underlyingToStataToken[underlyings[i]]; + if (cachedStataToken == address(0)) { DataTypes.ReserveDataLegacy memory reserveData = POOL.getReserveData(underlyings[i]); if (reserveData.aTokenAddress == address(0)) revert NotListedUnderlying(reserveData.aTokenAddress); @@ -54,8 +54,8 @@ contract StataTokenFactory is Initializable, IStataTokenFactory { IERC20Metadata(reserveData.aTokenAddress).symbol(), 'v2' ); - address staticAToken = TRANSPARENT_PROXY_FACTORY.createDeterministic( - STATIC_A_TOKEN_IMPL, + address stataToken = TRANSPARENT_PROXY_FACTORY.createDeterministic( + STATA_TOKEN_IMPL, PROXY_ADMIN, abi.encodeWithSelector( StataTokenV2.initialize.selector, @@ -68,24 +68,24 @@ contract StataTokenFactory is Initializable, IStataTokenFactory { bytes32(uint256(uint160(underlyings[i]))) ); - _underlyingToStaticAToken[underlyings[i]] = staticAToken; - staticATokens[i] = staticAToken; - _staticATokens.push(staticAToken); - emit StaticTokenCreated(staticAToken, underlyings[i]); + _underlyingToStataToken[underlyings[i]] = stataToken; + stataTokens[i] = stataToken; + _stataTokens.push(stataToken); + emit StataTokenCreated(stataToken, underlyings[i]); } else { - staticATokens[i] = cachedStaticAToken; + stataTokens[i] = cachedStataToken; } } - return staticATokens; + return stataTokens; } ///@inheritdoc IStataTokenFactory function getStataTokens() external view returns (address[] memory) { - return _staticATokens; + return _stataTokens; } ///@inheritdoc IStataTokenFactory function getStataToken(address underlying) external view returns (address) { - return _underlyingToStaticAToken[underlying]; + return _underlyingToStataToken[underlying]; } } diff --git a/tests/periphery/static-a-token/StataTokenV2Getters.sol b/tests/periphery/static-a-token/StataTokenV2Getters.sol index 425ada34..c9a8aa1c 100644 --- a/tests/periphery/static-a-token/StataTokenV2Getters.sol +++ b/tests/periphery/static-a-token/StataTokenV2Getters.sol @@ -9,7 +9,7 @@ import {BaseTest} from './TestBase.sol'; contract StataTokenV2GettersTest is BaseTest { function test_initializeShouldRevert() public { - address impl = factory.STATIC_A_TOKEN_IMPL(); + address impl = factory.STATA_TOKEN_IMPL(); vm.expectRevert(Initializable.InvalidInitialization.selector); StataTokenV2(impl).initialize(aToken, 'hey', 'ho'); }