-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Safesnap/Execution #3090
Closed
Closed
Safesnap/Execution #3090
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Space settings
In the space settings, safes and execution modules are defined. Each safe can have zero or more execution modules.
An execution module is a smart contract that is allowed to execute safe transactions, if the module's oracle approves.
If no module is configured, proposals can still have transactions attached, but execution can only happen manually via the safe. If no safes are configured, still transactions can be attached but there's no way to execute them via any UI (technically it's purely informational then).
Transaction builder
The new transaction builder is part of the proposal form (currently through Safesnap:
src/plugins/safeSnap/Create.vue
) and handles a single execution set, which can be a batch of batches of transactions (Transaction[x][y]
) or a single transaction (Transaction[0][0]
).This execution data is added to the proposal, for a specific safe (execution by multisig) or for a specific safe and execution module (oracle based).
Execution
The proposal page displays (
src/plugins/safeSnap/Proposal.vue
) each execution set and the relevant controls, based on the safe/module.The general process is always the same. Transactions are being proposed, disputed and executed (or rejected). The details of each of those steps depend on the oracle/module implementation.
Each module has a composable (e.g.
useExecutorUma.ts
) to handle logic and state and a UI component (ExecutionUma.vue
) to render the controls.New module types need to be added here.
Helpers
Interfaces and helper functions live in
src/helpers/safe.ts
(mostly execution) andsrc/helpers/transactionBuilder.ts
(validating/de-/encoding transaction data).ABIs
src/helpers/abi
contains some ABI related utilities (index.ts
), like loading ABIs from Etherscan, and a few known, JSON-formatted contract ABIs, such as ERC20 and 721.Full file list to review
src/plugins/safeSnap/
Create.vue
Proposal.vue
src/components/
ExecutionAbstract.vue
ExecutionManual.vue
ExecutionReality.vue
(wip)ExecutionUma.vue
(wip)ExecutionDisplayTransactions.vue
TransactionBuilder.vue
TransactionBuilderDisplayTransaction.vue
TransactionBuilderDisplayTransactionContract.vue
TransactionBuilderDisplayTransactionFunds.vue
TransactionBuilderDisplayTransactionNFT.vue
TransactionBuilderForm...
TransactionBuilderFormAddTransaction.vue
TransactionBuilderFormContract.vue
TransactionBuilderFormContractParams.vue
TransactionBuilderFormContractParamAddress.vue
TransactionBuilderFormContractParamArray.vue
TransactionBuilderFormContractParamBool.vue
TransactionBuilderFormContractParamBytes.vue
TransactionBuilderFormContractParamInt.vue
TransactionBuilderFormContractParamTuple.vue
TransactionBuilderFormFunds.vue
TransactionBuilderFormNFT.vue
src/composables/
useExecutorReality.ts
(wip)useExecutorUma.ts
(wip)useTransactionBuilder.ts
src/helpers/
abi/
transactionBuilder.ts
safe.ts
Execution criteria and choice-based execution
The ultimate decision making, if necessary, is a binary yes/no question in some form of on-chain dispute mechanism, based on whatever the Snapshot proposal defines as criteria. Multiple execution sets can define multiple criteria for different proposal outcomes. The oracle question is always: "Is the criteria for this set of transactions in this proposal met? Yes or no?"
Instead of just defining one set of transactions to either execute or not, you can define transactions e.g. for each choice, like different budget plans, and explain in human-readable but unambiguous language, when and when not to execute each set.
Execution criteria can also be formatted as JSON for custom automation and monitoring.
Moving to core
Most of the logic and templates was moved outside of the plugin directory. The Safesnap plugin in this current state is only really responsible for handling the space config and rendering a few components. This could all easily be moved entirely to "The Core" by simply not using the plugin system's component mounting mechanism, moving the config from
{ plugins: safeSnap: { configMappedFromDifferentLegacyFormatsToMostRecentOne } }
to{ execution: ExecutionData™ }
and extend the validation schemas in snapshot.js. We would then just add back the old Safesnap codebase and leave it untouched (which would make this PR also much less daunting when looking at "Files changed").Otherwise these two functions need to be implemented properly, making suere old proposal pages don't break.