-
Notifications
You must be signed in to change notification settings - Fork 36
feat: tansu-DAO-gated registry manager contract #518
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
Closed
Closed
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
acbbc3d
feat: tansu-DAO-gated registry manager contract
willemneal 7d45513
feat(registry-tansu-manager): replay protection + review polish
willemneal e49940f
refactor(registry-tansu-manager): use soroban-sdk-tools typed storage
willemneal 41f5460
feat: hello example + tansu-stub + testnet e2e script
willemneal 0d32ccf
fix(clippy): satisfy pedantic ruleset (needless_pass_by_value)
willemneal 4a7a778
correct comments about `network alias`
chadoh 8e6bffa
refactor(registry-tansu-manager): use import_contract_client!(tansu_s…
willemneal 00f048e
test: add real-Tansu testnet e2e (two-phase, 24h voting gap)
willemneal 2fbc36a
fix(ci): mark tansu-stub as a contract dep so topo sort builds it bef…
willemneal f7ae8f1
docs(e2e): add Stellar Expert link for live Tansu + clarify collatera…
willemneal 80dea71
fix: cargo clippy --all --fix
chadoh 78c4896
checkpoint: no-op proxy design before __check_auth refactor
willemneal 9abd46f
refactor(registry-tansu-manager): switch to manager.trigger + authori…
willemneal 15d5fee
test: update e2e-testnet.sh + tansu-stub to drive trigger flow
willemneal File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| [package] | ||
| name = "hello" | ||
| description = "Hello world example contract used by the registry-tansu-manager e2e script." | ||
| version = "0.1.0" | ||
| license = "Apache-2.0" | ||
| edition = "2021" | ||
| publish = false | ||
|
|
||
| [lib] | ||
| crate-type = ["cdylib"] | ||
| doctest = false | ||
|
|
||
| [dependencies] | ||
| soroban-sdk = { workspace = true } | ||
|
|
||
| [dev-dependencies] | ||
| soroban-sdk = { workspace = true, features = ["testutils"] } | ||
|
|
||
| [package.metadata.stellar] | ||
| cargo_inherit = true |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| #![no_std] | ||
|
|
||
| use soroban_sdk::{contract, contractimpl, Address, Env, String}; | ||
|
|
||
| #[contract] | ||
| pub struct Hello; | ||
|
|
||
| #[contractimpl] | ||
| impl Hello { | ||
| pub fn __constructor(env: &Env, admin: &Address) { | ||
| env.storage().instance().set(&"admin", admin); | ||
| } | ||
|
|
||
| pub fn admin(env: &Env) -> Address { | ||
| env.storage().instance().get(&"admin").unwrap() | ||
| } | ||
|
|
||
| pub fn hello(_env: &Env, to: String) -> String { | ||
| to | ||
| } | ||
| } | ||
|
|
||
| #[cfg(test)] | ||
| mod test { | ||
| use super::*; | ||
| use soroban_sdk::testutils::Address as _; | ||
|
|
||
| #[test] | ||
| fn hello_echoes() { | ||
| let env = Env::default(); | ||
| let admin = Address::generate(&env); | ||
| let id = env.register(Hello, (admin.clone(),)); | ||
| let c = HelloClient::new(&env, &id); | ||
| assert_eq!( | ||
| c.hello(&String::from_str(&env, "world")), | ||
| String::from_str(&env, "world") | ||
| ); | ||
| assert_eq!(c.admin(), admin); | ||
| } | ||
| } |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| [package] | ||
| name = "registry-tansu-manager" | ||
| description = "Tansu-DAO-gated manager for the stellar registry." | ||
| version = "0.1.0" | ||
| license = "Apache-2.0" | ||
| edition = "2021" | ||
| publish = false | ||
| repository = "https://github.com/theahaco/scaffold-stellar/tree/main/contracts/registry-tansu-manager" | ||
|
|
||
| [lib] | ||
| crate-type = ["cdylib"] | ||
| doctest = false | ||
|
|
||
| [dependencies] | ||
| soroban-sdk = { workspace = true } | ||
| soroban-sdk-tools = "0.1.2" | ||
| stellar-registry = { workspace = true } | ||
| # Build-order signal so `stellar scaffold build` produces `tansu_stub.wasm` | ||
| # before this crate compiles `import_contract_client!(tansu_stub)`. The stub | ||
| # is the single source of truth for the Tansu proposal types — pattern mirrors | ||
| # `contracts/registry`'s dev-dep on `hello_world`. | ||
| tansu-stub = { path = "../test/tansu-stub" } | ||
|
|
||
| [dev-dependencies] | ||
| soroban-sdk = { workspace = true, features = ["testutils"] } | ||
| soroban-sdk-tools = { version = "0.1.2", features = ["testutils"] } | ||
|
|
||
| [package.metadata.stellar] | ||
| cargo_inherit = true |
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems weird to me that we can't list
contracts/*here. It makes me wonder if there's a more natural place to put these new tests, and everything incontracts/test/*.But also w/e ¯\_(ツ)_/¯
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The issue is that
contracts/*will fail on thecontracts/tests/*because that folder doesn't have a Cargo.toml. I do agree we need to move the hello to the test folder.