Skip to content

WIP: Payments contract should compile without via-ir being set to true in foundry.toml #149

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

pali101
Copy link
Contributor

@pali101 pali101 commented Jun 24, 2025

Refactored the Payments contract to reduce call stack depth and remove the requirement for via-ir in foundry.toml.

Breaking Changes

To address stack depth limits, I had to change function signatures of few external/public function (e.g., settleRail, settleTerminatedRailWithoutArbitration etc). Key changes:

  • Grouped related function parameters into structs (e.g., PermitParams).
  • Replaced multi-variable returns with result structs.
  • Moved some logic to internal helpers.

Remaining work

Update tests to use the new function signatures and verify full functionality.

pali101 added 2 commits June 23, 2025 22:01
- refactor internal settlement logic to use SettlementResult and SettlementState structs for cleaner return handling and avoiding stack-too-deep error.
- replace depositWithPermit() multi-argument signature with a PermitParams struct.
- move arbitration logic out of _settleSegment() into dedicated _runArbitration() helper.
- split modifyRailPayment logic into internal _modifyRailPayment.
- minor grouping, naming, and internal structure improvements.
@pali101 pali101 marked this pull request as draft June 24, 2025 07:05
@pali101 pali101 changed the title Payments contract should compile without via-ir being set to true in foundry.toml WIP: Payments contract should compile without via-ir being set to true in foundry.toml Jun 24, 2025
@aarshkshah1992
Copy link
Collaborator

@pali101 Let's get back to this after the M2 milestone. Thanks for your hard work so far.

@BigLep BigLep added this to FS Jul 17, 2025
@github-project-automation github-project-automation bot moved this to 📌 Triage in FS Jul 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 📌 Triage
Status: No status
Development

Successfully merging this pull request may close these issues.

3 participants