|
| 1 | +// SPDX-License-Identifier: BUSL-1.1 |
| 2 | +pragma solidity ^0.8.23; |
| 3 | + |
| 4 | +// Test Utils |
| 5 | +import "../../../utils/ProtocolActions.sol"; |
| 6 | + |
| 7 | +contract MDMVDMulti0000NoTokenInputSlippageAMB12Permit2 is ProtocolActions { |
| 8 | + function setUp() public override { |
| 9 | + chainIds = [ETH, OP]; |
| 10 | + |
| 11 | + super.setUp(); |
| 12 | + /*////////////////////////////////////////////////////////////// |
| 13 | + !! WARNING !! DEFINE TEST SETTINGS HERE |
| 14 | + //////////////////////////////////////////////////////////////*/ |
| 15 | + |
| 16 | + AMBs = [1, 2]; |
| 17 | + MultiDstAMBs = [AMBs, AMBs]; |
| 18 | + |
| 19 | + CHAIN_0 = OP; |
| 20 | + DST_CHAINS = [OP, ETH]; |
| 21 | + |
| 22 | + /// @dev define vaults amounts and slippage for every destination chain and for every action |
| 23 | + TARGET_UNDERLYINGS[OP][0] = [0, 1]; |
| 24 | + TARGET_UNDERLYINGS[ETH][0] = [1, 0]; |
| 25 | + |
| 26 | + TARGET_VAULTS[OP][0] = [0, 0]; |
| 27 | + TARGET_VAULTS[ETH][0] = [0, 0]; |
| 28 | + |
| 29 | + TARGET_FORM_KINDS[OP][0] = [0, 0]; |
| 30 | + TARGET_FORM_KINDS[ETH][0] = [0, 0]; |
| 31 | + |
| 32 | + MAX_SLIPPAGE = 1000; |
| 33 | + |
| 34 | + LIQ_BRIDGES[OP][0] = [1, 1]; |
| 35 | + LIQ_BRIDGES[ETH][0] = [1, 1]; |
| 36 | + |
| 37 | + RECEIVE_4626[OP][0] = [false, false]; |
| 38 | + RECEIVE_4626[ETH][0] = [false, false]; |
| 39 | + |
| 40 | + actions.push( |
| 41 | + TestAction({ |
| 42 | + action: Actions.DepositPermit2, |
| 43 | + multiVaults: true, //!!WARNING turn on or off multi vaults |
| 44 | + user: 0, |
| 45 | + testType: TestType.Pass, |
| 46 | + revertError: "", |
| 47 | + revertRole: "", |
| 48 | + slippage: 421, // 0% <- if we are testing a pass this must be below each maxSlippage, |
| 49 | + dstSwap: false, |
| 50 | + externalToken: 1 // 0 = DAI, 1 = USDT, 2 = WETH |
| 51 | + }) |
| 52 | + ); |
| 53 | + } |
| 54 | + |
| 55 | + /*/////////////////////////////////////////////////////////////// |
| 56 | + SCENARIO TESTS |
| 57 | + //////////////////////////////////////////////////////////////*/ |
| 58 | + |
| 59 | + function test_scenario(uint128 amountOne_, uint128 amountTwo_) public { |
| 60 | + /// @dev amount = 1 after slippage will become 0, hence starting with 2 |
| 61 | + amountOne_ = uint128(bound(amountOne_, 2 * 10 ** 6, TOTAL_SUPPLY_USDC / 4)); |
| 62 | + amountTwo_ = uint128(bound(amountTwo_, 2 * 10 ** 6, TOTAL_SUPPLY_USDC / 4)); |
| 63 | + AMOUNTS[OP][0] = [amountOne_, amountTwo_]; |
| 64 | + AMOUNTS[ETH][0] = [amountTwo_, amountOne_]; |
| 65 | + |
| 66 | + for (uint256 act; act < actions.length; ++act) { |
| 67 | + TestAction memory action = actions[act]; |
| 68 | + MultiVaultSFData[] memory multiSuperformsData; |
| 69 | + SingleVaultSFData[] memory singleSuperformsData; |
| 70 | + MessagingAssertVars[] memory aV; |
| 71 | + StagesLocalVars memory vars; |
| 72 | + bool success; |
| 73 | + |
| 74 | + _runMainStages(action, act, multiSuperformsData, singleSuperformsData, aV, vars, success); |
| 75 | + } |
| 76 | + } |
| 77 | +} |
0 commit comments