Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Making Safe safer #373

Open
kongzii opened this issue Sep 2, 2024 · 2 comments
Open

Making Safe safer #373

kongzii opened this issue Sep 2, 2024 · 2 comments

Comments

@kongzii
Copy link
Contributor

kongzii commented Sep 2, 2024

Currently, we support Safe and its single-signed transactions (if only one signer is required). That works out of the box with PMAT. However, we would like to use Safe for safer storage of funds.

The problem is, with only one signer, anyone who gets to the private key can remove the Spending limit (plus maybe Spending limit transactions don't work on arbitrary contracts).

We should be able to use https://github.com/gnosisguild/zodiac-modifier-roles to create a role for the agent's account on Safe that will be allowed to only send a certain amount of xDai and only use the Reality's contract, for anything else, multiple signers from our team would be required.

@gabrielfior
Copy link
Contributor

gabrielfior commented Sep 2, 2024

A bit more context for my own understanding:
-> The function we want to complete via a Safe wallet is submitAnswer (link to contract). Calling this function involves sending with the transaction X amount of xDAI (we antecipate sending 10 xDAI per answer)
-> As described above, we want to use Zodiac's module and allow the EOA to spend <= 10 xDAI with transactions interacting with RealityETH contract.
-> I would suggest exploring Zodiad'c SDK for easier interaction - it seems that EtherWithinAllowance should be a good start (what is missing is the requirement to interact only with RealityEth's submitAnswer method).

@kongzii
Copy link
Contributor Author

kongzii commented Sep 3, 2024

Another (simpler) option would be:

  1. Have a single Safe with funds, Gnosis AI would be signers.
  2. Each agent would have a daily spending limit
  3. Before agent does something, it would withdraw required xDai from Safe to his wallet

However I still like the Zodiac Roles solution more, because

  1. This would be a single point of failure
  2. We couldn't track how Agent's balance changes over time (as we do with Replicator right now to see if it is losing money)

Just wanted to mention it, maybe it will be a good solution for something in the future..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants