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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions evals/scenarios/assets/06-sep41-interface-types.json
Original file line number Diff line number Diff line change
@@ -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<MuxedAddress>`, so `&to` works",
"Does not suggest `&to.into()` for the client call, since it fails type inference (E0283)"
]
}
11 changes: 8 additions & 3 deletions skills/assets/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -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<MuxedAddress>` there, so pass an `&Address`
as `&to` (as above), never `&to.into()`, which fails to compile (E0283).

## When to Use What

Expand Down
Loading