Skip to content

Commit

Permalink
fix(bootstrap): deploy vaults correctly
Browse files Browse the repository at this point in the history
I had mistakenly confused the `BeaconProxyBytecode` and the beacon chain
related functions
  • Loading branch information
MaxMustermann2 committed Jun 3, 2024
1 parent ae0a41b commit f515a20
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/storage/BootstrapStorage.sol
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,15 @@ contract BootstrapStorage is GatewayStorage, ITokenWhitelister {
}

function _deployVault(address underlyingToken) internal returns (IVault) {
Vault vault = Vault(Create2.deploy(0, bytes32(uint256(uint160(underlyingToken))), type(Vault).creationCode));
Vault vault = Vault(
Create2.deploy(
0,
bytes32(uint256(uint160(underlyingToken))),
// for clarity, this BEACON_PROXY is not related to beacon chain
// but rather it is the bytecode for the beacon proxy upgrade pattern.
abi.encodePacked(BEACON_PROXY_BYTECODE.getBytecode(), abi.encode(address(VAULT_BEACON), ""))
)
);
vault.initialize(underlyingToken, address(this));
emit VaultCreated(underlyingToken, address(vault));

Expand Down

0 comments on commit f515a20

Please sign in to comment.