Skip to content

Commit

Permalink
test: deal with previously commented code
Browse files Browse the repository at this point in the history
  • Loading branch information
0xteddybear committed Aug 1, 2024
1 parent b101648 commit 5459229
Showing 1 changed file with 0 additions and 79 deletions.
79 changes: 0 additions & 79 deletions test/invariants/fuzz/Protocol.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,6 @@ contract FuzzProtocol is EchidnaTest {
}
}

/* TODO: re-enable this test after fixing the hevm issue with SafeTransfer library
/// @custom:property-id 3
/// @custom:property BFactory should always be able to transfer the BToken to the BDao, if called by it
function fuzz_alwaysCollect() public agentOrDeployer {
Expand All @@ -168,7 +167,6 @@ contract FuzzProtocol is EchidnaTest {
assert(_currentBDao != currentCaller);
}
}
*/

/// @custom:property-id 4
/// @custom:property the amount received can never be less than min amount out
Expand Down Expand Up @@ -419,83 +417,6 @@ contract FuzzProtocol is EchidnaTest {
assert(ghost_bptMinted - ghost_bptBurned == pool.totalSupply());
}

/* NOTE: deprecated calcSingleOutGivenPoolIn
/// @custom:property-id 17
/// @custom:property a direct token transfer can never reduce the underlying amount of a given token per BPT
function fuzz_directTransfer(
uint256 _amountPoolToken,
uint256 _amountToTransfer,
uint256 _tokenIdx
) public agentOrDeployer {
_tokenIdx = clamp(_tokenIdx, 0, tokens.length - 1);
FuzzERC20 _token = tokens[_tokenIdx];
uint256 _redeemedAmountBeforeTransfer = bmath.calcSingleOutGivenPoolIn(
_token.balanceOf(address(pool)),
pool.getDenormalizedWeight(address(_token)),
pool.totalSupply(),
pool.getTotalDenormalizedWeight(),
_amountPoolToken,
bconst.MIN_FEE()
);
_token.mint(address(this), _amountToTransfer);
// Action
_token.transfer(address(pool), _amountToTransfer);
// Postcondition
uint256 _redeemedAmountAfter = bmath.calcSingleOutGivenPoolIn(
_token.balanceOf(address(pool)),
pool.getDenormalizedWeight(address(_token)),
pool.totalSupply(),
pool.getTotalDenormalizedWeight(),
_amountPoolToken,
bconst.MIN_FEE()
);
assert(_redeemedAmountAfter >= _redeemedAmountBeforeTransfer);
ghost_amountDirectlyTransfered[_token] += _amountToTransfer;
}
/// @custom:property-id 18
/// @custom:property the amount of underlying token when exiting should always be the amount calculated in bmath
function fuzz_correctBPTBurnAmount(uint256 _amountPoolToken) public agentOrDeployer {
_amountPoolToken = clamp(_amountPoolToken, 0, pool.balanceOf(currentCaller));
uint256[] memory _amountsToReceive = new uint256[](4);
uint256[] memory _previousBalances = new uint256[](4);
for (uint256 i; i < tokens.length; i++) {
FuzzERC20 _token = tokens[i];
_amountsToReceive[i] = bmath.calcSingleOutGivenPoolIn(
_token.balanceOf(address(pool)),
pool.getDenormalizedWeight(address(_token)),
pool.totalSupply(),
pool.getTotalDenormalizedWeight(),
_amountPoolToken,
bconst.MIN_FEE()
);
_previousBalances[i] = _token.balanceOf(currentCaller);
}
hevm.prank(currentCaller);
pool.approve(address(pool), _amountPoolToken);
hevm.prank(currentCaller);
// Action
pool.exitPool(_amountPoolToken, new uint256[](4));
// PostCondition
for (uint256 i; i < tokens.length; i++) {
assert(tokens[i].balanceOf(currentCaller) == _previousBalances[i] + _amountsToReceive[i]);
}
}
*/

/// @custom:property-id 20
/// @custom:property bounding and unbounding token can only be done on a non-finalized pool, by the controller
function fuzz_boundOnlyNotFinalized() public agentOrDeployer {
Expand Down

0 comments on commit 5459229

Please sign in to comment.