mirror of
https://github.com/logos-messaging/logos-messaging-rlnv2-contract.git
synced 2026-08-01 12:23:12 +00:00
Formatting
This commit is contained in:
parent
ece613683d
commit
ca89155fa1
@ -13,11 +13,11 @@ contract DeployTokenWithProxy is BaseScript {
|
||||
function deploy() public returns (ERC1967Proxy) {
|
||||
// Deploy the initial implementation
|
||||
address implementation = address(new TestStableToken());
|
||||
|
||||
|
||||
// Encode the initialize call
|
||||
bytes memory data = abi.encodeCall(TestStableToken.initialize, ());
|
||||
|
||||
|
||||
// Deploy the proxy with initialization data
|
||||
return new ERC1967Proxy(implementation, data);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -3,7 +3,8 @@ pragma solidity >=0.8.19 <0.9.0;
|
||||
|
||||
import { BaseScript } from "../script/Base.s.sol";
|
||||
import { ERC20Upgradeable } from "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol";
|
||||
import { ERC20PermitUpgradeable } from "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/ERC20PermitUpgradeable.sol";
|
||||
import { ERC20PermitUpgradeable } from
|
||||
"@openzeppelin/contracts-upgradeable/token/ERC20/extensions/ERC20PermitUpgradeable.sol";
|
||||
import { OwnableUpgradeable } from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
|
||||
import { Initializable } from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
|
||||
import { UUPSUpgradeable } from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";
|
||||
@ -12,7 +13,13 @@ error AccountNotMinter();
|
||||
error AccountAlreadyMinter();
|
||||
error AccountNotInMinterList();
|
||||
|
||||
contract TestStableToken is Initializable, ERC20Upgradeable, ERC20PermitUpgradeable, OwnableUpgradeable, UUPSUpgradeable {
|
||||
contract TestStableToken is
|
||||
Initializable,
|
||||
ERC20Upgradeable,
|
||||
ERC20PermitUpgradeable,
|
||||
OwnableUpgradeable,
|
||||
UUPSUpgradeable
|
||||
{
|
||||
mapping(address => bool) public isMinter;
|
||||
|
||||
event MinterAdded(address indexed account);
|
||||
@ -34,7 +41,7 @@ contract TestStableToken is Initializable, ERC20Upgradeable, ERC20PermitUpgradea
|
||||
__UUPSUpgradeable_init();
|
||||
}
|
||||
|
||||
function _authorizeUpgrade(address newImplementation) internal override onlyOwner {}
|
||||
function _authorizeUpgrade(address newImplementation) internal override onlyOwner { }
|
||||
|
||||
function addMinter(address account) external onlyOwner {
|
||||
if (isMinter[account]) revert AccountAlreadyMinter();
|
||||
|
||||
@ -15,14 +15,14 @@ contract TestStableTokenTest is Test {
|
||||
function setUp() public {
|
||||
// Deploy implementation
|
||||
TestStableToken implementation = new TestStableToken();
|
||||
|
||||
|
||||
// Deploy proxy with initialization
|
||||
bytes memory data = abi.encodeCall(TestStableToken.initialize, ());
|
||||
ERC1967Proxy proxy = new ERC1967Proxy(address(implementation), data);
|
||||
|
||||
|
||||
// Wrap proxy in TestStableToken interface
|
||||
token = TestStableToken(address(proxy));
|
||||
|
||||
|
||||
owner = address(this);
|
||||
user1 = vm.addr(1);
|
||||
user2 = vm.addr(2);
|
||||
|
||||
@ -28,7 +28,7 @@ contract WakuRlnV2Test is Test {
|
||||
bytes memory data = abi.encodeCall(TestStableToken.initialize, ());
|
||||
ERC1967Proxy tokenProxy = new ERC1967Proxy(address(implementation), data);
|
||||
token = TestStableToken(address(tokenProxy));
|
||||
|
||||
|
||||
IPriceCalculator priceCalculator = (new DeployPriceCalculator()).deploy(address(token));
|
||||
WakuRlnV2 wakuRlnV2 = (new DeployWakuRlnV2()).deploy();
|
||||
ERC1967Proxy proxy = (new DeployProxy()).deploy(address(priceCalculator), address(wakuRlnV2));
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user