Skip to content

Add Soroban test-stablecoin with OpenZeppelin freeze support#56

Merged
alex-predicate merged 1 commit intomainfrom
feat/soroban-test-stablecoin-v2
Mar 25, 2026
Merged

Add Soroban test-stablecoin with OpenZeppelin freeze support#56
alex-predicate merged 1 commit intomainfrom
feat/soroban-test-stablecoin-v2

Conversation

@alex-predicate
Copy link
Copy Markdown
Contributor

Summary

  • Soroban token contract for validating the asset compliance flow (Track 1)
  • Built on OpenZeppelin Stellar Contracts 0.6.0 — audited FungibleToken, BlockList, FungibleBurnable, and AccessControl traits
  • SAC-compatible with 6 decimals, admin-controlled minting, and manager-role blocklist enforcement
  • soroban-sdk pinned to 23.5.3 for OZ 0.6.0 compatibility

Contract interface

Function Access Description
transfer, approve, allowance, balance, etc. Public Standard SEP-41 token ops (auto-provided by OZ)
mint(to, amount) Admin Create new tokens
block_user(user, operator) Manager Block account from all token operations
unblock_user(user, operator) Manager Restore account access
blocked(account) Public Check if account is blocked
burn(from, amount) Token holder Destroy tokens (blocked users cannot burn)

How to test

cd soroban && cargo test

15 tests covering constructor, mint, transfer, block/unblock, blocked-transfer, blocked-approve, transfer_from, burn, burn-from-blocked, non-admin-mint, and non-manager-block scenarios.

What's next

Track 2 (application compliance) — predicate-registry and predicate-client contracts — will come in a follow-up PR.

🤖 Generated with Claude Code

SAC-compatible Soroban token built on OpenZeppelin Stellar Contracts 0.6.0:
- FungibleToken with BlockList extension (blocks transfers, approvals, burns)
- FungibleBurnable for token destruction
- AccessControl with "manager" role for compliance admin
- 6 decimals, admin-controlled minting
- 15 tests covering token operations, block enforcement, and auth checks
- CI job for Soroban build, test, and fmt check

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown

@claude claude bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Code review skipped — your organization's overage spend limit has been reached.

Code review is billed via overage credits. To resume reviews, an organization admin can raise the monthly limit in Settings → Usage.

Once credits are available, reopen this pull request to trigger a review.

${{ runner.os }}-cargo-

- name: Build Soroban contracts
run: cd soroban && cargo build --release --target wasm32-unknown-unknown
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is unknown-unknown correct here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe so, I think we only want to make sure that the contract builds in this case

}
}

#[cfg(test)]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it a standard pattern to keep tests in the same file?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes

@alex-predicate alex-predicate merged commit 6869a6f into main Mar 25, 2026
4 checks passed
@alex-predicate alex-predicate deleted the feat/soroban-test-stablecoin-v2 branch March 25, 2026 08:31
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.

2 participants