diff --git a/src/init/InitializationTest.sol b/src/init/InitializationTest.sol new file mode 100644 index 0000000..6f9075b --- /dev/null +++ b/src/init/InitializationTest.sol @@ -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); + } +} diff --git a/src/shared/AppStorage.sol b/src/shared/AppStorage.sol index 1530a17..fccb6d8 100644 --- a/src/shared/AppStorage.sol +++ b/src/shared/AppStorage.sol @@ -28,6 +28,7 @@ struct AppStorage { mapping(address sysAdmin => bool isSysAdmin) sysAdmins; uint256 sysAdminsCount; address minter; + bool initializationTest1; } library LibAppStorage {