-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
76bef1d
commit f8269f8
Showing
2 changed files
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// SPDX-License-Identifier: GPL-2.0-or-later | ||
pragma solidity ^0.8.0; | ||
|
||
import { | ||
EulerAggregationLayerBase, | ||
EulerAggregationLayer, | ||
IWithdrawalQueue | ||
} from "../common/EulerAggregationLayerBase.t.sol"; | ||
|
||
contract EulerAggregationLayerInvariants is EulerAggregationLayerBase { | ||
function setUp() public override { | ||
super.setUp(); | ||
|
||
targetContract(address(eulerAggregationLayer)); | ||
} | ||
|
||
function invariant_totalAllocationPoints() public view { | ||
address withdrawalQueueAddr = eulerAggregationLayer.withdrawalQueue(); | ||
|
||
(address[] memory withdrawalQueueArray, uint256 withdrawalQueueLength) = | ||
IWithdrawalQueue(withdrawalQueueAddr).getWithdrawalQueueArray(); | ||
|
||
uint256 expectedTotalAllocationpoints; | ||
expectedTotalAllocationpoints += (eulerAggregationLayer.getStrategy(address(0))).allocationPoints; | ||
for (uint256 i; i < withdrawalQueueLength; i++) { | ||
expectedTotalAllocationpoints += | ||
(eulerAggregationLayer.getStrategy(withdrawalQueueArray[i])).allocationPoints; | ||
} | ||
|
||
assertEq(eulerAggregationLayer.totalAllocationPoints(), expectedTotalAllocationpoints); | ||
} | ||
} |