infrastructure-upgrade/lib/v3-periphery/contracts/test/PoolAddressTest.sol
T-Hax 735546619e
init
Signed-off-by: T-Hax <>
2023-04-08 18:46:18 +00:00

31 lines
908 B
Solidity

// SPDX-License-Identifier: UNLICENSED
pragma solidity =0.7.6;
import '../libraries/PoolAddress.sol';
contract PoolAddressTest {
function POOL_INIT_CODE_HASH() external pure returns (bytes32) {
return PoolAddress.POOL_INIT_CODE_HASH;
}
function computeAddress(
address factory,
address token0,
address token1,
uint24 fee
) external pure returns (address) {
return PoolAddress.computeAddress(factory, PoolAddress.PoolKey({token0: token0, token1: token1, fee: fee}));
}
function getGasCostOfComputeAddress(
address factory,
address token0,
address token1,
uint24 fee
) external view returns (uint256) {
uint256 gasBefore = gasleft();
PoolAddress.computeAddress(factory, PoolAddress.PoolKey({token0: token0, token1: token1, fee: fee}));
return gasBefore - gasleft();
}
}