Skip to content

Commit

Permalink
Add pctToTreasuryInBasisPoints to communication contract
Browse files Browse the repository at this point in the history
  • Loading branch information
kongzii committed Jan 8, 2025
1 parent 78b9569 commit 6e9b3cd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
10 changes: 9 additions & 1 deletion prediction_market_agent_tooling/tools/contract.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@
)
from prediction_market_agent_tooling.tools.data_models import MessageContainer
from prediction_market_agent_tooling.tools.hexbytes_custom import HexBytes
from prediction_market_agent_tooling.tools.utils import DatetimeUTC, should_not_happen
from prediction_market_agent_tooling.tools.utils import (
BPS_CONSTANT,
DatetimeUTC,
should_not_happen,
)
from prediction_market_agent_tooling.tools.web3_utils import (
call_function_on_contract,
send_function_on_contract_tx,
Expand Down Expand Up @@ -548,6 +552,10 @@ class AgentCommunicationContract(ContractOnGnosisChain):
"0xd422e0059ed819e8d792af936da206878188e34f"
)

def ratio_given_to_treasury(self, web3: Web3 | None = None) -> float:
bps: int = self.call("pctToTreasuryInBasisPoints", web3=web3)
return bps / BPS_CONSTANT

def count_unseen_messages(
self,
agent_address: ChecksumAddress,
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "prediction-market-agent-tooling"
version = "0.57.9"
version = "0.57.10"
description = "Tools to benchmark, deploy and monitor prediction market agents."
authors = ["Gnosis"]
readme = "README.md"
Expand Down

0 comments on commit 6e9b3cd

Please sign in to comment.