npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

Iโ€™ve always been into building performant and accessible sites, but lately Iโ€™ve been taking it extremely seriously. So much so that Iโ€™ve been building a tool to help me optimize and monitor the sites that I build to make sure that Iโ€™m making an attempt to offer the best experience to those who visit them. If youโ€™re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, ๐Ÿ‘‹, Iโ€™m Ryan Hefnerย  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If youโ€™re interested in other things Iโ€™m working on, follow me on Twitter or check out the open source projects Iโ€™ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soonโ€“ish.

Open Software & Tools

This site wouldnโ€™t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you ๐Ÿ™

ยฉ 2024 โ€“ย Pkg Stats / Ryan Hefner

@uniswap/v3-periphery-optimism

v1.1.0-rc.1

Published

๐ŸŽš Optimism fork of peripheral smart contracts for interacting with Uniswap V3 on Optimism

Downloads

32

Readme

Uniswap V3 Periphery Optimism

Tests Lint

This repository contains the Optimism fork of the periphery smart contracts for the Uniswap V3 Protocol. For the lower level core contracts, see the uniswap-v3-core-optimism repository.

Testing

Because these contracts and tests are modified for OVM support, there are some changes that mean we can no longer simply run yarn test and yarn test:ovm and expect all tests to pass for both the EVM and OVM. There are a few reasons for this:

  1. EVM vs. OVM contracts will use different amounts of gas, so the gas tests will fail
  2. PoolAddress.sol has a hardcoded bytecode hash, but this hash will be different for EVM vs. OVM bytecode
  3. In Uniswap V3 Core and Periphery contracts some logic was pulled out into library contracts to reduce contract size. The original EVM contracts had deterministic bytecode, so a bytecode hash can be easily hardcoded in PoolAddress.sol, but this is no longer true. The contracts now require linking libraries, and therefore the bytecode and bytecode hash is dependent on the library addresses, which are dependent on the deployer account and nonce

Therefore, we must follow the steps below to run EVM tests in this repo:

  1. Run UPDATE_SNAPSHOT=1 yarn test which will ensure gas costs snapshots are updated (i.e. tests will not fail for gas cost reasons)

And to run OVM tests:

  1. Run yarn postinstall to apply a patch that adds OVM mock contract support to Waffle
  2. Run UPDATE_SNAPSHOT=1 yarn test:ovm which will ensure gas costs snapshots are updated (i.e. tests will not fail for gas cost reasons)
  3. On subsequent test runs, run yarn optimism-down && yarn optimism-up && UPDATE_SNAPSHOT=1 yarn test:ovm. This is required so the deployer account nonce is reset to zero, which is necessary to get the above bytecode hash when deploying contracts

Both test commands (yarn test and yarn test:ovm) will automatically update the POOL_INIT_CODE_HASH in PoolAddress.sol as needed for testing.

Note that the _Setup.spec.ts test file must always be run first. This ensures library addresses (which are dependent on account nonce) are always the same, which ensures the bytecode hash is the same on each test run.