diff --git a/main.py b/main.py index ba46254..c231c64 100644 --- a/main.py +++ b/main.py @@ -5,6 +5,7 @@ import logging from dotenv import load_dotenv from web3 import Web3 +from eth_abi.abi import decode from aiogram import types, Bot from aiogram.utils.keyboard import InlineKeyboardBuilder @@ -83,8 +84,9 @@ class EventBot: bond_id = int(log["topics"][1].hex(), 16) button_url += str(bond_id) elif event_name == "ProposalCreated": - proposal_id = int(log["topics"][1].hex(), 16) - button_url += str(proposal_id) + decoded_data = log.get("data", b"") + proposal_id = decode(['uint256'], decoded_data[:32])[0] + button_url += f"0x{proposal_id:x}" button.add(types.InlineKeyboardButton( text=msgs["button_text"],