contracts-wizard icon indicating copy to clipboard operation
contracts-wizard copied to clipboard

Suggestion: add UI toggle for `default_impl` attribute in contract generation

Open jsmaxi opened this issue 2 months ago • 2 comments

Currently, the OpenZeppelin Wizard for Stellar (https://wizard.openzeppelin.com/stellar) generates contracts that use default_impl attribute to implement all trait functions, when possible.

Suggestion is to add a UI toggle to choose between:

  • Using the #[default_impl] attribute (could be the default option)
  • Generating explicit implementations of all trait functions

Example for Fungible Token: https://github.com/OpenZeppelin/stellar-contracts/blob/a5fada3912bc4744eea81db97ad3a0f8adda6099/examples/fungible-capped/src/contract.rs#L32

jsmaxi avatar Oct 27 '25 14:10 jsmaxi

Hi @jsmaxi thanks for reporting the issue, could you explain more your use case and the added benefit of adding the explicit implementation of all trait function?

CoveMB avatar Nov 10 '25 20:11 CoveMB

@CoveMB Thanks for checking.

This would be primarily for convenience to accommodate various user needs. I envision two main use cases:

  • Some users may want to inspect all available trait functions directly in the wizard UI to understand what's possible without diving into documentation or source code.

  • Others may want to override specific trait functions with custom behavior.

That said, I understand this could be a significant implementation effort. If you think the benefit doesn't justify the work involved, or this is not reasonable, I'm happy to close this issue or discuss alternatives.

jsmaxi avatar Nov 10 '25 20:11 jsmaxi