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

feat: dirty initialize #4

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
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
6 changes: 6 additions & 0 deletions src/periphery/contracts/static-a-token/StaticATokenLM.sol
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,12 @@ contract StaticATokenLM is
emit Initialized(newAToken, staticATokenName, staticATokenSymbol);
}

///@inheritdoc IInitializableStaticATokenLM
function upgradeInitialize() external initializer {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this initializer can only be called on previously initialized tokens.
Afterwards it's setting storage back to zero.

require(__deprecated != 0, 'MUST_ALREADY_BE_INITIALIZED');
__deprecated = 0; // cleanup storage
}

/// @inheritdoc IRescuable
function whoCanRescue() public view override returns (address) {
return POOL_ADDRESSES_PROVIDER.getACLAdmin();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,10 @@ interface IInitializableStaticATokenLM {
string calldata staticATokenName,
string calldata staticATokenSymbol
) external;

/**
* @dev Initializes the already initialized StaticATokenLM
* @notice This is required Initializable was migrated to EIP-7102 so the storage location moved.
*/
function upgradeInitialize() external;
}
Loading