Skip to content
This repository was archived by the owner on Apr 14, 2026. It is now read-only.

Commit 7d558f1

Browse files
committed
safer bribe approval accounting
1 parent f6cb020 commit 7d558f1

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

fee_allocator/fee_allocator.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
from web3 import Web3
1111
from dotenv import load_dotenv
1212
import json
13+
import math
1314

1415
from fee_allocator.accounting.chains import CorePoolChain, CorePoolRunConfig
1516
from fee_allocator.accounting.core_pools import PoolFee
@@ -327,11 +328,11 @@ def generate_bribe_payload(
327328
bribe_df = df[df["platform"].isin(["balancer", "aura"])]
328329
payment_df = df[df["platform"] == "payment"].iloc[0]
329330

330-
total_bribe_usdc = sum(bribe_df["amount"]) * 1e6
331+
total_bribe_usdc = sum(int(row["amount"] * 1e6) for _, row in bribe_df.iterrows())
331332
dao_fee_usdc = int(payment_df["amount"] * 1e6)
332333

333334
"""bribe txs"""
334-
usdc.approve(self.book["hidden_hand2/bribe_vault"], total_bribe_usdc)
335+
usdc.approve(self.book["hidden_hand2/bribe_vault"], total_bribe_usdc + 1) # 1 wei buffer
335336

336337
for _, row in bribe_df.iterrows():
337338
if int(row["amount"]) == 0:

0 commit comments

Comments
 (0)