Skip to content

Conversation

@defitricks
Copy link
Contributor

Description

There was a missing / after $input_dir in the sed command, which could result in incorrect path substitution. If the path started with $input_dir but contained subdirectories, the replacement might not work as expected.

Now, the command explicitly matches the beginning of the string using ^ and ensures $input_dir/ is properly removed.

How Has This Been Tested?

Tested by running the modified command with various input paths, including cases with and without subdirectories. The results now correctly remove $input_dir/ only when it appears at the beginning of the path.

Checklist:

Before deployment

  • 100% test and branch coverage
  • check slither for severe issues
  • fuzz and invariant tests (when applicable)
  • formal verification (when applicable)
  • deployment or upgrade scripts ready

After deployment

  • transfer ownership after deployments (when applicable)
  • complete upgrade (when applicable)
  • generate deployment/upgrade log files

Considerations

  • I have followed the contributing guidelines.
  • My code follows the style guidelines of this project and I have run forge fmt and prettier to ensure the code style is valid
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Additional context

Verification

For example, given:

input_dir="src/pkgs/example"
sol_file="src/pkgs/example/contracts/MyContract.sol"

The original sed command would produce:

contracts/MyContract.sol

However, without / after input_dir, it could produce incorrect results if the path structure is more complex.

@gretzke gretzke closed this Jul 9, 2025
@gretzke gretzke reopened this Jul 9, 2025
@gretzke gretzke changed the base branch from main to fix-verification July 9, 2025 22:43
@gretzke gretzke merged commit b1b405d into Uniswap:fix-verification Jul 9, 2025
4 checks passed
gretzke added a commit that referenced this pull request Jul 9, 2025
* fix: fix incorrect path substitution in sed command (#73)

* fix: unsafe `read` usage with `find` output (#86)

---------

Co-authored-by: Donny <[email protected]>
Co-authored-by: Dmitry <[email protected]>
@defitricks defitricks deleted the patch-1 branch August 2, 2025 10:00
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