Skip to content

Commit

Permalink
Add pctToTreasuryInBasisPoints and minimumMessagevalue to communicati…
Browse files Browse the repository at this point in the history
…on contract (#577)
  • Loading branch information
kongzii authored Jan 8, 2025
1 parent 78b9569 commit 8fc5154
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
16 changes: 15 additions & 1 deletion prediction_market_agent_tooling/tools/contract.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,20 @@
TxParams,
TxReceipt,
Wei,
xDai,
)
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,
send_function_on_contract_tx_using_safe,
wei_to_xdai,
)


Expand Down Expand Up @@ -548,6 +554,14 @@ class AgentCommunicationContract(ContractOnGnosisChain):
"0xd422e0059ed819e8d792af936da206878188e34f"
)

def minimum_message_value(self, web3: Web3 | None = None) -> xDai:
value: Wei = self.call("minimumValueForSendingMessageInWei", web3=web3)
return wei_to_xdai(value)

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 8fc5154

Please sign in to comment.