Skip to content
This repository has been archived by the owner on Jun 29, 2023. It is now read-only.

Commit

Permalink
Merge pull request #497 from thehubbleproject/more-immutables
Browse files Browse the repository at this point in the history
Add the rest of the immutables
  • Loading branch information
ChihChengLiang committed Feb 26, 2021
2 parents 59145e9 + edeb3a5 commit 66fef37
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 13 deletions.
5 changes: 3 additions & 2 deletions contracts/DepositManager.sol
Expand Up @@ -87,10 +87,11 @@ contract DepositCore is SubtreeQueue {
contract DepositManager is DepositCore, IDepositManager {
using Types for Types.UserState;
using SafeERC20 for IERC20;
address public vault;
address public immutable vault;
// Can't be immutable yet. Since the rollup is deployed after DepositManager
address public rollup;

ITokenRegistry public tokenRegistry;
ITokenRegistry public immutable tokenRegistry;

modifier onlyRollup() {
require(
Expand Down
5 changes: 3 additions & 2 deletions contracts/Vault.sol
Expand Up @@ -13,9 +13,10 @@ contract Vault {
using Types for Types.MassMigrationCommitment;
using Types for Types.Batch;

// Can't be immutable yet. Since the rollup is deployed after Vault
Rollup public rollup;
SpokeRegistry public spokes;
ITokenRegistry public tokenRegistry;
SpokeRegistry public immutable spokes;
ITokenRegistry public immutable tokenRegistry;

mapping(uint256 => uint256) private bitmap;

Expand Down
7 changes: 4 additions & 3 deletions contracts/WithdrawManager.sol
Expand Up @@ -15,14 +15,15 @@ contract WithdrawManager {
using Tx for bytes;
using Types for Types.UserState;
using SafeERC20 for IERC20;
Vault public vault;

// withdrawRoot => a bitmap of whether a publicIndex owner has the token claimed
mapping(bytes32 => mapping(uint256 => uint256)) private bitmap;
// withdrawRoot => accountRoot
mapping(bytes32 => bytes32) private processed;
ITokenRegistry public tokenRegistry;
bytes32 public appID;

ITokenRegistry public immutable tokenRegistry;
Vault public immutable vault;
bytes32 public immutable appID;

constructor(
ITokenRegistry _tokenRegistry,
Expand Down
4 changes: 2 additions & 2 deletions contracts/client/FrontendUtilities.sol
Expand Up @@ -6,8 +6,8 @@ import { DepositManager } from "../DepositManager.sol";
import { BLSAccountRegistry } from "../BLSAccountRegistry.sol";

contract FrontendUtilities {
DepositManager public depositManager;
BLSAccountRegistry public accountRegistry;
DepositManager public immutable depositManager;
BLSAccountRegistry public immutable accountRegistry;

constructor(
DepositManager _depositManager,
Expand Down
8 changes: 4 additions & 4 deletions contracts/proposers/BurnAuction.sol
Expand Up @@ -12,13 +12,13 @@ contract BurnAuction is Chooser {

// donation numerator and demoninator are used to calculate donation amount
uint256 public constant DONATION_DENOMINATOR = 10000;
uint256 public donationNumerator;
uint256 public immutable donationNumerator;

// Donation address that is fed with portion of burned amount
address payable public donationAddress;
address payable public immutable donationAddress;

// First block where the first slot begins
uint256 public genesisBlock;
uint256 public immutable genesisBlock;

// Bid is a structure indicating that
// "coordinator" is willing to burn certain
Expand Down Expand Up @@ -50,7 +50,7 @@ contract BurnAuction is Chooser {
public
{
require(
donationNumerator <= DONATION_DENOMINATOR,
_donationNumerator <= DONATION_DENOMINATOR,
"BurnAuction, constructor: bad denominator"
);

Expand Down

0 comments on commit 66fef37

Please sign in to comment.