Contracts
Last updated
Last updated
Returns the Contract Application Binary Interface ( ABI ) of a verified smart contract.
Find verified contracts on our Verified Contracts Source Code page.
https://api-sepolia.lineascan.build/api
?module=contract
&action=getabi
&address=0x03f8b4b140249dc7b2503c928e7258cce1d91f1a
&apikey=YourApiKeyToken
Try this endpoint in your browser
Query Parameters
Parameter | Description |
---|---|
Sample Response
{
"status": "1",
"message": "OK",
"result": "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_factory\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_WNativeToken\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_tokenDescriptor_\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_poolDeployer\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"tickOutOfRange\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"approved\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"approved\",\"type\":\"bool\"}],\"name\":\"ApprovalForAll\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"}],\"name\":\"Collect\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint128\",\"name\":\"liquidity\",\"type\":\"uint128\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"}],\"name\":\"DecreaseLiquidity\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"farmingCenterAddress\",\"type\":\"address\"}],\"name\":\"FarmingCenter\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"FarmingFailed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint128\",\"name\":\"liquidityDesired\",\"type\":\"uint128\"},{\"indexed\":false,\"internalType\":\"uint128\",\"name\":\"actualLiquidity\",\"type\":\"uint128\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"pool\",\"type\":\"address\"}],\"name\":\"IncreaseLiquidity\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"DOMAIN_SEPARATOR\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"NONFUNGIBLE_POSITION_MANAGER_ADMINISTRATOR_ROLE\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"PERMIT_TYPEHASH\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"WNativeToken\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount0Owed\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1Owed\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"algebraMintCallback\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"approve\",\"type\":\"bool\"},{\"internalType\":\"address\",\"name\":\"farmingAddress\",\"type\":\"address\"}],\"name\":\"approveForFarming\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"burn\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint128\",\"name\":\"amount0Max\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"amount1Max\",\"type\":\"uint128\"}],\"internalType\":\"struct INonfungiblePositionManager.CollectParams\",\"name\":\"params\",\"type\":\"tuple\"}],\"name\":\"collect\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token0\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"token1\",\"type\":\"address\"},{\"internalType\":\"uint160\",\"name\":\"sqrtPriceX96\",\"type\":\"uint160\"}],\"name\":\"createAndInitializePoolIfNecessary\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"pool\",\"type\":\"address\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"uint128\",\"name\":\"liquidity\",\"type\":\"uint128\"},{\"internalType\":\"uint256\",\"name\":\"amount0Min\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1Min\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"}],\"internalType\":\"struct INonfungiblePositionManager.DecreaseLiquidityParams\",\"name\":\"params\",\"type\":\"tuple\"}],\"name\":\"decreaseLiquidity\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"factory\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"farmingApprovals\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"farmingCenterAddress\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"farmingCenter\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"getApproved\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount0Desired\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1Desired\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount0Min\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1Min\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"}],\"internalType\":\"struct INonfungiblePositionManager.IncreaseLiquidityParams\",\"name\":\"params\",\"type\":\"tuple\"}],\"name\":\"increaseLiquidity\",\"outputs\":[{\"internalType\":\"uint128\",\"name\":\"liquidity\",\"type\":\"uint128\"},{\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"}],\"name\":\"isApprovedForAll\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"isApprovedOrOwner\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"token0\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"token1\",\"type\":\"address\"},{\"internalType\":\"int24\",\"name\":\"tickLower\",\"type\":\"int24\"},{\"internalType\":\"int24\",\"name\":\"tickUpper\",\"type\":\"int24\"},{\"internalType\":\"uint256\",\"name\":\"amount0Desired\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1Desired\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount0Min\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1Min\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"}],\"internalType\":\"struct INonfungiblePositionManager.MintParams\",\"name\":\"params\",\"type\":\"tuple\"}],\"name\":\"mint\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"uint128\",\"name\":\"liquidity\",\"type\":\"uint128\"},{\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes[]\",\"name\":\"data\",\"type\":\"bytes[]\"}],\"name\":\"multicall\",\"outputs\":[{\"internalType\":\"bytes[]\",\"name\":\"results\",\"type\":\"bytes[]\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"ownerOf\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"permit\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"poolDeployer\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"positions\",\"outputs\":[{\"internalType\":\"uint88\",\"name\":\"nonce\",\"type\":\"uint88\"},{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"token0\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"token1\",\"type\":\"address\"},{\"internalType\":\"int24\",\"name\":\"tickLower\",\"type\":\"int24\"},{\"internalType\":\"int24\",\"name\":\"tickUpper\",\"type\":\"int24\"},{\"internalType\":\"uint128\",\"name\":\"liquidity\",\"type\":\"uint128\"},{\"internalType\":\"uint256\",\"name\":\"feeGrowthInside0LastX128\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"feeGrowthInside1LastX128\",\"type\":\"uint256\"},{\"internalType\":\"uint128\",\"name\":\"tokensOwed0\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"tokensOwed1\",\"type\":\"uint128\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"refundNativeToken\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"safeTransferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"safeTransferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"selfPermit\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expiry\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"selfPermitAllowed\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expiry\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"selfPermitAllowedIfNecessary\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"selfPermitIfNecessary\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"approved\",\"type\":\"bool\"}],\"name\":\"setApprovalForAll\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newFarmingCenter\",\"type\":\"address\"}],\"name\":\"setFarmingCenter\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amountMinimum\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"}],\"name\":\"sweepToken\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"toActive\",\"type\":\"bool\"}],\"name\":\"switchFarmingStatus\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"symbol\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"index\",\"type\":\"uint256\"}],\"name\":\"tokenByIndex\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"tokenFarmedIn\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"farmingCenterAddress\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"index\",\"type\":\"uint256\"}],\"name\":\"tokenOfOwnerByIndex\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"tokenURI\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalSupply\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amountMinimum\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"}],\"name\":\"unwrapWNativeToken\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}]"
}
A simple sample for retrieving the contractABI using Web3.js and Jquery to interact with a contract.
var Web3 = require('web3');
var web3 = new Web3(new Web3.providers.HttpProvider());
var version = web3.version.api;
$.getJSON('https://api-sepolia.lineascan.build/api?module=contract&action=getabi&address=0x1f1727E2C83c23faE3b1CdB048146647b3B6d17d&apikey=YourApiKeyToken', function (data) {
var contractABI = "";
contractABI = JSON.parse(data.result);
if (contractABI != ''){
var MyContract = web3.eth.contract(contractABI);
var myContractInstance = MyContract.at("0xfb6916095ca1df60bb79ce92ce3ea74c37c5d359");
var result = myContractInstance.memberId("0xfe8ad7dd2f564a877cc23feea6c0a9cc2e783715");
console.log("result1 : " + result);
var result = myContractInstance.members(1);
console.log("result2 : " + result);
} else {
console.log("Error" );
}
});
Returns the Solidity source code of a verified smart contract.
https://api-sepolia.lineascan.build/api
?module=contract
&action=getsourcecode
&address=0x03f8b4b140249dc7b2503c928e7258cce1d91f1a
&apikey=YourApiKeyToken
Query Parameters
Sample Response
{
"status": "1",
"message": "OK",
"result": [
{
"SourceCode": "{{\r\n \"language\": \"Solidity\",\r\n \"sources\": {\r\n \"@cryptoalgebra/integral-core/contracts/interfaces/callback/IAlgebraMintCallback.sol\": {\r\n \"content\": \"// SPDX-License-Identifier: GPL-2.0-or-later\\r\\npragma solidity \u003E=0.5.0;\\r\\n\\r\\n/// @title Callback for IAlgebraPoolActions#mint\\r\\n/// @notice Any contract that calls IAlgebraPoolActions#mint must implement this interface\\r\\n/// @dev Credit to Uniswap Labs under GPL-2.0-or-later license:\\r\\n/// https://github.com/Uniswap/v3-core/tree/main/contracts/interfaces\\r\\ninterface IAlgebraMintCallback {\\r\\n /// @notice Called to `msg.sender` after minting liquidity to a position from IAlgebraPool#mint.\\r\\n /// @dev In the implementation you must pay the pool tokens owed for the minted liquidity.\\r\\n /// The caller of this method _must_ be checked to be a AlgebraPool deployed by the canonical AlgebraFactory.\\r\\n /// @param amount0Owed The amount of token0 due to the pool for the minted liquidity\\r\\n /// @param amount1Owed The amount of token1 due to the pool for the minted liquidity\\r\\n /// @param data Any data passed through by the caller via the IAlgebraPoolActions#mint call\\r\\n function algebraMintCallback(uint256 amount0Owed, uint256 amount1Owed, bytes calldata data) external;\\r\\n}\\r\\n\"\r\n },\r\n \"@cryptoalgebra/integral-core/contracts/interfaces/IAlgebraFactory.sol\": {\r\n \"content\": \"// SPDX-License-Identifier: GPL-2.0-or-later\\r\\npragma solidity \u003E=0.5.0;\\r\\npragma abicoder v2;\\r\\n\\r\\nimport './plugin/IAlgebraPluginFactory.sol';\\r\\nimport './vault/IAlgebraVaultFactory.sol';\\r\\n\\r\\n/// @title The interface for the Algebra Factory\\r\\n/// @dev Credit to Uniswap Labs under GPL-2.0-or-later license:\\r\\n/// https://github.com/Uniswap/v3-core/tree/main/contracts/interfaces\\r\\ninterface IAlgebraFactory {\\r\\n /// @notice Emitted when a process of ownership renounce is started\\r\\n /// @param timestamp The timestamp of event\\r\\n /// @param finishTimestamp The timestamp when ownership renounce will be possible to finish\\r\\n event RenounceOwnershipStart(uint256 timestamp, uint256 finishTimestamp);\\r\\n\\r\\n /// @notice Emitted when a process of ownership renounce cancelled\\r\\n /// @param timestamp The timestamp of event\\r\\n event RenounceOwnershipStop(uint256 timestamp);\\r\\n\\r\\n /// @notice Emitted when a process of ownership renounce finished\\r\\n /// @param timestamp The timestamp of ownership renouncement\\r\\n event RenounceOwnershipFinish(uint256 timestamp);\\r\\n\\r\\n /// @notice Emitted when a pool is created\\r\\n /// @param token0 The first token of the pool by address sort order\\r\\n /// @param token1 The second token of the pool by address sort order\\r\\n /// @param pool The address of the created pool\\r\\n event Pool(address indexed token0, address indexed token1, address pool);\\r\\n\\r\\n /// @notice Emitted when the default community fee is changed\\r\\n /// @param newDefaultCommunityFee The new default community fee value\\r\\n event DefaultCommunityFee(uint16 newDefaultCommunityFee);\\r\\n\\r\\n /// @notice Emitted when the default tickspacing is changed\\r\\n /// @param newDefaultTickspacing The new default tickspacing value\\r\\n event DefaultTickspacing(int24 newDefaultTickspacing);\\r\\n\\r\\n /// @notice Emitted when the default fee is changed\\r\\n /// @param newDefaultFee The new default fee value\\r\\n event DefaultFee(uint16 newDefaultFee);\\r\\n\\r\\n /// @notice Emitted when the defaultPluginFactory address is changed\\r\\n /// @param defaultPluginFactoryAddress The new defaultPluginFactory address\\r\\n event DefaultPluginFactory(address defaultPluginFactoryAddress);\\r\\n\\r\\n /// @notice Emitted when the vaultFactory address is changed\\r\\n /// @param newVaultFactory The new vaultFactory address\\r\\n event VaultFactory(address newVaultFactory);\\r\\n\\r\\n /// @notice role that can change communityFee and tickspacing in pools\\r\\n /// @return The hash corresponding to this role\\r\\n function POOLS_ADMINISTRATOR_ROLE() external view returns (bytes32);\\r\\n\\r\\n /// @notice Returns `true` if `account` has been granted `role` or `account` is owner.\\r\\n /// @param role The hash corresponding to the role\\r\\n /// @param account The address for which the role is checked\\r\\n /// @return bool Whether the address has this role or the owner role or not\\r\\n function hasRoleOrOwner(bytes32 role, address account) external view returns (bool);\\r\\n\\r\\n /// @notice Returns the current owner of the factory\\r\\n /// @dev Can be changed by the current owner via transferOwnership(address newOwner)\\r\\n /// @return The address of the factory owner\\r\\n function owner() external view returns (address);\\r\\n\\r\\n /// @notice Returns the current poolDeployerAddress\\r\\n /// @return The address of the poolDeployer\\r\\n function poolDeployer() external view returns (address);\\r\\n\\r\\n /// @notice Returns the default community fee\\r\\n /// @return Fee which will be set at the creation of the pool\\r\\n function defaultCommunityFee() external view returns (uint16);\\r\\n\\r\\n /// @notice Returns the default fee\\r\\n /// @return Fee which will be set at the creation of the pool\\r\\n function defaultFee() external view returns (uint16);\\r\\n\\r\\n /// @notice Returns the default tickspacing\\r\\n /// @return Tickspacing which will be set at the creation of the pool\\r\\n function defaultTickspacing() external view returns (int24);\\r\\n\\r\\n /// @notice Return the current pluginFactory address\\r\\n /// @dev This contract is used to automatically set a plugin address in new liquidity pools\\r\\n /// @return Algebra plugin factory\\r\\n function defaultPluginFactory() external view returns (IAlgebraPluginFactory);\\r\\n\\r\\n /// @notice Return the current vaultFactory address\\r\\n /// @dev This contract is used to automatically set a vault address in new liquidity pools\\r\\n /// @return Algebra vault factory\\r\\n function vaultFactory() external view returns (IAlgebraVaultFactory);\\r\\n\\r\\n /// @notice Returns the default communityFee, tickspacing, fee and communityFeeVault for pool\\r\\n /// @param pool the address of liquidity pool\\r\\n /// @return communityFee which will be set at the creation of the pool\\r\\n /// @return tickSpacing which will be set at the creation of the pool\\r\\n /// @return fee which will be set at the creation of the pool\\r\\n /// @return communityFeeVault the address of communityFeeVault\\r\\n function defaultConfigurationForPool(\\r\\n address pool\\r\\n ) external view returns (uint16 communityFee, int24 tickSpacing, uint16 fee, address communityFeeVault);\\r\\n\\r\\n /// @notice Deterministically computes the pool address given the token0 and token1\\r\\n /// @dev The method does not check if such a pool has been created\\r\\n /// @param token0 first token\\r\\n /// @param token1 second token\\r\\n /// @return pool The contract address of the Algebra pool\\r\\n function computePoolAddress(address token0, address token1) external view returns (address pool);\\r\\n\\r\\n /// @notice Returns the pool address for a given pair of tokens, or address 0 if it does not exist\\r\\n /// @dev tokenA and tokenB may be passed in either token0/token1 or token1/token0 order\\r\\n /// @param tokenA The contract address of either token0 or token1\\r\\n /// @param tokenB The contract address of the other token\\r\\n /// @return pool The pool address\\r\\n function poolByPair(address tokenA, address tokenB) external view returns (address pool);\\r\\n\\r\\n /// @notice returns keccak256 of AlgebraPool init bytecode.\\r\\n /// @dev the hash value changes with any change in the pool bytecode\\r\\n /// @return Keccak256 hash of AlgebraPool contract init bytecode\\r\\n function POOL_INIT_CODE_HASH() external view returns (bytes32);\\r\\n\\r\\n /// @return timestamp The timestamp of the beginning of the renounceOwnership process\\r\\n function renounceOwnershipStartTimestamp() external view returns (uint256 timestamp);\\r\\n\\r\\n /// @notice Creates a pool for the given two tokens\\r\\n /// @param tokenA One of the two tokens in the desired pool\\r\\n /// @param tokenB The other of the two tokens in the desired pool\\r\\n /// @dev tokenA and tokenB may be passed in either order: token0/token1 or token1/token0.\\r\\n /// The call will revert if the pool already exists or the token arguments are invalid.\\r\\n /// @return pool The address of the newly created pool\\r\\n function createPool(address tokenA, address tokenB) external returns (address pool);\\r\\n\\r\\n /// @dev updates default community fee for new pools\\r\\n /// @param newDefaultCommunityFee The new community fee, _must_ be \u003C= MAX_COMMUNITY_FEE\\r\\n function setDefaultCommunityFee(uint16 newDefaultCommunityFee) external;\\r\\n\\r\\n /// @dev updates default fee for new pools\\r\\n /// @param newDefaultFee The new fee, _must_ be \u003C= MAX_DEFAULT_FEE\\r\\n function setDefaultFee(uint16 newDefaultFee) external;\\r\\n\\r\\n /// @dev updates default tickspacing for new pools\\r\\n /// @param newDefaultTickspacing The new tickspacing, _must_ be \u003C= MAX_TICK_SPACING and \u003E= MIN_TICK_SPACING\\r\\n function setDefaultTickspacing(int24 newDefaultTickspacing) external;\\r\\n\\r\\n /// @dev updates pluginFactory address\\r\\n /// @param newDefaultPluginFactory address of new plugin factory\\r\\n function setDefaultPluginFactory(address newDefaultPluginFactory) external;\\r\\n\\r\\n /// @dev updates vaultFactory address\\r\\n /// @param newVaultFactory address of new vault factory\\r\\n function setVaultFactory(address newVaultFactory) external;\\r\\n\\r\\n /// @notice Starts process of renounceOwnership. After that, a certain period\\r\\n /// of time must pass before the ownership renounce can be completed.\\r\\n function startRenounceOwnership() external;\\r\\n\\r\\n /// @notice Stops process of renounceOwnership and removes timer.\\r\\n function stopRenounceOwnership() external;\\r\\n}\\r\\n\"\r\n },\r\n \"@cryptoalgebra/integral-core/contracts/interfaces/IAlgebraPool.sol\": {\r\n \"content\": \"// SPDX-License-Identifier: GPL-2.0-or-later\\r\\npragma solidity \u003E=0.8.4;\\r\\n\\r\\nimport './pool/IAlgebraPoolImmutables.sol';\\r\\nimport './pool/IAlgebraPoolState.sol';\\r\\nimport './pool/IAlgebraPoolActions.sol';\\r\\nimport './pool/IAlgebraPoolPermissionedActions.sol';\\r\\nimport './pool/IAlgebraPoolEvents.sol';\\r\\nimport './pool/IAlgebraPoolErrors.sol';\\r\\n\\r\\n/// @title The interface for a Algebra Pool\\r\\n/// @dev The pool interface is broken up into many smaller pieces.\\r\\n/// This interface includes custom error definitions and cannot be used in older versions of Solidity.\\r\\n/// For older versions of Solidity use #IAlgebraPoolLegacy\\r\\n/// Credit to Uniswap Labs under GPL-2.0-or-later license:\\r\\n/// https://github.com/Uniswap/v3-core/tree/main/contracts/interfaces\\r\\ninterface IAlgebraPool is\\r\\n IAlgebraPoolImmutables,\\r\\n IAlgebraPoolState,\\r\\n IAlgebraPoolActions,\\r\\n IAlgebraPoolPermissionedActions,\\r\\n IAlgebraPoolEvents,\\r\\n IAlgebraPoolErrors\\r\\n{\\r\\n // used only for combining interfaces\\r\\n}\\r\\n\"\r\n },\r\n \"@cryptoalgebra/integral-core/contracts/interfaces/plugin/IAlgebraPluginFactory.sol\": {\r\n \"content\": \"// SPDX-License-Identifier: GPL-2.0-or-later\\r\\npragma solidity \u003E=0.5.0;\\r\\n\\r\\n/// @title An interface for a contract that is capable of deploying Algebra plugins\\r\\n/// @dev Such a factory is needed if the plugin should be automatically created and connected to each new pool\\r\\ninterface IAlgebraPluginFactory {\\r\\n /// @notice Deploys new plugin contract for pool\\r\\n /// @param pool The address of the pool for which the new plugin will be created\\r\\n /// @param token0 First token of the pool\\r\\n /// @param token1 Second token of the pool\\r\\n /// @return New plugin address\\r\\n function createPlugin(address pool, address token0, address token1) external returns (address);\\r\\n}\\r\\n\"\r\n },\r\n \"@cryptoalgebra/integral-core/contracts/interfaces/pool/IAlgebraPoolActions.sol\": {\r\n \"content\": \"// SPDX-License-Identifier: GPL-2.0-or-later\\r\\npragma solidity \u003E=0.5.0;\\r\\n\\r\\n/// @title Permissionless pool actions\\r\\n/// @dev Credit to Uniswap Labs under GPL-2.0-or-later license:\\r\\n/// https://github.com/Uniswap/v3-core/tree/main/contracts/interfaces\\r\\ninterface IAlgebraPoolActions {\\r\\n /// @notice Sets the initial price for the pool\\r\\n /// @dev Price is represented as a sqrt(amountToken1/amountToken0) Q64.96 value\\r\\n /// @dev Initialization should be done in one transaction with pool creation to avoid front-running\\r\\n /// @param initialPrice The initial sqrt price of the pool as a Q64.96\\r\\n function initialize(uint160 initialPrice) external;\\r\\n\\r\\n /// @notice Adds liquidity for the given recipient/bottomTick/topTick position\\r\\n /// @dev The caller of this method receives a callback in the form of IAlgebraMintCallback#algebraMintCallback\\r\\n /// in which they must pay any token0 or token1 owed for the liquidity. The amount of token0/token1 due depends\\r\\n /// on bottomTick, topTick, the amount of liquidity, and the current price.\\r\\n /// @param leftoversRecipient The address which will receive potential surplus of paid tokens\\r\\n /// @param recipient The address for which the liquidity will be created\\r\\n /// @param bottomTick The lower tick of the position in which to add liquidity\\r\\n /// @param topTick The upper tick of the position in which to add liquidity\\r\\n /// @param liquidityDesired The desired amount of liquidity to mint\\r\\n /// @param data Any data that should be passed through to the callback\\r\\n /// @return amount0 The amount of token0 that was paid to mint the given amount of liquidity. Matches the value in the callback\\r\\n /// @return amount1 The amount of token1 that was paid to mint the given amount of liquidity. Matches the value in the callback\\r\\n /// @return liquidityActual The actual minted amount of liquidity\\r\\n function mint(\\r\\n address leftoversRecipient,\\r\\n address recipient,\\r\\n int24 bottomTick,\\r\\n int24 topTick,\\r\\n uint128 liquidityDesired,\\r\\n bytes calldata data\\r\\n ) external returns (uint256 amount0, uint256 amount1, uint128 liquidityActual);\\r\\n\\r\\n /// @notice Collects tokens owed to a position\\r\\n /// @dev Does not recompute fees earned, which must be done either via mint or burn of any amount of liquidity.\\r\\n /// Collect must be called by the position owner. To withdraw only token0 or only token1, amount0Requested or\\r\\n /// amount1Requested may be set to zero. To withdraw all tokens owed, caller may pass any value greater than the\\r\\n /// actual tokens owed, e.g. type(uint128).max. Tokens owed may be from accumulated swap fees or burned liquidity.\\r\\n /// @param recipient The address which should receive the fees collected\\r\\n /// @param bottomTick The lower tick of the position for which to collect fees\\r\\n /// @param topTick The upper tick of the position for which to collect fees\\r\\n /// @param amount0Requested How much token0 should be withdrawn from the fees owed\\r\\n /// @param amount1Requested How much token1 should be withdrawn from the fees owed\\r\\n /// @return amount0 The amount of fees collected in token0\\r\\n /// @return amount1 The amount of fees collected in token1\\r\\n function collect(\\r\\n address recipient,\\r\\n int24 bottomTick,\\r\\n int24 topTick,\\r\\n uint128 amount0Requested,\\r\\n uint128 amount1Requested\\r\\n ) external returns (uint128 amount0, uint128 amount1);\\r\\n\\r\\n /// @notice Burn liquidity from the sender and account tokens owed for the liquidity to the position\\r\\n /// @dev Can be used to trigger a recalculation of fees owed to a position by calling with an amount of 0\\r\\n /// @dev Fees must be collected separately via a call to #collect\\r\\n /// @param bottomTick The lower tick of the position for which to burn liquidity\\r\\n /// @param topTick The upper tick of the position for which to burn liquidity\\r\\n /// @param amount How much liquidity to burn\\r\\n /// @param data Any data that should be passed through to the plugin\\r\\n /// @return amount0 The amount of token0 sent to the recipient\\r\\n /// @return amount1 The amount of token1 sent to the recipient\\r\\n function burn(int24 bottomTick, int24 topTick, uint128 amount, bytes calldata data) external returns (uint256 amount0, uint256 amount1);\\r\\n\\r\\n /// @notice Swap token0 for token1, or token1 for token0\\r\\n /// @dev The caller of this method receives a callback in the form of IAlgebraSwapCallback#algebraSwapCallback\\r\\n /// @param recipient The address to receive the output of the swap\\r\\n /// @param zeroToOne The direction of the swap, true for token0 to token1, false for token1 to token0\\r\\n /// @param amountRequired The amount of the swap, which implicitly configures the swap as exact input (positive), or exact output (negative)\\r\\n /// @param limitSqrtPrice The Q64.96 sqrt price limit. If zero for one, the price cannot be less than this\\r\\n /// value after the swap. If one for zero, the price cannot be greater than this value after the swap\\r\\n /// @param data Any data to be passed through to the callback. If using the Router it should contain SwapRouter#SwapCallbackData\\r\\n /// @return amount0 The delta of the balance of token0 of the pool, exact when negative, minimum when positive\\r\\n /// @return amount1 The delta of the balance of token1 of the pool, exact when negative, minimum when positive\\r\\n function swap(\\r\\n address recipient,\\r\\n bool zeroToOne,\\r\\n int256 amountRequired,\\r\\n uint160 limitSqrtPrice,\\r\\n bytes calldata data\\r\\n ) external returns (int256 amount0, int256 amount1);\\r\\n\\r\\n /// @notice Swap token0 for token1, or token1 for token0 with prepayment\\r\\n /// @dev The caller of this method receives a callback in the form of IAlgebraSwapCallback#algebraSwapCallback\\r\\n /// caller must send tokens in callback before swap calculation\\r\\n /// the actually sent amount of tokens is used for further calculations\\r\\n /// @param leftoversRecipient The address which will receive potential surplus of paid tokens\\r\\n /// @param recipient The address to receive the output of the swap\\r\\n /// @param zeroToOne The direction of the swap, true for token0 to token1, false for token1 to token0\\r\\n /// @param amountToSell The amount of the swap, only positive (exact input) amount allowed\\r\\n /// @param limitSqrtPrice The Q64.96 sqrt price limit. If zero for one, the price cannot be less than this\\r\\n /// value after the swap. If one for zero, the price cannot be greater than this value after the swap\\r\\n /// @param data Any data to be passed through to the callback. If using the Router it should contain SwapRouter#SwapCallbackData\\r\\n /// @return amount0 The delta of the balance of token0 of the pool, exact when negative, minimum when positive\\r\\n /// @return amount1 The delta of the balance of token1 of the pool, exact when negative, minimum when positive\\r\\n function swapWithPaymentInAdvance(\\r\\n address leftoversRecipient,\\r\\n address recipient,\\r\\n bool zeroToOne,\\r\\n int256 amountToSell,\\r\\n uint160 limitSqrtPrice,\\r\\n bytes calldata data\\r\\n ) external returns (int256 amount0, int256 amount1);\\r\\n\\r\\n /// @notice Receive token0 and/or token1 and pay it back, plus a fee, in the callback\\r\\n /// @dev The caller of this method receives a callback in the form of IAlgebraFlashCallback#algebraFlashCallback\\r\\n /// @dev All excess tokens paid in the callback are distributed to currently in-range liquidity providers as an additional fee.\\r\\n /// If there are no in-range liquidity providers, the fee will be transferred to the first active provider in the future\\r\\n /// @param recipient The address which will receive the token0 and token1 amounts\\r\\n /// @param amount0 The amount of token0 to send\\r\\n /// @param amount1 The amount of token1 to send\\r\\n /// @param data Any data to be passed through to the callback\\r\\n function flash(address recipient, uint256 amount0, uint256 amount1, bytes calldata data) external;\\r\\n}\\r\\n\"\r\n },\r\n \"@cryptoalgebra/integral-core/contracts/interfaces/pool/IAlgebraPoolErrors.sol\": {\r\n \"content\": \"// SPDX-License-Identifier: GPL-2.0-or-later\\r\\npragma solidity \u003E=0.8.4;\\r\\n\\r\\n/// @title Errors emitted by a pool\\r\\n/// @notice Contains custom errors emitted by the pool\\r\\n/// @dev Custom errors are separated from the common pool interface for compatibility with older versions of Solidity\\r\\ninterface IAlgebraPoolErrors {\\r\\n // #### pool errors ####\\r\\n\\r\\n /// @notice Emitted by the reentrancy guard\\r\\n error locked();\\r\\n\\r\\n /// @notice Emitted if arithmetic error occurred\\r\\n error arithmeticError();\\r\\n\\r\\n /// @notice Emitted if an attempt is made to initialize the pool twice\\r\\n error alreadyInitialized();\\r\\n\\r\\n /// @notice Emitted if an attempt is made to mint or swap in uninitialized pool\\r\\n error notInitialized();\\r\\n\\r\\n /// @notice Emitted if 0 is passed as amountRequired to swap function\\r\\n error zeroAmountRequired();\\r\\n\\r\\n /// @notice Emitted if invalid amount is passed as amountRequired to swap function\\r\\n error invalidAmountRequired();\\r\\n\\r\\n /// @notice Emitted if the pool received fewer tokens than it should have\\r\\n error insufficientInputAmount();\\r\\n\\r\\n /// @notice Emitted if there was an attempt to mint zero liquidity\\r\\n error zeroLiquidityDesired();\\r\\n /// @notice Emitted if actual amount of liquidity is zero (due to insufficient amount of tokens received)\\r\\n error zeroLiquidityActual();\\r\\n\\r\\n /// @notice Emitted if the pool received fewer tokens0 after flash than it should have\\r\\n error flashInsufficientPaid0();\\r\\n /// @notice Emitted if the pool received fewer tokens1 after flash than it should have\\r\\n error flashInsufficientPaid1();\\r\\n\\r\\n /// @notice Emitted if limitSqrtPrice param is incorrect\\r\\n error invalidLimitSqrtPrice();\\r\\n\\r\\n /// @notice Tick must be divisible by tickspacing\\r\\n error tickIsNotSpaced();\\r\\n\\r\\n /// @notice Emitted if a method is called that is accessible only to the factory owner or dedicated role\\r\\n error notAllowed();\\r\\n\\r\\n /// @notice Emitted if new tick spacing exceeds max allowed value\\r\\n error invalidNewTickSpacing();\\r\\n /// @notice Emitted if new community fee exceeds max allowed value\\r\\n error invalidNewCommunityFee();\\r\\n\\r\\n /// @notice Emitted if an attempt is made to manually change the fee value, but dynamic fee is enabled\\r\\n error dynamicFeeActive();\\r\\n /// @notice Emitted if an attempt is made by plugin to change the fee value, but dynamic fee is disabled\\r\\n error dynamicFeeDisabled();\\r\\n /// @notice Emitted if an attempt is made to change the plugin configuration, but the plugin is not connected\\r\\n error pluginIsNotConnected();\\r\\n /// @notice Emitted if a plugin returns invalid selector after hook call\\r\\n /// @param expectedSelector The expected selector\\r\\n error invalidHookResponse(bytes4 expectedSelector);\\r\\n\\r\\n // #### LiquidityMath errors ####\\r\\n\\r\\n /// @notice Emitted if liquidity underflows\\r\\n error liquiditySub();\\r\\n /// @notice Emitted if liquidity overflows\\r\\n error liquidityAdd();\\r\\n\\r\\n // #### TickManagement errors ####\\r\\n\\r\\n /// @notice Emitted if the topTick param not greater then the bottomTick param\\r\\n error topTickLowerOrEqBottomTick();\\r\\n /// @notice Emitted if the bottomTick param is lower than min allowed value\\r\\n error bottomTickLowerThanMIN();\\r\\n /// @notice Emitted if the topTick param is greater than max allowed value\\r\\n error topTickAboveMAX();\\r\\n /// @notice Emitted if the liquidity value associated with the tick exceeds MAX_LIQUIDITY_PER_TICK\\r\\n error liquidityOverflow();\\r\\n /// @notice Emitted if an attempt is made to interact with an uninitialized tick\\r\\n error tickIsNotInitialized();\\r\\n /// @notice Emitted if there is an attempt to insert a new tick into the list of ticks with incorrect indexes of the previous and next ticks\\r\\n error tickInvalidLinks();\\r\\n\\r\\n // #### SafeTransfer errors ####\\r\\n\\r\\n /// @notice Emitted if token transfer failed internally\\r\\n error transferFailed();\\r\\n\\r\\n // #### TickMath errors ####\\r\\n\\r\\n /// @notice Emitted if tick is greater than the maximum or less than the minimum allowed value\\r\\n error tickOutOfRange();\\r\\n /// @notice Emitted if price is greater than the maximum or less than the minimum allowed value\\r\\n error priceOutOfRange();\\r\\n}\\r\\n\"\r\n },\r\n \"@cryptoalgebra/integral-core/contracts/interfaces/pool/IAlgebraPoolEvents.sol\": {\r\n \"content\": \"// SPDX-License-Identifier: GPL-2.0-or-later\\r\\npragma solidity \u003E=0.5.0;\\r\\n\\r\\n/// @title Events emitted by a pool\\r\\n/// @dev Credit to Uniswap Labs under GPL-2.0-or-later license:\\r\\n/// https://github.com/Uniswap/v3-core/tree/main/contracts/interfaces\\r\\ninterface IAlgebraPoolEvents {\\r\\n /// @notice Emitted exactly once by a pool when #initialize is first called on the pool\\r\\n /// @dev Mint/Burn/Swaps cannot be emitted by the pool before Initialize\\r\\n /// @param price The initial sqrt price of the pool, as a Q64.96\\r\\n /// @param tick The initial tick of the pool, i.e. log base 1.0001 of the starting price of the pool\\r\\n event Initialize(uint160 price, int24 tick);\\r\\n\\r\\n /// @notice Emitted when liquidity is minted for a given position\\r\\n /// @param sender The address that minted the liquidity\\r\\n /// @param owner The owner of the position and recipient of any minted liquidity\\r\\n /// @param bottomTick The lower tick of the position\\r\\n /// @param topTick The upper tick of the position\\r\\n /// @param liquidityAmount The amount of liquidity minted to the position range\\r\\n /// @param amount0 How much token0 was required for the minted liquidity\\r\\n /// @param amount1 How much token1 was required for the minted liquidity\\r\\n event Mint(\\r\\n address sender,\\r\\n address indexed owner,\\r\\n int24 indexed bottomTick,\\r\\n int24 indexed topTick,\\r\\n uint128 liquidityAmount,\\r\\n uint256 amount0,\\r\\n uint256 amount1\\r\\n );\\r\\n\\r\\n /// @notice Emitted when fees are collected by the owner of a position\\r\\n /// @param owner The owner of the position for which fees are collected\\r\\n /// @param recipient The address that received fees\\r\\n /// @param bottomTick The lower tick of the position\\r\\n /// @param topTick The upper tick of the position\\r\\n /// @param amount0 The amount of token0 fees collected\\r\\n /// @param amount1 The amount of token1 fees collected\\r\\n event Collect(address indexed owner, address recipient, int24 indexed bottomTick, int24 indexed topTick, uint128 amount0, uint128 amount1);\\r\\n\\r\\n /// @notice Emitted when a position's liquidity is removed\\r\\n /// @dev Does not withdraw any fees earned by the liquidity position, which must be withdrawn via #collect\\r\\n /// @param owner The owner of the position for which liquidity is removed\\r\\n /// @param bottomTick The lower tick of the position\\r\\n /// @param topTick The upper tick of the position\\r\\n /// @param liquidityAmount The amount of liquidity to remove\\r\\n /// @param amount0 The amount of token0 withdrawn\\r\\n /// @param amount1 The amount of token1 withdrawn\\r\\n event Burn(address indexed owner, int24 indexed bottomTick, int24 indexed topTick, uint128 liquidityAmount, uint256 amount0, uint256 amount1);\\r\\n\\r\\n /// @notice Emitted by the pool for any swaps between token0 and token1\\r\\n /// @param sender The address that initiated the swap call, and that received the callback\\r\\n /// @param recipient The address that received the output of the swap\\r\\n /// @param amount0 The delta of the token0 balance of the pool\\r\\n /// @param amount1 The delta of the token1 balance of the pool\\r\\n /// @param price The sqrt(price) of the pool after the swap, as a Q64.96\\r\\n /// @param liquidity The liquidity of the pool after the swap\\r\\n /// @param tick The log base 1.0001 of price of the pool after the swap\\r\\n event Swap(address indexed sender, address indexed recipient, int256 amount0, int256 amount1, uint160 price, uint128 liquidity, int24 tick);\\r\\n\\r\\n /// @notice Emitted by the pool for any flashes of token0/token1\\r\\n /// @param sender The address that initiated the swap call, and that received the callback\\r\\n /// @param recipient The address that received the tokens from flash\\r\\n /// @param amount0 The amount of token0 that was flashed\\r\\n /// @param amount1 The amount of token1 that was flashed\\r\\n /// @param paid0 The amount of token0 paid for the flash, which can exceed the amount0 plus the fee\\r\\n /// @param paid1 The amount of token1 paid for the flash, which can exceed the amount1 plus the fee\\r\\n event Flash(address indexed sender, address indexed recipient, uint256 amount0, uint256 amount1, uint256 paid0, uint256 paid1);\\r\\n\\r\\n /// @notice Emitted when the community fee is changed by the pool\\r\\n /// @param communityFeeNew The updated value of the community fee in thousandths (1e-3)\\r\\n event CommunityFee(uint16 communityFeeNew);\\r\\n\\r\\n /// @notice Emitted when the tick spacing changes\\r\\n /// @param newTickSpacing The updated value of the new tick spacing\\r\\n event TickSpacing(int24 newTickSpacing);\\r\\n\\r\\n /// @notice Emitted when the plugin address changes\\r\\n /// @param newPluginAddress New plugin address\\r\\n event Plugin(address newPluginAddress);\\r\\n\\r\\n /// @notice Emitted when the plugin config changes\\r\\n /// @param newPluginConfig New plugin config\\r\\n event PluginConfig(uint8 newPluginConfig);\\r\\n\\r\\n /// @notice Emitted when the fee changes inside the pool\\r\\n /// @param fee The current fee in hundredths of a bip, i.e. 1e-6\\r\\n event Fee(uint16 fee);\\r\\n\\r\\n event CommunityVault(address newCommunityVault);\\r\\n}\\r\\n\"\r\n },\r\n \"@cryptoalgebra/integral-core/contracts/interfaces/pool/IAlgebraPoolImmutables.sol\": {\r\n \"content\": \"// SPDX-License-Identifier: GPL-2.0-or-later\\r\\npragma solidity \u003E=0.5.0;\\r\\n\\r\\n/// @title Pool state that never changes\\r\\n/// @dev Credit to Uniswap Labs under GPL-2.0-or-later license:\\r\\n/// https://github.com/Uniswap/v3-core/tree/main/contracts/interfaces\\r\\ninterface IAlgebraPoolImmutables {\\r\\n /// @notice The Algebra factory contract, which must adhere to the IAlgebraFactory interface\\r\\n /// @return The contract address\\r\\n function factory() external view returns (address);\\r\\n\\r\\n /// @notice The first of the two tokens of the pool, sorted by address\\r\\n /// @return The token contract address\\r\\n function token0() external view returns (address);\\r\\n\\r\\n /// @notice The second of the two tokens of the pool, sorted by address\\r\\n /// @return The token contract address\\r\\n function token1() external view returns (address);\\r\\n\\r\\n /// @notice The maximum amount of position liquidity that can use any tick in the range\\r\\n /// @dev This parameter is enforced per tick to prevent liquidity from overflowing a uint128 at any point, and\\r\\n /// also prevents out-of-range liquidity from being used to prevent adding in-range liquidity to a pool\\r\\n /// @return The max amount of liquidity per tick\\r\\n function maxLiquidityPerTick() external view returns (uint128);\\r\\n}\\r\\n\"\r\n },\r\n \"@cryptoalgebra/integral-core/contracts/interfaces/pool/IAlgebraPoolPermissionedActions.sol\": {\r\n \"content\": \"// SPDX-License-Identifier: GPL-2.0-or-later\\r\\npragma solidity \u003E=0.5.0;\\r\\n\\r\\n/// @title Permissioned pool actions\\r\\n/// @notice Contains pool methods that may only be called by permissioned addresses\\r\\n/// @dev Credit to Uniswap Labs under GPL-2.0-or-later license:\\r\\n/// https://github.com/Uniswap/v3-core/tree/main/contracts/interfaces\\r\\ninterface IAlgebraPoolPermissionedActions {\\r\\n /// @notice Set the community's % share of the fees. Only factory owner or POOLS_ADMINISTRATOR_ROLE role\\r\\n /// @param newCommunityFee The new community fee percent in thousandths (1e-3)\\r\\n function setCommunityFee(uint16 newCommunityFee) external;\\r\\n\\r\\n /// @notice Set the new tick spacing values. Only factory owner or POOLS_ADMINISTRATOR_ROLE role\\r\\n /// @param newTickSpacing The new tick spacing value\\r\\n function setTickSpacing(int24 newTickSpacing) external;\\r\\n\\r\\n /// @notice Set the new plugin address. Only factory owner or POOLS_ADMINISTRATOR_ROLE role\\r\\n /// @param newPluginAddress The new plugin address\\r\\n function setPlugin(address newPluginAddress) external;\\r\\n\\r\\n /// @notice Set new plugin config. Only factory owner or POOLS_ADMINISTRATOR_ROLE role\\r\\n /// @param newConfig In the new configuration of the plugin,\\r\\n /// each bit of which is responsible for a particular hook.\\r\\n function setPluginConfig(uint8 newConfig) external;\\r\\n\\r\\n /// @notice Set new community fee vault address. Only factory owner or POOLS_ADMINISTRATOR_ROLE role\\r\\n /// @dev Community fee vault receives collected community fees.\\r\\n /// **accumulated but not yet sent to the vault community fees once will be sent to the `newCommunityVault` address**\\r\\n /// @param newCommunityVault The address of new community fee vault\\r\\n function setCommunityVault(address newCommunityVault) external;\\r\\n\\r\\n /// @notice Set new pool fee. Can be called by owner if dynamic fee is disabled.\\r\\n /// Called by the plugin if dynamic fee is enabled\\r\\n /// @param newFee The new fee value\\r\\n function setFee(uint16 newFee) external;\\r\\n}\\r\\n\"\r\n },\r\n \"@cryptoalgebra/integral-core/contracts/interfaces/pool/IAlgebraPoolState.sol\": {\r\n \"content\": \"// SPDX-License-Identifier: GPL-2.0-or-later\\r\\npragma solidity \u003E=0.5.0;\\r\\n\\r\\n/// @title Pool state that can change\\r\\n/// @dev Important security note: when using this data by external contracts, it is necessary to take into account the possibility\\r\\n/// of manipulation (including read-only reentrancy).\\r\\n/// This interface is based on the UniswapV3 interface, credit to Uniswap Labs under GPL-2.0-or-later license:\\r\\n/// https://github.com/Uniswap/v3-core/tree/main/contracts/interfaces\\r\\ninterface IAlgebraPoolState {\\r\\n /// @notice Safely get most important state values of Algebra Integral AMM\\r\\n /// @dev Several values exposed as a single method to save gas when accessed externally.\\r\\n /// **Important security note: this method checks reentrancy lock and should be preferred in most cases**.\\r\\n /// @return sqrtPrice The current price of the pool as a sqrt(dToken1/dToken0) Q64.96 value\\r\\n /// @return tick The current global tick of the pool. May not always be equal to SqrtTickMath.getTickAtSqrtRatio(price) if the price is on a tick boundary\\r\\n /// @return lastFee The current (last known) pool fee value in hundredths of a bip, i.e. 1e-6 (so '100' is '0.01%'). May be obsolete if using dynamic fee plugin\\r\\n /// @return pluginConfig The current plugin config as bitmap. Each bit is responsible for enabling/disabling the hooks, the last bit turns on/off dynamic fees logic\\r\\n /// @return activeLiquidity The currently in-range liquidity available to the pool\\r\\n /// @return nextTick The next initialized tick after current global tick\\r\\n /// @return previousTick The previous initialized tick before (or at) current global tick\\r\\n function safelyGetStateOfAMM()\\r\\n external\\r\\n view\\r\\n returns (uint160 sqrtPrice, int24 tick, uint16 lastFee, uint8 pluginConfig, uint128 activeLiquidity, int24 nextTick, int24 previousTick);\\r\\n\\r\\n /// @notice Allows to easily get current reentrancy lock status\\r\\n /// @dev can be used to prevent read-only reentrancy.\\r\\n /// This method just returns `globalState.unlocked` value\\r\\n /// @return unlocked Reentrancy lock flag, true if the pool currently is unlocked, otherwise - false\\r\\n function isUnlocked() external view returns (bool unlocked);\\r\\n\\r\\n // ! IMPORTANT security note: the pool state can be manipulated.\\r\\n // ! The following methods do not check reentrancy lock themselves.\\r\\n\\r\\n /// @notice The globalState structure in the pool stores many values but requires only one slot\\r\\n /// and is exposed as a single method to save gas when accessed externally.\\r\\n /// @dev **important security note: caller should check `unlocked` flag to prevent read-only reentrancy**\\r\\n /// @return price The current price of the pool as a sqrt(dToken1/dToken0) Q64.96 value\\r\\n /// @return tick The current tick of the pool, i.e. according to the last tick transition that was run\\r\\n /// This value may not always be equal to SqrtTickMath.getTickAtSqrtRatio(price) if the price is on a tick boundary\\r\\n /// @return lastFee The current (last known) pool fee value in hundredths of a bip, i.e. 1e-6 (so '100' is '0.01%'). May be obsolete if using dynamic fee plugin\\r\\n /// @return pluginConfig The current plugin config as bitmap. Each bit is responsible for enabling/disabling the hooks, the last bit turns on/off dynamic fees logic\\r\\n /// @return communityFee The community fee represented as a percent of all collected fee in thousandths, i.e. 1e-3 (so 100 is 10%)\\r\\n /// @return unlocked Reentrancy lock flag, true if the pool currently is unlocked, otherwise - false\\r\\n function globalState() external view returns (uint160 price, int24 tick, uint16 lastFee, uint8 pluginConfig, uint16 communityFee, bool unlocked);\\r\\n\\r\\n /// @notice Look up information about a specific tick in the pool\\r\\n /// @dev **important security note: caller should check reentrancy lock to prevent read-only reentrancy**\\r\\n /// @param tick The tick to look up\\r\\n /// @return liquidityTotal The total amount of position liquidity that uses the pool either as tick lower or tick upper\\r\\n /// @return liquidityDelta How much liquidity changes when the pool price crosses the tick\\r\\n /// @return prevTick The previous tick in tick list\\r\\n /// @return nextTick The next tick in tick list\\r\\n /// @return outerFeeGrowth0Token The fee growth on the other side of the tick from the current tick in token0\\r\\n /// @return outerFeeGrowth1Token The fee growth on the other side of the tick from the current tick in token1\\r\\n /// In addition, these values are only relative and must be used only in comparison to previous snapshots for\\r\\n /// a specific position.\\r\\n function ticks(\\r\\n int24 tick\\r\\n )\\r\\n external\\r\\n view\\r\\n returns (\\r\\n uint256 liquidityTotal,\\r\\n int128 liquidityDelta,\\r\\n int24 prevTick,\\r\\n int24 nextTick,\\r\\n uint256 outerFeeGrowth0Token,\\r\\n uint256 outerFeeGrowth1Token\\r\\n );\\r\\n\\r\\n /// @notice The timestamp of the last sending of tokens to community vault\\r\\n /// @return The timestamp truncated to 32 bits\\r\\n function communityFeeLastTimestamp() external view returns (uint32);\\r\\n\\r\\n /// @notice The amounts of token0 and token1 that will be sent to the vault\\r\\n /// @dev Will be sent COMMUNITY_FEE_TRANSFER_FREQUENCY after communityFeeLastTimestamp\\r\\n /// @return communityFeePending0 The amount of token0 that will be sent to the vault\\r\\n /// @return communityFeePending1 The amount of token1 that will be sent to the vault\\r\\n function getCommunityFeePending() external view returns (uint128 communityFeePending0, uint128 communityFeePending1);\\r\\n\\r\\n /// @notice Returns the address of currently used plugin\\r\\n /// @dev The plugin is subject to change\\r\\n /// @return pluginAddress The address of currently used plugin\\r\\n function plugin() external view returns (address pluginAddress);\\r\\n\\r\\n /// @notice The contract to which community fees are transferred\\r\\n /// @return communityVaultAddress The communityVault address\\r\\n function communityVault() external view returns (address communityVaultAddress);\\r\\n\\r\\n /// @notice Returns 256 packed tick initialized boolean values. See TickTree for more information\\r\\n /// @param wordPosition Index of 256-bits word with ticks\\r\\n /// @return The 256-bits word with packed ticks info\\r\\n function tickTable(int16 wordPosition) external view returns (uint256);\\r\\n\\r\\n /// @notice The fee growth as a Q128.128 fees of token0 collected per unit of liquidity for the entire life of the pool\\r\\n /// @dev This value can overflow the uint256\\r\\n /// @return The fee growth accumulator for token0\\r\\n function totalFeeGrowth0Token() external view returns (uint256);\\r\\n\\r\\n /// @notice The fee growth as a Q128.128 fees of token1 collected per unit of liquidity for the entire life of the pool\\r\\n /// @dev This value can overflow the uint256\\r\\n /// @return The fee growth accumulator for token1\\r\\n function totalFeeGrowth1Token() external view returns (uint256);\\r\\n\\r\\n /// @notice The current pool fee value\\r\\n /// @dev In case dynamic fee is enabled in the pool, this method will call the plugin to get the current fee.\\r\\n /// If the plugin implements complex fee logic, this method may return an incorrect value or revert.\\r\\n /// In this case, see the plugin implementation and related documentation.\\r\\n /// @dev **important security note: caller should check reentrancy lock to prevent read-only reentrancy**\\r\\n /// @return currentFee The current pool fee value in hundredths of a bip, i.e. 1e-6\\r\\n function fee() external view returns (uint16 currentFee);\\r\\n\\r\\n /// @notice The tracked token0 and token1 reserves of pool\\r\\n /// @dev If at any time the real balance is larger, the excess will be transferred to liquidity providers as additional fee.\\r\\n /// If the balance exceeds uint128, the excess will be sent to the communityVault.\\r\\n /// @return reserve0 The last known reserve of token0\\r\\n /// @return reserve1 The last known reserve of token1\\r\\n function getReserves() external view returns (uint128 reserve0, uint128 reserve1);\\r\\n\\r\\n /// @notice Returns the information about a position by the position's key\\r\\n /// @dev **important security note: caller should check reentrancy lock to prevent read-only reentrancy**\\r\\n /// @param key The position's key is a packed concatenation of the owner address, bottomTick and topTick indexes\\r\\n /// @return liquidity The amount of liquidity in the position\\r\\n /// @return innerFeeGrowth0Token Fee growth of token0 inside the tick range as of the last mint/burn/poke\\r\\n /// @return innerFeeGrowth1Token Fee growth of token1 inside the tick range as of the last mint/burn/poke\\r\\n /// @return fees0 The computed amount of token0 owed to the position as of the last mint/burn/poke\\r\\n /// @return fees1 The computed amount of token1 owed to the position as of the last mint/burn/poke\\r\\n function positions(\\r\\n bytes32 key\\r\\n ) external view returns (uint256 liquidity, uint256 innerFeeGrowth0Token, uint256 innerFeeGrowth1Token, uint128 fees0, uint128 fees1);\\r\\n\\r\\n /// @notice The currently in range liquidity available to the pool\\r\\n /// @dev This value has no relationship to the total liquidity across all ticks.\\r\\n /// Returned value cannot exceed type(uint128).max\\r\\n /// @dev **important security note: caller should check reentrancy lock to prevent read-only reentrancy**\\r\\n /// @return The current in range liquidity\\r\\n function liquidity() external view returns (uint128);\\r\\n\\r\\n /// @notice The current tick spacing\\r\\n /// @dev Ticks can only be initialized by new mints at multiples of this value\\r\\n /// e.g.: a tickSpacing of 60 means ticks can be initialized every 60th tick, i.e., ..., -120, -60, 0, 60, 120, ...\\r\\n /// However, tickspacing can be changed after the ticks have been initialized.\\r\\n /// This value is an int24 to avoid casting even though it is always positive.\\r\\n /// @return The current tick spacing\\r\\n function tickSpacing() external view returns (int24);\\r\\n\\r\\n /// @notice The previous initialized tick before (or at) current global tick\\r\\n /// @dev **important security note: caller should check reentrancy lock to prevent read-only reentrancy**\\r\\n /// @return The previous initialized tick\\r\\n function prevTickGlobal() external view returns (int24);\\r\\n\\r\\n /// @notice The next initialized tick after current global tick\\r\\n /// @dev **important security note: caller should check reentrancy lock to prevent read-only reentrancy**\\r\\n /// @return The next initialized tick\\r\\n function nextTickGlobal() external view returns (int24);\\r\\n\\r\\n /// @notice The root of tick search tree\\r\\n /// @dev Each bit corresponds to one node in the second layer of tick tree: '1' if node has at least one active bit.\\r\\n /// **important security note: caller should check reentrancy lock to prevent read-only reentrancy**\\r\\n /// @return The root of tick search tree as bitmap\\r\\n function tickTreeRoot() external view returns (uint32);\\r\\n\\r\\n /// @notice The second layer of tick search tree\\r\\n /// @dev Each bit in node corresponds to one node in the leafs layer (`tickTable`) of tick tree: '1' if leaf has at least one active bit.\\r\\n /// **important security note: caller should check reentrancy lock to prevent read-only reentrancy**\\r\\n /// @return The node of tick search tree second layer\\r\\n function tickTreeSecondLayer(int16) external view returns (uint256);\\r\\n}\\r\\n\"\r\n },\r\n \"@cryptoalgebra/integral-core/contracts/interfaces/vault/IAlgebraVaultFactory.sol\": {\r\n \"content\": \"// SPDX-License-Identifier: GPL-2.0-or-later\\r\\npragma solidity \u003E=0.5.0;\\r\\n\\r\\n/// @title The interface for the Algebra Vault Factory\\r\\n/// @notice This contract can be used for automatic vaults creation\\r\\n/// @dev Version: Algebra Integral\\r\\ninterface IAlgebraVaultFactory {\\r\\n /// @notice returns address of the community fee vault for the pool\\r\\n /// @param pool the address of Algebra Integral pool\\r\\n /// @return communityFeeVault the address of community fee vault\\r\\n function getVaultForPool(address pool) external view returns (address communityFeeVault);\\r\\n\\r\\n /// @notice creates the community fee vault for the pool if needed\\r\\n /// @param pool the address of Algebra Integral pool\\r\\n /// @return communityFeeVault the address of community fee vault\\r\\n function createVaultForPool(address pool) external returns (address communityFeeVault);\\r\\n}\\r\\n\"\r\n },\r\n \"@cryptoalgebra/integral-core/contracts/libraries/Constants.sol\": {\r\n \"content\": \"// SPDX-License-Identifier: GPL-2.0-or-later\\r\\npragma solidity \u003E=0.5.0 \u003C0.9.0;\\r\\n\\r\\n/// @title Contains common constants for Algebra contracts\\r\\n/// @dev Constants moved to the library, not the base contract, to further emphasize their constant nature\\r\\nlibrary Constants {\\r\\n uint8 internal constant RESOLUTION = 96;\\r\\n uint256 internal constant Q96 = 1 \u003C\u003C 96;\\r\\n uint256 internal constant Q128 = 1 \u003C\u003C 128;\\r\\n\\r\\n uint24 internal constant FEE_DENOMINATOR = 1e6;\\r\\n uint16 internal constant FLASH_FEE = 0.01e4; // fee for flash loan in hundredths of a bip (0.01%)\\r\\n uint16 internal constant INIT_DEFAULT_FEE = 0.05e4; // init default fee value in hundredths of a bip (0.05%)\\r\\n uint16 internal constant MAX_DEFAULT_FEE = 5e4; // max default fee value in hundredths of a bip (5%)\\r\\n\\r\\n int24 internal constant INIT_DEFAULT_TICK_SPACING = 60;\\r\\n int24 internal constant MAX_TICK_SPACING = 500;\\r\\n int24 internal constant MIN_TICK_SPACING = 1;\\r\\n\\r\\n // the frequency with which the accumulated community fees are sent to the vault\\r\\n uint32 internal constant COMMUNITY_FEE_TRANSFER_FREQUENCY = 8 hours;\\r\\n\\r\\n // max(uint128) / (MAX_TICK - MIN_TICK)\\r\\n uint128 internal constant MAX_LIQUIDITY_PER_TICK = 191757638537527648490752896198553;\\r\\n\\r\\n uint16 internal constant MAX_COMMUNITY_FEE = 1e3; // 100%\\r\\n uint256 internal constant COMMUNITY_FEE_DENOMINATOR = 1e3;\\r\\n // role that can change settings in pools\\r\\n bytes32 internal constant POOLS_ADMINISTRATOR_ROLE = keccak256('POOLS_ADMINISTRATOR');\\r\\n}\\r\\n\"\r\n },\r\n \"@cryptoalgebra/integral-core/contracts/libraries/FullMath.sol\": {\r\n \"content\": \"// SPDX-License-Identifier: MIT\\r\\npragma solidity ^0.8.0;\\r\\n\\r\\n/// @title Contains 512-bit math functions\\r\\n/// @notice Facilitates multiplication and division that can have overflow of an intermediate value without any loss of precision\\r\\n/// @dev Handles \\\"phantom overflow\\\" i.e., allows multiplication and division where an intermediate value overflows 256 bits\\r\\nlibrary FullMath {\\r\\n /// @notice Calculates floor(a×b÷denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\\r\\n /// @param a The multiplicand\\r\\n /// @param b The multiplier\\r\\n /// @param denominator The divisor\\r\\n /// @return result The 256-bit result\\r\\n /// @dev Credit to Remco Bloemen under MIT license https://xn--2-umb.com/21/muldiv\\r\\n function mulDiv(uint256 a, uint256 b, uint256 denominator) internal pure returns (uint256 result) {\\r\\n unchecked {\\r\\n // 512-bit multiply [prod1 prod0] = a * b\\r\\n // Compute the product mod 2**256 and mod 2**256 - 1\\r\\n // then use the Chinese Remainder Theorem to reconstruct\\r\\n // the 512 bit result. The result is stored in two 256\\r\\n // variables such that product = prod1 * 2**256 + prod0\\r\\n uint256 prod0 = a * b; // Least significant 256 bits of the product\\r\\n uint256 prod1; // Most significant 256 bits of the product\\r\\n assembly {\\r\\n let mm := mulmod(a, b, not(0))\\r\\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\\r\\n }\\r\\n\\r\\n // Make sure the result is less than 2**256.\\r\\n // Also prevents denominator == 0\\r\\n require(denominator \u003E prod1);\\r\\n\\r\\n // Handle non-overflow cases, 256 by 256 division\\r\\n if (prod1 == 0) {\\r\\n assembly {\\r\\n result := div(prod0, denominator)\\r\\n }\\r\\n return result;\\r\\n }\\r\\n\\r\\n ///////////////////////////////////////////////\\r\\n // 512 by 256 division.\\r\\n ///////////////////////////////////////////////\\r\\n\\r\\n // Make division exact by subtracting the remainder from [prod1 prod0]\\r\\n // Compute remainder using mulmod\\r\\n // Subtract 256 bit remainder from 512 bit number\\r\\n assembly {\\r\\n let remainder := mulmod(a, b, denominator)\\r\\n prod1 := sub(prod1, gt(remainder, prod0))\\r\\n prod0 := sub(prod0, remainder)\\r\\n }\\r\\n\\r\\n // Factor powers of two out of denominator\\r\\n // Compute largest power of two divisor of denominator.\\r\\n // Always \u003E= 1.\\r\\n uint256 twos = (0 - denominator) & denominator;\\r\\n // Divide denominator by power of two\\r\\n assembly {\\r\\n denominator := div(denominator, twos)\\r\\n }\\r\\n\\r\\n // Divide [prod1 prod0] by the factors of two\\r\\n assembly {\\r\\n prod0 := div(prod0, twos)\\r\\n }\\r\\n // Shift in bits from prod1 into prod0. For this we need\\r\\n // to flip `twos` such that it is 2**256 / twos.\\r\\n // If twos is zero, then it becomes one\\r\\n assembly {\\r\\n twos := add(div(sub(0, twos), twos), 1)\\r\\n }\\r\\n prod0 |= prod1 * twos;\\r\\n\\r\\n // Invert denominator mod 2**256\\r\\n // Now that denominator is an odd number, it has an inverse\\r\\n // modulo 2**256 such that denominator * inv = 1 mod 2**256.\\r\\n // Compute the inverse by starting with a seed that is correct\\r\\n // correct for four bits. That is, denominator * inv = 1 mod 2**4\\r\\n uint256 inv = (3 * denominator) ^ 2;\\r\\n // Now use Newton-Raphson iteration to improve the precision.\\r\\n // Thanks to Hensel's lifting lemma, this also works in modular\\r\\n // arithmetic, doubling the correct bits in each step.\\r\\n inv *= 2 - denominator * inv; // inverse mod 2**8\\r\\n inv *= 2 - denominator * inv; // inverse mod 2**16\\r\\n inv *= 2 - denominator * inv; // inverse mod 2**32\\r\\n inv *= 2 - denominator * inv; // inverse mod 2**64\\r\\n inv *= 2 - denominator * inv; // inverse mod 2**128\\r\\n inv *= 2 - denominator * inv; // inverse mod 2**256\\r\\n\\r\\n // Because the division is now exact we can divide by multiplying\\r\\n // with the modular inverse of denominator. This will give us the\\r\\n // correct result modulo 2**256. Since the preconditions guarantee\\r\\n // that the outcome is less than 2**256, this is the final result.\\r\\n // We don't need to compute the high bits of the result and prod1\\r\\n // is no longer required.\\r\\n result = prod0 * inv;\\r\\n return result;\\r\\n }\\r\\n }\\r\\n\\r\\n /// @notice Calculates ceil(a×b÷denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\\r\\n /// @param a The multiplicand\\r\\n /// @param b The multiplier\\r\\n /// @param denominator The divisor\\r\\n /// @return result The 256-bit result\\r\\n function mulDivRoundingUp(uint256 a, uint256 b, uint256 denominator) internal pure returns (uint256 result) {\\r\\n unchecked {\\r\\n if (a == 0 || ((result = a * b) / a == b)) {\\r\\n require(denominator \u003E 0);\\r\\n assembly {\\r\\n result := add(div(result, denominator), gt(mod(result, denominator), 0))\\r\\n }\\r\\n } else {\\r\\n result = mulDiv(a, b, denominator);\\r\\n if (mulmod(a, b, denominator) \u003E 0) {\\r\\n require(result \u003C type(uint256).max);\\r\\n result++;\\r\\n }\\r\\n }\\r\\n }\\r\\n }\\r\\n\\r\\n /// @notice Returns ceil(x / y)\\r\\n /// @dev division by 0 has unspecified behavior, and must be checked externally\\r\\n /// @param x The dividend\\r\\n /// @param y The divisor\\r\\n /// @return z The quotient, ceil(x / y)\\r\\n function unsafeDivRoundingUp(uint256 x, uint256 y) internal pure returns (uint256 z) {\\r\\n assembly {\\r\\n z := add(div(x, y), gt(mod(x, y), 0))\\r\\n }\\r\\n }\\r\\n}\\r\\n\"\r\n },\r\n \"@cryptoalgebra/integral-core/contracts/libraries/TickMath.sol\": {\r\n \"content\": \"// SPDX-License-Identifier: GPL-2.0-or-later\\r\\npragma solidity \u003E=0.8.4 \u003C0.9.0;\\r\\n\\r\\nimport '../interfaces/pool/IAlgebraPoolErrors.sol';\\r\\n\\r\\n/// @title Math library for computing sqrt prices from ticks and vice versa\\r\\n/// @notice Computes sqrt price for ticks of size 1.0001, i.e. sqrt(1.0001^tick) as fixed point Q64.96 numbers. Supports\\r\\n/// prices between 2**-128 and 2**128\\r\\n/// @dev Credit to Uniswap Labs under GPL-2.0-or-later license:\\r\\n/// https://github.com/Uniswap/v3-core/blob/main/contracts/libraries\\r\\nlibrary TickMath {\\r\\n /// @dev The minimum tick that may be passed to #getSqrtRatioAtTick computed from log base 1.0001 of 2**-128\\r\\n int24 internal constant MIN_TICK = -887272;\\r\\n /// @dev The maximum tick that may be passed to #getSqrtRatioAtTick computed from log base 1.0001 of 2**128\\r\\n int24 internal constant MAX_TICK = -MIN_TICK;\\r\\n\\r\\n /// @dev The minimum value that can be returned from #getSqrtRatioAtTick. Equivalent to getSqrtRatioAtTick(MIN_TICK)\\r\\n uint160 internal constant MIN_SQRT_RATIO = 4295128739;\\r\\n /// @dev The maximum value that can be returned from #getSqrtRatioAtTick. Equivalent to getSqrtRatioAtTick(MAX_TICK)\\r\\n uint160 internal constant MAX_SQRT_RATIO = 1461446703485210103287273052203988822378723970342;\\r\\n\\r\\n /// @notice Calculates sqrt(1.0001^tick) * 2^96\\r\\n /// @dev Throws if |tick| \u003E max tick\\r\\n /// @param tick The input tick for the above formula\\r\\n /// @return price A Fixed point Q64.96 number representing the sqrt of the ratio of the two assets (token1/token0)\\r\\n /// at the given tick\\r\\n function getSqrtRatioAtTick(int24 tick) internal pure returns (uint160 price) {\\r\\n unchecked {\\r\\n // get abs value\\r\\n int24 absTickMask = tick \u003E\u003E (24 - 1);\\r\\n uint256 absTick = uint24((tick + absTickMask) ^ absTickMask);\\r\\n if (absTick \u003E uint24(MAX_TICK)) revert IAlgebraPoolErrors.tickOutOfRange();\\r\\n\\r\\n uint256 ratio = 0x100000000000000000000000000000000;\\r\\n if (absTick & 0x1 != 0) ratio = 0xfffcb933bd6fad37aa2d162d1a594001;\\r\\n if (absTick & 0x2 != 0) ratio = (ratio * 0xfff97272373d413259a46990580e213a) \u003E\u003E 128;\\r\\n if (absTick & 0x4 != 0) ratio = (ratio * 0xfff2e50f5f656932ef12357cf3c7fdcc) \u003E\u003E 128;\\r\\n if (absTick & 0x8 != 0) ratio = (ratio * 0xffe5caca7e10e4e61c3624eaa0941cd0) \u003E\u003E 128;\\r\\n if (absTick & 0x10 != 0) ratio = (ratio * 0xffcb9843d60f6159c9db58835c926644) \u003E\u003E 128;\\r\\n if (absTick & 0x20 != 0) ratio = (ratio * 0xff973b41fa98c081472e6896dfb254c0) \u003E\u003E 128;\\r\\n if (absTick & 0x40 != 0) ratio = (ratio * 0xff2ea16466c96a3843ec78b326b52861) \u003E\u003E 128;\\r\\n if (absTick & 0x80 != 0) ratio = (ratio * 0xfe5dee046a99a2a811c461f1969c3053) \u003E\u003E 128;\\r\\n if (absTick & 0x100 != 0) ratio = (ratio * 0xfcbe86c7900a88aedcffc83b479aa3a4) \u003E\u003E 128;\\r\\n if (absTick & 0x200 != 0) ratio = (ratio * 0xf987a7253ac413176f2b074cf7815e54) \u003E\u003E 128;\\r\\n if (absTick & 0x400 != 0) ratio = (ratio * 0xf3392b0822b70005940c7a398e4b70f3) \u003E\u003E 128;\\r\\n if (absTick & 0x800 != 0) ratio = (ratio * 0xe7159475a2c29b7443b29c7fa6e889d9) \u003E\u003E 128;\\r\\n if (absTick & 0x1000 != 0) ratio = (ratio * 0xd097f3bdfd2022b8845ad8f792aa5825) \u003E\u003E 128;\\r\\n if (absTick & 0x2000 != 0) ratio = (ratio * 0xa9f746462d870fdf8a65dc1f90e061e5) \u003E\u003E 128;\\r\\n if (absTick & 0x4000 != 0) ratio = (ratio * 0x70d869a156d2a1b890bb3df62baf32f7) \u003E\u003E 128;\\r\\n if (absTick & 0x8000 != 0) ratio = (ratio * 0x31be135f97d08fd981231505542fcfa6) \u003E\u003E 128;\\r\\n if (absTick & 0x10000 != 0) ratio = (ratio * 0x9aa508b5b7a84e1c677de54f3e99bc9) \u003E\u003E 128;\\r\\n if (absTick & 0x20000 != 0) ratio = (ratio * 0x5d6af8dedb81196699c329225ee604) \u003E\u003E 128;\\r\\n if (absTick \u003E= 0x40000) {\\r\\n if (absTick & 0x40000 != 0) ratio = (ratio * 0x2216e584f5fa1ea926041bedfe98) \u003E\u003E 128;\\r\\n if (absTick & 0x80000 != 0) ratio = (ratio * 0x48a170391f7dc42444e8fa2) \u003E\u003E 128;\\r\\n }\\r\\n\\r\\n if (tick \u003E 0) {\\r\\n assembly {\\r\\n ratio := div(not(0), ratio)\\r\\n }\\r\\n }\\r\\n\\r\\n // this divides by 1\u003C\u003C32 rounding up to go from a Q128.128 to a Q128.96.\\r\\n // we then downcast because we know the result always fits within 160 bits due to our tick input constraint\\r\\n // we round up in the division so getTickAtSqrtRatio of the output price is always consistent\\r\\n price = uint160((ratio + 0xFFFFFFFF) \u003E\u003E 32);\\r\\n }\\r\\n }\\r\\n\\r\\n /// @notice Calculates the greatest tick value such that getRatioAtTick(tick) \u003C= ratio\\r\\n /// @dev Throws in case price \u003C MIN_SQRT_RATIO, as MIN_SQRT_RATIO is the lowest value getRatioAtTick may\\r\\n /// ever return.\\r\\n /// @param price The sqrt ratio for which to compute the tick as a Q64.96\\r\\n /// @return tick The greatest tick for which the ratio is less than or equal to the input ratio\\r\\n function getTickAtSqrtRatio(uint160 price) internal pure returns (int24 tick) {\\r\\n unchecked {\\r\\n // second inequality must be \u003E= because the price can never reach the price at the max tick\\r\\n if (price \u003C MIN_SQRT_RATIO || price \u003E= MAX_SQRT_RATIO) revert IAlgebraPoolErrors.priceOutOfRange();\\r\\n uint256 ratio = uint256(price) \u003C\u003C 32;\\r\\n\\r\\n uint256 r = ratio;\\r\\n uint256 msb;\\r\\n\\r\\n assembly {\\r\\n let f := shl(7, gt(r, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF))\\r\\n msb := or(msb, f)\\r\\n r := shr(f, r)\\r\\n }\\r\\n assembly {\\r\\n let f := shl(6, gt(r, 0xFFFFFFFFFFFFFFFF))\\r\\n msb := or(msb, f)\\r\\n r := shr(f, r)\\r\\n }\\r\\n assembly {\\r\\n let f := shl(5, gt(r, 0xFFFFFFFF))\\r\\n msb := or(msb, f)\\r\\n r := shr(f, r)\\r\\n }\\r\\n assembly {\\r\\n let f := shl(4, gt(r, 0xFFFF))\\r\\n msb := or(msb, f)\\r\\n r := shr(f, r)\\r\\n }\\r\\n assembly {\\r\\n let f := shl(3, gt(r, 0xFF))\\r\\n msb := or(msb, f)\\r\\n r := shr(f, r)\\r\\n }\\r\\n assembly {\\r\\n let f := shl(2, gt(r, 0xF))\\r\\n msb := or(msb, f)\\r\\n r := shr(f, r)\\r\\n }\\r\\n assembly {\\r\\n let f := shl(1, gt(r, 0x3))\\r\\n msb := or(msb, f)\\r\\n r := shr(f, r)\\r\\n }\\r\\n assembly {\\r\\n let f := gt(r, 0x1)\\r\\n msb := or(msb, f)\\r\\n }\\r\\n\\r\\n if (msb \u003E= 128) r = ratio \u003E\u003E (msb - 127);\\r\\n else r = ratio \u003C\u003C (127 - msb);\\r\\n\\r\\n int256 log_2 = (int256(msb) - 128) \u003C\u003C 64;\\r\\n\\r\\n assembly {\\r\\n r := shr(127, mul(r, r))\\r\\n let f := shr(128, r)\\r\\n log_2 := or(log_2, shl(63, f))\\r\\n r := shr(f, r)\\r\\n }\\r\\n assembly {\\r\\n r := shr(127, mul(r, r))\\r\\n let f := shr(128, r)\\r\\n log_2 := or(log_2, shl(62, f))\\r\\n r := shr(f, r)\\r\\n }\\r\\n assembly {\\r\\n r := shr(127, mul(r, r))\\r\\n let f := shr(128, r)\\r\\n log_2 := or(log_2, shl(61, f))\\r\\n r := shr(f, r)\\r\\n }\\r\\n assembly {\\r\\n r := shr(127, mul(r, r))\\r\\n let f := shr(128, r)\\r\\n log_2 := or(log_2, shl(60, f))\\r\\n r := shr(f, r)\\r\\n }\\r\\n assembly {\\r\\n r := shr(127, mul(r, r))\\r\\n let f := shr(128, r)\\r\\n log_2 := or(log_2, shl(59, f))\\r\\n r := shr(f, r)\\r\\n }\\r\\n assembly {\\r\\n r := shr(127, mul(r, r))\\r\\n let f := shr(128, r)\\r\\n log_2 := or(log_2, shl(58, f))\\r\\n r := shr(f, r)\\r\\n }\\r\\n assembly {\\r\\n r := shr(127, mul(r, r))\\r\\n let f := shr(128, r)\\r\\n log_2 := or(log_2, shl(57, f))\\r\\n r := shr(f, r)\\r\\n }\\r\\n assembly {\\r\\n r := shr(127, mul(r, r))\\r\\n let f := shr(128, r)\\r\\n log_2 := or(log_2, shl(56, f))\\r\\n r := shr(f, r)\\r\\n }\\r\\n assembly {\\r\\n r := shr(127, mul(r, r))\\r\\n let f := shr(128, r)\\r\\n log_2 := or(log_2, shl(55, f))\\r\\n r := shr(f, r)\\r\\n }\\r\\n assembly {\\r\\n r := shr(127, mul(r, r))\\r\\n let f := shr(128, r)\\r\\n log_2 := or(log_2, shl(54, f))\\r\\n r := shr(f, r)\\r\\n }\\r\\n assembly {\\r\\n r := shr(127, mul(r, r))\\r\\n let f := shr(128, r)\\r\\n log_2 := or(log_2, shl(53, f))\\r\\n r := shr(f, r)\\r\\n }\\r\\n assembly {\\r\\n r := shr(127, mul(r, r))\\r\\n let f := shr(128, r)\\r\\n log_2 := or(log_2, shl(52, f))\\r\\n r := shr(f, r)\\r\\n }\\r\\n assembly {\\r\\n r := shr(127, mul(r, r))\\r\\n let f := shr(128, r)\\r\\n log_2 := or(log_2, shl(51, f))\\r\\n r := shr(f, r)\\r\\n }\\r\\n assembly {\\r\\n r := shr(127, mul(r, r))\\r\\n let f := shr(128, r)\\r\\n log_2 := or(log_2, shl(50, f))\\r\\n }\\r\\n\\r\\n int256 log_sqrt10001 = log_2 * 255738958999603826347141; // 128.128 number\\r\\n\\r\\n int24 tickLow = int24((log_sqrt10001 - 3402992956809132418596140100660247210) \u003E\u003E 128);\\r\\n int24 tickHi = int24((log_sqrt10001 + 291339464771989622907027621153398088495) \u003E\u003E 128);\\r\\n\\r\\n tick = tickLow == tickHi ? tickLow : getSqrtRatioAtTick(tickHi) \u003C= price ? tickHi : tickLow;\\r\\n }\\r\\n }\\r\\n}\\r\\n\"\r\n },\r\n \"@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol\": {\r\n \"content\": \"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/extensions/draft-IERC20Permit.sol)\\n\\npragma solidity ^0.8.0;\\n\\n// EIP-2612 is Final as of 2022-11-01. This file is deprecated.\\n\\nimport \\\"./IERC20Permit.sol\\\";\\n\"\r\n },\r\n \"@openzeppelin/contracts/token/ERC20/extensions/IERC20Permit.sol\": {\r\n \"content\": \"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/extensions/IERC20Permit.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\\n *\\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\\n * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't\\n * need to send a transaction, and thus is not required to hold Ether at all.\\n */\\ninterface IERC20Permit {\\n /**\\n * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,\\n * given ``owner``'s signed approval.\\n *\\n * IMPORTANT: The same issues {IERC20-approve} has related to transaction\\n * ordering also apply here.\\n *\\n * Emits an {Approval} event.\\n *\\n * Requirements:\\n *\\n * - `spender` cannot be the zero address.\\n * - `deadline` must be a timestamp in the future.\\n * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`\\n * over the EIP712-formatted function arguments.\\n * - the signature must use ``owner``'s current nonce (see {nonces}).\\n *\\n * For more information on the signature format, see the\\n * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP\\n * section].\\n */\\n function permit(\\n address owner,\\n address spender,\\n uint256 value,\\n uint256 deadline,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) external;\\n\\n /**\\n * @dev Returns the current nonce for `owner`. This value must be\\n * included whenever a signature is generated for {permit}.\\n *\\n * Every successful call to {permit} increases ``owner``'s nonce by one. This\\n * prevents a signature from being used multiple times.\\n */\\n function nonces(address owner) external view returns (uint256);\\n\\n /**\\n * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.\\n */\\n // solhint-disable-next-line func-name-mixedcase\\n function DOMAIN_SEPARATOR() external view returns (bytes32);\\n}\\n\"\r\n },\r\n \"@openzeppelin/contracts/token/ERC20/IERC20.sol\": {\r\n \"content\": \"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `from` to `to` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(address from, address to, uint256 amount) external returns (bool);\\n}\\n\"\r\n },\r\n \"@openzeppelin/contracts/token/ERC721/ERC721.sol\": {\r\n \"content\": \"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC721/ERC721.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IERC721.sol\\\";\\nimport \\\"./IERC721Receiver.sol\\\";\\nimport \\\"./extensions/IERC721Metadata.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\nimport \\\"../../utils/Context.sol\\\";\\nimport \\\"../../utils/Strings.sol\\\";\\nimport \\\"../../utils/introspection/ERC165.sol\\\";\\n\\n/**\\n * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including\\n * the Metadata extension, but not including the Enumerable extension, which is available separately as\\n * {ERC721Enumerable}.\\n */\\ncontract ERC721 is Context, ERC165, IERC721, IERC721Metadata {\\n using Address for address;\\n using Strings for uint256;\\n\\n // Token name\\n string private _name;\\n\\n // Token symbol\\n string private _symbol;\\n\\n // Mapping from token ID to owner address\\n mapping(uint256 =\u003E address) private _owners;\\n\\n // Mapping owner address to token count\\n mapping(address =\u003E uint256) private _balances;\\n\\n // Mapping from token ID to approved address\\n mapping(uint256 =\u003E address) private _tokenApprovals;\\n\\n // Mapping from owner to operator approvals\\n mapping(address =\u003E mapping(address =\u003E bool)) private _operatorApprovals;\\n\\n /**\\n * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection.\\n */\\n constructor(string memory name_, string memory symbol_) {\\n _name = name_;\\n _symbol = symbol_;\\n }\\n\\n /**\\n * @dev See {IERC165-supportsInterface}.\\n */\\n function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {\\n return\\n interfaceId == type(IERC721).interfaceId ||\\n interfaceId == type(IERC721Metadata).interfaceId ||\\n super.supportsInterface(interfaceId);\\n }\\n\\n /**\\n * @dev See {IERC721-balanceOf}.\\n */\\n function balanceOf(address owner) public view virtual override returns (uint256) {\\n require(owner != address(0), \\\"ERC721: address zero is not a valid owner\\\");\\n return _balances[owner];\\n }\\n\\n /**\\n * @dev See {IERC721-ownerOf}.\\n */\\n function ownerOf(uint256 tokenId) public view virtual override returns (address) {\\n address owner = _ownerOf(tokenId);\\n require(owner != address(0), \\\"ERC721: invalid token ID\\\");\\n return owner;\\n }\\n\\n /**\\n * @dev See {IERC721Metadata-name}.\\n */\\n function name() public view virtual override returns (string memory) {\\n return _name;\\n }\\n\\n /**\\n * @dev See {IERC721Metadata-symbol}.\\n */\\n function symbol() public view virtual override returns (string memory) {\\n return _symbol;\\n }\\n\\n /**\\n * @dev See {IERC721Metadata-tokenURI}.\\n */\\n function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {\\n _requireMinted(tokenId);\\n\\n string memory baseURI = _baseURI();\\n return bytes(baseURI).length \u003E 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : \\\"\\\";\\n }\\n\\n /**\\n * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each\\n * token will be the concatenation of the `baseURI` and the `tokenId`. Empty\\n * by default, can be overridden in child contracts.\\n */\\n function _baseURI() internal view virtual returns (string memory) {\\n return \\\"\\\";\\n }\\n\\n /**\\n * @dev See {IERC721-approve}.\\n */\\n function approve(address to, uint256 tokenId) public virtual override {\\n address owner = ERC721.ownerOf(tokenId);\\n require(to != owner, \\\"ERC721: approval to current owner\\\");\\n\\n require(\\n _msgSender() == owner || isApprovedForAll(owner, _msgSender()),\\n \\\"ERC721: approve caller is not token owner or approved for all\\\"\\n );\\n\\n _approve(to, tokenId);\\n }\\n\\n /**\\n * @dev See {IERC721-getApproved}.\\n */\\n function getApproved(uint256 tokenId) public view virtual override returns (address) {\\n _requireMinted(tokenId);\\n\\n return _tokenApprovals[tokenId];\\n }\\n\\n /**\\n * @dev See {IERC721-setApprovalForAll}.\\n */\\n function setApprovalForAll(address operator, bool approved) public virtual override {\\n _setApprovalForAll(_msgSender(), operator, approved);\\n }\\n\\n /**\\n * @dev See {IERC721-isApprovedForAll}.\\n */\\n function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) {\\n return _operatorApprovals[owner][operator];\\n }\\n\\n /**\\n * @dev See {IERC721-transferFrom}.\\n */\\n function transferFrom(address from, address to, uint256 tokenId) public virtual override {\\n //solhint-disable-next-line max-line-length\\n require(_isApprovedOrOwner(_msgSender(), tokenId), \\\"ERC721: caller is not token owner or approved\\\");\\n\\n _transfer(from, to, tokenId);\\n }\\n\\n /**\\n * @dev See {IERC721-safeTransferFrom}.\\n */\\n function safeTransferFrom(address from, address to, uint256 tokenId) public virtual override {\\n safeTransferFrom(from, to, tokenId, \\\"\\\");\\n }\\n\\n /**\\n * @dev See {IERC721-safeTransferFrom}.\\n */\\n function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory data) public virtual override {\\n require(_isApprovedOrOwner(_msgSender(), tokenId), \\\"ERC721: caller is not token owner or approved\\\");\\n _safeTransfer(from, to, tokenId, data);\\n }\\n\\n /**\\n * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients\\n * are aware of the ERC721 protocol to prevent tokens from being forever locked.\\n *\\n * `data` is additional data, it has no specified format and it is sent in call to `to`.\\n *\\n * This internal function is equivalent to {safeTransferFrom}, and can be used to e.g.\\n * implement alternative mechanisms to perform token transfer, such as signature-based.\\n *\\n * Requirements:\\n *\\n * - `from` cannot be the zero address.\\n * - `to` cannot be the zero address.\\n * - `tokenId` token must exist and be owned by `from`.\\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\\n *\\n * Emits a {Transfer} event.\\n */\\n function _safeTransfer(address from, address to, uint256 tokenId, bytes memory data) internal virtual {\\n _transfer(from, to, tokenId);\\n require(_checkOnERC721Received(from, to, tokenId, data), \\\"ERC721: transfer to non ERC721Receiver implementer\\\");\\n }\\n\\n /**\\n * @dev Returns the owner of the `tokenId`. Does NOT revert if token doesn't exist\\n */\\n function _ownerOf(uint256 tokenId) internal view virtual returns (address) {\\n return _owners[tokenId];\\n }\\n\\n /**\\n * @dev Returns whether `tokenId` exists.\\n *\\n * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}.\\n *\\n * Tokens start existing when they are minted (`_mint`),\\n * and stop existing when they are burned (`_burn`).\\n */\\n function _exists(uint256 tokenId) internal view virtual returns (bool) {\\n return _ownerOf(tokenId) != address(0);\\n }\\n\\n /**\\n * @dev Returns whether `spender` is allowed to manage `tokenId`.\\n *\\n * Requirements:\\n *\\n * - `tokenId` must exist.\\n */\\n function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) {\\n address owner = ERC721.ownerOf(tokenId);\\n return (spender == owner || isApprovedForAll(owner, spender) || getApproved(tokenId) == spender);\\n }\\n\\n /**\\n * @dev Safely mints `tokenId` and transfers it to `to`.\\n *\\n * Requirements:\\n *\\n * - `tokenId` must not exist.\\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\\n *\\n * Emits a {Transfer} event.\\n */\\n function _safeMint(address to, uint256 tokenId) internal virtual {\\n _safeMint(to, tokenId, \\\"\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is\\n * forwarded in {IERC721Receiver-onERC721Received} to contract recipients.\\n */\\n function _safeMint(address to, uint256 tokenId, bytes memory data) internal virtual {\\n _mint(to, tokenId);\\n require(\\n _checkOnERC721Received(address(0), to, tokenId, data),\\n \\\"ERC721: transfer to non ERC721Receiver implementer\\\"\\n );\\n }\\n\\n /**\\n * @dev Mints `tokenId` and transfers it to `to`.\\n *\\n * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible\\n *\\n * Requirements:\\n *\\n * - `tokenId` must not exist.\\n * - `to` cannot be the zero address.\\n *\\n * Emits a {Transfer} event.\\n */\\n function _mint(address to, uint256 tokenId) internal virtual {\\n require(to != address(0), \\\"ERC721: mint to the zero address\\\");\\n require(!_exists(tokenId), \\\"ERC721: token already minted\\\");\\n\\n _beforeTokenTransfer(address(0), to, tokenId, 1);\\n\\n // Check that tokenId was not minted by `_beforeTokenTransfer` hook\\n require(!_exists(tokenId), \\\"ERC721: token already minted\\\");\\n\\n unchecked {\\n // Will not overflow unless all 2**256 token ids are minted to the same owner.\\n // Given that tokens are minted one by one, it is impossible in practice that\\n // this ever happens. Might change if we allow batch minting.\\n // The ERC fails to describe this case.\\n _balances[to] += 1;\\n }\\n\\n _owners[tokenId] = to;\\n\\n emit Transfer(address(0), to, tokenId);\\n\\n _afterTokenTransfer(address(0), to, tokenId, 1);\\n }\\n\\n /**\\n * @dev Destroys `tokenId`.\\n * The approval is cleared when the token is burned.\\n * This is an internal function that does not check if the sender is authorized to operate on the token.\\n *\\n * Requirements:\\n *\\n * - `tokenId` must exist.\\n *\\n * Emits a {Transfer} event.\\n */\\n function _burn(uint256 tokenId) internal virtual {\\n address owner = ERC721.ownerOf(tokenId);\\n\\n _beforeTokenTransfer(owner, address(0), tokenId, 1);\\n\\n // Update ownership in case tokenId was transferred by `_beforeTokenTransfer` hook\\n owner = ERC721.ownerOf(tokenId);\\n\\n // Clear approvals\\n delete _tokenApprovals[tokenId];\\n\\n unchecked {\\n // Cannot overflow, as that would require more tokens to be burned/transferred\\n // out than the owner initially received through minting and transferring in.\\n _balances[owner] -= 1;\\n }\\n delete _owners[tokenId];\\n\\n emit Transfer(owner, address(0), tokenId);\\n\\n _afterTokenTransfer(owner, address(0), tokenId, 1);\\n }\\n\\n /**\\n * @dev Transfers `tokenId` from `from` to `to`.\\n * As opposed to {transferFrom}, this imposes no restrictions on msg.sender.\\n *\\n * Requirements:\\n *\\n * - `to` cannot be the zero address.\\n * - `tokenId` token must be owned by `from`.\\n *\\n * Emits a {Transfer} event.\\n */\\n function _transfer(address from, address to, uint256 tokenId) internal virtual {\\n require(ERC721.ownerOf(tokenId) == from, \\\"ERC721: transfer from incorrect owner\\\");\\n require(to != address(0), \\\"ERC721: transfer to the zero address\\\");\\n\\n _beforeTokenTransfer(from, to, tokenId, 1);\\n\\n // Check that tokenId was not transferred by `_beforeTokenTransfer` hook\\n require(ERC721.ownerOf(tokenId) == from, \\\"ERC721: transfer from incorrect owner\\\");\\n\\n // Clear approvals from the previous owner\\n delete _tokenApprovals[tokenId];\\n\\n unchecked {\\n // `_balances[from]` cannot overflow for the same reason as described in `_burn`:\\n // `from`'s balance is the number of token held, which is at least one before the current\\n // transfer.\\n // `_balances[to]` could overflow in the conditions described in `_mint`. That would require\\n // all 2**256 token ids to be minted, which in practice is impossible.\\n _balances[from] -= 1;\\n _balances[to] += 1;\\n }\\n _owners[tokenId] = to;\\n\\n emit Transfer(from, to, tokenId);\\n\\n _afterTokenTransfer(from, to, tokenId, 1);\\n }\\n\\n /**\\n * @dev Approve `to` to operate on `tokenId`\\n *\\n * Emits an {Approval} event.\\n */\\n function _approve(address to, uint256 tokenId) internal virtual {\\n _tokenApprovals[tokenId] = to;\\n emit Approval(ERC721.ownerOf(tokenId), to, tokenId);\\n }\\n\\n /**\\n * @dev Approve `operator` to operate on all of `owner` tokens\\n *\\n * Emits an {ApprovalForAll} event.\\n */\\n function _setApprovalForAll(address owner, address operator, bool approved) internal virtual {\\n require(owner != operator, \\\"ERC721: approve to caller\\\");\\n _operatorApprovals[owner][operator] = approved;\\n emit ApprovalForAll(owner, operator, approved);\\n }\\n\\n /**\\n * @dev Reverts if the `tokenId` has not been minted yet.\\n */\\n function _requireMinted(uint256 tokenId) internal view virtual {\\n require(_exists(tokenId), \\\"ERC721: invalid token ID\\\");\\n }\\n\\n /**\\n * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address.\\n * The call is not executed if the target address is not a contract.\\n *\\n * @param from address representing the previous owner of the given token ID\\n * @param to target address that will receive the tokens\\n * @param tokenId uint256 ID of the token to be transferred\\n * @param data bytes optional data to send along with the call\\n * @return bool whether the call correctly returned the expected magic value\\n */\\n function _checkOnERC721Received(\\n address from,\\n address to,\\n uint256 tokenId,\\n bytes memory data\\n ) private returns (bool) {\\n if (to.isContract()) {\\n try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, data) returns (bytes4 retval) {\\n return retval == IERC721Receiver.onERC721Received.selector;\\n } catch (bytes memory reason) {\\n if (reason.length == 0) {\\n revert(\\\"ERC721: transfer to non ERC721Receiver implementer\\\");\\n } else {\\n /// @solidity memory-safe-assembly\\n assembly {\\n revert(add(32, reason), mload(reason))\\n }\\n }\\n }\\n } else {\\n return true;\\n }\\n }\\n\\n /**\\n * @dev Hook that is called before any token transfer. This includes minting and burning. If {ERC721Consecutive} is\\n * used, the hook may be called as part of a consecutive (batch) mint, as indicated by `batchSize` greater than 1.\\n *\\n * Calling conditions:\\n *\\n * - When `from` and `to` are both non-zero, ``from``'s tokens will be transferred to `to`.\\n * - When `from` is zero, the tokens will be minted for `to`.\\n * - When `to` is zero, ``from``'s tokens will be burned.\\n * - `from` and `to` are never both zero.\\n * - `batchSize` is non-zero.\\n *\\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\\n */\\n function _beforeTokenTransfer(address from, address to, uint256 firstTokenId, uint256 batchSize) internal virtual {}\\n\\n /**\\n * @dev Hook that is called after any token transfer. This includes minting and burning. If {ERC721Consecutive} is\\n * used, the hook may be called as part of a consecutive (batch) mint, as indicated by `batchSize` greater than 1.\\n *\\n * Calling conditions:\\n *\\n * - When `from` and `to` are both non-zero, ``from``'s tokens were transferred to `to`.\\n * - When `from` is zero, the tokens were minted for `to`.\\n * - When `to` is zero, ``from``'s tokens were burned.\\n * - `from` and `to` are never both zero.\\n * - `batchSize` is non-zero.\\n *\\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\\n */\\n function _afterTokenTransfer(address from, address to, uint256 firstTokenId, uint256 batchSize) internal virtual {}\\n\\n /**\\n * @dev Unsafe write access to the balances, used by extensions that \\\"mint\\\" tokens using an {ownerOf} override.\\n *\\n * WARNING: Anyone calling this MUST ensure that the balances remain consistent with the ownership. The invariant\\n * being that for any address `a` the value returned by `balanceOf(a)` must be equal to the number of tokens such\\n * that `ownerOf(tokenId)` is `a`.\\n */\\n // solhint-disable-next-line func-name-mixedcase\\n function __unsafe_increaseBalance(address account, uint256 amount) internal {\\n _balances[account] += amount;\\n }\\n}\\n\"\r\n },\r\n \"@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol\": {\r\n \"content\": \"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC721/extensions/ERC721Enumerable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../ERC721.sol\\\";\\nimport \\\"./IERC721Enumerable.sol\\\";\\n\\n/**\\n * @dev This implements an optional extension of {ERC721} defined in the EIP that adds\\n * enumerability of all the token ids in the contract as well as all token ids owned by each\\n * account.\\n */\\nabstract contract ERC721Enumerable is ERC721, IERC721Enumerable {\\n // Mapping from owner to list of owned token IDs\\n mapping(address =\u003E mapping(uint256 =\u003E uint256)) private _ownedTokens;\\n\\n // Mapping from token ID to index of the owner tokens list\\n mapping(uint256 =\u003E uint256) private _ownedTokensIndex;\\n\\n // Array with all token ids, used for enumeration\\n uint256[] private _allTokens;\\n\\n // Mapping from token id to position in the allTokens array\\n mapping(uint256 =\u003E uint256) private _allTokensIndex;\\n\\n /**\\n * @dev See {IERC165-supportsInterface}.\\n */\\n function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC721) returns (bool) {\\n return interfaceId == type(IERC721Enumerable).interfaceId || super.supportsInterface(interfaceId);\\n }\\n\\n /**\\n * @dev See {IERC721Enumerable-tokenOfOwnerByIndex}.\\n */\\n function tokenOfOwnerByIndex(address owner, uint256 index) public view virtual override returns (uint256) {\\n require(index \u003C ERC721.balanceOf(owner), \\\"ERC721Enumerable: owner index out of bounds\\\");\\n return _ownedTokens[owner][index];\\n }\\n\\n /**\\n * @dev See {IERC721Enumerable-totalSupply}.\\n */\\n function totalSupply() public view virtual override returns (uint256) {\\n return _allTokens.length;\\n }\\n\\n /**\\n * @dev See {IERC721Enumerable-tokenByIndex}.\\n */\\n function tokenByIndex(uint256 index) public view virtual override returns (uint256) {\\n require(index \u003C ERC721Enumerable.totalSupply(), \\\"ERC721Enumerable: global index out of bounds\\\");\\n return _allTokens[index];\\n }\\n\\n /**\\n * @dev See {ERC721-_beforeTokenTransfer}.\\n */\\n function _beforeTokenTransfer(\\n address from,\\n address to,\\n uint256 firstTokenId,\\n uint256 batchSize\\n ) internal virtual override {\\n super._beforeTokenTransfer(from, to, firstTokenId, batchSize);\\n\\n if (batchSize \u003E 1) {\\n // Will only trigger during construction. Batch transferring (minting) is not available afterwards.\\n revert(\\\"ERC721Enumerable: consecutive transfers not supported\\\");\\n }\\n\\n uint256 tokenId = firstTokenId;\\n\\n if (from == address(0)) {\\n _addTokenToAllTokensEnumeration(tokenId);\\n } else if (from != to) {\\n _removeTokenFromOwnerEnumeration(from, tokenId);\\n }\\n if (to == address(0)) {\\n _removeTokenFromAllTokensEnumeration(tokenId);\\n } else if (to != from) {\\n _addTokenToOwnerEnumeration(to, tokenId);\\n }\\n }\\n\\n /**\\n * @dev Private function to add a token to this extension's ownership-tracking data structures.\\n * @param to address representing the new owner of the given token ID\\n * @param tokenId uint256 ID of the token to be added to the tokens list of the given address\\n */\\n function _addTokenToOwnerEnumeration(address to, uint256 tokenId) private {\\n uint256 length = ERC721.balanceOf(to);\\n _ownedTokens[to][length] = tokenId;\\n _ownedTokensIndex[tokenId] = length;\\n }\\n\\n /**\\n * @dev Private function to add a token to this extension's token tracking data structures.\\n * @param tokenId uint256 ID of the token to be added to the tokens list\\n */\\n function _addTokenToAllTokensEnumeration(uint256 tokenId) private {\\n _allTokensIndex[tokenId] = _allTokens.length;\\n _allTokens.push(tokenId);\\n }\\n\\n /**\\n * @dev Private function to remove a token from this extension's ownership-tracking data structures. Note that\\n * while the token is not assigned a new owner, the `_ownedTokensIndex` mapping is _not_ updated: this allows for\\n * gas optimizations e.g. when performing a transfer operation (avoiding double writes).\\n * This has O(1) time complexity, but alters the order of the _ownedTokens array.\\n * @param from address representing the previous owner of the given token ID\\n * @param tokenId uint256 ID of the token to be removed from the tokens list of the given address\\n */\\n function _removeTokenFromOwnerEnumeration(address from, uint256 tokenId) private {\\n // To prevent a gap in from's tokens array, we store the last token in the index of the token to delete, and\\n // then delete the last slot (swap and pop).\\n\\n uint256 lastTokenIndex = ERC721.balanceOf(from) - 1;\\n uint256 tokenIndex = _ownedTokensIndex[tokenId];\\n\\n // When the token to delete is the last token, the swap operation is unnecessary\\n if (tokenIndex != lastTokenIndex) {\\n uint256 lastTokenId = _ownedTokens[from][lastTokenIndex];\\n\\n _ownedTokens[from][tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token\\n _ownedTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index\\n }\\n\\n // This also deletes the contents at the last position of the array\\n delete _ownedTokensIndex[tokenId];\\n delete _ownedTokens[from][lastTokenIndex];\\n }\\n\\n /**\\n * @dev Private function to remove a token from this extension's token tracking data structures.\\n * This has O(1) time complexity, but alters the order of the _allTokens array.\\n * @param tokenId uint256 ID of the token to be removed from the tokens list\\n */\\n function _removeTokenFromAllTokensEnumeration(uint256 tokenId) private {\\n // To prevent a gap in the tokens array, we store the last token in the index of the token to delete, and\\n // then delete the last slot (swap and pop).\\n\\n uint256 lastTokenIndex = _allTokens.length - 1;\\n uint256 tokenIndex = _allTokensIndex[tokenId];\\n\\n // When the token to delete is the last token, the swap operation is unnecessary. However, since this occurs so\\n // rarely (when the last minted token is burnt) that we still do the swap here to avoid the gas cost of adding\\n // an 'if' statement (like in _removeTokenFromOwnerEnumeration)\\n uint256 lastTokenId = _allTokens[lastTokenIndex];\\n\\n _allTokens[tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token\\n _allTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index\\n\\n // This also deletes the contents at the last position of the array\\n delete _allTokensIndex[tokenId];\\n _allTokens.pop();\\n }\\n}\\n\"\r\n },\r\n \"@openzeppelin/contracts/token/ERC721/extensions/IERC721Enumerable.sol\": {\r\n \"content\": \"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC721/extensions/IERC721Enumerable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../IERC721.sol\\\";\\n\\n/**\\n * @title ERC-721 Non-Fungible Token Standard, optional enumeration extension\\n * @dev See https://eips.ethereum.org/EIPS/eip-721\\n */\\ninterface IERC721Enumerable is IERC721 {\\n /**\\n * @dev Returns the total amount of tokens stored by the contract.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns a token ID owned by `owner` at a given `index` of its token list.\\n * Use along with {balanceOf} to enumerate all of ``owner``'s tokens.\\n */\\n function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256);\\n\\n /**\\n * @dev Returns a token ID at a given `index` of all the tokens stored by the contract.\\n * Use along with {totalSupply} to enumerate all tokens.\\n */\\n function tokenByIndex(uint256 index) external view returns (uint256);\\n}\\n\"\r\n },\r\n \"@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol\": {\r\n \"content\": \"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../IERC721.sol\\\";\\n\\n/**\\n * @title ERC-721 Non-Fungible Token Standard, optional metadata extension\\n * @dev See https://eips.ethereum.org/EIPS/eip-721\\n */\\ninterface IERC721Metadata is IERC721 {\\n /**\\n * @dev Returns the token collection name.\\n */\\n function name() external view returns (string memory);\\n\\n /**\\n * @dev Returns the token collection symbol.\\n */\\n function symbol() external view returns (string memory);\\n\\n /**\\n * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.\\n */\\n function tokenURI(uint256 tokenId) external view returns (string memory);\\n}\\n\"\r\n },\r\n \"@openzeppelin/contracts/token/ERC721/IERC721.sol\": {\r\n \"content\": \"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC721/IERC721.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../../utils/introspection/IERC165.sol\\\";\\n\\n/**\\n * @dev Required interface of an ERC721 compliant contract.\\n */\\ninterface IERC721 is IERC165 {\\n /**\\n * @dev Emitted when `tokenId` token is transferred from `from` to `to`.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);\\n\\n /**\\n * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.\\n */\\n event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);\\n\\n /**\\n * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.\\n */\\n event ApprovalForAll(address indexed owner, address indexed operator, bool approved);\\n\\n /**\\n * @dev Returns the number of tokens in ``owner``'s account.\\n */\\n function balanceOf(address owner) external view returns (uint256 balance);\\n\\n /**\\n * @dev Returns the owner of the `tokenId` token.\\n *\\n * Requirements:\\n *\\n * - `tokenId` must exist.\\n */\\n function ownerOf(uint256 tokenId) external view returns (address owner);\\n\\n /**\\n * @dev Safely transfers `tokenId` token from `from` to `to`.\\n *\\n * Requirements:\\n *\\n * - `from` cannot be the zero address.\\n * - `to` cannot be the zero address.\\n * - `tokenId` token must exist and be owned by `from`.\\n * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.\\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\\n *\\n * Emits a {Transfer} event.\\n */\\n function safeTransferFrom(address from, address to, uint256 tokenId, bytes calldata data) external;\\n\\n /**\\n * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients\\n * are aware of the ERC721 protocol to prevent tokens from being forever locked.\\n *\\n * Requirements:\\n *\\n * - `from` cannot be the zero address.\\n * - `to` cannot be the zero address.\\n * - `tokenId` token must exist and be owned by `from`.\\n * - If the caller is not `from`, it must have been allowed to move this token by either {approve} or {setApprovalForAll}.\\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\\n *\\n * Emits a {Transfer} event.\\n */\\n function safeTransferFrom(address from, address to, uint256 tokenId) external;\\n\\n /**\\n * @dev Transfers `tokenId` token from `from` to `to`.\\n *\\n * WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721\\n * or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must\\n * understand this adds an external call which potentially creates a reentrancy vulnerability.\\n *\\n * Requirements:\\n *\\n * - `from` cannot be the zero address.\\n * - `to` cannot be the zero address.\\n * - `tokenId` token must be owned by `from`.\\n * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(address from, address to, uint256 tokenId) external;\\n\\n /**\\n * @dev Gives permission to `to` to transfer `tokenId` token to another account.\\n * The approval is cleared when the token is transferred.\\n *\\n * Only a single account can be approved at a time, so approving the zero address clears previous approvals.\\n *\\n * Requirements:\\n *\\n * - The caller must own the token or be an approved operator.\\n * - `tokenId` must exist.\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address to, uint256 tokenId) external;\\n\\n /**\\n * @dev Approve or remove `operator` as an operator for the caller.\\n * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.\\n *\\n * Requirements:\\n *\\n * - The `operator` cannot be the caller.\\n *\\n * Emits an {ApprovalForAll} event.\\n */\\n function setApprovalForAll(address operator, bool approved) external;\\n\\n /**\\n * @dev Returns the account approved for `tokenId` token.\\n *\\n * Requirements:\\n *\\n * - `tokenId` must exist.\\n */\\n function getApproved(uint256 tokenId) external view returns (address operator);\\n\\n /**\\n * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.\\n *\\n * See {setApprovalForAll}\\n */\\n function isApprovedForAll(address owner, address operator) external view returns (bool);\\n}\\n\"\r\n },\r\n \"@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol\": {\r\n \"content\": \"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721Receiver.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @title ERC721 token receiver interface\\n * @dev Interface for any contract that wants to support safeTransfers\\n * from ERC721 asset contracts.\\n */\\ninterface IERC721Receiver {\\n /**\\n * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}\\n * by `operator` from `from`, this function is called.\\n *\\n * It must return its Solidity selector to confirm the token transfer.\\n * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted.\\n *\\n * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`.\\n */\\n function onERC721Received(\\n address operator,\\n address from,\\n uint256 tokenId,\\n bytes calldata data\\n ) external returns (bytes4);\\n}\\n\"\r\n },\r\n \"@openzeppelin/contracts/utils/Address.sol\": {\r\n \"content\": \"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n *\\n * Furthermore, `isContract` will also return true if the target contract within\\n * the same transaction is already scheduled for destruction by `SELFDESTRUCT`,\\n * which only has an effect at the end of a transaction.\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length \u003E 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.8.0/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance \u003E= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance \u003E= value, \\\"Address: insufficient balance for call\\\");\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\\n *\\n * _Available since v4.8._\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n if (success) {\\n if (returndata.length == 0) {\\n // only check isContract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n }\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason or using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length \u003E 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n}\\n\"\r\n },\r\n \"@openzeppelin/contracts/utils/Context.sol\": {\r\n \"content\": \"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\"\r\n },\r\n \"@openzeppelin/contracts/utils/introspection/ERC165.sol\": {\r\n \"content\": \"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IERC165.sol\\\";\\n\\n/**\\n * @dev Implementation of the {IERC165} interface.\\n *\\n * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check\\n * for the additional interface id that will be supported. For example:\\n *\\n * ```solidity\\n * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\\n * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);\\n * }\\n * ```\\n *\\n * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.\\n */\\nabstract contract ERC165 is IERC165 {\\n /**\\n * @dev See {IERC165-supportsInterface}.\\n */\\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\\n return interfaceId == type(IERC165).interfaceId;\\n }\\n}\\n\"\r\n },\r\n \"@openzeppelin/contracts/utils/introspection/IERC165.sol\": {\r\n \"content\": \"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC165 standard, as defined in the\\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\\n *\\n * Implementers can declare support of contract interfaces, which can then be\\n * queried by others ({ERC165Checker}).\\n *\\n * For an implementation, see {ERC165}.\\n */\\ninterface IERC165 {\\n /**\\n * @dev Returns true if this contract implements the interface defined by\\n * `interfaceId`. See the corresponding\\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\\n * to learn more about how these ids are created.\\n *\\n * This function call must use less than 30 000 gas.\\n */\\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\\n}\\n\"\r\n },\r\n \"@openzeppelin/contracts/utils/math/Math.sol\": {\r\n \"content\": \"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/math/Math.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Standard math utilities missing in the Solidity language.\\n */\\nlibrary Math {\\n enum Rounding {\\n Down, // Toward negative infinity\\n Up, // Toward infinity\\n Zero // Toward zero\\n }\\n\\n /**\\n * @dev Returns the largest of two numbers.\\n */\\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a \u003E b ? a : b;\\n }\\n\\n /**\\n * @dev Returns the smallest of two numbers.\\n */\\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a \u003C b ? a : b;\\n }\\n\\n /**\\n * @dev Returns the average of two numbers. The result is rounded towards\\n * zero.\\n */\\n function average(uint256 a, uint256 b) internal pure returns (uint256) {\\n // (a + b) / 2 can overflow.\\n return (a & b) + (a ^ b) / 2;\\n }\\n\\n /**\\n * @dev Returns the ceiling of the division of two numbers.\\n *\\n * This differs from standard division with `/` in that it rounds up instead\\n * of rounding down.\\n */\\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\\n // (a + b - 1) / b can overflow on addition, so we distribute.\\n return a == 0 ? 0 : (a - 1) / b + 1;\\n }\\n\\n /**\\n * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\\n * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)\\n * with further edits by Uniswap Labs also under MIT license.\\n */\\n function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {\\n unchecked {\\n // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use\\n // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\\n // variables such that product = prod1 * 2^256 + prod0.\\n uint256 prod0; // Least significant 256 bits of the product\\n uint256 prod1; // Most significant 256 bits of the product\\n assembly {\\n let mm := mulmod(x, y, not(0))\\n prod0 := mul(x, y)\\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\\n }\\n\\n // Handle non-overflow cases, 256 by 256 division.\\n if (prod1 == 0) {\\n // Solidity will revert if denominator == 0, unlike the div opcode on its own.\\n // The surrounding unchecked block does not change this fact.\\n // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.\\n return prod0 / denominator;\\n }\\n\\n // Make sure the result is less than 2^256. Also prevents denominator == 0.\\n require(denominator \u003E prod1, \\\"Math: mulDiv overflow\\\");\\n\\n ///////////////////////////////////////////////\\n // 512 by 256 division.\\n ///////////////////////////////////////////////\\n\\n // Make division exact by subtracting the remainder from [prod1 prod0].\\n uint256 remainder;\\n assembly {\\n // Compute remainder using mulmod.\\n remainder := mulmod(x, y, denominator)\\n\\n // Subtract 256 bit number from 512 bit number.\\n prod1 := sub(prod1, gt(remainder, prod0))\\n prod0 := sub(prod0, remainder)\\n }\\n\\n // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always \u003E= 1.\\n // See https://cs.stackexchange.com/q/138556/92363.\\n\\n // Does not overflow because the denominator cannot be zero at this stage in the function.\\n uint256 twos = denominator & (~denominator + 1);\\n assembly {\\n // Divide denominator by twos.\\n denominator := div(denominator, twos)\\n\\n // Divide [prod1 prod0] by twos.\\n prod0 := div(prod0, twos)\\n\\n // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.\\n twos := add(div(sub(0, twos), twos), 1)\\n }\\n\\n // Shift in bits from prod1 into prod0.\\n prod0 |= prod1 * twos;\\n\\n // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such\\n // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for\\n // four bits. That is, denominator * inv = 1 mod 2^4.\\n uint256 inverse = (3 * denominator) ^ 2;\\n\\n // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works\\n // in modular arithmetic, doubling the correct bits in each step.\\n inverse *= 2 - denominator * inverse; // inverse mod 2^8\\n inverse *= 2 - denominator * inverse; // inverse mod 2^16\\n inverse *= 2 - denominator * inverse; // inverse mod 2^32\\n inverse *= 2 - denominator * inverse; // inverse mod 2^64\\n inverse *= 2 - denominator * inverse; // inverse mod 2^128\\n inverse *= 2 - denominator * inverse; // inverse mod 2^256\\n\\n // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.\\n // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is\\n // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1\\n // is no longer required.\\n result = prod0 * inverse;\\n return result;\\n }\\n }\\n\\n /**\\n * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.\\n */\\n function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) {\\n uint256 result = mulDiv(x, y, denominator);\\n if (rounding == Rounding.Up && mulmod(x, y, denominator) \u003E 0) {\\n result += 1;\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.\\n *\\n * Inspired by Henry S. Warren, Jr.'s \\\"Hacker's Delight\\\" (Chapter 11).\\n */\\n function sqrt(uint256 a) internal pure returns (uint256) {\\n if (a == 0) {\\n return 0;\\n }\\n\\n // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.\\n //\\n // We know that the \\\"msb\\\" (most significant bit) of our target number `a` is a power of 2 such that we have\\n // `msb(a) \u003C= a \u003C 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.\\n //\\n // This can be rewritten `2**log2(a) \u003C= a \u003C 2**(log2(a) + 1)`\\n // → `sqrt(2**k) \u003C= sqrt(a) \u003C sqrt(2**(k+1))`\\n // → `2**(k/2) \u003C= sqrt(a) \u003C 2**((k+1)/2) \u003C= 2**(k/2 + 1)`\\n //\\n // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.\\n uint256 result = 1 \u003C\u003C (log2(a) \u003E\u003E 1);\\n\\n // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,\\n // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at\\n // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision\\n // into the expected uint128 result.\\n unchecked {\\n result = (result + a / result) \u003E\u003E 1;\\n result = (result + a / result) \u003E\u003E 1;\\n result = (result + a / result) \u003E\u003E 1;\\n result = (result + a / result) \u003E\u003E 1;\\n result = (result + a / result) \u003E\u003E 1;\\n result = (result + a / result) \u003E\u003E 1;\\n result = (result + a / result) \u003E\u003E 1;\\n return min(result, a / result);\\n }\\n }\\n\\n /**\\n * @notice Calculates sqrt(a), following the selected rounding direction.\\n */\\n function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = sqrt(a);\\n return result + (rounding == Rounding.Up && result * result \u003C a ? 1 : 0);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 2, rounded down, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log2(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value \u003E\u003E 128 \u003E 0) {\\n value \u003E\u003E= 128;\\n result += 128;\\n }\\n if (value \u003E\u003E 64 \u003E 0) {\\n value \u003E\u003E= 64;\\n result += 64;\\n }\\n if (value \u003E\u003E 32 \u003E 0) {\\n value \u003E\u003E= 32;\\n result += 32;\\n }\\n if (value \u003E\u003E 16 \u003E 0) {\\n value \u003E\u003E= 16;\\n result += 16;\\n }\\n if (value \u003E\u003E 8 \u003E 0) {\\n value \u003E\u003E= 8;\\n result += 8;\\n }\\n if (value \u003E\u003E 4 \u003E 0) {\\n value \u003E\u003E= 4;\\n result += 4;\\n }\\n if (value \u003E\u003E 2 \u003E 0) {\\n value \u003E\u003E= 2;\\n result += 2;\\n }\\n if (value \u003E\u003E 1 \u003E 0) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 2, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log2(value);\\n return result + (rounding == Rounding.Up && 1 \u003C\u003C result \u003C value ? 1 : 0);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 10, rounded down, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log10(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value \u003E= 10 ** 64) {\\n value /= 10 ** 64;\\n result += 64;\\n }\\n if (value \u003E= 10 ** 32) {\\n value /= 10 ** 32;\\n result += 32;\\n }\\n if (value \u003E= 10 ** 16) {\\n value /= 10 ** 16;\\n result += 16;\\n }\\n if (value \u003E= 10 ** 8) {\\n value /= 10 ** 8;\\n result += 8;\\n }\\n if (value \u003E= 10 ** 4) {\\n value /= 10 ** 4;\\n result += 4;\\n }\\n if (value \u003E= 10 ** 2) {\\n value /= 10 ** 2;\\n result += 2;\\n }\\n if (value \u003E= 10 ** 1) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log10(value);\\n return result + (rounding == Rounding.Up && 10 ** result \u003C value ? 1 : 0);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 256, rounded down, of a positive value.\\n * Returns 0 if given 0.\\n *\\n * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.\\n */\\n function log256(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value \u003E\u003E 128 \u003E 0) {\\n value \u003E\u003E= 128;\\n result += 16;\\n }\\n if (value \u003E\u003E 64 \u003E 0) {\\n value \u003E\u003E= 64;\\n result += 8;\\n }\\n if (value \u003E\u003E 32 \u003E 0) {\\n value \u003E\u003E= 32;\\n result += 4;\\n }\\n if (value \u003E\u003E 16 \u003E 0) {\\n value \u003E\u003E= 16;\\n result += 2;\\n }\\n if (value \u003E\u003E 8 \u003E 0) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 256, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log256(value);\\n return result + (rounding == Rounding.Up && 1 \u003C\u003C (result \u003C\u003C 3) \u003C value ? 1 : 0);\\n }\\n }\\n}\\n\"\r\n },\r\n \"@openzeppelin/contracts/utils/math/SignedMath.sol\": {\r\n \"content\": \"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/SignedMath.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Standard signed math utilities missing in the Solidity language.\\n */\\nlibrary SignedMath {\\n /**\\n * @dev Returns the largest of two signed numbers.\\n */\\n function max(int256 a, int256 b) internal pure returns (int256) {\\n return a \u003E b ? a : b;\\n }\\n\\n /**\\n * @dev Returns the smallest of two signed numbers.\\n */\\n function min(int256 a, int256 b) internal pure returns (int256) {\\n return a \u003C b ? a : b;\\n }\\n\\n /**\\n * @dev Returns the average of two signed numbers without overflow.\\n * The result is rounded towards zero.\\n */\\n function average(int256 a, int256 b) internal pure returns (int256) {\\n // Formula from the book \\\"Hacker's Delight\\\"\\n int256 x = (a & b) + ((a ^ b) \u003E\u003E 1);\\n return x + (int256(uint256(x) \u003E\u003E 255) & (a ^ b));\\n }\\n\\n /**\\n * @dev Returns the absolute unsigned value of a signed value.\\n */\\n function abs(int256 n) internal pure returns (uint256) {\\n unchecked {\\n // must be unchecked in order to support `n = type(int256).min`\\n return uint256(n \u003E= 0 ? n : -n);\\n }\\n }\\n}\\n\"\r\n },\r\n \"@openzeppelin/contracts/utils/Strings.sol\": {\r\n \"content\": \"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/Strings.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./math/Math.sol\\\";\\nimport \\\"./math/SignedMath.sol\\\";\\n\\n/**\\n * @dev String operations.\\n */\\nlibrary Strings {\\n bytes16 private constant _SYMBOLS = \\\"0123456789abcdef\\\";\\n uint8 private constant _ADDRESS_LENGTH = 20;\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\\n */\\n function toString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n uint256 length = Math.log10(value) + 1;\\n string memory buffer = new string(length);\\n uint256 ptr;\\n /// @solidity memory-safe-assembly\\n assembly {\\n ptr := add(buffer, add(32, length))\\n }\\n while (true) {\\n ptr--;\\n /// @solidity memory-safe-assembly\\n assembly {\\n mstore8(ptr, byte(mod(value, 10), _SYMBOLS))\\n }\\n value /= 10;\\n if (value == 0) break;\\n }\\n return buffer;\\n }\\n }\\n\\n /**\\n * @dev Converts a `int256` to its ASCII `string` decimal representation.\\n */\\n function toString(int256 value) internal pure returns (string memory) {\\n return string(abi.encodePacked(value \u003C 0 ? \\\"-\\\" : \\\"\\\", toString(SignedMath.abs(value))));\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\\n */\\n function toHexString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n return toHexString(value, Math.log256(value) + 1);\\n }\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\\n */\\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\\n bytes memory buffer = new bytes(2 * length + 2);\\n buffer[0] = \\\"0\\\";\\n buffer[1] = \\\"x\\\";\\n for (uint256 i = 2 * length + 1; i \u003E 1; --i) {\\n buffer[i] = _SYMBOLS[value & 0xf];\\n value \u003E\u003E= 4;\\n }\\n require(value == 0, \\\"Strings: hex length insufficient\\\");\\n return string(buffer);\\n }\\n\\n /**\\n * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.\\n */\\n function toHexString(address addr) internal pure returns (string memory) {\\n return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);\\n }\\n\\n /**\\n * @dev Returns true if the two strings are equal.\\n */\\n function equal(string memory a, string memory b) internal pure returns (bool) {\\n return keccak256(bytes(a)) == keccak256(bytes(b));\\n }\\n}\\n\"\r\n },\r\n \"contracts/base/BlockTimestamp.sol\": {\r\n \"content\": \"// SPDX-License-Identifier: GPL-2.0-or-later\\r\\npragma solidity =0.8.20;\\r\\n\\r\\n/// @title Function for getting block timestamp\\r\\n/// @dev Base contract that is overridden for tests\\r\\nabstract contract BlockTimestamp {\\r\\n /// @dev Method that exists purely to be overridden for tests\\r\\n /// @return The current block timestamp\\r\\n function _blockTimestamp() internal view virtual returns (uint256) {\\r\\n return block.timestamp;\\r\\n }\\r\\n}\\r\\n\"\r\n },\r\n \"contracts/base/ERC721Permit.sol\": {\r\n \"content\": \"// SPDX-License-Identifier: GPL-2.0-or-later\\r\\npragma solidity =0.8.20;\\r\\n\\r\\nimport '@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol';\\r\\nimport '@openzeppelin/contracts/utils/Address.sol';\\r\\n\\r\\nimport '../interfaces/external/IERC1271.sol';\\r\\nimport '../interfaces/IERC721Permit.sol';\\r\\nimport './BlockTimestamp.sol';\\r\\n\\r\\n/// @title ERC721 with permit\\r\\n/// @notice Nonfungible tokens that support an approve via signature, i.e. permit\\r\\nabstract contract ERC721Permit is BlockTimestamp, ERC721Enumerable, IERC721Permit {\\r\\n bytes32 private constant _TYPE_HASH =\\r\\n keccak256('EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)');\\r\\n\\r\\n /// @dev Gets the current nonce for a token ID and then increments it, returning the original value\\r\\n function _getAndIncrementNonce(uint256 tokenId) internal virtual returns (uint256);\\r\\n\\r\\n /// @dev The hash of the name used in the permit signature verification\\r\\n bytes32 private immutable nameHash;\\r\\n\\r\\n /// @dev The hash of the version string used in the permit signature verification\\r\\n bytes32 private immutable versionHash;\\r\\n\\r\\n bytes32 private immutable _cachedDomainSeparator;\\r\\n uint256 private immutable _cachedChainId;\\r\\n address private immutable _cachedThis;\\r\\n\\r\\n /// @notice Computes the nameHash and versionHash\\r\\n constructor(string memory name_, string memory symbol_, string memory version_) ERC721(name_, symbol_) {\\r\\n nameHash = keccak256(bytes(name_));\\r\\n versionHash = keccak256(bytes(version_));\\r\\n\\r\\n _cachedChainId = block.chainid;\\r\\n _cachedDomainSeparator = _buildDomainSeparator();\\r\\n _cachedThis = address(this);\\r\\n }\\r\\n\\r\\n /// @inheritdoc IERC721Permit\\r\\n function DOMAIN_SEPARATOR() public view override returns (bytes32) {\\r\\n if (address(this) == _cachedThis && block.chainid == _cachedChainId) {\\r\\n return _cachedDomainSeparator;\\r\\n } else {\\r\\n return _buildDomainSeparator();\\r\\n }\\r\\n }\\r\\n\\r\\n function _buildDomainSeparator() private view returns (bytes32) {\\r\\n return keccak256(abi.encode(_TYPE_HASH, nameHash, versionHash, block.chainid, address(this)));\\r\\n }\\r\\n\\r\\n /// @inheritdoc IERC721Permit\\r\\n bytes32 public constant override PERMIT_TYPEHASH =\\r\\n keccak256('Permit(address spender,uint256 tokenId,uint256 nonce,uint256 deadline)');\\r\\n\\r\\n /// @inheritdoc IERC721Permit\\r\\n function permit(\\r\\n address spender,\\r\\n uint256 tokenId,\\r\\n uint256 deadline,\\r\\n uint8 v,\\r\\n bytes32 r,\\r\\n bytes32 s\\r\\n ) external payable override {\\r\\n require(_blockTimestamp() \u003C= deadline, 'Permit expired');\\r\\n\\r\\n bytes32 digest = keccak256(\\r\\n abi.encodePacked(\\r\\n '\\\\x19\\\\x01',\\r\\n DOMAIN_SEPARATOR(),\\r\\n keccak256(abi.encode(PERMIT_TYPEHASH, spender, tokenId, _getAndIncrementNonce(tokenId), deadline))\\r\\n )\\r\\n );\\r\\n address owner = ownerOf(tokenId);\\r\\n require(spender != owner, 'ERC721Permit: approval to current owner');\\r\\n\\r\\n if (Address.isContract(owner)) {\\r\\n _checkAuthorization(IERC1271(owner).isValidSignature(digest, abi.encodePacked(r, s, v)) == 0x1626ba7e);\\r\\n } else {\\r\\n address recoveredAddress = ecrecover(digest, v, r, s);\\r\\n require(recoveredAddress != address(0), 'Invalid signature');\\r\\n _checkAuthorization(recoveredAddress == owner);\\r\\n }\\r\\n\\r\\n _approve(spender, tokenId);\\r\\n }\\r\\n\\r\\n function _checkAuthorization(bool isAuthorized) private pure {\\r\\n require(isAuthorized, 'Unauthorized');\\r\\n }\\r\\n}\\r\\n\"\r\n },\r\n \"contracts/base/LiquidityManagement.sol\": {\r\n \"content\": \"// SPDX-License-Identifier: GPL-2.0-or-later\\r\\npragma solidity =0.8.20;\\r\\n\\r\\nimport '@cryptoalgebra/integral-core/contracts/interfaces/IAlgebraFactory.sol';\\r\\nimport '@cryptoalgebra/integral-core/contracts/interfaces/callback/IAlgebraMintCallback.sol';\\r\\nimport '@cryptoalgebra/integral-core/contracts/libraries/TickMath.sol';\\r\\n\\r\\nimport '../libraries/PoolAddress.sol';\\r\\nimport '../libraries/CallbackValidation.sol';\\r\\nimport '../libraries/LiquidityAmounts.sol';\\r\\n\\r\\nimport '../libraries/PoolInteraction.sol';\\r\\n\\r\\nimport './PeripheryPayments.sol';\\r\\nimport './PeripheryImmutableState.sol';\\r\\n\\r\\n/// @title Liquidity management functions\\r\\n/// @notice Internal functions for safely managing liquidity in Algebra\\r\\n/// @dev Credit to Uniswap Labs under GPL-2.0-or-later license:\\r\\n/// https://github.com/Uniswap/v3-periphery\\r\\nabstract contract LiquidityManagement is IAlgebraMintCallback, PeripheryImmutableState, PeripheryPayments {\\r\\n using PoolInteraction for IAlgebraPool;\\r\\n struct MintCallbackData {\\r\\n PoolAddress.PoolKey poolKey;\\r\\n address payer;\\r\\n }\\r\\n\\r\\n /// @inheritdoc IAlgebraMintCallback\\r\\n function algebraMintCallback(uint256 amount0Owed, uint256 amount1Owed, bytes calldata data) external override {\\r\\n MintCallbackData memory decoded = abi.decode(data, (MintCallbackData));\\r\\n CallbackValidation.verifyCallback(poolDeployer, decoded.poolKey);\\r\\n\\r\\n if (amount0Owed \u003E 0) pay(decoded.poolKey.token0, decoded.payer, msg.sender, amount0Owed);\\r\\n if (amount1Owed \u003E 0) pay(decoded.poolKey.token1, decoded.payer, msg.sender, amount1Owed);\\r\\n }\\r\\n\\r\\n struct AddLiquidityParams {\\r\\n address token0;\\r\\n address token1;\\r\\n address recipient;\\r\\n int24 tickLower;\\r\\n int24 tickUpper;\\r\\n uint256 amount0Desired;\\r\\n uint256 amount1Desired;\\r\\n uint256 amount0Min;\\r\\n uint256 amount1Min;\\r\\n }\\r\\n\\r\\n /// @notice Add liquidity to an initialized pool\\r\\n function addLiquidity(\\r\\n AddLiquidityParams memory params\\r\\n )\\r\\n internal\\r\\n returns (uint128 liquidity, uint128 actualLiquidity, uint256 amount0, uint256 amount1, IAlgebraPool pool)\\r\\n {\\r\\n PoolAddress.PoolKey memory poolKey = PoolAddress.PoolKey({token0: params.token0, token1: params.token1});\\r\\n\\r\\n pool = IAlgebraPool(PoolAddress.computeAddress(poolDeployer, poolKey));\\r\\n\\r\\n // compute the liquidity amount\\r\\n {\\r\\n uint160 sqrtPriceX96 = pool._getSqrtPrice();\\r\\n uint160 sqrtRatioAX96 = TickMath.getSqrtRatioAtTick(params.tickLower);\\r\\n uint160 sqrtRatioBX96 = TickMath.getSqrtRatioAtTick(params.tickUpper);\\r\\n\\r\\n liquidity = LiquidityAmounts.getLiquidityForAmounts(\\r\\n sqrtPriceX96,\\r\\n sqrtRatioAX96,\\r\\n sqrtRatioBX96,\\r\\n params.amount0Desired,\\r\\n params.amount1Desired\\r\\n );\\r\\n }\\r\\n\\r\\n (amount0, amount1, actualLiquidity) = pool.mint(\\r\\n msg.sender,\\r\\n params.recipient,\\r\\n params.tickLower,\\r\\n params.tickUpper,\\r\\n liquidity,\\r\\n abi.encode(MintCallbackData({poolKey: poolKey, payer: msg.sender}))\\r\\n );\\r\\n\\r\\n require(amount0 \u003E= params.amount0Min && amount1 \u003E= params.amount1Min, 'Price slippage check');\\r\\n }\\r\\n}\\r\\n\"\r\n },\r\n \"contracts/base/Multicall.sol\": {\r\n \"content\": \"// SPDX-License-Identifier: GPL-2.0-or-later\\r\\npragma solidity =0.8.20;\\r\\n\\r\\nimport '../interfaces/IMulticall.sol';\\r\\n\\r\\n/// @title Multicall\\r\\n/// @notice Enables calling multiple methods in a single call to the contract\\r\\nabstract contract Multicall is IMulticall {\\r\\n /// @inheritdoc IMulticall\\r\\n function multicall(bytes[] calldata data) external payable override returns (bytes[] memory results) {\\r\\n results = new bytes[](data.length);\\r\\n unchecked {\\r\\n for (uint256 i = 0; i \u003C data.length; i++) {\\r\\n (bool success, bytes memory result) = address(this).delegatecall(data[i]);\\r\\n if (!success) {\\r\\n // Look for revert reason and bubble it up if present\\r\\n require(result.length \u003E 0);\\r\\n // The easiest way to bubble the revert reason is using memory via assembly\\r\\n assembly ('memory-safe') {\\r\\n revert(add(32, result), mload(result))\\r\\n }\\r\\n }\\r\\n results[i] = result;\\r\\n }\\r\\n }\\r\\n }\\r\\n}\\r\\n\"\r\n },\r\n \"contracts/base/PeripheryImmutableState.sol\": {\r\n \"content\": \"// SPDX-License-Identifier: GPL-2.0-or-later\\r\\npragma solidity =0.8.20;\\r\\n\\r\\nimport '../interfaces/IPeripheryImmutableState.sol';\\r\\n\\r\\n/// @title Immutable state\\r\\n/// @notice Immutable state used by periphery contracts\\r\\n/// @dev Credit to Uniswap Labs under GPL-2.0-or-later license:\\r\\n/// https://github.com/Uniswap/v3-periphery\\r\\nabstract contract PeripheryImmutableState is IPeripheryImmutableState {\\r\\n /// @inheritdoc IPeripheryImmutableState\\r\\n address public immutable override factory;\\r\\n /// @inheritdoc IPeripheryImmutableState\\r\\n address public immutable override poolDeployer;\\r\\n /// @inheritdoc IPeripheryImmutableState\\r\\n address public immutable override WNativeToken;\\r\\n\\r\\n constructor(address _factory, address _WNativeToken, address _poolDeployer) {\\r\\n factory = _factory;\\r\\n poolDeployer = _poolDeployer;\\r\\n WNativeToken = _WNativeToken;\\r\\n }\\r\\n}\\r\\n\"\r\n },\r\n \"contracts/base/PeripheryPayments.sol\": {\r\n \"content\": \"// SPDX-License-Identifier: GPL-2.0-or-later\\r\\npragma solidity \u003E=0.7.5;\\r\\n\\r\\nimport '@openzeppelin/contracts/token/ERC20/IERC20.sol';\\r\\n\\r\\nimport '../interfaces/IPeripheryPayments.sol';\\r\\nimport '../interfaces/external/IWNativeToken.sol';\\r\\n\\r\\nimport '../libraries/TransferHelper.sol';\\r\\n\\r\\nimport './PeripheryImmutableState.sol';\\r\\n\\r\\n/// @dev Credit to Uniswap Labs under GPL-2.0-or-later license:\\r\\n/// https://github.com/Uniswap/v3-periphery\\r\\nabstract contract PeripheryPayments is IPeripheryPayments, PeripheryImmutableState {\\r\\n receive() external payable {\\r\\n require(msg.sender == WNativeToken, 'Not WNativeToken');\\r\\n }\\r\\n\\r\\n function _balanceOfToken(address token) private view returns (uint256) {\\r\\n return (IERC20(token).balanceOf(address(this)));\\r\\n }\\r\\n\\r\\n /// @inheritdoc IPeripheryPayments\\r\\n function unwrapWNativeToken(uint256 amountMinimum, address recipient) external payable override {\\r\\n uint256 balanceWNativeToken = _balanceOfToken(WNativeToken);\\r\\n require(balanceWNativeToken \u003E= amountMinimum, 'Insufficient WNativeToken');\\r\\n\\r\\n if (balanceWNativeToken \u003E 0) {\\r\\n IWNativeToken(WNativeToken).withdraw(balanceWNativeToken);\\r\\n TransferHelper.safeTransferNative(recipient, balanceWNativeToken);\\r\\n }\\r\\n }\\r\\n\\r\\n /// @inheritdoc IPeripheryPayments\\r\\n function sweepToken(address token, uint256 amountMinimum, address recipient) external payable override {\\r\\n uint256 balanceToken = _balanceOfToken(token);\\r\\n require(balanceToken \u003E= amountMinimum, 'Insufficient token');\\r\\n\\r\\n if (balanceToken \u003E 0) {\\r\\n TransferHelper.safeTransfer(token, recipient, balanceToken);\\r\\n }\\r\\n }\\r\\n\\r\\n /// @inheritdoc IPeripheryPayments\\r\\n function refundNativeToken() external payable override {\\r\\n if (address(this).balance \u003E 0) TransferHelper.safeTransferNative(msg.sender, address(this).balance);\\r\\n }\\r\\n\\r\\n /// @param token The token to pay\\r\\n /// @param payer The entity that must pay\\r\\n /// @param recipient The entity that will receive payment\\r\\n /// @param value The amount to pay\\r\\n function pay(address token, address payer, address recipient, uint256 value) internal {\\r\\n if (token == WNativeToken && address(this).balance \u003E= value) {\\r\\n // pay with WNativeToken\\r\\n // \\\"address(this).balance \u003E= value\\\" may unexpectedly become false (including due to frontrun)\\r\\n // so this function should be accompanied by a `refundNativeToken` in multicall to avoid potential loss of tokens\\r\\n IWNativeToken(WNativeToken).deposit{value: value}(); // wrap only what is needed to pay\\r\\n IWNativeToken(WNativeToken).transfer(recipient, value);\\r\\n } else if (payer == address(this)) {\\r\\n // pay with tokens already in the contract (for the exact input multihop case)\\r\\n TransferHelper.safeTransfer(token, recipient, value);\\r\\n } else {\\r\\n // pull payment\\r\\n TransferHelper.safeTransferFrom(token, payer, recipient, value);\\r\\n }\\r\\n }\\r\\n}\\r\\n\"\r\n },\r\n \"contracts/base/PeripheryValidation.sol\": {\r\n \"content\": \"// SPDX-License-Identifier: GPL-2.0-or-later\\r\\npragma solidity =0.8.20;\\r\\n\\r\\nimport './BlockTimestamp.sol';\\r\\n\\r\\n/// @dev Credit to Uniswap Labs under GPL-2.0-or-later license:\\r\\n/// https://github.com/Uniswap/v3-periphery\\r\\nabstract contract PeripheryValidation is BlockTimestamp {\\r\\n modifier checkDeadline(uint256 deadline) {\\r\\n _checkDeadline(deadline);\\r\\n _;\\r\\n }\\r\\n\\r\\n function _checkDeadline(uint256 deadline) private view {\\r\\n require(_blockTimestamp() \u003C= deadline, 'Transaction too old');\\r\\n }\\r\\n}\\r\\n\"\r\n },\r\n \"contracts/base/PoolInitializer.sol\": {\r\n \"content\": \"// SPDX-License-Identifier: GPL-2.0-or-later\\r\\npragma solidity =0.8.20;\\r\\n\\r\\nimport '@cryptoalgebra/integral-core/contracts/interfaces/IAlgebraFactory.sol';\\r\\nimport '@cryptoalgebra/integral-core/contracts/interfaces/IAlgebraPool.sol';\\r\\nimport './PeripheryImmutableState.sol';\\r\\nimport '../interfaces/IPoolInitializer.sol';\\r\\n\\r\\nimport '../libraries/PoolInteraction.sol';\\r\\n\\r\\n/// @title Creates and initializes Algebra Pools\\r\\n/// @dev Credit to Uniswap Labs under GPL-2.0-or-later license:\\r\\n/// https://github.com/Uniswap/v3-periphery\\r\\nabstract contract PoolInitializer is IPoolInitializer, PeripheryImmutableState {\\r\\n using PoolInteraction for IAlgebraPool;\\r\\n\\r\\n /// @inheritdoc IPoolInitializer\\r\\n function createAndInitializePoolIfNecessary(\\r\\n address token0,\\r\\n address token1,\\r\\n uint160 sqrtPriceX96\\r\\n ) external payable override returns (address pool) {\\r\\n require(token0 \u003C token1, 'Invalid order of tokens');\\r\\n\\r\\n pool = IAlgebraFactory(factory).poolByPair(token0, token1);\\r\\n\\r\\n if (pool == address(0)) {\\r\\n pool = IAlgebraFactory(factory).createPool(token0, token1);\\r\\n\\r\\n _initializePool(pool, sqrtPriceX96);\\r\\n } else {\\r\\n uint160 sqrtPriceX96Existing = IAlgebraPool(pool)._getSqrtPrice();\\r\\n if (sqrtPriceX96Existing == 0) {\\r\\n _initializePool(pool, sqrtPriceX96);\\r\\n }\\r\\n }\\r\\n }\\r\\n\\r\\n function _initializePool(address pool, uint160 initPrice) private {\\r\\n IAlgebraPool(pool).initialize(initPrice);\\r\\n }\\r\\n}\\r\\n\"\r\n },\r\n \"contracts/base/SelfPermit.sol\": {\r\n \"content\": \"// SPDX-License-Identifier: GPL-2.0-or-later\\r\\npragma solidity \u003E=0.5.0;\\r\\n\\r\\nimport '@openzeppelin/contracts/token/ERC20/IERC20.sol';\\r\\nimport '@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol';\\r\\n\\r\\nimport '../interfaces/ISelfPermit.sol';\\r\\nimport '../interfaces/external/IERC20PermitAllowed.sol';\\r\\n\\r\\n/// @title Self Permit\\r\\n/// @notice Functionality to call permit on any EIP-2612-compliant token for use in the route\\r\\n/// @dev These functions are expected to be embedded in multicalls to allow EOAs to approve a contract and call a function\\r\\n/// that requires an approval in a single transaction.\\r\\nabstract contract SelfPermit is ISelfPermit {\\r\\n /// @inheritdoc ISelfPermit\\r\\n function selfPermit(\\r\\n address token,\\r\\n uint256 value,\\r\\n uint256 deadline,\\r\\n uint8 v,\\r\\n bytes32 r,\\r\\n bytes32 s\\r\\n ) public payable override {\\r\\n IERC20Permit(token).permit(msg.sender, address(this), value, deadline, v, r, s);\\r\\n }\\r\\n\\r\\n /// @inheritdoc ISelfPermit\\r\\n function selfPermitIfNecessary(\\r\\n address token,\\r\\n uint256 value,\\r\\n uint256 deadline,\\r\\n uint8 v,\\r\\n bytes32 r,\\r\\n bytes32 s\\r\\n ) external payable override {\\r\\n if (_getAllowance(token) \u003C value) selfPermit(token, value, deadline, v, r, s);\\r\\n }\\r\\n\\r\\n /// @inheritdoc ISelfPermit\\r\\n function selfPermitAllowed(\\r\\n address token,\\r\\n uint256 nonce,\\r\\n uint256 expiry,\\r\\n uint8 v,\\r\\n bytes32 r,\\r\\n bytes32 s\\r\\n ) public payable override {\\r\\n IERC20PermitAllowed(token).permit(msg.sender, address(this), nonce, expiry, true, v, r, s);\\r\\n }\\r\\n\\r\\n /// @inheritdoc ISelfPermit\\r\\n function selfPermitAllowedIfNecessary(\\r\\n address token,\\r\\n uint256 nonce,\\r\\n uint256 expiry,\\r\\n uint8 v,\\r\\n bytes32 r,\\r\\n bytes32 s\\r\\n ) external payable override {\\r\\n if (_getAllowance(token) \u003C type(uint256).max) selfPermitAllowed(token, nonce, expiry, v, r, s);\\r\\n }\\r\\n\\r\\n function _getAllowance(address token) private view returns (uint256) {\\r\\n return IERC20(token).allowance(msg.sender, address(this));\\r\\n }\\r\\n}\\r\\n\"\r\n },\r\n \"contracts/interfaces/external/IERC1271.sol\": {\r\n \"content\": \"// SPDX-License-Identifier: GPL-2.0-or-later\\r\\npragma solidity \u003E=0.5.0;\\r\\n\\r\\n/// @title Interface for verifying contract-based account signatures\\r\\n/// @notice Interface that verifies provided signature for the data\\r\\n/// @dev Interface defined by EIP-1271\\r\\ninterface IERC1271 {\\r\\n /// @notice Returns whether the provided signature is valid for the provided data\\r\\n /// @dev MUST return the bytes4 magic value 0x1626ba7e when function passes.\\r\\n /// MUST NOT modify state (using STATICCALL for solc \u003C 0.5, view modifier for solc \u003E 0.5).\\r\\n /// MUST allow external calls.\\r\\n /// @param hash Hash of the data to be signed\\r\\n /// @param signature Signature byte array associated with _data\\r\\n /// @return magicValue The bytes4 magic value 0x1626ba7e\\r\\n function isValidSignature(bytes32 hash, bytes memory signature) external view returns (bytes4 magicValue);\\r\\n}\\r\\n\"\r\n },\r\n \"contracts/interfaces/external/IERC20PermitAllowed.sol\": {\r\n \"content\": \"// SPDX-License-Identifier: GPL-2.0-or-later\\r\\npragma solidity \u003E=0.5.0;\\r\\n\\r\\n/// @title Interface for permit\\r\\n/// @notice Interface used by DAI/CHAI for permit\\r\\ninterface IERC20PermitAllowed {\\r\\n /// @notice Approve the spender to spend some tokens via the holder signature\\r\\n /// @dev This is the permit interface used by DAI and CHAI\\r\\n /// @param holder The address of the token holder, the token owner\\r\\n /// @param spender The address of the token spender\\r\\n /// @param nonce The holder's nonce, increases at each call to permit\\r\\n /// @param expiry The timestamp at which the permit is no longer valid\\r\\n /// @param allowed Boolean that sets approval amount, true for type(uint256).max and false for 0\\r\\n /// @param v Must produce valid secp256k1 signature from the holder along with `r` and `s`\\r\\n /// @param r Must produce valid secp256k1 signature from the holder along with `v` and `s`\\r\\n /// @param s Must produce valid secp256k1 signature from the holder along with `r` and `v`\\r\\n function permit(\\r\\n address holder,\\r\\n address spender,\\r\\n uint256 nonce,\\r\\n uint256 expiry,\\r\\n bool allowed,\\r\\n uint8 v,\\r\\n bytes32 r,\\r\\n bytes32 s\\r\\n ) external;\\r\\n}\\r\\n\"\r\n },\r\n \"contracts/interfaces/external/IWNativeToken.sol\": {\r\n \"content\": \"// SPDX-License-Identifier: GPL-2.0-or-later\\r\\npragma solidity ^0.8.0;\\r\\n\\r\\nimport '@openzeppelin/contracts/token/ERC20/IERC20.sol';\\r\\n\\r\\n/// @title Interface for WNativeToken\\r\\ninterface IWNativeToken is IERC20 {\\r\\n /// @notice Deposit ether to get wrapped ether\\r\\n function deposit() external payable;\\r\\n\\r\\n /// @notice Withdraw wrapped ether to get ether\\r\\n function withdraw(uint256) external;\\r\\n}\\r\\n\"\r\n },\r\n \"contracts/interfaces/IERC721Permit.sol\": {\r\n \"content\": \"// SPDX-License-Identifier: GPL-2.0-or-later\\r\\npragma solidity \u003E=0.7.5;\\r\\n\\r\\nimport '@openzeppelin/contracts/token/ERC721/IERC721.sol';\\r\\n\\r\\n/// @title ERC721 with permit\\r\\n/// @notice Extension to ERC721 that includes a permit function for signature based approvals\\r\\ninterface IERC721Permit is IERC721 {\\r\\n /// @notice The permit typehash used in the permit signature\\r\\n /// @return The typehash for the permit\\r\\n function PERMIT_TYPEHASH() external pure returns (bytes32);\\r\\n\\r\\n /// @notice The domain separator used in the permit signature\\r\\n /// @return The domain separator used in encoding of permit signature\\r\\n function DOMAIN_SEPARATOR() external view returns (bytes32);\\r\\n\\r\\n /// @notice Approve of a specific token ID for spending by spender via signature\\r\\n /// @param spender The account that is being approved\\r\\n /// @param tokenId The ID of the token that is being approved for spending\\r\\n /// @param deadline The deadline timestamp by which the call must be mined for the approve to work\\r\\n /// @param v Must produce valid secp256k1 signature from the holder along with `r` and `s`\\r\\n /// @param r Must produce valid secp256k1 signature from the holder along with `v` and `s`\\r\\n /// @param s Must produce valid secp256k1 signature from the holder along with `r` and `v`\\r\\n function permit(\\r\\n address spender,\\r\\n uint256 tokenId,\\r\\n uint256 deadline,\\r\\n uint8 v,\\r\\n bytes32 r,\\r\\n bytes32 s\\r\\n ) external payable;\\r\\n}\\r\\n\"\r\n },\r\n \"contracts/interfaces/IMulticall.sol\": {\r\n \"content\": \"// SPDX-License-Identifier: GPL-2.0-or-later\\r\\npragma solidity \u003E=0.7.5;\\r\\npragma abicoder v2;\\r\\n\\r\\n/// @title Multicall interface\\r\\n/// @notice Enables calling multiple methods in a single call to the contract\\r\\ninterface IMulticall {\\r\\n /// @notice Call multiple functions in the current contract and return the data from all of them if they all succeed\\r\\n /// @dev The `msg.value` should not be trusted for any method callable from multicall.\\r\\n /// @param data The encoded function data for each of the calls to make to this contract\\r\\n /// @return results The results from each of the calls passed in via data\\r\\n function multicall(bytes[] calldata data) external payable returns (bytes[] memory results);\\r\\n}\\r\\n\"\r\n },\r\n \"contracts/interfaces/INonfungiblePositionManager.sol\": {\r\n \"content\": \"// SPDX-License-Identifier: GPL-2.0-or-later\\r\\npragma solidity \u003E=0.7.5;\\r\\npragma abicoder v2;\\r\\n\\r\\nimport '@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol';\\r\\nimport '@openzeppelin/contracts/token/ERC721/extensions/IERC721Enumerable.sol';\\r\\n\\r\\nimport './IPoolInitializer.sol';\\r\\nimport './IERC721Permit.sol';\\r\\nimport './IPeripheryPayments.sol';\\r\\nimport './IPeripheryImmutableState.sol';\\r\\n\\r\\n/// @title Non-fungible token for positions\\r\\n/// @notice Wraps Algebra positions in a non-fungible token interface which allows for them to be transferred\\r\\n/// and authorized.\\r\\n/// @dev Credit to Uniswap Labs under GPL-2.0-or-later license:\\r\\n/// https://github.com/Uniswap/v3-periphery\\r\\ninterface INonfungiblePositionManager is\\r\\n IPoolInitializer,\\r\\n IPeripheryPayments,\\r\\n IPeripheryImmutableState,\\r\\n IERC721Metadata,\\r\\n IERC721Enumerable,\\r\\n IERC721Permit\\r\\n{\\r\\n /// @notice Emitted when liquidity is increased for a position NFT\\r\\n /// @dev Also emitted when a token is minted\\r\\n /// @param tokenId The ID of the token for which liquidity was increased\\r\\n /// @param liquidityDesired The amount by which liquidity for the NFT position was increased\\r\\n /// @param actualLiquidity the actual liquidity that was added into a pool. Could differ from\\r\\n /// _liquidity_ when using FeeOnTransfer tokens\\r\\n /// @param amount0 The amount of token0 that was paid for the increase in liquidity\\r\\n /// @param amount1 The amount of token1 that was paid for the increase in liquidity\\r\\n event IncreaseLiquidity(\\r\\n uint256 indexed tokenId,\\r\\n uint128 liquidityDesired,\\r\\n uint128 actualLiquidity,\\r\\n uint256 amount0,\\r\\n uint256 amount1,\\r\\n address pool\\r\\n );\\r\\n\\r\\n /// @notice Emitted when liquidity is decreased for a position NFT\\r\\n /// @param tokenId The ID of the token for which liquidity was decreased\\r\\n /// @param liquidity The amount by which liquidity for the NFT position was decreased\\r\\n /// @param amount0 The amount of token0 that was accounted for the decrease in liquidity\\r\\n /// @param amount1 The amount of token1 that was accounted for the decrease in liquidity\\r\\n event DecreaseLiquidity(uint256 indexed tokenId, uint128 liquidity, uint256 amount0, uint256 amount1);\\r\\n\\r\\n /// @notice Emitted when tokens are collected for a position NFT\\r\\n /// @dev The amounts reported may not be exactly equivalent to the amounts transferred, due to rounding behavior\\r\\n /// @param tokenId The ID of the token for which underlying tokens were collected\\r\\n /// @param recipient The address of the account that received the collected tokens\\r\\n /// @param amount0 The amount of token0 owed to the position that was collected\\r\\n /// @param amount1 The amount of token1 owed to the position that was collected\\r\\n event Collect(uint256 indexed tokenId, address recipient, uint256 amount0, uint256 amount1);\\r\\n\\r\\n /// @notice Emitted if farming failed in call from NonfungiblePositionManager.\\r\\n /// @dev Should never be emitted\\r\\n /// @param tokenId The ID of corresponding token\\r\\n event FarmingFailed(uint256 indexed tokenId);\\r\\n\\r\\n /// @notice Emitted after farming center address change\\r\\n /// @param farmingCenterAddress The new address of connected farming center\\r\\n event FarmingCenter(address farmingCenterAddress);\\r\\n\\r\\n /// @notice Returns the position information associated with a given token ID.\\r\\n /// @dev Throws if the token ID is not valid.\\r\\n /// @param tokenId The ID of the token that represents the position\\r\\n /// @return nonce The nonce for permits\\r\\n /// @return operator The address that is approved for spending\\r\\n /// @return token0 The address of the token0 for a specific pool\\r\\n /// @return token1 The address of the token1 for a specific pool\\r\\n /// @return tickLower The lower end of the tick range for the position\\r\\n /// @return tickUpper The higher end of the tick range for the position\\r\\n /// @return liquidity The liquidity of the position\\r\\n /// @return feeGrowthInside0LastX128 The fee growth of token0 as of the last action on the individual position\\r\\n /// @return feeGrowthInside1LastX128 The fee growth of token1 as of the last action on the individual position\\r\\n /// @return tokensOwed0 The uncollected amount of token0 owed to the position as of the last computation\\r\\n /// @return tokensOwed1 The uncollected amount of token1 owed to the position as of the last computation\\r\\n function positions(\\r\\n uint256 tokenId\\r\\n )\\r\\n external\\r\\n view\\r\\n returns (\\r\\n uint88 nonce,\\r\\n address operator,\\r\\n address token0,\\r\\n address token1,\\r\\n int24 tickLower,\\r\\n int24 tickUpper,\\r\\n uint128 liquidity,\\r\\n uint256 feeGrowthInside0LastX128,\\r\\n uint256 feeGrowthInside1LastX128,\\r\\n uint128 tokensOwed0,\\r\\n uint128 tokensOwed1\\r\\n );\\r\\n\\r\\n struct MintParams {\\r\\n address token0;\\r\\n address token1;\\r\\n int24 tickLower;\\r\\n int24 tickUpper;\\r\\n uint256 amount0Desired;\\r\\n uint256 amount1Desired;\\r\\n uint256 amount0Min;\\r\\n uint256 amount1Min;\\r\\n address recipient;\\r\\n uint256 deadline;\\r\\n }\\r\\n\\r\\n /// @notice Creates a new position wrapped in a NFT\\r\\n /// @dev Call this when the pool does exist and is initialized. Note that if the pool is created but not initialized\\r\\n /// a method does not exist, i.e. the pool is assumed to be initialized.\\r\\n /// @dev If native token is used as input, this function should be accompanied by a `refundNativeToken` in multicall to avoid potential loss of native tokens\\r\\n /// @param params The params necessary to mint a position, encoded as `MintParams` in calldata\\r\\n /// @return tokenId The ID of the token that represents the minted position\\r\\n /// @return liquidity The liquidity delta amount as a result of the increase\\r\\n /// @return amount0 The amount of token0\\r\\n /// @return amount1 The amount of token1\\r\\n function mint(\\r\\n MintParams calldata params\\r\\n ) external payable returns (uint256 tokenId, uint128 liquidity, uint256 amount0, uint256 amount1);\\r\\n\\r\\n struct IncreaseLiquidityParams {\\r\\n uint256 tokenId;\\r\\n uint256 amount0Desired;\\r\\n uint256 amount1Desired;\\r\\n uint256 amount0Min;\\r\\n uint256 amount1Min;\\r\\n uint256 deadline;\\r\\n }\\r\\n\\r\\n /// @notice Increases the amount of liquidity in a position, with tokens paid by the `msg.sender`\\r\\n /// @param params tokenId The ID of the token for which liquidity is being increased,\\r\\n /// amount0Desired The desired amount of token0 to be spent,\\r\\n /// amount1Desired The desired amount of token1 to be spent,\\r\\n /// amount0Min The minimum amount of token0 to spend, which serves as a slippage check,\\r\\n /// amount1Min The minimum amount of token1 to spend, which serves as a slippage check,\\r\\n /// deadline The time by which the transaction must be included to effect the change\\r\\n /// @dev If native token is used as input, this function should be accompanied by a `refundNativeToken` in multicall to avoid potential loss of native tokens\\r\\n /// @return liquidity The liquidity delta amount as a result of the increase\\r\\n /// @return amount0 The amount of token0 to achieve resulting liquidity\\r\\n /// @return amount1 The amount of token1 to achieve resulting liquidity\\r\\n function increaseLiquidity(\\r\\n IncreaseLiquidityParams calldata params\\r\\n ) external payable returns (uint128 liquidity, uint256 amount0, uint256 amount1);\\r\\n\\r\\n struct DecreaseLiquidityParams {\\r\\n uint256 tokenId;\\r\\n uint128 liquidity;\\r\\n uint256 amount0Min;\\r\\n uint256 amount1Min;\\r\\n uint256 deadline;\\r\\n }\\r\\n\\r\\n /// @notice Decreases the amount of liquidity in a position and accounts it to the position\\r\\n /// @param params tokenId The ID of the token for which liquidity is being decreased,\\r\\n /// amount The amount by which liquidity will be decreased,\\r\\n /// amount0Min The minimum amount of token0 that should be accounted for the burned liquidity,\\r\\n /// amount1Min The minimum amount of token1 that should be accounted for the burned liquidity,\\r\\n /// deadline The time by which the transaction must be included to effect the change\\r\\n /// @return amount0 The amount of token0 accounted to the position's tokens owed\\r\\n /// @return amount1 The amount of token1 accounted to the position's tokens owed\\r\\n function decreaseLiquidity(\\r\\n DecreaseLiquidityParams calldata params\\r\\n ) external payable returns (uint256 amount0, uint256 amount1);\\r\\n\\r\\n struct CollectParams {\\r\\n uint256 tokenId;\\r\\n address recipient;\\r\\n uint128 amount0Max;\\r\\n uint128 amount1Max;\\r\\n }\\r\\n\\r\\n /// @notice Collects up to a maximum amount of fees owed to a specific position to the recipient\\r\\n /// @param params tokenId The ID of the NFT for which tokens are being collected,\\r\\n /// recipient The account that should receive the tokens,\\r\\n /// amount0Max The maximum amount of token0 to collect,\\r\\n /// amount1Max The maximum amount of token1 to collect\\r\\n /// @return amount0 The amount of fees collected in token0\\r\\n /// @return amount1 The amount of fees collected in token1\\r\\n function collect(CollectParams calldata params) external payable returns (uint256 amount0, uint256 amount1);\\r\\n\\r\\n /// @notice Burns a token ID, which deletes it from the NFT contract. The token must have 0 liquidity and all tokens\\r\\n /// must be collected first.\\r\\n /// @param tokenId The ID of the token that is being burned\\r\\n function burn(uint256 tokenId) external payable;\\r\\n\\r\\n /// @notice Changes approval of token ID for farming.\\r\\n /// @param tokenId The ID of the token that is being approved / unapproved\\r\\n /// @param approve New status of approval\\r\\n /// @param farmingAddress The address of farming: used to prevent tx frontrun\\r\\n function approveForFarming(uint256 tokenId, bool approve, address farmingAddress) external payable;\\r\\n\\r\\n /// @notice Changes farming status of token to 'farmed' or 'not farmed'\\r\\n /// @dev can be called only by farmingCenter\\r\\n /// @param tokenId The ID of the token\\r\\n /// @param toActive The new status\\r\\n function switchFarmingStatus(uint256 tokenId, bool toActive) external;\\r\\n\\r\\n /// @notice Changes address of farmingCenter\\r\\n /// @dev can be called only by factory owner or NONFUNGIBLE_POSITION_MANAGER_ADMINISTRATOR_ROLE\\r\\n /// @param newFarmingCenter The new address of farmingCenter\\r\\n function setFarmingCenter(address newFarmingCenter) external;\\r\\n\\r\\n /// @notice Returns whether `spender` is allowed to manage `tokenId`\\r\\n /// @dev Requirement: `tokenId` must exist\\r\\n function isApprovedOrOwner(address spender, uint256 tokenId) external view returns (bool);\\r\\n\\r\\n /// @notice Returns the address of currently connected farming, if any\\r\\n /// @return The address of the farming center contract, which handles farmings logic\\r\\n function farmingCenter() external view returns (address);\\r\\n\\r\\n /// @notice Returns the address of farming that is approved for this token, if any\\r\\n function farmingApprovals(uint256 tokenId) external view returns (address);\\r\\n\\r\\n /// @notice Returns the address of farming in which this token is farmed, if any\\r\\n function tokenFarmedIn(uint256 tokenId) external view returns (address);\\r\\n}\\r\\n\"\r\n },\r\n \"contracts/interfaces/INonfungibleTokenPositionDescriptor.sol\": {\r\n \"content\": \"// SPDX-License-Identifier: GPL-2.0-or-later\\r\\npragma solidity \u003E=0.5.0;\\r\\n\\r\\nimport './INonfungiblePositionManager.sol';\\r\\n\\r\\n/// @title Describes position NFT tokens via URI\\r\\n/// @dev Credit to Uniswap Labs under GPL-2.0-or-later license:\\r\\n/// https://github.com/Uniswap/v3-periphery\\r\\ninterface INonfungibleTokenPositionDescriptor {\\r\\n /// @notice Produces the URI describing a particular token ID for a position manager\\r\\n /// @dev Note this URI may be a data: URI with the JSON contents directly inlined\\r\\n /// @param positionManager The position manager for which to describe the token\\r\\n /// @param tokenId The ID of the token for which to produce a description, which may not be valid\\r\\n /// @return The URI of the ERC721-compliant metadata\\r\\n function tokenURI(INonfungiblePositionManager positionManager, uint256 tokenId)\\r\\n external\\r\\n view\\r\\n returns (string memory);\\r\\n}\\r\\n\"\r\n },\r\n \"contracts/interfaces/IPeripheryImmutableState.sol\": {\r\n \"content\": \"// SPDX-License-Identifier: GPL-2.0-or-later\\r\\npragma solidity \u003E=0.5.0;\\r\\n\\r\\n/// @title Immutable state\\r\\n/// @notice Functions that return immutable state of the router\\r\\n/// @dev Credit to Uniswap Labs under GPL-2.0-or-later license:\\r\\n/// https://github.com/Uniswap/v3-periphery\\r\\ninterface IPeripheryImmutableState {\\r\\n /// @return Returns the address of the Algebra factory\\r\\n function factory() external view returns (address);\\r\\n\\r\\n /// @return Returns the address of the pool Deployer\\r\\n function poolDeployer() external view returns (address);\\r\\n\\r\\n /// @return Returns the address of WNativeToken\\r\\n function WNativeToken() external view returns (address);\\r\\n}\\r\\n\"\r\n },\r\n \"contracts/interfaces/IPeripheryPayments.sol\": {\r\n \"content\": \"// SPDX-License-Identifier: GPL-2.0-or-later\\r\\npragma solidity \u003E=0.7.5;\\r\\n\\r\\n/// @title Periphery Payments\\r\\n/// @notice Functions to ease deposits and withdrawals of NativeToken\\r\\n/// @dev Credit to Uniswap Labs under GPL-2.0-or-later license:\\r\\n/// https://github.com/Uniswap/v3-periphery\\r\\ninterface IPeripheryPayments {\\r\\n /// @notice Unwraps the contract's WNativeToken balance and sends it to recipient as NativeToken.\\r\\n /// @dev The amountMinimum parameter prevents malicious contracts from stealing WNativeToken from users.\\r\\n /// @param amountMinimum The minimum amount of WNativeToken to unwrap\\r\\n /// @param recipient The address receiving NativeToken\\r\\n function unwrapWNativeToken(uint256 amountMinimum, address recipient) external payable;\\r\\n\\r\\n /// @notice Refunds any NativeToken balance held by this contract to the `msg.sender`\\r\\n /// @dev Useful for bundling with mint or increase liquidity that uses ether, or exact output swaps\\r\\n /// that use ether for the input amount\\r\\n function refundNativeToken() external payable;\\r\\n\\r\\n /// @notice Transfers the full amount of a token held by this contract to recipient\\r\\n /// @dev The amountMinimum parameter prevents malicious contracts from stealing the token from users\\r\\n /// @param token The contract address of the token which will be transferred to `recipient`\\r\\n /// @param amountMinimum The minimum amount of token required for a transfer\\r\\n /// @param recipient The destination address of the token\\r\\n function sweepToken(\\r\\n address token,\\r\\n uint256 amountMinimum,\\r\\n address recipient\\r\\n ) external payable;\\r\\n}\\r\\n\"\r\n },\r\n \"contracts/interfaces/IPoolInitializer.sol\": {\r\n \"content\": \"// SPDX-License-Identifier: GPL-2.0-or-later\\r\\npragma solidity \u003E=0.7.5;\\r\\npragma abicoder v2;\\r\\n\\r\\n/// @title Creates and initializes Algebra Pools\\r\\n/// @notice Provides a method for creating and initializing a pool, if necessary, for bundling with other methods that\\r\\n/// require the pool to exist.\\r\\n/// @dev Credit to Uniswap Labs under GPL-2.0-or-later license:\\r\\n/// https://github.com/Uniswap/v3-periphery\\r\\ninterface IPoolInitializer {\\r\\n /// @notice Creates a new pool if it does not exist, then initializes if not initialized\\r\\n /// @dev This method can be bundled with others via IMulticall for the first action (e.g. mint) performed against a pool\\r\\n /// @param token0 The contract address of token0 of the pool\\r\\n /// @param token1 The contract address of token1 of the pool\\r\\n /// @param sqrtPriceX96 The initial square root price of the pool as a Q64.96 value\\r\\n /// @return pool Returns the pool address based on the pair of tokens and fee, will return the newly created pool address if necessary\\r\\n function createAndInitializePoolIfNecessary(\\r\\n address token0,\\r\\n address token1,\\r\\n uint160 sqrtPriceX96\\r\\n ) external payable returns (address pool);\\r\\n}\\r\\n\"\r\n },\r\n \"contracts/interfaces/IPositionFollower.sol\": {\r\n \"content\": \"// SPDX-License-Identifier: GPL-2.0-or-later\\r\\npragma solidity \u003E=0.5.0;\\r\\n\\r\\n/// @title Contract tracking liquidity position\\r\\n/// @notice Using these methods farmingCenter receives information about changes in the positions\\r\\ninterface IPositionFollower {\\r\\n /// @notice Report a change of liquidity in position\\r\\n /// @param tokenId The ID of the token for which liquidity is being added\\r\\n /// @param liquidityDelta The amount of added liquidity\\r\\n function applyLiquidityDelta(uint256 tokenId, int256 liquidityDelta) external;\\r\\n}\\r\\n\"\r\n },\r\n \"contracts/interfaces/ISelfPermit.sol\": {\r\n \"content\": \"// SPDX-License-Identifier: GPL-2.0-or-later\\r\\npragma solidity \u003E=0.7.5;\\r\\n\\r\\n/// @title Self Permit\\r\\n/// @notice Functionality to call permit on any EIP-2612-compliant token for use in the route\\r\\ninterface ISelfPermit {\\r\\n /// @notice Permits this contract to spend a given token from `msg.sender`\\r\\n /// @dev The `owner` is always msg.sender and the `spender` is always address(this).\\r\\n /// @param token The address of the token spent\\r\\n /// @param value The amount that can be spent of token\\r\\n /// @param deadline A timestamp, the current blocktime must be less than or equal to this timestamp\\r\\n /// @param v Must produce valid secp256k1 signature from the holder along with `r` and `s`\\r\\n /// @param r Must produce valid secp256k1 signature from the holder along with `v` and `s`\\r\\n /// @param s Must produce valid secp256k1 signature from the holder along with `r` and `v`\\r\\n function selfPermit(\\r\\n address token,\\r\\n uint256 value,\\r\\n uint256 deadline,\\r\\n uint8 v,\\r\\n bytes32 r,\\r\\n bytes32 s\\r\\n ) external payable;\\r\\n\\r\\n /// @notice Permits this contract to spend a given token from `msg.sender`\\r\\n /// @dev The `owner` is always msg.sender and the `spender` is always address(this).\\r\\n /// Can be used instead of #selfPermit to prevent calls from failing due to a frontrun of a call to #selfPermit\\r\\n /// @param token The address of the token spent\\r\\n /// @param value The amount that can be spent of token\\r\\n /// @param deadline A timestamp, the current blocktime must be less than or equal to this timestamp\\r\\n /// @param v Must produce valid secp256k1 signature from the holder along with `r` and `s`\\r\\n /// @param r Must produce valid secp256k1 signature from the holder along with `v` and `s`\\r\\n /// @param s Must produce valid secp256k1 signature from the holder along with `r` and `v`\\r\\n function selfPermitIfNecessary(\\r\\n address token,\\r\\n uint256 value,\\r\\n uint256 deadline,\\r\\n uint8 v,\\r\\n bytes32 r,\\r\\n bytes32 s\\r\\n ) external payable;\\r\\n\\r\\n /// @notice Permits this contract to spend the sender's tokens for permit signatures that have the `allowed` parameter\\r\\n /// @dev The `owner` is always msg.sender and the `spender` is always address(this)\\r\\n /// @param token The address of the token spent\\r\\n /// @param nonce The current nonce of the owner\\r\\n /// @param expiry The timestamp at which the permit is no longer valid\\r\\n /// @param v Must produce valid secp256k1 signature from the holder along with `r` and `s`\\r\\n /// @param r Must produce valid secp256k1 signature from the holder along with `v` and `s`\\r\\n /// @param s Must produce valid secp256k1 signature from the holder along with `r` and `v`\\r\\n function selfPermitAllowed(\\r\\n address token,\\r\\n uint256 nonce,\\r\\n uint256 expiry,\\r\\n uint8 v,\\r\\n bytes32 r,\\r\\n bytes32 s\\r\\n ) external payable;\\r\\n\\r\\n /// @notice Permits this contract to spend the sender's tokens for permit signatures that have the `allowed` parameter\\r\\n /// @dev The `owner` is always msg.sender and the `spender` is always address(this)\\r\\n /// Can be used instead of #selfPermitAllowed to prevent calls from failing due to a frontrun of a call to #selfPermitAllowed.\\r\\n /// @param token The address of the token spent\\r\\n /// @param nonce The current nonce of the owner\\r\\n /// @param expiry The timestamp at which the permit is no longer valid\\r\\n /// @param v Must produce valid secp256k1 signature from the holder along with `r` and `s`\\r\\n /// @param r Must produce valid secp256k1 signature from the holder along with `v` and `s`\\r\\n /// @param s Must produce valid secp256k1 signature from the holder along with `r` and `v`\\r\\n function selfPermitAllowedIfNecessary(\\r\\n address token,\\r\\n uint256 nonce,\\r\\n uint256 expiry,\\r\\n uint8 v,\\r\\n bytes32 r,\\r\\n bytes32 s\\r\\n ) external payable;\\r\\n}\\r\\n\"\r\n },\r\n \"contracts/libraries/CallbackValidation.sol\": {\r\n \"content\": \"// SPDX-License-Identifier: GPL-2.0-or-later\\r\\npragma solidity ^0.8.0;\\r\\n\\r\\nimport '@cryptoalgebra/integral-core/contracts/interfaces/IAlgebraPool.sol';\\r\\nimport './PoolAddress.sol';\\r\\n\\r\\n/// @notice Provides validation for callbacks from Algebra Pools\\r\\n/// @dev Credit to Uniswap Labs under GPL-2.0-or-later license:\\r\\n/// https://github.com/Uniswap/v3-periphery\\r\\nlibrary CallbackValidation {\\r\\n /// @notice Returns the address of a valid Algebra Pool\\r\\n /// @param poolDeployer The contract address of the Algebra pool deployer\\r\\n /// @param tokenA The contract address of either token0 or token1\\r\\n /// @param tokenB The contract address of the other token\\r\\n /// @return pool The Algebra pool contract address\\r\\n function verifyCallback(\\r\\n address poolDeployer,\\r\\n address tokenA,\\r\\n address tokenB\\r\\n ) internal view returns (IAlgebraPool pool) {\\r\\n return verifyCallback(poolDeployer, PoolAddress.getPoolKey(tokenA, tokenB));\\r\\n }\\r\\n\\r\\n /// @notice Returns the address of a valid Algebra Pool\\r\\n /// @param poolDeployer The contract address of the Algebra pool deployer\\r\\n /// @param poolKey The identifying key of the ALgebra pool\\r\\n /// @return pool The Algebra pool contract address\\r\\n function verifyCallback(\\r\\n address poolDeployer,\\r\\n PoolAddress.PoolKey memory poolKey\\r\\n ) internal view returns (IAlgebraPool pool) {\\r\\n pool = IAlgebraPool(PoolAddress.computeAddress(poolDeployer, poolKey));\\r\\n require(msg.sender == address(pool), 'Invalid caller of callback');\\r\\n }\\r\\n}\\r\\n\"\r\n },\r\n \"contracts/libraries/LiquidityAmounts.sol\": {\r\n \"content\": \"// SPDX-License-Identifier: GPL-2.0-or-later\\r\\npragma solidity \u003E=0.5.0;\\r\\n\\r\\nimport '@cryptoalgebra/integral-core/contracts/libraries/FullMath.sol';\\r\\nimport '@cryptoalgebra/integral-core/contracts/libraries/Constants.sol';\\r\\n\\r\\n/// @title Liquidity amount functions\\r\\n/// @notice Provides functions for computing liquidity amounts from token amounts and prices\\r\\n/// @dev Credit to Uniswap Labs under GPL-2.0-or-later license:\\r\\n/// https://github.com/Uniswap/v3-periphery\\r\\nlibrary LiquidityAmounts {\\r\\n /// @notice Downcasts uint256 to uint128\\r\\n /// @param x The uint258 to be downcasted\\r\\n /// @return y The passed value, downcasted to uint128\\r\\n function toUint128(uint256 x) private pure returns (uint128 y) {\\r\\n require((y = uint128(x)) == x);\\r\\n }\\r\\n\\r\\n /// @notice Computes the amount of liquidity received for a given amount of token0 and price range\\r\\n /// @dev Calculates amount0 * (sqrt(upper) * sqrt(lower)) / (sqrt(upper) - sqrt(lower))\\r\\n /// @param sqrtRatioAX96 A sqrt price representing the first tick boundary\\r\\n /// @param sqrtRatioBX96 A sqrt price representing the second tick boundary\\r\\n /// @param amount0 The amount0 being sent in\\r\\n /// @return liquidity The amount of returned liquidity\\r\\n function getLiquidityForAmount0(\\r\\n uint160 sqrtRatioAX96,\\r\\n uint160 sqrtRatioBX96,\\r\\n uint256 amount0\\r\\n ) internal pure returns (uint128 liquidity) {\\r\\n if (sqrtRatioAX96 \u003E sqrtRatioBX96) (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\\r\\n uint256 intermediate = FullMath.mulDiv(sqrtRatioAX96, sqrtRatioBX96, Constants.Q96);\\r\\n unchecked {\\r\\n return toUint128(FullMath.mulDiv(amount0, intermediate, sqrtRatioBX96 - sqrtRatioAX96));\\r\\n }\\r\\n }\\r\\n\\r\\n /// @notice Computes the amount of liquidity received for a given amount of token1 and price range\\r\\n /// @dev Calculates amount1 / (sqrt(upper) - sqrt(lower)).\\r\\n /// @param sqrtRatioAX96 A sqrt price representing the first tick boundary\\r\\n /// @param sqrtRatioBX96 A sqrt price representing the second tick boundary\\r\\n /// @param amount1 The amount1 being sent in\\r\\n /// @return liquidity The amount of returned liquidity\\r\\n function getLiquidityForAmount1(\\r\\n uint160 sqrtRatioAX96,\\r\\n uint160 sqrtRatioBX96,\\r\\n uint256 amount1\\r\\n ) internal pure returns (uint128 liquidity) {\\r\\n if (sqrtRatioAX96 \u003E sqrtRatioBX96) (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\\r\\n unchecked {\\r\\n return toUint128(FullMath.mulDiv(amount1, Constants.Q96, sqrtRatioBX96 - sqrtRatioAX96));\\r\\n }\\r\\n }\\r\\n\\r\\n /// @notice Computes the maximum amount of liquidity received for a given amount of token0, token1, the current\\r\\n /// pool prices and the prices at the tick boundaries\\r\\n /// @param sqrtRatioX96 A sqrt price representing the current pool prices\\r\\n /// @param sqrtRatioAX96 A sqrt price representing the first tick boundary\\r\\n /// @param sqrtRatioBX96 A sqrt price representing the second tick boundary\\r\\n /// @param amount0 The amount of token0 being sent in\\r\\n /// @param amount1 The amount of token1 being sent in\\r\\n /// @return liquidity The maximum amount of liquidity received\\r\\n function getLiquidityForAmounts(\\r\\n uint160 sqrtRatioX96,\\r\\n uint160 sqrtRatioAX96,\\r\\n uint160 sqrtRatioBX96,\\r\\n uint256 amount0,\\r\\n uint256 amount1\\r\\n ) internal pure returns (uint128 liquidity) {\\r\\n if (sqrtRatioAX96 \u003E sqrtRatioBX96) (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\\r\\n\\r\\n if (sqrtRatioX96 \u003C= sqrtRatioAX96) {\\r\\n liquidity = getLiquidityForAmount0(sqrtRatioAX96, sqrtRatioBX96, amount0);\\r\\n } else if (sqrtRatioX96 \u003C sqrtRatioBX96) {\\r\\n uint128 liquidity0 = getLiquidityForAmount0(sqrtRatioX96, sqrtRatioBX96, amount0);\\r\\n uint128 liquidity1 = getLiquidityForAmount1(sqrtRatioAX96, sqrtRatioX96, amount1);\\r\\n\\r\\n liquidity = liquidity0 \u003C liquidity1 ? liquidity0 : liquidity1;\\r\\n } else {\\r\\n liquidity = getLiquidityForAmount1(sqrtRatioAX96, sqrtRatioBX96, amount1);\\r\\n }\\r\\n }\\r\\n\\r\\n /// @notice Computes the amount of token0 for a given amount of liquidity and a price range\\r\\n /// @param sqrtRatioAX96 A sqrt price representing the first tick boundary\\r\\n /// @param sqrtRatioBX96 A sqrt price representing the second tick boundary\\r\\n /// @param liquidity The liquidity being valued\\r\\n /// @return amount0 The amount of token0\\r\\n function getAmount0ForLiquidity(\\r\\n uint160 sqrtRatioAX96,\\r\\n uint160 sqrtRatioBX96,\\r\\n uint128 liquidity\\r\\n ) internal pure returns (uint256 amount0) {\\r\\n unchecked {\\r\\n if (sqrtRatioAX96 \u003E sqrtRatioBX96) (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\\r\\n\\r\\n return\\r\\n FullMath.mulDiv(\\r\\n uint256(liquidity) \u003C\u003C Constants.RESOLUTION,\\r\\n sqrtRatioBX96 - sqrtRatioAX96,\\r\\n sqrtRatioBX96\\r\\n ) / sqrtRatioAX96;\\r\\n }\\r\\n }\\r\\n\\r\\n /// @notice Computes the amount of token1 for a given amount of liquidity and a price range\\r\\n /// @param sqrtRatioAX96 A sqrt price representing the first tick boundary\\r\\n /// @param sqrtRatioBX96 A sqrt price representing the second tick boundary\\r\\n /// @param liquidity The liquidity being valued\\r\\n /// @return amount1 The amount of token1\\r\\n function getAmount1ForLiquidity(\\r\\n uint160 sqrtRatioAX96,\\r\\n uint160 sqrtRatioBX96,\\r\\n uint128 liquidity\\r\\n ) internal pure returns (uint256 amount1) {\\r\\n if (sqrtRatioAX96 \u003E sqrtRatioBX96) (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\\r\\n unchecked {\\r\\n return FullMath.mulDiv(liquidity, sqrtRatioBX96 - sqrtRatioAX96, Constants.Q96);\\r\\n }\\r\\n }\\r\\n\\r\\n /// @notice Computes the token0 and token1 value for a given amount of liquidity, the current\\r\\n /// pool prices and the prices at the tick boundaries\\r\\n /// @param sqrtRatioX96 A sqrt price representing the current pool prices\\r\\n /// @param sqrtRatioAX96 A sqrt price representing the first tick boundary\\r\\n /// @param sqrtRatioBX96 A sqrt price representing the second tick boundary\\r\\n /// @param liquidity The liquidity being valued\\r\\n /// @return amount0 The amount of token0\\r\\n /// @return amount1 The amount of token1\\r\\n function getAmountsForLiquidity(\\r\\n uint160 sqrtRatioX96,\\r\\n uint160 sqrtRatioAX96,\\r\\n uint160 sqrtRatioBX96,\\r\\n uint128 liquidity\\r\\n ) internal pure returns (uint256 amount0, uint256 amount1) {\\r\\n if (sqrtRatioAX96 \u003E sqrtRatioBX96) (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);\\r\\n\\r\\n if (sqrtRatioX96 \u003C= sqrtRatioAX96) {\\r\\n amount0 = getAmount0ForLiquidity(sqrtRatioAX96, sqrtRatioBX96, liquidity);\\r\\n } else if (sqrtRatioX96 \u003C sqrtRatioBX96) {\\r\\n amount0 = getAmount0ForLiquidity(sqrtRatioX96, sqrtRatioBX96, liquidity);\\r\\n amount1 = getAmount1ForLiquidity(sqrtRatioAX96, sqrtRatioX96, liquidity);\\r\\n } else {\\r\\n amount1 = getAmount1ForLiquidity(sqrtRatioAX96, sqrtRatioBX96, liquidity);\\r\\n }\\r\\n }\\r\\n}\\r\\n\"\r\n },\r\n \"contracts/libraries/PoolAddress.sol\": {\r\n \"content\": \"// SPDX-License-Identifier: GPL-2.0-or-later\\r\\npragma solidity \u003E=0.5.0;\\r\\n\\r\\n/// @title Provides functions for deriving a pool address from the poolDeployer and tokens\\r\\n/// @dev Credit to Uniswap Labs under GPL-2.0-or-later license:\\r\\n/// https://github.com/Uniswap/v3-periphery\\r\\nlibrary PoolAddress {\\r\\n bytes32 internal constant POOL_INIT_CODE_HASH = 0xf96d2474815c32e070cd63233f06af5413efc5dcb430aee4ff18cc29007c562d;\\r\\n\\r\\n /// @notice The identifying key of the pool\\r\\n struct PoolKey {\\r\\n address token0;\\r\\n address token1;\\r\\n }\\r\\n\\r\\n /// @notice Returns PoolKey: the ordered tokens\\r\\n /// @param tokenA The first token of a pool, unsorted\\r\\n /// @param tokenB The second token of a pool, unsorted\\r\\n /// @return Poolkey The pool details with ordered token0 and token1 assignments\\r\\n function getPoolKey(address tokenA, address tokenB) internal pure returns (PoolKey memory) {\\r\\n if (tokenA \u003E tokenB) (tokenA, tokenB) = (tokenB, tokenA);\\r\\n return PoolKey({token0: tokenA, token1: tokenB});\\r\\n }\\r\\n\\r\\n /// @notice Deterministically computes the pool address given the poolDeployer and PoolKey\\r\\n /// @param poolDeployer The Algebra poolDeployer contract address\\r\\n /// @param key The PoolKey\\r\\n /// @return pool The contract address of the Algebra pool\\r\\n function computeAddress(address poolDeployer, PoolKey memory key) internal pure returns (address pool) {\\r\\n require(key.token0 \u003C key.token1, 'Invalid order of tokens');\\r\\n pool = address(\\r\\n uint160(\\r\\n uint256(\\r\\n keccak256(\\r\\n abi.encodePacked(\\r\\n hex'ff',\\r\\n poolDeployer,\\r\\n keccak256(abi.encode(key.token0, key.token1)),\\r\\n POOL_INIT_CODE_HASH\\r\\n )\\r\\n )\\r\\n )\\r\\n )\\r\\n );\\r\\n }\\r\\n}\\r\\n\"\r\n },\r\n \"contracts/libraries/PoolInteraction.sol\": {\r\n \"content\": \"// SPDX-License-Identifier: GPL-2.0-or-later\\r\\npragma solidity =0.8.20;\\r\\n\\r\\nimport '@cryptoalgebra/integral-core/contracts/interfaces/IAlgebraPool.sol';\\r\\n\\r\\nimport './PositionKey.sol';\\r\\n\\r\\n/// @title Implements commonly used interactions with Algebra pool\\r\\nlibrary PoolInteraction {\\r\\n function _getPositionInPool(\\r\\n IAlgebraPool pool,\\r\\n address owner,\\r\\n int24 tickLower,\\r\\n int24 tickUpper\\r\\n )\\r\\n internal\\r\\n view\\r\\n returns (\\r\\n uint256 liquidityAmount,\\r\\n uint256 innerFeeGrowth0Token,\\r\\n uint256 innerFeeGrowth1Token,\\r\\n uint128 fees0,\\r\\n uint128 fees1\\r\\n )\\r\\n {\\r\\n bytes32 positionKey = PositionKey.compute(owner, tickLower, tickUpper);\\r\\n return pool.positions(positionKey);\\r\\n }\\r\\n\\r\\n function _getSqrtPrice(IAlgebraPool pool) internal view returns (uint160 sqrtPriceX96) {\\r\\n (sqrtPriceX96, , , , , ) = pool.globalState();\\r\\n }\\r\\n\\r\\n function _burnPositionInPool(\\r\\n IAlgebraPool pool,\\r\\n int24 tickLower,\\r\\n int24 tickUpper,\\r\\n uint128 liquidity\\r\\n ) internal returns (uint256 amount0, uint256 amount1) {\\r\\n return pool.burn(tickLower, tickUpper, liquidity, '0x0');\\r\\n }\\r\\n}\\r\\n\"\r\n },\r\n \"contracts/libraries/PositionKey.sol\": {\r\n \"content\": \"// SPDX-License-Identifier: GPL-2.0-or-later\\r\\npragma solidity \u003E=0.5.0;\\r\\n\\r\\nlibrary PositionKey {\\r\\n /// @dev Returns the key of the position in the core library\\r\\n function compute(\\r\\n address owner,\\r\\n int24 bottomTick,\\r\\n int24 topTick\\r\\n ) internal pure returns (bytes32 key) {\\r\\n assembly {\\r\\n key := or(shl(24, or(shl(24, owner), and(bottomTick, 0xFFFFFF))), and(topTick, 0xFFFFFF))\\r\\n }\\r\\n }\\r\\n}\\r\\n\"\r\n },\r\n \"contracts/libraries/TransferHelper.sol\": {\r\n \"content\": \"// SPDX-License-Identifier: GPL-2.0-or-later\\r\\npragma solidity \u003E=0.6.0;\\r\\n\\r\\nimport '@openzeppelin/contracts/token/ERC20/IERC20.sol';\\r\\n\\r\\n/// @dev Credit to Uniswap Labs under GPL-2.0-or-later license:\\r\\n/// https://github.com/Uniswap/v3-periphery\\r\\nlibrary TransferHelper {\\r\\n /// @notice Transfers tokens from the targeted address to the given destination\\r\\n /// @notice Errors with 'STF' if transfer fails\\r\\n /// @param token The contract address of the token to be transferred\\r\\n /// @param from The originating address from which the tokens will be transferred\\r\\n /// @param to The destination address of the transfer\\r\\n /// @param value The amount to be transferred\\r\\n function safeTransferFrom(\\r\\n address token,\\r\\n address from,\\r\\n address to,\\r\\n uint256 value\\r\\n ) internal {\\r\\n (bool success, bytes memory data) = token.call(\\r\\n abi.encodeWithSelector(IERC20.transferFrom.selector, from, to, value)\\r\\n );\\r\\n require(success && (data.length == 0 || abi.decode(data, (bool))), 'STF');\\r\\n }\\r\\n\\r\\n /// @notice Transfers tokens from msg.sender to a recipient\\r\\n /// @dev Errors with ST if transfer fails\\r\\n /// @param token The contract address of the token which will be transferred\\r\\n /// @param to The recipient of the transfer\\r\\n /// @param value The value of the transfer\\r\\n function safeTransfer(\\r\\n address token,\\r\\n address to,\\r\\n uint256 value\\r\\n ) internal {\\r\\n (bool success, bytes memory data) = token.call(abi.encodeWithSelector(IERC20.transfer.selector, to, value));\\r\\n require(success && (data.length == 0 || abi.decode(data, (bool))), 'ST');\\r\\n }\\r\\n\\r\\n /// @notice Approves the stipulated contract to spend the given allowance in the given token\\r\\n /// @dev Errors with 'SA' if transfer fails\\r\\n /// @param token The contract address of the token to be approved\\r\\n /// @param to The target of the approval\\r\\n /// @param value The amount of the given token the target will be allowed to spend\\r\\n function safeApprove(\\r\\n address token,\\r\\n address to,\\r\\n uint256 value\\r\\n ) internal {\\r\\n (bool success, bytes memory data) = token.call(abi.encodeWithSelector(IERC20.approve.selector, to, value));\\r\\n require(success && (data.length == 0 || abi.decode(data, (bool))), 'SA');\\r\\n }\\r\\n\\r\\n /// @notice Transfers NativeToken to the recipient address\\r\\n /// @dev Fails with `STE`\\r\\n /// @param to The destination of the transfer\\r\\n /// @param value The value to be transferred\\r\\n function safeTransferNative(address to, uint256 value) internal {\\r\\n (bool success, ) = to.call{value: value}(new bytes(0));\\r\\n require(success, 'STE');\\r\\n }\\r\\n}\\r\\n\"\r\n },\r\n \"contracts/NonfungiblePositionManager.sol\": {\r\n \"content\": \"// SPDX-License-Identifier: GPL-2.0-or-later\\r\\npragma solidity =0.8.20;\\r\\n\\r\\nimport '@cryptoalgebra/integral-core/contracts/interfaces/IAlgebraPool.sol';\\r\\nimport '@cryptoalgebra/integral-core/contracts/interfaces/IAlgebraFactory.sol';\\r\\nimport '@cryptoalgebra/integral-core/contracts/libraries/Constants.sol';\\r\\nimport '@cryptoalgebra/integral-core/contracts/libraries/FullMath.sol';\\r\\n\\r\\nimport './interfaces/INonfungiblePositionManager.sol';\\r\\nimport './interfaces/INonfungibleTokenPositionDescriptor.sol';\\r\\nimport './interfaces/IPositionFollower.sol';\\r\\nimport './libraries/PoolInteraction.sol';\\r\\nimport './libraries/PoolAddress.sol';\\r\\nimport './base/LiquidityManagement.sol';\\r\\nimport './base/PeripheryImmutableState.sol';\\r\\nimport './base/Multicall.sol';\\r\\nimport './base/ERC721Permit.sol';\\r\\nimport './base/PeripheryValidation.sol';\\r\\nimport './base/SelfPermit.sol';\\r\\nimport './base/PoolInitializer.sol';\\r\\n\\r\\n/// @title Algebra Integral 1.0 NFT positions\\r\\n/// @notice Wraps Algebra positions in the ERC721 non-fungible token interface\\r\\n/// @dev Credit to Uniswap Labs under GPL-2.0-or-later license:\\r\\n/// https://github.com/Uniswap/v3-periphery\\r\\ncontract NonfungiblePositionManager is\\r\\n INonfungiblePositionManager,\\r\\n Multicall,\\r\\n ERC721Permit,\\r\\n PeripheryImmutableState,\\r\\n PoolInitializer,\\r\\n LiquidityManagement,\\r\\n PeripheryValidation,\\r\\n SelfPermit\\r\\n{\\r\\n using PoolInteraction for IAlgebraPool;\\r\\n\\r\\n // details about the Algebra position\\r\\n struct Position {\\r\\n uint88 nonce; // the nonce for permits\\r\\n address operator; // the address that is approved for spending this token\\r\\n uint80 poolId; // the ID of the pool with which this token is connected\\r\\n int24 tickLower; // the tick range of the position\\r\\n int24 tickUpper;\\r\\n uint128 liquidity; // the liquidity of the position\\r\\n uint256 feeGrowthInside0LastX128; // the fee growth of the aggregate position as of the last action on the individual position\\r\\n uint256 feeGrowthInside1LastX128;\\r\\n uint128 tokensOwed0; // how many uncollected tokens are owed to the position, as of the last computation\\r\\n uint128 tokensOwed1;\\r\\n }\\r\\n\\r\\n /// @dev The role which has the right to change the farming center address\\r\\n bytes32 public constant NONFUNGIBLE_POSITION_MANAGER_ADMINISTRATOR_ROLE =\\r\\n keccak256('NONFUNGIBLE_POSITION_MANAGER_ADMINISTRATOR_ROLE');\\r\\n\\r\\n /// @inheritdoc INonfungiblePositionManager\\r\\n address public override farmingCenter;\\r\\n\\r\\n /// @inheritdoc INonfungiblePositionManager\\r\\n mapping(uint256 tokenId =\u003E address farmingCenterAddress) public override farmingApprovals;\\r\\n\\r\\n /// @inheritdoc INonfungiblePositionManager\\r\\n mapping(uint256 tokenId =\u003E address farmingCenterAddress) public tokenFarmedIn;\\r\\n\\r\\n /// @dev The address of the token descriptor contract, which handles generating token URIs for position tokens\\r\\n address private immutable _tokenDescriptor;\\r\\n\\r\\n /// @dev IDs of pools assigned by this contract\\r\\n mapping(address poolAddress =\u003E uint80 poolId) private _poolIds;\\r\\n\\r\\n /// @dev Pool keys by pool ID, to save on SSTOREs for position data\\r\\n mapping(uint80 poolId =\u003E PoolAddress.PoolKey poolKey) private _poolIdToPoolKey;\\r\\n\\r\\n /// @dev The token ID position data\\r\\n mapping(uint256 tokenId =\u003E Position position) private _positions;\\r\\n\\r\\n /// @dev The ID of the next token that will be minted. Skips 0\\r\\n uint176 private _nextId = 1;\\r\\n /// @dev The ID of the next pool that is used for the first time. Skips 0\\r\\n uint80 private _nextPoolId = 1;\\r\\n\\r\\n modifier isAuthorizedForToken(uint256 tokenId) {\\r\\n _checkAuthorizationForToken(tokenId);\\r\\n _;\\r\\n }\\r\\n\\r\\n constructor(\\r\\n address _factory,\\r\\n address _WNativeToken,\\r\\n address _tokenDescriptor_,\\r\\n address _poolDeployer\\r\\n )\\r\\n ERC721Permit('Algebra Positions NFT-V2', 'ALGB-POS', '2')\\r\\n PeripheryImmutableState(_factory, _WNativeToken, _poolDeployer)\\r\\n {\\r\\n _tokenDescriptor = _tokenDescriptor_;\\r\\n }\\r\\n\\r\\n /// @inheritdoc INonfungiblePositionManager\\r\\n function positions(\\r\\n uint256 tokenId\\r\\n )\\r\\n external\\r\\n view\\r\\n override\\r\\n returns (\\r\\n uint88 nonce,\\r\\n address operator,\\r\\n address token0,\\r\\n address token1,\\r\\n int24 tickLower,\\r\\n int24 tickUpper,\\r\\n uint128 liquidity,\\r\\n uint256 feeGrowthInside0LastX128,\\r\\n uint256 feeGrowthInside1LastX128,\\r\\n uint128 tokensOwed0,\\r\\n uint128 tokensOwed1\\r\\n )\\r\\n {\\r\\n Position storage position = _positions[tokenId];\\r\\n // single SLOAD\\r\\n uint80 poolId = position.poolId;\\r\\n tickLower = position.tickLower;\\r\\n tickUpper = position.tickUpper;\\r\\n liquidity = position.liquidity;\\r\\n require(poolId != 0, 'Invalid token ID');\\r\\n PoolAddress.PoolKey storage poolKey = _poolIdToPoolKey[poolId];\\r\\n return (\\r\\n position.nonce,\\r\\n position.operator,\\r\\n poolKey.token0,\\r\\n poolKey.token1,\\r\\n tickLower,\\r\\n tickUpper,\\r\\n liquidity,\\r\\n position.feeGrowthInside0LastX128,\\r\\n position.feeGrowthInside1LastX128,\\r\\n position.tokensOwed0,\\r\\n position.tokensOwed1\\r\\n );\\r\\n }\\r\\n\\r\\n /// @inheritdoc INonfungiblePositionManager\\r\\n function mint(\\r\\n MintParams calldata params\\r\\n )\\r\\n external\\r\\n payable\\r\\n override\\r\\n checkDeadline(params.deadline)\\r\\n returns (uint256 tokenId, uint128 liquidity, uint256 amount0, uint256 amount1)\\r\\n {\\r\\n IAlgebraPool pool;\\r\\n uint128 liquidityDesired;\\r\\n (liquidityDesired, liquidity, amount0, amount1, pool) = addLiquidity(\\r\\n AddLiquidityParams({\\r\\n token0: params.token0,\\r\\n token1: params.token1,\\r\\n recipient: address(this),\\r\\n tickLower: params.tickLower,\\r\\n tickUpper: params.tickUpper,\\r\\n amount0Desired: params.amount0Desired,\\r\\n amount1Desired: params.amount1Desired,\\r\\n amount0Min: params.amount0Min,\\r\\n amount1Min: params.amount1Min\\r\\n })\\r\\n );\\r\\n unchecked {\\r\\n _mint(params.recipient, (tokenId = _nextId++));\\r\\n }\\r\\n\\r\\n (, uint256 feeGrowthInside0LastX128, uint256 feeGrowthInside1LastX128, , ) = pool._getPositionInPool(\\r\\n address(this),\\r\\n params.tickLower,\\r\\n params.tickUpper\\r\\n );\\r\\n\\r\\n // idempotent set\\r\\n uint80 poolId = _cachePoolKey(\\r\\n address(pool),\\r\\n PoolAddress.PoolKey({token0: params.token0, token1: params.token1})\\r\\n );\\r\\n\\r\\n _positions[tokenId] = Position({\\r\\n nonce: 0,\\r\\n operator: address(0),\\r\\n poolId: poolId,\\r\\n tickLower: params.tickLower,\\r\\n tickUpper: params.tickUpper,\\r\\n liquidity: liquidity,\\r\\n feeGrowthInside0LastX128: feeGrowthInside0LastX128,\\r\\n feeGrowthInside1LastX128: feeGrowthInside1LastX128,\\r\\n tokensOwed0: 0,\\r\\n tokensOwed1: 0\\r\\n });\\r\\n\\r\\n emit IncreaseLiquidity(tokenId, liquidityDesired, liquidity, amount0, amount1, address(pool));\\r\\n }\\r\\n\\r\\n /// @dev Caches a pool key\\r\\n function _cachePoolKey(address pool, PoolAddress.PoolKey memory poolKey) private returns (uint80 poolId) {\\r\\n if ((poolId = _poolIds[pool]) == 0) {\\r\\n unchecked {\\r\\n _poolIds[pool] = (poolId = _nextPoolId++);\\r\\n }\\r\\n _poolIdToPoolKey[poolId] = poolKey;\\r\\n }\\r\\n }\\r\\n\\r\\n function _getPoolById(uint80 poolId) private view returns (address) {\\r\\n return PoolAddress.computeAddress(poolDeployer, _poolIdToPoolKey[poolId]);\\r\\n }\\r\\n\\r\\n function _updateUncollectedFees(\\r\\n Position storage position,\\r\\n IAlgebraPool pool,\\r\\n address owner,\\r\\n int24 tickLower,\\r\\n int24 tickUpper,\\r\\n uint128 positionLiquidity\\r\\n ) private returns (uint128 tokensOwed0, uint128 tokensOwed1) {\\r\\n (, uint256 feeGrowthInside0LastX128, uint256 feeGrowthInside1LastX128, , ) = pool._getPositionInPool(\\r\\n owner,\\r\\n tickLower,\\r\\n tickUpper\\r\\n );\\r\\n unchecked {\\r\\n tokensOwed0 = uint128(\\r\\n FullMath.mulDiv(\\r\\n feeGrowthInside0LastX128 - position.feeGrowthInside0LastX128,\\r\\n positionLiquidity,\\r\\n Constants.Q128\\r\\n )\\r\\n );\\r\\n tokensOwed1 = uint128(\\r\\n FullMath.mulDiv(\\r\\n feeGrowthInside1LastX128 - position.feeGrowthInside1LastX128,\\r\\n positionLiquidity,\\r\\n Constants.Q128\\r\\n )\\r\\n );\\r\\n }\\r\\n\\r\\n position.feeGrowthInside0LastX128 = feeGrowthInside0LastX128;\\r\\n position.feeGrowthInside1LastX128 = feeGrowthInside1LastX128;\\r\\n }\\r\\n\\r\\n /// @inheritdoc INonfungiblePositionManager\\r\\n function increaseLiquidity(\\r\\n IncreaseLiquidityParams calldata params\\r\\n )\\r\\n external\\r\\n payable\\r\\n override\\r\\n checkDeadline(params.deadline)\\r\\n returns (uint128 liquidity, uint256 amount0, uint256 amount1)\\r\\n {\\r\\n Position storage position = _positions[params.tokenId];\\r\\n\\r\\n PoolAddress.PoolKey storage poolKey = _poolIdToPoolKey[position.poolId];\\r\\n int24 tickLower = position.tickLower;\\r\\n int24 tickUpper = position.tickUpper;\\r\\n uint128 positionLiquidity = position.liquidity;\\r\\n\\r\\n IAlgebraPool pool;\\r\\n uint128 liquidityDesired;\\r\\n (liquidityDesired, liquidity, amount0, amount1, pool) = addLiquidity(\\r\\n AddLiquidityParams({\\r\\n token0: poolKey.token0,\\r\\n token1: poolKey.token1,\\r\\n tickLower: tickLower,\\r\\n tickUpper: tickUpper,\\r\\n amount0Desired: params.amount0Desired,\\r\\n amount1Desired: params.amount1Desired,\\r\\n amount0Min: params.amount0Min,\\r\\n amount1Min: params.amount1Min,\\r\\n recipient: address(this)\\r\\n })\\r\\n );\\r\\n\\r\\n // this is now updated to the current transaction\\r\\n (uint128 tokensOwed0, uint128 tokensOwed1) = _updateUncollectedFees(\\r\\n position,\\r\\n pool,\\r\\n address(this),\\r\\n tickLower,\\r\\n tickUpper,\\r\\n positionLiquidity\\r\\n );\\r\\n\\r\\n unchecked {\\r\\n if (tokensOwed0 | tokensOwed1 != 0) {\\r\\n position.tokensOwed0 += tokensOwed0;\\r\\n position.tokensOwed1 += tokensOwed1;\\r\\n }\\r\\n position.liquidity = positionLiquidity + liquidity;\\r\\n }\\r\\n\\r\\n emit IncreaseLiquidity(params.tokenId, liquidityDesired, liquidity, amount0, amount1, address(pool));\\r\\n\\r\\n _applyLiquidityDeltaInFarming(params.tokenId, int256(uint256(liquidity)));\\r\\n }\\r\\n\\r\\n /// @inheritdoc INonfungiblePositionManager\\r\\n function decreaseLiquidity(\\r\\n DecreaseLiquidityParams calldata params\\r\\n )\\r\\n external\\r\\n payable\\r\\n override\\r\\n isAuthorizedForToken(params.tokenId)\\r\\n checkDeadline(params.deadline)\\r\\n returns (uint256 amount0, uint256 amount1)\\r\\n {\\r\\n require(params.liquidity \u003E 0);\\r\\n Position storage position = _positions[params.tokenId];\\r\\n\\r\\n (uint80 poolId, int24 tickLower, int24 tickUpper, uint128 positionLiquidity) = (\\r\\n position.poolId,\\r\\n position.tickLower,\\r\\n position.tickUpper,\\r\\n position.liquidity\\r\\n );\\r\\n require(positionLiquidity \u003E= params.liquidity);\\r\\n\\r\\n IAlgebraPool pool = IAlgebraPool(_getPoolById(poolId));\\r\\n (amount0, amount1) = pool._burnPositionInPool(tickLower, tickUpper, params.liquidity);\\r\\n\\r\\n require(amount0 \u003E= params.amount0Min && amount1 \u003E= params.amount1Min, 'Price slippage check');\\r\\n\\r\\n // scope to prevent stack-too-deep\\r\\n {\\r\\n // this is now updated to the current transaction\\r\\n (uint128 tokensOwed0, uint128 tokensOwed1) = _updateUncollectedFees(\\r\\n position,\\r\\n pool,\\r\\n address(this),\\r\\n tickLower,\\r\\n tickUpper,\\r\\n positionLiquidity\\r\\n );\\r\\n\\r\\n unchecked {\\r\\n position.tokensOwed0 += uint128(amount0) + tokensOwed0;\\r\\n position.tokensOwed1 += uint128(amount1) + tokensOwed1;\\r\\n\\r\\n // subtraction is safe because we checked positionLiquidity is gte params.liquidity\\r\\n position.liquidity = positionLiquidity - params.liquidity;\\r\\n }\\r\\n }\\r\\n\\r\\n emit DecreaseLiquidity(params.tokenId, params.liquidity, amount0, amount1);\\r\\n\\r\\n _applyLiquidityDeltaInFarming(params.tokenId, -int256(uint256(params.liquidity)));\\r\\n }\\r\\n\\r\\n /// @inheritdoc INonfungiblePositionManager\\r\\n function collect(\\r\\n CollectParams calldata params\\r\\n ) external payable override isAuthorizedForToken(params.tokenId) returns (uint256 amount0, uint256 amount1) {\\r\\n require(params.amount0Max \u003E 0 || params.amount1Max \u003E 0);\\r\\n // allow collecting to the nft position manager address with address 0\\r\\n address recipient = params.recipient == address(0) ? address(this) : params.recipient;\\r\\n\\r\\n Position storage position = _positions[params.tokenId];\\r\\n IAlgebraPool pool = IAlgebraPool(_getPoolById(position.poolId));\\r\\n\\r\\n // trigger an update of the position fees owed and fee growth snapshots if it has any liquidity\\r\\n int24 tickLower = position.tickLower;\\r\\n int24 tickUpper = position.tickUpper;\\r\\n uint128 positionLiquidity = position.liquidity;\\r\\n\\r\\n (uint128 tokensOwed0, uint128 tokensOwed1) = (position.tokensOwed0, position.tokensOwed1);\\r\\n if (positionLiquidity \u003E 0) {\\r\\n pool._burnPositionInPool(tickLower, tickUpper, 0);\\r\\n (uint128 _tokensOwed0, uint128 _tokensOwed1) = _updateUncollectedFees(\\r\\n position,\\r\\n pool,\\r\\n address(this),\\r\\n tickLower,\\r\\n tickUpper,\\r\\n positionLiquidity\\r\\n );\\r\\n\\r\\n unchecked {\\r\\n tokensOwed0 += _tokensOwed0;\\r\\n tokensOwed1 += _tokensOwed1;\\r\\n }\\r\\n }\\r\\n\\r\\n // compute the arguments to give to the pool#collect method\\r\\n (uint128 amount0Collect, uint128 amount1Collect) = (\\r\\n params.amount0Max \u003E tokensOwed0 ? tokensOwed0 : params.amount0Max,\\r\\n params.amount1Max \u003E tokensOwed1 ? tokensOwed1 : params.amount1Max\\r\\n );\\r\\n\\r\\n // the actual amounts collected are returned\\r\\n (amount0, amount1) = pool.collect(recipient, tickLower, tickUpper, amount0Collect, amount1Collect);\\r\\n\\r\\n // sometimes there will be a few less wei than expected due to rounding down in core, but we just subtract the full amount expected\\r\\n // instead of the actual amount so we can burn the token\\r\\n unchecked {\\r\\n (position.tokensOwed0, position.tokensOwed1) = (tokensOwed0 - amount0Collect, tokensOwed1 - amount1Collect);\\r\\n }\\r\\n\\r\\n emit Collect(params.tokenId, recipient, amount0Collect, amount1Collect);\\r\\n }\\r\\n\\r\\n /// @inheritdoc INonfungiblePositionManager\\r\\n function burn(uint256 tokenId) external payable override isAuthorizedForToken(tokenId) {\\r\\n Position storage position = _positions[tokenId];\\r\\n require(position.liquidity | position.tokensOwed0 | position.tokensOwed1 == 0, 'Not cleared');\\r\\n\\r\\n delete _positions[tokenId];\\r\\n delete tokenFarmedIn[tokenId];\\r\\n _burn(tokenId);\\r\\n }\\r\\n\\r\\n /// @inheritdoc INonfungiblePositionManager\\r\\n function approveForFarming(\\r\\n uint256 tokenId,\\r\\n bool approve,\\r\\n address farmingAddress\\r\\n ) external payable override isAuthorizedForToken(tokenId) {\\r\\n address newValue;\\r\\n if (approve) {\\r\\n require(farmingAddress == farmingCenter, 'Invalid farming address');\\r\\n newValue = farmingAddress;\\r\\n }\\r\\n farmingApprovals[tokenId] = newValue;\\r\\n }\\r\\n\\r\\n /// @inheritdoc INonfungiblePositionManager\\r\\n function switchFarmingStatus(uint256 tokenId, bool toActive) external override {\\r\\n address _farmingCenter = farmingCenter;\\r\\n bool accessAllowed = msg.sender == _farmingCenter;\\r\\n address newFarmForToken;\\r\\n if (toActive) {\\r\\n require(farmingApprovals[tokenId] == _farmingCenter, 'Not approved for farming');\\r\\n newFarmForToken = _farmingCenter;\\r\\n } else {\\r\\n // can be switched off by current farming center or by the farming center in which nft is farmed\\r\\n accessAllowed = accessAllowed || msg.sender == tokenFarmedIn[tokenId];\\r\\n }\\r\\n require(accessAllowed, 'Only FarmingCenter');\\r\\n tokenFarmedIn[tokenId] = newFarmForToken;\\r\\n }\\r\\n\\r\\n /// @inheritdoc INonfungiblePositionManager\\r\\n function setFarmingCenter(address newFarmingCenter) external override {\\r\\n require(IAlgebraFactory(factory).hasRoleOrOwner(NONFUNGIBLE_POSITION_MANAGER_ADMINISTRATOR_ROLE, msg.sender));\\r\\n farmingCenter = newFarmingCenter;\\r\\n emit FarmingCenter(newFarmingCenter);\\r\\n }\\r\\n\\r\\n /// @inheritdoc IERC721Metadata\\r\\n function tokenURI(uint256 tokenId) public view override(ERC721, IERC721Metadata) returns (string memory) {\\r\\n _requireMinted(tokenId);\\r\\n return INonfungibleTokenPositionDescriptor(_tokenDescriptor).tokenURI(this, tokenId);\\r\\n }\\r\\n\\r\\n /// @inheritdoc IERC721\\r\\n function getApproved(uint256 tokenId) public view override(ERC721, IERC721) returns (address) {\\r\\n _requireMinted(tokenId);\\r\\n return _positions[tokenId].operator;\\r\\n }\\r\\n\\r\\n /// @inheritdoc INonfungiblePositionManager\\r\\n function isApprovedOrOwner(address spender, uint256 tokenId) external view override returns (bool) {\\r\\n _requireMinted(tokenId);\\r\\n return _isApprovedOrOwner(spender, tokenId);\\r\\n }\\r\\n\\r\\n function _checkAuthorizationForToken(uint256 tokenId) private view {\\r\\n require(_isApprovedOrOwner(msg.sender, tokenId), 'Not approved');\\r\\n }\\r\\n\\r\\n function _applyLiquidityDeltaInFarming(uint256 tokenId, int256 liquidityDelta) private {\\r\\n address _tokenFarmedIn = tokenFarmedIn[tokenId];\\r\\n if (_tokenFarmedIn == address(0)) return;\\r\\n\\r\\n address _farmingCenter = farmingCenter;\\r\\n if (_farmingCenter == address(0)) return;\\r\\n\\r\\n if (_tokenFarmedIn == _farmingCenter) {\\r\\n // errors without message (i.e. out of gas) will be propagated\\r\\n // custom errors will be propagated\\r\\n try IPositionFollower(_farmingCenter).applyLiquidityDelta(tokenId, liquidityDelta) {\\r\\n // do nothing\\r\\n } catch Panic(uint256) {\\r\\n emit FarmingFailed(tokenId);\\r\\n } catch Error(string memory) {\\r\\n emit FarmingFailed(tokenId);\\r\\n }\\r\\n }\\r\\n }\\r\\n\\r\\n /// @dev Gets the current nonce for a token ID and then increments it, returning the original value\\r\\n function _getAndIncrementNonce(uint256 tokenId) internal override returns (uint256) {\\r\\n unchecked {\\r\\n return uint256(_positions[tokenId].nonce++);\\r\\n }\\r\\n }\\r\\n\\r\\n /// @dev Overrides to clear operator and farming approval before any transfer (including burn, but not including mint)\\r\\n function _beforeTokenTransfer(address from, address to, uint256 tokenId, uint256 batch) internal override {\\r\\n // transfer from address(0) is mint\\r\\n if (from != address(0)) {\\r\\n // clear approvals\\r\\n _positions[tokenId].operator = address(0);\\r\\n delete farmingApprovals[tokenId];\\r\\n }\\r\\n super._beforeTokenTransfer(from, to, tokenId, batch);\\r\\n }\\r\\n\\r\\n /// @dev Overrides _approve to use the operator in the position, which is packed with the position permit nonce\\r\\n function _approve(address to, uint256 tokenId) internal override(ERC721) {\\r\\n _positions[tokenId].operator = to;\\r\\n emit Approval(ownerOf(tokenId), to, tokenId);\\r\\n }\\r\\n}\\r\\n\"\r\n }\r\n },\r\n \"settings\": {\r\n \"evmVersion\": \"paris\",\r\n \"optimizer\": {\r\n \"enabled\": true,\r\n \"runs\": 2000\r\n },\r\n \"metadata\": {\r\n \"bytecodeHash\": \"none\"\r\n },\r\n \"outputSelection\": {\r\n \"*\": {\r\n \"*\": [\r\n \"evm.bytecode\",\r\n \"evm.deployedBytecode\",\r\n \"devdoc\",\r\n \"userdoc\",\r\n \"metadata\",\r\n \"abi\"\r\n ]\r\n }\r\n },\r\n \"libraries\": {}\r\n }\r\n}}",
"ABI": "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_factory\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_WNativeToken\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_tokenDescriptor_\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_poolDeployer\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"tickOutOfRange\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"approved\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"approved\",\"type\":\"bool\"}],\"name\":\"ApprovalForAll\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"}],\"name\":\"Collect\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint128\",\"name\":\"liquidity\",\"type\":\"uint128\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"}],\"name\":\"DecreaseLiquidity\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"farmingCenterAddress\",\"type\":\"address\"}],\"name\":\"FarmingCenter\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"FarmingFailed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint128\",\"name\":\"liquidityDesired\",\"type\":\"uint128\"},{\"indexed\":false,\"internalType\":\"uint128\",\"name\":\"actualLiquidity\",\"type\":\"uint128\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"pool\",\"type\":\"address\"}],\"name\":\"IncreaseLiquidity\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"DOMAIN_SEPARATOR\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"NONFUNGIBLE_POSITION_MANAGER_ADMINISTRATOR_ROLE\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"PERMIT_TYPEHASH\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"WNativeToken\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount0Owed\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1Owed\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"algebraMintCallback\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"approve\",\"type\":\"bool\"},{\"internalType\":\"address\",\"name\":\"farmingAddress\",\"type\":\"address\"}],\"name\":\"approveForFarming\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"burn\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint128\",\"name\":\"amount0Max\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"amount1Max\",\"type\":\"uint128\"}],\"internalType\":\"struct INonfungiblePositionManager.CollectParams\",\"name\":\"params\",\"type\":\"tuple\"}],\"name\":\"collect\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token0\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"token1\",\"type\":\"address\"},{\"internalType\":\"uint160\",\"name\":\"sqrtPriceX96\",\"type\":\"uint160\"}],\"name\":\"createAndInitializePoolIfNecessary\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"pool\",\"type\":\"address\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"uint128\",\"name\":\"liquidity\",\"type\":\"uint128\"},{\"internalType\":\"uint256\",\"name\":\"amount0Min\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1Min\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"}],\"internalType\":\"struct INonfungiblePositionManager.DecreaseLiquidityParams\",\"name\":\"params\",\"type\":\"tuple\"}],\"name\":\"decreaseLiquidity\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"factory\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"farmingApprovals\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"farmingCenterAddress\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"farmingCenter\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"getApproved\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount0Desired\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1Desired\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount0Min\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1Min\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"}],\"internalType\":\"struct INonfungiblePositionManager.IncreaseLiquidityParams\",\"name\":\"params\",\"type\":\"tuple\"}],\"name\":\"increaseLiquidity\",\"outputs\":[{\"internalType\":\"uint128\",\"name\":\"liquidity\",\"type\":\"uint128\"},{\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"}],\"name\":\"isApprovedForAll\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"isApprovedOrOwner\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"token0\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"token1\",\"type\":\"address\"},{\"internalType\":\"int24\",\"name\":\"tickLower\",\"type\":\"int24\"},{\"internalType\":\"int24\",\"name\":\"tickUpper\",\"type\":\"int24\"},{\"internalType\":\"uint256\",\"name\":\"amount0Desired\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1Desired\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount0Min\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1Min\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"}],\"internalType\":\"struct INonfungiblePositionManager.MintParams\",\"name\":\"params\",\"type\":\"tuple\"}],\"name\":\"mint\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"uint128\",\"name\":\"liquidity\",\"type\":\"uint128\"},{\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes[]\",\"name\":\"data\",\"type\":\"bytes[]\"}],\"name\":\"multicall\",\"outputs\":[{\"internalType\":\"bytes[]\",\"name\":\"results\",\"type\":\"bytes[]\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"ownerOf\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"permit\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"poolDeployer\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"positions\",\"outputs\":[{\"internalType\":\"uint88\",\"name\":\"nonce\",\"type\":\"uint88\"},{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"token0\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"token1\",\"type\":\"address\"},{\"internalType\":\"int24\",\"name\":\"tickLower\",\"type\":\"int24\"},{\"internalType\":\"int24\",\"name\":\"tickUpper\",\"type\":\"int24\"},{\"internalType\":\"uint128\",\"name\":\"liquidity\",\"type\":\"uint128\"},{\"internalType\":\"uint256\",\"name\":\"feeGrowthInside0LastX128\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"feeGrowthInside1LastX128\",\"type\":\"uint256\"},{\"internalType\":\"uint128\",\"name\":\"tokensOwed0\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"tokensOwed1\",\"type\":\"uint128\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"refundNativeToken\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"safeTransferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"safeTransferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"selfPermit\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expiry\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"selfPermitAllowed\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expiry\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"selfPermitAllowedIfNecessary\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"selfPermitIfNecessary\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"approved\",\"type\":\"bool\"}],\"name\":\"setApprovalForAll\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newFarmingCenter\",\"type\":\"address\"}],\"name\":\"setFarmingCenter\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amountMinimum\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"}],\"name\":\"sweepToken\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"toActive\",\"type\":\"bool\"}],\"name\":\"switchFarmingStatus\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"symbol\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"index\",\"type\":\"uint256\"}],\"name\":\"tokenByIndex\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"tokenFarmedIn\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"farmingCenterAddress\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"index\",\"type\":\"uint256\"}],\"name\":\"tokenOfOwnerByIndex\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"tokenURI\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalSupply\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amountMinimum\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"}],\"name\":\"unwrapWNativeToken\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}]",
"ContractName": "NonfungiblePositionManager",
"CompilerVersion": "v0.8.20+commit.a1b79de6",
"OptimizationUsed": "1",
"Runs": "2000",
"ConstructorArguments": "000000000000000000000000955b95b8532fe75ddcf2161f61127be74a76815800000000000000000000000010253594a832f967994b44f33411940533302acb00000000000000000000000013fce0acbe6fb11641ab753212550574cad3141500000000000000000000000099e317c0099f0fb8c5913db976d00fddedb69583",
"EVMVersion": "paris",
"Library": "",
"LicenseType": "",
"Proxy": "0",
"Implementation": "",
"SwarmSource": ""
}
]
}
Submits a contract source code to LineaScan for verification.
Requires a valid LineaScan API key, it will be rejected otherwise
Only supports HTTP POST due to max transfer size limitations for HTTP GET
Supports up to 10 different library pairs
Contracts that use "imports" will need to have the code concatenated into one file as we do not support "imports" in separate files.
List of supported solc versions, only solc version v0.4.11 and above is supported e.g. v0.4.25+commit.59dbf8f1
Upon successful submission you will receive a GUID (50 characters) as a receipt
You may use this GUID to track the status of your submission
Verified Source Codes will be displayed at the Verified Contracts page.
//Submit Source Code for Verification
$.ajax({
type: "POST", //Only POST supported
url: "//api-sepolia.etherscan.io/api", //Set to the correct API url for Other Networks
data: {
apikey: $('#apikey').val(), //A valid API-Key is required
module: 'contract', //Do not change
action: 'verifysourcecode', //Do not change
contractaddress: $('#contractaddress').val(), //Contract Address starts with 0x...
sourceCode: $('#sourceCode').val(), //Contract Source Code (Flattened if necessary)
codeformat: $('#codeformat').val(), //solidity-single-file (default) or solidity-standard-json-input (for std-input-json-format support
contractname: $('#contractname').val(), //ContractName (if codeformat=solidity-standard-json-input, then enter contractname as ex: erc20.sol:erc20)
compilerversion: $('#compilerversion').val(), // see https://sepolia.lineascan.build/solcversions for list of support versions
optimizationUsed: $('#optimizationUsed').val(), //0 = No Optimization, 1 = Optimization used (applicable when codeformat=solidity-single-file)
runs: 200, //set to 200 as default unless otherwise (applicable when codeformat=solidity-single-file)
constructorArguements: $('#constructorArguements').val(), //if applicable
evmversion: $('#evmVersion').val(), //leave blank for compiler default, homestead, tangerineWhistle, spuriousDragon, byzantium, constantinople, petersburg, istanbul (applicable when codeformat=solidity-single-file)
licenseType: $('#licenseType').val(), //Valid codes 1-12 where 1=No License .. 12=Apache 2.0, see https://sepolia.lineascan.build/contract-license-types
libraryname1: $('#libraryname1').val(), //if applicable, a matching pair with libraryaddress1 required
libraryaddress1: $('#libraryaddress1').val(), //if applicable, a matching pair with libraryname1 required
libraryname2: $('#libraryname2').val(), //if applicable, matching pair required
libraryaddress2: $('#libraryaddress2').val(), //if applicable, matching pair required
libraryname3: $('#libraryname3').val(), //if applicable, matching pair required
libraryaddress3: $('#libraryaddress3').val(), //if applicable, matching pair required
libraryname4: $('#libraryname4').val(), //if applicable, matching pair required
libraryaddress4: $('#libraryaddress4').val(), //if applicable, matching pair required
libraryname5: $('#libraryname5').val(), //if applicable, matching pair required
libraryaddress5: $('#libraryaddress5').val(), //if applicable, matching pair required
libraryname6: $('#libraryname6').val(), //if applicable, matching pair required
libraryaddress6: $('#libraryaddress6').val(), //if applicable, matching pair required
libraryname7: $('#libraryname7').val(), //if applicable, matching pair required
libraryaddress7: $('#libraryaddress7').val(), //if applicable, matching pair required
libraryname8: $('#libraryname8').val(), //if applicable, matching pair required
libraryaddress8: $('#libraryaddress8').val(), //if applicable, matching pair required
libraryname9: $('#libraryname9').val(), //if applicable, matching pair required
libraryaddress9: $('#libraryaddress9').val(), //if applicable, matching pair required
libraryname10: $('#libraryname10').val(), //if applicable, matching pair required
libraryaddress10: $('#libraryaddress10').val() //if applicable, matching pair required
},
success: function (result) {
console.log(result);
if (result.status == "1") {
//1 = submission success, use the guid returned (result.result) to check the status of your submission.
// Average time of processing is 30-60 seconds
document.getElementById("postresult").innerHTML = result.status + ";" + result.message + ";" + result.result;
// result.result is the GUID receipt for the submission, you can use this guid for checking the verification status
} else {
//0 = error
document.getElementById("postresult").innerHTML = result.status + ";" + result.message + ";" + result.result;
}
console.log("status : " + result.status);
console.log("result : " + result.result);
},
error: function (result) {
console.log("error!");
document.getElementById("postresult").innerHTML = "Unexpected Error"
}
});
//Check Source Code Verification Status
$.ajax({
type: "GET",
url: "//api-sepolia.etherscan.io/api",
data: {
apikey: $('#apikey').val(),
guid: 'ezq878u486pzijkvvmerl6a9mzwhv6sefgvqi5tkwceejc7tvn', //Replace with your Source Code GUID receipt above
module: "contract",
action: "checkverifystatus"
},
success: function (result) {
console.log("status : " + result.status); //0=Error, 1=Pass
console.log("message : " + result.message); //OK, NOTOK
console.log("result : " + result.result); //result explanation
$('#guidstatus').html(">> " + result.result);
},
error: function (result) {
alert('error');
}
});
Submits a proxy contract source code to LineaScan for verification.
Requires a valid LineaScan API key, it will be rejected otherwise
Current daily limit of 100 submissions per day per user (subject to change)
Only supports HTTP post
Upon successful submission you will receive a GUID (50 characters) as a receipt
You may use this GUID to track the status of your submission
Verified proxy contracts will display the "Read/Write as Proxy" of the implementation contract under the contract address's contract tab
// example with only the mandatory contract address parameter
curl -d "address=0xcbdcd3815b5f975e1a2c944a9b2cd1c985a1cb7f" "https://api-sepolia.lineascan.build/api?module=contract&action=verifyproxycontract&apikey=YourApiKeyToken"
// example using the expectedimplementation optional parameter
// the expectedimplementation enforces a check to ensure the returned implementation contract address == address picked up by the verifier
curl -d "address=0xbc46363a7669f6e12353fa95bb067aead3675c29&expectedimplementation=0xe45a5176bc0f2c1198e2451c4e4501d4ed9b65a6" "https://api-sepolia.lineascan.build/api?module=contract&action=verifyproxycontract&apikey=YourApiKeyToken"
// OK
{"status":"1","message":"OK","result":"gwgrrnfy56zf6vc1fljuejwg6pelnc5yns6fg6y2i6zfpgzquz"}
// NOTOK
{"status":"0","message":"NOTOK","result":"Invalid API Key"}
curl "https://api-sepolia.lineascan.build/api?module=contract&action=checkproxyverification&guid=gwgrrnfy56zf6vc1fljuejwg6pelnc5yns6fg6y2i6zfpgzquz&apikey=YourApiKeyToken"
// OK
{"status":"1","message":"OK","result":"The proxy's (0xbc46363a7669f6e12353fa95bb067aead3675c29) implementation contract is found at 0xe45a5176bc0f2c1198e2451c4e4501d4ed9b65a6 and is successfully updated."}
// NOTOK
{"status":"0","message":"NOTOK","result":"A corresponding implementation contract was unfortunately not detected for the proxy address."}
Tip : You can also download a CSV list of verified contracts addresses of which the code publishers have provided a corresponding Open Source license for redistribution.
Try this endpoint in your browser
Parameter | Description |
---|---|
Note : This endpoint is limited to 100 verifications/day, regardless of API PRO tier.
Note: Upon successful submission, a GUID is returned, which can be used to check for submission status.
address
the contract address
that has a verified source code
address
the contract address
that has a verified source code