Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: set contract name manually if it's the ETH address to avoid cont… #557

Merged
merged 1 commit into from
Jul 21, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions scripts/curve_apy_previews.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,15 @@ def _build_data(gauges):
# Sometimes the call returns the zero address instead of reverting. This means there is no coin with index i.
if coin_address == ZERO_ADDRESS:
continue

try:
c = Contract(coin_address)
pool_coins.append({"name": c.name(), "address": str(c)})
if coin_address == "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE":
name = "ETH"
else:
c = Contract(coin_address)
name = c.name()

pool_coins.append({"name": name, "address": coin_address})
except (ContractNotFound, ContractNotVerified, ValueError, AttributeError) as e:
pool_coins.append({"address": coin_address, "error": str(e)})
logger.error(f"error for coins({i}) for pool {str(gauge.pool)}")
Expand Down
Loading