From 8252f19ce924922b1d5649a744ac2ce6823d1bd6 Mon Sep 17 00:00:00 2001 From: Elliot Voris Date: Fri, 7 Nov 2025 12:00:25 -0600 Subject: [PATCH 01/19] add the stablecoin contract type to stellar readme --- packages/core/stellar/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/core/stellar/README.md b/packages/core/stellar/README.md index 95578d74f..d1607c772 100644 --- a/packages/core/stellar/README.md +++ b/packages/core/stellar/README.md @@ -13,6 +13,7 @@ This package provides a programmatic API. For a web interface, see https://wizar The following contract types are supported: - `fungible` - `nonFungible` +- `stablecoin` Each contract type has functions/constants as defined below. From 195aabf56a2a62c791d7b05f7b0bf2631da614f2 Mon Sep 17 00:00:00 2001 From: Elliot Voris Date: Fri, 7 Nov 2025 12:09:52 -0600 Subject: [PATCH 02/19] add a new `ConstructorArgument` type to the contract builder --- packages/core/stellar/src/contract.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/packages/core/stellar/src/contract.ts b/packages/core/stellar/src/contract.ts index 5dafa0d1b..047e5d8bc 100644 --- a/packages/core/stellar/src/contract.ts +++ b/packages/core/stellar/src/contract.ts @@ -7,7 +7,7 @@ export interface Contract { name: string; useClauses: UseClause[]; constructorCode: string[]; - constructorArgs: Argument[]; + constructorArgs: ConstructorArgument[]; implementedTraits: TraitImplBlock[]; freeFunctions: ContractFunction[]; variables: Variable[]; @@ -71,6 +71,10 @@ export interface Argument { type?: string; } +export interface ConstructorArgument extends Argument { + value?: string; +} + export class ContractBuilder implements Contract { readonly name: string; license = 'MIT'; @@ -79,7 +83,7 @@ export class ContractBuilder implements Contract { readonly documentations: string[] = []; - readonly constructorArgs: Argument[] = []; + readonly constructorArgs: ConstructorArgument[] = []; readonly constructorCode: string[] = []; private implementedTraitsMap: Map = new Map(); @@ -241,7 +245,7 @@ export class ContractBuilder implements Contract { existingFn.tags = [...(existingFn.tags ?? []), tag]; } - addConstructorArgument(arg: Argument): void { + addConstructorArgument(arg: ConstructorArgument): void { for (const existingArg of this.constructorArgs) { if (existingArg.name == arg.name) { return; From 9f3a60cb71657572df6485aa54f19e9df25d1ee3 Mon Sep 17 00:00:00 2001 From: Elliot Voris Date: Fri, 7 Nov 2025 12:15:27 -0600 Subject: [PATCH 03/19] create a command to print the deploy CLI command with constructor --- packages/core/stellar/src/print.ts | 35 ++++++++++++++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/packages/core/stellar/src/print.ts b/packages/core/stellar/src/print.ts index 7b46f2e03..7767c446d 100644 --- a/packages/core/stellar/src/print.ts +++ b/packages/core/stellar/src/print.ts @@ -1,4 +1,4 @@ -import type { Contract, Argument, ContractFunction, TraitImplBlock, UseClause } from './contract'; +import type { Contract, Argument, ContractFunction, TraitImplBlock, UseClause, ConstructorArgument } from './contract'; import type { Lines } from './utils/format-lines'; import { formatLines, spaceBetween } from './utils/format-lines'; @@ -249,7 +249,7 @@ function printFunction(fn: ContractFunction): Lines[] { } } - return printFunction2(fn.pub, head, args, fn.tags, fn.returns, undefined, codeLines); + return printFunction2(fn.pub, head, args, fn.tags, fn.returns, undefined, codeLines, undefined); } function printContractFunctions(contract: Contract): Lines[] { @@ -283,6 +283,7 @@ function printConstructor(contract: Contract): Lines[] { if (contract.constructorCode.length > 0) { const head = 'fn __constructor'; const args = [getSelfArg(), ...contract.constructorArgs]; + const deploy = printDeployCommand(contract.constructorArgs); const body = spaceBetween(withSemicolons(contract.constructorCode)); @@ -294,6 +295,7 @@ function printConstructor(contract: Contract): Lines[] { undefined, undefined, body, + deploy, ); return constructor; } else { @@ -311,6 +313,7 @@ function printFunction2( returns: string | undefined, returnLine: string | undefined, code: Lines[], + deploy: string[] | undefined, ): Lines[] { const fn = []; @@ -318,6 +321,10 @@ function printFunction2( fn.push(`#[${tags[i]}]`); } + if (kindedName === 'fn __constructor' && deploy) { + fn.push(...deploy); + } + let accum = ''; if (pub) { @@ -371,3 +378,27 @@ function printDocumentations(documentations: string[]): string[] { function printMetadata(contract: Contract) { return Array.from(contract.metadata.entries()).map(([key, value]) => `contractmeta!(key="${key}", val="${value}");`); } + +function printDeployCommand(args: ConstructorArgument[]): string[] { + if (args.length === 0) { + return []; + } + + const cmd = []; + cmd.push('// deploy this smart contract with the Stellar CLI:'); + cmd.push('//'); + cmd.push('// stellar contract deploy \\'); + cmd.push('// --wasm path/to/file.wasm \\'); + cmd.push('// -- \\'); + args.map((arg, i) => { + if (arg.value) { + let formattedArg = `// --${arg.name} ${arg.value}`; + if (i !== args.length - 1) { + formattedArg += ' \\'; + } + cmd.push(formattedArg); + } + }); + + return cmd; +} From ea78063e33763db92269e051f39c13b8a0de43e7 Mon Sep 17 00:00:00 2001 From: Elliot Voris Date: Fri, 7 Nov 2025 12:16:26 -0600 Subject: [PATCH 04/19] add values for the deploy command in fungible token --- packages/core/stellar/src/fungible.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/core/stellar/src/fungible.ts b/packages/core/stellar/src/fungible.ts index c9033e74b..a4ce22993 100644 --- a/packages/core/stellar/src/fungible.ts +++ b/packages/core/stellar/src/fungible.ts @@ -89,7 +89,9 @@ export function buildFungible(opts: FungibleOptions): ContractBuilder { function addBase(c: ContractBuilder, name: string, symbol: string, pausable: boolean) { // Set metadata - c.addConstructorCode(`Base::set_metadata(e, 18, String::from_str(e, "${name}"), String::from_str(e, "${symbol}"));`); + c.addConstructorArgument({ name: 'name', type: 'String', value: name }); + c.addConstructorArgument({ name: 'symbol', type: 'String', value: symbol }); + c.addConstructorCode('Base::set_metadata(e, 18, name, symbol);'); // Set token functions c.addUseClause('stellar_tokens::fungible', 'Base'); @@ -199,7 +201,8 @@ function addPremint(c: ContractBuilder, amount: string) { c.addUseClause('soroban_sdk', 'Address'); c.addConstructorArgument({ name: 'recipient', type: 'Address' }); - c.addConstructorCode(`Base::mint(e, &recipient, ${premintAbsolute});`); + c.addConstructorArgument({ name: 'premint', type: 'i128', value: String(premintAbsolute) }); + c.addConstructorCode(`Base::mint(e, &recipient, premint);`); } } From 0d317eb232c685d8298299edaedd3775fa666cc8 Mon Sep 17 00:00:00 2001 From: Elliot Voris Date: Fri, 7 Nov 2025 12:22:21 -0600 Subject: [PATCH 05/19] print deploy command on non-fungible contract --- packages/core/stellar/src/non-fungible.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/core/stellar/src/non-fungible.ts b/packages/core/stellar/src/non-fungible.ts index 7230a3c80..b81f21214 100644 --- a/packages/core/stellar/src/non-fungible.ts +++ b/packages/core/stellar/src/non-fungible.ts @@ -121,9 +121,9 @@ export function buildNonFungible(opts: NonFungibleOptions): Contract { function addBase(c: ContractBuilder, name: string, symbol: string, pausable: boolean) { // Set metadata - c.addConstructorCode('let uri = String::from_str(e, "www.mytoken.com");'); - c.addConstructorCode(`let name = String::from_str(e, "${name}");`); - c.addConstructorCode(`let symbol = String::from_str(e, "${symbol}");`); + c.addConstructorArgument({ name: 'uri', type: 'String', value: 'www.mytoken.com' }); + c.addConstructorArgument({ name: 'name', type: 'String', value: name }); + c.addConstructorArgument({ name: 'symbol', type: 'String', value: symbol }); c.addConstructorCode(`Base::set_metadata(e, uri, name, symbol);`); // Set token functions From c71c4a70a91697b9deb65cdd8685bb08cd84b01b Mon Sep 17 00:00:00 2001 From: Elliot Voris Date: Fri, 7 Nov 2025 12:27:13 -0600 Subject: [PATCH 06/19] add a placeholder for premint recipient in deploy command --- packages/core/stellar/src/fungible.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/core/stellar/src/fungible.ts b/packages/core/stellar/src/fungible.ts index a4ce22993..07b5ed09f 100644 --- a/packages/core/stellar/src/fungible.ts +++ b/packages/core/stellar/src/fungible.ts @@ -200,7 +200,7 @@ function addPremint(c: ContractBuilder, amount: string) { c.addUseClause('soroban_sdk', 'Address'); - c.addConstructorArgument({ name: 'recipient', type: 'Address' }); + c.addConstructorArgument({ name: 'recipient', type: 'Address', value: '' }); c.addConstructorArgument({ name: 'premint', type: 'i128', value: String(premintAbsolute) }); c.addConstructorCode(`Base::mint(e, &recipient, premint);`); } From d25c3cdfb19638ddfc1a75296b3bd8b8768128a5 Mon Sep 17 00:00:00 2001 From: Elliot Voris Date: Fri, 7 Nov 2025 12:27:56 -0600 Subject: [PATCH 07/19] add deploy command placeholder addresses in access control --- packages/core/stellar/src/set-access-control.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/core/stellar/src/set-access-control.ts b/packages/core/stellar/src/set-access-control.ts index 9725c58ed..e0168a416 100644 --- a/packages/core/stellar/src/set-access-control.ts +++ b/packages/core/stellar/src/set-access-control.ts @@ -32,7 +32,7 @@ export function setAccessControl(c: ContractBuilder, access: Access): void { }; c.addTraitImplBlock(ownableTrait); - c.addConstructorArgument({ name: 'owner', type: 'Address' }); + c.addConstructorArgument({ name: 'owner', type: 'Address', value: '' }); c.addConstructorCode('ownable::set_owner(e, &owner);'); } break; @@ -50,7 +50,7 @@ export function setAccessControl(c: ContractBuilder, access: Access): void { }; c.addTraitImplBlock(accessControltrait); - c.addConstructorArgument({ name: 'admin', type: 'Address' }); + c.addConstructorArgument({ name: 'admin', type: 'Address', value: '' }); c.addConstructorCode('access_control::set_admin(e, &admin);'); break; } @@ -93,7 +93,7 @@ export function requireAccessControl( if (caller && role) { c.addUseClause('soroban_sdk', 'Symbol'); - c.addConstructorArgument({ name: role, type: 'Address' }); + c.addConstructorArgument({ name: role, type: 'Address', value: `<${role} address>` }); c.addConstructorCode(`access_control::grant_role_no_auth(e, &admin, &${role}, &Symbol::new(e, "${role}"));`); if (useMacro) { From 0614fb889db14537161d4b7b229e66c19936da72 Mon Sep 17 00:00:00 2001 From: Elliot Voris Date: Fri, 7 Nov 2025 12:45:32 -0600 Subject: [PATCH 08/19] fix linting warning in print.ts file i'm ignoring a couple warnings in a scaffold download test file, since i didn't touch anything related to those files --- packages/core/stellar/src/print.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/core/stellar/src/print.ts b/packages/core/stellar/src/print.ts index 7767c446d..074f53c7b 100644 --- a/packages/core/stellar/src/print.ts +++ b/packages/core/stellar/src/print.ts @@ -4,7 +4,6 @@ import type { Lines } from './utils/format-lines'; import { formatLines, spaceBetween } from './utils/format-lines'; import { getSelfArg } from './common-options'; import { compatibleContractsSemver } from './utils/version'; -import { toByteArray } from './utils/convert-strings'; const DEFAULT_SECTION = '1. with no section'; const STANDALONE_IMPORTS_GROUP = 'Standalone Imports'; From 7d7e0b04edca7cebb7e5c2a9acbb3d5657103901 Mon Sep 17 00:00:00 2001 From: Elliot Voris Date: Fri, 7 Nov 2025 17:03:27 -0600 Subject: [PATCH 09/19] include all constructor arguments in export functionality --- packages/core/stellar/src/zip-shared.ts | 35 ++++++++++++++++++++++--- 1 file changed, 31 insertions(+), 4 deletions(-) diff --git a/packages/core/stellar/src/zip-shared.ts b/packages/core/stellar/src/zip-shared.ts index b87e51702..b00eeafd2 100644 --- a/packages/core/stellar/src/zip-shared.ts +++ b/packages/core/stellar/src/zip-shared.ts @@ -8,6 +8,10 @@ function pascalToSnakeCase(string: string) { .toLowerCase(); } +function stringFromStr(str: string): string { + return `String::from_str(&env, "${str}")`; +} + export const contractOptionsToContractName = pascalToSnakeCase; export function getAddressArgs(c: Pick): string[] { @@ -16,6 +20,29 @@ export function getAddressArgs(c: Pick): string[] { .map(constructorArg => constructorArg.name); } +export function getConstructorArgs(c: Pick): string[] { + return (c.constructorArgs || []) + .map(constructorArg => { + switch (constructorArg.type?.trim()) { + case 'Address': + return 'Address::generate(&env)'; + case 'String': + return constructorArg.value + ? stringFromStr(constructorArg.value) + : constructorArg.name === 'name' + ? stringFromStr('MyToken') + : constructorArg.name === 'symbol' + ? stringFromStr('MTK') + : stringFromStr('SomeString'); + case 'i128': + return constructorArg.value ? `${constructorArg.value}i128` : '100i128'; + default: + return ''; + } + }) + .filter(constructorArg => constructorArg); +} + export const printRustNameTest = (c: Pick) => `#![cfg(test)] extern crate std; @@ -28,15 +55,15 @@ use crate::contract::{ ${c.name}, ${c.name}Client }; fn initial_state() { let env = Env::default(); - let contract_addr = env.register(${c.name}, (${getAddressArgs(c) - .map(() => 'Address::generate(&env)') - .join(',')}${getAddressArgs(c).length === 1 ? ',' : ''})); + let contract_addr = env.register(${c.name}, (${getConstructorArgs(c).join( + ',', + )}${getConstructorArgs(c).length === 1 ? ',' : ''})); let client = ${c.name}Client::new(&env, &contract_addr); assert_eq!(client.name(), String::from_str(&env, "${c.name}")); } -// Add more tests bellow +// Add more tests below `; export const libDependencies = [ From 019d4c5fb4c95abe88244cc060e9b8761dd4fa4e Mon Sep 17 00:00:00 2001 From: Elliot Voris Date: Fri, 7 Nov 2025 17:04:18 -0600 Subject: [PATCH 10/19] update test snapshots --- packages/core/stellar/src/fungible.test.ts.md | 173 +++++++++++-- .../core/stellar/src/fungible.test.ts.snap | Bin 1515 -> 1715 bytes .../core/stellar/src/non-fungible.test.ts.md | 192 ++++++++++---- .../stellar/src/non-fungible.test.ts.snap | Bin 1592 -> 1677 bytes .../core/stellar/src/stablecoin.test.ts.md | 240 +++++++++++++++--- .../core/stellar/src/stablecoin.test.ts.snap | Bin 1803 -> 2014 bytes .../stellar/src/zip-rust.compile.test.ts.md | 19 +- .../stellar/src/zip-rust.compile.test.ts.snap | Bin 1513 -> 1630 bytes packages/core/stellar/src/zip-shared.test.ts | 36 ++- 9 files changed, 533 insertions(+), 127 deletions(-) diff --git a/packages/core/stellar/src/fungible.test.ts.md b/packages/core/stellar/src/fungible.test.ts.md index 466c2739c..0e7965671 100644 --- a/packages/core/stellar/src/fungible.test.ts.md +++ b/packages/core/stellar/src/fungible.test.ts.md @@ -21,8 +21,15 @@ 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"));␊ + // deploy this smart contract with the Stellar CLI:␊ + //␊ + // stellar contract deploy \\␊ + // --wasm path/to/file.wasm \\␊ + // -- \\␊ + // --name MyToken \\␊ + // --symbol MTK␊ + pub fn __constructor(e: &Env, name: String, symbol: String) {␊ + Base::set_metadata(e, 18, name, symbol);␊ }␊ }␊ ␊ @@ -51,8 +58,15 @@ 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"));␊ + // deploy this smart contract with the Stellar CLI:␊ + //␊ + // stellar contract deploy \\␊ + // --wasm path/to/file.wasm \\␊ + // -- \\␊ + // --name MyToken \\␊ + // --symbol MTK␊ + pub fn __constructor(e: &Env, name: String, symbol: String) {␊ + Base::set_metadata(e, 18, name, symbol);␊ }␊ }␊ ␊ @@ -91,8 +105,16 @@ 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"));␊ + // deploy this smart contract with the Stellar CLI:␊ + //␊ + // stellar contract deploy \\␊ + // --wasm path/to/file.wasm \\␊ + // -- \\␊ + // --name MyToken \\␊ + // --symbol MTK \\␊ + // --owner ␊ + pub fn __constructor(e: &Env, name: String, symbol: String, owner: Address) {␊ + Base::set_metadata(e, 18, name, symbol);␊ ownable::set_owner(e, &owner);␊ }␊ }␊ @@ -158,8 +180,16 @@ 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"));␊ + // deploy this smart contract with the Stellar CLI:␊ + //␊ + // stellar contract deploy \\␊ + // --wasm path/to/file.wasm \\␊ + // -- \\␊ + // --name MyToken \\␊ + // --symbol MTK \\␊ + // --owner ␊ + pub fn __constructor(e: &Env, name: String, symbol: String, owner: Address) {␊ + Base::set_metadata(e, 18, name, symbol);␊ ownable::set_owner(e, &owner);␊ }␊ }␊ @@ -240,9 +270,18 @@ 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);␊ + // deploy this smart contract with the Stellar CLI:␊ + //␊ + // stellar contract deploy \\␊ + // --wasm path/to/file.wasm \\␊ + // -- \\␊ + // --name MyToken \\␊ + // --symbol MTK \\␊ + // --recipient \\␊ + // --premint 1000000000000000000000␊ + pub fn __constructor(e: &Env, name: String, symbol: String, recipient: Address, premint: i128) {␊ + Base::set_metadata(e, 18, name, symbol);␊ + Base::mint(e, &recipient, premint);␊ }␊ }␊ ␊ @@ -271,8 +310,15 @@ 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"));␊ + // deploy this smart contract with the Stellar CLI:␊ + //␊ + // stellar contract deploy \\␊ + // --wasm path/to/file.wasm \\␊ + // -- \\␊ + // --name MyToken \\␊ + // --symbol MTK␊ + pub fn __constructor(e: &Env, name: String, symbol: String) {␊ + Base::set_metadata(e, 18, name, symbol);␊ }␊ }␊ ␊ @@ -301,8 +347,15 @@ 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"));␊ + // deploy this smart contract with the Stellar CLI:␊ + //␊ + // stellar contract deploy \\␊ + // --wasm path/to/file.wasm \\␊ + // -- \\␊ + // --name MyToken \\␊ + // --symbol MTK␊ + pub fn __constructor(e: &Env, name: String, symbol: String) {␊ + Base::set_metadata(e, 18, name, symbol);␊ }␊ }␊ ␊ @@ -332,8 +385,16 @@ 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"));␊ + // deploy this smart contract with the Stellar CLI:␊ + //␊ + // stellar contract deploy \\␊ + // --wasm path/to/file.wasm \\␊ + // -- \\␊ + // --name MyToken \\␊ + // --symbol MTK \\␊ + // --owner ␊ + pub fn __constructor(e: &Env, name: String, symbol: String, owner: Address) {␊ + Base::set_metadata(e, 18, name, symbol);␊ ownable::set_owner(e, &owner);␊ }␊ }␊ @@ -372,8 +433,16 @@ 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"));␊ + // deploy this smart contract with the Stellar CLI:␊ + //␊ + // stellar contract deploy \\␊ + // --wasm path/to/file.wasm \\␊ + // -- \\␊ + // --name MyToken \\␊ + // --symbol MTK \\␊ + // --admin ␊ + pub fn __constructor(e: &Env, name: String, symbol: String, admin: Address) {␊ + Base::set_metadata(e, 18, name, symbol);␊ access_control::set_admin(e, &admin);␊ }␊ }␊ @@ -413,9 +482,26 @@ 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);␊ + // deploy this smart contract with the Stellar CLI:␊ + //␊ + // stellar contract deploy \\␊ + // --wasm path/to/file.wasm \\␊ + // -- \\␊ + // --name MyToken \\␊ + // --symbol MTK \\␊ + // --recipient \\␊ + // --premint 2000000000000000000000 \\␊ + // --owner ␊ + pub fn __constructor(␊ + e: &Env,␊ + name: String,␊ + symbol: String,␊ + recipient: Address,␊ + premint: i128,␊ + owner: Address,␊ + ) {␊ + Base::set_metadata(e, 18, name, symbol);␊ + Base::mint(e, &recipient, premint);␊ ownable::set_owner(e, &owner);␊ }␊ ␊ @@ -506,16 +592,32 @@ Generated by [AVA](https://avajs.dev). ␊ #[contractimpl]␊ impl MyToken {␊ + // deploy this smart contract with the Stellar CLI:␊ + //␊ + // stellar contract deploy \\␊ + // --wasm path/to/file.wasm \\␊ + // -- \\␊ + // --name MyToken \\␊ + // --symbol MTK \\␊ + // --recipient \\␊ + // --premint 2000000000000000000000 \\␊ + // --admin \\␊ + // --pauser \\␊ + // --upgrader \\␊ + // --minter ␊ pub fn __constructor(␊ e: &Env,␊ + name: String,␊ + symbol: String,␊ recipient: Address,␊ + premint: i128,␊ admin: Address,␊ pauser: Address,␊ 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, 18, name, symbol);␊ + Base::mint(e, &recipient, premint);␊ 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"));␊ @@ -616,9 +718,26 @@ 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);␊ + // deploy this smart contract with the Stellar CLI:␊ + //␊ + // stellar contract deploy \\␊ + // --wasm path/to/file.wasm \\␊ + // -- \\␊ + // --name Custom $ Token \\␊ + // --symbol MTK \\␊ + // --recipient \\␊ + // --premint 2000000000000000000000 \\␊ + // --owner ␊ + pub fn __constructor(␊ + e: &Env,␊ + name: String,␊ + symbol: String,␊ + recipient: Address,␊ + premint: i128,␊ + owner: Address,␊ + ) {␊ + Base::set_metadata(e, 18, name, symbol);␊ + Base::mint(e, &recipient, premint);␊ ownable::set_owner(e, &owner);␊ }␊ ␊ diff --git a/packages/core/stellar/src/fungible.test.ts.snap b/packages/core/stellar/src/fungible.test.ts.snap index 8cc95005863993bf26ef0492bc66bb197c837c26..1328e9c3a31651cc7c7778e79cfc9706188c6ff6 100644 GIT binary patch literal 1715 zcmV;k22A-uRzVU!thOE(t&Txd37>*;4-EkW(2Zmpo+N~R zO_GGf5rr*D;uv$-Vw|-wg$+g}$G#Ns?d_FMR#u%`A3mqd6EfIwoKz4Hn$Q!$3xp2* zoZN-tDe5G#3lHfl7q%pi=x%RK^XZPf4)!?{2n8g>X)HZOU#F1l1)&0=LJJ5TJivmu z@Oj>_tq6K+j&tjI(d&+rq%9DVr@n;8`x!-zKy|a@sNdo<95?^~%_amSiP=8Lb|gS_ zFqh?Iw8CVYlzQ5Dw25-Qf;}I1pDCC3O+m1{+{K~;36|}qWX&*&$x7Bzp{PDn+#%&C zEA3*x(_%3^-u@zMQ!@@Jc%ILwo;l--1VJNHz7m4+C2&Er7Vk^>+|{L2i;y7F>kx_6 zCR-#ftlrfU3eKgqjG^cBlv1l}w_{dvZLJ_=d_e7TKOyC2+g2~1Wg^ zKr7`G8x7)eP&0^Um(SQB?gs%ULiFw7R4k*=4?>0BALK38YA%e`IL)To-4FL9p(0{b zsD{b*mIFAV?en7Ld2N@I*fhFcuwn zsf=QQP@%1ggrdoXr}@(eG&ra(p9_q}`yT63!d>XL3H2zGo)Siao^_)W0z$Pl(n=`?{xeZKX4VDIf@%^?NJF%==HC@AEt zQ)<8k$to|n!%`{{M5}l1R+Y0w;t-)~{|NOZyUg0!=cj!VR@9WT6lxY4;AxIA7hIK5!!?1)Q1wHp-mP@dF4_b`Hl@a%msi0k|>#>hF zJ2k0&)%iG%N9^$d>5F7=l?>8TdKCF3*Tj~PBlrl9xA*=~40?#~yZWH!`#!#Eecz1v zJ{u@ozi9p9Iq-`^SD1QA|i#NWzn8h#aw@rSV6F*8KLM5#C9}E9oCCv91tllc)R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Ivazh|R=20?_H^BzevjJI*0lT6<1v_4 zgE}09BNYJuUatT~*u4b;BPJYPblOAM{6>NPO#qca8ewoEsDm+?SN)e~Orc=ZA0Osu zqneN-F)PU9pzz+{W{z{SH9aJh#Z4Mq*+2<2>R&zzw;r<)eEEEsO(b?Hn~J{T8Jt)Q z)HVJctZem(piD)6W-)HjP@VR-nb3%JX+k58L_!#LqXWbfBQJwjkWQ^pLOh+i4*A%k zCB);2T=O!Y^EJ86II-uJ-ZVrV`Q>JfS!>K%W7er+)<~Bng}EHAS^{5(p1>r>WG(9e z1yx)SXp}_pV75XgLxFLA!T#oPlV7@iyC6$38O#lb7n5dM8K(BTkt^8E`iCUrG!M@| z8-(jN?*u-c1EZai7UErAK<&TWT_Dtcn_7s|L*_{X@|HvMgHS5o841sGOXlCKjD-RC z9O|a!^Z?+n$!id}=pb;|rZo_}CJ-D}X*C$MMx((j$slvNurW>|36056T&YxbM|IMU RYC(-X<9|(>R%0MP006J`@kIat diff --git a/packages/core/stellar/src/non-fungible.test.ts.md b/packages/core/stellar/src/non-fungible.test.ts.md index 62e5ccafd..34af56ada 100644 --- a/packages/core/stellar/src/non-fungible.test.ts.md +++ b/packages/core/stellar/src/non-fungible.test.ts.md @@ -21,10 +21,15 @@ Generated by [AVA](https://avajs.dev). ␊ #[contractimpl]␊ impl MyToken {␊ - pub fn __constructor(e: &Env) {␊ - let uri = String::from_str(e, "www.mytoken.com");␊ - let name = String::from_str(e, "MyToken");␊ - let symbol = String::from_str(e, "MTK");␊ + // deploy this smart contract with the Stellar CLI:␊ + //␊ + // stellar contract deploy \\␊ + // --wasm path/to/file.wasm \\␊ + // -- \\␊ + // --uri www.mytoken.com \\␊ + // --name MyToken \\␊ + // --symbol MTK␊ + pub fn __constructor(e: &Env, uri: String, name: String, symbol: String) {␊ Base::set_metadata(e, uri, name, symbol);␊ }␊ }␊ @@ -54,10 +59,15 @@ Generated by [AVA](https://avajs.dev). ␊ #[contractimpl]␊ impl MyToken {␊ - pub fn __constructor(e: &Env) {␊ - let uri = String::from_str(e, "www.mytoken.com");␊ - let name = String::from_str(e, "MyToken");␊ - let symbol = String::from_str(e, "MTK");␊ + // deploy this smart contract with the Stellar CLI:␊ + //␊ + // stellar contract deploy \\␊ + // --wasm path/to/file.wasm \\␊ + // -- \\␊ + // --uri www.mytoken.com \\␊ + // --name MyToken \\␊ + // --symbol MTK␊ + pub fn __constructor(e: &Env, uri: String, name: String, symbol: String) {␊ Base::set_metadata(e, uri, name, symbol);␊ }␊ }␊ @@ -97,10 +107,16 @@ Generated by [AVA](https://avajs.dev). ␊ #[contractimpl]␊ impl MyToken {␊ - pub fn __constructor(e: &Env, owner: Address) {␊ - let uri = String::from_str(e, "www.mytoken.com");␊ - let name = String::from_str(e, "MyToken");␊ - let symbol = String::from_str(e, "MTK");␊ + // deploy this smart contract with the Stellar CLI:␊ + //␊ + // stellar contract deploy \\␊ + // --wasm path/to/file.wasm \\␊ + // -- \\␊ + // --uri www.mytoken.com \\␊ + // --name MyToken \\␊ + // --symbol MTK \\␊ + // --owner ␊ + pub fn __constructor(e: &Env, uri: String, name: String, symbol: String, owner: Address) {␊ Base::set_metadata(e, uri, name, symbol);␊ ownable::set_owner(e, &owner);␊ }␊ @@ -167,10 +183,16 @@ Generated by [AVA](https://avajs.dev). ␊ #[contractimpl]␊ impl MyToken {␊ - pub fn __constructor(e: &Env, owner: Address) {␊ - let uri = String::from_str(e, "www.mytoken.com");␊ - let name = String::from_str(e, "MyToken");␊ - let symbol = String::from_str(e, "MTK");␊ + // deploy this smart contract with the Stellar CLI:␊ + //␊ + // stellar contract deploy \\␊ + // --wasm path/to/file.wasm \\␊ + // -- \\␊ + // --uri www.mytoken.com \\␊ + // --name MyToken \\␊ + // --symbol MTK \\␊ + // --owner ␊ + pub fn __constructor(e: &Env, uri: String, name: String, symbol: String, owner: Address) {␊ Base::set_metadata(e, uri, name, symbol);␊ ownable::set_owner(e, &owner);␊ }␊ @@ -253,10 +275,16 @@ Generated by [AVA](https://avajs.dev). ␊ #[contractimpl]␊ impl MyToken {␊ - pub fn __constructor(e: &Env, owner: Address) {␊ - let uri = String::from_str(e, "www.mytoken.com");␊ - let name = String::from_str(e, "MyToken");␊ - let symbol = String::from_str(e, "MTK");␊ + // deploy this smart contract with the Stellar CLI:␊ + //␊ + // stellar contract deploy \\␊ + // --wasm path/to/file.wasm \\␊ + // -- \\␊ + // --uri www.mytoken.com \\␊ + // --name MyToken \\␊ + // --symbol MTK \\␊ + // --owner ␊ + pub fn __constructor(e: &Env, uri: String, name: String, symbol: String, owner: Address) {␊ Base::set_metadata(e, uri, name, symbol);␊ ownable::set_owner(e, &owner);␊ }␊ @@ -302,10 +330,15 @@ Generated by [AVA](https://avajs.dev). ␊ #[contractimpl]␊ impl MyToken {␊ - pub fn __constructor(e: &Env) {␊ - let uri = String::from_str(e, "www.mytoken.com");␊ - let name = String::from_str(e, "MyToken");␊ - let symbol = String::from_str(e, "MTK");␊ + // deploy this smart contract with the Stellar CLI:␊ + //␊ + // stellar contract deploy \\␊ + // --wasm path/to/file.wasm \\␊ + // -- \\␊ + // --uri www.mytoken.com \\␊ + // --name MyToken \\␊ + // --symbol MTK␊ + pub fn __constructor(e: &Env, uri: String, name: String, symbol: String) {␊ Base::set_metadata(e, uri, name, symbol);␊ }␊ }␊ @@ -346,10 +379,16 @@ Generated by [AVA](https://avajs.dev). ␊ #[contractimpl]␊ impl MyToken {␊ - pub fn __constructor(e: &Env, owner: Address) {␊ - let uri = String::from_str(e, "www.mytoken.com");␊ - let name = String::from_str(e, "MyToken");␊ - let symbol = String::from_str(e, "MTK");␊ + // deploy this smart contract with the Stellar CLI:␊ + //␊ + // stellar contract deploy \\␊ + // --wasm path/to/file.wasm \\␊ + // -- \\␊ + // --uri www.mytoken.com \\␊ + // --name MyToken \\␊ + // --symbol MTK \\␊ + // --owner ␊ + pub fn __constructor(e: &Env, uri: String, name: String, symbol: String, owner: Address) {␊ Base::set_metadata(e, uri, name, symbol);␊ ownable::set_owner(e, &owner);␊ }␊ @@ -404,10 +443,16 @@ Generated by [AVA](https://avajs.dev). ␊ #[contractimpl]␊ impl MyToken {␊ - pub fn __constructor(e: &Env, owner: Address) {␊ - let uri = String::from_str(e, "www.mytoken.com");␊ - let name = String::from_str(e, "MyToken");␊ - let symbol = String::from_str(e, "MTK");␊ + // deploy this smart contract with the Stellar CLI:␊ + //␊ + // stellar contract deploy \\␊ + // --wasm path/to/file.wasm \\␊ + // -- \\␊ + // --uri www.mytoken.com \\␊ + // --name MyToken \\␊ + // --symbol MTK \\␊ + // --owner ␊ + pub fn __constructor(e: &Env, uri: String, name: String, symbol: String, owner: Address) {␊ Base::set_metadata(e, uri, name, symbol);␊ ownable::set_owner(e, &owner);␊ }␊ @@ -466,10 +511,16 @@ Generated by [AVA](https://avajs.dev). ␊ #[contractimpl]␊ impl MyToken {␊ - pub fn __constructor(e: &Env, owner: Address) {␊ - let uri = String::from_str(e, "www.mytoken.com");␊ - let name = String::from_str(e, "MyToken");␊ - let symbol = String::from_str(e, "MTK");␊ + // deploy this smart contract with the Stellar CLI:␊ + //␊ + // stellar contract deploy \\␊ + // --wasm path/to/file.wasm \\␊ + // -- \\␊ + // --uri www.mytoken.com \\␊ + // --name MyToken \\␊ + // --symbol MTK \\␊ + // --owner ␊ + pub fn __constructor(e: &Env, uri: String, name: String, symbol: String, owner: Address) {␊ Base::set_metadata(e, uri, name, symbol);␊ ownable::set_owner(e, &owner);␊ }␊ @@ -552,10 +603,16 @@ Generated by [AVA](https://avajs.dev). ␊ #[contractimpl]␊ impl MyToken {␊ - pub fn __constructor(e: &Env, owner: Address) {␊ - let uri = String::from_str(e, "www.mytoken.com");␊ - let name = String::from_str(e, "MyToken");␊ - let symbol = String::from_str(e, "MTK");␊ + // deploy this smart contract with the Stellar CLI:␊ + //␊ + // stellar contract deploy \\␊ + // --wasm path/to/file.wasm \\␊ + // -- \\␊ + // --uri www.mytoken.com \\␊ + // --name MyToken \\␊ + // --symbol MTK \\␊ + // --owner ␊ + pub fn __constructor(e: &Env, uri: String, name: String, symbol: String, owner: Address) {␊ Base::set_metadata(e, uri, name, symbol);␊ ownable::set_owner(e, &owner);␊ }␊ @@ -646,10 +703,15 @@ Generated by [AVA](https://avajs.dev). ␊ #[contractimpl]␊ impl MyToken {␊ - pub fn __constructor(e: &Env) {␊ - let uri = String::from_str(e, "www.mytoken.com");␊ - let name = String::from_str(e, "MyToken");␊ - let symbol = String::from_str(e, "MTK");␊ + // deploy this smart contract with the Stellar CLI:␊ + //␊ + // stellar contract deploy \\␊ + // --wasm path/to/file.wasm \\␊ + // -- \\␊ + // --uri www.mytoken.com \\␊ + // --name MyToken \\␊ + // --symbol MTK␊ + pub fn __constructor(e: &Env, uri: String, name: String, symbol: String) {␊ Base::set_metadata(e, uri, name, symbol);␊ }␊ }␊ @@ -682,10 +744,16 @@ Generated by [AVA](https://avajs.dev). ␊ #[contractimpl]␊ impl MyToken {␊ - pub fn __constructor(e: &Env, owner: Address) {␊ - let uri = String::from_str(e, "www.mytoken.com");␊ - let name = String::from_str(e, "MyToken");␊ - let symbol = String::from_str(e, "MTK");␊ + // deploy this smart contract with the Stellar CLI:␊ + //␊ + // stellar contract deploy \\␊ + // --wasm path/to/file.wasm \\␊ + // -- \\␊ + // --uri www.mytoken.com \\␊ + // --name MyToken \\␊ + // --symbol MTK \\␊ + // --owner ␊ + pub fn __constructor(e: &Env, uri: String, name: String, symbol: String, owner: Address) {␊ Base::set_metadata(e, uri, name, symbol);␊ ownable::set_owner(e, &owner);␊ }␊ @@ -738,10 +806,16 @@ Generated by [AVA](https://avajs.dev). ␊ #[contractimpl]␊ impl MyToken {␊ - pub fn __constructor(e: &Env, owner: Address) {␊ - let uri = String::from_str(e, "www.mytoken.com");␊ - let name = String::from_str(e, "MyToken");␊ - let symbol = String::from_str(e, "MTK");␊ + // deploy this smart contract with the Stellar CLI:␊ + //␊ + // stellar contract deploy \\␊ + // --wasm path/to/file.wasm \\␊ + // -- \\␊ + // --uri www.mytoken.com \\␊ + // --name MyToken \\␊ + // --symbol MTK \\␊ + // --owner ␊ + pub fn __constructor(e: &Env, uri: String, name: String, symbol: String, owner: Address) {␊ Base::set_metadata(e, uri, name, symbol);␊ ownable::set_owner(e, &owner);␊ }␊ @@ -841,10 +915,16 @@ Generated by [AVA](https://avajs.dev). ␊ #[contractimpl]␊ impl CustomToken {␊ - pub fn __constructor(e: &Env, owner: Address) {␊ - let uri = String::from_str(e, "www.mytoken.com");␊ - let name = String::from_str(e, "Custom $ Token");␊ - let symbol = String::from_str(e, "MTK");␊ + // deploy this smart contract with the Stellar CLI:␊ + //␊ + // stellar contract deploy \\␊ + // --wasm path/to/file.wasm \\␊ + // -- \\␊ + // --uri www.mytoken.com \\␊ + // --name Custom $ Token \\␊ + // --symbol MTK \\␊ + // --owner ␊ + pub fn __constructor(e: &Env, uri: String, name: String, symbol: String, owner: Address) {␊ Base::set_metadata(e, uri, name, symbol);␊ ownable::set_owner(e, &owner);␊ }␊ diff --git a/packages/core/stellar/src/non-fungible.test.ts.snap b/packages/core/stellar/src/non-fungible.test.ts.snap index 92c1b0daf738cac33c191c454b899b2f5298fc2e..8bf64989f170b5d8ed860486fdfc50ad208474db 100644 GIT binary patch literal 1677 zcmV;826Fj9RzV`IdJ^sVbMED{gaT{~r19|; z86Do)L+H@Wv)fQy`C$~;utgu+up?rhKJ2e&<+6&L5W6ws2z7{ulR!8!zn(*|JwiD` zlu@V91VV>5F()>B!RV)X+OEvkU$?C5_lwF~R+O}Xi#Txw+&)NiXc=T}Eld6_9>bvp z0MKkgheQE80MYe1@DRsh(5FmqqDuzq+Pt-m@^VG-y!mCJT;4ZDhDM`@c?b~}-KJno z&kx92nxf=Tuanq^Uaz+n9;6ysbD5Tv;*bnFp``PJu+0Lvz598ZCKcjQa2%J>Off88 zAqbXJ6D6^aay!`|C6;%YoZ@~p*OUB7OCZFFa6%%m9G5F36_tr7imtAwCHhuhT0pgT ztJ)&Nwgr#HLuL{O5gClpU3v3S+MIRE>RY)ZC8`TS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yVII9mf;QN2yhP?%k)mg qqmJ6ZzDzzhEb6FnEt8tf3*|>OZ&}9)Scjp;zVkntYRvetQvd)1I{o$l diff --git a/packages/core/stellar/src/stablecoin.test.ts.md b/packages/core/stellar/src/stablecoin.test.ts.md index 496964c3e..7d08d45e5 100644 --- a/packages/core/stellar/src/stablecoin.test.ts.md +++ b/packages/core/stellar/src/stablecoin.test.ts.md @@ -21,8 +21,15 @@ 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"));␊ + // deploy this smart contract with the Stellar CLI:␊ + //␊ + // stellar contract deploy \\␊ + // --wasm path/to/file.wasm \\␊ + // -- \\␊ + // --name MyStablecoin \\␊ + // --symbol MST␊ + pub fn __constructor(e: &Env, name: String, symbol: String) {␊ + Base::set_metadata(e, 18, name, symbol);␊ }␊ }␊ ␊ @@ -51,8 +58,15 @@ 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"));␊ + // deploy this smart contract with the Stellar CLI:␊ + //␊ + // stellar contract deploy \\␊ + // --wasm path/to/file.wasm \\␊ + // -- \\␊ + // --name MyStablecoin \\␊ + // --symbol MST␊ + pub fn __constructor(e: &Env, name: String, symbol: String) {␊ + Base::set_metadata(e, 18, name, symbol);␊ }␊ }␊ ␊ @@ -91,8 +105,16 @@ 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"));␊ + // deploy this smart contract with the Stellar CLI:␊ + //␊ + // stellar contract deploy \\␊ + // --wasm path/to/file.wasm \\␊ + // -- \\␊ + // --name MyStablecoin \\␊ + // --symbol MST \\␊ + // --owner ␊ + pub fn __constructor(e: &Env, name: String, symbol: String, owner: Address) {␊ + Base::set_metadata(e, 18, name, symbol);␊ ownable::set_owner(e, &owner);␊ }␊ }␊ @@ -158,8 +180,16 @@ 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"));␊ + // deploy this smart contract with the Stellar CLI:␊ + //␊ + // stellar contract deploy \\␊ + // --wasm path/to/file.wasm \\␊ + // -- \\␊ + // --name MyStablecoin \\␊ + // --symbol MST \\␊ + // --owner ␊ + pub fn __constructor(e: &Env, name: String, symbol: String, owner: Address) {␊ + Base::set_metadata(e, 18, name, symbol);␊ ownable::set_owner(e, &owner);␊ }␊ }␊ @@ -240,9 +270,18 @@ 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);␊ + // deploy this smart contract with the Stellar CLI:␊ + //␊ + // stellar contract deploy \\␊ + // --wasm path/to/file.wasm \\␊ + // -- \\␊ + // --name MyStablecoin \\␊ + // --symbol MST \\␊ + // --recipient \\␊ + // --premint 1000000000000000000000␊ + pub fn __constructor(e: &Env, name: String, symbol: String, recipient: Address, premint: i128) {␊ + Base::set_metadata(e, 18, name, symbol);␊ + Base::mint(e, &recipient, premint);␊ }␊ }␊ ␊ @@ -271,8 +310,15 @@ 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"));␊ + // deploy this smart contract with the Stellar CLI:␊ + //␊ + // stellar contract deploy \\␊ + // --wasm path/to/file.wasm \\␊ + // -- \\␊ + // --name MyStablecoin \\␊ + // --symbol MST␊ + pub fn __constructor(e: &Env, name: String, symbol: String) {␊ + Base::set_metadata(e, 18, name, symbol);␊ }␊ }␊ ␊ @@ -301,8 +347,15 @@ 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"));␊ + // deploy this smart contract with the Stellar CLI:␊ + //␊ + // stellar contract deploy \\␊ + // --wasm path/to/file.wasm \\␊ + // -- \\␊ + // --name MyStablecoin \\␊ + // --symbol MST␊ + pub fn __constructor(e: &Env, name: String, symbol: String) {␊ + Base::set_metadata(e, 18, name, symbol);␊ }␊ }␊ ␊ @@ -332,8 +385,16 @@ 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"));␊ + // deploy this smart contract with the Stellar CLI:␊ + //␊ + // stellar contract deploy \\␊ + // --wasm path/to/file.wasm \\␊ + // -- \\␊ + // --name MyStablecoin \\␊ + // --symbol MST \\␊ + // --owner ␊ + pub fn __constructor(e: &Env, name: String, symbol: String, owner: Address) {␊ + Base::set_metadata(e, 18, name, symbol);␊ ownable::set_owner(e, &owner);␊ }␊ }␊ @@ -372,8 +433,16 @@ 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"));␊ + // deploy this smart contract with the Stellar CLI:␊ + //␊ + // stellar contract deploy \\␊ + // --wasm path/to/file.wasm \\␊ + // -- \\␊ + // --name MyStablecoin \\␊ + // --symbol MST \\␊ + // --admin ␊ + pub fn __constructor(e: &Env, name: String, symbol: String, admin: Address) {␊ + Base::set_metadata(e, 18, name, symbol);␊ access_control::set_admin(e, &admin);␊ }␊ }␊ @@ -414,8 +483,16 @@ 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"));␊ + // deploy this smart contract with the Stellar CLI:␊ + //␊ + // stellar contract deploy \\␊ + // --wasm path/to/file.wasm \\␊ + // -- \\␊ + // --name MyStablecoin \\␊ + // --symbol MST \\␊ + // --owner ␊ + pub fn __constructor(e: &Env, name: String, symbol: String, owner: Address) {␊ + Base::set_metadata(e, 18, name, symbol);␊ ownable::set_owner(e, &owner);␊ }␊ }␊ @@ -477,8 +554,16 @@ 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"));␊ + // deploy this smart contract with the Stellar CLI:␊ + //␊ + // stellar contract deploy \\␊ + // --wasm path/to/file.wasm \\␊ + // -- \\␊ + // --name MyStablecoin \\␊ + // --symbol MST \\␊ + // --owner ␊ + pub fn __constructor(e: &Env, name: String, symbol: String, owner: Address) {␊ + Base::set_metadata(e, 18, name, symbol);␊ ownable::set_owner(e, &owner);␊ }␊ }␊ @@ -541,9 +626,26 @@ 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);␊ + // deploy this smart contract with the Stellar CLI:␊ + //␊ + // stellar contract deploy \\␊ + // --wasm path/to/file.wasm \\␊ + // -- \\␊ + // --name MyStablecoin \\␊ + // --symbol MST \\␊ + // --recipient \\␊ + // --premint 2000000000000000000000 \\␊ + // --owner ␊ + pub fn __constructor(␊ + e: &Env,␊ + name: String,␊ + symbol: String,␊ + recipient: Address,␊ + premint: i128,␊ + owner: Address,␊ + ) {␊ + Base::set_metadata(e, 18, name, symbol);␊ + Base::mint(e, &recipient, premint);␊ ownable::set_owner(e, &owner);␊ }␊ ␊ @@ -651,9 +753,26 @@ 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);␊ + // deploy this smart contract with the Stellar CLI:␊ + //␊ + // stellar contract deploy \\␊ + // --wasm path/to/file.wasm \\␊ + // -- \\␊ + // --name MyStablecoin \\␊ + // --symbol MST \\␊ + // --recipient \\␊ + // --premint 2000000000000000000000 \\␊ + // --owner ␊ + pub fn __constructor(␊ + e: &Env,␊ + name: String,␊ + symbol: String,␊ + recipient: Address,␊ + premint: i128,␊ + owner: Address,␊ + ) {␊ + Base::set_metadata(e, 18, name, symbol);␊ + Base::mint(e, &recipient, premint);␊ ownable::set_owner(e, &owner);␊ }␊ ␊ @@ -761,16 +880,32 @@ Generated by [AVA](https://avajs.dev). ␊ #[contractimpl]␊ impl MyStablecoin {␊ + // deploy this smart contract with the Stellar CLI:␊ + //␊ + // stellar contract deploy \\␊ + // --wasm path/to/file.wasm \\␊ + // -- \\␊ + // --name MyStablecoin \\␊ + // --symbol MST \\␊ + // --recipient \\␊ + // --premint 2000000000000000000000 \\␊ + // --admin \\␊ + // --pauser \\␊ + // --minter \\␊ + // --manager ␊ pub fn __constructor(␊ e: &Env,␊ + name: String,␊ + symbol: String,␊ recipient: Address,␊ + premint: i128,␊ admin: Address,␊ pauser: Address,␊ 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, 18, name, symbol);␊ + Base::mint(e, &recipient, premint);␊ 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"));␊ @@ -881,16 +1016,32 @@ Generated by [AVA](https://avajs.dev). ␊ #[contractimpl]␊ impl MyStablecoin {␊ + // deploy this smart contract with the Stellar CLI:␊ + //␊ + // stellar contract deploy \\␊ + // --wasm path/to/file.wasm \\␊ + // -- \\␊ + // --name MyStablecoin \\␊ + // --symbol MST \\␊ + // --recipient \\␊ + // --premint 2000000000000000000000 \\␊ + // --admin \\␊ + // --pauser \\␊ + // --minter \\␊ + // --manager ␊ pub fn __constructor(␊ e: &Env,␊ + name: String,␊ + symbol: String,␊ recipient: Address,␊ + premint: i128,␊ admin: Address,␊ pauser: Address,␊ 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, 18, name, symbol);␊ + Base::mint(e, &recipient, premint);␊ 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"));␊ @@ -999,9 +1150,26 @@ 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);␊ + // deploy this smart contract with the Stellar CLI:␊ + //␊ + // stellar contract deploy \\␊ + // --wasm path/to/file.wasm \\␊ + // -- \\␊ + // --name Custom $ Token \\␊ + // --symbol MST \\␊ + // --recipient \\␊ + // --premint 2000000000000000000000 \\␊ + // --owner ␊ + pub fn __constructor(␊ + e: &Env,␊ + name: String,␊ + symbol: String,␊ + recipient: Address,␊ + premint: i128,␊ + owner: Address,␊ + ) {␊ + Base::set_metadata(e, 18, name, symbol);␊ + Base::mint(e, &recipient, premint);␊ ownable::set_owner(e, &owner);␊ }␊ ␊ diff --git a/packages/core/stellar/src/stablecoin.test.ts.snap b/packages/core/stellar/src/stablecoin.test.ts.snap index 93b9ab4dad09cee3c59476435eec192917e41168..275dc07d9ed583147f48f3c8a3713cd1fd21b6a0 100644 GIT binary patch literal 2014 zcmV<42O;=DRzVZ^!w~Yw-@c)iZkKP$JOeU2w~m~UY@K3 zJnc%ml^=@;00000000B+T-}ZvH5Bd-TiRK*688ul+A7+WW}CL+qVg`4+NDU9TD4LZ z1e9guB+l-r6MHmv$gWno;0?Io0cd#u#4GRy2zUYDhFdNW7YHHSGm~*Lnfz=vKf9ib z#N)A#J;y%ZImhQDuNu{W)n4+iUlZYrfP_`d{TgtAs{yGopZc8Qknc0Wzj{@#V}U=t z@Xy6_Z=RFa`IU2TUHJ1txeS%(AAGX$#IF&`$;RV4p~7$YBtr1?@s3k2!!~P%Soqa| zK-(Al@GKo_e= zfa``HufIg-s1`SOAu0LIFmT}!{nCYshU^3!Mo zM-Bi$xeRp@2J8^TzR!U-aU{~$(ySBvB<0xllgB9TmvoQcpxY^?_j%G_W223E6GANZ z%Yu~~en4)inoNsqnc^lfr{9OLv)foYXs{@60mNZQ z(hayHZ{An)*>s$a6UzwiN(WS15tTRnVsf!#hzY$oXEAwDuSbOQu9VC~UK0Kwl(7F{ zTw`VFOv{o}F3TPN=s*z4eMY&g7;o@oC*_QvE2|-H@qAgm^t&Oezg${gS;e&);T$2> zj^*x%lb`{ZLtNv+GhOKEm<-^xgdcE(5^iNEBvmdvk4po9;wZa{E-)G#daO-J(X@X!s`e zP@RRPpRJQbC4!;h=y=QLdd`s8}zn%8|$v= z%Z#@gvh%nrF?>3MS#7P81-DK_)?bfE)2D*ea}L+OGmMgN&gS8oRqi7w_lVT|&?i*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H=jpa*weIumPj5O${cjVfQXwC;rlNqeE&8r zd=G3pz>E!LZz)ok(g&fG{11~SNu`jLo#?ScfCnaF4wgtKc9v022Tr9MvqwY15xBee?#o1NW6wcIULT<$WF1-p zs17YoQy3W;CdAJW5Qa!H9}`>R@chwE7Sy4YtW~><%sPHAR53A(CCp5DaA2F^AgQ$w3{`&oVu)LP18LZ{kr_l|T>4Eby~gQ|m-x59{2> z$wwuTRE9`>#Ps@q%=v0$hx%3rx>0HhX1Ke{7$973^;Pi0daV<3r8M9u0IT(Me5tyXAYkj3>4212rpV z0BUM$kz5RmYq~HH9fDdP5n~*$ruOn3fV-#4zGIZ%(sE z17%2?H>4RiW;LW4fEq&@NyM~8&{h$i+66;`L> z#5Z6=vmcB;L+puc9fsvD%yZV;7Otx9I4nszR7(~hy|uARviSZpV5 zU2s~H^lLA2!RfauI9;*ebm~fi3QkpU+Gubp7gAJkx~jpcs#dK=wMvDiDl|Rkq3K33 zG>y7uYOAI_zl-Md=HZm`8;-YZM+&-mz3R`Y137k3`TQ)G$MSJe;OOE2gIotys+vBDf!I zAbwHXIyDA#%#jk%@r$f!enpCBxhJN#xT&i-Y zQkC^dRo1_}u2Pkf2vwyjDpgUZASzW^qf?OaSwRCQBjb@$rzI*;QHjdZ6P1sPiHb#g zzK2hMn7xv(`fvQ2OHz6_)+k9i?~Ok5`_p^-A>*_cjjGBkq#@0B?Zn6c+=d7t)wr{e tkhREi_16X0F<6!3n<7tDcr%airbt)S3o=75NREsH?SE&?=uP}%001k7VnF}^ 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 8eecc5875..c03d542ed 100644 --- a/packages/core/stellar/src/zip-rust.compile.test.ts.md +++ b/packages/core/stellar/src/zip-rust.compile.test.ts.md @@ -22,9 +22,18 @@ 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);␊ + // deploy this smart contract with the Stellar CLI:␊ + //␊ + // stellar contract deploy \\␊ + // --wasm path/to/file.wasm \\␊ + // -- \\␊ + // --name MyToken \\␊ + // --symbol MTK \\␊ + // --recipient \\␊ + // --premint 2000000000000000000000␊ + pub fn __constructor(e: &Env, name: String, symbol: String, recipient: Address, premint: i128) {␊ + Base::set_metadata(e, 18, name, symbol);␊ + Base::mint(e, &recipient, premint);␊ }␊ }␊ ␊ @@ -55,13 +64,13 @@ Generated by [AVA](https://avajs.dev). fn initial_state() {␊ let env = Env::default();␊ ␊ - let contract_addr = env.register(MyToken, (Address::generate(&env),));␊ + let contract_addr = env.register(MyToken, (String::from_str(&env, "MyToken"),String::from_str(&env, "MTK"),Address::generate(&env),2000000000000000000000i128));␊ let client = MyTokenClient::new(&env, &contract_addr);␊ ␊ assert_eq!(client.name(), String::from_str(&env, "MyToken"));␊ }␊ ␊ - // Add more tests bellow␊ + // Add more tests below␊ `, `#![no_std]␊ #![allow(dead_code)]␊ 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 d554d6bd2ceb7c7998d59e7e944db3ecc7af4e76..cf2893552efe609e6835c326d30800ce53aec307 100644 GIT binary patch literal 1630 zcmV-k2BG;uRzVI+j^eq)Jjrok1>o)Awi}V&7sPr4P`%1u0RsCz%V|XDh z$8c^G6XngMRnXd*S2R~rr)hyp+HfTi2SZ|}l-jEwx_Fd*>chg{xO|X>eHDZ`ejeVzF*pI36VnVEmB(Yuh;wOVbGbyy) z`2XyBUhkW}Azk|q2EP9v9~>Rd@?|+RsLd!N1b;H91mubu+fl{juJ#3sZVcl(O}lyk z)i57#tFzOo0`iXhQm9Z)$Ei3sVb^6_!jJRKwo(u=O)dmr7Q1ZPf4yTKB^a5st=hL|l9uj>cWo zXBlPjqmOT$JdTh&dE0B>3$BZ=h_q*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GavPmLm zW?3b5+$|$V9d|h!gtfO5p$+BS9?jQ-BP4)RM3~hTw~;y*tWltKi{=%}aO1HJ5S4cG zIg~0NWir*HI?0hPs4~H3BIIZc6M3KwRR*(>MpKo8(0PB(%zrw(mSWCKP)qfw)d+HC P1|j(uqq0NBT?_yK(}vlG diff --git a/packages/core/stellar/src/zip-shared.test.ts b/packages/core/stellar/src/zip-shared.test.ts index 6c0b640cd..50b54524c 100644 --- a/packages/core/stellar/src/zip-shared.test.ts +++ b/packages/core/stellar/src/zip-shared.test.ts @@ -134,7 +134,7 @@ fn initial_state() { assert_eq!(client.name(), String::from_str(&env, "Fungible")); } -// Add more tests bellow +// Add more tests below `; t.is(output, expected); }); @@ -164,7 +164,7 @@ fn initial_state() { assert_eq!(client.name(), String::from_str(&env, "NoArgs")); } -// Add more tests bellow +// Add more tests below `; t.is(output, expected); }); @@ -194,7 +194,37 @@ fn initial_state() { assert_eq!(client.name(), String::from_str(&env, "SingleArg")); } -// Add more tests bellow +// Add more tests below +`; + t.is(output, expected); +}); + +test('printRustNameTest handles single String arg', t => { + const contract = { + name: 'SingleToken', + constructorArgs: [{ name: 'name', type: 'String', value: 'SingleToken' }], + }; + const output = printRustNameTest(contract); + + const expected = `#![cfg(test)] + +extern crate std; + +use soroban_sdk::{ Env, String }; + +use crate::contract::{ SingleToken, SingleTokenClient }; + +#[test] +fn initial_state() { + let env = Env::default(); + + let contract_addr = env.register(SingleToken, (String::from_str(&env, "SingleToken"),)); + let client = SingleTokenClient::new(&env, &contract_addr); + + assert_eq!(client.name(), String::from_str(&env, "SingleToken")); +} + +// Add more tests below `; t.is(output, expected); }); From 55f90cb62b8d745c82a0da48b3ec422c4ad0de8c Mon Sep 17 00:00:00 2001 From: Elliot Voris Date: Fri, 7 Nov 2025 19:13:57 -0600 Subject: [PATCH 11/19] parameterize base uri for stellar nft contracts --- .../common/src/ai/descriptions/stellar.ts | 1 + packages/core/stellar/src/fungible.test.ts.md | 30 +++--- .../core/stellar/src/fungible.test.ts.snap | Bin 1715 -> 1729 bytes .../core/stellar/src/generate/non-fungible.ts | 1 + .../stellar/src/non-fungible.compile.test.ts | 11 +++ .../core/stellar/src/non-fungible.test.ts | 2 +- .../core/stellar/src/non-fungible.test.ts.md | 86 +++++++++--------- .../stellar/src/non-fungible.test.ts.snap | Bin 1677 -> 1689 bytes packages/core/stellar/src/non-fungible.ts | 9 +- packages/core/stellar/src/print.ts | 15 ++- .../core/stellar/src/set-access-control.ts | 6 +- .../core/stellar/src/stablecoin.test.ts.md | 48 +++++----- .../core/stellar/src/stablecoin.test.ts.snap | Bin 2014 -> 2017 bytes .../stellar/src/zip-rust.compile.test.ts.md | 2 +- .../stellar/src/zip-rust.compile.test.ts.snap | Bin 1630 -> 1633 bytes packages/mcp/src/stellar/schemas.ts | 1 + .../src/stellar/tools/non-fungible.test.ts | 2 + .../ui/src/stellar/NonFungibleControls.svelte | 8 ++ 18 files changed, 127 insertions(+), 95 deletions(-) diff --git a/packages/common/src/ai/descriptions/stellar.ts b/packages/common/src/ai/descriptions/stellar.ts index 18532c024..3a5955412 100644 --- a/packages/common/src/ai/descriptions/stellar.ts +++ b/packages/common/src/ai/descriptions/stellar.ts @@ -19,6 +19,7 @@ export const stellarFungibleDescriptions = { }; export const stellarNonFungibleDescriptions = { + baseUri: 'A base uri for the token', enumerable: 'Whether the NFTs are enumerable (can be iterated over).', consecutive: 'To batch mint NFTs instead of minting them individually (sequential minting is mandatory).', sequential: 'Whether the IDs of the minted NFTs will be sequential.', diff --git a/packages/core/stellar/src/fungible.test.ts.md b/packages/core/stellar/src/fungible.test.ts.md index 0e7965671..b0640c086 100644 --- a/packages/core/stellar/src/fungible.test.ts.md +++ b/packages/core/stellar/src/fungible.test.ts.md @@ -112,7 +112,7 @@ Generated by [AVA](https://avajs.dev). // -- \\␊ // --name MyToken \\␊ // --symbol MTK \\␊ - // --owner ␊ + // --owner ␊ pub fn __constructor(e: &Env, name: String, symbol: String, owner: Address) {␊ Base::set_metadata(e, 18, name, symbol);␊ ownable::set_owner(e, &owner);␊ @@ -187,7 +187,7 @@ Generated by [AVA](https://avajs.dev). // -- \\␊ // --name MyToken \\␊ // --symbol MTK \\␊ - // --owner ␊ + // --owner ␊ pub fn __constructor(e: &Env, name: String, symbol: String, owner: Address) {␊ Base::set_metadata(e, 18, name, symbol);␊ ownable::set_owner(e, &owner);␊ @@ -277,7 +277,7 @@ Generated by [AVA](https://avajs.dev). // -- \\␊ // --name MyToken \\␊ // --symbol MTK \\␊ - // --recipient \\␊ + // --recipient "" \\␊ // --premint 1000000000000000000000␊ pub fn __constructor(e: &Env, name: String, symbol: String, recipient: Address, premint: i128) {␊ Base::set_metadata(e, 18, name, symbol);␊ @@ -392,7 +392,7 @@ Generated by [AVA](https://avajs.dev). // -- \\␊ // --name MyToken \\␊ // --symbol MTK \\␊ - // --owner ␊ + // --owner ␊ pub fn __constructor(e: &Env, name: String, symbol: String, owner: Address) {␊ Base::set_metadata(e, 18, name, symbol);␊ ownable::set_owner(e, &owner);␊ @@ -440,7 +440,7 @@ Generated by [AVA](https://avajs.dev). // -- \\␊ // --name MyToken \\␊ // --symbol MTK \\␊ - // --admin ␊ + // --admin ␊ pub fn __constructor(e: &Env, name: String, symbol: String, admin: Address) {␊ Base::set_metadata(e, 18, name, symbol);␊ access_control::set_admin(e, &admin);␊ @@ -489,9 +489,9 @@ Generated by [AVA](https://avajs.dev). // -- \\␊ // --name MyToken \\␊ // --symbol MTK \\␊ - // --recipient \\␊ + // --recipient "" \\␊ // --premint 2000000000000000000000 \\␊ - // --owner ␊ + // --owner ␊ pub fn __constructor(␊ e: &Env,␊ name: String,␊ @@ -599,12 +599,12 @@ Generated by [AVA](https://avajs.dev). // -- \\␊ // --name MyToken \\␊ // --symbol MTK \\␊ - // --recipient \\␊ + // --recipient "" \\␊ // --premint 2000000000000000000000 \\␊ - // --admin \\␊ - // --pauser \\␊ - // --upgrader \\␊ - // --minter ␊ + // --admin \\␊ + // --pauser \\␊ + // --upgrader \\␊ + // --minter ␊ pub fn __constructor(␊ e: &Env,␊ name: String,␊ @@ -723,11 +723,11 @@ Generated by [AVA](https://avajs.dev). // stellar contract deploy \\␊ // --wasm path/to/file.wasm \\␊ // -- \\␊ - // --name Custom $ Token \\␊ + // --name "Custom $ Token" \\␊ // --symbol MTK \\␊ - // --recipient \\␊ + // --recipient "" \\␊ // --premint 2000000000000000000000 \\␊ - // --owner ␊ + // --owner ␊ pub fn __constructor(␊ e: &Env,␊ name: String,␊ diff --git a/packages/core/stellar/src/fungible.test.ts.snap b/packages/core/stellar/src/fungible.test.ts.snap index 1328e9c3a31651cc7c7778e79cfc9706188c6ff6..69b1ec8c50d642948b52d07b64c77d2ae3d819db 100644 GIT binary patch literal 1729 zcmV;y20r;gRzVL=-QnD6OR)5I4l(u|=yyaGKeI3WPRQJ6;=3P+3}i@X2aCW3KcRa;CnSNOI2K(d#WycK4@>;T(m$6k zy>&@lZ@hWw?WI4LS}oXl{K@C54+57^K~}dtLS^6wgd=#ky=%2vu*ISnOC=9_f$YMg zn9wgt9Fs7hup>zrVh%fuvks=P#i-=il>)xLx%Sc8x^?6Ir<6HDdTq-}1OcH59pODg z=+Mo`Z7@$k6o)q4r!Q>SkvyP#{SD2hJ8~lIawZV+h>w#{I*PtbA=xuR1wuv(2p!(T zg4pnB*08Gx`Wu#Y>r_lWE+}Fs0~fYjEr0Z6OPYO5(a}5F`-^z zrA~j?S%)?>v%Zd;MULiA6oOz7%hKdohb&wcoDt+nl&T91tp@u{n4)4!lt$&2|{9->kY$?CbO1 z3y76aQ~V?2}|KE?=0`*TuRr;u=xV>;bwiFQycC@tW1xTkCjDKr_f9Pl?>wV z^EQaurPY=(d&`J(%gD0XidgTDl41P1z_H%3YfH67)y19jDehFJ#V1bkXm0kLg+x>s z{l6un|LZj{dVSYrVip!`zx=_5yXpIueyxFEwm^WrD4?*J-cAn)QgNpP1jE}#v8Liv zJV>7w0S`)>dJHP`a#Zk>Fof0dF~PN;O7QUGwZ(^r`n>6aBh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Y4;AxIA7hIK5!!?1)Q1wHp-mP@dF4_b`Hl@a%msi0k|>#>hF zJ2k0&)%iG%N9^$d>5F7=l?>8TdKCF3*Tj~PBlrl9xA*=~40?#~yZWH!`#!#Eecz1v zJ{u@ozi9p9Iq-`^SD1QA|i#NWzn8h#aw@rSV6F*8KLM5#C9}E9oCCv91tllc)R=2)}6h;`|q;<2&_a{|5aU(F!?K5K)p z4$WG|^erPPEhEom4Uyg-HN*IIjw8JzSC*_r+0xG0ly;0s@v&1pTADp)F%br%|F>rJ zf1LxP*LPhcW^u*#>mOXWpS^GBR|^Ew1p*v&A`0vJc49z~i8~n}7~D3BH4~rVLH0Bc zcu?EaBT%7RqC%L)F)WXc39kKAgNHZQ<{uvHY10KqqKT_kcZ^l5V?;S6<`gJbHq_9r zY#l(ovfWVk>X(nJ^)I&??o_M%S^KF}$HtDeMpVy7oMzu|f8<7BBhgyVpIi@m$ z0*^8er?TB=bD^Qt;X*@$B|?;R6~RsY;pWoOMHdP+2roVzN4#DXgK+(!6kT`AO5CFM zy%o}v&LR%|?~Y9?Y+7N{im9d*nJx{nlR2aCIC+^yoa7i&%z-6@W63yzhQW#l(TY%! za-#8t^qI#6zk+_HHkLXVoLQ<=2hGAWOzm%xZ|Ux||0g+4(R}ZN!Hmjhog^lESpYDc zSUJDd604t`IZCW%sdPTQ␊ - pub fn __constructor(e: &Env, uri: String, name: String, symbol: String, owner: Address) {␊ + // --uri "https://example.com/" \\␊ + // --owner ␊ + pub fn __constructor(e: &Env, name: String, symbol: String, uri: String, owner: Address) {␊ Base::set_metadata(e, uri, name, symbol);␊ ownable::set_owner(e, &owner);␊ }␊ @@ -188,11 +188,11 @@ Generated by [AVA](https://avajs.dev). // stellar contract deploy \\␊ // --wasm path/to/file.wasm \\␊ // -- \\␊ - // --uri www.mytoken.com \\␊ // --name MyToken \\␊ // --symbol MTK \\␊ - // --owner ␊ - pub fn __constructor(e: &Env, uri: String, name: String, symbol: String, owner: Address) {␊ + // --uri "https://example.com/" \\␊ + // --owner ␊ + pub fn __constructor(e: &Env, name: String, symbol: String, uri: String, owner: Address) {␊ Base::set_metadata(e, uri, name, symbol);␊ ownable::set_owner(e, &owner);␊ }␊ @@ -280,11 +280,11 @@ Generated by [AVA](https://avajs.dev). // stellar contract deploy \\␊ // --wasm path/to/file.wasm \\␊ // -- \\␊ - // --uri www.mytoken.com \\␊ // --name MyToken \\␊ // --symbol MTK \\␊ - // --owner ␊ - pub fn __constructor(e: &Env, uri: String, name: String, symbol: String, owner: Address) {␊ + // --uri "https://example.com/" \\␊ + // --owner ␊ + pub fn __constructor(e: &Env, name: String, symbol: String, uri: String, owner: Address) {␊ Base::set_metadata(e, uri, name, symbol);␊ ownable::set_owner(e, &owner);␊ }␊ @@ -335,10 +335,10 @@ Generated by [AVA](https://avajs.dev). // stellar contract deploy \\␊ // --wasm path/to/file.wasm \\␊ // -- \\␊ - // --uri www.mytoken.com \\␊ // --name MyToken \\␊ - // --symbol MTK␊ - pub fn __constructor(e: &Env, uri: String, name: String, symbol: String) {␊ + // --symbol MTK \\␊ + // --uri "https://example.com/"␊ + pub fn __constructor(e: &Env, name: String, symbol: String, uri: String) {␊ Base::set_metadata(e, uri, name, symbol);␊ }␊ }␊ @@ -384,11 +384,11 @@ Generated by [AVA](https://avajs.dev). // stellar contract deploy \\␊ // --wasm path/to/file.wasm \\␊ // -- \\␊ - // --uri www.mytoken.com \\␊ // --name MyToken \\␊ // --symbol MTK \\␊ - // --owner ␊ - pub fn __constructor(e: &Env, uri: String, name: String, symbol: String, owner: Address) {␊ + // --uri "https://example.com/" \\␊ + // --owner ␊ + pub fn __constructor(e: &Env, name: String, symbol: String, uri: String, owner: Address) {␊ Base::set_metadata(e, uri, name, symbol);␊ ownable::set_owner(e, &owner);␊ }␊ @@ -448,11 +448,11 @@ Generated by [AVA](https://avajs.dev). // stellar contract deploy \\␊ // --wasm path/to/file.wasm \\␊ // -- \\␊ - // --uri www.mytoken.com \\␊ // --name MyToken \\␊ // --symbol MTK \\␊ - // --owner ␊ - pub fn __constructor(e: &Env, uri: String, name: String, symbol: String, owner: Address) {␊ + // --uri "https://example.com/" \\␊ + // --owner ␊ + pub fn __constructor(e: &Env, name: String, symbol: String, uri: String, owner: Address) {␊ Base::set_metadata(e, uri, name, symbol);␊ ownable::set_owner(e, &owner);␊ }␊ @@ -516,11 +516,11 @@ Generated by [AVA](https://avajs.dev). // stellar contract deploy \\␊ // --wasm path/to/file.wasm \\␊ // -- \\␊ - // --uri www.mytoken.com \\␊ // --name MyToken \\␊ // --symbol MTK \\␊ - // --owner ␊ - pub fn __constructor(e: &Env, uri: String, name: String, symbol: String, owner: Address) {␊ + // --uri "https://example.com/" \\␊ + // --owner ␊ + pub fn __constructor(e: &Env, name: String, symbol: String, uri: String, owner: Address) {␊ Base::set_metadata(e, uri, name, symbol);␊ ownable::set_owner(e, &owner);␊ }␊ @@ -608,11 +608,11 @@ Generated by [AVA](https://avajs.dev). // stellar contract deploy \\␊ // --wasm path/to/file.wasm \\␊ // -- \\␊ - // --uri www.mytoken.com \\␊ // --name MyToken \\␊ // --symbol MTK \\␊ - // --owner ␊ - pub fn __constructor(e: &Env, uri: String, name: String, symbol: String, owner: Address) {␊ + // --uri "https://example.com/" \\␊ + // --owner ␊ + pub fn __constructor(e: &Env, name: String, symbol: String, uri: String, owner: Address) {␊ Base::set_metadata(e, uri, name, symbol);␊ ownable::set_owner(e, &owner);␊ }␊ @@ -708,10 +708,10 @@ Generated by [AVA](https://avajs.dev). // stellar contract deploy \\␊ // --wasm path/to/file.wasm \\␊ // -- \\␊ - // --uri www.mytoken.com \\␊ // --name MyToken \\␊ - // --symbol MTK␊ - pub fn __constructor(e: &Env, uri: String, name: String, symbol: String) {␊ + // --symbol MTK \\␊ + // --uri "https://example.com/"␊ + pub fn __constructor(e: &Env, name: String, symbol: String, uri: String) {␊ Base::set_metadata(e, uri, name, symbol);␊ }␊ }␊ @@ -749,11 +749,11 @@ Generated by [AVA](https://avajs.dev). // stellar contract deploy \\␊ // --wasm path/to/file.wasm \\␊ // -- \\␊ - // --uri www.mytoken.com \\␊ // --name MyToken \\␊ // --symbol MTK \\␊ - // --owner ␊ - pub fn __constructor(e: &Env, uri: String, name: String, symbol: String, owner: Address) {␊ + // --uri "https://example.com/" \\␊ + // --owner ␊ + pub fn __constructor(e: &Env, name: String, symbol: String, uri: String, owner: Address) {␊ Base::set_metadata(e, uri, name, symbol);␊ ownable::set_owner(e, &owner);␊ }␊ @@ -811,11 +811,11 @@ Generated by [AVA](https://avajs.dev). // stellar contract deploy \\␊ // --wasm path/to/file.wasm \\␊ // -- \\␊ - // --uri www.mytoken.com \\␊ // --name MyToken \\␊ // --symbol MTK \\␊ - // --owner ␊ - pub fn __constructor(e: &Env, uri: String, name: String, symbol: String, owner: Address) {␊ + // --uri "https://example.com/" \\␊ + // --owner ␊ + pub fn __constructor(e: &Env, name: String, symbol: String, uri: String, owner: Address) {␊ Base::set_metadata(e, uri, name, symbol);␊ ownable::set_owner(e, &owner);␊ }␊ @@ -920,11 +920,11 @@ Generated by [AVA](https://avajs.dev). // stellar contract deploy \\␊ // --wasm path/to/file.wasm \\␊ // -- \\␊ - // --uri www.mytoken.com \\␊ - // --name Custom $ Token \\␊ + // --name "Custom $ Token" \\␊ // --symbol MTK \\␊ - // --owner ␊ - pub fn __constructor(e: &Env, uri: String, name: String, symbol: String, owner: Address) {␊ + // --uri "https://example.com/" \\␊ + // --owner ␊ + pub fn __constructor(e: &Env, name: String, symbol: String, uri: String, owner: Address) {␊ Base::set_metadata(e, uri, name, symbol);␊ ownable::set_owner(e, &owner);␊ }␊ diff --git a/packages/core/stellar/src/non-fungible.test.ts.snap b/packages/core/stellar/src/non-fungible.test.ts.snap index 8bf64989f170b5d8ed860486fdfc50ad208474db..b28930460d8ba76b6e39fa093e3c9ba8e4c21865 100644 GIT binary patch literal 1689 zcmV;K24?v|RzV*RHA zI0@Wvryq+500000000B+T-|OQH54wiq3zruETJ z;)Tl>63R()%Og|-en1igceZw{Rtq**6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E719$r ziTpvSv0WmE|C*4w|3)SG9T7Y)|DpxYCznm|JcGg0P<0bqO>AB8*m`8PHOcJi7_~^C z8DX_Cx|>NF^le=G$l~MMX3X~0o5C=hGspw89P4Q~Mraa}xMrW?4-LtFU7&pm zs~8Ekq9KG16@zXK(q#*Z>;6%^vJ7A?{QgBbK&H5hQ3|bFlzCnAb*WwACc=MQ;p|Hr znzJ{T3~iZ|wkY7Cs9Z;n&GLZ_%8kJfLwHV3c-mOFU1tRC!68eis3Sd%4f#On#HKo2 zRpB`i%EYbC2Q!t%j0DZmH7ZhuQF0dSYX4dtHHvh{ZM*g{C*vMIBBW5aV2#X;shOijIVh*0o^Wd3bh|f7g)DL@b z@+gs%4hQB1Z*$DdoZ1-o1@EEr6iM_j#vM|#r}w7jPp>ZGp5E~6N>La>_sW}XDo9Lm zF!sDkk#YJHr5zIckI9N6bG2m{FA?g27e6{}4@b!1g;Oj)I zSM$W^nJaF-kNG-++WswN1WPw4r)z{=vk6Hi#MB*r9 diff --git a/packages/core/stellar/src/non-fungible.ts b/packages/core/stellar/src/non-fungible.ts index b81f21214..29ff90ed0 100644 --- a/packages/core/stellar/src/non-fungible.ts +++ b/packages/core/stellar/src/non-fungible.ts @@ -16,6 +16,7 @@ import { toByteArray } from './utils/convert-strings'; export const defaults: Required = { name: 'MyToken', symbol: 'MTK', + uri: '', burnable: false, enumerable: false, consecutive: false, @@ -34,6 +35,7 @@ export function printNonFungible(opts: NonFungibleOptions = defaults): string { export interface NonFungibleOptions extends CommonContractOptions { name: string; symbol: string; + uri?: string; burnable?: boolean; enumerable?: boolean; consecutive?: boolean; @@ -47,6 +49,7 @@ function withDefaults(opts: NonFungibleOptions): Required { return { ...opts, ...withCommonContractDefaults(opts), + uri: opts.uri ?? defaults.uri, burnable: opts.burnable ?? defaults.burnable, consecutive: opts.consecutive ?? defaults.consecutive, enumerable: opts.enumerable ?? defaults.enumerable, @@ -87,7 +90,7 @@ export function buildNonFungible(opts: NonFungibleOptions): Contract { throw new OptionsError(errors); } - addBase(c, toByteArray(allOpts.name), toByteArray(allOpts.symbol), allOpts.pausable); + addBase(c, toByteArray(allOpts.name), toByteArray(allOpts.symbol), toByteArray(allOpts.uri), allOpts.pausable); if (allOpts.pausable) { addPausable(c, allOpts.access); @@ -119,11 +122,11 @@ export function buildNonFungible(opts: NonFungibleOptions): Contract { return c; } -function addBase(c: ContractBuilder, name: string, symbol: string, pausable: boolean) { +function addBase(c: ContractBuilder, name: string, symbol: string, baseUri: string, pausable: boolean) { // Set metadata - c.addConstructorArgument({ name: 'uri', type: 'String', value: 'www.mytoken.com' }); c.addConstructorArgument({ name: 'name', type: 'String', value: name }); c.addConstructorArgument({ name: 'symbol', type: 'String', value: symbol }); + c.addConstructorArgument({ name: 'uri', type: 'String', value: baseUri }); c.addConstructorCode(`Base::set_metadata(e, uri, name, symbol);`); // Set token functions diff --git a/packages/core/stellar/src/print.ts b/packages/core/stellar/src/print.ts index 074f53c7b..261a2691e 100644 --- a/packages/core/stellar/src/print.ts +++ b/packages/core/stellar/src/print.ts @@ -390,13 +390,18 @@ function printDeployCommand(args: ConstructorArgument[]): string[] { cmd.push('// --wasm path/to/file.wasm \\'); cmd.push('// -- \\'); args.map((arg, i) => { + let formattedArg = ''; if (arg.value) { - let formattedArg = `// --${arg.name} ${arg.value}`; - if (i !== args.length - 1) { - formattedArg += ' \\'; - } - cmd.push(formattedArg); + const needsQuoting = /[\s"'$\\]/.test(arg.value) || arg.name === 'uri'; + const quotedValue = needsQuoting ? `"${arg.value.replace(/"/g, '\\"')}"` : arg.value; + formattedArg += `// --${arg.name} ${quotedValue}`; + } else if (arg.name === 'uri') { + formattedArg += `// --${arg.name} "https://example.com/"`; + } + if (i < args.length - 1) { + formattedArg += ' \\'; } + cmd.push(formattedArg); }); return cmd; diff --git a/packages/core/stellar/src/set-access-control.ts b/packages/core/stellar/src/set-access-control.ts index e0168a416..8caabf0ce 100644 --- a/packages/core/stellar/src/set-access-control.ts +++ b/packages/core/stellar/src/set-access-control.ts @@ -32,7 +32,7 @@ export function setAccessControl(c: ContractBuilder, access: Access): void { }; c.addTraitImplBlock(ownableTrait); - c.addConstructorArgument({ name: 'owner', type: 'Address', value: '' }); + c.addConstructorArgument({ name: 'owner', type: 'Address', value: '' }); c.addConstructorCode('ownable::set_owner(e, &owner);'); } break; @@ -50,7 +50,7 @@ export function setAccessControl(c: ContractBuilder, access: Access): void { }; c.addTraitImplBlock(accessControltrait); - c.addConstructorArgument({ name: 'admin', type: 'Address', value: '' }); + c.addConstructorArgument({ name: 'admin', type: 'Address', value: '' }); c.addConstructorCode('access_control::set_admin(e, &admin);'); break; } @@ -93,7 +93,7 @@ export function requireAccessControl( if (caller && role) { c.addUseClause('soroban_sdk', 'Symbol'); - c.addConstructorArgument({ name: role, type: 'Address', value: `<${role} address>` }); + c.addConstructorArgument({ name: role, type: 'Address', value: `<${role}_address>` }); c.addConstructorCode(`access_control::grant_role_no_auth(e, &admin, &${role}, &Symbol::new(e, "${role}"));`); if (useMacro) { diff --git a/packages/core/stellar/src/stablecoin.test.ts.md b/packages/core/stellar/src/stablecoin.test.ts.md index 7d08d45e5..9cda6c6dd 100644 --- a/packages/core/stellar/src/stablecoin.test.ts.md +++ b/packages/core/stellar/src/stablecoin.test.ts.md @@ -112,7 +112,7 @@ Generated by [AVA](https://avajs.dev). // -- \\␊ // --name MyStablecoin \\␊ // --symbol MST \\␊ - // --owner ␊ + // --owner ␊ pub fn __constructor(e: &Env, name: String, symbol: String, owner: Address) {␊ Base::set_metadata(e, 18, name, symbol);␊ ownable::set_owner(e, &owner);␊ @@ -187,7 +187,7 @@ Generated by [AVA](https://avajs.dev). // -- \\␊ // --name MyStablecoin \\␊ // --symbol MST \\␊ - // --owner ␊ + // --owner ␊ pub fn __constructor(e: &Env, name: String, symbol: String, owner: Address) {␊ Base::set_metadata(e, 18, name, symbol);␊ ownable::set_owner(e, &owner);␊ @@ -277,7 +277,7 @@ Generated by [AVA](https://avajs.dev). // -- \\␊ // --name MyStablecoin \\␊ // --symbol MST \\␊ - // --recipient \\␊ + // --recipient "" \\␊ // --premint 1000000000000000000000␊ pub fn __constructor(e: &Env, name: String, symbol: String, recipient: Address, premint: i128) {␊ Base::set_metadata(e, 18, name, symbol);␊ @@ -392,7 +392,7 @@ Generated by [AVA](https://avajs.dev). // -- \\␊ // --name MyStablecoin \\␊ // --symbol MST \\␊ - // --owner ␊ + // --owner ␊ pub fn __constructor(e: &Env, name: String, symbol: String, owner: Address) {␊ Base::set_metadata(e, 18, name, symbol);␊ ownable::set_owner(e, &owner);␊ @@ -440,7 +440,7 @@ Generated by [AVA](https://avajs.dev). // -- \\␊ // --name MyStablecoin \\␊ // --symbol MST \\␊ - // --admin ␊ + // --admin ␊ pub fn __constructor(e: &Env, name: String, symbol: String, admin: Address) {␊ Base::set_metadata(e, 18, name, symbol);␊ access_control::set_admin(e, &admin);␊ @@ -490,7 +490,7 @@ Generated by [AVA](https://avajs.dev). // -- \\␊ // --name MyStablecoin \\␊ // --symbol MST \\␊ - // --owner ␊ + // --owner ␊ pub fn __constructor(e: &Env, name: String, symbol: String, owner: Address) {␊ Base::set_metadata(e, 18, name, symbol);␊ ownable::set_owner(e, &owner);␊ @@ -561,7 +561,7 @@ Generated by [AVA](https://avajs.dev). // -- \\␊ // --name MyStablecoin \\␊ // --symbol MST \\␊ - // --owner ␊ + // --owner ␊ pub fn __constructor(e: &Env, name: String, symbol: String, owner: Address) {␊ Base::set_metadata(e, 18, name, symbol);␊ ownable::set_owner(e, &owner);␊ @@ -633,9 +633,9 @@ Generated by [AVA](https://avajs.dev). // -- \\␊ // --name MyStablecoin \\␊ // --symbol MST \\␊ - // --recipient \\␊ + // --recipient "" \\␊ // --premint 2000000000000000000000 \\␊ - // --owner ␊ + // --owner ␊ pub fn __constructor(␊ e: &Env,␊ name: String,␊ @@ -760,9 +760,9 @@ Generated by [AVA](https://avajs.dev). // -- \\␊ // --name MyStablecoin \\␊ // --symbol MST \\␊ - // --recipient \\␊ + // --recipient "" \\␊ // --premint 2000000000000000000000 \\␊ - // --owner ␊ + // --owner ␊ pub fn __constructor(␊ e: &Env,␊ name: String,␊ @@ -887,12 +887,12 @@ Generated by [AVA](https://avajs.dev). // -- \\␊ // --name MyStablecoin \\␊ // --symbol MST \\␊ - // --recipient \\␊ + // --recipient "" \\␊ // --premint 2000000000000000000000 \\␊ - // --admin \\␊ - // --pauser \\␊ - // --minter \\␊ - // --manager ␊ + // --admin \\␊ + // --pauser \\␊ + // --minter \\␊ + // --manager ␊ pub fn __constructor(␊ e: &Env,␊ name: String,␊ @@ -1023,12 +1023,12 @@ Generated by [AVA](https://avajs.dev). // -- \\␊ // --name MyStablecoin \\␊ // --symbol MST \\␊ - // --recipient \\␊ + // --recipient "" \\␊ // --premint 2000000000000000000000 \\␊ - // --admin \\␊ - // --pauser \\␊ - // --minter \\␊ - // --manager ␊ + // --admin \\␊ + // --pauser \\␊ + // --minter \\␊ + // --manager ␊ pub fn __constructor(␊ e: &Env,␊ name: String,␊ @@ -1155,11 +1155,11 @@ Generated by [AVA](https://avajs.dev). // stellar contract deploy \\␊ // --wasm path/to/file.wasm \\␊ // -- \\␊ - // --name Custom $ Token \\␊ + // --name "Custom $ Token" \\␊ // --symbol MST \\␊ - // --recipient \\␊ + // --recipient "" \\␊ // --premint 2000000000000000000000 \\␊ - // --owner ␊ + // --owner ␊ pub fn __constructor(␊ e: &Env,␊ name: String,␊ diff --git a/packages/core/stellar/src/stablecoin.test.ts.snap b/packages/core/stellar/src/stablecoin.test.ts.snap index 275dc07d9ed583147f48f3c8a3713cd1fd21b6a0..06a03bc4ea1073a2e4a107639a525cc466786614 100644 GIT binary patch literal 2017 zcmV<72OjuARzVQN?FL6&Uv`A+FMZ1dR9*JD{9>`>Iy+x&Ot* ze=jY)y(B&tmY3eW_}9f!3Chnu{(R#}P{oAdjmI@icu)^;jNs|xU8hun9omR|9#ldM zt$-iEvj~$faTMV&AW-Hw4E-3&G^Q1wzz!um_N$!1*LQAzcze^i`N0c9J;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L01!m=?e1l>UrQ@EE7mX0yM1h7 z=L9L&?VgVR7-kS5Vgcd(c<{!Gfd_w|0zA;)`k0yp8CWnMxbQ&TZ|hr&5i`XITyOdm zw)EH3FhY@=4o39uBH2}uS5To!O9K_gMj!RS2?qgd2R;}5ps~_pM64`7XiRKG42)n6 z4_K+?PT4HqLzbWTTy#Mst?Iat122xn7i)tY16b1SRhWiWFk(ueAR3^ycsCs2N^I3p ziG9MX&Rf!#+pV%XqLTUeTbb{)13_R`~e{7x5qEnoLNo(w);A{I4yZZcnFE`GOY3t&`sp(x zwC`s1T^9LN{Y(P?BP-hhP(C1sE9S2re~@Auma~=4KJJ*8r!_mLu;6WNe&by88?EQP zD4w@XLp{rBsNPBEp^i4d$^J~H$l@u=u~V7XN}-{9~UqS&QFV{7JpF_)m+) zpFQ#`HV&-CKgVA**>lx}I9IjyzP0yHxxIhA-`-aVgoWq(*RC4Y{(o1O$l7=2M_dM9a)IKA!`-$y#1@B7%ElY5Cuu#&nR}A&^m~#u)(iu3 zpiH8EFY?Myh8Owcl_l~bPka91^!~1UyTt`-s#b#>zf6+__xtor0d9hxt<5LYKx6X> w7a^apUykg5qc5WekTn|n*VNjK)36!)`D# \\␊ + // --recipient "" \\␊ // --premint 2000000000000000000000␊ pub fn __constructor(e: &Env, name: String, symbol: String, recipient: Address, premint: i128) {␊ Base::set_metadata(e, 18, name, symbol);␊ 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 cf2893552efe609e6835c326d30800ce53aec307..b7c48ff61f73ec95147a6b6de56ab5faff75cbd0 100644 GIT binary patch delta 1619 zcmV-Z2CVts4B-raK~_N^Q*L2!b7*gLAa*kf0|4O!oX))R^v@{L5eli*rrJ?b`lrod zKYnd6whhHTzvCZ^2mk;800003l~&zu<2DwSGe0eeE(XQy&EB0Tz`$NuQWEUNth_Ed zowkFZ9c7!DycKbMeq6=?NjtE`Y8K<0DH3_CCc_BGlTlVpvdq1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C@CjP?!wwOS#&1Mid>f9&UDRn>qCgv@J06Yi?gq!#j#AFa zHsMz#~%-et%}(4dpPoWe@i^0Ny{^TTQ8`jLRV1@3*_>u zXURdwlEJ4(hchAP+7uZ%I-F6?<<+o2TFi4C;7qSz3QNj0l1o(jP7TC6 z5c}&P?rzzPWOj1)4rvG#_^tiT#Yfg)$9 zGtw!K+Gh!-@Csh{32u56&2!sL??CxPMXm|og>IkBH=^3sj&!kp6U2se8NC+PJH*DY zL~0s^+NG<%F~SVC_t1S$i;oXxy@HG=)RJGK?bz@%Bo$VF3skKhAGuEc9A<=UrQ)7e zv@t8$!ZS}Kr|J0gB=iKb8_#N*uP{1|k3&xvyL}uV$0y;Q?ze>=o}R|X@zd~jp~I=0 zfWq6wy>)V{ptlfx5&IL%WF_5;uaG0vm=RfoZ4|42Ex3IZb=aOo?d4)$pPtw?6)d+C6cm;vvUc(QAR8rc(*`-)8ArE4 zl+3JgnuYVbV`S2Em$OmqtepvMDChRg-*t|V2+k2<<}z+Q^(I&=KwXQL4J&YKv2zfW z_V;rvRhbkr*NF= { const params: z.infer = { name: 'TestToken', symbol: 'TST', + baseUri: 'www.testtoken.com', }; await assertAPIEquivalence(t, params, nonFungible.print); }); @@ -42,6 +43,7 @@ test('all', async t => { const params: DeepRequired> = { name: 'TestToken', symbol: 'TST', + baseUri: 'www.testtoken.com', burnable: true, enumerable: true, consecutive: true, diff --git a/packages/ui/src/stellar/NonFungibleControls.svelte b/packages/ui/src/stellar/NonFungibleControls.svelte index 322e6845e..b7c936a3d 100644 --- a/packages/ui/src/stellar/NonFungibleControls.svelte +++ b/packages/ui/src/stellar/NonFungibleControls.svelte @@ -50,6 +50,14 @@ + +
From 770bdd831a737651989432f69f2eb2f9def451c5 Mon Sep 17 00:00:00 2001 From: Elliot Voris Date: Mon, 10 Nov 2025 09:21:43 -0600 Subject: [PATCH 12/19] more consistent placholder address formats --- packages/core/stellar/src/fungible.test.ts.md | 8 ++++---- .../core/stellar/src/fungible.test.ts.snap | Bin 1729 -> 1723 bytes packages/core/stellar/src/fungible.ts | 2 +- .../core/stellar/src/stablecoin.test.ts.md | 12 ++++++------ .../core/stellar/src/stablecoin.test.ts.snap | Bin 2017 -> 2015 bytes .../stellar/src/zip-rust.compile.test.ts.md | 2 +- .../stellar/src/zip-rust.compile.test.ts.snap | Bin 1633 -> 1630 bytes 7 files changed, 12 insertions(+), 12 deletions(-) diff --git a/packages/core/stellar/src/fungible.test.ts.md b/packages/core/stellar/src/fungible.test.ts.md index b0640c086..02ee04efc 100644 --- a/packages/core/stellar/src/fungible.test.ts.md +++ b/packages/core/stellar/src/fungible.test.ts.md @@ -277,7 +277,7 @@ Generated by [AVA](https://avajs.dev). // -- \\␊ // --name MyToken \\␊ // --symbol MTK \\␊ - // --recipient "" \\␊ + // --recipient \\␊ // --premint 1000000000000000000000␊ pub fn __constructor(e: &Env, name: String, symbol: String, recipient: Address, premint: i128) {␊ Base::set_metadata(e, 18, name, symbol);␊ @@ -489,7 +489,7 @@ Generated by [AVA](https://avajs.dev). // -- \\␊ // --name MyToken \\␊ // --symbol MTK \\␊ - // --recipient "" \\␊ + // --recipient \\␊ // --premint 2000000000000000000000 \\␊ // --owner ␊ pub fn __constructor(␊ @@ -599,7 +599,7 @@ Generated by [AVA](https://avajs.dev). // -- \\␊ // --name MyToken \\␊ // --symbol MTK \\␊ - // --recipient "" \\␊ + // --recipient \\␊ // --premint 2000000000000000000000 \\␊ // --admin \\␊ // --pauser \\␊ @@ -725,7 +725,7 @@ Generated by [AVA](https://avajs.dev). // -- \\␊ // --name "Custom $ Token" \\␊ // --symbol MTK \\␊ - // --recipient "" \\␊ + // --recipient \\␊ // --premint 2000000000000000000000 \\␊ // --owner ␊ pub fn __constructor(␊ diff --git a/packages/core/stellar/src/fungible.test.ts.snap b/packages/core/stellar/src/fungible.test.ts.snap index 69b1ec8c50d642948b52d07b64c77d2ae3d819db..86a3905494dd617879708935d47c40c7d1f1a1ad 100644 GIT binary patch literal 1723 zcmV;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S^6wgd=#ky=%2vu*ISnOC=9_f$YMg zn9wgt9Fs7hup>zrVh%fuvks=P#i-=il>)xLx%Sc8x^?6Ir<6HDdTq-}1OcH59pODg z=+Mo`Z7@$k6o)q4r!Q>SkvyP#{SD2hJ8~lIawZV+h>w#{I*PtbA=xuR1wuv(2p!(T zg4pnB*08Gx`Wu#Y>r_lWE+}Fs0~fYjEr0Z6OPYO5(a}5F`-^z zrA~j?S%)?>v%Zd;MULiA6oOz7%hKdohb&wcoDt+nl&T91tp@u{n4)4!lt$&2|{9->kY$?CbO1 z3y76aQ~V?2}|KE?=0`*TuRr;u=xV>;bwiFQycC@tW1xTkCjDKr_f9Pl?>wV z^EQaurPY=(d&`J(%gD0XidgTDl41P1z_H%3YfH67)y19jDehFJ#V1bkXm0kLg+x>s z{l6un|LZj{dVSYrVip!`zx=_5yXpIueyxFEwm^WrD4?*J-cAn)QgNpP1jE}#v8Liv zJV>7w0S`)>dJHP`a#Zk>Fof0dF~PN;O7QUGwZ(^r`n>6aBhfMHR<|naRwsyaa?~+6 zmp7E~E^i&ey}Z4m@--+S7b{?PG2kgy`qTC^sgF$@ZH=j*k2%rE^sDic|0v*iMSU4qw<`tjxe9tR1p1l50 zMZL!{l_?lFlsPz&-2s~oO|1?ani?(1pQ?NB)DSPAuxgqE0MknpmW|tcaefa|(x(=SjdxhB0OiEG8UF#t}3t ztauo$2o(t@8ehnOc~bB*^lPQDl)>QKlBF_e8qYAZKS#czyR-hcDTFq1We0J$mR(zlH{Anu@l0`@6Pz91X&!ZZ8r~n^8I^0HG zvd?j>F4@mR$$r$9>gamWqwCQ%tt0FcM%be&9Uo;oM~B%t$Pnr??h+?MhpwY&l5^&>|6f>K(7`lNJ;' }); + c.addConstructorArgument({ name: 'recipient', type: 'Address', value: '' }); c.addConstructorArgument({ name: 'premint', type: 'i128', value: String(premintAbsolute) }); c.addConstructorCode(`Base::mint(e, &recipient, premint);`); } diff --git a/packages/core/stellar/src/stablecoin.test.ts.md b/packages/core/stellar/src/stablecoin.test.ts.md index 9cda6c6dd..914b12043 100644 --- a/packages/core/stellar/src/stablecoin.test.ts.md +++ b/packages/core/stellar/src/stablecoin.test.ts.md @@ -277,7 +277,7 @@ Generated by [AVA](https://avajs.dev). // -- \\␊ // --name MyStablecoin \\␊ // --symbol MST \\␊ - // --recipient "" \\␊ + // --recipient \\␊ // --premint 1000000000000000000000␊ pub fn __constructor(e: &Env, name: String, symbol: String, recipient: Address, premint: i128) {␊ Base::set_metadata(e, 18, name, symbol);␊ @@ -633,7 +633,7 @@ Generated by [AVA](https://avajs.dev). // -- \\␊ // --name MyStablecoin \\␊ // --symbol MST \\␊ - // --recipient "" \\␊ + // --recipient \\␊ // --premint 2000000000000000000000 \\␊ // --owner ␊ pub fn __constructor(␊ @@ -760,7 +760,7 @@ Generated by [AVA](https://avajs.dev). // -- \\␊ // --name MyStablecoin \\␊ // --symbol MST \\␊ - // --recipient "" \\␊ + // --recipient \\␊ // --premint 2000000000000000000000 \\␊ // --owner ␊ pub fn __constructor(␊ @@ -887,7 +887,7 @@ Generated by [AVA](https://avajs.dev). // -- \\␊ // --name MyStablecoin \\␊ // --symbol MST \\␊ - // --recipient "" \\␊ + // --recipient \\␊ // --premint 2000000000000000000000 \\␊ // --admin \\␊ // --pauser \\␊ @@ -1023,7 +1023,7 @@ Generated by [AVA](https://avajs.dev). // -- \\␊ // --name MyStablecoin \\␊ // --symbol MST \\␊ - // --recipient "" \\␊ + // --recipient \\␊ // --premint 2000000000000000000000 \\␊ // --admin \\␊ // --pauser \\␊ @@ -1157,7 +1157,7 @@ Generated by [AVA](https://avajs.dev). // -- \\␊ // --name "Custom $ Token" \\␊ // --symbol MST \\␊ - // --recipient "" \\␊ + // --recipient \\␊ // --premint 2000000000000000000000 \\␊ // --owner ␊ pub fn __constructor(␊ diff --git a/packages/core/stellar/src/stablecoin.test.ts.snap b/packages/core/stellar/src/stablecoin.test.ts.snap index 06a03bc4ea1073a2e4a107639a525cc466786614..b1238021e96fc23a68cf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UPg?ODZ3PQt>}b zTC6UeYh7|mC9&fl9db-qKnW8KqYa+!q@3|{bv5#vEMHeI|6%CrZs zCLW>O6U=a}ZSC&Kup-+kMGV{W%k$M9x_?42aY3>}knG8^!9{%ZrW7=iuOL{JS5wCz z@%ZM8uKl=RbU87b9c+R$Qffz!;5-=Iyx5d@oe?`0)a#$g?y?DzYa zn7XjaY05*3VaWM;f1(bg4SXc0k zYw4@5!^VB6P#R{Y-GQvM@46|>4iN1bTs!is`eE2-w|8-0!`(}j!@Wty;jgJi)`ddpYiFfo;5k4cqwH6>A&k%r;sd+uBWQH_xcu>Qw-zI&iV=RT z5fIpxUz5WK$!;54{`!v(c7!A5UpTD&7dG3Ah&oYA>ayZ zRe1|7$lerzW{i-g7r?7X2d4`pk=JC|^qaWL95~Vl$3Ca|3)($?!penJaWOrXCj4&LgkP;q7~du&wG64Sg=ZF@ z+62v@z$VDeJ*rL6j1kiGqu2yVbOJo?9)Dz;&?FO_g2`-(7UA$##w666VF()?WGo09 zuKjG7h##(FV?l>7+{od%Z_k#vJ$`E+ZS1=Q_1Nqzmy zNbb8?i+{c<&p+~6llA$n&u@MHv*+_? zkNt|>1MBn8@OMr2Y;`WqR;|ZxJ^nN9@vroH{IZC!@QnY)JBGi%bYp@1eHY5owK&bX z!qbig#0uHt|MMLR5*OCFlP5a-N4E@WJf@rcJdvxQv5l#Mg-A0oO6HVI0 zl8q*9G?_lI(WH$g&rdXIbBT)(P0mp+ad6-^gZ$#)N!gsEjU{a?IrUib{oYuzN*hs# z52Z`g8%JJ!W5kiaTwS0z@~l@OPVOIf?=%^w4cV(-=$Gj-=aJuvnkv98kkehUb%h#i zY+d0z)D`yXlKoHVix>rD9mn1^wSMCy{Kj6n+ETSKO4ST8ww?b02((j#vU30cS?TCl 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 0a0bb6422..da75f30f7 100644 --- a/packages/core/stellar/src/zip-rust.compile.test.ts.md +++ b/packages/core/stellar/src/zip-rust.compile.test.ts.md @@ -29,7 +29,7 @@ Generated by [AVA](https://avajs.dev). // -- \\␊ // --name MyToken \\␊ // --symbol MTK \\␊ - // --recipient "" \\␊ + // --recipient \\␊ // --premint 2000000000000000000000␊ pub fn __constructor(e: &Env, name: String, symbol: String, recipient: Address, premint: i128) {␊ Base::set_metadata(e, 18, name, symbol);␊ 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 b7c48ff61f73ec95147a6b6de56ab5faff75cbd0..26d8c9fbf42c3ab18df80be566ccfcb19ea4c1a6 100644 GIT binary patch literal 1630 zcmV-k2BG;uRzVI+j^eq)Jjrok1>o)Awi}V&7sPr4P`%1u0RsCz%V|XDh z$8c^G6XngMRnXd*S2R~rr)hyp+HfN0MBw%BQ^(ab9})V9wM$8hqrHR6?zCa(!t zWfu6PH`d$eus7t!mVK9b+1)hQV-qZ;dW{%nQ)AyL7xrW7yqFMcB1vr5z4*zX&`b(# zH~v4np4a=PZ%EhvgMsh=#|KA;vwT?&4QeyW2*IBWDgn8o#&%ROxvPD_q8r1wPSdU) zKsC(A+v@BzFx+%XoYFM)ep^MIZ)3lB&K=v@2DDZ(vJ}7sGmP@NHq_wI*P5dN6qhiy z#`+6kIGT|D*qd^kg{g(d3QML9s$p+?*!r2KOC_thHfs0;t@~kz2uI^LA}+oSN8>K) zG%Zn}4bmNt#&>sv<7-DL=VTl6bUz1aD)6c^^JFg$A0X8lm6_v@hr?DyZ23JL`Mkd+ zp3$V`nXMO8QlYD;h6QqY)wATFW69vtqr;hyb8U)@939Rm=kjV;AT8#(EYQ-Xl0~2F ziTkn&C%vkBo^baMW;M;%w8V_KyJ!lbzo;XxAtYEZ!=#9>q+08m<`!pEgM_!w)a`@1 zS#YLTFoh-M8p$OpeWwQE9f)Vr8_pJC zMhcnRSbM`{R$z^yK#?=l8R?Wq?Xv_^cm=Qf1UEg3=DF>rcc6TtBG-iPLbp%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ATCH 13/19] be more consistent with "baseUri" instead of "uri" --- .../core/stellar/src/generate/non-fungible.ts | 2 +- .../stellar/src/non-fungible.compile.test.ts | 22 +++++++++---------- .../core/stellar/src/non-fungible.test.ts | 2 +- packages/core/stellar/src/non-fungible.ts | 8 +++---- packages/mcp/src/stellar/schemas.ts | 2 +- .../src/stellar/tools/non-fungible.test.ts | 4 ++-- .../mcp/src/stellar/tools/non-fungible.ts | 15 ++++++++++++- 7 files changed, 34 insertions(+), 21 deletions(-) diff --git a/packages/core/stellar/src/generate/non-fungible.ts b/packages/core/stellar/src/generate/non-fungible.ts index f0628d17b..56882fa34 100644 --- a/packages/core/stellar/src/generate/non-fungible.ts +++ b/packages/core/stellar/src/generate/non-fungible.ts @@ -8,7 +8,7 @@ const booleans = [true, false]; const blueprint = { name: ['MyToken'], symbol: ['MTK'], - uri: ['https://example.com/'], + baseUri: ['https://example.com/'], burnable: booleans, pausable: booleans, upgradeable: booleans, diff --git a/packages/core/stellar/src/non-fungible.compile.test.ts b/packages/core/stellar/src/non-fungible.compile.test.ts index 79a858861..47a38606a 100644 --- a/packages/core/stellar/src/non-fungible.compile.test.ts +++ b/packages/core/stellar/src/non-fungible.compile.test.ts @@ -13,7 +13,7 @@ test.serial( kind: 'NonFungible', name: 'MyNFT', symbol: 'MNFT', - uri: 'www.mynft.com', + baseUri: 'www.mynft.com', burnable: false, enumerable: false, consecutive: false, @@ -34,7 +34,7 @@ test.serial( kind: 'NonFungible', name: 'MyNFT', symbol: 'MNFT', - uri: 'www.mynft.com', + baseUri: 'www.mynft.com', burnable: true, enumerable: false, consecutive: true, @@ -55,7 +55,7 @@ test.serial( kind: 'NonFungible', name: 'MyNFT', symbol: 'MNFT', - uri: 'www.mynft.com', + baseUri: 'www.mynft.com', burnable: true, enumerable: false, consecutive: false, @@ -76,7 +76,7 @@ test.serial( kind: 'NonFungible', name: 'MyNFT', symbol: 'MNFT', - uri: 'www.mynft.com', + baseUri: 'www.mynft.com', burnable: false, enumerable: false, consecutive: true, @@ -97,7 +97,7 @@ test.serial( kind: 'NonFungible', name: 'MyNFT', symbol: 'MNFT', - uri: 'www.mynft.com', + baseUri: 'www.mynft.com', burnable: false, enumerable: false, consecutive: false, @@ -118,7 +118,7 @@ test.serial( kind: 'NonFungible', name: 'MyNFT', symbol: 'MNFT', - uri: 'www.mynft.com', + baseUri: 'www.mynft.com', burnable: false, enumerable: false, consecutive: false, @@ -139,7 +139,7 @@ test.serial( kind: 'NonFungible', name: 'MyNFT', symbol: 'MNFT', - uri: 'www.mynft.com', + baseUri: 'www.mynft.com', burnable: false, enumerable: false, consecutive: false, @@ -160,7 +160,7 @@ test.serial( kind: 'NonFungible', name: 'MyNFT', symbol: 'MNFT', - uri: 'www.mynft.com', + baseUri: 'www.mynft.com', burnable: true, enumerable: false, consecutive: false, @@ -181,7 +181,7 @@ test.serial( kind: 'NonFungible', name: 'MyNFT', symbol: 'MNFT', - uri: 'www.mynft.com', + baseUri: 'www.mynft.com', burnable: false, enumerable: true, consecutive: false, @@ -202,7 +202,7 @@ test.serial( kind: 'NonFungible', name: 'MyNFT', symbol: 'MNFT', - uri: 'www.mynft.com', + baseUri: 'www.mynft.com', burnable: true, enumerable: true, consecutive: false, @@ -223,7 +223,7 @@ test.serial( kind: 'NonFungible', name: 'MyNFT', symbol: 'MNFT', - uri: 'www.mynft.com', + baseUri: 'www.mynft.com', burnable: true, enumerable: true, consecutive: false, diff --git a/packages/core/stellar/src/non-fungible.test.ts b/packages/core/stellar/src/non-fungible.test.ts index cd1734bdf..7b82effb1 100644 --- a/packages/core/stellar/src/non-fungible.test.ts +++ b/packages/core/stellar/src/non-fungible.test.ts @@ -155,7 +155,7 @@ testNonFungible('non-fungible - complex name', { testAPIEquivalence('non-fungible API default'); -testAPIEquivalence('non-fungible API basic', { name: 'CustomToken', symbol: 'CTK', uri: 'www.customtoken.com' }); +testAPIEquivalence('non-fungible API basic', { name: 'CustomToken', symbol: 'CTK', baseUri: 'www.customtoken.com' }); testAPIEquivalence('non-fungible API full', { name: 'CustomToken', diff --git a/packages/core/stellar/src/non-fungible.ts b/packages/core/stellar/src/non-fungible.ts index 29ff90ed0..3b35334c4 100644 --- a/packages/core/stellar/src/non-fungible.ts +++ b/packages/core/stellar/src/non-fungible.ts @@ -16,7 +16,7 @@ import { toByteArray } from './utils/convert-strings'; export const defaults: Required = { name: 'MyToken', symbol: 'MTK', - uri: '', + baseUri: '', burnable: false, enumerable: false, consecutive: false, @@ -35,7 +35,7 @@ export function printNonFungible(opts: NonFungibleOptions = defaults): string { export interface NonFungibleOptions extends CommonContractOptions { name: string; symbol: string; - uri?: string; + baseUri?: string; burnable?: boolean; enumerable?: boolean; consecutive?: boolean; @@ -49,7 +49,7 @@ function withDefaults(opts: NonFungibleOptions): Required { return { ...opts, ...withCommonContractDefaults(opts), - uri: opts.uri ?? defaults.uri, + baseUri: opts.baseUri ?? defaults.baseUri, burnable: opts.burnable ?? defaults.burnable, consecutive: opts.consecutive ?? defaults.consecutive, enumerable: opts.enumerable ?? defaults.enumerable, @@ -90,7 +90,7 @@ export function buildNonFungible(opts: NonFungibleOptions): Contract { throw new OptionsError(errors); } - addBase(c, toByteArray(allOpts.name), toByteArray(allOpts.symbol), toByteArray(allOpts.uri), allOpts.pausable); + addBase(c, toByteArray(allOpts.name), toByteArray(allOpts.symbol), toByteArray(allOpts.baseUri), allOpts.pausable); if (allOpts.pausable) { addPausable(c, allOpts.access); diff --git a/packages/mcp/src/stellar/schemas.ts b/packages/mcp/src/stellar/schemas.ts index 74ee585fd..e95d0b0b6 100644 --- a/packages/mcp/src/stellar/schemas.ts +++ b/packages/mcp/src/stellar/schemas.ts @@ -57,7 +57,7 @@ export const stablecoinSchema = { export const nonFungibleSchema = { name: z.string().describe(commonDescriptions.name), symbol: z.string().describe(commonDescriptions.symbol), - baseUri: z.string().describe(stellarNonFungibleDescriptions.uri), + baseUri: z.string().describe(stellarNonFungibleDescriptions.baseUri), burnable: z.boolean().optional().describe(commonDescriptions.burnable), enumerable: z.boolean().optional().describe(stellarNonFungibleDescriptions.enumerable), consecutive: z.boolean().optional().describe(stellarNonFungibleDescriptions.consecutive), diff --git a/packages/mcp/src/stellar/tools/non-fungible.test.ts b/packages/mcp/src/stellar/tools/non-fungible.test.ts index bbee52e5b..d1ad0ea0e 100644 --- a/packages/mcp/src/stellar/tools/non-fungible.test.ts +++ b/packages/mcp/src/stellar/tools/non-fungible.test.ts @@ -34,7 +34,7 @@ test('basic', async t => { const params: z.infer = { name: 'TestToken', symbol: 'TST', - baseUri: 'www.testtoken.com', + baseUri: 'https://example.com/nft/', }; await assertAPIEquivalence(t, params, nonFungible.print); }); @@ -43,7 +43,7 @@ test('all', async t => { const params: DeepRequired> = { name: 'TestToken', symbol: 'TST', - baseUri: 'www.testtoken.com', + baseUri: 'https://example.com/nft/', burnable: true, enumerable: true, consecutive: true, diff --git a/packages/mcp/src/stellar/tools/non-fungible.ts b/packages/mcp/src/stellar/tools/non-fungible.ts index c46efc2a5..fa3f55d79 100644 --- a/packages/mcp/src/stellar/tools/non-fungible.ts +++ b/packages/mcp/src/stellar/tools/non-fungible.ts @@ -10,10 +10,23 @@ export function registerStellarNonFungible(server: McpServer): RegisteredTool { 'stellar-non-fungible', makeDetailedPrompt(stellarPrompts.NonFungible), nonFungibleSchema, - async ({ name, symbol, burnable, enumerable, consecutive, pausable, mintable, sequential, upgradeable, info }) => { + async ({ + name, + symbol, + baseUri, + burnable, + enumerable, + consecutive, + pausable, + mintable, + sequential, + upgradeable, + info, + }) => { const opts: NonFungibleOptions = { name, symbol, + baseUri, burnable, enumerable, consecutive, From d5a36af7738d6ffcab7122c6f0780d316d16aad3 Mon Sep 17 00:00:00 2001 From: Elliot Voris Date: Tue, 11 Nov 2025 10:08:05 -0600 Subject: [PATCH 14/19] remove token uri parameterization --- .../core/stellar/src/generate/non-fungible.ts | 1 - packages/core/stellar/src/non-fungible.test.ts | 2 +- packages/core/stellar/src/non-fungible.ts | 9 +++------ packages/mcp/src/stellar/schemas.ts | 1 - .../mcp/src/stellar/tools/non-fungible.test.ts | 2 -- packages/mcp/src/stellar/tools/non-fungible.ts | 15 +-------------- 6 files changed, 5 insertions(+), 25 deletions(-) diff --git a/packages/core/stellar/src/generate/non-fungible.ts b/packages/core/stellar/src/generate/non-fungible.ts index 56882fa34..4c008ad35 100644 --- a/packages/core/stellar/src/generate/non-fungible.ts +++ b/packages/core/stellar/src/generate/non-fungible.ts @@ -8,7 +8,6 @@ const booleans = [true, false]; const blueprint = { name: ['MyToken'], symbol: ['MTK'], - baseUri: ['https://example.com/'], burnable: booleans, pausable: booleans, upgradeable: booleans, diff --git a/packages/core/stellar/src/non-fungible.test.ts b/packages/core/stellar/src/non-fungible.test.ts index 7b82effb1..5fddbee3b 100644 --- a/packages/core/stellar/src/non-fungible.test.ts +++ b/packages/core/stellar/src/non-fungible.test.ts @@ -155,7 +155,7 @@ testNonFungible('non-fungible - complex name', { testAPIEquivalence('non-fungible API default'); -testAPIEquivalence('non-fungible API basic', { name: 'CustomToken', symbol: 'CTK', baseUri: 'www.customtoken.com' }); +testAPIEquivalence('non-fungible API basic', { name: 'CustomToken', symbol: 'CTK' }); testAPIEquivalence('non-fungible API full', { name: 'CustomToken', diff --git a/packages/core/stellar/src/non-fungible.ts b/packages/core/stellar/src/non-fungible.ts index 3b35334c4..d71242ee0 100644 --- a/packages/core/stellar/src/non-fungible.ts +++ b/packages/core/stellar/src/non-fungible.ts @@ -16,7 +16,6 @@ import { toByteArray } from './utils/convert-strings'; export const defaults: Required = { name: 'MyToken', symbol: 'MTK', - baseUri: '', burnable: false, enumerable: false, consecutive: false, @@ -35,7 +34,6 @@ export function printNonFungible(opts: NonFungibleOptions = defaults): string { export interface NonFungibleOptions extends CommonContractOptions { name: string; symbol: string; - baseUri?: string; burnable?: boolean; enumerable?: boolean; consecutive?: boolean; @@ -49,7 +47,6 @@ function withDefaults(opts: NonFungibleOptions): Required { return { ...opts, ...withCommonContractDefaults(opts), - baseUri: opts.baseUri ?? defaults.baseUri, burnable: opts.burnable ?? defaults.burnable, consecutive: opts.consecutive ?? defaults.consecutive, enumerable: opts.enumerable ?? defaults.enumerable, @@ -90,7 +87,7 @@ export function buildNonFungible(opts: NonFungibleOptions): Contract { throw new OptionsError(errors); } - addBase(c, toByteArray(allOpts.name), toByteArray(allOpts.symbol), toByteArray(allOpts.baseUri), allOpts.pausable); + addBase(c, toByteArray(allOpts.name), toByteArray(allOpts.symbol), allOpts.pausable); if (allOpts.pausable) { addPausable(c, allOpts.access); @@ -122,11 +119,11 @@ export function buildNonFungible(opts: NonFungibleOptions): Contract { return c; } -function addBase(c: ContractBuilder, name: string, symbol: string, baseUri: string, pausable: boolean) { +function addBase(c: ContractBuilder, name: string, symbol: string, pausable: boolean) { // Set metadata c.addConstructorArgument({ name: 'name', type: 'String', value: name }); c.addConstructorArgument({ name: 'symbol', type: 'String', value: symbol }); - c.addConstructorArgument({ name: 'uri', type: 'String', value: baseUri }); + c.addConstructorArgument({ name: 'uri', type: 'String', value: 'https://example.com/' }); c.addConstructorCode(`Base::set_metadata(e, uri, name, symbol);`); // Set token functions diff --git a/packages/mcp/src/stellar/schemas.ts b/packages/mcp/src/stellar/schemas.ts index e95d0b0b6..0d80599e6 100644 --- a/packages/mcp/src/stellar/schemas.ts +++ b/packages/mcp/src/stellar/schemas.ts @@ -57,7 +57,6 @@ export const stablecoinSchema = { export const nonFungibleSchema = { name: z.string().describe(commonDescriptions.name), symbol: z.string().describe(commonDescriptions.symbol), - baseUri: z.string().describe(stellarNonFungibleDescriptions.baseUri), burnable: z.boolean().optional().describe(commonDescriptions.burnable), enumerable: z.boolean().optional().describe(stellarNonFungibleDescriptions.enumerable), consecutive: z.boolean().optional().describe(stellarNonFungibleDescriptions.consecutive), diff --git a/packages/mcp/src/stellar/tools/non-fungible.test.ts b/packages/mcp/src/stellar/tools/non-fungible.test.ts index d1ad0ea0e..22464b5e9 100644 --- a/packages/mcp/src/stellar/tools/non-fungible.test.ts +++ b/packages/mcp/src/stellar/tools/non-fungible.test.ts @@ -34,7 +34,6 @@ test('basic', async t => { const params: z.infer = { name: 'TestToken', symbol: 'TST', - baseUri: 'https://example.com/nft/', }; await assertAPIEquivalence(t, params, nonFungible.print); }); @@ -43,7 +42,6 @@ test('all', async t => { const params: DeepRequired> = { name: 'TestToken', symbol: 'TST', - baseUri: 'https://example.com/nft/', burnable: true, enumerable: true, consecutive: true, diff --git a/packages/mcp/src/stellar/tools/non-fungible.ts b/packages/mcp/src/stellar/tools/non-fungible.ts index fa3f55d79..c46efc2a5 100644 --- a/packages/mcp/src/stellar/tools/non-fungible.ts +++ b/packages/mcp/src/stellar/tools/non-fungible.ts @@ -10,23 +10,10 @@ export function registerStellarNonFungible(server: McpServer): RegisteredTool { 'stellar-non-fungible', makeDetailedPrompt(stellarPrompts.NonFungible), nonFungibleSchema, - async ({ - name, - symbol, - baseUri, - burnable, - enumerable, - consecutive, - pausable, - mintable, - sequential, - upgradeable, - info, - }) => { + async ({ name, symbol, burnable, enumerable, consecutive, pausable, mintable, sequential, upgradeable, info }) => { const opts: NonFungibleOptions = { name, symbol, - baseUri, burnable, enumerable, consecutive, From 5c65037c308b69935bec231df6a905489a6f7f3a Mon Sep 17 00:00:00 2001 From: Elliot Voris Date: Wed, 12 Nov 2025 09:10:05 -0600 Subject: [PATCH 15/19] remove base uri input in Stellar ui --- packages/ui/src/stellar/NonFungibleControls.svelte | 8 -------- 1 file changed, 8 deletions(-) diff --git a/packages/ui/src/stellar/NonFungibleControls.svelte b/packages/ui/src/stellar/NonFungibleControls.svelte index b7c936a3d..322e6845e 100644 --- a/packages/ui/src/stellar/NonFungibleControls.svelte +++ b/packages/ui/src/stellar/NonFungibleControls.svelte @@ -50,14 +50,6 @@ - -
From d3266b3b4d503256a2fc1fec588fdb298a786dcf Mon Sep 17 00:00:00 2001 From: Elliot Voris Date: Wed, 12 Nov 2025 09:42:29 -0600 Subject: [PATCH 16/19] remove baseuri description for mcp server --- packages/common/src/ai/descriptions/stellar.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/common/src/ai/descriptions/stellar.ts b/packages/common/src/ai/descriptions/stellar.ts index 3a5955412..18532c024 100644 --- a/packages/common/src/ai/descriptions/stellar.ts +++ b/packages/common/src/ai/descriptions/stellar.ts @@ -19,7 +19,6 @@ export const stellarFungibleDescriptions = { }; export const stellarNonFungibleDescriptions = { - baseUri: 'A base uri for the token', enumerable: 'Whether the NFTs are enumerable (can be iterated over).', consecutive: 'To batch mint NFTs instead of minting them individually (sequential minting is mandatory).', sequential: 'Whether the IDs of the minted NFTs will be sequential.', From 7818a8cfb3ee7b6503f0827e8f54d6bc2a670147 Mon Sep 17 00:00:00 2001 From: Elliot Voris Date: Wed, 12 Nov 2025 09:46:08 -0600 Subject: [PATCH 17/19] add changeset --- .changeset/big-buttons-cover.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/big-buttons-cover.md diff --git a/.changeset/big-buttons-cover.md b/.changeset/big-buttons-cover.md new file mode 100644 index 000000000..53d336b2b --- /dev/null +++ b/.changeset/big-buttons-cover.md @@ -0,0 +1,5 @@ +--- +'@openzeppelin/wizard-stellar': minor +--- + +Use constructor args for Sellar smart contracts From 7538724e1e99f31309f556f44e73763da31ae6b0 Mon Sep 17 00:00:00 2001 From: Elliot Voris Date: Wed, 12 Nov 2025 15:23:32 -0600 Subject: [PATCH 18/19] remove baseuri field from non-fungible compilation test --- .../core/stellar/src/non-fungible.compile.test.ts | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/packages/core/stellar/src/non-fungible.compile.test.ts b/packages/core/stellar/src/non-fungible.compile.test.ts index 47a38606a..6f8952f9b 100644 --- a/packages/core/stellar/src/non-fungible.compile.test.ts +++ b/packages/core/stellar/src/non-fungible.compile.test.ts @@ -13,7 +13,6 @@ test.serial( kind: 'NonFungible', name: 'MyNFT', symbol: 'MNFT', - baseUri: 'www.mynft.com', burnable: false, enumerable: false, consecutive: false, @@ -34,7 +33,6 @@ test.serial( kind: 'NonFungible', name: 'MyNFT', symbol: 'MNFT', - baseUri: 'www.mynft.com', burnable: true, enumerable: false, consecutive: true, @@ -55,7 +53,6 @@ test.serial( kind: 'NonFungible', name: 'MyNFT', symbol: 'MNFT', - baseUri: 'www.mynft.com', burnable: true, enumerable: false, consecutive: false, @@ -76,7 +73,6 @@ test.serial( kind: 'NonFungible', name: 'MyNFT', symbol: 'MNFT', - baseUri: 'www.mynft.com', burnable: false, enumerable: false, consecutive: true, @@ -97,7 +93,6 @@ test.serial( kind: 'NonFungible', name: 'MyNFT', symbol: 'MNFT', - baseUri: 'www.mynft.com', burnable: false, enumerable: false, consecutive: false, @@ -118,7 +113,6 @@ test.serial( kind: 'NonFungible', name: 'MyNFT', symbol: 'MNFT', - baseUri: 'www.mynft.com', burnable: false, enumerable: false, consecutive: false, @@ -139,7 +133,6 @@ test.serial( kind: 'NonFungible', name: 'MyNFT', symbol: 'MNFT', - baseUri: 'www.mynft.com', burnable: false, enumerable: false, consecutive: false, @@ -160,7 +153,6 @@ test.serial( kind: 'NonFungible', name: 'MyNFT', symbol: 'MNFT', - baseUri: 'www.mynft.com', burnable: true, enumerable: false, consecutive: false, @@ -181,7 +173,6 @@ test.serial( kind: 'NonFungible', name: 'MyNFT', symbol: 'MNFT', - baseUri: 'www.mynft.com', burnable: false, enumerable: true, consecutive: false, @@ -202,7 +193,6 @@ test.serial( kind: 'NonFungible', name: 'MyNFT', symbol: 'MNFT', - baseUri: 'www.mynft.com', burnable: true, enumerable: true, consecutive: false, @@ -223,7 +213,6 @@ test.serial( kind: 'NonFungible', name: 'MyNFT', symbol: 'MNFT', - baseUri: 'www.mynft.com', burnable: true, enumerable: true, consecutive: false, From 4ee89140d8f6f4edc633832aa24176f8922efb8e Mon Sep 17 00:00:00 2001 From: CoveMB Date: Thu, 13 Nov 2025 12:34:51 -0500 Subject: [PATCH 19/19] Align exemple url with other languages --- packages/core/cairo/src/generate/erc1155.ts | 2 +- packages/core/cairo/src/generate/erc721.ts | 2 +- .../core/cairo_alpha/src/generate/erc1155.ts | 2 +- .../core/cairo_alpha/src/generate/erc721.ts | 2 +- .../core/solidity/src/generate/erc1155.ts | 2 +- packages/core/solidity/src/generate/erc721.ts | 2 +- .../core/stellar/src/generate/non-fungible.ts | 2 +- .../core/stellar/src/non-fungible.test.ts | 2 +- .../core/stellar/src/non-fungible.test.ts.md | 30 +++++++++--------- .../stellar/src/non-fungible.test.ts.snap | Bin 1728 -> 1722 bytes packages/core/stellar/src/non-fungible.ts | 2 +- packages/core/stellar/src/print.ts | 2 +- packages/mcp/src/cairo/tools/erc1155.test.ts | 4 +-- packages/mcp/src/cairo/tools/erc721.test.ts | 2 +- .../mcp/src/solidity/tools/erc1155.test.ts | 4 +-- .../mcp/src/solidity/tools/erc721.test.ts | 2 +- .../src/stellar/tools/non-fungible.test.ts | 4 +-- 17 files changed, 33 insertions(+), 33 deletions(-) diff --git a/packages/core/cairo/src/generate/erc1155.ts b/packages/core/cairo/src/generate/erc1155.ts index 1dd04b75a..bc2d3dcd9 100644 --- a/packages/core/cairo/src/generate/erc1155.ts +++ b/packages/core/cairo/src/generate/erc1155.ts @@ -16,7 +16,7 @@ function prepareBlueprint(opts: GeneratorOptions) { const royaltyInfo = resolveRoyaltyOptionsSubset(opts.royaltyInfo); return { name: ['MyToken'], - baseUri: ['https://www.mytoken.com/'], + baseUri: ['https://example.com/'], burnable: booleans, pausable: booleans, mintable: booleans, diff --git a/packages/core/cairo/src/generate/erc721.ts b/packages/core/cairo/src/generate/erc721.ts index daadae561..2911e642d 100644 --- a/packages/core/cairo/src/generate/erc721.ts +++ b/packages/core/cairo/src/generate/erc721.ts @@ -17,7 +17,7 @@ function prepareBlueprint(opts: GeneratorOptions) { return { name: ['MyToken'], symbol: ['MTK'], - baseUri: ['https://www.mytoken.com/'], + baseUri: ['https://example.com/'], burnable: booleans, enumerable: booleans, votes: booleans, diff --git a/packages/core/cairo_alpha/src/generate/erc1155.ts b/packages/core/cairo_alpha/src/generate/erc1155.ts index c888018b2..27ce7c45c 100644 --- a/packages/core/cairo_alpha/src/generate/erc1155.ts +++ b/packages/core/cairo_alpha/src/generate/erc1155.ts @@ -20,7 +20,7 @@ type GeneratorOptions = { function prepareBlueprint(opts: GeneratorOptions) { return { name: ['MyToken'], - baseUri: ['https://www.mytoken.com/'], + baseUri: ['https://example.com/'], burnable: booleans, pausable: booleans, mintable: booleans, diff --git a/packages/core/cairo_alpha/src/generate/erc721.ts b/packages/core/cairo_alpha/src/generate/erc721.ts index 5c95c905a..cc39f604c 100644 --- a/packages/core/cairo_alpha/src/generate/erc721.ts +++ b/packages/core/cairo_alpha/src/generate/erc721.ts @@ -21,7 +21,7 @@ function prepareBlueprint(opts: GeneratorOptions) { return { name: ['MyToken'], symbol: ['MTK'], - baseUri: ['https://www.mytoken.com/'], + baseUri: ['https://example.com/'], burnable: booleans, enumerable: booleans, votes: booleans, diff --git a/packages/core/solidity/src/generate/erc1155.ts b/packages/core/solidity/src/generate/erc1155.ts index a76a9b0b3..fdb9c09fe 100644 --- a/packages/core/solidity/src/generate/erc1155.ts +++ b/packages/core/solidity/src/generate/erc1155.ts @@ -8,7 +8,7 @@ const booleans = [true, false]; const blueprint = { name: ['MyToken'], - uri: ['https://www.mytoken.com/'], + uri: ['https://example.com/'], burnable: booleans, pausable: booleans, mintable: booleans, diff --git a/packages/core/solidity/src/generate/erc721.ts b/packages/core/solidity/src/generate/erc721.ts index 99a0141f0..13749101c 100644 --- a/packages/core/solidity/src/generate/erc721.ts +++ b/packages/core/solidity/src/generate/erc721.ts @@ -10,7 +10,7 @@ const booleans = [true, false]; const blueprint = { name: ['MyToken'], symbol: ['MTK'], - baseUri: ['https://www.mytoken.com/'], + baseUri: ['https://example.com/'], enumerable: booleans, uriStorage: booleans, burnable: booleans, diff --git a/packages/core/stellar/src/generate/non-fungible.ts b/packages/core/stellar/src/generate/non-fungible.ts index b86fb5c86..94648b899 100644 --- a/packages/core/stellar/src/generate/non-fungible.ts +++ b/packages/core/stellar/src/generate/non-fungible.ts @@ -8,7 +8,7 @@ const booleans = [true, false]; const blueprint = { name: ['MyToken'], symbol: ['MTK'], - tokenUri: ['https://www.mytoken.com'], + tokenUri: ['https://example.com'], burnable: booleans, pausable: booleans, upgradeable: booleans, diff --git a/packages/core/stellar/src/non-fungible.test.ts b/packages/core/stellar/src/non-fungible.test.ts index 8a29eff34..3293cac7a 100644 --- a/packages/core/stellar/src/non-fungible.test.ts +++ b/packages/core/stellar/src/non-fungible.test.ts @@ -154,7 +154,7 @@ testNonFungible('non-fungible - complex name', { }); testNonFungible('non-fungible custom token uri', { - tokenUri: 'https://www.mytoken.com/nfts/', + tokenUri: 'https://example.com/nfts/', }); testAPIEquivalence('non-fungible API default'); diff --git a/packages/core/stellar/src/non-fungible.test.ts.md b/packages/core/stellar/src/non-fungible.test.ts.md index a5fe40bfb..bce41b7b9 100644 --- a/packages/core/stellar/src/non-fungible.test.ts.md +++ b/packages/core/stellar/src/non-fungible.test.ts.md @@ -28,7 +28,7 @@ Generated by [AVA](https://avajs.dev). // -- \\␊ // --name MyToken \\␊ // --symbol MTK \\␊ - // --uri "https://www.mytoken.com"␊ + // --uri "https://example.com"␊ pub fn __constructor(e: &Env, name: String, symbol: String, uri: String) {␊ Base::set_metadata(e, uri, name, symbol);␊ }␊ @@ -66,7 +66,7 @@ Generated by [AVA](https://avajs.dev). // -- \\␊ // --name MyToken \\␊ // --symbol MTK \\␊ - // --uri "https://www.mytoken.com"␊ + // --uri "https://example.com"␊ pub fn __constructor(e: &Env, name: String, symbol: String, uri: String) {␊ Base::set_metadata(e, uri, name, symbol);␊ }␊ @@ -114,7 +114,7 @@ Generated by [AVA](https://avajs.dev). // -- \\␊ // --name MyToken \\␊ // --symbol MTK \\␊ - // --uri "https://www.mytoken.com" \\␊ + // --uri "https://example.com" \\␊ // --owner ␊ pub fn __constructor(e: &Env, name: String, symbol: String, uri: String, owner: Address) {␊ Base::set_metadata(e, uri, name, symbol);␊ @@ -190,7 +190,7 @@ Generated by [AVA](https://avajs.dev). // -- \\␊ // --name MyToken \\␊ // --symbol MTK \\␊ - // --uri "https://www.mytoken.com" \\␊ + // --uri "https://example.com" \\␊ // --owner ␊ pub fn __constructor(e: &Env, name: String, symbol: String, uri: String, owner: Address) {␊ Base::set_metadata(e, uri, name, symbol);␊ @@ -282,7 +282,7 @@ Generated by [AVA](https://avajs.dev). // -- \\␊ // --name MyToken \\␊ // --symbol MTK \\␊ - // --uri "https://www.mytoken.com" \\␊ + // --uri "https://example.com" \\␊ // --owner ␊ pub fn __constructor(e: &Env, name: String, symbol: String, uri: String, owner: Address) {␊ Base::set_metadata(e, uri, name, symbol);␊ @@ -337,7 +337,7 @@ Generated by [AVA](https://avajs.dev). // -- \\␊ // --name MyToken \\␊ // --symbol MTK \\␊ - // --uri "https://www.mytoken.com"␊ + // --uri "https://example.com"␊ pub fn __constructor(e: &Env, name: String, symbol: String, uri: String) {␊ Base::set_metadata(e, uri, name, symbol);␊ }␊ @@ -386,7 +386,7 @@ Generated by [AVA](https://avajs.dev). // -- \\␊ // --name MyToken \\␊ // --symbol MTK \\␊ - // --uri "https://www.mytoken.com" \\␊ + // --uri "https://example.com" \\␊ // --owner ␊ pub fn __constructor(e: &Env, name: String, symbol: String, uri: String, owner: Address) {␊ Base::set_metadata(e, uri, name, symbol);␊ @@ -450,7 +450,7 @@ Generated by [AVA](https://avajs.dev). // -- \\␊ // --name MyToken \\␊ // --symbol MTK \\␊ - // --uri "https://www.mytoken.com" \\␊ + // --uri "https://example.com" \\␊ // --owner ␊ pub fn __constructor(e: &Env, name: String, symbol: String, uri: String, owner: Address) {␊ Base::set_metadata(e, uri, name, symbol);␊ @@ -518,7 +518,7 @@ Generated by [AVA](https://avajs.dev). // -- \\␊ // --name MyToken \\␊ // --symbol MTK \\␊ - // --uri "https://www.mytoken.com" \\␊ + // --uri "https://example.com" \\␊ // --owner ␊ pub fn __constructor(e: &Env, name: String, symbol: String, uri: String, owner: Address) {␊ Base::set_metadata(e, uri, name, symbol);␊ @@ -610,7 +610,7 @@ Generated by [AVA](https://avajs.dev). // -- \\␊ // --name MyToken \\␊ // --symbol MTK \\␊ - // --uri "https://www.mytoken.com" \\␊ + // --uri "https://example.com" \\␊ // --owner ␊ pub fn __constructor(e: &Env, name: String, symbol: String, uri: String, owner: Address) {␊ Base::set_metadata(e, uri, name, symbol);␊ @@ -710,7 +710,7 @@ Generated by [AVA](https://avajs.dev). // -- \\␊ // --name MyToken \\␊ // --symbol MTK \\␊ - // --uri "https://www.mytoken.com"␊ + // --uri "https://example.com"␊ pub fn __constructor(e: &Env, name: String, symbol: String, uri: String) {␊ Base::set_metadata(e, uri, name, symbol);␊ }␊ @@ -751,7 +751,7 @@ Generated by [AVA](https://avajs.dev). // -- \\␊ // --name MyToken \\␊ // --symbol MTK \\␊ - // --uri "https://www.mytoken.com" \\␊ + // --uri "https://example.com" \\␊ // --owner ␊ pub fn __constructor(e: &Env, name: String, symbol: String, uri: String, owner: Address) {␊ Base::set_metadata(e, uri, name, symbol);␊ @@ -813,7 +813,7 @@ Generated by [AVA](https://avajs.dev). // -- \\␊ // --name MyToken \\␊ // --symbol MTK \\␊ - // --uri "https://www.mytoken.com" \\␊ + // --uri "https://example.com" \\␊ // --owner ␊ pub fn __constructor(e: &Env, name: String, symbol: String, uri: String, owner: Address) {␊ Base::set_metadata(e, uri, name, symbol);␊ @@ -922,7 +922,7 @@ Generated by [AVA](https://avajs.dev). // -- \\␊ // --name "Custom $ Token" \\␊ // --symbol MTK \\␊ - // --uri "https://www.mytoken.com" \\␊ + // --uri "https://example.com" \\␊ // --owner ␊ pub fn __constructor(e: &Env, name: String, symbol: String, uri: String, owner: Address) {␊ Base::set_metadata(e, uri, name, symbol);␊ @@ -1013,7 +1013,7 @@ Generated by [AVA](https://avajs.dev). // -- \\␊ // --name MyToken \\␊ // --symbol MTK \\␊ - // --uri "https://www.mytoken.com/nfts/"␊ + // --uri "https://example.com/nfts/"␊ pub fn __constructor(e: &Env, name: String, symbol: String, uri: String) {␊ Base::set_metadata(e, uri, name, symbol);␊ }␊ diff --git a/packages/core/stellar/src/non-fungible.test.ts.snap b/packages/core/stellar/src/non-fungible.test.ts.snap index 289da25f0d09d616f0cff4d257cffb422465aa6a..e153f1dc51033d131d2d08a79592f9fc18ea5640 100644 GIT binary patch literal 1722 zcmV;r21WTnRzV8oa_PRsgNaQqZz7yFhCp)GDn7t6 z(Z+f-sUM3700000000B+Tu*NtH54zjq3zt@fGQ!-Yg$5rX0!agI1q`ZL5gT-rKA$j zE+g-Zr#s4wJso?RMA07j0`wD5soW8K0XT5x0^fj-!3}x-?AV*xO?JDx-8SAsGUK(M zJ@5Jb-p_uXed@PE=I-&wKNAs%kR)x)0~aWx4L_w1f_6v(PI1gTOzN-NF0+eps*uI7~%wWSi;(v!Um%v!LH!&{RgX`tbS-+yLyi@hYPP|St%#L^NJ4l z_7FO9i|RI%S3wkqHf+*IHtdKbpbxrhdAqzLC&F&RI6@xraT*Fo*4JwYwnr#Oh%)Mw znn3922Ij{_4T^qNyP|>bzUJSo#RLHwuR%kT#F^?d|qSF+t=?5WM z%}SIS>NUj?>5Wn;=Z8_7g|NN*m0Fr60W5Zeh&gID$pMbykgU2aTFk0QwfGbq$7M8E z4@;H_f~Cw*vL{rS%Z6Njb)P0dd9zYzOMaw15aL8Q5fNC<&SjES&gGSIR@Sl>U8^hY zpjy3EZa6la3?vO)oeZ1Kc^rDX(|ui;ju6`~{PT#D&%PeUhkSLna$RF?+{H zA^GXeU)d-VEL$vPS2G4H`SrDXeG|8p75fxKf+_cjqA@>VQBMmt2&Uca5$XgUg7o8$ zR1NKr&__re078{$8P(dU4^d z1fe1%)EKnHpBh8@6!OO}A9Mv8>(FK_RK{F^TUmESS7ilRElp~rJr{@JfZ5(BeVOzd zsz!QB$C2M_HL^<-L0~}OJb0&;2oDLNmwwSg=#xt(gwA0IHMHGCSQBAQgsoe7jkD4^ zK`jz)hFEQc$IT`6o^4e7$mXNlX2kIgHih9ibINn{4T313qMqGc_(@|oKVCS4?B+yf zV%GA8X^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yxE|F#1sc(ueB5z$3K_aC9(gIEGse_ZG#18euZ>m=R{Mf6<$)!nw*$CNc@;M zI1#;4vn(Pp7A!`vRH3qg0toe3>=GxpTq;6UR4!#j>txzHT-P*oP5r_x5s^hgE(s1I zt@W3Nw7**hX(!s-nkQP%e4A|C6ThSO$V^}`f#K*ULu!`#W4_*?j(=U5%hDmr1)X!E zuQ+JOphxd=n2j>CQT8-$luhf1|7^&gbA0w!zae-EHu0QU@8TV;gPEm#U(pD0GiAd8 z*-4{T#o4pJH6Hw@IeT`xa=g?2fsVC=3l@%~n@W{aPB|B|p#ofkbhwL#e9mrH;^4F} zKil!t5W9oMHRNtSKizRq^M(jbK!h|kmSpHP{rp=NE>gouG_6Q&zNOKjS50cuq&5#H W4lU{l-a2y$&i?_A`aqq6UH||PuR@yu diff --git a/packages/core/stellar/src/non-fungible.ts b/packages/core/stellar/src/non-fungible.ts index 8e52e4a82..6dafe7bfb 100644 --- a/packages/core/stellar/src/non-fungible.ts +++ b/packages/core/stellar/src/non-fungible.ts @@ -16,7 +16,7 @@ import { toByteArray } from './utils/convert-strings'; export const defaults: Required = { name: 'MyToken', symbol: 'MTK', - tokenUri: 'https://www.mytoken.com', + tokenUri: 'https://example.com', burnable: false, enumerable: false, consecutive: false, diff --git a/packages/core/stellar/src/print.ts b/packages/core/stellar/src/print.ts index 3d11af6c8..1dbaf4f8b 100644 --- a/packages/core/stellar/src/print.ts +++ b/packages/core/stellar/src/print.ts @@ -384,7 +384,7 @@ const needsQuoting = (name: string, value?: string): boolean => name === 'uri' || (value !== undefined && /[\s"'$\\]/.test(value)); const formatDeployValue = (name: string, value?: string): string => { - if (value === undefined && name === 'uri') return `"https://www.mytoken.com/"`; + if (value === undefined && name === 'uri') return `"https://example.com/"`; if (value === undefined) return ''; return needsQuoting(name, value) ? `"${escapeQuotes(value)}"` : value; }; diff --git a/packages/mcp/src/cairo/tools/erc1155.test.ts b/packages/mcp/src/cairo/tools/erc1155.test.ts index a28bcf546..6daee1382 100644 --- a/packages/mcp/src/cairo/tools/erc1155.test.ts +++ b/packages/mcp/src/cairo/tools/erc1155.test.ts @@ -33,7 +33,7 @@ function assertHasAllSupportedFields( test('basic', async t => { const params: z.infer = { name: 'MyNFT', - baseUri: 'https://www.mytoken.com/nft/', + baseUri: 'https://example.com/nft/', }; await assertAPIEquivalence(t, params, erc1155.print); }); @@ -41,7 +41,7 @@ test('basic', async t => { test('all', async t => { const params: DeepRequired> = { name: 'MyNFT', - baseUri: 'https://www.mytoken.com/nft/', + baseUri: 'https://example.com/nft/', burnable: true, pausable: true, mintable: true, diff --git a/packages/mcp/src/cairo/tools/erc721.test.ts b/packages/mcp/src/cairo/tools/erc721.test.ts index dcca16b8d..c42128b71 100644 --- a/packages/mcp/src/cairo/tools/erc721.test.ts +++ b/packages/mcp/src/cairo/tools/erc721.test.ts @@ -42,7 +42,7 @@ test('all', async t => { const params: DeepRequired> = { name: 'MyNFT', symbol: 'NFT', - baseUri: 'https://www.mytoken.com/nft/', + baseUri: 'https://example.com/nft/', burnable: true, pausable: true, mintable: true, diff --git a/packages/mcp/src/solidity/tools/erc1155.test.ts b/packages/mcp/src/solidity/tools/erc1155.test.ts index dcaf7a45f..a729fdeac 100644 --- a/packages/mcp/src/solidity/tools/erc1155.test.ts +++ b/packages/mcp/src/solidity/tools/erc1155.test.ts @@ -33,7 +33,7 @@ function assertHasAllSupportedFields( test('basic', async t => { const params: z.infer = { name: 'MyTokens', - uri: 'https://www.mytoken.com/token/{id}.json', + uri: 'https://example.com/token/{id}.json', }; await assertAPIEquivalence(t, params, erc1155.print); }); @@ -41,7 +41,7 @@ test('basic', async t => { test('all', async t => { const params: DeepRequired> = { name: 'MyTokens', - uri: 'https://www.mytoken.com/token/{id}.json', + uri: 'https://example.com/token/{id}.json', burnable: true, pausable: true, mintable: true, diff --git a/packages/mcp/src/solidity/tools/erc721.test.ts b/packages/mcp/src/solidity/tools/erc721.test.ts index cfc53849c..32f1d1eac 100644 --- a/packages/mcp/src/solidity/tools/erc721.test.ts +++ b/packages/mcp/src/solidity/tools/erc721.test.ts @@ -42,7 +42,7 @@ test('all', async t => { const params: DeepRequired> = { name: 'MyNFT', symbol: 'NFT', - baseUri: 'https://www.mytoken.com/nft/', + baseUri: 'https://example.com/nft/', enumerable: true, uriStorage: true, burnable: true, diff --git a/packages/mcp/src/stellar/tools/non-fungible.test.ts b/packages/mcp/src/stellar/tools/non-fungible.test.ts index cf48ef773..59643e92d 100644 --- a/packages/mcp/src/stellar/tools/non-fungible.test.ts +++ b/packages/mcp/src/stellar/tools/non-fungible.test.ts @@ -34,7 +34,7 @@ test('basic', async t => { const params: z.infer = { name: 'TestToken', symbol: 'TST', - tokenUri: 'https://www.mytoken.com/nft/', + tokenUri: 'https://example.com/nft/', }; await assertAPIEquivalence(t, params, nonFungible.print); }); @@ -43,7 +43,7 @@ test('all', async t => { const params: DeepRequired> = { name: 'TestToken', symbol: 'TST', - tokenUri: 'https://www.mytoken.com/nft/', + tokenUri: 'https://example.com/nft/', burnable: true, enumerable: true, consecutive: true,