Skip to content

Commit

Permalink
Bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
shahthepro committed Nov 7, 2023
1 parent c4b10de commit 221e4e2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
1 change: 1 addition & 0 deletions eagleproject/core/blockchain/addresses.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
AUSDC = "0xbcca60bb61934080951369a648fb03df4f96263c"
AUSDT = "0x3ed3b47dd13ec9a98b44e6204a523e766b225811"
LINK = "0x514910771af9ca656af840dff83e8264ecf986ca"
CVX = "0x4e3fbd56cd56c3e72c1403e103b45db9da5b9d2b"

THREEPOOL = "0x6c3f90f043a72fa612cbac8115ee7e52bde6e490"

Expand Down
18 changes: 12 additions & 6 deletions eagleproject/notify/triggers/buyback_swap.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@

from core.blockchain.const import OETH_BUYBACK_BLOCK

from core.blockchain.addresses import OGV, OGV_BUYBACK_LEGACY, OUSD_BUYBACK_PROXY, OETH_BUYBACK_PROXY, REWARDS_SOURCE, OUSD, CONTRACT_ADDR_TO_NAME
from core.blockchain.sigs import TRANSFER
from core.blockchain.addresses import OGV, OETH, OUSD, CVX, OGV_BUYBACK_LEGACY, OUSD_BUYBACK_PROXY, OETH_BUYBACK_PROXY, REWARDS_SOURCE, OUSD, CONTRACT_ADDR_TO_NAME
from core.blockchain.sigs import TRANSFER, SIG_EVENT_OTOKEN_BUYBACK
from core.common import format_token_human
from notify.events import event_low


def get_legacy_events(logs):
""" Get events """
return logs.filter(
Expand All @@ -31,12 +30,19 @@ def get_swap_events(logs):

def run_trigger(new_logs):
""" Template trigger """

if len(new_logs) <= 0:
return []

events = []
block_number = new_logs[0].block_number

if ev.block_number > OETH_BUYBACK_BLOCK:
if block_number > OETH_BUYBACK_BLOCK:
for ev in get_swap_events(new_logs):
(otoken, dest_token, amount_in, amount_out) = decode_single(
"(address,address,uint256,uint256)",
otoken = decode_single("(address)", decode_hex(ev.topic_1))[0]
dest_token = decode_single("(address)", decode_hex(ev.topic_2))[0]
(amount_in, amount_out) = decode_single(
"(uint256,uint256)",
decode_hex(ev.data)
)

Expand Down

0 comments on commit 221e4e2

Please sign in to comment.