Skip to content

Commit

Permalink
chore: filter token that are not addreses in token list
Browse files Browse the repository at this point in the history
  • Loading branch information
cbrzn committed Apr 23, 2024
1 parent eed7484 commit e0a2b1a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion autotx/utils/ethereum/lifi/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def get_quote_to_amount( # type: ignore
_from: ETHAddress,
chain: ChainId,
slippage: float,
) -> dict[str, Any]:
) -> dict[str, Any]:
params: dict[str, Any] = {
"fromToken": from_token.hex,
"toToken": to_token.hex,
Expand Down
3 changes: 1 addition & 2 deletions autotx/utils/ethereum/lifi/swap.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,8 @@ def get_quote(
"to": quote["transactionRequest"]["to"],
"from": quote["transactionRequest"]["from"],
"data": quote["transactionRequest"]["data"],
"data": quote["transactionRequest"]["gasPrice"],
"gas": quote["transactionRequest"]["gasLimit"],
"gasPrice": quote["transactionRequest"]["gasPrice"],
"gas": quote["transactionRequest"]["gasLimit"],
"value": Wei(int(quote["transactionRequest"]["value"], 0)),
"chainId": quote["transactionRequest"]["chainId"]
}
Expand Down
2 changes: 1 addition & 1 deletion autotx/utils/ethereum/networks.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def fetch_tokens_for_chain(self, chain_id: int) -> dict[str, str]:
return {
cast(str, token["symbol"]).lower(): Web3.to_checksum_address(cast(str, token["address"]))
for token in token_list
if token["chainId"] == chain_id
if token["chainId"] == chain_id and Web3.is_checksum_address(cast(str, token["address"]))
}


Expand Down

0 comments on commit e0a2b1a

Please sign in to comment.