fix for the proposal id parsing

Signed-off-by: Uncle Stretch <uncle.stretch@ghostchain.io>
This commit is contained in:
Uncle Stretch 2026-04-13 19:05:51 +03:00
parent 564cf0dd5c
commit c37f8da040
Signed by: str3tch
GPG Key ID: 84F3190747EE79AA

View File

@ -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"],