-
-
Notifications
You must be signed in to change notification settings - Fork 493
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7933 from LefterisJP/eigenlayer_airdrop
Decode eigenlayer airdrop claim event
- Loading branch information
Showing
9 changed files
with
172 additions
and
26 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
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
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
Empty file.
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,3 @@ | ||
from typing import Final | ||
|
||
CLIQUE_CLAIMED: Final = b'\xd8\x13\x8f\x8a?7|RY\xcaT\x8ep\xe4\xc2\xde\x94\xf1)\xf5\xa1\x106\xa1[iQ<\xba+Bj' # noqa: E501 |
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,27 @@ | ||
from abc import ABC | ||
|
||
from rotkehlchen.chain.ethereum.utils import token_normalized_value_decimals | ||
from rotkehlchen.chain.evm.decoding.clique.constants import CLIQUE_CLAIMED | ||
from rotkehlchen.chain.evm.decoding.interfaces import DecoderInterface | ||
from rotkehlchen.chain.evm.decoding.structures import DecoderContext | ||
from rotkehlchen.fval import FVal | ||
from rotkehlchen.types import ChecksumEvmAddress | ||
from rotkehlchen.utils.misc import hex_or_bytes_to_address, hex_or_bytes_to_int | ||
|
||
|
||
class CliqueAirdropDecoderInterface(DecoderInterface, ABC): | ||
"""Decoders of protocols using clique airdrop claim""" | ||
|
||
def _decode_claim(self, context: DecoderContext) -> tuple[ChecksumEvmAddress, FVal] | None: | ||
"""Just decode the claim part of a clique claim and return the amount and address""" | ||
if context.tx_log.topics[0] != CLIQUE_CLAIMED: | ||
return None | ||
|
||
if not self.base.is_tracked(claiming_address := hex_or_bytes_to_address(context.tx_log.topics[1])): # noqa: E501 | ||
return None | ||
|
||
claimed_amount = token_normalized_value_decimals( | ||
token_amount=hex_or_bytes_to_int(context.tx_log.data), | ||
token_decimals=18, # both omni and eigen have 18 decimals | ||
) | ||
return claiming_address, claimed_amount |
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