Skip to content

Meta: Potential benefits of switching the pragma to ">=0.8.0 <0.9.0" #125

@PaulRBerg

Description

@PaulRBerg

I know that there's a keen interest in keeping Forge Std compatible with Solidity v0.6 and Solidity v0.7, but I also think that there would be quite a few benefits in upgrading to Solidity v0.8, so I made this post to shed some light on them.

Even if we don't upgrade the pragma now, it might be worth it keep these advantages in the back of our minds (maybe we could implement them on a "solidity-v8" branch).

  1. Provide a speed bump to Solidity v0.8 users (probably the majority of users at the time of writing this) via:
    • unchecked arithmetic
    • Reverting with custom errors instead of revert reason strings
  2. Simplify and even delete some functions, e.g. getCode could be replaced by <address>.code.
  3. Free functions (introduced in v0.7.1) (see what how I used them in PRBTest).
  4. Provide type safety via user-defined value types (introduced v0.8.13), e.g. in assertApproxEqRel.
  5. type(uint256).max to get the min and max values permitted in a given type.
  6. Make it possible to implement the change proposed by @mds1 in #78 (because interfaces and libraries can inherit in Solidity v0.8)
  7. Make it possible to upstream assertions to PRBTest (see discussion here).

And potentially several other enhancements could be made to the syntax in StdStorage.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions