Skip to content

Commit

Permalink
refactor: update variable to initComplete
Browse files Browse the repository at this point in the history
  • Loading branch information
kevin-fruitful committed Oct 15, 2024
1 parent 71e3e00 commit cc8f741
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions src/init/InitializationTest1.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,14 @@ import "../libs/LibERC20Token.sol";

contract InitializationTest1 {
function init() external {
uint256 initId = 1;

AppStorage storage s = LibAppStorage.diamondStorage();
require(!s.initializationTest1, "InitializationTest already initialized");
require(!s.initComplete[initId], "Initialization already complete");

s.initializationTest1 = true;
s.initComplete[initId] = true;

// Burn the test tokens
address testAddress = 0x5ba45268dC851209e66DEcD4E31e6723Fa3954C6;
uint256 balance = LibERC20Token._balanceOf(testAddress);
require(balance > 0, "No tokens to burn");
Expand Down
2 changes: 1 addition & 1 deletion src/shared/AppStorage.sol
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ struct AppStorage {
mapping(address sysAdmin => bool isSysAdmin) sysAdmins;
uint256 sysAdminsCount;
address minter;
bool initializationTest1;
mapping(uint256 => bool) initComplete;
}

library LibAppStorage {
Expand Down

0 comments on commit cc8f741

Please sign in to comment.