Skip to content

Commit

Permalink
Merge pull request #33 from euler-xyz/test/a16z-tests
Browse files Browse the repository at this point in the history
Test: a16z property tests
  • Loading branch information
haythemsellami authored Jul 1, 2024
2 parents e4eb399 + bfbe585 commit 76bef1d
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,6 @@
[submodule "lib/openzeppelin-contracts"]
path = lib/openzeppelin-contracts
url = https://github.com/OpenZeppelin/openzeppelin-contracts
[submodule "lib/erc4626-tests"]
path = lib/erc4626-tests
url = https://github.com/a16z/erc4626-tests
1 change: 1 addition & 0 deletions lib/erc4626-tests
Submodule erc4626-tests added at 8b1d7c
61 changes: 61 additions & 0 deletions test/A16zPropertyTests.t.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity ^0.8.0;

// a16z property tests
import {ERC4626Test} from "erc4626-tests/ERC4626.test.sol";
// contracts
import {EulerAggregationLayer} from "../src/core/EulerAggregationLayer.sol";
import {Rebalancer} from "../src/plugin/Rebalancer.sol";
import {Hooks} from "../src/core/module/Hooks.sol";
import {Rewards} from "../src/core/module/Rewards.sol";
import {Fee} from "../src/core/module/Fee.sol";
import {EulerAggregationLayerFactory} from "../src/core/EulerAggregationLayerFactory.sol";
import {WithdrawalQueue} from "../src/plugin/WithdrawalQueue.sol";
import {AllocationPoints} from "../src/core/module/AllocationPoints.sol";
// mocks
import {ERC20Mock} from "@openzeppelin/contracts/mocks/token/ERC20Mock.sol";

contract A16zPropertyTests is ERC4626Test {
uint256 public constant CASH_RESERVE_ALLOCATION_POINTS = 1000e18;

// core modules
Rewards rewardsImpl;
Hooks hooksImpl;
Fee feeModuleImpl;
AllocationPoints allocationPointsModuleImpl;
// plugins
Rebalancer rebalancerPlugin;
WithdrawalQueue withdrawalQueuePluginImpl;

EulerAggregationLayerFactory eulerAggregationLayerFactory;
EulerAggregationLayer eulerAggregationLayer;

function setUp() public override {
rewardsImpl = new Rewards();
hooksImpl = new Hooks();
feeModuleImpl = new Fee();
allocationPointsModuleImpl = new AllocationPoints();

rebalancerPlugin = new Rebalancer();
withdrawalQueuePluginImpl = new WithdrawalQueue();

EulerAggregationLayerFactory.FactoryParams memory factoryParams = EulerAggregationLayerFactory.FactoryParams({
balanceTracker: address(0),
rewardsModuleImpl: address(rewardsImpl),
hooksModuleImpl: address(hooksImpl),
feeModuleImpl: address(feeModuleImpl),
allocationPointsModuleImpl: address(allocationPointsModuleImpl),
rebalancer: address(rebalancerPlugin),
withdrawalQueueImpl: address(withdrawalQueuePluginImpl)
});
eulerAggregationLayerFactory = new EulerAggregationLayerFactory(factoryParams);

_underlying_ = address(new ERC20Mock());
_vault_ = eulerAggregationLayerFactory.deployEulerAggregationLayer(
_underlying_, "E20M_Agg", "E20M_Agg", CASH_RESERVE_ALLOCATION_POINTS
);
_delta_ = 0;
_vaultMayBeEmpty = false;
_unlimitedAmount = false;
}
}

0 comments on commit 76bef1d

Please sign in to comment.