diff --git a/contracts/pools/mkusd/pooldata.json b/contracts/pools/mkusd/pooldata.json new file mode 100644 index 0000000..f6d45ad --- /dev/null +++ b/contracts/pools/mkusd/pooldata.json @@ -0,0 +1,26 @@ +{ + "base_pool": "paypool", + "pool_types": ["meta", "factory"], + "lp_contract": "CurveTokenV2", + "swap_address": "0x9e10f9fb6f0d32b350cee2618662243d4f24c64a", + "lp_token_address": "0x9e10f9fb6f0d32b350cee2618662243d4f24c64a", + "zap_address": "0xE07a16358aA878CBDa2D49A88E5106871E0db307", + "gauge_addresses": ["0x088a9770bc30627791f42b551d474e8fd44808a2"], + "lp_constructor": { + "symbol": "mkUSDPay", + "name": "Curve.fi mkUSD/Paypool" + }, + "coins": [ + { + "name": "mkUSD", + "decimals": 18, + "underlying_address": "0x4591dbff62656e7859afe5e45f6f47d3669fbb28" + }, + { + "name": "PYUSDUSDC", + "decimals": 18, + "base_pool_token": true, + "underlying_address": "0x383e6b4437b59fff47b619cba855ca29342a8559" + } + ] +} diff --git a/contracts/pools/paypool/pooldata.json b/contracts/pools/paypool/pooldata.json new file mode 100644 index 0000000..d038e36 --- /dev/null +++ b/contracts/pools/paypool/pooldata.json @@ -0,0 +1,23 @@ +{ + "lp_contract": "CurveTokenV3", + "swap_address": "0x383e6b4437b59fff47b619cba855ca29342a8559", + "lp_token_address": "0x383e6b4437b59fff47b619cba855ca29342a8559", + "gauge_addresses": ["0x9da75997624c697444958aded6790bfca96af19a"], + "lp_constructor": { + "name": "PayPool", + "symbol": "PayPool" + }, + "coins": [ + { + "name": "PYUSD", + "decimals": 6, + "underlying_address": "0x6c3ea9036406852006290770bedfcaba0e23a0e8" + }, + { + "name": "USDC", + "decimals": 6, + "underlying_address": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48" + + } + ] +} diff --git a/tests/conftest.py b/tests/conftest.py index 4fd9f0a..154e1fb 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -6,10 +6,10 @@ POOLS = ['3pool', 'aave', 'aeth', 'bbtc', 'busd', 'compound', 'dusd', 'gusd', 'hbtc', 'husd', 'ib', 'link', 'musd', 'obtc', 'pax', 'pbtc', 'ren', 'reth', 'rsv', 'saave', 'sbtc', 'seth', 'steth', 'susd', 'tbtc', 'usdk', 'usdp', 'usdt', - 'ust', 'y', 'tricrypto2', 'eurt', 'eurtusd', 'crveth', 'cvxeth', 'tusd', 'veth', 'usdv'] # 'eurs' + 'ust', 'y', 'tricrypto2', 'eurt', 'eurtusd', 'crveth', 'cvxeth', 'tusd', 'veth', 'usdv', 'paypool', 'mkusd'] # 'eurs' LENDING_POOLS = ['compound', 'usdt', 'y', 'busd', 'pax', 'aave', 'saave', 'ib'] -META_POOLS = ['gusd', 'husd', 'usdk', 'musd', 'rsv', 'tbtc', 'dusd', 'pbtc', 'bbtc', 'obtc', 'ust', 'usdp', 'eurtusd', 'usdv'] +META_POOLS = ['gusd', 'husd', 'usdk', 'musd', 'rsv', 'tbtc', 'dusd', 'pbtc', 'bbtc', 'obtc', 'ust', 'usdp', 'eurtusd', 'usdv', 'mkusd'] FACTORY_POOOLS = ['tusd'] # 'frax', 'lusd', 'busdv2', 'alusd', 'mim' WETH_POOLS = ['tricrypto2', 'crveth', 'cvxeth'] diff --git a/tests/fixtures/pooldata.py b/tests/fixtures/pooldata.py index 70c4b33..da05a8f 100644 --- a/tests/fixtures/pooldata.py +++ b/tests/fixtures/pooldata.py @@ -135,8 +135,13 @@ def factory_pool_address(pool_data): @pytest.fixture(scope="module") -def is_plain_stable_ng(pool_data): - if pool_data['swap_address'] == "0x6685fcfce05e7502bf9f0aa03b36025b09374726": # vETH/ETH +def use_dynarray(pool_data): + ng_pools = [ + "0x6685fcfce05e7502bf9f0aa03b36025b09374726", # vETH/ETH + "0x383e6b4437b59fff47b619cba855ca29342a8559", # PayPool + "0x9e10f9fb6f0d32b350cee2618662243d4f24c64a", # mkUSD + ] + if pool_data['swap_address'] in ng_pools: return True return False diff --git a/tests/test_underlying.py b/tests/test_underlying.py index 9b16dd0..0c9961a 100644 --- a/tests/test_underlying.py +++ b/tests/test_underlying.py @@ -7,7 +7,7 @@ def test_balance( zap, margo, deposit_address, token_address, gauge_address, n_coins_underlying, underlying_coin_addresses, underlying_amounts, value_underlying, gauge, use_underlying, - is_plain_stable_ng, factory_pool_address + use_dynarray, factory_pool_address ): assert gauge.balanceOf(margo.address) == 0 @@ -20,7 +20,7 @@ def test_balance( underlying_amounts, 0, use_underlying, - is_plain_stable_ng, + use_dynarray, factory_pool_address, {'from': margo, 'value': value_underlying} ) @@ -31,7 +31,7 @@ def test_balance( def test_approve( zap, margo, deposit_address, token_address, gauge_address, n_coins_underlying, underlying_coin_addresses, - underlying_amounts, value_underlying, underlying_coins, lp_token, use_underlying, is_plain_stable_ng, + underlying_amounts, value_underlying, underlying_coins, lp_token, use_underlying, use_dynarray, factory_pool_address ): for coin in underlying_coins: @@ -50,7 +50,7 @@ def test_approve( underlying_amounts, 0, use_underlying, - is_plain_stable_ng, + use_dynarray, factory_pool_address, {'from': margo, 'value': value_underlying} ) @@ -66,7 +66,7 @@ def test_approve( def test_token_mismatch( zap, margo, deposit_address, other_token_address, gauge_address, n_coins_underlying, underlying_coin_addresses, underlying_amounts, value_underlying, use_underlying, - is_plain_stable_ng, factory_pool_address + use_dynarray, factory_pool_address ): with brownie.reverts(): zap.deposit_and_stake( @@ -78,7 +78,7 @@ def test_token_mismatch( underlying_amounts, 0, use_underlying, - is_plain_stable_ng, + use_dynarray, factory_pool_address, {'from': margo, 'value': value_underlying} ) @@ -87,7 +87,7 @@ def test_token_mismatch( def test_gauge_mismatch( zap, margo, deposit_address, token_address, other_gauge_address, n_coins_underlying, underlying_coin_addresses, underlying_amounts, value_underlying, use_underlying, - is_plain_stable_ng, factory_pool_address + use_dynarray, factory_pool_address ): with brownie.reverts(): zap.deposit_and_stake( @@ -99,7 +99,7 @@ def test_gauge_mismatch( underlying_amounts, 0, use_underlying, - is_plain_stable_ng, + use_dynarray, factory_pool_address, {'from': margo, 'value': value_underlying} ) @@ -108,7 +108,7 @@ def test_gauge_mismatch( def test_n_coins_too_high( zap, margo, deposit_address, token_address, gauge_address, n_coins_underlying, underlying_coin_addresses, underlying_amounts, value_underlying, use_underlying, - is_plain_stable_ng, factory_pool_address + use_dynarray, factory_pool_address ): with brownie.reverts(): zap.deposit_and_stake( @@ -120,7 +120,7 @@ def test_n_coins_too_high( underlying_amounts, 0, use_underlying, - is_plain_stable_ng, + use_dynarray, factory_pool_address, {'from': margo, 'value': value_underlying} ) @@ -129,7 +129,7 @@ def test_n_coins_too_high( def test_n_coins_too_low( zap, margo, deposit_address, token_address, gauge_address, n_coins_underlying, underlying_coin_addresses, underlying_amounts, value_underlying, use_underlying, - is_plain_stable_ng, factory_pool_address + use_dynarray, factory_pool_address ): with brownie.reverts(): zap.deposit_and_stake( @@ -141,7 +141,7 @@ def test_n_coins_too_low( underlying_amounts, 0, use_underlying, - is_plain_stable_ng, + use_dynarray, factory_pool_address, {'from': margo, 'value': value_underlying} ) @@ -150,7 +150,7 @@ def test_n_coins_too_low( def test_wrong_coins( zap, margo, deposit_address, token_address, gauge_address, n_coins_underlying, wrong_coin_addresses, underlying_amounts, value_underlying, use_underlying, - is_plain_stable_ng, factory_pool_address + use_dynarray, factory_pool_address ): with brownie.reverts(): zap.deposit_and_stake( @@ -162,7 +162,7 @@ def test_wrong_coins( underlying_amounts, 0, use_underlying, - is_plain_stable_ng, + use_dynarray, factory_pool_address, {'from': margo, 'value': value_underlying} ) @@ -171,7 +171,7 @@ def test_wrong_coins( def test_wrong_order_of_coins( zap, margo, deposit_address, token_address, gauge_address, n_coins_underlying, underlying_coin_addresses_wrong_order, underlying_amounts, value_underlying, - use_underlying, is_plain_stable_ng, factory_pool_address + use_underlying, use_dynarray, factory_pool_address ): with brownie.reverts(): zap.deposit_and_stake( @@ -183,7 +183,7 @@ def test_wrong_order_of_coins( underlying_amounts, 0, use_underlying, - is_plain_stable_ng, + use_dynarray, factory_pool_address, {'from': margo, 'value': value_underlying} ) @@ -192,7 +192,7 @@ def test_wrong_order_of_coins( def test_wrong_value( zap, margo, deposit_address, token_address, gauge_address, n_coins_underlying, underlying_coin_addresses, underlying_amounts, value_underlying, use_underlying, - is_plain_stable_ng, factory_pool_address + use_dynarray, factory_pool_address ): with brownie.reverts(): zap.deposit_and_stake( @@ -204,7 +204,7 @@ def test_wrong_value( underlying_amounts, 0, use_underlying, - is_plain_stable_ng, + use_dynarray, factory_pool_address, {'from': margo, 'value': 0 if value_underlying > 0 else 10**18} ) @@ -213,7 +213,7 @@ def test_wrong_value( def test_wrong_use_underlying( zap, margo, deposit_address, token_address, gauge_address, n_coins_underlying, underlying_coin_addresses, underlying_amounts, value_underlying, use_underlying, - is_plain_stable_ng, factory_pool_address + use_dynarray, factory_pool_address ): if factory_pool_address == brownie.ZERO_ADDRESS: with brownie.reverts(): @@ -226,7 +226,7 @@ def test_wrong_use_underlying( underlying_amounts, 0, not use_underlying, - is_plain_stable_ng, + use_dynarray, factory_pool_address, {'from': margo, 'value': value_underlying} ) diff --git a/tests/test_wrapped.py b/tests/test_wrapped.py index 83b81a6..d123814 100644 --- a/tests/test_wrapped.py +++ b/tests/test_wrapped.py @@ -6,7 +6,7 @@ def test_balance( zap, margo, swap_address, token_address, gauge_address, n_coins_wrapped, - wrapped_coin_addresses, wrapped_amounts, value_wrapped, gauge, is_plain_stable_ng + wrapped_coin_addresses, wrapped_amounts, value_wrapped, gauge, use_dynarray, is_meta ): assert gauge.balanceOf(margo.address) == 0 @@ -19,7 +19,7 @@ def test_balance( wrapped_amounts, 0, False, - is_plain_stable_ng, + use_dynarray and not is_meta, {'from': margo, 'value': value_wrapped} ) @@ -30,7 +30,7 @@ def test_balance( def test_approve( zap, margo, swap_address, token_address, gauge_address, n_coins_wrapped, wrapped_coin_addresses, wrapped_amounts, value_wrapped, wrapped_coins, - lp_token, is_plain_stable_ng + lp_token, use_dynarray, is_meta ): for coin in wrapped_coins: if coin == '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE': @@ -48,7 +48,7 @@ def test_approve( wrapped_amounts, 0, False, - is_plain_stable_ng, + use_dynarray and not is_meta, {'from': margo, 'value': value_wrapped} ) @@ -62,7 +62,7 @@ def test_approve( def test_token_mismatch( zap, margo, swap_address, other_token_address, gauge_address, n_coins_wrapped, - wrapped_coin_addresses, wrapped_amounts, value_wrapped, is_plain_stable_ng + wrapped_coin_addresses, wrapped_amounts, value_wrapped, use_dynarray, is_meta ): with brownie.reverts(): zap.deposit_and_stake( @@ -74,14 +74,14 @@ def test_token_mismatch( wrapped_amounts, 0, False, - is_plain_stable_ng, + use_dynarray and not is_meta, {'from': margo, 'value': value_wrapped} ) def test_gauge_mismatch( zap, margo, swap_address, token_address, other_gauge_address, n_coins_wrapped, - wrapped_coin_addresses, wrapped_amounts, value_wrapped, is_plain_stable_ng + wrapped_coin_addresses, wrapped_amounts, value_wrapped, use_dynarray, is_meta ): with brownie.reverts(): zap.deposit_and_stake( @@ -93,14 +93,14 @@ def test_gauge_mismatch( wrapped_amounts, 0, False, - is_plain_stable_ng, + use_dynarray and not is_meta, {'from': margo, 'value': value_wrapped} ) def test_n_coins_too_high( zap, margo, swap_address, token_address, gauge_address, n_coins_wrapped, - wrapped_coin_addresses, wrapped_amounts, value_wrapped, is_plain_stable_ng + wrapped_coin_addresses, wrapped_amounts, value_wrapped, use_dynarray, is_meta ): with brownie.reverts(): zap.deposit_and_stake( @@ -112,14 +112,14 @@ def test_n_coins_too_high( wrapped_amounts, 0, False, - is_plain_stable_ng, + use_dynarray and not is_meta, {'from': margo, 'value': value_wrapped} ) def test_n_coins_too_low( zap, margo, swap_address, token_address, gauge_address, n_coins_wrapped, - wrapped_coin_addresses, wrapped_amounts, value_wrapped, is_plain_stable_ng + wrapped_coin_addresses, wrapped_amounts, value_wrapped, use_dynarray, is_meta ): with brownie.reverts(): zap.deposit_and_stake( @@ -131,14 +131,14 @@ def test_n_coins_too_low( wrapped_amounts, 0, False, - is_plain_stable_ng, + use_dynarray and not is_meta, {'from': margo, 'value': value_wrapped} ) def test_wrong_coins( zap, margo, deposit_address, token_address, gauge_address, n_coins_wrapped, - wrong_coin_addresses, wrapped_amounts, value_wrapped, is_plain_stable_ng + wrong_coin_addresses, wrapped_amounts, value_wrapped, use_dynarray, is_meta ): with brownie.reverts(): zap.deposit_and_stake( @@ -150,14 +150,14 @@ def test_wrong_coins( wrapped_amounts, 0, False, - is_plain_stable_ng, + use_dynarray and not is_meta, {'from': margo, 'value': value_wrapped} ) def test_wrong_order_of_coins( zap, margo, deposit_address, token_address, gauge_address, n_coins_wrapped, - wrapped_coin_addresses_wrong_order, wrapped_amounts, value_wrapped, is_plain_stable_ng + wrapped_coin_addresses_wrong_order, wrapped_amounts, value_wrapped, use_dynarray, is_meta ): with brownie.reverts(): zap.deposit_and_stake( @@ -169,14 +169,14 @@ def test_wrong_order_of_coins( wrapped_amounts, 0, False, - is_plain_stable_ng, + use_dynarray and not is_meta, {'from': margo, 'value': value_wrapped} ) def test_wrong_value( zap, margo, deposit_address, token_address, gauge_address, n_coins_wrapped, - wrapped_coin_addresses, wrapped_amounts, value_wrapped, is_plain_stable_ng + wrapped_coin_addresses, wrapped_amounts, value_wrapped, use_dynarray, is_meta ): with brownie.reverts(): zap.deposit_and_stake( @@ -188,16 +188,16 @@ def test_wrong_value( wrapped_amounts, 0, False, - is_plain_stable_ng, + use_dynarray and not is_meta, {'from': margo, 'value': 0 if value_wrapped > 0 else 10**18} ) def test_wrong_use_underlying( zap, margo, deposit_address, token_address, gauge_address, n_coins_wrapped, - wrapped_coin_addresses, wrapped_amounts, value_wrapped, is_plain_stable_ng + wrapped_coin_addresses, wrapped_amounts, value_wrapped, use_dynarray, is_meta ): - if not is_plain_stable_ng: + if not use_dynarray: with brownie.reverts(): zap.deposit_and_stake( deposit_address, @@ -208,6 +208,6 @@ def test_wrong_use_underlying( wrapped_amounts, 0, True, - is_plain_stable_ng, + use_dynarray and not is_meta, {'from': margo, 'value': value_wrapped} )