From 0ad485b70261f3d29d1da489598d975ea2ecbe43 Mon Sep 17 00:00:00 2001 From: brozorec <9572072+brozorec@users.noreply.github.com> Date: Tue, 27 Jan 2026 12:19:20 +0100 Subject: [PATCH 1/6] refactor for 0.6.0 --- .changeset/pink-eyes-judge.md | 12 + .../common/src/ai/descriptions/stellar.ts | 2 +- packages/core/stellar/src/add-pausable.ts | 1 - packages/core/stellar/src/contract.test.ts.md | 26 +- .../core/stellar/src/contract.test.ts.snap | Bin 774 -> 775 bytes packages/core/stellar/src/fungible.test.ts.md | 237 ++++++------ .../core/stellar/src/fungible.test.ts.snap | Bin 1709 -> 1707 bytes packages/core/stellar/src/fungible.ts | 24 +- .../core/stellar/src/non-fungible.test.ts.md | 190 ++++------ .../stellar/src/non-fungible.test.ts.snap | Bin 1918 -> 1900 bytes packages/core/stellar/src/non-fungible.ts | 15 +- .../core/stellar/src/set-access-control.ts | 26 +- .../core/stellar/src/stablecoin.test.ts.md | 345 +++++++++--------- .../core/stellar/src/stablecoin.test.ts.snap | Bin 2208 -> 2198 bytes packages/core/stellar/src/utils/version.ts | 6 +- .../stellar/src/zip-rust.compile.test.ts.md | 45 ++- .../stellar/src/zip-rust.compile.test.ts.snap | Bin 1892 -> 1890 bytes .../stellar/TraitImplementationSection.svelte | 9 +- 18 files changed, 454 insertions(+), 484 deletions(-) create mode 100644 .changeset/pink-eyes-judge.md diff --git a/.changeset/pink-eyes-judge.md b/.changeset/pink-eyes-judge.md new file mode 100644 index 000000000..81a6606d2 --- /dev/null +++ b/.changeset/pink-eyes-judge.md @@ -0,0 +1,12 @@ +--- +'@openzeppelin/wizard-stellar': minor +'@openzeppelin/wizard-common': minor +--- + +Refactor Stellar contracts to match the latest v0.6.0 + - **Breaking changes**: + - Use OpenZeppelin Stellar Soroban Contracts v0.6.0 + - Use `MuxedAddress` for fungible transfer function + - Change order of parameters in access control + +Change default fungible decimals to 7 diff --git a/packages/common/src/ai/descriptions/stellar.ts b/packages/common/src/ai/descriptions/stellar.ts index cc151bcc2..3a0c7fd49 100644 --- a/packages/common/src/ai/descriptions/stellar.ts +++ b/packages/common/src/ai/descriptions/stellar.ts @@ -13,7 +13,7 @@ export const stellarCommonDescriptions = { access: 'The type of access control to provision. Ownable is a simple mechanism with a single account authorized for all privileged actions. Roles is a flexible mechanism with a separate role for each privileged action. A role can have many authorized accounts.', explicitImplementations: - 'Whether the contract should use explicit trait implementations instead of using the #[default_impl] macro to auto-generate trait method bodies.', + 'Whether the contract should use explicit trait implementations instead of using the default ones provided by the library.', }; export const stellarFungibleDescriptions = { diff --git a/packages/core/stellar/src/add-pausable.ts b/packages/core/stellar/src/add-pausable.ts index d5cf968fd..0ac7fedb2 100644 --- a/packages/core/stellar/src/add-pausable.ts +++ b/packages/core/stellar/src/add-pausable.ts @@ -7,7 +7,6 @@ import { defineFunctions } from './utils/define-functions'; export function addPausable(c: ContractBuilder, access: Access, explicitImplementations: boolean) { c.addUseClause('stellar_contract_utils::pausable', 'self', { alias: 'pausable' }); c.addUseClause('stellar_contract_utils::pausable', 'Pausable'); - if (!explicitImplementations) c.addUseClause('stellar_macros', 'default_impl'); const pausableTrait = { traitName: 'Pausable', diff --git a/packages/core/stellar/src/contract.test.ts.md b/packages/core/stellar/src/contract.test.ts.md index 40c6b6b58..a45f9d867 100644 --- a/packages/core/stellar/src/contract.test.ts.md +++ b/packages/core/stellar/src/contract.test.ts.md @@ -9,7 +9,7 @@ Generated by [AVA](https://avajs.dev). > Snapshot 1 `// SPDX-License-Identifier: MIT␊ - // Compatible with OpenZeppelin Stellar Soroban Contracts ^0.4.1␊ + // Compatible with OpenZeppelin Stellar Soroban Contracts ^0.6.0␊ #![no_std]␊ ␊ #[contract]␊ @@ -21,7 +21,7 @@ Generated by [AVA](https://avajs.dev). > Snapshot 1 `// SPDX-License-Identifier: MIT␊ - // Compatible with OpenZeppelin Stellar Soroban Contracts ^0.4.1␊ + // Compatible with OpenZeppelin Stellar Soroban Contracts ^0.6.0␊ #![no_std]␊ ␊ #[contract]␊ @@ -40,7 +40,7 @@ Generated by [AVA](https://avajs.dev). > Snapshot 1 `// SPDX-License-Identifier: MIT␊ - // Compatible with OpenZeppelin Stellar Soroban Contracts ^0.4.1␊ + // Compatible with OpenZeppelin Stellar Soroban Contracts ^0.6.0␊ #![no_std]␊ ␊ #[contract]␊ @@ -59,7 +59,7 @@ Generated by [AVA](https://avajs.dev). > Snapshot 1 `// SPDX-License-Identifier: MIT␊ - // Compatible with OpenZeppelin Stellar Soroban Contracts ^0.4.1␊ + // Compatible with OpenZeppelin Stellar Soroban Contracts ^0.6.0␊ #![no_std]␊ ␊ #[contract]␊ @@ -81,7 +81,7 @@ Generated by [AVA](https://avajs.dev). > Snapshot 1 `// SPDX-License-Identifier: MIT␊ - // Compatible with OpenZeppelin Stellar Soroban Contracts ^0.4.1␊ + // Compatible with OpenZeppelin Stellar Soroban Contracts ^0.6.0␊ #![no_std]␊ ␊ #[contract]␊ @@ -103,7 +103,7 @@ Generated by [AVA](https://avajs.dev). > Snapshot 1 `// SPDX-License-Identifier: MIT␊ - // Compatible with OpenZeppelin Stellar Soroban Contracts ^0.4.1␊ + // Compatible with OpenZeppelin Stellar Soroban Contracts ^0.6.0␊ #![no_std]␊ ␊ use some::library::SomeLibrary;␊ @@ -117,7 +117,7 @@ Generated by [AVA](https://avajs.dev). > Snapshot 1 `// SPDX-License-Identifier: MIT␊ - // Compatible with OpenZeppelin Stellar Soroban Contracts ^0.4.1␊ + // Compatible with OpenZeppelin Stellar Soroban Contracts ^0.6.0␊ #![no_std]␊ ␊ use some::library::{Misc, SomeLibrary};␊ @@ -131,7 +131,7 @@ Generated by [AVA](https://avajs.dev). > Snapshot 1 `// SPDX-License-Identifier: MIT␊ - // Compatible with OpenZeppelin Stellar Soroban Contracts ^0.4.1␊ + // Compatible with OpenZeppelin Stellar Soroban Contracts ^0.6.0␊ #![no_std]␊ ␊ use another::library::{self as custom1, self as custom2, AnotherLibrary};␊ @@ -146,7 +146,7 @@ Generated by [AVA](https://avajs.dev). > Snapshot 1 `// SPDX-License-Identifier: MIT␊ - // Compatible with OpenZeppelin Stellar Soroban Contracts ^0.4.1␊ + // Compatible with OpenZeppelin Stellar Soroban Contracts ^0.6.0␊ ␊ //! Some documentation␊ #![no_std]␊ @@ -160,7 +160,7 @@ Generated by [AVA](https://avajs.dev). > Snapshot 1 `// SPDX-License-Identifier: MIT␊ - // Compatible with OpenZeppelin Stellar Soroban Contracts ^0.4.1␊ + // Compatible with OpenZeppelin Stellar Soroban Contracts ^0.6.0␊ #![no_std]␊ ␊ use soroban_sdk::contractmeta;␊ @@ -176,7 +176,7 @@ Generated by [AVA](https://avajs.dev). > Snapshot 1 `// SPDX-License-Identifier: MIT␊ - // Compatible with OpenZeppelin Stellar Soroban Contracts ^0.4.1␊ + // Compatible with OpenZeppelin Stellar Soroban Contracts ^0.6.0␊ #![no_std]␊ ␊ use soroban_sdk::contractmeta;␊ @@ -193,7 +193,7 @@ Generated by [AVA](https://avajs.dev). > Snapshot 1 `// SPDX-License-Identifier: MIT␊ - // Compatible with OpenZeppelin Stellar Soroban Contracts ^0.4.1␊ + // Compatible with OpenZeppelin Stellar Soroban Contracts ^0.6.0␊ ␊ //! Some documentation␊ #![no_std]␊ @@ -212,7 +212,7 @@ Generated by [AVA](https://avajs.dev). > Snapshot 1 `// SPDX-License-Identifier: MIT␊ - // Compatible with OpenZeppelin Stellar Soroban Contracts ^0.4.1␊ + // Compatible with OpenZeppelin Stellar Soroban Contracts ^0.6.0␊ #![no_std]␊ ␊ use soroban_sdk::contractmeta;␊ diff --git a/packages/core/stellar/src/contract.test.ts.snap b/packages/core/stellar/src/contract.test.ts.snap index bd748d120ba343aee14caf4d69d865aae8e67398..81d7162798ddc17b9dbc619ffd02efb1ca6745db 100644 GIT binary patch literal 775 zcmV+i1Ni(wRzVel|g@u6$1_lOnm!!nGK!fNnq~35k`|O;*&+k2F zKWs_jo95LUw8BaxPReS=Ewq>s+z6vsY&OW67yCiLEL(j&Qn*w|uj0kRl?yKm)hg5< zKU|$y5*(GmiNyew6`?@w!}8*aSFOSvMKQCYB@vzry8(}4R8KIDQ3?fhi&8QTb<)&g z3g$WsFz|G0^4{c>R~}tg)HF6|cwTwEyS|1OCoM2mC)~mUQO)ZRY~MIQ$UeqNwMUT# zP66hLzB@#p&kj+~OA*Dg;idQV73_Kd0O|NpL9^MzIEFslo>yDroiXWUD8hwAaVtoT zjn}gNJ#X*8*uuOjrwEtYjoNUB%XOFenWiMh zpaVSMwEXB0zdv>2-DP2T1$w~uh9rl+-6m}@fbqB&BDT6*P8L0BZ-kbmgn8tz4)UkdNR@10(*&Eo-^EDRTl2i$=IGca?#z}tM5PLB zF*#f6lHSK{7R3@LIYp)MA%ml@ltziPB9{1jTWiIuj;_lmdvqP2t^qUC$L_S0eQ2xG zhgb!sfLZNlKgxG>HB}>J6u}&(8V#{N8g8 z!j>eyWnR5OE38D~q^xG#LW>!}jWCMEW|ORWaS#N|venlkg)4>hDqb#JyY#Y9twR0D zqt%He!BH8USPW2E5en2kEHAEj)hf(U6f-MY65+Y9oA5YB^%Ub6rBG0}C?(TSCrvG; zV6L+O1JCYH&P+~u<uY#%(gI_3!YwQi)w~YD&aFd)>|>l%dlYHl z6kwj{yF>K({1ElL6j3Z2UV2Yo!JY>Ikd6-(G@Ct)W9Y-(d9^*>8IxXyB3wumw}RBz zcrEMS_x2BsP5jwdyVqbOI7w0$0&@aOuE4M}v~912A?bYBtrce+ZFh?2NgLTs)Rt{D z1}mK3v8WZ35RyJ@tY{`|$69&4Dyc1%~`VSCaqKgSX|H(Y-K@gzcJS(;t>xOwN8J2-iBUbQ-!g@wDazy9}i zuP;oHCtBFuEPB%32rWwq^T=NvWa59}Kj|+8c2R|tPy8Q_;V Snapshot 1 `// SPDX-License-Identifier: MIT␊ - // Compatible with OpenZeppelin Stellar Soroban Contracts ^0.4.1␊ + // Compatible with OpenZeppelin Stellar Soroban Contracts ^0.6.0␊ #![no_std]␊ ␊ - use soroban_sdk::{contract, contractimpl, Env, String};␊ - use stellar_macros::default_impl;␊ + use soroban_sdk::{␊ + Address, contract, contractimpl, Env, MuxedAddress, String, Symbol, Vec␊ + };␊ use stellar_tokens::fungible::{Base, FungibleToken};␊ ␊ #[contract]␊ @@ -22,12 +23,11 @@ Generated by [AVA](https://avajs.dev). #[contractimpl]␊ impl MyToken {␊ pub fn __constructor(e: &Env) {␊ - Base::set_metadata(e, 18, String::from_str(e, "MyToken"), String::from_str(e, "MTK"));␊ + Base::set_metadata(e, 7, String::from_str(e, "MyToken"), String::from_str(e, "MTK"));␊ }␊ }␊ ␊ - #[default_impl]␊ - #[contractimpl]␊ + #[contractimpl(contracttrait)]␊ impl FungibleToken for MyToken {␊ type ContractType = Base;␊ ␊ @@ -39,11 +39,12 @@ Generated by [AVA](https://avajs.dev). > Snapshot 1 `// SPDX-License-Identifier: MIT␊ - // Compatible with OpenZeppelin Stellar Soroban Contracts ^0.4.1␊ + // Compatible with OpenZeppelin Stellar Soroban Contracts ^0.6.0␊ #![no_std]␊ ␊ - use soroban_sdk::{Address, contract, contractimpl, Env, String};␊ - use stellar_macros::default_impl;␊ + use soroban_sdk::{␊ + Address, contract, contractimpl, Env, MuxedAddress, String, Symbol, Vec␊ + };␊ use stellar_tokens::fungible::{Base, burnable::FungibleBurnable, FungibleToken};␊ ␊ #[contract]␊ @@ -52,12 +53,11 @@ Generated by [AVA](https://avajs.dev). #[contractimpl]␊ impl MyToken {␊ pub fn __constructor(e: &Env) {␊ - Base::set_metadata(e, 18, String::from_str(e, "MyToken"), String::from_str(e, "MTK"));␊ + Base::set_metadata(e, 7, String::from_str(e, "MyToken"), String::from_str(e, "MTK"));␊ }␊ }␊ ␊ - #[default_impl]␊ - #[contractimpl]␊ + #[contractimpl(contracttrait)]␊ impl FungibleToken for MyToken {␊ type ContractType = Base;␊ ␊ @@ -67,8 +67,7 @@ Generated by [AVA](https://avajs.dev). // Extensions␊ //␊ ␊ - #[default_impl]␊ - #[contractimpl]␊ + #[contractimpl(contracttrait)]␊ impl FungibleBurnable for MyToken {}␊ ` @@ -77,13 +76,15 @@ Generated by [AVA](https://avajs.dev). > Snapshot 1 `// SPDX-License-Identifier: MIT␊ - // Compatible with OpenZeppelin Stellar Soroban Contracts ^0.4.1␊ + // Compatible with OpenZeppelin Stellar Soroban Contracts ^0.6.0␊ #![no_std]␊ ␊ - use soroban_sdk::{Address, contract, contractimpl, Env, String};␊ + use soroban_sdk::{␊ + Address, contract, contractimpl, Env, MuxedAddress, String, Symbol, Vec␊ + };␊ use stellar_access::ownable::{self as ownable, Ownable};␊ use stellar_contract_utils::pausable::{self as pausable, Pausable};␊ - use stellar_macros::{default_impl, only_owner, when_not_paused};␊ + use stellar_macros::{only_owner, when_not_paused};␊ use stellar_tokens::fungible::{Base, FungibleToken};␊ ␊ #[contract]␊ @@ -92,18 +93,17 @@ Generated by [AVA](https://avajs.dev). #[contractimpl]␊ impl MyToken {␊ pub fn __constructor(e: &Env, owner: Address) {␊ - Base::set_metadata(e, 18, String::from_str(e, "MyToken"), String::from_str(e, "MTK"));␊ + Base::set_metadata(e, 7, String::from_str(e, "MyToken"), String::from_str(e, "MTK"));␊ ownable::set_owner(e, &owner);␊ }␊ }␊ ␊ - #[default_impl]␊ - #[contractimpl]␊ + #[contractimpl(contracttrait)]␊ impl FungibleToken for MyToken {␊ type ContractType = Base;␊ ␊ #[when_not_paused]␊ - fn transfer(e: &Env, from: Address, to: Address, amount: i128) {␊ + fn transfer(e: &Env, from: Address, to: MuxedAddress, amount: i128) {␊ Self::ContractType::transfer(e, &from, &to, amount);␊ }␊ ␊ @@ -117,6 +117,9 @@ Generated by [AVA](https://avajs.dev). // Utils␊ //␊ ␊ + #[contractimpl(contracttrait)]␊ + impl Ownable for MyToken {}␊ + ␊ #[contractimpl]␊ impl Pausable for MyToken {␊ fn paused(e: &Env) -> bool {␊ @@ -133,10 +136,6 @@ Generated by [AVA](https://avajs.dev). pausable::unpause(e);␊ }␊ }␊ - ␊ - #[default_impl]␊ - #[contractimpl]␊ - impl Ownable for MyToken {}␊ ` ## fungible burnable pausable @@ -144,13 +143,15 @@ Generated by [AVA](https://avajs.dev). > Snapshot 1 `// SPDX-License-Identifier: MIT␊ - // Compatible with OpenZeppelin Stellar Soroban Contracts ^0.4.1␊ + // Compatible with OpenZeppelin Stellar Soroban Contracts ^0.6.0␊ #![no_std]␊ ␊ - use soroban_sdk::{Address, contract, contractimpl, Env, String};␊ + use soroban_sdk::{␊ + Address, contract, contractimpl, Env, MuxedAddress, String, Symbol, Vec␊ + };␊ use stellar_access::ownable::{self as ownable, Ownable};␊ use stellar_contract_utils::pausable::{self as pausable, Pausable};␊ - use stellar_macros::{default_impl, only_owner, when_not_paused};␊ + use stellar_macros::{only_owner, when_not_paused};␊ use stellar_tokens::fungible::{Base, burnable::FungibleBurnable, FungibleToken};␊ ␊ #[contract]␊ @@ -159,18 +160,17 @@ Generated by [AVA](https://avajs.dev). #[contractimpl]␊ impl MyToken {␊ pub fn __constructor(e: &Env, owner: Address) {␊ - Base::set_metadata(e, 18, String::from_str(e, "MyToken"), String::from_str(e, "MTK"));␊ + Base::set_metadata(e, 7, String::from_str(e, "MyToken"), String::from_str(e, "MTK"));␊ ownable::set_owner(e, &owner);␊ }␊ }␊ ␊ - #[default_impl]␊ - #[contractimpl]␊ + #[contractimpl(contracttrait)]␊ impl FungibleToken for MyToken {␊ type ContractType = Base;␊ ␊ #[when_not_paused]␊ - fn transfer(e: &Env, from: Address, to: Address, amount: i128) {␊ + fn transfer(e: &Env, from: Address, to: MuxedAddress, amount: i128) {␊ Self::ContractType::transfer(e, &from, &to, amount);␊ }␊ ␊ @@ -184,7 +184,7 @@ Generated by [AVA](https://avajs.dev). // Extensions␊ //␊ ␊ - #[contractimpl]␊ + #[contractimpl(contracttrait)]␊ impl FungibleBurnable for MyToken {␊ #[when_not_paused]␊ fn burn(e: &Env, from: Address, amount: i128) {␊ @@ -201,6 +201,9 @@ Generated by [AVA](https://avajs.dev). // Utils␊ //␊ ␊ + #[contractimpl(contracttrait)]␊ + impl Ownable for MyToken {}␊ + ␊ #[contractimpl]␊ impl Pausable for MyToken {␊ fn paused(e: &Env) -> bool {␊ @@ -217,10 +220,6 @@ Generated by [AVA](https://avajs.dev). pausable::unpause(e);␊ }␊ }␊ - ␊ - #[default_impl]␊ - #[contractimpl]␊ - impl Ownable for MyToken {}␊ ` ## fungible preminted @@ -228,11 +227,12 @@ Generated by [AVA](https://avajs.dev). > Snapshot 1 `// SPDX-License-Identifier: MIT␊ - // Compatible with OpenZeppelin Stellar Soroban Contracts ^0.4.1␊ + // Compatible with OpenZeppelin Stellar Soroban Contracts ^0.6.0␊ #![no_std]␊ ␊ - use soroban_sdk::{Address, contract, contractimpl, Env, String};␊ - use stellar_macros::default_impl;␊ + use soroban_sdk::{␊ + Address, contract, contractimpl, Env, MuxedAddress, String, Symbol, Vec␊ + };␊ use stellar_tokens::fungible::{Base, FungibleToken};␊ ␊ #[contract]␊ @@ -241,13 +241,12 @@ Generated by [AVA](https://avajs.dev). #[contractimpl]␊ impl MyToken {␊ pub fn __constructor(e: &Env, recipient: Address) {␊ - Base::set_metadata(e, 18, String::from_str(e, "MyToken"), String::from_str(e, "MTK"));␊ - Base::mint(e, &recipient, 1000000000000000000000);␊ + Base::set_metadata(e, 7, String::from_str(e, "MyToken"), String::from_str(e, "MTK"));␊ + Base::mint(e, &recipient, 10000000000);␊ }␊ }␊ ␊ - #[default_impl]␊ - #[contractimpl]␊ + #[contractimpl(contracttrait)]␊ impl FungibleToken for MyToken {␊ type ContractType = Base;␊ ␊ @@ -259,11 +258,12 @@ Generated by [AVA](https://avajs.dev). > Snapshot 1 `// SPDX-License-Identifier: MIT␊ - // Compatible with OpenZeppelin Stellar Soroban Contracts ^0.4.1␊ + // Compatible with OpenZeppelin Stellar Soroban Contracts ^0.6.0␊ #![no_std]␊ ␊ - use soroban_sdk::{contract, contractimpl, Env, String};␊ - use stellar_macros::default_impl;␊ + use soroban_sdk::{␊ + Address, contract, contractimpl, Env, MuxedAddress, String, Symbol, Vec␊ + };␊ use stellar_tokens::fungible::{Base, FungibleToken};␊ ␊ #[contract]␊ @@ -272,12 +272,11 @@ Generated by [AVA](https://avajs.dev). #[contractimpl]␊ impl MyToken {␊ pub fn __constructor(e: &Env) {␊ - Base::set_metadata(e, 18, String::from_str(e, "MyToken"), String::from_str(e, "MTK"));␊ + Base::set_metadata(e, 7, String::from_str(e, "MyToken"), String::from_str(e, "MTK"));␊ }␊ }␊ ␊ - #[default_impl]␊ - #[contractimpl]␊ + #[contractimpl(contracttrait)]␊ impl FungibleToken for MyToken {␊ type ContractType = Base;␊ ␊ @@ -289,11 +288,12 @@ Generated by [AVA](https://avajs.dev). > Snapshot 1 `// SPDX-License-Identifier: MIT␊ - // Compatible with OpenZeppelin Stellar Soroban Contracts ^0.4.1␊ + // Compatible with OpenZeppelin Stellar Soroban Contracts ^0.6.0␊ #![no_std]␊ ␊ - use soroban_sdk::{Address, contract, contractimpl, Env, String};␊ - use stellar_macros::default_impl;␊ + use soroban_sdk::{␊ + Address, contract, contractimpl, Env, MuxedAddress, String, Symbol, Vec␊ + };␊ use stellar_tokens::fungible::{Base, FungibleToken};␊ ␊ #[contract]␊ @@ -302,12 +302,11 @@ Generated by [AVA](https://avajs.dev). #[contractimpl]␊ impl MyToken {␊ pub fn __constructor(e: &Env) {␊ - Base::set_metadata(e, 18, String::from_str(e, "MyToken"), String::from_str(e, "MTK"));␊ + Base::set_metadata(e, 7, String::from_str(e, "MyToken"), String::from_str(e, "MTK"));␊ }␊ }␊ ␊ - #[default_impl]␊ - #[contractimpl]␊ + #[contractimpl(contracttrait)]␊ impl FungibleToken for MyToken {␊ type ContractType = Base;␊ ␊ @@ -319,12 +318,13 @@ Generated by [AVA](https://avajs.dev). > Snapshot 1 `// SPDX-License-Identifier: MIT␊ - // Compatible with OpenZeppelin Stellar Soroban Contracts ^0.4.1␊ + // Compatible with OpenZeppelin Stellar Soroban Contracts ^0.6.0␊ #![no_std]␊ ␊ - use soroban_sdk::{Address, contract, contractimpl, Env, String};␊ + use soroban_sdk::{␊ + Address, contract, contractimpl, Env, MuxedAddress, String, Symbol, Vec␊ + };␊ use stellar_access::ownable::{self as ownable, Ownable};␊ - use stellar_macros::default_impl;␊ use stellar_tokens::fungible::{Base, FungibleToken};␊ ␊ #[contract]␊ @@ -333,13 +333,12 @@ Generated by [AVA](https://avajs.dev). #[contractimpl]␊ impl MyToken {␊ pub fn __constructor(e: &Env, owner: Address) {␊ - Base::set_metadata(e, 18, String::from_str(e, "MyToken"), String::from_str(e, "MTK"));␊ + Base::set_metadata(e, 7, String::from_str(e, "MyToken"), String::from_str(e, "MTK"));␊ ownable::set_owner(e, &owner);␊ }␊ }␊ ␊ - #[default_impl]␊ - #[contractimpl]␊ + #[contractimpl(contracttrait)]␊ impl FungibleToken for MyToken {␊ type ContractType = Base;␊ ␊ @@ -349,8 +348,7 @@ Generated by [AVA](https://avajs.dev). // Utils␊ //␊ ␊ - #[default_impl]␊ - #[contractimpl]␊ + #[contractimpl(contracttrait)]␊ impl Ownable for MyToken {}␊ ` @@ -359,12 +357,13 @@ Generated by [AVA](https://avajs.dev). > Snapshot 1 `// SPDX-License-Identifier: MIT␊ - // Compatible with OpenZeppelin Stellar Soroban Contracts ^0.4.1␊ + // Compatible with OpenZeppelin Stellar Soroban Contracts ^0.6.0␊ #![no_std]␊ ␊ - use soroban_sdk::{Address, contract, contractimpl, Env, String};␊ + use soroban_sdk::{␊ + Address, contract, contractimpl, Env, MuxedAddress, String, Symbol, Vec␊ + };␊ use stellar_access::access_control::{self as access_control, AccessControl};␊ - use stellar_macros::default_impl;␊ use stellar_tokens::fungible::{Base, FungibleToken};␊ ␊ #[contract]␊ @@ -373,13 +372,12 @@ Generated by [AVA](https://avajs.dev). #[contractimpl]␊ impl MyToken {␊ pub fn __constructor(e: &Env, admin: Address) {␊ - Base::set_metadata(e, 18, String::from_str(e, "MyToken"), String::from_str(e, "MTK"));␊ + Base::set_metadata(e, 7, String::from_str(e, "MyToken"), String::from_str(e, "MTK"));␊ access_control::set_admin(e, &admin);␊ }␊ }␊ ␊ - #[default_impl]␊ - #[contractimpl]␊ + #[contractimpl(contracttrait)]␊ impl FungibleToken for MyToken {␊ type ContractType = Base;␊ ␊ @@ -389,8 +387,7 @@ Generated by [AVA](https://avajs.dev). // Utils␊ //␊ ␊ - #[default_impl]␊ - #[contractimpl]␊ + #[contractimpl(contracttrait)]␊ impl AccessControl for MyToken {}␊ ` @@ -399,13 +396,15 @@ Generated by [AVA](https://avajs.dev). > Snapshot 1 `// SPDX-License-Identifier: MIT␊ - // Compatible with OpenZeppelin Stellar Soroban Contracts ^0.4.1␊ + // Compatible with OpenZeppelin Stellar Soroban Contracts ^0.6.0␊ #![no_std]␊ ␊ - use soroban_sdk::{Address, contract, contractimpl, Env, String};␊ + use soroban_sdk::{␊ + Address, contract, contractimpl, Env, MuxedAddress, String, Symbol, Vec␊ + };␊ use stellar_access::ownable::{self as ownable, Ownable};␊ use stellar_contract_utils::pausable::{self as pausable, Pausable};␊ - use stellar_macros::{default_impl, only_owner, when_not_paused};␊ + use stellar_macros::{only_owner, when_not_paused};␊ use stellar_tokens::fungible::{Base, burnable::FungibleBurnable, FungibleToken};␊ ␊ #[contract]␊ @@ -414,8 +413,8 @@ Generated by [AVA](https://avajs.dev). #[contractimpl]␊ impl MyToken {␊ pub fn __constructor(e: &Env, recipient: Address, owner: Address) {␊ - Base::set_metadata(e, 18, String::from_str(e, "MyToken"), String::from_str(e, "MTK"));␊ - Base::mint(e, &recipient, 2000000000000000000000);␊ + Base::set_metadata(e, 7, String::from_str(e, "MyToken"), String::from_str(e, "MTK"));␊ + Base::mint(e, &recipient, 20000000000);␊ ownable::set_owner(e, &owner);␊ }␊ ␊ @@ -426,13 +425,12 @@ Generated by [AVA](https://avajs.dev). }␊ }␊ ␊ - #[default_impl]␊ - #[contractimpl]␊ + #[contractimpl(contracttrait)]␊ impl FungibleToken for MyToken {␊ type ContractType = Base;␊ ␊ #[when_not_paused]␊ - fn transfer(e: &Env, from: Address, to: Address, amount: i128) {␊ + fn transfer(e: &Env, from: Address, to: MuxedAddress, amount: i128) {␊ Self::ContractType::transfer(e, &from, &to, amount);␊ }␊ ␊ @@ -446,7 +444,7 @@ Generated by [AVA](https://avajs.dev). // Extensions␊ //␊ ␊ - #[contractimpl]␊ + #[contractimpl(contracttrait)]␊ impl FungibleBurnable for MyToken {␊ #[when_not_paused]␊ fn burn(e: &Env, from: Address, amount: i128) {␊ @@ -463,6 +461,9 @@ Generated by [AVA](https://avajs.dev). // Utils␊ //␊ ␊ + #[contractimpl(contracttrait)]␊ + impl Ownable for MyToken {}␊ + ␊ #[contractimpl]␊ impl Pausable for MyToken {␊ fn paused(e: &Env) -> bool {␊ @@ -479,10 +480,6 @@ Generated by [AVA](https://avajs.dev). pausable::unpause(e);␊ }␊ }␊ - ␊ - #[default_impl]␊ - #[contractimpl]␊ - impl Ownable for MyToken {}␊ ` ## fungible full - roles @@ -490,14 +487,16 @@ Generated by [AVA](https://avajs.dev). > Snapshot 1 `// SPDX-License-Identifier: MIT␊ - // Compatible with OpenZeppelin Stellar Soroban Contracts ^0.4.1␊ + // Compatible with OpenZeppelin Stellar Soroban Contracts ^0.6.0␊ #![no_std]␊ ␊ - use soroban_sdk::{Address, contract, contractimpl, Env, String, Symbol};␊ + use soroban_sdk::{␊ + Address, contract, contractimpl, Env, MuxedAddress, String, Symbol, Vec␊ + };␊ use stellar_access::access_control::{self as access_control, AccessControl};␊ use stellar_contract_utils::pausable::{self as pausable, Pausable};␊ use stellar_contract_utils::upgradeable::UpgradeableInternal;␊ - use stellar_macros::{default_impl, only_role, Upgradeable, when_not_paused};␊ + use stellar_macros::{only_role, Upgradeable, when_not_paused};␊ use stellar_tokens::fungible::{Base, burnable::FungibleBurnable, FungibleToken};␊ ␊ #[derive(Upgradeable)]␊ @@ -514,12 +513,12 @@ Generated by [AVA](https://avajs.dev). upgrader: Address,␊ minter: Address,␊ ) {␊ - Base::set_metadata(e, 18, String::from_str(e, "MyToken"), String::from_str(e, "MTK"));␊ - Base::mint(e, &recipient, 2000000000000000000000);␊ + Base::set_metadata(e, 7, String::from_str(e, "MyToken"), String::from_str(e, "MTK"));␊ + Base::mint(e, &recipient, 20000000000);␊ access_control::set_admin(e, &admin);␊ - access_control::grant_role_no_auth(e, &admin, &pauser, &Symbol::new(e, "pauser"));␊ - access_control::grant_role_no_auth(e, &admin, &upgrader, &Symbol::new(e, "upgrader"));␊ - access_control::grant_role_no_auth(e, &admin, &minter, &Symbol::new(e, "minter"));␊ + access_control::grant_role_no_auth(e, &pauser, &Symbol::new(e, "pauser"), &admin);␊ + access_control::grant_role_no_auth(e, &upgrader, &Symbol::new(e, "upgrader"), &admin);␊ + access_control::grant_role_no_auth(e, &minter, &Symbol::new(e, "minter"), &admin);␊ }␊ ␊ #[only_role(caller, "minter")]␊ @@ -529,13 +528,12 @@ Generated by [AVA](https://avajs.dev). }␊ }␊ ␊ - #[default_impl]␊ - #[contractimpl]␊ + #[contractimpl(contracttrait)]␊ impl FungibleToken for MyToken {␊ type ContractType = Base;␊ ␊ #[when_not_paused]␊ - fn transfer(e: &Env, from: Address, to: Address, amount: i128) {␊ + fn transfer(e: &Env, from: Address, to: MuxedAddress, amount: i128) {␊ Self::ContractType::transfer(e, &from, &to, amount);␊ }␊ ␊ @@ -549,7 +547,7 @@ Generated by [AVA](https://avajs.dev). // Extensions␊ //␊ ␊ - #[contractimpl]␊ + #[contractimpl(contracttrait)]␊ impl FungibleBurnable for MyToken {␊ #[when_not_paused]␊ fn burn(e: &Env, from: Address, amount: i128) {␊ @@ -568,11 +566,14 @@ Generated by [AVA](https://avajs.dev). ␊ impl UpgradeableInternal for MyToken {␊ fn _require_auth(e: &Env, operator: &Address) {␊ - access_control::ensure_role(e, operator, &Symbol::new(e, "upgrader"));␊ + access_control::ensure_role(e, &Symbol::new(e, "upgrader"), operator);␊ operator.require_auth();␊ }␊ }␊ ␊ + #[contractimpl(contracttrait)]␊ + impl AccessControl for MyToken {}␊ + ␊ #[contractimpl]␊ impl Pausable for MyToken {␊ fn paused(e: &Env) -> bool {␊ @@ -589,10 +590,6 @@ Generated by [AVA](https://avajs.dev). pausable::unpause(e);␊ }␊ }␊ - ␊ - #[default_impl]␊ - #[contractimpl]␊ - impl AccessControl for MyToken {}␊ ` ## fungible full - complex name @@ -600,14 +597,16 @@ Generated by [AVA](https://avajs.dev). > Snapshot 1 `// SPDX-License-Identifier: MIT␊ - // Compatible with OpenZeppelin Stellar Soroban Contracts ^0.4.1␊ + // Compatible with OpenZeppelin Stellar Soroban Contracts ^0.6.0␊ #![no_std]␊ ␊ - use soroban_sdk::{Address, contract, contractimpl, Env, String};␊ + use soroban_sdk::{␊ + Address, contract, contractimpl, Env, MuxedAddress, String, Symbol, Vec␊ + };␊ use stellar_access::ownable::{self as ownable, Ownable};␊ use stellar_contract_utils::pausable::{self as pausable, Pausable};␊ use stellar_contract_utils::upgradeable::UpgradeableInternal;␊ - use stellar_macros::{default_impl, only_owner, Upgradeable, when_not_paused};␊ + use stellar_macros::{only_owner, Upgradeable, when_not_paused};␊ use stellar_tokens::fungible::{Base, burnable::FungibleBurnable, FungibleToken};␊ ␊ #[derive(Upgradeable)]␊ @@ -617,8 +616,8 @@ Generated by [AVA](https://avajs.dev). #[contractimpl]␊ impl CustomToken {␊ pub fn __constructor(e: &Env, recipient: Address, owner: Address) {␊ - Base::set_metadata(e, 18, String::from_str(e, "Custom $ Token"), String::from_str(e, "MTK"));␊ - Base::mint(e, &recipient, 2000000000000000000000);␊ + Base::set_metadata(e, 7, String::from_str(e, "Custom $ Token"), String::from_str(e, "MTK"));␊ + Base::mint(e, &recipient, 20000000000);␊ ownable::set_owner(e, &owner);␊ }␊ ␊ @@ -629,13 +628,12 @@ Generated by [AVA](https://avajs.dev). }␊ }␊ ␊ - #[default_impl]␊ - #[contractimpl]␊ + #[contractimpl(contracttrait)]␊ impl FungibleToken for CustomToken {␊ type ContractType = Base;␊ ␊ #[when_not_paused]␊ - fn transfer(e: &Env, from: Address, to: Address, amount: i128) {␊ + fn transfer(e: &Env, from: Address, to: MuxedAddress, amount: i128) {␊ Self::ContractType::transfer(e, &from, &to, amount);␊ }␊ ␊ @@ -649,7 +647,7 @@ Generated by [AVA](https://avajs.dev). // Extensions␊ //␊ ␊ - #[contractimpl]␊ + #[contractimpl(contracttrait)]␊ impl FungibleBurnable for CustomToken {␊ #[when_not_paused]␊ fn burn(e: &Env, from: Address, amount: i128) {␊ @@ -672,6 +670,9 @@ Generated by [AVA](https://avajs.dev). }␊ }␊ ␊ + #[contractimpl(contracttrait)]␊ + impl Ownable for CustomToken {}␊ + ␊ #[contractimpl]␊ impl Pausable for CustomToken {␊ fn paused(e: &Env) -> bool {␊ @@ -688,10 +689,6 @@ Generated by [AVA](https://avajs.dev). pausable::unpause(e);␊ }␊ }␊ - ␊ - #[default_impl]␊ - #[contractimpl]␊ - impl Ownable for CustomToken {}␊ ` ## fungible explicit trait implementations @@ -699,10 +696,12 @@ Generated by [AVA](https://avajs.dev). > Snapshot 1 `// SPDX-License-Identifier: MIT␊ - // Compatible with OpenZeppelin Stellar Soroban Contracts ^0.4.1␊ + // Compatible with OpenZeppelin Stellar Soroban Contracts ^0.6.0␊ #![no_std]␊ ␊ - use soroban_sdk::{Address, contract, contractimpl, Env, String};␊ + use soroban_sdk::{␊ + Address, contract, contractimpl, Env, MuxedAddress, String, Symbol, Vec␊ + };␊ use stellar_tokens::fungible::{Base, FungibleToken};␊ ␊ #[contract]␊ @@ -711,7 +710,7 @@ Generated by [AVA](https://avajs.dev). #[contractimpl]␊ impl MyToken {␊ pub fn __constructor(e: &Env) {␊ - Base::set_metadata(e, 18, String::from_str(e, "MyToken"), String::from_str(e, "MTK"));␊ + Base::set_metadata(e, 7, String::from_str(e, "MyToken"), String::from_str(e, "MTK"));␊ }␊ }␊ ␊ @@ -731,7 +730,7 @@ Generated by [AVA](https://avajs.dev). Self::ContractType::allowance(e, &owner, &spender)␊ }␊ ␊ - fn transfer(e: &Env, from: Address, to: Address, amount: i128) {␊ + fn transfer(e: &Env, from: Address, to: MuxedAddress, amount: i128) {␊ Self::ContractType::transfer(e, &from, &to, amount);␊ }␊ ␊ diff --git a/packages/core/stellar/src/fungible.test.ts.snap b/packages/core/stellar/src/fungible.test.ts.snap index 84a1df52a5de7d2820743ad997e24ebded9f0c86..57c61bb47f1a8493740e2986e82230fbbcc302ea 100644 GIT binary patch literal 1707 zcmV;c22}Y$RzV7rfK;8-4PW#GWUn9PQDBhAL7f_ z7PK{BG#`ry00000000B+TU&43L=-Nm=*5+g`iejrS`@O9)1;{cXd)18C{hJgD<$Pt zrPi!{oLC*txHIEyq9{U0Jn%yQ0T1Pcf55-uAMk+2xAl1Ky)@hGHtT&z?75tC=3Kuy z*}U?*l)KO6AAf-g6b05LGH{U}v%R28A&`tja-S>t>nqPAiu|(g87*3FNeGVVy_?OIkW0m*csBfaMsA6p0^bl39) zNNFQC+uVN&!id`FK0C0{!}t)qV(GRL0o$|D_EFg7)JETfYn^PS98!@S#h(L{80Xr+ z`1l@?V54ucfgQczWYe;4KF#^W;P(EEIb9LMD> z-Ot4eV6=Rn9dxoa`lCg_Sb}mwP(&ML1#I+Lej<#0!9zzXp@(l|JZ^NF=6Alm(dld^ z)K9FFs-!FVixMPIolJ1!{K)5`aujtGL1D-p{qjX3_NHZ>Sed82$hC^Pv0$X$+5Rz{ z?eB$jwp=|J=W4%~jkJz|{4b;cDECj}V@-|x5lx?)Ecuu3x z!k9ujnnGVv83FT3rmdCzRAOfgZM2;68hVN%FFw(+Hg-zP0=Jq8>m5H2(HbA{8A|om zuQ;n;qAusOblQIW=W9Er4f-*@Yf$a0-Ej$}4G~o#zXDYg*N~6dYcVLcmGqxgkHhx| z5Ymu3a`{iAj=a3w){*(IBXb4q+8Wc=n6s`iQ^(#T^rHi=(SS|oPMts9S{!RKyXei6 z+GMmi%}Q@;`h3=O(Z3N22m_|TtLb|DW|Z=HA-f(kD1QRnAPPXo+?kial)CnaB%TXV zY;=3Q_{^eB7gs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{+SSN<{F{I4sk>*m;T zh?EHNLE^Hfl28w@gk;2m=kZHvW6Hn|l}{x?skRCf(jg08ByTk_c3L!_1)R|nn-3Tf z77Pvvvl&;mCPv)hvZj0sB7qSkwwP1c=_fOt<`7Atm$jp}c}Az6zVoVNux>Q$F;D_C z>5+oM^r13+S)h2~1NV8z6as&1`(aU)dxUxj75O8SQ?{V3iCWNBJf)FoU`qLHO(7Rj z286ieh&#*~a}Cq~Km=~`1V zmaJqf6>4kBNmEYdT24j~^~?x*f;elyDSFYjgpV*%w(5XTREqN8s9B`+qgeIg3!Oco2a?o~Yt>A!_# z{{`;By{6UMw0bYF)vNuirq#P^xY>h6yV*OEDgT%L7G(aGTs}tK?ed!8Zhx<^yZz_; z^D6mibAhdf{%3}5zfH5a5coco_#-A%4J=pF0 zY!T5@*0p972@?fT^tK8?WOzbNC=Ieu@jlo8?!_UYEN;@^$_6T+QGWR_ZatO}e8qg2O(b@ynu`9!Q=V82)HVGb ztZMavz)VGcW;1T%P#xymENI8Nw4fbFB0`J|q65SeV=sdfNT=4QAf8U0g?wz$3gYoZ zp?O)%`I_8%oY)IX&l{pzFs61in6<&I4Q9Pi%o^#kqA*v(Ra=lZp)W|1W3rZYKm=A? zAZS-aaXDKNCPP8u{6g~0(n&#p0 zM`gI~@P0taF)-Y(Xd&L<25SHD#tNbKWojW_95PQDkV_8DcSEUoe=IyNELnWBG8P8l zV`!R|7Y6`GP2PaORR@8iHf@058G+!aO6$R(Jsu5aNro_w3x~u>B%v`IimQ~W>8Q@y zQ8m<<N~#DDa2Qx36MTv3M(C*qmb?DBLlK+UtL|uwmkpZFyDV*JOA#9 zu0UL2YRfPP=!p@aI-^Z0CdOVPV0Ajh6f=j^LyT$JWQ20GQRamy Snapshot 1 `// SPDX-License-Identifier: MIT␊ - // Compatible with OpenZeppelin Stellar Soroban Contracts ^0.4.1␊ + // Compatible with OpenZeppelin Stellar Soroban Contracts ^0.6.0␊ #![no_std]␊ ␊ - use soroban_sdk::{contract, contractimpl, Env, String};␊ - use stellar_macros::default_impl;␊ + use soroban_sdk::{Address, contract, contractimpl, Env, String};␊ use stellar_tokens::non_fungible::{Base, NonFungibleToken};␊ ␊ #[contract]␊ @@ -29,8 +28,7 @@ Generated by [AVA](https://avajs.dev). }␊ }␊ ␊ - #[default_impl]␊ - #[contractimpl]␊ + #[contractimpl(contracttrait)]␊ impl NonFungibleToken for MyToken {␊ type ContractType = Base;␊ ␊ @@ -42,11 +40,10 @@ Generated by [AVA](https://avajs.dev). > Snapshot 1 `// SPDX-License-Identifier: MIT␊ - // Compatible with OpenZeppelin Stellar Soroban Contracts ^0.4.1␊ + // Compatible with OpenZeppelin Stellar Soroban Contracts ^0.6.0␊ #![no_std]␊ ␊ - use soroban_sdk::{contract, contractimpl, Env, String};␊ - use stellar_macros::default_impl;␊ + use soroban_sdk::{Address, contract, contractimpl, Env, String};␊ use stellar_tokens::non_fungible::{Base, burnable::NonFungibleBurnable, NonFungibleToken};␊ ␊ #[contract]␊ @@ -62,8 +59,7 @@ Generated by [AVA](https://avajs.dev). }␊ }␊ ␊ - #[default_impl]␊ - #[contractimpl]␊ + #[contractimpl(contracttrait)]␊ impl NonFungibleToken for MyToken {␊ type ContractType = Base;␊ ␊ @@ -73,8 +69,7 @@ Generated by [AVA](https://avajs.dev). // Extensions␊ //␊ ␊ - #[default_impl]␊ - #[contractimpl]␊ + #[contractimpl(contracttrait)]␊ impl NonFungibleBurnable for MyToken {}␊ ` @@ -83,13 +78,13 @@ Generated by [AVA](https://avajs.dev). > Snapshot 1 `// SPDX-License-Identifier: MIT␊ - // Compatible with OpenZeppelin Stellar Soroban Contracts ^0.4.1␊ + // Compatible with OpenZeppelin Stellar Soroban Contracts ^0.6.0␊ #![no_std]␊ ␊ use soroban_sdk::{Address, contract, contractimpl, Env, String};␊ use stellar_access::ownable::{self as ownable, Ownable};␊ use stellar_contract_utils::pausable::{self as pausable, Pausable};␊ - use stellar_macros::{default_impl, only_owner, when_not_paused};␊ + use stellar_macros::{only_owner, when_not_paused};␊ use stellar_tokens::non_fungible::{Base, NonFungibleToken};␊ ␊ #[contract]␊ @@ -106,8 +101,7 @@ Generated by [AVA](https://avajs.dev). }␊ }␊ ␊ - #[default_impl]␊ - #[contractimpl]␊ + #[contractimpl(contracttrait)]␊ impl NonFungibleToken for MyToken {␊ type ContractType = Base;␊ ␊ @@ -126,6 +120,9 @@ Generated by [AVA](https://avajs.dev). // Utils␊ //␊ ␊ + #[contractimpl(contracttrait)]␊ + impl Ownable for MyToken {}␊ + ␊ #[contractimpl]␊ impl Pausable for MyToken {␊ fn paused(e: &Env) -> bool {␊ @@ -142,10 +139,6 @@ Generated by [AVA](https://avajs.dev). pausable::unpause(e);␊ }␊ }␊ - ␊ - #[default_impl]␊ - #[contractimpl]␊ - impl Ownable for MyToken {}␊ ` ## non-fungible burnable pausable @@ -153,13 +146,13 @@ Generated by [AVA](https://avajs.dev). > Snapshot 1 `// SPDX-License-Identifier: MIT␊ - // Compatible with OpenZeppelin Stellar Soroban Contracts ^0.4.1␊ + // Compatible with OpenZeppelin Stellar Soroban Contracts ^0.6.0␊ #![no_std]␊ ␊ use soroban_sdk::{Address, contract, contractimpl, Env, String};␊ use stellar_access::ownable::{self as ownable, Ownable};␊ use stellar_contract_utils::pausable::{self as pausable, Pausable};␊ - use stellar_macros::{default_impl, only_owner, when_not_paused};␊ + use stellar_macros::{only_owner, when_not_paused};␊ use stellar_tokens::non_fungible::{Base, burnable::NonFungibleBurnable, NonFungibleToken};␊ ␊ #[contract]␊ @@ -176,8 +169,7 @@ Generated by [AVA](https://avajs.dev). }␊ }␊ ␊ - #[default_impl]␊ - #[contractimpl]␊ + #[contractimpl(contracttrait)]␊ impl NonFungibleToken for MyToken {␊ type ContractType = Base;␊ ␊ @@ -196,7 +188,7 @@ Generated by [AVA](https://avajs.dev). // Extensions␊ //␊ ␊ - #[contractimpl]␊ + #[contractimpl(contracttrait)]␊ impl NonFungibleBurnable for MyToken {␊ #[when_not_paused]␊ fn burn(e: &Env, from: Address, token_id: u32) {␊ @@ -213,6 +205,9 @@ Generated by [AVA](https://avajs.dev). // Utils␊ //␊ ␊ + #[contractimpl(contracttrait)]␊ + impl Ownable for MyToken {}␊ + ␊ #[contractimpl]␊ impl Pausable for MyToken {␊ fn paused(e: &Env) -> bool {␊ @@ -229,10 +224,6 @@ Generated by [AVA](https://avajs.dev). pausable::unpause(e);␊ }␊ }␊ - ␊ - #[default_impl]␊ - #[contractimpl]␊ - impl Ownable for MyToken {}␊ ` ## non-fungible mintable @@ -240,12 +231,12 @@ Generated by [AVA](https://avajs.dev). > Snapshot 1 `// SPDX-License-Identifier: MIT␊ - // Compatible with OpenZeppelin Stellar Soroban Contracts ^0.4.1␊ + // Compatible with OpenZeppelin Stellar Soroban Contracts ^0.6.0␊ #![no_std]␊ ␊ use soroban_sdk::{Address, contract, contractimpl, Env, String};␊ use stellar_access::ownable::{self as ownable, Ownable};␊ - use stellar_macros::{default_impl, only_owner};␊ + use stellar_macros::only_owner;␊ use stellar_tokens::non_fungible::{Base, NonFungibleToken};␊ ␊ #[contract]␊ @@ -267,8 +258,7 @@ Generated by [AVA](https://avajs.dev). }␊ }␊ ␊ - #[default_impl]␊ - #[contractimpl]␊ + #[contractimpl(contracttrait)]␊ impl NonFungibleToken for MyToken {␊ type ContractType = Base;␊ ␊ @@ -278,8 +268,7 @@ Generated by [AVA](https://avajs.dev). // Utils␊ //␊ ␊ - #[default_impl]␊ - #[contractimpl]␊ + #[contractimpl(contracttrait)]␊ impl Ownable for MyToken {}␊ ` @@ -288,11 +277,10 @@ Generated by [AVA](https://avajs.dev). > Snapshot 1 `// SPDX-License-Identifier: MIT␊ - // Compatible with OpenZeppelin Stellar Soroban Contracts ^0.4.1␊ + // Compatible with OpenZeppelin Stellar Soroban Contracts ^0.6.0␊ #![no_std]␊ ␊ - use soroban_sdk::{contract, contractimpl, Env, String};␊ - use stellar_macros::default_impl;␊ + use soroban_sdk::{Address, contract, contractimpl, Env, String};␊ use stellar_tokens::non_fungible::{␊ Base, enumerable::{NonFungibleEnumerable, Enumerable}, NonFungibleToken␊ };␊ @@ -310,8 +298,7 @@ Generated by [AVA](https://avajs.dev). }␊ }␊ ␊ - #[default_impl]␊ - #[contractimpl]␊ + #[contractimpl(contracttrait)]␊ impl NonFungibleToken for MyToken {␊ type ContractType = Enumerable;␊ ␊ @@ -321,8 +308,7 @@ Generated by [AVA](https://avajs.dev). // Extensions␊ //␊ ␊ - #[default_impl]␊ - #[contractimpl]␊ + #[contractimpl(contracttrait)]␊ impl NonFungibleEnumerable for MyToken {}␊ ` @@ -331,12 +317,12 @@ Generated by [AVA](https://avajs.dev). > Snapshot 1 `// SPDX-License-Identifier: MIT␊ - // Compatible with OpenZeppelin Stellar Soroban Contracts ^0.4.1␊ + // Compatible with OpenZeppelin Stellar Soroban Contracts ^0.6.0␊ #![no_std]␊ ␊ use soroban_sdk::{Address, contract, contractimpl, Env, String};␊ use stellar_access::ownable::{self as ownable, Ownable};␊ - use stellar_macros::{default_impl, only_owner};␊ + use stellar_macros::only_owner;␊ use stellar_tokens::non_fungible::{␊ Base, consecutive::{NonFungibleConsecutive, Consecutive}, NonFungibleToken␊ };␊ @@ -360,8 +346,7 @@ Generated by [AVA](https://avajs.dev). }␊ }␊ ␊ - #[default_impl]␊ - #[contractimpl]␊ + #[contractimpl(contracttrait)]␊ impl NonFungibleToken for MyToken {␊ type ContractType = Consecutive;␊ ␊ @@ -378,8 +363,7 @@ Generated by [AVA](https://avajs.dev). // Utils␊ //␊ ␊ - #[default_impl]␊ - #[contractimpl]␊ + #[contractimpl(contracttrait)]␊ impl Ownable for MyToken {}␊ ` @@ -388,12 +372,12 @@ Generated by [AVA](https://avajs.dev). > Snapshot 1 `// SPDX-License-Identifier: MIT␊ - // Compatible with OpenZeppelin Stellar Soroban Contracts ^0.4.1␊ + // Compatible with OpenZeppelin Stellar Soroban Contracts ^0.6.0␊ #![no_std]␊ ␊ use soroban_sdk::{Address, contract, contractimpl, Env, String};␊ use stellar_access::ownable::{self as ownable, Ownable};␊ - use stellar_macros::{default_impl, only_owner};␊ + use stellar_macros::only_owner;␊ use stellar_tokens::non_fungible::{␊ Base, burnable::NonFungibleBurnable, consecutive::{NonFungibleConsecutive, Consecutive},␊ NonFungibleToken␊ @@ -418,8 +402,7 @@ Generated by [AVA](https://avajs.dev). }␊ }␊ ␊ - #[default_impl]␊ - #[contractimpl]␊ + #[contractimpl(contracttrait)]␊ impl NonFungibleToken for MyToken {␊ type ContractType = Consecutive;␊ ␊ @@ -429,19 +412,17 @@ Generated by [AVA](https://avajs.dev). // Extensions␊ //␊ ␊ - #[contractimpl]␊ - impl NonFungibleConsecutive for MyToken {}␊ + #[contractimpl(contracttrait)]␊ + impl NonFungibleBurnable for MyToken {}␊ ␊ - #[default_impl]␊ #[contractimpl]␊ - impl NonFungibleBurnable for MyToken {}␊ + impl NonFungibleConsecutive for MyToken {}␊ ␊ //␊ // Utils␊ //␊ ␊ - #[default_impl]␊ - #[contractimpl]␊ + #[contractimpl(contracttrait)]␊ impl Ownable for MyToken {}␊ ` @@ -450,13 +431,13 @@ Generated by [AVA](https://avajs.dev). > Snapshot 1 `// SPDX-License-Identifier: MIT␊ - // Compatible with OpenZeppelin Stellar Soroban Contracts ^0.4.1␊ + // Compatible with OpenZeppelin Stellar Soroban Contracts ^0.6.0␊ #![no_std]␊ ␊ use soroban_sdk::{Address, contract, contractimpl, Env, String};␊ use stellar_access::ownable::{self as ownable, Ownable};␊ use stellar_contract_utils::pausable::{self as pausable, Pausable};␊ - use stellar_macros::{default_impl, only_owner, when_not_paused};␊ + use stellar_macros::{only_owner, when_not_paused};␊ use stellar_tokens::non_fungible::{␊ Base, consecutive::{NonFungibleConsecutive, Consecutive}, NonFungibleToken␊ };␊ @@ -481,8 +462,7 @@ Generated by [AVA](https://avajs.dev). }␊ }␊ ␊ - #[default_impl]␊ - #[contractimpl]␊ + #[contractimpl(contracttrait)]␊ impl NonFungibleToken for MyToken {␊ type ContractType = Consecutive;␊ ␊ @@ -508,6 +488,9 @@ Generated by [AVA](https://avajs.dev). // Utils␊ //␊ ␊ + #[contractimpl(contracttrait)]␊ + impl Ownable for MyToken {}␊ + ␊ #[contractimpl]␊ impl Pausable for MyToken {␊ fn paused(e: &Env) -> bool {␊ @@ -524,10 +507,6 @@ Generated by [AVA](https://avajs.dev). pausable::unpause(e);␊ }␊ }␊ - ␊ - #[default_impl]␊ - #[contractimpl]␊ - impl Ownable for MyToken {}␊ ` ## non-fungible consecutive burnable pausable @@ -535,13 +514,13 @@ Generated by [AVA](https://avajs.dev). > Snapshot 1 `// SPDX-License-Identifier: MIT␊ - // Compatible with OpenZeppelin Stellar Soroban Contracts ^0.4.1␊ + // Compatible with OpenZeppelin Stellar Soroban Contracts ^0.6.0␊ #![no_std]␊ ␊ use soroban_sdk::{Address, contract, contractimpl, Env, String};␊ use stellar_access::ownable::{self as ownable, Ownable};␊ use stellar_contract_utils::pausable::{self as pausable, Pausable};␊ - use stellar_macros::{default_impl, only_owner, when_not_paused};␊ + use stellar_macros::{only_owner, when_not_paused};␊ use stellar_tokens::non_fungible::{␊ Base, burnable::NonFungibleBurnable, consecutive::{NonFungibleConsecutive, Consecutive},␊ NonFungibleToken␊ @@ -567,8 +546,7 @@ Generated by [AVA](https://avajs.dev). }␊ }␊ ␊ - #[default_impl]␊ - #[contractimpl]␊ + #[contractimpl(contracttrait)]␊ impl NonFungibleToken for MyToken {␊ type ContractType = Consecutive;␊ ␊ @@ -587,7 +565,7 @@ Generated by [AVA](https://avajs.dev). // Extensions␊ //␊ ␊ - #[contractimpl]␊ + #[contractimpl(contracttrait)]␊ impl NonFungibleBurnable for MyToken {␊ #[when_not_paused]␊ fn burn(e: &Env, from: Address, token_id: u32) {␊ @@ -607,6 +585,9 @@ Generated by [AVA](https://avajs.dev). // Utils␊ //␊ ␊ + #[contractimpl(contracttrait)]␊ + impl Ownable for MyToken {}␊ + ␊ #[contractimpl]␊ impl Pausable for MyToken {␊ fn paused(e: &Env) -> bool {␊ @@ -623,10 +604,6 @@ Generated by [AVA](https://avajs.dev). pausable::unpause(e);␊ }␊ }␊ - ␊ - #[default_impl]␊ - #[contractimpl]␊ - impl Ownable for MyToken {}␊ ` ## non-fungible sequential @@ -634,11 +611,10 @@ Generated by [AVA](https://avajs.dev). > Snapshot 1 `// SPDX-License-Identifier: MIT␊ - // Compatible with OpenZeppelin Stellar Soroban Contracts ^0.4.1␊ + // Compatible with OpenZeppelin Stellar Soroban Contracts ^0.6.0␊ #![no_std]␊ ␊ - use soroban_sdk::{contract, contractimpl, Env, String};␊ - use stellar_macros::default_impl;␊ + use soroban_sdk::{Address, contract, contractimpl, Env, String};␊ use stellar_tokens::non_fungible::{Base, NonFungibleToken};␊ ␊ #[contract]␊ @@ -654,8 +630,7 @@ Generated by [AVA](https://avajs.dev). }␊ }␊ ␊ - #[default_impl]␊ - #[contractimpl]␊ + #[contractimpl(contracttrait)]␊ impl NonFungibleToken for MyToken {␊ type ContractType = Base;␊ ␊ @@ -667,13 +642,13 @@ Generated by [AVA](https://avajs.dev). > Snapshot 1 `// SPDX-License-Identifier: MIT␊ - // Compatible with OpenZeppelin Stellar Soroban Contracts ^0.4.1␊ + // Compatible with OpenZeppelin Stellar Soroban Contracts ^0.6.0␊ #![no_std]␊ ␊ use soroban_sdk::{Address, contract, contractimpl, Env, String};␊ use stellar_access::ownable::{self as ownable, Ownable};␊ use stellar_contract_utils::upgradeable::UpgradeableInternal;␊ - use stellar_macros::{default_impl, only_owner, Upgradeable};␊ + use stellar_macros::{only_owner, Upgradeable};␊ use stellar_tokens::non_fungible::{Base, NonFungibleToken};␊ ␊ #[derive(Upgradeable)]␊ @@ -691,8 +666,7 @@ Generated by [AVA](https://avajs.dev). }␊ }␊ ␊ - #[default_impl]␊ - #[contractimpl]␊ + #[contractimpl(contracttrait)]␊ impl NonFungibleToken for MyToken {␊ type ContractType = Base;␊ ␊ @@ -709,8 +683,7 @@ Generated by [AVA](https://avajs.dev). }␊ }␊ ␊ - #[default_impl]␊ - #[contractimpl]␊ + #[contractimpl(contracttrait)]␊ impl Ownable for MyToken {}␊ ` @@ -719,14 +692,14 @@ Generated by [AVA](https://avajs.dev). > Snapshot 1 `// SPDX-License-Identifier: MIT␊ - // Compatible with OpenZeppelin Stellar Soroban Contracts ^0.4.1␊ + // Compatible with OpenZeppelin Stellar Soroban Contracts ^0.6.0␊ #![no_std]␊ ␊ use soroban_sdk::{Address, contract, contractimpl, Env, String};␊ use stellar_access::ownable::{self as ownable, Ownable};␊ use stellar_contract_utils::pausable::{self as pausable, Pausable};␊ use stellar_contract_utils::upgradeable::UpgradeableInternal;␊ - use stellar_macros::{default_impl, only_owner, Upgradeable, when_not_paused};␊ + use stellar_macros::{only_owner, Upgradeable, when_not_paused};␊ use stellar_tokens::non_fungible::{␊ Base, burnable::NonFungibleBurnable, enumerable::{NonFungibleEnumerable, Enumerable},␊ NonFungibleToken␊ @@ -753,8 +726,7 @@ Generated by [AVA](https://avajs.dev). }␊ }␊ ␊ - #[default_impl]␊ - #[contractimpl]␊ + #[contractimpl(contracttrait)]␊ impl NonFungibleToken for MyToken {␊ type ContractType = Enumerable;␊ ␊ @@ -773,7 +745,7 @@ Generated by [AVA](https://avajs.dev). // Extensions␊ //␊ ␊ - #[contractimpl]␊ + #[contractimpl(contracttrait)]␊ impl NonFungibleBurnable for MyToken {␊ #[when_not_paused]␊ fn burn(e: &Env, from: Address, token_id: u32) {␊ @@ -786,8 +758,7 @@ Generated by [AVA](https://avajs.dev). }␊ }␊ ␊ - #[default_impl]␊ - #[contractimpl]␊ + #[contractimpl(contracttrait)]␊ impl NonFungibleEnumerable for MyToken {}␊ ␊ //␊ @@ -800,6 +771,9 @@ Generated by [AVA](https://avajs.dev). }␊ }␊ ␊ + #[contractimpl(contracttrait)]␊ + impl Ownable for MyToken {}␊ + ␊ #[contractimpl]␊ impl Pausable for MyToken {␊ fn paused(e: &Env) -> bool {␊ @@ -816,10 +790,6 @@ Generated by [AVA](https://avajs.dev). pausable::unpause(e);␊ }␊ }␊ - ␊ - #[default_impl]␊ - #[contractimpl]␊ - impl Ownable for MyToken {}␊ ` ## non-fungible - complex name @@ -827,13 +797,13 @@ Generated by [AVA](https://avajs.dev). > Snapshot 1 `// SPDX-License-Identifier: MIT␊ - // Compatible with OpenZeppelin Stellar Soroban Contracts ^0.4.1␊ + // Compatible with OpenZeppelin Stellar Soroban Contracts ^0.6.0␊ #![no_std]␊ ␊ use soroban_sdk::{Address, contract, contractimpl, Env, String};␊ use stellar_access::ownable::{self as ownable, Ownable};␊ use stellar_contract_utils::pausable::{self as pausable, Pausable};␊ - use stellar_macros::{default_impl, only_owner, when_not_paused};␊ + use stellar_macros::{only_owner, when_not_paused};␊ use stellar_tokens::non_fungible::{Base, burnable::NonFungibleBurnable, NonFungibleToken};␊ ␊ #[contract]␊ @@ -850,8 +820,7 @@ Generated by [AVA](https://avajs.dev). }␊ }␊ ␊ - #[default_impl]␊ - #[contractimpl]␊ + #[contractimpl(contracttrait)]␊ impl NonFungibleToken for CustomToken {␊ type ContractType = Base;␊ ␊ @@ -870,7 +839,7 @@ Generated by [AVA](https://avajs.dev). // Extensions␊ //␊ ␊ - #[contractimpl]␊ + #[contractimpl(contracttrait)]␊ impl NonFungibleBurnable for CustomToken {␊ #[when_not_paused]␊ fn burn(e: &Env, from: Address, token_id: u32) {␊ @@ -887,6 +856,9 @@ Generated by [AVA](https://avajs.dev). // Utils␊ //␊ ␊ + #[contractimpl(contracttrait)]␊ + impl Ownable for CustomToken {}␊ + ␊ #[contractimpl]␊ impl Pausable for CustomToken {␊ fn paused(e: &Env) -> bool {␊ @@ -903,10 +875,6 @@ Generated by [AVA](https://avajs.dev). pausable::unpause(e);␊ }␊ }␊ - ␊ - #[default_impl]␊ - #[contractimpl]␊ - impl Ownable for CustomToken {}␊ ` ## non-fungible explicit trait implementations @@ -914,7 +882,7 @@ Generated by [AVA](https://avajs.dev). > Snapshot 1 `// SPDX-License-Identifier: MIT␊ - // Compatible with OpenZeppelin Stellar Soroban Contracts ^0.4.1␊ + // Compatible with OpenZeppelin Stellar Soroban Contracts ^0.6.0␊ #![no_std]␊ ␊ use soroban_sdk::{Address, contract, contractimpl, Env, String};␊ @@ -994,11 +962,10 @@ Generated by [AVA](https://avajs.dev). > Snapshot 1 `// SPDX-License-Identifier: MIT␊ - // Compatible with OpenZeppelin Stellar Soroban Contracts ^0.4.1␊ + // Compatible with OpenZeppelin Stellar Soroban Contracts ^0.6.0␊ #![no_std]␊ ␊ - use soroban_sdk::{contract, contractimpl, Env, String};␊ - use stellar_macros::default_impl;␊ + use soroban_sdk::{Address, contract, contractimpl, Env, String};␊ use stellar_tokens::non_fungible::{Base, NonFungibleToken};␊ ␊ #[contract]␊ @@ -1014,8 +981,7 @@ Generated by [AVA](https://avajs.dev). }␊ }␊ ␊ - #[default_impl]␊ - #[contractimpl]␊ + #[contractimpl(contracttrait)]␊ impl NonFungibleToken for MyToken {␊ type ContractType = Base;␊ ␊ diff --git a/packages/core/stellar/src/non-fungible.test.ts.snap b/packages/core/stellar/src/non-fungible.test.ts.snap index 7c8e15e563443a82ab1ce422dd5faaa5993a2d27..5dab96554cb7f11bbb8a94daed1fe317c588af76 100644 GIT binary patch literal 1900 zcmV-y2b1_gRzVc^V*e}EAsco zjVo_o{pD(_1vZ|3`R&5vz{P~)g*6Wo5%>XS5IkAiv|25&LOT%>QXc3AVh5~8n0$|; z2!{ay8v=(RVqk+Z+C~JdP$C#|1qVOeUwp85-@1GIIiU_0-j-#>90Q&fbhx(*;o%pa z$1vwMaI<>lRnUn-8?2H&8*B&`knN+TR6yFIBj_$B96~~glXn=x!$*i?8+=2_SJ|^o zS?*}bvhF_5MQ>SA+y-2**cIT(K~h31Alu%umF74czU(zHH)WJ<6 zGQFx*_(7*l!^TRRU#k_QtsvxBI2|mI93Zk(%mO=U+Rmh9HIA&Ks*UFI8^KT@<};I3 zjSqavDs~hH5iZ8cro4HWXtQKlM^-kVV|6HlcFYK>9n;r7)W-B%*DmOo&Mg3;V&F&F zL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Acf!#CIVF~h+X?tVNS) z(9rprQq0Sx^x1rj8bcLM6(`6wMp49Q7ti$@ z$(8Qk$Vw>M4?glr9%-E@Zihh^J24SK=!DqYlv4Z8M|CwmqC|*~IxY(|UP?cDmH+XbX71 z*aWsK<0)m@l(tf0uR-l3q-vZfh3FBjrL_iSrNBJCw7lLBP9+wNSy1P+1GS(?8g^8{ zY~IxmPp6a5q`1sKCFgbi)ws-G=Dbcb84cb+l9oy~(;~j$ty95irm(I5KM;o6lBZt) E0FZ8^k^lez diff --git a/packages/core/stellar/src/non-fungible.ts b/packages/core/stellar/src/non-fungible.ts index 1029695a6..dbd2defa2 100644 --- a/packages/core/stellar/src/non-fungible.ts +++ b/packages/core/stellar/src/non-fungible.ts @@ -155,17 +155,16 @@ function addBase( c.addUseClause('stellar_tokens::non_fungible', 'Base'); c.addUseClause('stellar_tokens::non_fungible', 'NonFungibleToken'); if (explicitImplementations) c.addUseClause('stellar_tokens::non_fungible', 'ContractOverrides'); - else c.addUseClause('stellar_macros', 'default_impl'); c.addUseClause('soroban_sdk', 'contract'); c.addUseClause('soroban_sdk', 'contractimpl'); c.addUseClause('soroban_sdk', 'String'); c.addUseClause('soroban_sdk', 'Env'); - if (explicitImplementations || pausable) c.addUseClause('soroban_sdk', 'Address'); + c.addUseClause('soroban_sdk', 'Address'); const nonFungibleTokenTrait = { traitName: 'NonFungibleToken', structName: c.name, - tags: explicitImplementations ? ['contractimpl'] : ['default_impl', 'contractimpl'], + tags: explicitImplementations ? ['contractimpl'] : ['contractimpl(contracttrait)'], assocType: 'type ContractType = Base;', }; @@ -190,7 +189,7 @@ function addBurnable(c: ContractBuilder, pausable: boolean, explicitImplementati const nonFungibleBurnableTrait = { traitName: 'NonFungibleBurnable', structName: c.name, - tags: ['contractimpl'], + tags: explicitImplementations ? ['contractimpl'] : ['contractimpl(contracttrait)'], section: 'Extensions', }; @@ -205,21 +204,17 @@ function addBurnable(c: ContractBuilder, pausable: boolean, explicitImplementati } else if (explicitImplementations) c.addTraitForEachFunctions(nonFungibleBurnableTrait, nonFungibleBurnableFunctions); else { - // prepend '#[default_impl]' - nonFungibleBurnableTrait.tags.unshift('default_impl'); c.addTraitImplBlock(nonFungibleBurnableTrait); } } function addEnumerable(c: ContractBuilder, explicitImplementations: boolean) { c.addUseClause('stellar_tokens::non_fungible', 'enumerable::{NonFungibleEnumerable, Enumerable}'); - if (explicitImplementations) c.addUseClause('soroban_sdk', 'Address'); - else c.addUseClause('stellar_macros', 'default_impl'); const nonFungibleEnumerableTrait = { traitName: 'NonFungibleEnumerable', structName: c.name, - tags: explicitImplementations ? ['contractimpl'] : ['default_impl', 'contractimpl'], + tags: explicitImplementations ? ['contractimpl'] : ['contractimpl(contracttrait)'], section: 'Extensions', }; if (explicitImplementations) @@ -231,7 +226,6 @@ function addEnumerable(c: ContractBuilder, explicitImplementations: boolean) { function addConsecutive(c: ContractBuilder, pausable: boolean, access: Access, explicitImplementations: boolean) { c.addUseClause('stellar_tokens::non_fungible', 'consecutive::{NonFungibleConsecutive, Consecutive}'); - c.addUseClause('soroban_sdk', 'Address'); const effectiveAccess = access === false ? DEFAULT_ACCESS_CONTROL : access; const nonFungibleConsecutiveTrait = { @@ -274,7 +268,6 @@ function addMintable( access: Access, explicitImplementations: boolean, ) { - c.addUseClause('soroban_sdk', 'Address'); const accessProps = { useMacro: true, role: 'minter', caller: 'caller' }; const effectiveAccess = access === false ? DEFAULT_ACCESS_CONTROL : access; diff --git a/packages/core/stellar/src/set-access-control.ts b/packages/core/stellar/src/set-access-control.ts index e7ee71b74..f9edf362f 100644 --- a/packages/core/stellar/src/set-access-control.ts +++ b/packages/core/stellar/src/set-access-control.ts @@ -29,7 +29,7 @@ export function setAccessControl(c: ContractBuilder, access: Access, explicitImp const ownableTrait = { traitName: 'Ownable', structName: c.name, - tags: explicitImplementations ? ['contractimpl'] : ['default_impl', 'contractimpl'], + tags: explicitImplementations ? ['contractimpl'] : ['contractimpl(contracttrait)'], section: 'Utils', }; if (explicitImplementations) { @@ -51,7 +51,7 @@ export function setAccessControl(c: ContractBuilder, access: Access, explicitImp const accessControlTrait = { traitName: 'AccessControl', structName: c.name, - tags: explicitImplementations ? ['contractimpl'] : ['default_impl', 'contractimpl'], + tags: explicitImplementations ? ['contractimpl'] : ['contractimpl(contracttrait)'], section: 'Utils', }; if (explicitImplementations) { @@ -105,8 +105,9 @@ export function requireAccessControl( if (caller && role) { c.addUseClause('soroban_sdk', 'Symbol'); + c.addUseClause('soroban_sdk', 'Vec'); c.addConstructorArgument({ name: role, type: 'Address' }); - c.addConstructorCode(`access_control::grant_role_no_auth(e, &admin, &${role}, &Symbol::new(e, "${role}"));`); + c.addConstructorCode(`access_control::grant_role_no_auth(e, &${role}, &Symbol::new(e, "${role}"), &admin);`); if (useMacro) { c.addUseClause('stellar_macros', 'only_role'); @@ -114,7 +115,7 @@ export function requireAccessControl( } else { c.addFunctionCodeBefore( fn, - [`access_control::ensure_role(e, ${caller}, &Symbol::new(e, "${role}"));`], + [`access_control::ensure_role(e, &Symbol::new(e, "${role}"), ${caller});`], trait, ); } @@ -162,6 +163,11 @@ const accessControlFunctions = defineFunctions({ returns: 'Option', code: ['access_control::has_role(e, &account, &role)'], }, + get_existing_roles: { + args: [getSelfArg()], + returns: 'Vec', + code: ['access_control::get_existing_roles(e)'], + }, get_role_member_count: { args: [getSelfArg(), { name: 'role', type: 'Symbol' }], returns: 'u32', @@ -185,24 +191,24 @@ const accessControlFunctions = defineFunctions({ grant_role: { args: [ getSelfArg(), - { name: 'caller', type: 'Address' }, { name: 'account', type: 'Address' }, { name: 'role', type: 'Symbol' }, + { name: 'caller', type: 'Address' }, ], - code: ['access_control::grant_role(e, &caller, &account, &role);'], + code: ['access_control::grant_role(e, &account, &role, &caller);'], }, revoke_role: { args: [ getSelfArg(), - { name: 'caller', type: 'Address' }, { name: 'account', type: 'Address' }, { name: 'role', type: 'Symbol' }, + { name: 'caller', type: 'Address' }, ], - code: ['access_control::revoke_role(e, &caller, &account, &role);'], + code: ['access_control::revoke_role(e, &account, &role, &caller);'], }, renounce_role: { - args: [getSelfArg(), { name: 'caller', type: 'Address' }, { name: 'role', type: 'Symbol' }], - code: ['access_control::renounce_role(e, &caller, &role);'], + args: [getSelfArg(), { name: 'role', type: 'Symbol' }, { name: 'caller', type: 'Address' }], + code: ['access_control::renounce_role(e, &role, &caller);'], }, transfer_admin_role: { args: [getSelfArg(), { name: 'new_admin', type: 'Address' }, { name: 'live_until_ledger', type: 'u32' }], diff --git a/packages/core/stellar/src/stablecoin.test.ts.md b/packages/core/stellar/src/stablecoin.test.ts.md index abb7da355..d2225ae65 100644 --- a/packages/core/stellar/src/stablecoin.test.ts.md +++ b/packages/core/stellar/src/stablecoin.test.ts.md @@ -9,11 +9,12 @@ Generated by [AVA](https://avajs.dev). > Snapshot 1 `// SPDX-License-Identifier: MIT␊ - // Compatible with OpenZeppelin Stellar Soroban Contracts ^0.4.1␊ + // Compatible with OpenZeppelin Stellar Soroban Contracts ^0.6.0␊ #![no_std]␊ ␊ - use soroban_sdk::{contract, contractimpl, Env, String};␊ - use stellar_macros::default_impl;␊ + use soroban_sdk::{␊ + Address, contract, contractimpl, Env, MuxedAddress, String, Symbol, Vec␊ + };␊ use stellar_tokens::fungible::{Base, FungibleToken};␊ ␊ #[contract]␊ @@ -22,12 +23,11 @@ Generated by [AVA](https://avajs.dev). #[contractimpl]␊ impl MyStablecoin {␊ pub fn __constructor(e: &Env) {␊ - Base::set_metadata(e, 18, String::from_str(e, "MyStablecoin"), String::from_str(e, "MST"));␊ + Base::set_metadata(e, 7, String::from_str(e, "MyStablecoin"), String::from_str(e, "MST"));␊ }␊ }␊ ␊ - #[default_impl]␊ - #[contractimpl]␊ + #[contractimpl(contracttrait)]␊ impl FungibleToken for MyStablecoin {␊ type ContractType = Base;␊ ␊ @@ -39,11 +39,12 @@ Generated by [AVA](https://avajs.dev). > Snapshot 1 `// SPDX-License-Identifier: MIT␊ - // Compatible with OpenZeppelin Stellar Soroban Contracts ^0.4.1␊ + // Compatible with OpenZeppelin Stellar Soroban Contracts ^0.6.0␊ #![no_std]␊ ␊ - use soroban_sdk::{Address, contract, contractimpl, Env, String};␊ - use stellar_macros::default_impl;␊ + use soroban_sdk::{␊ + Address, contract, contractimpl, Env, MuxedAddress, String, Symbol, Vec␊ + };␊ use stellar_tokens::fungible::{Base, burnable::FungibleBurnable, FungibleToken};␊ ␊ #[contract]␊ @@ -52,12 +53,11 @@ Generated by [AVA](https://avajs.dev). #[contractimpl]␊ impl MyStablecoin {␊ pub fn __constructor(e: &Env) {␊ - Base::set_metadata(e, 18, String::from_str(e, "MyStablecoin"), String::from_str(e, "MST"));␊ + Base::set_metadata(e, 7, String::from_str(e, "MyStablecoin"), String::from_str(e, "MST"));␊ }␊ }␊ ␊ - #[default_impl]␊ - #[contractimpl]␊ + #[contractimpl(contracttrait)]␊ impl FungibleToken for MyStablecoin {␊ type ContractType = Base;␊ ␊ @@ -67,8 +67,7 @@ Generated by [AVA](https://avajs.dev). // Extensions␊ //␊ ␊ - #[default_impl]␊ - #[contractimpl]␊ + #[contractimpl(contracttrait)]␊ impl FungibleBurnable for MyStablecoin {}␊ ` @@ -77,13 +76,15 @@ Generated by [AVA](https://avajs.dev). > Snapshot 1 `// SPDX-License-Identifier: MIT␊ - // Compatible with OpenZeppelin Stellar Soroban Contracts ^0.4.1␊ + // Compatible with OpenZeppelin Stellar Soroban Contracts ^0.6.0␊ #![no_std]␊ ␊ - use soroban_sdk::{Address, contract, contractimpl, Env, String};␊ + use soroban_sdk::{␊ + Address, contract, contractimpl, Env, MuxedAddress, String, Symbol, Vec␊ + };␊ use stellar_access::ownable::{self as ownable, Ownable};␊ use stellar_contract_utils::pausable::{self as pausable, Pausable};␊ - use stellar_macros::{default_impl, only_owner, when_not_paused};␊ + use stellar_macros::{only_owner, when_not_paused};␊ use stellar_tokens::fungible::{Base, FungibleToken};␊ ␊ #[contract]␊ @@ -92,18 +93,17 @@ Generated by [AVA](https://avajs.dev). #[contractimpl]␊ impl MyStablecoin {␊ pub fn __constructor(e: &Env, owner: Address) {␊ - Base::set_metadata(e, 18, String::from_str(e, "MyStablecoin"), String::from_str(e, "MST"));␊ + Base::set_metadata(e, 7, String::from_str(e, "MyStablecoin"), String::from_str(e, "MST"));␊ ownable::set_owner(e, &owner);␊ }␊ }␊ ␊ - #[default_impl]␊ - #[contractimpl]␊ + #[contractimpl(contracttrait)]␊ impl FungibleToken for MyStablecoin {␊ type ContractType = Base;␊ ␊ #[when_not_paused]␊ - fn transfer(e: &Env, from: Address, to: Address, amount: i128) {␊ + fn transfer(e: &Env, from: Address, to: MuxedAddress, amount: i128) {␊ Self::ContractType::transfer(e, &from, &to, amount);␊ }␊ ␊ @@ -117,6 +117,9 @@ Generated by [AVA](https://avajs.dev). // Utils␊ //␊ ␊ + #[contractimpl(contracttrait)]␊ + impl Ownable for MyStablecoin {}␊ + ␊ #[contractimpl]␊ impl Pausable for MyStablecoin {␊ fn paused(e: &Env) -> bool {␊ @@ -133,10 +136,6 @@ Generated by [AVA](https://avajs.dev). pausable::unpause(e);␊ }␊ }␊ - ␊ - #[default_impl]␊ - #[contractimpl]␊ - impl Ownable for MyStablecoin {}␊ ` ## stablecoin burnable pausable @@ -144,13 +143,15 @@ Generated by [AVA](https://avajs.dev). > Snapshot 1 `// SPDX-License-Identifier: MIT␊ - // Compatible with OpenZeppelin Stellar Soroban Contracts ^0.4.1␊ + // Compatible with OpenZeppelin Stellar Soroban Contracts ^0.6.0␊ #![no_std]␊ ␊ - use soroban_sdk::{Address, contract, contractimpl, Env, String};␊ + use soroban_sdk::{␊ + Address, contract, contractimpl, Env, MuxedAddress, String, Symbol, Vec␊ + };␊ use stellar_access::ownable::{self as ownable, Ownable};␊ use stellar_contract_utils::pausable::{self as pausable, Pausable};␊ - use stellar_macros::{default_impl, only_owner, when_not_paused};␊ + use stellar_macros::{only_owner, when_not_paused};␊ use stellar_tokens::fungible::{Base, burnable::FungibleBurnable, FungibleToken};␊ ␊ #[contract]␊ @@ -159,18 +160,17 @@ Generated by [AVA](https://avajs.dev). #[contractimpl]␊ impl MyStablecoin {␊ pub fn __constructor(e: &Env, owner: Address) {␊ - Base::set_metadata(e, 18, String::from_str(e, "MyStablecoin"), String::from_str(e, "MST"));␊ + Base::set_metadata(e, 7, String::from_str(e, "MyStablecoin"), String::from_str(e, "MST"));␊ ownable::set_owner(e, &owner);␊ }␊ }␊ ␊ - #[default_impl]␊ - #[contractimpl]␊ + #[contractimpl(contracttrait)]␊ impl FungibleToken for MyStablecoin {␊ type ContractType = Base;␊ ␊ #[when_not_paused]␊ - fn transfer(e: &Env, from: Address, to: Address, amount: i128) {␊ + fn transfer(e: &Env, from: Address, to: MuxedAddress, amount: i128) {␊ Self::ContractType::transfer(e, &from, &to, amount);␊ }␊ ␊ @@ -184,7 +184,7 @@ Generated by [AVA](https://avajs.dev). // Extensions␊ //␊ ␊ - #[contractimpl]␊ + #[contractimpl(contracttrait)]␊ impl FungibleBurnable for MyStablecoin {␊ #[when_not_paused]␊ fn burn(e: &Env, from: Address, amount: i128) {␊ @@ -201,6 +201,9 @@ Generated by [AVA](https://avajs.dev). // Utils␊ //␊ ␊ + #[contractimpl(contracttrait)]␊ + impl Ownable for MyStablecoin {}␊ + ␊ #[contractimpl]␊ impl Pausable for MyStablecoin {␊ fn paused(e: &Env) -> bool {␊ @@ -217,10 +220,6 @@ Generated by [AVA](https://avajs.dev). pausable::unpause(e);␊ }␊ }␊ - ␊ - #[default_impl]␊ - #[contractimpl]␊ - impl Ownable for MyStablecoin {}␊ ` ## stablecoin preminted @@ -228,11 +227,12 @@ Generated by [AVA](https://avajs.dev). > Snapshot 1 `// SPDX-License-Identifier: MIT␊ - // Compatible with OpenZeppelin Stellar Soroban Contracts ^0.4.1␊ + // Compatible with OpenZeppelin Stellar Soroban Contracts ^0.6.0␊ #![no_std]␊ ␊ - use soroban_sdk::{Address, contract, contractimpl, Env, String};␊ - use stellar_macros::default_impl;␊ + use soroban_sdk::{␊ + Address, contract, contractimpl, Env, MuxedAddress, String, Symbol, Vec␊ + };␊ use stellar_tokens::fungible::{Base, FungibleToken};␊ ␊ #[contract]␊ @@ -241,13 +241,12 @@ Generated by [AVA](https://avajs.dev). #[contractimpl]␊ impl MyStablecoin {␊ pub fn __constructor(e: &Env, recipient: Address) {␊ - Base::set_metadata(e, 18, String::from_str(e, "MyStablecoin"), String::from_str(e, "MST"));␊ - Base::mint(e, &recipient, 1000000000000000000000);␊ + Base::set_metadata(e, 7, String::from_str(e, "MyStablecoin"), String::from_str(e, "MST"));␊ + Base::mint(e, &recipient, 10000000000);␊ }␊ }␊ ␊ - #[default_impl]␊ - #[contractimpl]␊ + #[contractimpl(contracttrait)]␊ impl FungibleToken for MyStablecoin {␊ type ContractType = Base;␊ ␊ @@ -259,11 +258,12 @@ Generated by [AVA](https://avajs.dev). > Snapshot 1 `// SPDX-License-Identifier: MIT␊ - // Compatible with OpenZeppelin Stellar Soroban Contracts ^0.4.1␊ + // Compatible with OpenZeppelin Stellar Soroban Contracts ^0.6.0␊ #![no_std]␊ ␊ - use soroban_sdk::{contract, contractimpl, Env, String};␊ - use stellar_macros::default_impl;␊ + use soroban_sdk::{␊ + Address, contract, contractimpl, Env, MuxedAddress, String, Symbol, Vec␊ + };␊ use stellar_tokens::fungible::{Base, FungibleToken};␊ ␊ #[contract]␊ @@ -272,12 +272,11 @@ Generated by [AVA](https://avajs.dev). #[contractimpl]␊ impl MyStablecoin {␊ pub fn __constructor(e: &Env) {␊ - Base::set_metadata(e, 18, String::from_str(e, "MyStablecoin"), String::from_str(e, "MST"));␊ + Base::set_metadata(e, 7, String::from_str(e, "MyStablecoin"), String::from_str(e, "MST"));␊ }␊ }␊ ␊ - #[default_impl]␊ - #[contractimpl]␊ + #[contractimpl(contracttrait)]␊ impl FungibleToken for MyStablecoin {␊ type ContractType = Base;␊ ␊ @@ -289,11 +288,12 @@ Generated by [AVA](https://avajs.dev). > Snapshot 1 `// SPDX-License-Identifier: MIT␊ - // Compatible with OpenZeppelin Stellar Soroban Contracts ^0.4.1␊ + // Compatible with OpenZeppelin Stellar Soroban Contracts ^0.6.0␊ #![no_std]␊ ␊ - use soroban_sdk::{Address, contract, contractimpl, Env, String};␊ - use stellar_macros::default_impl;␊ + use soroban_sdk::{␊ + Address, contract, contractimpl, Env, MuxedAddress, String, Symbol, Vec␊ + };␊ use stellar_tokens::fungible::{Base, FungibleToken};␊ ␊ #[contract]␊ @@ -302,12 +302,11 @@ Generated by [AVA](https://avajs.dev). #[contractimpl]␊ impl MyStablecoin {␊ pub fn __constructor(e: &Env) {␊ - Base::set_metadata(e, 18, String::from_str(e, "MyStablecoin"), String::from_str(e, "MST"));␊ + Base::set_metadata(e, 7, String::from_str(e, "MyStablecoin"), String::from_str(e, "MST"));␊ }␊ }␊ ␊ - #[default_impl]␊ - #[contractimpl]␊ + #[contractimpl(contracttrait)]␊ impl FungibleToken for MyStablecoin {␊ type ContractType = Base;␊ ␊ @@ -319,12 +318,13 @@ Generated by [AVA](https://avajs.dev). > Snapshot 1 `// SPDX-License-Identifier: MIT␊ - // Compatible with OpenZeppelin Stellar Soroban Contracts ^0.4.1␊ + // Compatible with OpenZeppelin Stellar Soroban Contracts ^0.6.0␊ #![no_std]␊ ␊ - use soroban_sdk::{Address, contract, contractimpl, Env, String};␊ + use soroban_sdk::{␊ + Address, contract, contractimpl, Env, MuxedAddress, String, Symbol, Vec␊ + };␊ use stellar_access::ownable::{self as ownable, Ownable};␊ - use stellar_macros::default_impl;␊ use stellar_tokens::fungible::{Base, FungibleToken};␊ ␊ #[contract]␊ @@ -333,13 +333,12 @@ Generated by [AVA](https://avajs.dev). #[contractimpl]␊ impl MyStablecoin {␊ pub fn __constructor(e: &Env, owner: Address) {␊ - Base::set_metadata(e, 18, String::from_str(e, "MyStablecoin"), String::from_str(e, "MST"));␊ + Base::set_metadata(e, 7, String::from_str(e, "MyStablecoin"), String::from_str(e, "MST"));␊ ownable::set_owner(e, &owner);␊ }␊ }␊ ␊ - #[default_impl]␊ - #[contractimpl]␊ + #[contractimpl(contracttrait)]␊ impl FungibleToken for MyStablecoin {␊ type ContractType = Base;␊ ␊ @@ -349,8 +348,7 @@ Generated by [AVA](https://avajs.dev). // Utils␊ //␊ ␊ - #[default_impl]␊ - #[contractimpl]␊ + #[contractimpl(contracttrait)]␊ impl Ownable for MyStablecoin {}␊ ` @@ -359,12 +357,13 @@ Generated by [AVA](https://avajs.dev). > Snapshot 1 `// SPDX-License-Identifier: MIT␊ - // Compatible with OpenZeppelin Stellar Soroban Contracts ^0.4.1␊ + // Compatible with OpenZeppelin Stellar Soroban Contracts ^0.6.0␊ #![no_std]␊ ␊ - use soroban_sdk::{Address, contract, contractimpl, Env, String};␊ + use soroban_sdk::{␊ + Address, contract, contractimpl, Env, MuxedAddress, String, Symbol, Vec␊ + };␊ use stellar_access::access_control::{self as access_control, AccessControl};␊ - use stellar_macros::default_impl;␊ use stellar_tokens::fungible::{Base, FungibleToken};␊ ␊ #[contract]␊ @@ -373,13 +372,12 @@ Generated by [AVA](https://avajs.dev). #[contractimpl]␊ impl MyStablecoin {␊ pub fn __constructor(e: &Env, admin: Address) {␊ - Base::set_metadata(e, 18, String::from_str(e, "MyStablecoin"), String::from_str(e, "MST"));␊ + Base::set_metadata(e, 7, String::from_str(e, "MyStablecoin"), String::from_str(e, "MST"));␊ access_control::set_admin(e, &admin);␊ }␊ }␊ ␊ - #[default_impl]␊ - #[contractimpl]␊ + #[contractimpl(contracttrait)]␊ impl FungibleToken for MyStablecoin {␊ type ContractType = Base;␊ ␊ @@ -389,8 +387,7 @@ Generated by [AVA](https://avajs.dev). // Utils␊ //␊ ␊ - #[default_impl]␊ - #[contractimpl]␊ + #[contractimpl(contracttrait)]␊ impl AccessControl for MyStablecoin {}␊ ` @@ -399,12 +396,14 @@ Generated by [AVA](https://avajs.dev). > Snapshot 1 `// SPDX-License-Identifier: MIT␊ - // Compatible with OpenZeppelin Stellar Soroban Contracts ^0.4.1␊ + // Compatible with OpenZeppelin Stellar Soroban Contracts ^0.6.0␊ #![no_std]␊ ␊ - use soroban_sdk::{Address, contract, contractimpl, Env, String};␊ + use soroban_sdk::{␊ + Address, contract, contractimpl, Env, MuxedAddress, String, Symbol, Vec␊ + };␊ use stellar_access::ownable::{self as ownable, Ownable};␊ - use stellar_macros::{default_impl, only_owner};␊ + use stellar_macros::only_owner;␊ use stellar_tokens::fungible::{␊ allowlist::{AllowList, FungibleAllowList}, Base, FungibleToken␊ };␊ @@ -415,13 +414,12 @@ Generated by [AVA](https://avajs.dev). #[contractimpl]␊ impl MyStablecoin {␊ pub fn __constructor(e: &Env, owner: Address) {␊ - Base::set_metadata(e, 18, String::from_str(e, "MyStablecoin"), String::from_str(e, "MST"));␊ + Base::set_metadata(e, 7, String::from_str(e, "MyStablecoin"), String::from_str(e, "MST"));␊ ownable::set_owner(e, &owner);␊ }␊ }␊ ␊ - #[default_impl]␊ - #[contractimpl]␊ + #[contractimpl(contracttrait)]␊ impl FungibleToken for MyStablecoin {␊ type ContractType = AllowList;␊ ␊ @@ -452,8 +450,7 @@ Generated by [AVA](https://avajs.dev). // Utils␊ //␊ ␊ - #[default_impl]␊ - #[contractimpl]␊ + #[contractimpl(contracttrait)]␊ impl Ownable for MyStablecoin {}␊ ` @@ -462,12 +459,14 @@ Generated by [AVA](https://avajs.dev). > Snapshot 1 `// SPDX-License-Identifier: MIT␊ - // Compatible with OpenZeppelin Stellar Soroban Contracts ^0.4.1␊ + // Compatible with OpenZeppelin Stellar Soroban Contracts ^0.6.0␊ #![no_std]␊ ␊ - use soroban_sdk::{Address, contract, contractimpl, Env, String};␊ + use soroban_sdk::{␊ + Address, contract, contractimpl, Env, MuxedAddress, String, Symbol, Vec␊ + };␊ use stellar_access::ownable::{self as ownable, Ownable};␊ - use stellar_macros::{default_impl, only_owner};␊ + use stellar_macros::only_owner;␊ use stellar_tokens::fungible::{␊ Base, blocklist::{BlockList, FungibleBlockList}, FungibleToken␊ };␊ @@ -478,13 +477,12 @@ Generated by [AVA](https://avajs.dev). #[contractimpl]␊ impl MyStablecoin {␊ pub fn __constructor(e: &Env, owner: Address) {␊ - Base::set_metadata(e, 18, String::from_str(e, "MyStablecoin"), String::from_str(e, "MST"));␊ + Base::set_metadata(e, 7, String::from_str(e, "MyStablecoin"), String::from_str(e, "MST"));␊ ownable::set_owner(e, &owner);␊ }␊ }␊ ␊ - #[default_impl]␊ - #[contractimpl]␊ + #[contractimpl(contracttrait)]␊ impl FungibleToken for MyStablecoin {␊ type ContractType = BlockList;␊ ␊ @@ -515,8 +513,7 @@ Generated by [AVA](https://avajs.dev). // Utils␊ //␊ ␊ - #[default_impl]␊ - #[contractimpl]␊ + #[contractimpl(contracttrait)]␊ impl Ownable for MyStablecoin {}␊ ` @@ -525,10 +522,12 @@ Generated by [AVA](https://avajs.dev). > Snapshot 1 `// SPDX-License-Identifier: MIT␊ - // Compatible with OpenZeppelin Stellar Soroban Contracts ^0.4.1␊ + // Compatible with OpenZeppelin Stellar Soroban Contracts ^0.6.0␊ #![no_std]␊ ␊ - use soroban_sdk::{Address, contract, contractimpl, Env, String};␊ + use soroban_sdk::{␊ + Address, contract, contractimpl, Env, MuxedAddress, String, Symbol, Vec␊ + };␊ use stellar_access::ownable::{self as ownable, Ownable};␊ use stellar_macros::only_owner;␊ use stellar_tokens::fungible::{␊ @@ -541,7 +540,7 @@ Generated by [AVA](https://avajs.dev). #[contractimpl]␊ impl MyStablecoin {␊ pub fn __constructor(e: &Env, owner: Address) {␊ - Base::set_metadata(e, 18, String::from_str(e, "MyStablecoin"), String::from_str(e, "MST"));␊ + Base::set_metadata(e, 7, String::from_str(e, "MyStablecoin"), String::from_str(e, "MST"));␊ ownable::set_owner(e, &owner);␊ }␊ }␊ @@ -562,7 +561,7 @@ Generated by [AVA](https://avajs.dev). Self::ContractType::allowance(e, &owner, &spender)␊ }␊ ␊ - fn transfer(e: &Env, from: Address, to: Address, amount: i128) {␊ + fn transfer(e: &Env, from: Address, to: MuxedAddress, amount: i128) {␊ Self::ContractType::transfer(e, &from, &to, amount);␊ }␊ ␊ @@ -637,10 +636,12 @@ Generated by [AVA](https://avajs.dev). > Snapshot 1 `// SPDX-License-Identifier: MIT␊ - // Compatible with OpenZeppelin Stellar Soroban Contracts ^0.4.1␊ + // Compatible with OpenZeppelin Stellar Soroban Contracts ^0.6.0␊ #![no_std]␊ ␊ - use soroban_sdk::{Address, contract, contractimpl, Env, String};␊ + use soroban_sdk::{␊ + Address, contract, contractimpl, Env, MuxedAddress, String, Symbol, Vec␊ + };␊ use stellar_access::ownable::{self as ownable, Ownable};␊ use stellar_macros::only_owner;␊ use stellar_tokens::fungible::{␊ @@ -653,7 +654,7 @@ Generated by [AVA](https://avajs.dev). #[contractimpl]␊ impl MyStablecoin {␊ pub fn __constructor(e: &Env, owner: Address) {␊ - Base::set_metadata(e, 18, String::from_str(e, "MyStablecoin"), String::from_str(e, "MST"));␊ + Base::set_metadata(e, 7, String::from_str(e, "MyStablecoin"), String::from_str(e, "MST"));␊ ownable::set_owner(e, &owner);␊ }␊ }␊ @@ -674,7 +675,7 @@ Generated by [AVA](https://avajs.dev). Self::ContractType::allowance(e, &owner, &spender)␊ }␊ ␊ - fn transfer(e: &Env, from: Address, to: Address, amount: i128) {␊ + fn transfer(e: &Env, from: Address, to: MuxedAddress, amount: i128) {␊ Self::ContractType::transfer(e, &from, &to, amount);␊ }␊ ␊ @@ -749,13 +750,15 @@ Generated by [AVA](https://avajs.dev). > Snapshot 1 `// SPDX-License-Identifier: MIT␊ - // Compatible with OpenZeppelin Stellar Soroban Contracts ^0.4.1␊ + // Compatible with OpenZeppelin Stellar Soroban Contracts ^0.6.0␊ #![no_std]␊ ␊ - use soroban_sdk::{Address, contract, contractimpl, Env, String};␊ + use soroban_sdk::{␊ + Address, contract, contractimpl, Env, MuxedAddress, String, Symbol, Vec␊ + };␊ use stellar_access::ownable::{self as ownable, Ownable};␊ use stellar_contract_utils::pausable::{self as pausable, Pausable};␊ - use stellar_macros::{default_impl, only_owner, when_not_paused};␊ + use stellar_macros::{only_owner, when_not_paused};␊ use stellar_tokens::fungible::{␊ allowlist::{AllowList, FungibleAllowList}, Base, burnable::FungibleBurnable, FungibleToken␊ };␊ @@ -766,8 +769,8 @@ Generated by [AVA](https://avajs.dev). #[contractimpl]␊ impl MyStablecoin {␊ pub fn __constructor(e: &Env, recipient: Address, owner: Address) {␊ - Base::set_metadata(e, 18, String::from_str(e, "MyStablecoin"), String::from_str(e, "MST"));␊ - Base::mint(e, &recipient, 2000000000000000000000);␊ + Base::set_metadata(e, 7, String::from_str(e, "MyStablecoin"), String::from_str(e, "MST"));␊ + Base::mint(e, &recipient, 20000000000);␊ ownable::set_owner(e, &owner);␊ }␊ ␊ @@ -778,13 +781,12 @@ Generated by [AVA](https://avajs.dev). }␊ }␊ ␊ - #[default_impl]␊ - #[contractimpl]␊ + #[contractimpl(contracttrait)]␊ impl FungibleToken for MyStablecoin {␊ type ContractType = AllowList;␊ ␊ #[when_not_paused]␊ - fn transfer(e: &Env, from: Address, to: Address, amount: i128) {␊ + fn transfer(e: &Env, from: Address, to: MuxedAddress, amount: i128) {␊ Self::ContractType::transfer(e, &from, &to, amount);␊ }␊ ␊ @@ -815,7 +817,7 @@ Generated by [AVA](https://avajs.dev). }␊ }␊ ␊ - #[contractimpl]␊ + #[contractimpl(contracttrait)]␊ impl FungibleBurnable for MyStablecoin {␊ #[when_not_paused]␊ fn burn(e: &Env, from: Address, amount: i128) {␊ @@ -832,6 +834,9 @@ Generated by [AVA](https://avajs.dev). // Utils␊ //␊ ␊ + #[contractimpl(contracttrait)]␊ + impl Ownable for MyStablecoin {}␊ + ␊ #[contractimpl]␊ impl Pausable for MyStablecoin {␊ fn paused(e: &Env) -> bool {␊ @@ -848,10 +853,6 @@ Generated by [AVA](https://avajs.dev). pausable::unpause(e);␊ }␊ }␊ - ␊ - #[default_impl]␊ - #[contractimpl]␊ - impl Ownable for MyStablecoin {}␊ ` ## stablecoin full - ownable, blocklist @@ -859,13 +860,15 @@ Generated by [AVA](https://avajs.dev). > Snapshot 1 `// SPDX-License-Identifier: MIT␊ - // Compatible with OpenZeppelin Stellar Soroban Contracts ^0.4.1␊ + // Compatible with OpenZeppelin Stellar Soroban Contracts ^0.6.0␊ #![no_std]␊ ␊ - use soroban_sdk::{Address, contract, contractimpl, Env, String};␊ + use soroban_sdk::{␊ + Address, contract, contractimpl, Env, MuxedAddress, String, Symbol, Vec␊ + };␊ use stellar_access::ownable::{self as ownable, Ownable};␊ use stellar_contract_utils::pausable::{self as pausable, Pausable};␊ - use stellar_macros::{default_impl, only_owner, when_not_paused};␊ + use stellar_macros::{only_owner, when_not_paused};␊ use stellar_tokens::fungible::{␊ Base, blocklist::{BlockList, FungibleBlockList}, burnable::FungibleBurnable, FungibleToken␊ };␊ @@ -876,8 +879,8 @@ Generated by [AVA](https://avajs.dev). #[contractimpl]␊ impl MyStablecoin {␊ pub fn __constructor(e: &Env, recipient: Address, owner: Address) {␊ - Base::set_metadata(e, 18, String::from_str(e, "MyStablecoin"), String::from_str(e, "MST"));␊ - Base::mint(e, &recipient, 2000000000000000000000);␊ + Base::set_metadata(e, 7, String::from_str(e, "MyStablecoin"), String::from_str(e, "MST"));␊ + Base::mint(e, &recipient, 20000000000);␊ ownable::set_owner(e, &owner);␊ }␊ ␊ @@ -888,13 +891,12 @@ Generated by [AVA](https://avajs.dev). }␊ }␊ ␊ - #[default_impl]␊ - #[contractimpl]␊ + #[contractimpl(contracttrait)]␊ impl FungibleToken for MyStablecoin {␊ type ContractType = BlockList;␊ ␊ #[when_not_paused]␊ - fn transfer(e: &Env, from: Address, to: Address, amount: i128) {␊ + fn transfer(e: &Env, from: Address, to: MuxedAddress, amount: i128) {␊ Self::ContractType::transfer(e, &from, &to, amount);␊ }␊ ␊ @@ -925,7 +927,7 @@ Generated by [AVA](https://avajs.dev). }␊ }␊ ␊ - #[contractimpl]␊ + #[contractimpl(contracttrait)]␊ impl FungibleBurnable for MyStablecoin {␊ #[when_not_paused]␊ fn burn(e: &Env, from: Address, amount: i128) {␊ @@ -942,6 +944,9 @@ Generated by [AVA](https://avajs.dev). // Utils␊ //␊ ␊ + #[contractimpl(contracttrait)]␊ + impl Ownable for MyStablecoin {}␊ + ␊ #[contractimpl]␊ impl Pausable for MyStablecoin {␊ fn paused(e: &Env) -> bool {␊ @@ -958,10 +963,6 @@ Generated by [AVA](https://avajs.dev). pausable::unpause(e);␊ }␊ }␊ - ␊ - #[default_impl]␊ - #[contractimpl]␊ - impl Ownable for MyStablecoin {}␊ ` ## stablecoin full - roles, allowlist @@ -969,13 +970,15 @@ Generated by [AVA](https://avajs.dev). > Snapshot 1 `// SPDX-License-Identifier: MIT␊ - // Compatible with OpenZeppelin Stellar Soroban Contracts ^0.4.1␊ + // Compatible with OpenZeppelin Stellar Soroban Contracts ^0.6.0␊ #![no_std]␊ ␊ - use soroban_sdk::{Address, contract, contractimpl, Env, String, Symbol};␊ + use soroban_sdk::{␊ + Address, contract, contractimpl, Env, MuxedAddress, String, Symbol, Vec␊ + };␊ use stellar_access::access_control::{self as access_control, AccessControl};␊ use stellar_contract_utils::pausable::{self as pausable, Pausable};␊ - use stellar_macros::{default_impl, only_role, when_not_paused};␊ + use stellar_macros::{only_role, when_not_paused};␊ use stellar_tokens::fungible::{␊ allowlist::{AllowList, FungibleAllowList}, Base, burnable::FungibleBurnable, FungibleToken␊ };␊ @@ -993,12 +996,12 @@ Generated by [AVA](https://avajs.dev). minter: Address,␊ manager: Address,␊ ) {␊ - Base::set_metadata(e, 18, String::from_str(e, "MyStablecoin"), String::from_str(e, "MST"));␊ - Base::mint(e, &recipient, 2000000000000000000000);␊ + Base::set_metadata(e, 7, String::from_str(e, "MyStablecoin"), String::from_str(e, "MST"));␊ + Base::mint(e, &recipient, 20000000000);␊ access_control::set_admin(e, &admin);␊ - access_control::grant_role_no_auth(e, &admin, &pauser, &Symbol::new(e, "pauser"));␊ - access_control::grant_role_no_auth(e, &admin, &minter, &Symbol::new(e, "minter"));␊ - access_control::grant_role_no_auth(e, &admin, &manager, &Symbol::new(e, "manager"));␊ + access_control::grant_role_no_auth(e, &pauser, &Symbol::new(e, "pauser"), &admin);␊ + access_control::grant_role_no_auth(e, &minter, &Symbol::new(e, "minter"), &admin);␊ + access_control::grant_role_no_auth(e, &manager, &Symbol::new(e, "manager"), &admin);␊ }␊ ␊ #[only_role(caller, "minter")]␊ @@ -1008,13 +1011,12 @@ Generated by [AVA](https://avajs.dev). }␊ }␊ ␊ - #[default_impl]␊ - #[contractimpl]␊ + #[contractimpl(contracttrait)]␊ impl FungibleToken for MyStablecoin {␊ type ContractType = AllowList;␊ ␊ #[when_not_paused]␊ - fn transfer(e: &Env, from: Address, to: Address, amount: i128) {␊ + fn transfer(e: &Env, from: Address, to: MuxedAddress, amount: i128) {␊ Self::ContractType::transfer(e, &from, &to, amount);␊ }␊ ␊ @@ -1045,7 +1047,7 @@ Generated by [AVA](https://avajs.dev). }␊ }␊ ␊ - #[contractimpl]␊ + #[contractimpl(contracttrait)]␊ impl FungibleBurnable for MyStablecoin {␊ #[when_not_paused]␊ fn burn(e: &Env, from: Address, amount: i128) {␊ @@ -1062,6 +1064,9 @@ Generated by [AVA](https://avajs.dev). // Utils␊ //␊ ␊ + #[contractimpl(contracttrait)]␊ + impl AccessControl for MyStablecoin {}␊ + ␊ #[contractimpl]␊ impl Pausable for MyStablecoin {␊ fn paused(e: &Env) -> bool {␊ @@ -1078,10 +1083,6 @@ Generated by [AVA](https://avajs.dev). pausable::unpause(e);␊ }␊ }␊ - ␊ - #[default_impl]␊ - #[contractimpl]␊ - impl AccessControl for MyStablecoin {}␊ ` ## stablecoin full - roles, blocklist @@ -1089,13 +1090,15 @@ Generated by [AVA](https://avajs.dev). > Snapshot 1 `// SPDX-License-Identifier: MIT␊ - // Compatible with OpenZeppelin Stellar Soroban Contracts ^0.4.1␊ + // Compatible with OpenZeppelin Stellar Soroban Contracts ^0.6.0␊ #![no_std]␊ ␊ - use soroban_sdk::{Address, contract, contractimpl, Env, String, Symbol};␊ + use soroban_sdk::{␊ + Address, contract, contractimpl, Env, MuxedAddress, String, Symbol, Vec␊ + };␊ use stellar_access::access_control::{self as access_control, AccessControl};␊ use stellar_contract_utils::pausable::{self as pausable, Pausable};␊ - use stellar_macros::{default_impl, only_role, when_not_paused};␊ + use stellar_macros::{only_role, when_not_paused};␊ use stellar_tokens::fungible::{␊ Base, blocklist::{BlockList, FungibleBlockList}, burnable::FungibleBurnable, FungibleToken␊ };␊ @@ -1113,12 +1116,12 @@ Generated by [AVA](https://avajs.dev). minter: Address,␊ manager: Address,␊ ) {␊ - Base::set_metadata(e, 18, String::from_str(e, "MyStablecoin"), String::from_str(e, "MST"));␊ - Base::mint(e, &recipient, 2000000000000000000000);␊ + Base::set_metadata(e, 7, String::from_str(e, "MyStablecoin"), String::from_str(e, "MST"));␊ + Base::mint(e, &recipient, 20000000000);␊ access_control::set_admin(e, &admin);␊ - access_control::grant_role_no_auth(e, &admin, &pauser, &Symbol::new(e, "pauser"));␊ - access_control::grant_role_no_auth(e, &admin, &minter, &Symbol::new(e, "minter"));␊ - access_control::grant_role_no_auth(e, &admin, &manager, &Symbol::new(e, "manager"));␊ + access_control::grant_role_no_auth(e, &pauser, &Symbol::new(e, "pauser"), &admin);␊ + access_control::grant_role_no_auth(e, &minter, &Symbol::new(e, "minter"), &admin);␊ + access_control::grant_role_no_auth(e, &manager, &Symbol::new(e, "manager"), &admin);␊ }␊ ␊ #[only_role(caller, "minter")]␊ @@ -1128,13 +1131,12 @@ Generated by [AVA](https://avajs.dev). }␊ }␊ ␊ - #[default_impl]␊ - #[contractimpl]␊ + #[contractimpl(contracttrait)]␊ impl FungibleToken for MyStablecoin {␊ type ContractType = BlockList;␊ ␊ #[when_not_paused]␊ - fn transfer(e: &Env, from: Address, to: Address, amount: i128) {␊ + fn transfer(e: &Env, from: Address, to: MuxedAddress, amount: i128) {␊ Self::ContractType::transfer(e, &from, &to, amount);␊ }␊ ␊ @@ -1165,7 +1167,7 @@ Generated by [AVA](https://avajs.dev). }␊ }␊ ␊ - #[contractimpl]␊ + #[contractimpl(contracttrait)]␊ impl FungibleBurnable for MyStablecoin {␊ #[when_not_paused]␊ fn burn(e: &Env, from: Address, amount: i128) {␊ @@ -1182,6 +1184,9 @@ Generated by [AVA](https://avajs.dev). // Utils␊ //␊ ␊ + #[contractimpl(contracttrait)]␊ + impl AccessControl for MyStablecoin {}␊ + ␊ #[contractimpl]␊ impl Pausable for MyStablecoin {␊ fn paused(e: &Env) -> bool {␊ @@ -1198,10 +1203,6 @@ Generated by [AVA](https://avajs.dev). pausable::unpause(e);␊ }␊ }␊ - ␊ - #[default_impl]␊ - #[contractimpl]␊ - impl AccessControl for MyStablecoin {}␊ ` ## stablecoin full - complex name @@ -1209,13 +1210,15 @@ Generated by [AVA](https://avajs.dev). > Snapshot 1 `// SPDX-License-Identifier: MIT␊ - // Compatible with OpenZeppelin Stellar Soroban Contracts ^0.4.1␊ + // Compatible with OpenZeppelin Stellar Soroban Contracts ^0.6.0␊ #![no_std]␊ ␊ - use soroban_sdk::{Address, contract, contractimpl, Env, String};␊ + use soroban_sdk::{␊ + Address, contract, contractimpl, Env, MuxedAddress, String, Symbol, Vec␊ + };␊ use stellar_access::ownable::{self as ownable, Ownable};␊ use stellar_contract_utils::pausable::{self as pausable, Pausable};␊ - use stellar_macros::{default_impl, only_owner, when_not_paused};␊ + use stellar_macros::{only_owner, when_not_paused};␊ use stellar_tokens::fungible::{Base, burnable::FungibleBurnable, FungibleToken};␊ ␊ #[contract]␊ @@ -1224,8 +1227,8 @@ Generated by [AVA](https://avajs.dev). #[contractimpl]␊ impl CustomToken {␊ pub fn __constructor(e: &Env, recipient: Address, owner: Address) {␊ - Base::set_metadata(e, 18, String::from_str(e, "Custom $ Token"), String::from_str(e, "MST"));␊ - Base::mint(e, &recipient, 2000000000000000000000);␊ + Base::set_metadata(e, 7, String::from_str(e, "Custom $ Token"), String::from_str(e, "MST"));␊ + Base::mint(e, &recipient, 20000000000);␊ ownable::set_owner(e, &owner);␊ }␊ ␊ @@ -1236,13 +1239,12 @@ Generated by [AVA](https://avajs.dev). }␊ }␊ ␊ - #[default_impl]␊ - #[contractimpl]␊ + #[contractimpl(contracttrait)]␊ impl FungibleToken for CustomToken {␊ type ContractType = Base;␊ ␊ #[when_not_paused]␊ - fn transfer(e: &Env, from: Address, to: Address, amount: i128) {␊ + fn transfer(e: &Env, from: Address, to: MuxedAddress, amount: i128) {␊ Self::ContractType::transfer(e, &from, &to, amount);␊ }␊ ␊ @@ -1256,7 +1258,7 @@ Generated by [AVA](https://avajs.dev). // Extensions␊ //␊ ␊ - #[contractimpl]␊ + #[contractimpl(contracttrait)]␊ impl FungibleBurnable for CustomToken {␊ #[when_not_paused]␊ fn burn(e: &Env, from: Address, amount: i128) {␊ @@ -1273,6 +1275,9 @@ Generated by [AVA](https://avajs.dev). // Utils␊ //␊ ␊ + #[contractimpl(contracttrait)]␊ + impl Ownable for CustomToken {}␊ + ␊ #[contractimpl]␊ impl Pausable for CustomToken {␊ fn paused(e: &Env) -> bool {␊ @@ -1289,10 +1294,6 @@ Generated by [AVA](https://avajs.dev). pausable::unpause(e);␊ }␊ }␊ - ␊ - #[default_impl]␊ - #[contractimpl]␊ - impl Ownable for CustomToken {}␊ ` ## stablecoin explicit trait implementations @@ -1300,10 +1301,12 @@ Generated by [AVA](https://avajs.dev). > Snapshot 1 `// SPDX-License-Identifier: MIT␊ - // Compatible with OpenZeppelin Stellar Soroban Contracts ^0.4.1␊ + // Compatible with OpenZeppelin Stellar Soroban Contracts ^0.6.0␊ #![no_std]␊ ␊ - use soroban_sdk::{Address, contract, contractimpl, Env, String};␊ + use soroban_sdk::{␊ + Address, contract, contractimpl, Env, MuxedAddress, String, Symbol, Vec␊ + };␊ use stellar_tokens::fungible::{Base, FungibleToken};␊ ␊ #[contract]␊ @@ -1312,7 +1315,7 @@ Generated by [AVA](https://avajs.dev). #[contractimpl]␊ impl MyStablecoin {␊ pub fn __constructor(e: &Env) {␊ - Base::set_metadata(e, 18, String::from_str(e, "MyStablecoin"), String::from_str(e, "MST"));␊ + Base::set_metadata(e, 7, String::from_str(e, "MyStablecoin"), String::from_str(e, "MST"));␊ }␊ }␊ ␊ @@ -1332,7 +1335,7 @@ Generated by [AVA](https://avajs.dev). Self::ContractType::allowance(e, &owner, &spender)␊ }␊ ␊ - fn transfer(e: &Env, from: Address, to: Address, amount: i128) {␊ + fn transfer(e: &Env, from: Address, to: MuxedAddress, amount: i128) {␊ Self::ContractType::transfer(e, &from, &to, amount);␊ }␊ ␊ diff --git a/packages/core/stellar/src/stablecoin.test.ts.snap b/packages/core/stellar/src/stablecoin.test.ts.snap index 1b347ebdf96d1238d144bff75ce478106702c8f3..d196cdb830f76ab1cc9f438d510cd1d6a2744f60 100644 GIT binary patch literal 2198 zcmV;H2x<30RzVozi^M-O zXU@#|neQCW*l)TWmsm&i*FO+*n2WrQNgWGNW_Da;5eGXIn;tzRjQ;e-woPV!cYW{1 zwOiNt@12|1-o3tkeQgcwzWVap)fbM1Fh#4+ZG@TAb&wCi%jbLA+8Wp*Jv; zutTupA^bh^JmfkU>@wuKrVn=q39?1eUFJLZKnJ_0y$*48@C~xG z!DiG##FD|t5yBM0Zh#Ls_Yj^vGbz%+SMh~CUSP1PX?I^I?d@w`&;gYBfyKbf(_Jx? zQYp^WzQ+GbWkA#&PN9o|VORu5l!(8AAZTsl<91wz|2Q)cQpAiNVkQ^Q3ev%+N#7vs z`lM%2=JU(T*@l+eRfTrquWgZ?4H1}4nl)sa016NU~#)?p%} zDOxE13DNOZLQZ(GR(LdRL*}>dzRrnoKfK(DT8tz##88aLq`@hqoKg>AJ0s*$-Y>*<+@KCxaa%)s zAzbFy-2O)Pma#FHI>~ZlNNl%C8@iDzMRqzttv&%ALflNhQ}2+JZOhU~J;1(1H5Gti znXX%5WjXRIC@<_1@&P_q1EN|+67lSE@?i2dOz| zc5~3>!1kI!;+9w`#j4Inwh&bneH%|Wyz;n$sb{BptIEWTB)E?!OK!XKcj+iY*W<08}CUPxOC$RYv8%#_a>^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=!tsIDb;QIywg5s=ahEVn&Cy*wcUL%MN z@*g{p#$jLEBG|duB_0|Q zVMkyi3Dtz!9HHvmbp4i>(?{j5kj@oUtfvpk(T;~c=I7}SslPCc=CbVQ*)@;t8f^`_}0xK+>365W<=aR(uk!oWeB~r z*B~u+(C<<_KDE5xauJM7O1nrY?O50=7kj&yt`vjX2nEFYIFs?NBBPw=l#X>lGri7s zg0L75g7%!jSTNkzCD$s_Ht0yIqjccd5Ynke zDoCdnUW;_9(<<8O73J*_YJ?XAuccvJkz>-Cgbf;IingQ{rtUotsYQ$G-ihzzSY7qB zS=Pdb3uWr#CJC8n5~9x``7~LVmArORGK5_zOPO+#GV*IF8d8;p8v5lQv{dDVNmb@2 zRhj?tx=B?k5UNR4OsZm5K}@PLN2?&ivw|6{j0_jbtd^KW#Uv^xo~XQEPEuY@4=qI i&m&Cf7u3uP7t9M6%nKLH3l~Ov;llr*rf&|vfB*n(p)i>M diff --git a/packages/core/stellar/src/utils/version.ts b/packages/core/stellar/src/utils/version.ts index 20d840cec..9fe7720f4 100644 --- a/packages/core/stellar/src/utils/version.ts +++ b/packages/core/stellar/src/utils/version.ts @@ -1,15 +1,15 @@ /** * The actual latest version to use in links. */ -export const contractsVersion = '0.4.1'; +export const contractsVersion = '0.6.0'; export const contractsVersionTag = `v${contractsVersion}`; /** * Semantic version string representing of the minimum compatible version of Contracts to display in output. */ -export const compatibleContractsSemver = '^0.4.1'; +export const compatibleContractsSemver = '^0.6.0'; /** * The Soroban version for which compilation and testing have passing tests */ -export const compatibleSorobanVersion = '22.0.8'; +export const compatibleSorobanVersion = '23.4.0'; diff --git a/packages/core/stellar/src/zip-rust.compile.test.ts.md b/packages/core/stellar/src/zip-rust.compile.test.ts.md index 2a4007672..0b6272bd3 100644 --- a/packages/core/stellar/src/zip-rust.compile.test.ts.md +++ b/packages/core/stellar/src/zip-rust.compile.test.ts.md @@ -10,11 +10,10 @@ Generated by [AVA](https://avajs.dev). [ `// SPDX-License-Identifier: MIT␊ - // Compatible with OpenZeppelin Stellar Soroban Contracts ^0.4.1␊ + // Compatible with OpenZeppelin Stellar Soroban Contracts ^0.6.0␊ ␊ ␊ - use soroban_sdk::{Address, contract, contractimpl, Env, String};␊ - use stellar_macros::default_impl;␊ + use soroban_sdk::{Address, contract, contractimpl, Env, MuxedAddress, String};␊ use stellar_tokens::fungible::{Base, burnable::FungibleBurnable, FungibleToken};␊ ␊ #[contract]␊ @@ -23,13 +22,12 @@ Generated by [AVA](https://avajs.dev). #[contractimpl]␊ impl MyToken {␊ pub fn __constructor(e: &Env, recipient: Address) {␊ - Base::set_metadata(e, 18, String::from_str(e, "MyToken"), String::from_str(e, "MTK"));␊ - Base::mint(e, &recipient, 2000000000000000000000);␊ + Base::set_metadata(e, 7, String::from_str(e, "MyToken"), String::from_str(e, "MTK"));␊ + Base::mint(e, &recipient, 20000000000);␊ }␊ }␊ ␊ - #[default_impl]␊ - #[contractimpl]␊ + #[contractimpl(contracttrait)]␊ impl FungibleToken for MyToken {␊ type ContractType = Base;␊ ␊ @@ -39,8 +37,7 @@ Generated by [AVA](https://avajs.dev). // Extensions␊ //␊ ␊ - #[default_impl]␊ - #[contractimpl]␊ + #[contractimpl(contracttrait)]␊ impl FungibleBurnable for MyToken {}␊ `, `#![cfg(test)]␊ @@ -104,11 +101,11 @@ Generated by [AVA](https://avajs.dev). version = "0.0.1"␊ ␊ [workspace.dependencies]␊ - soroban-sdk = "22.0.8"␊ - stellar-tokens = "=0.4.1"␊ - stellar-access = "=0.4.1"␊ - stellar-contract-utils = "=0.4.1"␊ - stellar-macros = "=0.4.1"␊ + soroban-sdk = "23.4.0"␊ + stellar-tokens = "=0.6.0"␊ + stellar-access = "=0.6.0"␊ + stellar-contract-utils = "=0.6.0"␊ + stellar-macros = "=0.6.0"␊ ␊ ␊ [profile.release]␊ @@ -146,10 +143,10 @@ Generated by [AVA](https://avajs.dev). [ `// SPDX-License-Identifier: MIT␊ - // Compatible with OpenZeppelin Stellar Soroban Contracts ^0.4.1␊ + // Compatible with OpenZeppelin Stellar Soroban Contracts ^0.6.0␊ ␊ ␊ - use soroban_sdk::{Address, contract, contractimpl, Env, String};␊ + use soroban_sdk::{Address, contract, contractimpl, Env, MuxedAddress, String};␊ use stellar_tokens::fungible::{Base, burnable::FungibleBurnable, FungibleToken};␊ ␊ #[contract]␊ @@ -158,8 +155,8 @@ Generated by [AVA](https://avajs.dev). #[contractimpl]␊ impl MyToken {␊ pub fn __constructor(e: &Env, recipient: Address) {␊ - Base::set_metadata(e, 18, String::from_str(e, "MyToken"), String::from_str(e, "MTK"));␊ - Base::mint(e, &recipient, 2000000000000000000000);␊ + Base::set_metadata(e, 7, String::from_str(e, "MyToken"), String::from_str(e, "MTK"));␊ + Base::mint(e, &recipient, 20000000000);␊ }␊ }␊ ␊ @@ -179,7 +176,7 @@ Generated by [AVA](https://avajs.dev). Self::ContractType::allowance(e, &owner, &spender)␊ }␊ ␊ - fn transfer(e: &Env, from: Address, to: Address, amount: i128) {␊ + fn transfer(e: &Env, from: Address, to: MuxedAddress, amount: i128) {␊ Self::ContractType::transfer(e, &from, &to, amount);␊ }␊ ␊ @@ -280,11 +277,11 @@ Generated by [AVA](https://avajs.dev). version = "0.0.1"␊ ␊ [workspace.dependencies]␊ - soroban-sdk = "22.0.8"␊ - stellar-tokens = "=0.4.1"␊ - stellar-access = "=0.4.1"␊ - stellar-contract-utils = "=0.4.1"␊ - stellar-macros = "=0.4.1"␊ + soroban-sdk = "23.4.0"␊ + stellar-tokens = "=0.6.0"␊ + stellar-access = "=0.6.0"␊ + stellar-contract-utils = "=0.6.0"␊ + stellar-macros = "=0.6.0"␊ ␊ ␊ [profile.release]␊ diff --git a/packages/core/stellar/src/zip-rust.compile.test.ts.snap b/packages/core/stellar/src/zip-rust.compile.test.ts.snap index 8714750999a570270d844f76815231270c9019e2..81599a9bb0a34e5a0a6703b3ebfafdbc45a26fca 100644 GIT binary patch literal 1890 zcmV-o2c7sqRzV^};7h$Q7oXWRnbn4T9}W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~Mt;=4d9vpoIx(DqNwFm7QZIg#lROl(L=*{Y3g@utTe`r?a!?Nh!m+J<( z2W<=5gSL?lqY=s`k+C&hve`_+56`a-xJ=RaqD%8!$@v3TZ=GBZIGf|R5QgzF$0W6u z#m7hYk#54?Tv-?37U&!76O36#xn8TE;^U)xqA%SxWmF#TR>A61@VoIUuT89KxA$-~ z=ht1fpgS%V9(;+=bcjNUJ1gZb@l`#va&5GAhpepCLo49^xOYo@gU0r Trait Implementations - Whether the contract should use explicit trait implementations instead of the #[default_impl] macro to - auto-generate trait method bodies. + Whether the contract functions should be explicitly implemented or be auto-generated with the defaults provided by + the library.
@@ -27,7 +27,8 @@ Default Keep the #[default_impl] attribute so unused trait functions rely on the macro.The #[contractimpl(contracttrait)] attribute generates the contract functions with the defaults provided + in the trait. If needed, one can always re-implement some of the functions with custom logic. @@ -35,7 +36,7 @@ Explicit Generate every trait function body explicitly and omit the #[default_impl] attribute. Easier to customize.Generate every trait function body explicitly. Useful when all of them need to be customized.
From 9632bc91bc43d0f65f96b3940b18d1cc51103c3a Mon Sep 17 00:00:00 2001 From: brozorec <9572072+brozorec@users.noreply.github.com> Date: Tue, 27 Jan 2026 14:22:43 +0100 Subject: [PATCH 2/6] update zip-rust snapshot --- .../stellar/src/zip-rust.compile.test.ts.md | 8 ++++++-- .../stellar/src/zip-rust.compile.test.ts.snap | Bin 1890 -> 1897 bytes 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/core/stellar/src/zip-rust.compile.test.ts.md b/packages/core/stellar/src/zip-rust.compile.test.ts.md index 0b6272bd3..aa28730a1 100644 --- a/packages/core/stellar/src/zip-rust.compile.test.ts.md +++ b/packages/core/stellar/src/zip-rust.compile.test.ts.md @@ -13,7 +13,9 @@ Generated by [AVA](https://avajs.dev). // Compatible with OpenZeppelin Stellar Soroban Contracts ^0.6.0␊ ␊ ␊ - use soroban_sdk::{Address, contract, contractimpl, Env, MuxedAddress, String};␊ + use soroban_sdk::{␊ + Address, contract, contractimpl, Env, MuxedAddress, String, Symbol, Vec␊ + };␊ use stellar_tokens::fungible::{Base, burnable::FungibleBurnable, FungibleToken};␊ ␊ #[contract]␊ @@ -146,7 +148,9 @@ Generated by [AVA](https://avajs.dev). // Compatible with OpenZeppelin Stellar Soroban Contracts ^0.6.0␊ ␊ ␊ - use soroban_sdk::{Address, contract, contractimpl, Env, MuxedAddress, String};␊ + use soroban_sdk::{␊ + Address, contract, contractimpl, Env, MuxedAddress, String, Symbol, Vec␊ + };␊ use stellar_tokens::fungible::{Base, burnable::FungibleBurnable, FungibleToken};␊ ␊ #[contract]␊ diff --git a/packages/core/stellar/src/zip-rust.compile.test.ts.snap b/packages/core/stellar/src/zip-rust.compile.test.ts.snap index 81599a9bb0a34e5a0a6703b3ebfafdbc45a26fca..ab029b4cf0dc462f782a7d7e302fab889f995976 100644 GIT binary patch literal 1897 zcmV-v2bTCjRzVpxD}Q&o1GbAu!F(&rgtX_5ZHwzXEH^9lzNNV+3h0j z4q7zn_Q!AyS~`}wrbsPGIg<=>(Y{1`yM2T9vQN{#NkK`Jf09fl*vr}%hAp1+osWm# zIU@P(bi!pa*MIp38fG}oRH+SIvVv(r3q6xY|MlB6rH20T$G$FEH=q3>{E{UoG=?WB3d5!hRSd6B&PcxxuVh|O!zLWzoS7N? zx!U~4M#4Z!P#?O8%@dkR%gt5a1EtLR{4%<&-e?_h~XWMmujH1l+n#r%_5T;UX zq{Cbk*vjL~{uxw6j){%X?^~&T{>GrtObTru+$*eG%=O4uq>+55<23*8&i>vonPy#s z+M*DAV^9f56g5^x>G4gH1#4Xz#&sMw>jhN9I9TeqTGl%MaMgfRpmFS&TcCzp;C{T~ zHuX@e&PExLsQ@OJVU&-xp$5B78XOIvSiryri{lihwB)ASJ0|V03pJ)`s$gKvBZV2$ z235C>-ECOMafSjd$?gG)MK5qNsi10RgLS5HEbzRt4&Y!dnxjFrMrFqM&0e>Lhy=~C zdy_hAn5BSw$F&%2Rw0)PtGsKNAm{SDUCf1qqxAHl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ellar/TraitImplementationSection.svelte Co-authored-by: Eric Lau --- packages/ui/src/stellar/TraitImplementationSection.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/ui/src/stellar/TraitImplementationSection.svelte b/packages/ui/src/stellar/TraitImplementationSection.svelte index ef001cf67..fbd1b7f8a 100644 --- a/packages/ui/src/stellar/TraitImplementationSection.svelte +++ b/packages/ui/src/stellar/TraitImplementationSection.svelte @@ -36,7 +36,7 @@ Explicit Generate every trait function body explicitly. Useful when all of them need to be customized.Include every trait function body explicitly. Useful when all of them need to be customized. From aff2a222c9cf7d24f407f17088a7fec9d4027bd5 Mon Sep 17 00:00:00 2001 From: Boyan Barakov <9572072+brozorec@users.noreply.github.com> Date: Wed, 28 Jan 2026 09:46:13 +0100 Subject: [PATCH 4/6] Update packages/ui/src/stellar/TraitImplementationSection.svelte Co-authored-by: Eric Lau --- packages/ui/src/stellar/TraitImplementationSection.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/ui/src/stellar/TraitImplementationSection.svelte b/packages/ui/src/stellar/TraitImplementationSection.svelte index fbd1b7f8a..87f526200 100644 --- a/packages/ui/src/stellar/TraitImplementationSection.svelte +++ b/packages/ui/src/stellar/TraitImplementationSection.svelte @@ -28,7 +28,7 @@ Default The #[contractimpl(contracttrait)] attribute generates the contract functions with the defaults provided - in the trait. If needed, one can always re-implement some of the functions with custom logic. From 337fc3309da5e1a0de4ebd14896dabfd62979001 Mon Sep 17 00:00:00 2001 From: brozorec <9572072+brozorec@users.noreply.github.com> Date: Wed, 28 Jan 2026 09:46:48 +0100 Subject: [PATCH 5/6] separate changesets --- .changeset/little-papers-notice.md | 5 +++++ .changeset/pink-eyes-judge.md | 4 +--- 2 files changed, 6 insertions(+), 3 deletions(-) create mode 100644 .changeset/little-papers-notice.md diff --git a/.changeset/little-papers-notice.md b/.changeset/little-papers-notice.md new file mode 100644 index 000000000..7947684bd --- /dev/null +++ b/.changeset/little-papers-notice.md @@ -0,0 +1,5 @@ +--- +'@openzeppelin/wizard-common': minor +--- + +Modify tooltip descriptions regarding default implementations to fit the changes introduced with v0.6.0 diff --git a/.changeset/pink-eyes-judge.md b/.changeset/pink-eyes-judge.md index 81a6606d2..1cdd3710f 100644 --- a/.changeset/pink-eyes-judge.md +++ b/.changeset/pink-eyes-judge.md @@ -1,6 +1,5 @@ --- '@openzeppelin/wizard-stellar': minor -'@openzeppelin/wizard-common': minor --- Refactor Stellar contracts to match the latest v0.6.0 @@ -8,5 +7,4 @@ Refactor Stellar contracts to match the latest v0.6.0 - Use OpenZeppelin Stellar Soroban Contracts v0.6.0 - Use `MuxedAddress` for fungible transfer function - Change order of parameters in access control - -Change default fungible decimals to 7 + - Change default fungible decimals to 7 From e78be74505cffe00358bc7940c85e135b38bce2e Mon Sep 17 00:00:00 2001 From: Boyan Barakov <9572072+brozorec@users.noreply.github.com> Date: Wed, 28 Jan 2026 16:37:10 +0100 Subject: [PATCH 6/6] Update .changeset/little-papers-notice.md Co-authored-by: Eric Lau --- .changeset/little-papers-notice.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/little-papers-notice.md b/.changeset/little-papers-notice.md index 7947684bd..0ba683536 100644 --- a/.changeset/little-papers-notice.md +++ b/.changeset/little-papers-notice.md @@ -1,5 +1,5 @@ --- -'@openzeppelin/wizard-common': minor +'@openzeppelin/wizard-common': patch --- Modify tooltip descriptions regarding default implementations to fit the changes introduced with v0.6.0