@134dd3v/uniswap-v3-core-0.8-support 中文文档教程
Uniswap V3
此存储库包含 Uniswap V3 协议的核心智能合约。 对于更高级别的合约,请参阅 uniswap-v3-periphery 存储库。
Bug bounty
根据此处定义的条款,此存储库受 Uniswap V3 错误赏金计划的约束。
Local deployment
为了将此代码部署到本地测试网,您应该安装 npm 包 <代码>@uniswap/v3-核心 并导入位于的工厂字节码 @uniswap/v3-core/artifacts/contracts/UniswapV3Factory.sol/UniswapV3Factory.json
。 例如:
import {
abi as FACTORY_ABI,
bytecode as FACTORY_BYTECODE,
} from '@uniswap/v3-core/artifacts/contracts/UniswapV3Factory.sol/UniswapV3Factory.json'
// deploy the bytecode
这将确保您正在针对部署到的相同字节码进行测试 主网和公共测试网,以及所有 Uniswap 代码将正确地与 您的本地部署。
Using solidity interfaces
Uniswap v3 接口可用于导入 solidity 智能合约 通过 npm 工件 @uniswap/v3-core
,例如:
import '@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol';
contract MyContract {
IUniswapV3Pool pool;
function doSomethingWithPool() {
// pool.swap(...);
}
}
Licensing
Uniswap V3 Core 的主要许可证是 Business Source License 1.1 (BUSL-1.1
),参见 LICENSE
。
Exceptions
- All files in
contracts/interfaces/
are licensed underGPL-2.0-or-later
(as indicated in their SPDX headers), seecontracts/interfaces/LICENSE
- Several files in
contracts/libraries/
are licensed underGPL-2.0-or-later
(as indicated in their SPDX headers), seecontracts/libraries/LICENSE_GPL
contracts/libraries/FullMath.sol
is licensed underMIT
(as indicated in its SPDX header), seecontracts/libraries/LICENSE_MIT
- All files in
contracts/test
remain unlicensed.
Uniswap V3
This repository contains the core smart contracts for the Uniswap V3 Protocol. For higher level contracts, see the uniswap-v3-periphery repository.
Bug bounty
This repository is subject to the Uniswap V3 bug bounty program, per the terms defined here.
Local deployment
In order to deploy this code to a local testnet, you should install the npm package @uniswap/v3-core
and import the factory bytecode located at @uniswap/v3-core/artifacts/contracts/UniswapV3Factory.sol/UniswapV3Factory.json
. For example:
import {
abi as FACTORY_ABI,
bytecode as FACTORY_BYTECODE,
} from '@uniswap/v3-core/artifacts/contracts/UniswapV3Factory.sol/UniswapV3Factory.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 Uniswap code will correctly interoperate with your local deployment.
Using solidity interfaces
The Uniswap v3 interfaces are available for import into solidity smart contracts via the npm artifact @uniswap/v3-core
, e.g.:
import '@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol';
contract MyContract {
IUniswapV3Pool pool;
function doSomethingWithPool() {
// pool.swap(...);
}
}
Licensing
The primary license for Uniswap V3 Core is the Business Source License 1.1 (BUSL-1.1
), see LICENSE
.
Exceptions
- All files in
contracts/interfaces/
are licensed underGPL-2.0-or-later
(as indicated in their SPDX headers), seecontracts/interfaces/LICENSE
- Several files in
contracts/libraries/
are licensed underGPL-2.0-or-later
(as indicated in their SPDX headers), seecontracts/libraries/LICENSE_GPL
contracts/libraries/FullMath.sol
is licensed underMIT
(as indicated in its SPDX header), seecontracts/libraries/LICENSE_MIT
- All files in
contracts/test
remain unlicensed.