Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: "docs workflow"

on:
push:
branches:
- main
paths:
- "packages/tokens/src/confidential/**"
- ".github/workflows/docs.yml"
pull_request:
paths:
- "packages/tokens/src/confidential/**"
- ".github/workflows/docs.yml"
workflow_dispatch:

permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
check-links:
runs-on: ubuntu-latest
steps:
- name: git checkout
uses: actions/checkout@v4
with:
persist-credentials: false

- name: collect code citations
working-directory: packages/tokens/src/confidential
run: |
grep -rhoE '(\.\./)*docs/[A-Za-z0-9_./-]+\.md(#[A-Za-z0-9_-]+)?' --include='*.rs' --include='*.nr' --include='CLAUDE.md' . \
| sed -E 's|^(\.\./)+||' | sort -u | sed -E 's|.*|[&](/&)|' > "$RUNNER_TEMP/citations.md"

- name: check documentation references
uses: lycheeverse/lychee-action@v2
with:
lycheeVersion: v0.24.2
args: --offline --include-fragments --no-progress --root-dir ${{ github.workspace }}/packages/tokens/src/confidential 'packages/tokens/src/confidential/**/*.md' ${{ runner.temp }}/citations.md
14 changes: 12 additions & 2 deletions Architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ This design makes it **impossible** to implement conflicting extensions:
```rust
// ✅ This works - using Enumerable
impl NonFungibleToken for MyContract {
type ContractType = Enumerable;
type ContractType = Compose<(Enumerable,)>;
// ... implementations
}
impl NonFungibleEnumerable for MyContract {
Expand Down Expand Up @@ -199,7 +199,17 @@ pub struct MyToken;

#[contractimpl(contracttrait)]
impl FungibleToken for MyToken {
type ContractType = Base;
// From a type-safety perspective there are two kinds of extensions:
// *overriding* ones change the base behavior and compete for the single
// `ContractType` slot, so `Compose` must resolve them; *additive* ones
// (e.g. `Burnable`) change nothing and override nothing. Listing an
// additive extension in `Compose` serves no type-safety purpose: the
// entry is ignored by the resolution, and the extension is enabled by
// implementing its trait, listed or not. Listing them is made optional
// purely to unify the developer experience: developers can list every
// extension they use and never have to figure out which ones are
// additive and which ones are overriding.
type ContractType = Compose<(Base,)>;
// The macro fills in every method body, no manual overrides needed.
// Alternatively, custom overrides can be provided here (optional)
}
Expand Down
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ members = [
exclude = [
"examples/upgradeable/testdata",
"examples/rwa/sign-claim", # native CLI tool, not a WASM contract
"bench/rwa-batch", # cost benchmark, run on demand only
]

[workspace.package]
Expand Down
Loading
Loading