forked from balancer/balancer-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTBPoolExitSwap.sol
23 lines (17 loc) · 896 Bytes
/
TBPoolExitSwap.sol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import "./BMathInternal.sol";
// This contract used a modified version of BMath where all the public/external functions are internal to speed up Echidna exploration
contract TestSwapOut is BMath {
bool public echidna_no_bug = true;
// A bug is found if tokenAmountOut can be greater than 0 while calcPoolInGivenSingleOut returns 0
function exitswapExternAmountOut(uint balanceOut, uint poolTotal, uint tokenAmountOut) public {
// We constraint poolTotal and _records_t_balance
// To have "realistic" values
require(poolTotal <= 100 ether);
require(poolTotal >= 1 ether);
require(balanceOut <= 10 ether);
require(balanceOut >= 10**6);
require(tokenAmountOut > 0);
require(calcPoolInGivenSingleOut(balanceOut, MIN_WEIGHT, poolTotal, MIN_WEIGHT*2, tokenAmountOut, MIN_FEE)==0);
echidna_no_bug = false;
}
}