Commit 82b0348
fix: use correct SIP-018 message format in acceptIncomingTransfer
Two bugs caused the agent to produce signatures incompatible with
on-chain verification:
1. Message was nested (pipe-key as sub-object) with plain string values.
The Clarity contract uses a flat merged tuple with typed uint/principal
fields — matching what sip018_sign expects.
2. balance-1/balance-2 always used myBalance/theirBalance regardless of
whether the local agent is principal-1 or principal-2. The contract's
map-balances logic assigns balance-1 to principal-1's balance canonically,
so we must resolve ordering from pipeKey before building the message.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent c5dd384 commit 82b0348
1 file changed
Lines changed: 32 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
306 | 306 | | |
307 | 307 | | |
308 | 308 | | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
309 | 340 | | |
310 | 341 | | |
311 | | - | |
312 | | - | |
313 | | - | |
314 | | - | |
315 | | - | |
316 | | - | |
317 | | - | |
318 | | - | |
319 | | - | |
320 | | - | |
| 342 | + | |
321 | 343 | | |
322 | 344 | | |
323 | 345 | | |
| |||
0 commit comments