Skip to content

fix(session): separate sender from fee payer in settle and close#247

Merged
brendanjryan merged 2 commits intomainfrom
fix/settle-sender-separation
Mar 27, 2026
Merged

fix(session): separate sender from fee payer in settle and close#247
brendanjryan merged 2 commits intomainfrom
fix/settle-sender-separation

Conversation

@brendanjryan
Copy link
Copy Markdown
Collaborator

@brendanjryan brendanjryan commented Mar 26, 2026

The escrow contract requires msg.sender == payee for settle() and close(). The sendFeePayerTx helper used the fee payer as both sender and gas sponsor, causing every fee-sponsored settlement/close to revert with NotPayee().

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Mar 26, 2026

Open in StackBlitz

npm i https://pkg.pr.new/mppx@247

commit: f79b884

Copy link
Copy Markdown
Member

@tmm tmm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do any examples/ need updating?

@brendanjryan brendanjryan force-pushed the fix/settle-sender-separation branch from da2264b to aca8819 Compare March 27, 2026 02:32
@brendanjryan
Copy link
Copy Markdown
Collaborator Author

@tmm examples are good here!

Comment on lines +733 to +734
// TODO: add on-chain test with distinct feePayer != account once localnet
// supports fee-sponsored settle (currently msg.sender resolves to feePayer).
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test.todo() instead of comment?

Comment on lines +829 to +830
// TODO: add on-chain test with distinct feePayer != account once localnet
// supports fee-sponsored close (currently msg.sender resolves to feePayer).
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test.todo()

Comment on lines +103 to +104
feePayer?: Account | undefined,
account?: Account | undefined,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generic type parameter to require account if feePayer is defined?

Comment on lines +190 to +194
"pnpm": {
"overrides": {
"path-to-regexp": ">=8.4.0",
"tar": ">=7.5.11"
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be in pnpm-workspace file

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

moved here!

#258

Comment on lines +5 to +10
Fixed `settleOnChain` and `closeOnChain` to use the payee account as
`msg.sender` instead of the fee payer when submitting fee-sponsored
transactions. Previously, `sendFeePayerTx` used the fee payer as both
sender and gas sponsor, causing the escrow contract to revert with
`NotPayee()`. Added `account` option to `tempo.settle()` so callers can
specify the signing account separately from the fee payer.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

line wrapping for some reason

The escrow contract requires msg.sender == payee for settle() and
close(). The sendFeePayerTx helper used the fee payer as both sender
and gas sponsor, causing every fee-sponsored settlement/close to
revert with NotPayee().

Fix sendFeePayerTx to accept a separate account (logical sender)
and feePayer (gas sponsor). Update settleOnChain and closeOnChain
to resolve and pass the correct account. Add account option to
the top-level tempo.settle() API.

Also fix feeToken resolution to use resolveCurrency() which falls
back to pathUsd for unknown chain IDs (e.g. localnet).
@brendanjryan brendanjryan force-pushed the fix/settle-sender-separation branch from 32bd2eb to f79b884 Compare March 27, 2026 23:34
@brendanjryan brendanjryan merged commit 5684b94 into main Mar 27, 2026
5 of 6 checks passed
@brendanjryan brendanjryan deleted the fix/settle-sender-separation branch March 27, 2026 23:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants