Skip to content

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

Open
brendanjryan wants to merge 1 commit intomainfrom
fix/settle-sender-separation
Open

fix(session): separate sender from fee payer in settle and close#247
brendanjryan wants to merge 1 commit intomainfrom
fix/settle-sender-separation

Conversation

@brendanjryan
Copy link
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

pkg-pr-new bot commented Mar 26, 2026

Open in StackBlitz

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

commit: aca8819

Copy link
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?

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 da2264b to aca8819 Compare March 27, 2026 02:32
@brendanjryan
Copy link
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
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
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
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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants