Skip to content

Conversation

@jsmaxi
Copy link
Contributor

@jsmaxi jsmaxi commented Nov 5, 2025

Fixes #225

Added ownable where it made sense.

Some examples use the access_control module instead of ownable, which I think is fine.


Notes

  • Combining ownable with pausable is not very elegant in practice. For example:
fn pause(e: &Env, caller: Address) {
    let owner: Address = enforce_owner_auth(e);
    if owner != caller {
        panic_with_error!(e, ExampleContractError::Unauthorized);
    }

    pausable::pause(e);
}
  • In the vault example, ownable was added, but it isn’t actually used to authorize functions, just included for demonstration purposes.

  • I didn’t touch the upgradeable contract examples, since you may want to keep their current wasm unchanged.

  • I’ve also added examples/DEPLOY.md, which contains sample Stellar CLI deploy commands for the example contracts.

PR Checklist

  • Tests - tests are passing, though no new tests have been added.
  • Documentation - documentation appears to have been moved to another repository.

Looking forward to your review and suggestions.

@codecov
Copy link

codecov bot commented Nov 5, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.72%. Comparing base (372a162) to head (5d3e911).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #487   +/-   ##
=======================================
  Coverage   94.72%   94.72%           
=======================================
  Files          74       74           
  Lines        5020     5020           
=======================================
  Hits         4755     4755           
  Misses        265      265           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

Use ownable in all examples

1 participant