Skip to content

Commit

Permalink
test pool token burning
Browse files Browse the repository at this point in the history
  • Loading branch information
alcueca committed Nov 6, 2023
1 parent f0e2015 commit d247a53
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 35 deletions.
66 changes: 33 additions & 33 deletions src/Unwind.sol
Original file line number Diff line number Diff line change
Expand Up @@ -53,58 +53,58 @@ contract Unwind {
current = 0xcDfBf28Db3B1B7fC8efE08f988D955270A5c4752; knownContracts.push(current); contractTypes[current] = Type.FYTOKEN;
current = 0x38b8BF13c94082001f784A642165517F8760988f; knownContracts.push(current); contractTypes[current] = Type.FYTOKEN;
current = 0xC20952b2C8bB6689e7EC2F70Aeba392C378EC413; knownContracts.push(current); contractTypes[current] = Type.FYTOKEN;
current = 0x0FBd5ca8eE61ec921B3F61B707f1D7D64456d2d1; knownContracts.push(current); contractTypes[current] = Type.FYTOKEN; // - Not enough join balance
current = 0x79A6Be1Ae54153AA6Fc7e4795272c63F63B2a6DC; knownContracts.push(current); contractTypes[current] = Type.FYTOKEN; // - Not enough join balance
current = 0x22E1e5337C5BA769e98d732518b2128dE14b553C; knownContracts.push(current); contractTypes[current] = Type.FYTOKEN; // - Not enough join balance
current = 0x0FBd5ca8eE61ec921B3F61B707f1D7D64456d2d1; knownContracts.push(current); contractTypes[current] = Type.FYTOKEN; // Not enough join balance
current = 0x79A6Be1Ae54153AA6Fc7e4795272c63F63B2a6DC; knownContracts.push(current); contractTypes[current] = Type.FYTOKEN; // Not enough join balance
current = 0x22E1e5337C5BA769e98d732518b2128dE14b553C; knownContracts.push(current); contractTypes[current] = Type.FYTOKEN; // Not enough join balance
current = 0x2eb907fb4b71390dC5CD00e6b81B7dAAcE358193; knownContracts.push(current); contractTypes[current] = Type.FYTOKEN;
current = 0x124c9F7E97235Fe3E35820f95D10aFfCe4bE9168; knownContracts.push(current); contractTypes[current] = Type.FYTOKEN; // - Not enough join balance
current = 0x9ca4D6fbE0Ba91d553e74805d2E2545b04AbEfEA; knownContracts.push(current); contractTypes[current] = Type.FYTOKEN; // - Not enough join balance
current = 0x667f185407C4CAb52aeb681f0006e4642d8091DF; knownContracts.push(current); contractTypes[current] = Type.FYTOKEN; // - Not enough join balance
current = 0x124c9F7E97235Fe3E35820f95D10aFfCe4bE9168; knownContracts.push(current); contractTypes[current] = Type.FYTOKEN; // Not enough join balance
current = 0x9ca4D6fbE0Ba91d553e74805d2E2545b04AbEfEA; knownContracts.push(current); contractTypes[current] = Type.FYTOKEN; // Not enough join balance
current = 0x667f185407C4CAb52aeb681f0006e4642d8091DF; knownContracts.push(current); contractTypes[current] = Type.FYTOKEN; // Not enough join balance
current = 0xFA71e5f0072401dA161b1FC25a9636927AF690D0; knownContracts.push(current); contractTypes[current] = Type.FYTOKEN;
current = 0x8A6ff4c631816888444807541578Ab8465EdDDC2; knownContracts.push(current); contractTypes[current] = Type.FYTOKEN;
current = 0xA0e4B17042F20D9BadBdA9961C2D0987c90F6439; knownContracts.push(current); contractTypes[current] = Type.FYTOKEN;
current = 0xc8110b03629211b946c2783637ABC9402b50EcDf; knownContracts.push(current); contractTypes[current] = Type.FYTOKEN; // - Not enough join balance, maybe disabled after Euler event
current = 0xc7f12Ea237bE7BE6028285052CF3727EaF0e597B; knownContracts.push(current); contractTypes[current] = Type.FYTOKEN; // - Not enough join balance, maybe disabled after Euler event
current = 0x9912ED921832A8F6fc4a07E0892E5974A252043C; knownContracts.push(current); contractTypes[current] = Type.FYTOKEN; // - Not enough join balance, maybe disabled after Euler event
current = 0xc8110b03629211b946c2783637ABC9402b50EcDf; knownContracts.push(current); contractTypes[current] = Type.FYTOKEN; // Not enough join balance, maybe disabled after Euler event
current = 0xc7f12Ea237bE7BE6028285052CF3727EaF0e597B; knownContracts.push(current); contractTypes[current] = Type.FYTOKEN; // Not enough join balance, maybe disabled after Euler event
current = 0x9912ED921832A8F6fc4a07E0892E5974A252043C; knownContracts.push(current); contractTypes[current] = Type.FYTOKEN; // Not enough join balance, maybe disabled after Euler event
current = 0xD28380De0e7093AC62bCb88610b9f4f4Fb58Be74; knownContracts.push(current); contractTypes[current] = Type.FYTOKEN;
current = 0xD842A9f77e142f420BcdBCd6cFAC3548a68906dB; knownContracts.push(current); contractTypes[current] = Type.FYTOKEN; // - Not enough join balance
current = 0xB917a6CD3f811A84c1c5B972E2c715a6d93f40aa; knownContracts.push(current); contractTypes[current] = Type.FYTOKEN; // - Not enough join balance
current = 0x74c4cEa80c1afEAda2907B55FDD9C958Da4a53F2; knownContracts.push(current); contractTypes[current] = Type.FYTOKEN; // - Not enough join balance
current = 0xD842A9f77e142f420BcdBCd6cFAC3548a68906dB; knownContracts.push(current); contractTypes[current] = Type.FYTOKEN; // Not enough join balance
current = 0xB917a6CD3f811A84c1c5B972E2c715a6d93f40aa; knownContracts.push(current); contractTypes[current] = Type.FYTOKEN; // Not enough join balance
current = 0x74c4cEa80c1afEAda2907B55FDD9C958Da4a53F2; knownContracts.push(current); contractTypes[current] = Type.FYTOKEN; // Not enough join balance
current = 0x299c9e28D2c5efa09aa147abB4f1CB4a8dc7AbE0; knownContracts.push(current); contractTypes[current] = Type.FYTOKEN;
current = 0xB38Ba395D15392796B51057490bBc790871dd6a0; knownContracts.push(current); contractTypes[current] = Type.FYTOKEN;
current = 0x82AC37A79D83f8C6E3B55E5e72e1f4ACb1E4fe9f; knownContracts.push(current); contractTypes[current] = Type.FYTOKEN; // - Not mature yet
current = 0xB78F9F7d67a4c7cfAD0Dad80364E95bAe42d2fE1; knownContracts.push(current); contractTypes[current] = Type.FYTOKEN; // - Not mature yet
current = 0x9536C528d9e3f12586ea3E8f624dACb8150b22aa; knownContracts.push(current); contractTypes[current] = Type.FYTOKEN; // - Not mature yet
current = 0x72791dA88B34869CdF4863d966F182D866f51c04; knownContracts.push(current); contractTypes[current] = Type.FYTOKEN; // - Not mature yet
current = 0x82AC37A79D83f8C6E3B55E5e72e1f4ACb1E4fe9f; knownContracts.push(current); contractTypes[current] = Type.FYTOKEN; // Not mature yet
current = 0xB78F9F7d67a4c7cfAD0Dad80364E95bAe42d2fE1; knownContracts.push(current); contractTypes[current] = Type.FYTOKEN; // Not mature yet
current = 0x9536C528d9e3f12586ea3E8f624dACb8150b22aa; knownContracts.push(current); contractTypes[current] = Type.FYTOKEN; // Not mature yet
current = 0x72791dA88B34869CdF4863d966F182D866f51c04; knownContracts.push(current); contractTypes[current] = Type.FYTOKEN; // Not mature yet
current = 0x6BaC09a67Ed1e1f42c29563847F77c28ec3a04FC; knownContracts.push(current); contractTypes[current] = Type.POOL;
current = 0xf5Fd5A9Db9CcCc6dc9f5EF1be3A859C39983577C; knownContracts.push(current); contractTypes[current] = Type.POOL;
current = 0x341B0976F962eC34eEaF31cdF2464Ab3B15B6301; knownContracts.push(current); contractTypes[current] = Type.POOL;
current = 0xc3348D8449d13C364479B1F114bcf5B73DFc0dc6; knownContracts.push(current); contractTypes[current] = Type.POOL;
current = 0xA4d45197E3261721B8A8d901489Df5d4D2E79eD7; knownContracts.push(current); contractTypes[current] = Type.POOL;
current = 0x4b32C37Be5949e77ba3726E863a030BD77942A97; knownContracts.push(current); contractTypes[current] = Type.POOL;
current = 0x9D34dF69958675450ab8E53c8Df5531203398Dc9; knownContracts.push(current); contractTypes[current] = Type.POOL;
current = 0x52956Fb3DC3361fd24713981917f2B6ef493DCcC; knownContracts.push(current); contractTypes[current] = Type.POOL;
current = 0xB2fff7FEA1D455F0BCdd38DA7DeE98af0872a13a; knownContracts.push(current); contractTypes[current] = Type.POOL;
// current = 0x9D34dF69958675450ab8E53c8Df5531203398Dc9; knownContracts.push(current); contractTypes[current] = Type.POOL; // Euler
// current = 0x52956Fb3DC3361fd24713981917f2B6ef493DCcC; knownContracts.push(current); contractTypes[current] = Type.POOL; // Euler
// current = 0xB2fff7FEA1D455F0BCdd38DA7DeE98af0872a13a; knownContracts.push(current); contractTypes[current] = Type.POOL; // Euler
current = 0xFa38F3717daD95085FF725aA93608Af3fa1D9e58; knownContracts.push(current); contractTypes[current] = Type.POOL;
current = 0x1b2145139516cB97568B76a2FdbE37D2BCD61e63; knownContracts.push(current); contractTypes[current] = Type.POOL;
current = 0xBdc7Bdae87dfE602E91FDD019c4C0334C38f6A46; knownContracts.push(current); contractTypes[current] = Type.POOL;
current = 0x48b95265749775310B77418Ff6f9675396ABE1e8; knownContracts.push(current); contractTypes[current] = Type.POOL;
// current = 0x1b2145139516cB97568B76a2FdbE37D2BCD61e63; knownContracts.push(current); contractTypes[current] = Type.POOL; // Euler
// current = 0xBdc7Bdae87dfE602E91FDD019c4C0334C38f6A46; knownContracts.push(current); contractTypes[current] = Type.POOL; // Euler
// current = 0x48b95265749775310B77418Ff6f9675396ABE1e8; knownContracts.push(current); contractTypes[current] = Type.POOL; // Euler
current = 0x1D2eB98042006B1bAFd10f33743CcbB573429daa; knownContracts.push(current); contractTypes[current] = Type.POOL;
current = 0xD129B0351416C75C9f0623fB43Bb93BB4107b2A4; knownContracts.push(current); contractTypes[current] = Type.POOL;
current = 0xC2a463278387e649eEaA5aE5076e283260B0B1bE; knownContracts.push(current); contractTypes[current] = Type.POOL;
current = 0x06aaF385809c7BC00698f1E266eD4C78d6b8ba75; knownContracts.push(current); contractTypes[current] = Type.POOL;
current = 0x2E8F62e3620497DbA8A2D7A18EA8212215805F22; knownContracts.push(current); contractTypes[current] = Type.POOL;
current = 0x7472DF92Ae587f97939de92bDFC23dbaCD8a3816; knownContracts.push(current); contractTypes[current] = Type.POOL;
current = 0xB4DbEc738Ffe47981D337C02Cb5746E456ecd505; knownContracts.push(current); contractTypes[current] = Type.POOL;
current = 0x60995D90B45169eB04F1ea9463443a62B83ab1c1; knownContracts.push(current); contractTypes[current] = Type.POOL;
current = 0x0bdF152f6d899F4B63b9554ED98D9b9d22FFdee4; knownContracts.push(current); contractTypes[current] = Type.POOL;
current = 0xaCd0523Aca72CC58EC2f3d4C14F5473FC11c5C2D; knownContracts.push(current); contractTypes[current] = Type.POOL;
current = 0x6E38B8d9dedd967961508708183678b4EC1B1E33; knownContracts.push(current); contractTypes[current] = Type.POOL;
// current = 0xD129B0351416C75C9f0623fB43Bb93BB4107b2A4; knownContracts.push(current); contractTypes[current] = Type.POOL; // Euler
// current = 0xC2a463278387e649eEaA5aE5076e283260B0B1bE; knownContracts.push(current); contractTypes[current] = Type.POOL; // Euler
// current = 0x06aaF385809c7BC00698f1E266eD4C78d6b8ba75; knownContracts.push(current); contractTypes[current] = Type.POOL; // Euler
// current = 0x2E8F62e3620497DbA8A2D7A18EA8212215805F22; knownContracts.push(current); contractTypes[current] = Type.POOL; // No balance
// current = 0x7472DF92Ae587f97939de92bDFC23dbaCD8a3816; knownContracts.push(current); contractTypes[current] = Type.POOL; // Euler
// current = 0xB4DbEc738Ffe47981D337C02Cb5746E456ecd505; knownContracts.push(current); contractTypes[current] = Type.POOL; // Euler
// current = 0x60995D90B45169eB04F1ea9463443a62B83ab1c1; knownContracts.push(current); contractTypes[current] = Type.POOL; // No balance
// current = 0x0bdF152f6d899F4B63b9554ED98D9b9d22FFdee4; knownContracts.push(current); contractTypes[current] = Type.POOL; // No balance
// current = 0xaCd0523Aca72CC58EC2f3d4C14F5473FC11c5C2D; knownContracts.push(current); contractTypes[current] = Type.POOL; // No balance
// current = 0x6E38B8d9dedd967961508708183678b4EC1B1E33; knownContracts.push(current); contractTypes[current] = Type.POOL; // No balance
current = 0xE56c9c47b271A58e5856004952c5F4D34a78B99B; knownContracts.push(current); contractTypes[current] = Type.POOL;
current = 0x9ce9c9f9fF417Ffc215A4e5c6b4e44BB76Cf8C79; knownContracts.push(current); contractTypes[current] = Type.POOL;
current = 0xFCd1C61139F8Af13c5090CfBb2dD674a2Ff4fe35; knownContracts.push(current); contractTypes[current] = Type.POOL;
current = 0x0ECc79FE01b02548853c87466cCd57710bf9d11A; knownContracts.push(current); contractTypes[current] = Type.POOL;
current = 0xe2F6f40192F3E4568a62577E0541AC823b6f0D9e; knownContracts.push(current); contractTypes[current] = Type.POOL;
// current = 0xe2F6f40192F3E4568a62577E0541AC823b6f0D9e; knownContracts.push(current); contractTypes[current] = Type.POOL; // No balance
current = 0xB9345c19291bB073b0E6483048fAFD0986AB82dF; knownContracts.push(current); contractTypes[current] = Type.POOL;
current = 0x14132D979fDdA62a56d9f552C9aa477b9c94851e; knownContracts.push(current); contractTypes[current] = Type.POOL;
current = 0x3667362C4B666B952383eDBE12fC9cC108D09cD7; knownContracts.push(current); contractTypes[current] = Type.POOL;
Expand Down
20 changes: 18 additions & 2 deletions test/Unwind.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ contract UnwindTest is StdCheats {
unwind = new Unwind();
}

/// @dev Basic test. Run it with `forge test -vvv` to see the console log.
/// @dev Test that the total supply of all fyToken can be redeemed, or give a reason of why not
function test_closeLend() external {
for (uint i = 0; i < unwind.knownContractsLength(); i++) {
address target = unwind.knownContracts(i);
Expand All @@ -44,12 +44,28 @@ contract UnwindTest is StdCheats {
deal(target, address(this), totalSupply);
ERC20(target).approve(address(unwind), type(uint256).max);
unwind.closeLend(target);
console2.log("%s: Redeemed", ERC20(target).name());
console2.log("%s: Redeemed %s", ERC20(target).name(), totalSupply);
}
}
}
}



/// @dev Test that the total supply of all pools can be burned, or give a reason of why not
function test_removePoolLiquidity() external {
for (uint i = 0; i < unwind.knownContractsLength(); i++) {
address target = unwind.knownContracts(i);
if (unwind.contractTypes(target) == Unwind.Type.POOL) {
uint256 totalSupply = ERC20(target).totalSupply();

deal(target, address(this), totalSupply);
ERC20(target).approve(address(unwind), type(uint256).max);
unwind.removeLiquidity(target);
console2.log("%s: Burned %s", ERC20(target).name(), totalSupply);
}
}
}
//
// /// @dev Fuzz test that provides random values for an unsigned integer, but which rejects zero as an input.
// /// If you need more sophisticated input validation, you should use the `bound` utility instead.
Expand Down

0 comments on commit d247a53

Please sign in to comment.