Skip to content

Commit ecff9d6

Browse files
author
Albert
authored
Merge pull request #104 from RSS3-Network/feat/annual-issuance
2 parents 5459389 + a5fd998 commit ecff9d6

2 files changed

Lines changed: 12 additions & 23 deletions

File tree

packages/contracts-bedrock/src/L2/RSS3Token.sol

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,19 @@
11
// SPDX-License-Identifier: MIT
22
pragma solidity 0.8.15;
33

4-
import {OptimismMintableERC20 as ERC20} from "src/universal/OptimismMintableERC20.sol";
5-
import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";
4+
import { OptimismMintableERC20 as ERC20 } from "src/universal/OptimismMintableERC20.sol";
5+
import { Initializable } from "@openzeppelin/contracts/proxy/utils/Initializable.sol";
66

77
/// @custom:proxied
88
/// @custom:predeploy 0x4200000000000000000000000000000000000042
99
/// @title RSS3Token
1010
contract RSS3Token is ERC20, Initializable {
1111
/// @param _l2Bridge Address of the L2 standard bridge.
1212
/// @param _l1Token Address of the L1 RSS3 token.
13-
constructor(
14-
address _l2Bridge,
15-
address _l1Token
16-
) ERC20(_l2Bridge, _l1Token, "RSS3", "RSS3", 18) {}
13+
constructor(address _l2Bridge, address _l1Token) ERC20(_l2Bridge, _l1Token, "RSS3", "RSS3", 18) { }
1714

1815
/// @dev Can only be called once through initializer modifier
19-
function initialize() external initializer {
16+
function initialize() external reinitializer(2) {
2017
uint256 amount = 30_000_000 * 10 ** 18; // annual issuance rate of 3%
2118
_mint(0x0cE3159BF19F3C55B648D04E8f0Ae1Ae118D2A0B, amount);
2219
}

packages/contracts-bedrock/test/L2/RSS3Token.t.sol

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,35 @@
11
// SPDX-License-Identifier: MIT
22
pragma solidity 0.8.15;
33

4-
import {Test} from "forge-std/Test.sol";
5-
import {RSS3Token} from "src/L2/RSS3Token.sol";
6-
import {TransparentUpgradeableProxy} from "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol";
4+
import { Test } from "forge-std/Test.sol";
5+
import { RSS3Token } from "src/L2/RSS3Token.sol";
6+
import { TransparentUpgradeableProxy } from "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol";
77

88
contract RSS3Token_Test is Test {
99
RSS3Token public token;
1010

1111
address constant L2_BRIDGE = address(0x1234);
1212
address constant L1_TOKEN = address(0x5678);
13-
address constant SETTLEMENT_ADDRESS =
14-
0x0cE3159BF19F3C55B648D04E8f0Ae1Ae118D2A0B;
13+
address constant SETTLEMENT_ADDRESS = 0x0cE3159BF19F3C55B648D04E8f0Ae1Ae118D2A0B;
1514
uint256 constant INITIAL_MINT_AMOUNT = 30_000_000 * 10 ** 18;
1615
uint256 settlementBalance;
1716

1817
function setUp() public {
1918
// Create and select the fork
20-
vm.createSelectFork("https://rpc.rss3.io", 15956709);
19+
vm.createSelectFork("https://rpc.rss3.io", 31726799);
2120

2221
// Deploy the token contract
2322
RSS3Token tokenV2 = new RSS3Token(L2_BRIDGE, L1_TOKEN);
2423

25-
address payable tokenProxy = payable(
26-
0x4200000000000000000000000000000000000042
27-
);
24+
address payable tokenProxy = payable(0x4200000000000000000000000000000000000042);
2825
token = RSS3Token(tokenProxy);
2926

3027
settlementBalance = token.balanceOf(SETTLEMENT_ADDRESS);
3128

32-
TransparentUpgradeableProxy proxy = TransparentUpgradeableProxy(
33-
tokenProxy
34-
);
29+
TransparentUpgradeableProxy proxy = TransparentUpgradeableProxy(tokenProxy);
3530

3631
vm.startPrank(0x4200000000000000000000000000000000000018);
37-
proxy.upgradeToAndCall(
38-
address(tokenV2),
39-
abi.encodeWithSelector(tokenV2.initialize.selector)
40-
);
32+
proxy.upgradeToAndCall(address(tokenV2), abi.encodeWithSelector(tokenV2.initialize.selector));
4133
vm.stopPrank();
4234
}
4335

0 commit comments

Comments
 (0)