Skip to content

Commit

Permalink
Use boa from source, fix more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielSchiavini committed Dec 4, 2023
1 parent 620bfe4 commit 1c7fce4
Show file tree
Hide file tree
Showing 10 changed files with 233 additions and 171 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ Out[1]: '0xc4AD29ba4B3c580e6D59105FFf484999997675Ff'

#### `MetaRegistry.get_pool_asset_type`

Gets the asset type of pool. `0` = `USD`, `1` = `ETH`, `2` = `BTC`, `3` = Other, `4` = CryptoPool token. The asset type is a property of StableSwaps, and is not enforced in CryptoSwap pools (which always return `4`).
Gets the asset type of a pool. `0` = `USD`, `1` = `ETH`, `2` = `BTC`, `3` = Other, `4` = CryptoPool token. The asset type is a property of StableSwaps, and is not enforced in CryptoSwap pools (which always return `4`).

StableSwap pool example for `LUSD-3CRV` pool which is a `USD` stablecoin pool:

Expand Down
2 changes: 1 addition & 1 deletion requirements.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
titanoboa[forking-recommended]==0.1.8
titanoboa[forking-recommended] @ git+https://github.com/vyperlang/titanoboa
black
flake8
isort
Expand Down
22 changes: 16 additions & 6 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# This file is autogenerated by pip-compile with Python 3.11
# This file is autogenerated by pip-compile with Python 3.10
# by the following command:
#
# pip-compile
Expand Down Expand Up @@ -45,7 +45,6 @@ eth-bloom==3.0.0
eth-hash[pycryptodome]==0.5.2
# via
# eth-bloom
# eth-hash
# eth-utils
# trie
eth-keyfile==0.6.1
Expand Down Expand Up @@ -78,6 +77,10 @@ eth-utils==2.3.1
# py-evm
# rlp
# trie
exceptiongroup==1.2.0
# via
# hypothesis
# pytest
filelock==3.13.1
# via virtualenv
flake8==6.1.0
Expand Down Expand Up @@ -178,16 +181,23 @@ sortedcontainers==2.4.0
# trie
tabulate==0.9.0
# via -r requirements.in
titanoboa[forking-recommended]==0.1.8
titanoboa[forking-recommended] @ git+https://github.com/vyperlang/titanoboa
# via -r requirements.in
tomli==2.0.1
# via
# -r requirements.in
# titanoboa
# black
# build
# pip-tools
# pyproject-hooks
# pytest
toolz==0.12.0
# via cytoolz
trie==2.2.0
# via py-evm
typing-extensions==4.8.0
# via eth-typing
# via
# black
# eth-typing
ujson==5.8.0
# via titanoboa
urllib3==2.1.0
Expand Down
11 changes: 4 additions & 7 deletions scripts/boa_scripts/set_up_registries.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,19 +43,16 @@ def set_up_registries(
boa.env.eoa = Account.from_key(os.environ[account])

data = next(
(
data
for _network, data in deploy_utils.curve_dao_network_settings.items()
if _network in network
),
None,
data
for _network, data in deploy_utils.curve_dao_network_settings.items()
if _network in network
)

owner = data.dao_ownership_contract
fee_receiver = data.fee_receiver_address
address_provider = Contract(data.address_provider)
assert owner, f"Curve's DAO contracts may not be on {network}."
assert fee_receiver, f"Curve's DAO contracts may not be on {network}."
address_provider = Contract(data.address_provider)

# -------------------------- Register into AddressProvider --------------------------

Expand Down
244 changes: 116 additions & 128 deletions tests/fixtures/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,141 +5,129 @@

@pytest.fixture(scope="module")
def base_pools():
base_pool_data = {}
base_pool_data["tripool"] = {
"pool": "0xbEbc44782C7dB0a1A60Cb6fe97d0b483032FF1C7",
"lp_token": "0x6c3F90f043a72FA612cbac8115EE7e52BDe6E490",
"num_coins": 3,
"is_legacy": False,
"is_lending": False,
"is_v2": False,
}

base_pool_data["fraxusdc"] = {
"pool": "0xdcef968d416a41cdac0ed8702fac8128a64241a2",
"lp_token": "0x3175df0976dfa876431c2e9ee6bc45b65d3473cc",
"num_coins": 2,
"is_legacy": False,
"is_lending": False,
"is_v2": False,
}

base_pool_data["sbtc"] = {
"pool": "0x7fC77b5c7614E1533320Ea6DDc2Eb61fa00A9714",
"lp_token": "0x075b1bb99792c9E1041bA13afEf80C91a1e70fB3",
"num_coins": 3,
"is_legacy": True,
"is_lending": False,
"is_v2": False,
return {
"tripool": {
"pool": "0xbEbc44782C7dB0a1A60Cb6fe97d0b483032FF1C7",
"lp_token": "0x6c3F90f043a72FA612cbac8115EE7e52BDe6E490",
"num_coins": 3,
"is_legacy": False,
"is_lending": False,
"is_v2": False,
},
"fraxusdc": {
"pool": "0xdcef968d416a41cdac0ed8702fac8128a64241a2",
"lp_token": "0x3175df0976dfa876431c2e9ee6bc45b65d3473cc",
"num_coins": 2,
"is_legacy": False,
"is_lending": False,
"is_v2": False,
},
"sbtc": {
"pool": "0x7fC77b5c7614E1533320Ea6DDc2Eb61fa00A9714",
"lp_token": "0x075b1bb99792c9E1041bA13afEf80C91a1e70fB3",
"num_coins": 3,
"is_legacy": True,
"is_lending": False,
"is_v2": False,
},
}

return base_pool_data


@pytest.fixture(scope="module")
def crypto_registry_pools(base_pools):
pool_data = {}
pool_data["tricrypto2"] = {
"pool": "0xD51a44d3FaE010294C616388b506AcdA1bfAAE46",
"lp_token": "0xc4AD29ba4B3c580e6D59105FFf484999997675Ff",
"gauge": "0xDeFd8FdD20e0f34115C7018CCfb655796F6B2168",
"zap": "0x3993d34e7e99Abf6B6f367309975d1360222D446",
"num_coins": 3,
"name": "tricrypto2",
"base_pool": ZERO_ADDRESS,
"has_positive_rebasing_tokens": False,
}

pool_data["eurt3crv"] = {
"pool": "0x9838eccc42659fa8aa7daf2ad134b53984c9427b",
"lp_token": "0x3b6831c0077a1e44ed0a21841c3bc4dc11bce833",
"gauge": "0x4Fd86Ce7Ecea88F7E0aA78DC12625996Fb3a04bC",
"zap": "0x5D0F47B32fDd343BfA74cE221808e2abE4A53827",
"num_coins": 2,
"name": "eurtusd",
"base_pool": base_pools["tripool"]["pool"],
"has_positive_rebasing_tokens": False,
}

pool_data["eursusdc"] = {
"pool": "0x98a7F18d4E56Cfe84E3D081B40001B3d5bD3eB8B",
"lp_token": "0x3D229E1B4faab62F621eF2F6A610961f7BD7b23B",
"gauge": "0x65CA7Dc5CB661fC58De57B1E1aF404649a27AD35",
"zap": ZERO_ADDRESS,
"num_coins": 2,
"name": "eursusd",
"base_pool": ZERO_ADDRESS,
"has_positive_rebasing_tokens": False,
}

pool_data["crveth"] = {
"pool": "0x8301AE4fc9c624d1D396cbDAa1ed877821D7C511",
"lp_token": "0xEd4064f376cB8d68F770FB1Ff088a3d0F3FF5c4d",
"gauge": "0x1cEBdB0856dd985fAe9b8fEa2262469360B8a3a6",
"zap": ZERO_ADDRESS,
"num_coins": 2,
"name": "crveth",
"base_pool": ZERO_ADDRESS,
"has_positive_rebasing_tokens": False,
}

pool_data["cvxeth"] = {
"pool": "0xB576491F1E6e5E62f1d8F26062Ee822B40B0E0d4",
"lp_token": "0x3A283D9c08E8b55966afb64C515f5143cf907611",
"gauge": "0x7E1444BA99dcdFfE8fBdb42C02F0005D14f13BE1",
"zap": ZERO_ADDRESS,
"num_coins": 2,
"name": "cvxeth",
"base_pool": ZERO_ADDRESS,
"has_positive_rebasing_tokens": False,
}

pool_data["xaut3crv"] = {
"pool": "0xAdCFcf9894335dC340f6Cd182aFA45999F45Fc44",
"lp_token": "0x8484673cA7BfF40F82B041916881aeA15ee84834",
"gauge": "0x1B3E14157ED33F60668f2103bCd5Db39a1573E5B",
"zap": "0xc5FA220347375ac4f91f9E4A4AAb362F22801504",
"num_coins": 2,
"name": "xaut3crv",
"base_pool": base_pools["tripool"]["pool"],
"has_positive_rebasing_tokens": False,
}

pool_data["spelleth"] = {
"pool": "0x98638FAcf9a3865cd033F36548713183f6996122",
"lp_token": "0x8282BD15dcA2EA2bDf24163E8f2781B30C43A2ef",
"gauge": "0x08380a4999Be1a958E2abbA07968d703C7A3027C",
"zap": ZERO_ADDRESS,
"num_coins": 2,
"name": "spelleth",
"base_pool": ZERO_ADDRESS,
"has_positive_rebasing_tokens": False,
}

pool_data["teth"] = {
"pool": "0x752eBeb79963cf0732E9c0fec72a49FD1DEfAEAC",
"lp_token": "0xCb08717451aaE9EF950a2524E33B6DCaBA60147B",
"gauge": "0x6070fBD4E608ee5391189E7205d70cc4A274c017",
"zap": ZERO_ADDRESS,
"num_coins": 2,
"name": "teth",
"base_pool": ZERO_ADDRESS,
"has_positive_rebasing_tokens": False,
}

pool_data["eurocusd"] = {
"pool": "0xE84f5b1582BA325fDf9cE6B0c1F087ccfC924e54",
"lp_token": "0x70fc957eb90e37af82acdbd12675699797745f68",
"gauge": "0x4329c8F09725c0e3b6884C1daB1771bcE17934F9",
"zap": "0xd446a98f88e1d053d1f64986e3ed083bb1ab7e5a",
"num_coins": 2,
"name": "eurocusd",
"base_pool": base_pools["tripool"]["pool"],
"has_positive_rebasing_tokens": False,
return {
"tricrypto2": {
"pool": "0xD51a44d3FaE010294C616388b506AcdA1bfAAE46",
"lp_token": "0xc4AD29ba4B3c580e6D59105FFf484999997675Ff",
"gauge": "0xDeFd8FdD20e0f34115C7018CCfb655796F6B2168",
"zap": "0x3993d34e7e99Abf6B6f367309975d1360222D446",
"num_coins": 3,
"name": "tricrypto2",
"base_pool": ZERO_ADDRESS,
"has_positive_rebasing_tokens": False,
},
"eurt3crv": {
"pool": "0x9838eccc42659fa8aa7daf2ad134b53984c9427b",
"lp_token": "0x3b6831c0077a1e44ed0a21841c3bc4dc11bce833",
"gauge": "0x4Fd86Ce7Ecea88F7E0aA78DC12625996Fb3a04bC",
"zap": "0x5D0F47B32fDd343BfA74cE221808e2abE4A53827",
"num_coins": 2,
"name": "eurtusd",
"base_pool": base_pools["tripool"]["pool"],
"has_positive_rebasing_tokens": False,
},
"eursusdc": {
"pool": "0x98a7F18d4E56Cfe84E3D081B40001B3d5bD3eB8B",
"lp_token": "0x3D229E1B4faab62F621eF2F6A610961f7BD7b23B",
"gauge": "0x65CA7Dc5CB661fC58De57B1E1aF404649a27AD35",
"zap": ZERO_ADDRESS,
"num_coins": 2,
"name": "eursusd",
"base_pool": ZERO_ADDRESS,
"has_positive_rebasing_tokens": False,
},
"crveth": {
"pool": "0x8301AE4fc9c624d1D396cbDAa1ed877821D7C511",
"lp_token": "0xEd4064f376cB8d68F770FB1Ff088a3d0F3FF5c4d",
"gauge": "0x1cEBdB0856dd985fAe9b8fEa2262469360B8a3a6",
"zap": ZERO_ADDRESS,
"num_coins": 2,
"name": "crveth",
"base_pool": ZERO_ADDRESS,
"has_positive_rebasing_tokens": False,
},
"cvxeth": {
"pool": "0xB576491F1E6e5E62f1d8F26062Ee822B40B0E0d4",
"lp_token": "0x3A283D9c08E8b55966afb64C515f5143cf907611",
"gauge": "0x7E1444BA99dcdFfE8fBdb42C02F0005D14f13BE1",
"zap": ZERO_ADDRESS,
"num_coins": 2,
"name": "cvxeth",
"base_pool": ZERO_ADDRESS,
"has_positive_rebasing_tokens": False,
},
"xaut3crv": {
"pool": "0xAdCFcf9894335dC340f6Cd182aFA45999F45Fc44",
"lp_token": "0x8484673cA7BfF40F82B041916881aeA15ee84834",
"gauge": "0x1B3E14157ED33F60668f2103bCd5Db39a1573E5B",
"zap": "0xc5FA220347375ac4f91f9E4A4AAb362F22801504",
"num_coins": 2,
"name": "xaut3crv",
"base_pool": base_pools["tripool"]["pool"],
"has_positive_rebasing_tokens": False,
},
"spelleth": {
"pool": "0x98638FAcf9a3865cd033F36548713183f6996122",
"lp_token": "0x8282BD15dcA2EA2bDf24163E8f2781B30C43A2ef",
"gauge": "0x08380a4999Be1a958E2abbA07968d703C7A3027C",
"zap": ZERO_ADDRESS,
"num_coins": 2,
"name": "spelleth",
"base_pool": ZERO_ADDRESS,
"has_positive_rebasing_tokens": False,
},
"teth": {
"pool": "0x752eBeb79963cf0732E9c0fec72a49FD1DEfAEAC",
"lp_token": "0xCb08717451aaE9EF950a2524E33B6DCaBA60147B",
"gauge": "0x6070fBD4E608ee5391189E7205d70cc4A274c017",
"zap": ZERO_ADDRESS,
"num_coins": 2,
"name": "teth",
"base_pool": ZERO_ADDRESS,
"has_positive_rebasing_tokens": False,
},
"eurocusd": {
"pool": "0xE84f5b1582BA325fDf9cE6B0c1F087ccfC924e54",
"lp_token": "0x70fc957eb90e37af82acdbd12675699797745f68",
"gauge": "0x4329c8F09725c0e3b6884C1daB1771bcE17934F9",
"zap": "0xd446a98f88e1d053d1f64986e3ed083bb1ab7e5a",
"num_coins": 2,
"name": "eurocusd",
"base_pool": base_pools["tripool"]["pool"],
"has_positive_rebasing_tokens": False,
},
}

return pool_data


@pytest.fixture(scope="module")
def max_coins():
Expand Down
Loading

0 comments on commit 1c7fce4

Please sign in to comment.