Every change in the ownership of digital collections can be recorded on the blockchain,greatly promoting the transaction and circulation of digital collections.Blockchain technology can confirm that digital collections are easy to transfer and can be traded;
Through blockchain technology,the creators,consumers and participants of digital collections will be more closely connected and become a more active and influential platform for creation,communication and trading.
UniswapV3PoolDeployer合约主要提供deploy函数来创建UniswapV3Pool智能合约并设置两个token信息,交易费用信息和tick的步长信息,完整代码如下:
//SPDX-License-Identifier:BUSL-1.1
pragma solidity=0.7.6;
import'./interfaces/IUniswapV3PoolDeployer.sol';
import'./UniswapV3Pool.sol';
contract UniswapV3PoolDeployer is IUniswapV3PoolDeployer{
struct Parameters{
address factory;
address token0;
address token1;
uint24 fee;
int24 tickSpacing;
}
///inheritdoc IUniswapV3PoolDeployer
Parameters public override parameters;
///dev Deploys a pool with the given parameters by transiently setting the parameters storage slot and then
///clearing it after deploying the pool.
///param factory The contract address of the Uniswap V3 factory
///param token0 The first token of the pool by address sort order
///param token1 The second token of the pool by address sort order
///param fee The fee collected upon every swap in the pool,denominated in hundredths of a bip
///param tickSpacing The spacing between usable ticks
function deploy(
address factory,
address token0,
address token1,
uint24 fee,
int24 tickSpacing
)internal returns(address pool){
parameters=Parameters({factory:factory,token0:token0,token1:token1,fee:fee,tickSpacing:tickSpacing});
pool=address(new UniswapV3Pool{salt:keccak256(abi.encode(token0,token1,fee))}());
delete parameters;
}
}