Commit 7d11d85
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 946d979 commit 7d11d85
1 file changed
+32
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
407 | 407 | | |
408 | 408 | | |
409 | 409 | | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
410 | 441 | | |
411 | 442 | | |
412 | | - | |
413 | | - | |
414 | | - | |
415 | | - | |
416 | | - | |
417 | | - | |
418 | | - | |
419 | | - | |
420 | | - | |
421 | | - | |
| 443 | + | |
422 | 444 | | |
423 | 445 | | |
424 | 446 | | |
| |||
0 commit comments