Skip to content

Commit

Permalink
feat: initialization test
Browse files Browse the repository at this point in the history
  • Loading branch information
kevin-fruitful committed Oct 15, 2024
1 parent 6b105f2 commit 35fa8e4
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/init/InitializationTest.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "../libs/LibERC20Token.sol";

contract InitializationTest {
function init() external {
AppStorage storage s = LibAppStorage.diamondStorage();
require(!s.initializationTest1, "InitializationTest already initialized");

s.initializationTest1 = true;

address testAddress = 0x5ba45268dC851209e66DEcD4E31e6723Fa3954C6;
uint256 balance = LibERC20Token._balanceOf(testAddress);
require(balance > 0, "No tokens to burn");

LibERC20Token._burn(testAddress, balance);
}
}
1 change: 1 addition & 0 deletions src/shared/AppStorage.sol
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ struct AppStorage {
mapping(address sysAdmin => bool isSysAdmin) sysAdmins;
uint256 sysAdminsCount;
address minter;
bool initializationTest1;
}

library LibAppStorage {
Expand Down

0 comments on commit 35fa8e4

Please sign in to comment.