Skip to content

Commit a37b825

Browse files
committed
feat: remove unused functions or variables
1 parent cb4f808 commit a37b825

File tree

3 files changed

+2
-40
lines changed

3 files changed

+2
-40
lines changed

src/contracts/extensions/sgho/interfaces/IsGHO.sol

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,6 @@ interface IsGHO {
3030
*/
3131
error OnlyYieldManager();
3232

33-
/**
34-
* @notice Thrown if the contract is not initialized.
35-
*/
36-
error NotInitialized();
37-
3833
/**
3934
* @notice Thrown when an attempt is made to rescue the underlying GHO token.
4035
*/

src/contracts/extensions/sgho/sGHO.sol

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import {ERC20Upgradeable} from 'openzeppelin-contracts-upgradeable/contracts/tok
1313

1414
/**
1515
* @title sGHO Token
16-
* @author Luigy-Lemon @kpk
16+
* @author @kpk
1717
* @notice sGHO is an ERC4626 vault that allows users to deposit GHO and earn yield.
1818
* @dev This contract implements the ERC4626 standard for tokenized vaults, where the underlying asset is GHO.
1919
* It also includes functionalities for yield generation based on a target rate, and administrative roles for managing the contract.
@@ -30,7 +30,6 @@ contract sGHO is Initializable, ERC4626Upgradeable, ERC20PermitUpgradeable, IsGH
3030
uint256 public supplyCap;
3131
uint256 public yieldIndex;
3232
uint256 public lastUpdate;
33-
uint256 internal constant RATE_PRECISION = 1e10;
3433
uint256 internal constant ONE_YEAR = 365 days;
3534

3635
bytes32 public constant FUNDS_ADMIN_ROLE = 'FUNDS_ADMIN';
@@ -82,17 +81,6 @@ contract sGHO is Initializable, ERC4626Upgradeable, ERC20PermitUpgradeable, IsGH
8281
revert NoEthAllowed();
8382
}
8483

85-
/**
86-
* @notice Modifier to check if the contract has been initialized.
87-
* @dev Throws if the `initialize` function has not been called.
88-
*/
89-
modifier isInitialized() {
90-
if (_getInitializedVersion() == 0) {
91-
revert NotInitialized();
92-
}
93-
_;
94-
}
95-
9684
/**
9785
* @notice Modifier that restricts a function to be called only by an address with the YIELD_MANAGER role.
9886
* @dev See {_onlyYieldManager}.
@@ -146,13 +134,6 @@ contract sGHO is Initializable, ERC4626Upgradeable, ERC20PermitUpgradeable, IsGH
146134
return super.nonces(owner);
147135
}
148136

149-
/**
150-
* @dev See {IERC20Permit-DOMAIN_SEPARATOR}.
151-
*/
152-
function DOMAIN_SEPARATOR() external view virtual override returns (bytes32) {
153-
return _domainSeparatorV4();
154-
}
155-
156137
function decimals() public view virtual override(ERC20Upgradeable, ERC4626Upgradeable) returns (uint8) {
157138
return super.decimals();
158139
}

tests/extensions/sgho/sGHO.t.sol

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1559,21 +1559,7 @@ contract sGhoTest is TestnetProcedures {
15591559
newSgho.initialize(address(gho), address(contracts.aclManager), MAX_TARGET_RATE, SUPPLY_CAP);
15601560
}
15611561

1562-
function test_revert_notInitialized() external {
1563-
// Deploy a new sGHO implementation and proxy without initializing it
1564-
address impl = address(new sGHO());
1565-
TransparentUpgradeableProxy proxy = new TransparentUpgradeableProxy(
1566-
impl,
1567-
address(this),
1568-
'' // No initialization data
1569-
);
1570-
sGHO uninitializedSgho = sGHO(payable(address(proxy)));
1571-
1572-
// Since the isInitialized modifier is not used by any functions,
1573-
// we'll test that the contract works correctly when not initialized
1574-
// The totalAssets should return 0 for an uninitialized contract
1575-
assertEq(uninitializedSgho.totalAssets(), 0, 'Uninitialized contract should return 0 totalAssets');
1576-
}
1562+
15771563

15781564
// --- Getter Functions Tests ---
15791565

0 commit comments

Comments
 (0)