generated from refcell/femplate
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cleaned up folder naming and removed redundant function calls and dep…
…reciated tests (#1043) Co-authored-by: Ian Harvey <iharvey@comcast.net>
- Loading branch information
1 parent
04c6ccd
commit 9fd555c
Showing
14 changed files
with
70 additions
and
244 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
File renamed without changes.
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
File renamed without changes.
62 changes: 62 additions & 0 deletions
62
tests/forge/invariants/Positions/handlers/ERC20PoolPositionHandler.sol
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,62 @@ | ||
// SPDX-License-Identifier: UNLICENSED | ||
|
||
pragma solidity 0.8.18; | ||
|
||
import { PositionManager } from 'src/PositionManager.sol'; | ||
import { Pool } from 'src/base/Pool.sol'; | ||
import { ERC20Pool } from 'src/ERC20Pool.sol'; | ||
import { Maths } from 'src/libraries/internal/Maths.sol'; | ||
|
||
import { TokenWithNDecimals } from '../../../utils/Tokens.sol'; | ||
|
||
import { PositionPoolHandler } from './PositionPoolHandler.sol'; | ||
import { BaseERC20PoolHandler } from '../../ERC20Pool/handlers/unbounded/BaseERC20PoolHandler.sol'; | ||
import { UnboundedBasicPoolHandler } from '../../base/handlers/unbounded/UnboundedBasicPoolHandler.sol'; | ||
import { UnboundedBasicERC20PoolHandler } from '../../ERC20Pool/handlers/unbounded/UnboundedBasicERC20PoolHandler.sol'; | ||
import { UnboundedLiquidationPoolHandler } from '../../base/handlers/unbounded/UnboundedLiquidationPoolHandler.sol'; | ||
import '@std/console.sol'; | ||
|
||
contract ERC20PoolPositionHandler is PositionPoolHandler, BaseERC20PoolHandler, UnboundedBasicERC20PoolHandler, UnboundedLiquidationPoolHandler { | ||
|
||
address[] internal _lenders; | ||
address[] internal _borrowers; | ||
|
||
uint16 internal constant LENDERS = 200; | ||
uint256 numberOfBuckets; | ||
|
||
constructor( | ||
address positions_, | ||
address[] memory pools_, | ||
address ajna_, | ||
address poolInfoUtils_, | ||
uint256 numOfActors_, | ||
address testContract_ | ||
) BaseERC20PoolHandler(pools_[0], ajna_, poolInfoUtils_, numOfActors_, testContract_) { | ||
|
||
for (uint256 i = 0; i < pools_.length; i++) { | ||
_pools.push(pools_[i]); | ||
} | ||
|
||
// Position manager | ||
_positionManager = PositionManager(positions_); | ||
|
||
// pool hash for mint() call | ||
_poolHash = bytes32(keccak256("ERC20_NON_SUBSET_HASH")); | ||
} | ||
|
||
modifier useRandomPool(uint256 poolIndex) override { | ||
poolIndex = bound(poolIndex, 0, _pools.length - 1); | ||
updateTokenAndPoolAddress(_pools[poolIndex]); | ||
|
||
_; | ||
} | ||
|
||
function updateTokenAndPoolAddress(address pool_) internal override { | ||
_pool = Pool(pool_); | ||
_erc20Pool = ERC20Pool(pool_); | ||
|
||
_quote = TokenWithNDecimals(_pool.quoteTokenAddress()); | ||
_collateral = TokenWithNDecimals(_pool.collateralAddress()); | ||
} | ||
|
||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
215 changes: 0 additions & 215 deletions
215
tests/forge/invariants/PositionsAndRewards/handlers/ERC20PoolPositionHandler.sol
This file was deleted.
Oops, something went wrong.
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
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