Skip to content

Remove unused contracts#17

Merged
reednaa merged 2 commits intots-libraryfrom
remove-unused-contracts
Apr 9, 2026
Merged

Remove unused contracts#17
reednaa merged 2 commits intots-libraryfrom
remove-unused-contracts

Conversation

@reednaa
Copy link
Copy Markdown
Member

@reednaa reednaa commented Apr 7, 2026

Remove unused contracts. The previous commit had unused contracts inside solidity/src/helpers. These have already been moved out so this commit PR deletes them. It also updates test so they correctly run on the new contracts.

Summary by CodeRabbit

  • Chores

    • Updated version control configuration to exclude local settings files.
  • Refactor

    • Reorganized smart contract structure and consolidated functionality.
    • Relocated core components to streamline code organization.
  • Tests

    • Updated test suite to align with refactored contract structure.
    • Added test coverage for empty calldata scenarios.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 7, 2026

📝 Walkthrough

Walkthrough

This PR removes the CATValidator, CallProxy, and LibExecutionConstraint contracts from the helpers directory and updates corresponding test imports and type references. Tests are modified to use relocated imports and renamed types (AllowanceSpend/Outcome replacing InputTarget/Output).

Changes

Cohort / File(s) Summary
Configuration
.gitignore
Added settings.local.json to the ignore list; whitespace/newline adjustments to file ending.
Removed Contracts
solidity/src/helpers/CATValidator.sol, solidity/src/helpers/CallProxy.sol, solidity/src/helpers/libs/LibExecutionConstraint.sol
Deleted three helper contracts/libraries: CATValidator (177 lines with validation/execution logic and custom errors), CallProxy (32 lines with fallback forwarding), and LibExecutionConstraint (87 lines with hashing helpers and type definitions).
Test Updates – CallProxy
solidity/test/CallProxy.t.sol, solidity/test/helpers/CallProxy.t.sol
Added test_emptyEtherTransfer_fails() covering empty-calldata value-transfer failure; updated import path from src/helpers/CallProxy.sol to src/CallProxy.sol.
Test Updates – CATValidator & LibExecutionConstraint
solidity/test/helpers/CATValidator.t.sol, solidity/test/helpers/libs/LibExecutionConstraint.t.sol
Updated imports and type references: InputTarget[]/Output[]AllowanceSpend[]/Outcome[]; renamed test mock methods (handleInputshandleAllowances, recordOutputsrecordBalances, compareOutputscompareOutcomes); updated type hash constants and test assertions to match new schema; import paths adjusted to relocated libraries.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • feat(intent factory): add executor contract #14: Directly overlaps at the code level, modifying the same helper contracts and libraries (CATValidator, CallProxy, LibExecutionConstraint) and their related execution/intent executor components.

Poem

🐰 Off with the helpers, away they go,
Types renamed as the contracts flow,
AllowanceSpend and Outcome now reign,
Tests rewired without a strain,
Cleaner paths and schemas bright—
The warren's refactor shines just right! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Remove unused contracts' accurately summarizes the main change—deletion of unused helper contracts (CATValidator, CallProxy, LibExecutionConstraint) and updates to test imports.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch remove-unused-contracts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@reednaa
Copy link
Copy Markdown
Member Author

reednaa commented Apr 7, 2026

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 7, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@solidity/test/helpers/CATValidator.t.sol`:
- Around line 185-188: The vm.expectCall invocation formatting doesn't match
forge fmt; reformat the call to match the project's style (wrap arguments and/or
line breaks as forge fmt expects) for the vm.expectCall(...) usage with
MockERC20.transferFrom and its arguments (allowances[i].token,
abi.encodeCall(MockERC20.transferFrom, (account, destination, amounts[i] / 2))).
Run or apply `forge fmt` to the block so the vm.expectCall, abi.encodeCall,
MockERC20.transferFrom, account, destination, allowances[i], and amounts[i]
expressions are laid out according to the formatter.

In `@solidity/test/helpers/libs/LibExecutionConstraint.t.sol`:
- Around line 6-10: Import block formatting in LibExecutionConstraint.t.sol is
failing forge fmt; run the formatter and fix the import layout for the symbols
AllowanceSpend, LibExecutionConstraint, Outcome so the file passes linting.
Update the import statement for these symbols from
"../../../src/libs/LibExecutionConstraint.sol" to the formatter-approved layout
(apply `forge fmt` or reorder/compact the imports as the project style requires)
and re-run `forge fmt --check` to confirm CI will pass.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 1582a3a0-a2ed-496e-ac5d-e4e17c13f2b3

📥 Commits

Reviewing files that changed from the base of the PR and between 211d261 and 8207107.

📒 Files selected for processing (8)
  • .gitignore
  • solidity/src/helpers/CATValidator.sol
  • solidity/src/helpers/CallProxy.sol
  • solidity/src/helpers/libs/LibExecutionConstraint.sol
  • solidity/test/CallProxy.t.sol
  • solidity/test/helpers/CATValidator.t.sol
  • solidity/test/helpers/CallProxy.t.sol
  • solidity/test/helpers/libs/LibExecutionConstraint.t.sol
💤 Files with no reviewable changes (3)
  • solidity/src/helpers/CallProxy.sol
  • solidity/src/helpers/libs/LibExecutionConstraint.sol
  • solidity/src/helpers/CATValidator.sol

@reednaa reednaa merged commit 4cfdaf4 into ts-library Apr 9, 2026
2 of 3 checks passed
@reednaa reednaa deleted the remove-unused-contracts branch April 9, 2026 08:50
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.

1 participant