Skip to content

Conversation

@benzntech
Copy link

This PR upgrades the project's smart contracts from Solidity version 0.6.11 to ^0.8.20.

Changes Included:

  • Updated Solidity pragma statements in all contracts.
  • Updated the compiler version in hardhat.config.js.
  • Upgraded @openzeppelin/contracts dependency to v4.9.3 (compatible with Solidity 0.8).
  • Upgraded prettier dependency to resolve peer conflicts.
  • Fixed breaking changes introduced by Solidity 0.8+, primarily related to explicit address payable conversions and updated OpenZeppelin import paths.
  • Updated the test suite (test/exchangedeposit.js) to use assert.rejects with adjusted regular expressions matching the new revert reason formats from Solidity 0.8.
  • Adjusted gas cost expectations slightly in tests to account for compiler differences.

All tests in the existing suite (34 tests) are passing after these changes.

Note: Due to the older dependency structure in the package.json, running npm install --legacy-peer-deps is currently required to successfully install dependencies.

address... since we can't stop ERC20 deposits, we want to leave a path for
fund recovery if the user deposits to an old deposit address after it's been
killed.
- **Solidity Version:** ^0.8.20
Copy link
Member

Choose a reason for hiding this comment

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

Not sure this is a goal.

- Fixed `address` to `address payable` explicit conversion errors introduced in Solidity 0.8+.
- Updated test file (`test/exchangedeposit.js`) assertions (`assert.rejects`) to match new revert reason string formats.
- Adjusted gas cost expectations in tests.
- **Note:** Due to older dependencies in the project structure, `npm install --legacy-peer-deps` is currently required to resolve peer dependency conflicts.
Copy link
Member

Choose a reason for hiding this comment

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

The npm ci restriction was originally added because we needed to use a special version of prettier.

I would appreciate it if you could fix the dependencies so that we don't need special install flags.

Copy link
Member

@junderw junderw left a comment

Choose a reason for hiding this comment

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

Thanks for the PR. Would appreciate some changes I made comments about.

@junderw
Copy link
Member

junderw commented Apr 11, 2025

I got the CI to run the tests and some are failing. If you could please remedy this along with your other changes I would appreciate it.

@benzntech benzntech requested a review from junderw June 11, 2025 07:03
const COLD_ADDRESS2 = accounts[7];
const ADMIN_ADDRESS2 = accounts[8];
const FUNDER_ADDRESS = accounts[9];
const FUNDER_ADDRESS = accounts[9]; // This is accounts[9]
Copy link
Member

Choose a reason for hiding this comment

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

?

Copy link
Member

@junderw junderw left a comment

Choose a reason for hiding this comment

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

Thanks for the work!

Tests are failing. And 2 of the issues mentioned before were left unresolved.

Also I think there was an accidental comment left (see the "?")

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