mirror of
https://github.com/logos-messaging/logos-messaging-rlnv2-contract.git
synced 2026-01-07 08:23:09 +00:00
Add TestStableToken with only owner minting
This commit is contained in:
parent
ad0dc9a81d
commit
e39e8f4886
25
test/TestStableToken.sol
Normal file
25
test/TestStableToken.sol
Normal file
@ -0,0 +1,25 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
pragma solidity >=0.8.19 <0.9.0;
|
||||
|
||||
import { BaseScript } from "../script/Base.s.sol";
|
||||
import { ERC20 } from "@openzeppelin/contracts/token/ERC20/ERC20.sol";
|
||||
import { ERC20Permit } from "@openzeppelin/contracts/token/ERC20/extensions/ERC20Permit.sol";
|
||||
|
||||
contract TestStableToken is ERC20, ERC20Permit {
|
||||
address public immutable owner;
|
||||
|
||||
constructor() ERC20("TestStableToken", "TST") ERC20Permit("TestStableToken") {
|
||||
owner = msg.sender;
|
||||
}
|
||||
|
||||
function mint(address to, uint256 amount) external {
|
||||
require(msg.sender == owner, "Only owner can mint");
|
||||
_mint(to, amount);
|
||||
}
|
||||
}
|
||||
|
||||
contract TestStableTokenFactory is BaseScript {
|
||||
function run() public broadcast returns (address) {
|
||||
return address(new TestStableToken());
|
||||
}
|
||||
}
|
||||
@ -7,7 +7,7 @@ import "../src/WakuRlnV2.sol"; // solhint-disable-line
|
||||
import "../src/Membership.sol"; // solhint-disable-line
|
||||
import { IPriceCalculator } from "../src/IPriceCalculator.sol";
|
||||
import { LinearPriceCalculator } from "../src/LinearPriceCalculator.sol";
|
||||
import { TestToken } from "./TestToken.sol";
|
||||
import { TestStableToken } from "./TestStableToken.sol";
|
||||
import { PoseidonT3 } from "poseidon-solidity/PoseidonT3.sol";
|
||||
import { UUPSUpgradeable } from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";
|
||||
import { ERC1967Proxy } from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol";
|
||||
@ -16,21 +16,21 @@ import "forge-std/console.sol";
|
||||
|
||||
contract WakuRlnV2Test is Test {
|
||||
WakuRlnV2 internal w;
|
||||
TestToken internal token;
|
||||
TestStableToken internal token;
|
||||
|
||||
address internal deployer;
|
||||
|
||||
uint256[] internal noIdCommitmentsToErase = new uint256[](0);
|
||||
|
||||
function setUp() public virtual {
|
||||
token = new TestToken();
|
||||
token = new TestStableToken();
|
||||
IPriceCalculator priceCalculator = (new DeployPriceCalculator()).deploy(address(token));
|
||||
WakuRlnV2 wakuRlnV2 = (new DeployWakuRlnV2()).deploy();
|
||||
ERC1967Proxy proxy = (new DeployProxy()).deploy(address(priceCalculator), address(wakuRlnV2));
|
||||
|
||||
w = WakuRlnV2(address(proxy));
|
||||
|
||||
// Minting a large number of tokens to not have to worry about
|
||||
// TestStableTokening a large number of tokens to not have to worry about
|
||||
// Not having enough balance
|
||||
token.mint(address(this), 100_000_000 ether);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user