@pancakeswap/v3-core

1.0.2 • Public • Published

PancakeSwap V3

This repository contains the core smart contracts for the PancakeSwap V3 Protocol. For higher level contracts, see the v3-periphery repository.

Local deployment

In order to deploy this code to a local testnet, you should install the npm package @pancakeswap/v3-core and import the factory bytecode located at @pancakeswap/v3-core/artifacts/contracts/PancakeV3Factory.sol/PancakeV3Factory.json. For example:

import {
  abi as FACTORY_ABI,
  bytecode as FACTORY_BYTECODE,
} from '@pancakeswap/v3-core/artifacts/contracts/PancakeV3Factory.sol/PancakeV3Factory.json'

// deploy the bytecode

This will ensure that you are testing against the same bytecode that is deployed to mainnet and public testnets, and all PancakeSwap code will correctly interoperate with your local deployment.

Using solidity interfaces

The PancakeSwap v3 interfaces are available for import into solidity smart contracts via the npm artifact @pancakeswap/v3-core, e.g.:

import '@pancakeswap/v3-core/contracts/interfaces/IPancakeV3Pool.sol';

contract MyContract {
  IPancakeV3Pool pool;

  function doSomethingWithPool() {
    // pool.swap(...);
  }
}

Readme

Keywords

Package Sidebar

Install

npm i @pancakeswap/v3-core

Weekly Downloads

796

Version

1.0.2

License

GPL-2.0-or-later

Unpacked Size

325 kB

Total Files

46

Last publish

Collaborators

  • chefjackson
  • chef-jojo
  • pancakeswapadmin