Suggestion: add UI toggle for `default_impl` attribute in contract generation
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
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 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.