Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add weth decoder for all supported evm chains
- Loading branch information
Showing
10 changed files
with
557 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import typing | ||
from typing import Final | ||
|
||
from rotkehlchen.constants.assets import A_WETH, A_WETH_ARB, A_WETH_BASE, A_WETH_OPT, A_WETH_SCROLL | ||
from rotkehlchen.types import SUPPORTED_CHAIN_IDS, ChainID | ||
|
||
CPT_WETH: Final = 'weth' | ||
CHAINS_WITHOUT_NATIVE_ETH: Final = {ChainID.GNOSIS, ChainID.POLYGON_POS} | ||
CHAIN_ID_TO_WETH_MAPPING: Final = { | ||
# A mapping from chain id to WETH asset for every supported evm chain except Gnosis | ||
ChainID.ETHEREUM: A_WETH, | ||
ChainID.ARBITRUM_ONE: A_WETH_ARB, | ||
ChainID.OPTIMISM: A_WETH_OPT, | ||
ChainID.SCROLL: A_WETH_SCROLL, | ||
ChainID.BASE: A_WETH_BASE, | ||
} | ||
|
||
# Make sure the CHAIN_ID_TO_WETH_MAPPING has all supported EVM chains with native ETH | ||
assert ( | ||
set(CHAIN_ID_TO_WETH_MAPPING.keys()) == | ||
set(typing.get_args(SUPPORTED_CHAIN_IDS)) - CHAINS_WITHOUT_NATIVE_ETH | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Oops, something went wrong.