Add composition example in playground - #22
Draft
czepluch wants to merge 3 commits into
Draft
Conversation
czepluch
force-pushed
the
composition-example
branch
from
August 24, 2026 20:29
87e3b6f to
fc55512
Compare
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.
Adds a composition example: three deployable vaults sharing one engine module.
Sender context (direct call, or recovered from a secp256k1 signature) and fee policy (flat, basis points, or two policies stacked) are traits with per-type impls, composed by a generic
settlefunction. With exactly one impl per trait and type there is nothing to disambiguate: nooverride(...)lists, nosuperchains, no linearization.Motivation: 0x-settler's
MainnetSettlerIntent, a mainnet contract whose entire body is elevenreturn super.f(...)overrides disambiguating an inheritance diamond, under the in-source comment "Solidity inheritance is stupid". This example doesn't cover everything 0x-settler does. It just shows how a comparable structure can be built without inheritance, so the diamond problem can't come up in the first place.All three contracts are runtime-tested on both backends, including deployment with a constructor argument and on-chain recovery of a real signature.