snapshot-labs / sx-monorepo

Snapshot monorepo
https://snapshot.box
MIT License
14 stars 12 forks source link

feat: add support for oSnap #467

Closed bonustrack closed 1 month ago

bonustrack commented 3 months ago

We should add support for oSnap in the UI. oSnap is an integration built by UMA on snapshot.org to execute transactions from Snapshot proposals. It uses UMA as an oracle to confirm onchain if a proposal pass. oSnap is a Safe module that works a bit like a Timelock contract, when a proposal pass, anyone can send a tx to start a challenge period, during the challenge period someone can challenge the proposal result and can stop execution using UMA resolution. You can learn more about it here: https://osnap.xyz

For this integration we need to allow space having oSnap to setup a proposal with execution. The execution is stored in the parameter "plugins" from the proposal. A space can have multiple oSnap Safe modules, on multiple chain. We should allow a proposal to have execution for multiple oSnap module / treasury.

Here is an example of space using oSnap: https://snapshot.org/#/cow.eth Here is a proposal using oSnap execution: https://snapshot.org/#/cow.eth/proposal/0x7456f84721dbbe164b30324112accf976ff3be397b1957e68abe6953801a1f97

The execution should be visible on the proposal page, similar to how SX-EVM executions are displayed.

With this integration it should also be possible to initiate tx to be populated in a proposal from the treasury page with the send, stake, walletconnect or transfer action.

Sekhmet commented 2 months ago

@bonustrack what features should be supported on SX-UI?

  1. Creating proposal with execution on oSnap
  2. Initiating execution by creating a bond.
  3. Executing transaction.

Anything else?

bonustrack commented 2 months ago

@Sekhmet That's it yes. There are others features that we will have to add, but it can be done later on within another PRs, these features are:

bonustrack commented 2 months ago

One thing that I didn't mention here and that would require some design is to display the treasury address or execution strategy name within the execution section of the proposal. I'll come up with a design for this, meanwhile you can just display name and address on top of the related execution txs

Sekhmet commented 2 months ago

@bonustrack I see that it's possible that there are multiple treasuries each having its own execution within single proposal with oSnap. Should we work on this task first to make it possible to use it? https://github.com/snapshot-labs/sx-monorepo/issues/138 I assume it will be needed.

bonustrack commented 2 months ago

@Sekhmet I think so

bonustrack commented 2 months ago

I think it should define not only the network but also the address executing the txs (the treasury)