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

Add multicall support to contracts #1091

Merged
merged 13 commits into from
Dec 2, 2022
Merged

Add multicall support to contracts #1091

merged 13 commits into from
Dec 2, 2022

Conversation

area
Copy link
Member

@area area commented Sep 23, 2022

Closes #1058

This PR adds Multicall support to colony contracts - currently just to Colony and ColonyNetwork, but will be added to extensions as well. Looking for a review, but not a merge, at this point.

The multicall functionality allows a single transaction to call multiple functions on the same contract, assuming that all the parameters are know at the time of the call. So, for example, this wouldn't be appropriate for creating an expenditure, and then editing it, because the id of the expenditure is not known at the time of the transaction.

The multicall implementation is from Uniswap, though I've changed it. I've removed payable, to stop us tripping ourselves up in the future.

It also required some changing to allow compatability with metatransactions, which with the default implementation wouldn't work as expected. That's where I'm most interested in getting feedback - as with anything related to metatransactions, that needs to be considered very carefully and has to be right otherwise there will be a lot of problems.

Some changes were also required on the metatransaction broadcaster, as we don't want calls that we otherwise wouldn't pay for being allowed just because they're wrapped inside a multicall (i.e. we don't want to just pay for all multicalls).

@area area force-pushed the feat/multicall branch 2 times, most recently from 7ca84d2 to 71f2800 Compare September 30, 2022 15:37
@area area force-pushed the feat/multicall branch 5 times, most recently from 5ff012b to 52e18fd Compare October 12, 2022 12:25
@area area marked this pull request as draft October 13, 2022 11:25
@area area mentioned this pull request Oct 19, 2022
@kronosapiens
Copy link
Member

@area is this still a draft?

@area area marked this pull request as ready for review October 25, 2022 10:34
@area area force-pushed the feat/multicall branch 7 times, most recently from 0295942 to a9e4452 Compare October 27, 2022 14:12
@area
Copy link
Member Author

area commented Oct 28, 2022

I still don't want this merged quite yet, but good for reviewing.

contracts/colony/Colony.sol Outdated Show resolved Hide resolved
contracts/common/Multicall.sol Outdated Show resolved Hide resolved
test/packages/metaTransactionBroadcaster.js Outdated Show resolved Hide resolved
kronosapiens
kronosapiens previously approved these changes Nov 21, 2022
Copy link
Member

@kronosapiens kronosapiens left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

kronosapiens
kronosapiens previously approved these changes Nov 24, 2022
@kronosapiens kronosapiens merged commit 60a8150 into develop Dec 2, 2022
@kronosapiens kronosapiens deleted the feat/multicall branch December 2, 2022 18:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Investigate colony creation bundling
2 participants