feat: governor spoke is able to execute multiple transactions atomically#3703
Merged
mrice32 merged 7 commits intoUMAprotocol:masterfrom Dec 17, 2021
Merged
feat: governor spoke is able to execute multiple transactions atomically#3703mrice32 merged 7 commits intoUMAprotocol:masterfrom
mrice32 merged 7 commits intoUMAprotocol:masterfrom
Conversation
Signed-off-by: Matt Rice <matthewcrice32@gmail.com>
chrismaree
reviewed
Dec 16, 2021
| emit ExecutedGovernanceTransaction(to, inputData); | ||
| for (uint256 i = 0; i < calls.length; i++) { | ||
| (address to, bytes memory inputData) = (calls[i].to, calls[i].data); | ||
| require(_executeCall(to, inputData), "execute call failed"); |
Member
There was a problem hiding this comment.
this forces that everything in the batch either success or fails, thereby making this atomic. nice.
chrismaree
reviewed
Dec 16, 2021
chrismaree
reviewed
Dec 16, 2021
| let targetAddress = addressWhitelist.options.address; | ||
| let inputDataBytes = addressWhitelist.methods.addToWhitelist(messenger).encodeABI(); | ||
| let messageBytes = web3.eth.abi.encodeParameters(["address", "bytes"], [targetAddress, inputDataBytes]); | ||
| const calls = [ |
Member
There was a problem hiding this comment.
this is really not too bad! having to do the web3.eth.abi.encodeParameters on this array of objects (struct) is a bit painful but nothing we cant abstract away in a script :)
Co-authored-by: Chris Maree <christopher.maree@gmail.com>
Signed-off-by: Matt Rice <matthewcrice32@gmail.com>
This file contains hidden or 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
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.
Motivation
The
GovernorSpokecontract should be able to execute multiple transactions atomically keep the Governance system from losing control of the sequencing of important actions.Summary
This adds a more complex structure for cross-chain messages so that they can contain multiple transactions rather than one.
Testing
Check a box to describe how you tested these changes and list the steps for reviewers to test.
Issue(s)
N/A