Skip to content

Commit

Permalink
proxy init
Browse files Browse the repository at this point in the history
  • Loading branch information
bulbozaur committed Feb 13, 2024
1 parent 0b028c0 commit 3242513
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
8 changes: 5 additions & 3 deletions contracts/Escrow.sol
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,12 @@ contract Escrow {
address internal _govState;
State internal _state;

uint256 internal _totalStEthInEthLocked = 1;
uint256 internal _totalStEthInEthLocked;
uint256 internal _totalWstEthInEthLocked;
uint256 internal _totalWithdrawalNftsAmountLocked;
uint256 internal _totalFinalizedWithdrawalNftsAmountLocked;

uint256 internal _totalEscrowShares = 1;
uint256 internal _totalEscrowShares;
uint256 internal _claimedWQRequestsAmount;

uint256 internal _rageQuitAmountTotal;
Expand All @@ -135,13 +135,15 @@ contract Escrow {
WITHDRAWAL_QUEUE = withdrawalQueue;
BURNER_VAULT = burnerVault;

// _govState = address(this);
_govState = address(this);
}

function initialize(address governanceState) external {
if (_govState != address(0)) {
revert Unauthorized();
}
_totalStEthInEthLocked = 1;
_totalEscrowShares = 1;
_govState = governanceState;
}

Expand Down
9 changes: 8 additions & 1 deletion test/scenario/escrow.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ contract EscrowHappyPath is TestHelpers {
address internal stEthHolder1;
address internal stEthHolder2;

address internal proxyAdmin = makeAddr("proxy_admin");

function assertEq(Escrow.Balance memory a, Escrow.Balance memory b) internal {
assertApproxEqAbs(a.stEth, b.stEth, 2, "StEth balance missmatched");
assertApproxEqAbs(a.wstEth, b.wstEth, 2, "WstEth balance missmatched");
Expand All @@ -72,7 +74,12 @@ contract EscrowHappyPath is TestHelpers {
TransparentUpgradeableProxy config;
(, config,) = deployConfig(DAO_VOTING);

(escrow, burnerVault) = deployEscrowImplementation(ST_ETH, WST_ETH, WITHDRAWAL_QUEUE, BURNER, address(config));
Escrow escrowImpl;
(escrowImpl, burnerVault) =
deployEscrowImplementation(ST_ETH, WST_ETH, WITHDRAWAL_QUEUE, BURNER, address(config));

escrow =
Escrow(payable(address(new TransparentUpgradeableProxy(address(escrowImpl), proxyAdmin, new bytes(0)))));

govState = new GovernanceState__mock();

Expand Down

0 comments on commit 3242513

Please sign in to comment.