Skip to content

Commit

Permalink
fix(Sideloading): update after vaulthub separation
Browse files Browse the repository at this point in the history
  • Loading branch information
failingtwice committed Feb 28, 2025
1 parent 3f1622a commit 7b95844
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
17 changes: 6 additions & 11 deletions contracts/0.8.25/vaults/Sideloading.sol
Original file line number Diff line number Diff line change
Expand Up @@ -55,17 +55,12 @@ contract Sideloading is VaultHub {
* @notice Constructor.
* @param _stETH The address of the STETH contract.
*/
constructor(IStETH _stETH) VaultHub(_stETH) {}

/**
* @notice Initializes the contract.
* @param _admin The address of the admin.
*/
function initialize(address _admin) external initializer {
if (_admin == address(0)) revert ZeroArgument("_admin");

__VaultHub_init(_admin);
}
constructor(
IStETH _stETH,
address _accounting,
uint256 _connectedVaultsLimit,
uint256 _relativeShareLimitBP
) VaultHub(_stETH, _accounting, _connectedVaultsLimit, _relativeShareLimitBP) {}

/**
* @notice Returns true if the sideloader registry is ignored and any address can be used as a sideloader.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ contract StETH__MockForSideloading is ERC20 {
return shares;
}

function getPooledEthBySharesRoundUp(uint256 shares) external view returns (uint256) {
return shares;
}

// for simplicity, 1 steth = 1 share
function getSharesByPooledEth(uint256 pooledEth) external view returns (uint256) {
return pooledEth;
Expand Down
3 changes: 2 additions & 1 deletion test/0.8.25/vaults/sideloading/sideloading.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ describe("Sideloading.sol", () => {
await setBalance(await swapper.getAddress(), ether("1000"));
adapter = await ethers.deployContract("SwapperAdapter__MockForSideloading", [steth, swapper]);

const sideloadingImpl = await ethers.deployContract("Sideloading", [steth]);
const accounting = certainAddress("accounting");
const sideloadingImpl = await ethers.deployContract("Sideloading", [steth, accounting, 100n, 1000n]);
[sideloading] = await proxify({ impl: sideloadingImpl, admin });

await expect(sideloading.initialize(admin))
Expand Down

0 comments on commit 7b95844

Please sign in to comment.