This repository has been archived by the owner on Sep 19, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 61
Gnosis Safe Integration #274
Comments
Perhaps it is better to have a 2/3 (2 confirmations required to transfer funds) safe for a partner:
So if partner loses one of his private keys at least we can recover funds from a safe |
We could certainly propose it to our partners but fortunately this is all configurable from the Safe UI so we don't necessarily have to plan for this feature. |
This was referenced May 3, 2023
Closed
perhaps it makes more sense to do the following in case of a manual approval:
|
There is an API for this case |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
We can't fully rely on Uniswap's permit2 payouts for large rewards. Partners should be able to manually approve transactions for large rewards. We can intergrate Gnosis Safe for such cases.
We can add a
autoPayThreshold
parameter to the bot's config. IfautoPayThreshold
is set to100
, then if a payment reward amount <100$
then permit2 URL is generated (the same way the bot is making it now) else the bot should call gnosis safe API which creates a payout transaction.Each partner should have a 2/2 safe (2 signatures required to transfer funds from a particular safe):
How it works under the hood:
autoPayThreshold
autoPayThreshold
then the bot calls gnosis safe API and proposes a new safe transaction to transfer reward to a bounty hunter's address (example script to propose tx: https://github.com/rndquu/play-with-gnosis-safe/blob/main/js/proposeTx.ts)a) Finds all signed (by 2 parties: bot + admin) transactions from the Gnosis Safe via Gnosis Safe API
b) Packs them together to be used by the MultiSendCallOnly contract (so that we could send only 1 transaction for all payouts)
c) Relays a single meta transaction with all payouts via the gelato network. (gnosis safe has an API for transaction relaying but under the hood it simply uses the gelato network so I found it easier to work directly with the gelato SDK). Example script for relaying multiple safe transactions: https://github.com/rndquu/play-with-gnosis-safe/blob/main/js/relayMultipleTxs.ts
Notice that gas fees are paid by bounty hunters from their rewards in DAI. So for us it is completely free.
How it works from a bounty hunter's view:
How it works from a partner's view:
In the end we should add 2 parameters to the bot's config:
autoPayThreshold
: threshold in dollars after which the bot should generate gnosis safe transactions intead of permit2 URLssafeAddress
: partner's safe addressHow to demo in polygon network:
git clone https://github.com/rndquu/play-with-gnosis-safe
.env
variables (DM me to get ready to use env variables for the polygon network)npx tsx js/proposeTx.ts
3 times. This will create 3 signed (by the bot's private key) proposals to transfer0.2
DAI (minus gelato fees) to a bounty hunter's address0xB52e2e8ED4C4B57ddD41FA5b62e721b90e77A36b
npx tsx js/relayMultipleTxs.ts
The text was updated successfully, but these errors were encountered: