Skip to content

Add generic ContractInterface impl for contracts that use only one root ComposableState #2

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

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

nemonical
Copy link

@nemonical nemonical commented May 13, 2025

this PR resolves #1

@CLAassistant
Copy link

CLAassistant commented May 13, 2025

CLA assistant check
All committers have signed the CLA.

@nemonical nemonical force-pushed the nemonical-generic-contract-interface-impl branch from f3aca70 to be054c7 Compare May 13, 2025 16:13
@nemonical nemonical force-pushed the nemonical-generic-contract-interface-impl branch from be054c7 to f5573f2 Compare May 13, 2025 16:15
@sanity
Copy link
Contributor

sanity commented May 14, 2025

It doesn't hurt to support contracts that are a single ComposableState, however the purpose of ComposableState is to allow more complex states to be built up out of composable components - which is why this wasn't previously supported.

@nemonical
Copy link
Author

however the purpose of ComposableState is to allow more complex states to be built up out of composable components

  • I imagined that this would be done in a hierarchical way, so one particular ComposableState contains more ComposableStates. This way you could leverage this kind of a system to reduce boilerplate while allowing any level of complexity. Is this not what you were imagining?
  • I suppose you could also build a contract that is a list of ComposableStates, though this could also be done with a Pair type which is just two ComposableStates in a trenchcoat or something similar.
  • Would it be reasonable to be able to #[derive(ContractInterface)] on types constructed purely from ComposableStates?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add generic ContractInterface implementation for contracts built from only ComposableState
3 participants