diff --git a/evals/scenarios/assets/06-sep41-interface-types.json b/evals/scenarios/assets/06-sep41-interface-types.json new file mode 100644 index 0000000..319cf2b --- /dev/null +++ b/evals/scenarios/assets/06-sep41-interface-types.json @@ -0,0 +1,13 @@ +{ + "skills": [ + "assets" + ], + "query": "I'm writing a Soroban contract that implements the SEP-41 token interface. What are the exact signatures for transfer, transfer_from and symbol?", + "expected_behavior": [ + "Gives `transfer(from: Address, to: MuxedAddress, amount: i128)`, with a `MuxedAddress` destination", + "Gives `transfer_from(spender: Address, from: Address, to: Address, amount: i128)`, keeping a plain `Address` destination", + "Gives `symbol() -> String`, not `Symbol`", + "Does not claim existing callers must convert an `Address` by hand: the generated client accepts `impl Into`, so `&to` works", + "Does not suggest `&to.into()` for the client call, since it fails type inference (E0283)" + ] +} diff --git a/skills/assets/SKILL.md b/skills/assets/SKILL.md index 1658beb..e649323 100644 --- a/skills/assets/SKILL.md +++ b/skills/assets/SKILL.md @@ -377,12 +377,17 @@ pub fn transfer_asset( SAC implements the standard SEP-41 token interface: - `balance(id: Address) -> i128` -- `transfer(from: Address, to: Address, amount: i128)` -- `approve(from: Address, spender: Address, amount: i128, expiration_ledger: u32)` +- `transfer(from: Address, to: MuxedAddress, amount: i128)` +- `transfer_from(spender: Address, from: Address, to: Address, amount: i128)` +- `approve(from: Address, spender: Address, amount: i128, live_until_ledger: u32)` - `allowance(from: Address, spender: Address) -> i128` - `decimals() -> u32` - `name() -> String` -- `symbol() -> Symbol` +- `symbol() -> String` + +Only `transfer` takes a `MuxedAddress` destination. The generated +`TokenClient` accepts `impl Into` there, so pass an `&Address` +as `&to` (as above), never `&to.into()`, which fails to compile (E0283). ## When to Use What