Source Code
Latest 9 from a total of 9 transactions
| Transaction Hash |
|
Block
|
From
|
To
|
|||||
|---|---|---|---|---|---|---|---|---|---|
| Emergency Withdr... | 58252470 | 37 days ago | IN | 0 S | 0.0024507 | ||||
| Emergency Withdr... | 58252425 | 37 days ago | IN | 0 S | 0.00264345 | ||||
| Pause | 58252399 | 37 days ago | IN | 0 S | 0.0023691 | ||||
| Remove Liquidity | 58246942 | 37 days ago | IN | 0 S | 0.01681943 | ||||
| Add Liquidity | 57985659 | 40 days ago | IN | 0 S | 0.03333286 | ||||
| Remove Liquidity | 57985645 | 40 days ago | IN | 0 S | 0.01460467 | ||||
| Add Liquidity | 57985486 | 40 days ago | IN | 0 S | 0.03333286 | ||||
| Remove Liquidity | 57940528 | 40 days ago | IN | 0 S | 0.01398202 | ||||
| Add Liquidity | 57940494 | 40 days ago | IN | 0 S | 0.0297945 |
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Cross-Chain Transactions
Loading...
Loading
Contract Name:
AutomatedLiquidityManager
Compiler Version
v0.8.28+commit.7893614a
Optimization Enabled:
Yes with 200 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/access/AccessControl.sol";
import "@openzeppelin/contracts/utils/Pausable.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/utils/ReentrancyGuard.sol";
interface INonfungiblePositionManager {
struct MintParams {
address token0;
address token1;
int24 tickSpacing;
int24 tickLower;
int24 tickUpper;
uint256 amount0Desired;
uint256 amount1Desired;
uint256 amount0Min;
uint256 amount1Min;
address recipient;
uint256 deadline;
}
struct DecreaseLiquidityParams {
uint256 tokenId;
uint128 liquidity;
uint256 amount0Min;
uint256 amount1Min;
uint256 deadline;
}
struct CollectParams {
uint256 tokenId;
address recipient;
uint128 amount0Max;
uint128 amount1Max;
}
function mint(MintParams calldata params)
external
payable
returns (
uint256 tokenId,
uint128 liquidity,
uint256 amount0,
uint256 amount1
);
function decreaseLiquidity(DecreaseLiquidityParams calldata params)
external
payable
returns (uint256 amount0, uint256 amount1);
function collect(CollectParams calldata params)
external
payable
returns (uint256 amount0, uint256 amount1);
function positions(uint256 tokenId)
external
view
returns (
address token0,
address token1,
int24 tickSpacing,
int24 tickLower,
int24 tickUpper,
uint128 liquidity,
uint256 feeGrowthInside0LastX128,
uint256 feeGrowthInside1LastX128,
uint128 tokensOwed0,
uint128 tokensOwed1
);
}
interface IUniswapV3Pool {
function token0() external view returns (address);
function token1() external view returns (address);
function slot0()
external
view
returns (
uint160 sqrtPriceX96,
int24 tick,
uint16 observationIndex,
uint16 observationCardinality,
uint16 observationCardinalityNext,
uint8 feeProtocol,
bool unlocked
);
function tickSpacing() external view returns (int24);
function fee() external view returns (uint24);
}
contract AutomatedLiquidityManager is AccessControl, Pausable, ReentrancyGuard {
using SafeERC20 for IERC20;
// Roles
bytes32 public constant ADMIN_ROLE = keccak256("ADMIN_ROLE");
bytes32 public constant SERVER_ROLE = keccak256("SERVER_ROLE");
// Contract addresses
address public immutable POSITION_MANAGER;
address public immutable POOL;
address public immutable TOKEN0; // USDC
address public immutable TOKEN1; // scUSD
// State variables
uint256 public currentTokenId;
bool public amountDesiredIsBalance = true;
uint256 public amount0Desired;
uint256 public amount1Desired;
uint256 public slippageBps = 50; // 0.5% slippage in basis points
uint256 public deadlineBuffer = 15 * 60; // 15 minutes
// Events
event LiquidityAdded(uint256 tokenId, uint128 liquidity, uint256 amount0, uint256 amount1);
event LiquidityRemoved(uint256 tokenId, uint256 amount0, uint256 amount1);
event PositionRebalanced(uint256 oldTokenId, uint256 newTokenId);
event AmountsUpdated(uint256 amount0Desired, uint256 amount1Desired);
event SlippageUpdated(uint256 newSlippageBps);
constructor(
address _positionManager,
address _pool,
uint256 _initialAmount0Desired,
uint256 _initialAmount1Desired
) {
POSITION_MANAGER = _positionManager;
POOL = _pool;
TOKEN0 = IUniswapV3Pool(_pool).token0();
TOKEN1 = IUniswapV3Pool(_pool).token1();
amount0Desired = _initialAmount0Desired;
amount1Desired = _initialAmount1Desired;
// Set up roles
_grantRole(DEFAULT_ADMIN_ROLE, msg.sender);
_grantRole(ADMIN_ROLE, msg.sender);
_grantRole(SERVER_ROLE, msg.sender);
}
/**
* @dev Get the current tick from the pool
*/
function getCurrentTick() public view returns (int24 tick) {
(, tick, , , , , ) = IUniswapV3Pool(POOL).slot0();
}
/**
* @dev Get the tick spacing from the pool
*/
function getTickSpacing() public view returns (int24) {
return IUniswapV3Pool(POOL).tickSpacing();
}
/**
* @dev Calculate the usable tick based on tick spacing
*/
function getUsableTick(int24 tick, int24 tickSpacing) public pure returns (int24) {
return (tick / tickSpacing) * tickSpacing;
}
/**
* @dev Get the active tick range (wider range for testing)
*/
function getActiveTickRange() public view returns (int24 tickLower, int24 tickUpper) {
int24 currentTick = getCurrentTick();
int24 tickSpacing = getTickSpacing();
// Use wider range similar to test.ts (±200 ticks = ±1000 range)
int24 tickRange = 200 * tickSpacing; // 1000 tick range
int24 lowerTick = getUsableTick(currentTick - tickRange, tickSpacing);
int24 upperTick = getUsableTick(currentTick + tickRange, tickSpacing);
tickLower = lowerTick;
tickUpper = upperTick;
// Critical validation to prevent edge cases
require(
tickLower % tickSpacing == 0 &&
tickUpper % tickSpacing == 0,
"Invalid tick alignment"
);
}
/**
* @dev Check if current position is still in the active tick
*/
function isPositionActive() public view returns (bool) {
if (currentTokenId == 0) return false;
(, , , int24 tickLower, int24 tickUpper, uint128 liquidity, , , , ) =
INonfungiblePositionManager(POSITION_MANAGER).positions(currentTokenId);
if (liquidity == 0) return false;
int24 currentTick = getCurrentTick();
return currentTick >= tickLower && currentTick < tickUpper;
}
/**
* @dev Add liquidity to the active tick range
*/
function addLiquidity() external onlyRole(SERVER_ROLE) whenNotPaused nonReentrant {
require(currentTokenId == 0, "Position already exists");
(int24 tickLower, int24 tickUpper) = getActiveTickRange();
uint256 finalAmount0Desired = amountDesiredIsBalance ?
IERC20(TOKEN0).balanceOf(address(this)) : amount0Desired;
uint256 finalAmount1Desired = amountDesiredIsBalance ?
IERC20(TOKEN1).balanceOf(address(this)) : amount1Desired;
if (finalAmount0Desired == 0 && finalAmount1Desired == 0) {
revert("No tokens available for liquidity");
}
// Ensure we have enough tokens
require(
IERC20(TOKEN0).balanceOf(address(this)) >= finalAmount0Desired,
"Insufficient TOKEN0 balance"
);
require(
IERC20(TOKEN1).balanceOf(address(this)) >= finalAmount1Desired,
"Insufficient TOKEN1 balance"
);
// Approve tokens
IERC20(TOKEN0).safeIncreaseAllowance(POSITION_MANAGER, finalAmount0Desired);
IERC20(TOKEN1).safeIncreaseAllowance(POSITION_MANAGER, finalAmount1Desired);
// Calculate minimum amounts with slippage tolerance (correct formula)
uint256 amount0Min = finalAmount0Desired * (10000 - slippageBps) / 10000;
uint256 amount1Min = finalAmount1Desired * (10000 - slippageBps) / 10000;
INonfungiblePositionManager.MintParams memory params = INonfungiblePositionManager.MintParams({
token0: TOKEN0,
token1: TOKEN1,
tickSpacing: getTickSpacing(),
tickLower: tickLower,
tickUpper: tickUpper,
amount0Desired: finalAmount0Desired,
amount1Desired: finalAmount1Desired,
amount0Min: amount0Min,
amount1Min: amount1Min,
recipient: address(this),
deadline: block.timestamp + deadlineBuffer
});
(uint256 tokenId, uint128 liquidity, uint256 amount0, uint256 amount1) =
INonfungiblePositionManager(POSITION_MANAGER).mint(params);
currentTokenId = tokenId;
emit LiquidityAdded(tokenId, liquidity, amount0, amount1);
}
/**
* @dev Remove all liquidity from current position
*/
function removeLiquidity() external onlyRole(SERVER_ROLE) whenNotPaused nonReentrant {
require(currentTokenId != 0, "No position to remove");
(, , , , , uint128 liquidity, , , , ) =
INonfungiblePositionManager(POSITION_MANAGER).positions(currentTokenId);
require(liquidity > 0, "No liquidity to remove");
// Decrease liquidity
INonfungiblePositionManager.DecreaseLiquidityParams memory decreaseParams =
INonfungiblePositionManager.DecreaseLiquidityParams({
tokenId: currentTokenId,
liquidity: liquidity,
amount0Min: 0,
amount1Min: 0,
deadline: block.timestamp + deadlineBuffer
});
INonfungiblePositionManager(POSITION_MANAGER).decreaseLiquidity(decreaseParams);
// Collect tokens
INonfungiblePositionManager.CollectParams memory collectParams =
INonfungiblePositionManager.CollectParams({
tokenId: currentTokenId,
recipient: address(this),
amount0Max: type(uint128).max,
amount1Max: type(uint128).max
});
(uint256 amount0, uint256 amount1) =
INonfungiblePositionManager(POSITION_MANAGER).collect(collectParams);
emit LiquidityRemoved(currentTokenId, amount0, amount1);
currentTokenId = 0;
}
/**
* @dev Rebalance position if it's no longer in the active tick
*/
function rebalance() external onlyRole(SERVER_ROLE) whenNotPaused nonReentrant {
require(!isPositionActive(), "Position is still active");
uint256 oldTokenId = currentTokenId;
// Remove current liquidity if exists
if (currentTokenId != 0) {
this.removeLiquidity();
}
// Add liquidity in new active tick
this.addLiquidity();
emit PositionRebalanced(oldTokenId, currentTokenId);
}
/**
* @dev Set whether desired amounts are fixed or based on balance
*/
function setDesiredAmountIsBalance(bool _isBalance)
external onlyRole(ADMIN_ROLE) {
amountDesiredIsBalance = _isBalance;
}
/**
* @dev Set the desired amounts for liquidity provision
*/
function setDesiredAmounts(uint256 _amount0Desired, uint256 _amount1Desired)
external onlyRole(ADMIN_ROLE) {
amount0Desired = _amount0Desired;
amount1Desired = _amount1Desired;
emit AmountsUpdated(_amount0Desired, _amount1Desired);
}
/**
* @dev Set slippage tolerance (in basis points)
*/
function setSlippageBps(uint256 _slippageBps) external onlyRole(ADMIN_ROLE) {
require(_slippageBps <= 10000, "Invalid slippage basis points");
slippageBps = _slippageBps;
emit SlippageUpdated(_slippageBps);
}
/**
* @dev Emergency withdraw tokens
*/
function emergencyWithdraw(address token, uint256 amount)
external onlyRole(ADMIN_ROLE) whenPaused {
IERC20(token).safeTransfer(msg.sender, amount);
}
/**
* @dev Deposit tokens to the contract
*/
function deposit(address token, uint256 amount) external onlyRole(ADMIN_ROLE) {
IERC20(token).safeTransferFrom(msg.sender, address(this), amount);
}
/**
* @dev Get contract token balances
*/
function getBalances() external view returns (uint256 balance0, uint256 balance1) {
balance0 = IERC20(TOKEN0).balanceOf(address(this));
balance1 = IERC20(TOKEN1).balanceOf(address(this));
}
/**
* @dev Get current position info
*/
function getCurrentPosition() external view returns (
uint256 tokenId,
int24 tickLower,
int24 tickUpper,
uint128 liquidity,
bool isActive
) {
tokenId = currentTokenId;
if (tokenId != 0) {
(, , , tickLower, tickUpper, liquidity, , , , ) =
INonfungiblePositionManager(POSITION_MANAGER).positions(tokenId);
}
isActive = isPositionActive();
}
/**
* @dev Pause the contract (admin only)
*/
function pause() external onlyRole(ADMIN_ROLE) {
_pause();
}
/**
* @dev Unpause the contract (admin only)
*/
function unpause() external onlyRole(ADMIN_ROLE) {
_unpause();
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.4.0) (access/AccessControl.sol)
pragma solidity ^0.8.20;
import {IAccessControl} from "./IAccessControl.sol";
import {Context} from "../utils/Context.sol";
import {IERC165, ERC165} from "../utils/introspection/ERC165.sol";
/**
* @dev Contract module that allows children to implement role-based access
* control mechanisms. This is a lightweight version that doesn't allow enumerating role
* members except through off-chain means by accessing the contract event logs. Some
* applications may benefit from on-chain enumerability, for those cases see
* {AccessControlEnumerable}.
*
* Roles are referred to by their `bytes32` identifier. These should be exposed
* in the external API and be unique. The best way to achieve this is by
* using `public constant` hash digests:
*
* ```solidity
* bytes32 public constant MY_ROLE = keccak256("MY_ROLE");
* ```
*
* Roles can be used to represent a set of permissions. To restrict access to a
* function call, use {hasRole}:
*
* ```solidity
* function foo() public {
* require(hasRole(MY_ROLE, msg.sender));
* ...
* }
* ```
*
* Roles can be granted and revoked dynamically via the {grantRole} and
* {revokeRole} functions. Each role has an associated admin role, and only
* accounts that have a role's admin role can call {grantRole} and {revokeRole}.
*
* By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means
* that only accounts with this role will be able to grant or revoke other
* roles. More complex role relationships can be created by using
* {_setRoleAdmin}.
*
* WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to
* grant and revoke this role. Extra precautions should be taken to secure
* accounts that have been granted it. We recommend using {AccessControlDefaultAdminRules}
* to enforce additional security measures for this role.
*/
abstract contract AccessControl is Context, IAccessControl, ERC165 {
struct RoleData {
mapping(address account => bool) hasRole;
bytes32 adminRole;
}
mapping(bytes32 role => RoleData) private _roles;
bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;
/**
* @dev Modifier that checks that an account has a specific role. Reverts
* with an {AccessControlUnauthorizedAccount} error including the required role.
*/
modifier onlyRole(bytes32 role) {
_checkRole(role);
_;
}
/// @inheritdoc IERC165
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);
}
/**
* @dev Returns `true` if `account` has been granted `role`.
*/
function hasRole(bytes32 role, address account) public view virtual returns (bool) {
return _roles[role].hasRole[account];
}
/**
* @dev Reverts with an {AccessControlUnauthorizedAccount} error if `_msgSender()`
* is missing `role`. Overriding this function changes the behavior of the {onlyRole} modifier.
*/
function _checkRole(bytes32 role) internal view virtual {
_checkRole(role, _msgSender());
}
/**
* @dev Reverts with an {AccessControlUnauthorizedAccount} error if `account`
* is missing `role`.
*/
function _checkRole(bytes32 role, address account) internal view virtual {
if (!hasRole(role, account)) {
revert AccessControlUnauthorizedAccount(account, role);
}
}
/**
* @dev Returns the admin role that controls `role`. See {grantRole} and
* {revokeRole}.
*
* To change a role's admin, use {_setRoleAdmin}.
*/
function getRoleAdmin(bytes32 role) public view virtual returns (bytes32) {
return _roles[role].adminRole;
}
/**
* @dev Grants `role` to `account`.
*
* If `account` had not been already granted `role`, emits a {RoleGranted}
* event.
*
* Requirements:
*
* - the caller must have ``role``'s admin role.
*
* May emit a {RoleGranted} event.
*/
function grantRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) {
_grantRole(role, account);
}
/**
* @dev Revokes `role` from `account`.
*
* If `account` had been granted `role`, emits a {RoleRevoked} event.
*
* Requirements:
*
* - the caller must have ``role``'s admin role.
*
* May emit a {RoleRevoked} event.
*/
function revokeRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) {
_revokeRole(role, account);
}
/**
* @dev Revokes `role` from the calling account.
*
* Roles are often managed via {grantRole} and {revokeRole}: this function's
* purpose is to provide a mechanism for accounts to lose their privileges
* if they are compromised (such as when a trusted device is misplaced).
*
* If the calling account had been revoked `role`, emits a {RoleRevoked}
* event.
*
* Requirements:
*
* - the caller must be `callerConfirmation`.
*
* May emit a {RoleRevoked} event.
*/
function renounceRole(bytes32 role, address callerConfirmation) public virtual {
if (callerConfirmation != _msgSender()) {
revert AccessControlBadConfirmation();
}
_revokeRole(role, callerConfirmation);
}
/**
* @dev Sets `adminRole` as ``role``'s admin role.
*
* Emits a {RoleAdminChanged} event.
*/
function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {
bytes32 previousAdminRole = getRoleAdmin(role);
_roles[role].adminRole = adminRole;
emit RoleAdminChanged(role, previousAdminRole, adminRole);
}
/**
* @dev Attempts to grant `role` to `account` and returns a boolean indicating if `role` was granted.
*
* Internal function without access restriction.
*
* May emit a {RoleGranted} event.
*/
function _grantRole(bytes32 role, address account) internal virtual returns (bool) {
if (!hasRole(role, account)) {
_roles[role].hasRole[account] = true;
emit RoleGranted(role, account, _msgSender());
return true;
} else {
return false;
}
}
/**
* @dev Attempts to revoke `role` from `account` and returns a boolean indicating if `role` was revoked.
*
* Internal function without access restriction.
*
* May emit a {RoleRevoked} event.
*/
function _revokeRole(bytes32 role, address account) internal virtual returns (bool) {
if (hasRole(role, account)) {
_roles[role].hasRole[account] = false;
emit RoleRevoked(role, account, _msgSender());
return true;
} else {
return false;
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.4.0) (access/IAccessControl.sol)
pragma solidity >=0.8.4;
/**
* @dev External interface of AccessControl declared to support ERC-165 detection.
*/
interface IAccessControl {
/**
* @dev The `account` is missing a role.
*/
error AccessControlUnauthorizedAccount(address account, bytes32 neededRole);
/**
* @dev The caller of a function is not the expected one.
*
* NOTE: Don't confuse with {AccessControlUnauthorizedAccount}.
*/
error AccessControlBadConfirmation();
/**
* @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`
*
* `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite
* {RoleAdminChanged} not being emitted to signal this.
*/
event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);
/**
* @dev Emitted when `account` is granted `role`.
*
* `sender` is the account that originated the contract call. This account bears the admin role (for the granted role).
* Expected in cases where the role was granted using the internal {AccessControl-_grantRole}.
*/
event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);
/**
* @dev Emitted when `account` is revoked `role`.
*
* `sender` is the account that originated the contract call:
* - if using `revokeRole`, it is the admin role bearer
* - if using `renounceRole`, it is the role bearer (i.e. `account`)
*/
event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);
/**
* @dev Returns `true` if `account` has been granted `role`.
*/
function hasRole(bytes32 role, address account) external view returns (bool);
/**
* @dev Returns the admin role that controls `role`. See {grantRole} and
* {revokeRole}.
*
* To change a role's admin, use {AccessControl-_setRoleAdmin}.
*/
function getRoleAdmin(bytes32 role) external view returns (bytes32);
/**
* @dev Grants `role` to `account`.
*
* If `account` had not been already granted `role`, emits a {RoleGranted}
* event.
*
* Requirements:
*
* - the caller must have ``role``'s admin role.
*/
function grantRole(bytes32 role, address account) external;
/**
* @dev Revokes `role` from `account`.
*
* If `account` had been granted `role`, emits a {RoleRevoked} event.
*
* Requirements:
*
* - the caller must have ``role``'s admin role.
*/
function revokeRole(bytes32 role, address account) external;
/**
* @dev Revokes `role` from the calling account.
*
* Roles are often managed via {grantRole} and {revokeRole}: this function's
* purpose is to provide a mechanism for accounts to lose their privileges
* if they are compromised (such as when a trusted device is misplaced).
*
* If the calling account had been granted `role`, emits a {RoleRevoked}
* event.
*
* Requirements:
*
* - the caller must be `callerConfirmation`.
*/
function renounceRole(bytes32 role, address callerConfirmation) external;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.4.0) (interfaces/IERC1363.sol)
pragma solidity >=0.6.2;
import {IERC20} from "./IERC20.sol";
import {IERC165} from "./IERC165.sol";
/**
* @title IERC1363
* @dev Interface of the ERC-1363 standard as defined in the https://eips.ethereum.org/EIPS/eip-1363[ERC-1363].
*
* Defines an extension interface for ERC-20 tokens that supports executing code on a recipient contract
* after `transfer` or `transferFrom`, or code on a spender contract after `approve`, in a single transaction.
*/
interface IERC1363 is IERC20, IERC165 {
/*
* Note: the ERC-165 identifier for this interface is 0xb0202a11.
* 0xb0202a11 ===
* bytes4(keccak256('transferAndCall(address,uint256)')) ^
* bytes4(keccak256('transferAndCall(address,uint256,bytes)')) ^
* bytes4(keccak256('transferFromAndCall(address,address,uint256)')) ^
* bytes4(keccak256('transferFromAndCall(address,address,uint256,bytes)')) ^
* bytes4(keccak256('approveAndCall(address,uint256)')) ^
* bytes4(keccak256('approveAndCall(address,uint256,bytes)'))
*/
/**
* @dev Moves a `value` amount of tokens from the caller's account to `to`
* and then calls {IERC1363Receiver-onTransferReceived} on `to`.
* @param to The address which you want to transfer to.
* @param value The amount of tokens to be transferred.
* @return A boolean value indicating whether the operation succeeded unless throwing.
*/
function transferAndCall(address to, uint256 value) external returns (bool);
/**
* @dev Moves a `value` amount of tokens from the caller's account to `to`
* and then calls {IERC1363Receiver-onTransferReceived} on `to`.
* @param to The address which you want to transfer to.
* @param value The amount of tokens to be transferred.
* @param data Additional data with no specified format, sent in call to `to`.
* @return A boolean value indicating whether the operation succeeded unless throwing.
*/
function transferAndCall(address to, uint256 value, bytes calldata data) external returns (bool);
/**
* @dev Moves a `value` amount of tokens from `from` to `to` using the allowance mechanism
* and then calls {IERC1363Receiver-onTransferReceived} on `to`.
* @param from The address which you want to send tokens from.
* @param to The address which you want to transfer to.
* @param value The amount of tokens to be transferred.
* @return A boolean value indicating whether the operation succeeded unless throwing.
*/
function transferFromAndCall(address from, address to, uint256 value) external returns (bool);
/**
* @dev Moves a `value` amount of tokens from `from` to `to` using the allowance mechanism
* and then calls {IERC1363Receiver-onTransferReceived} on `to`.
* @param from The address which you want to send tokens from.
* @param to The address which you want to transfer to.
* @param value The amount of tokens to be transferred.
* @param data Additional data with no specified format, sent in call to `to`.
* @return A boolean value indicating whether the operation succeeded unless throwing.
*/
function transferFromAndCall(address from, address to, uint256 value, bytes calldata data) external returns (bool);
/**
* @dev Sets a `value` amount of tokens as the allowance of `spender` over the
* caller's tokens and then calls {IERC1363Spender-onApprovalReceived} on `spender`.
* @param spender The address which will spend the funds.
* @param value The amount of tokens to be spent.
* @return A boolean value indicating whether the operation succeeded unless throwing.
*/
function approveAndCall(address spender, uint256 value) external returns (bool);
/**
* @dev Sets a `value` amount of tokens as the allowance of `spender` over the
* caller's tokens and then calls {IERC1363Spender-onApprovalReceived} on `spender`.
* @param spender The address which will spend the funds.
* @param value The amount of tokens to be spent.
* @param data Additional data with no specified format, sent in call to `spender`.
* @return A boolean value indicating whether the operation succeeded unless throwing.
*/
function approveAndCall(address spender, uint256 value, bytes calldata data) external returns (bool);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.4.0) (interfaces/IERC165.sol)
pragma solidity >=0.4.16;
import {IERC165} from "../utils/introspection/IERC165.sol";// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.4.0) (interfaces/IERC20.sol)
pragma solidity >=0.4.16;
import {IERC20} from "../token/ERC20/IERC20.sol";// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.4.0) (token/ERC20/IERC20.sol)
pragma solidity >=0.4.16;
/**
* @dev Interface of the ERC-20 standard as defined in the ERC.
*/
interface IERC20 {
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
/**
* @dev Returns the value of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the value of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves a `value` amount of tokens from the caller's account to `to`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address to, uint256 value) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets a `value` amount of tokens as the allowance of `spender` over the
* caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 value) external returns (bool);
/**
* @dev Moves a `value` amount of tokens from `from` to `to` using the
* allowance mechanism. `value` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address from, address to, uint256 value) external returns (bool);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.3.0) (token/ERC20/utils/SafeERC20.sol)
pragma solidity ^0.8.20;
import {IERC20} from "../IERC20.sol";
import {IERC1363} from "../../../interfaces/IERC1363.sol";
/**
* @title SafeERC20
* @dev Wrappers around ERC-20 operations that throw on failure (when the token
* contract returns false). Tokens that return no value (and instead revert or
* throw on failure) are also supported, non-reverting calls are assumed to be
* successful.
* To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
* which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
*/
library SafeERC20 {
/**
* @dev An operation with an ERC-20 token failed.
*/
error SafeERC20FailedOperation(address token);
/**
* @dev Indicates a failed `decreaseAllowance` request.
*/
error SafeERC20FailedDecreaseAllowance(address spender, uint256 currentAllowance, uint256 requestedDecrease);
/**
* @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,
* non-reverting calls are assumed to be successful.
*/
function safeTransfer(IERC20 token, address to, uint256 value) internal {
_callOptionalReturn(token, abi.encodeCall(token.transfer, (to, value)));
}
/**
* @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the
* calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.
*/
function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
_callOptionalReturn(token, abi.encodeCall(token.transferFrom, (from, to, value)));
}
/**
* @dev Variant of {safeTransfer} that returns a bool instead of reverting if the operation is not successful.
*/
function trySafeTransfer(IERC20 token, address to, uint256 value) internal returns (bool) {
return _callOptionalReturnBool(token, abi.encodeCall(token.transfer, (to, value)));
}
/**
* @dev Variant of {safeTransferFrom} that returns a bool instead of reverting if the operation is not successful.
*/
function trySafeTransferFrom(IERC20 token, address from, address to, uint256 value) internal returns (bool) {
return _callOptionalReturnBool(token, abi.encodeCall(token.transferFrom, (from, to, value)));
}
/**
* @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
* non-reverting calls are assumed to be successful.
*
* IMPORTANT: If the token implements ERC-7674 (ERC-20 with temporary allowance), and if the "client"
* smart contract uses ERC-7674 to set temporary allowances, then the "client" smart contract should avoid using
* this function. Performing a {safeIncreaseAllowance} or {safeDecreaseAllowance} operation on a token contract
* that has a non-zero temporary allowance (for that particular owner-spender) will result in unexpected behavior.
*/
function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
uint256 oldAllowance = token.allowance(address(this), spender);
forceApprove(token, spender, oldAllowance + value);
}
/**
* @dev Decrease the calling contract's allowance toward `spender` by `requestedDecrease`. If `token` returns no
* value, non-reverting calls are assumed to be successful.
*
* IMPORTANT: If the token implements ERC-7674 (ERC-20 with temporary allowance), and if the "client"
* smart contract uses ERC-7674 to set temporary allowances, then the "client" smart contract should avoid using
* this function. Performing a {safeIncreaseAllowance} or {safeDecreaseAllowance} operation on a token contract
* that has a non-zero temporary allowance (for that particular owner-spender) will result in unexpected behavior.
*/
function safeDecreaseAllowance(IERC20 token, address spender, uint256 requestedDecrease) internal {
unchecked {
uint256 currentAllowance = token.allowance(address(this), spender);
if (currentAllowance < requestedDecrease) {
revert SafeERC20FailedDecreaseAllowance(spender, currentAllowance, requestedDecrease);
}
forceApprove(token, spender, currentAllowance - requestedDecrease);
}
}
/**
* @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,
* non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval
* to be set to zero before setting it to a non-zero value, such as USDT.
*
* NOTE: If the token implements ERC-7674, this function will not modify any temporary allowance. This function
* only sets the "standard" allowance. Any temporary allowance will remain active, in addition to the value being
* set here.
*/
function forceApprove(IERC20 token, address spender, uint256 value) internal {
bytes memory approvalCall = abi.encodeCall(token.approve, (spender, value));
if (!_callOptionalReturnBool(token, approvalCall)) {
_callOptionalReturn(token, abi.encodeCall(token.approve, (spender, 0)));
_callOptionalReturn(token, approvalCall);
}
}
/**
* @dev Performs an {ERC1363} transferAndCall, with a fallback to the simple {ERC20} transfer if the target has no
* code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when
* targeting contracts.
*
* Reverts if the returned value is other than `true`.
*/
function transferAndCallRelaxed(IERC1363 token, address to, uint256 value, bytes memory data) internal {
if (to.code.length == 0) {
safeTransfer(token, to, value);
} else if (!token.transferAndCall(to, value, data)) {
revert SafeERC20FailedOperation(address(token));
}
}
/**
* @dev Performs an {ERC1363} transferFromAndCall, with a fallback to the simple {ERC20} transferFrom if the target
* has no code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when
* targeting contracts.
*
* Reverts if the returned value is other than `true`.
*/
function transferFromAndCallRelaxed(
IERC1363 token,
address from,
address to,
uint256 value,
bytes memory data
) internal {
if (to.code.length == 0) {
safeTransferFrom(token, from, to, value);
} else if (!token.transferFromAndCall(from, to, value, data)) {
revert SafeERC20FailedOperation(address(token));
}
}
/**
* @dev Performs an {ERC1363} approveAndCall, with a fallback to the simple {ERC20} approve if the target has no
* code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when
* targeting contracts.
*
* NOTE: When the recipient address (`to`) has no code (i.e. is an EOA), this function behaves as {forceApprove}.
* Opposedly, when the recipient address (`to`) has code, this function only attempts to call {ERC1363-approveAndCall}
* once without retrying, and relies on the returned value to be true.
*
* Reverts if the returned value is other than `true`.
*/
function approveAndCallRelaxed(IERC1363 token, address to, uint256 value, bytes memory data) internal {
if (to.code.length == 0) {
forceApprove(token, to, value);
} else if (!token.approveAndCall(to, value, data)) {
revert SafeERC20FailedOperation(address(token));
}
}
/**
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
* on the return value: the return value is optional (but if data is returned, it must not be false).
* @param token The token targeted by the call.
* @param data The call data (encoded using abi.encode or one of its variants).
*
* This is a variant of {_callOptionalReturnBool} that reverts if call fails to meet the requirements.
*/
function _callOptionalReturn(IERC20 token, bytes memory data) private {
uint256 returnSize;
uint256 returnValue;
assembly ("memory-safe") {
let success := call(gas(), token, 0, add(data, 0x20), mload(data), 0, 0x20)
// bubble errors
if iszero(success) {
let ptr := mload(0x40)
returndatacopy(ptr, 0, returndatasize())
revert(ptr, returndatasize())
}
returnSize := returndatasize()
returnValue := mload(0)
}
if (returnSize == 0 ? address(token).code.length == 0 : returnValue != 1) {
revert SafeERC20FailedOperation(address(token));
}
}
/**
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
* on the return value: the return value is optional (but if data is returned, it must not be false).
* @param token The token targeted by the call.
* @param data The call data (encoded using abi.encode or one of its variants).
*
* This is a variant of {_callOptionalReturn} that silently catches all reverts and returns a bool instead.
*/
function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {
bool success;
uint256 returnSize;
uint256 returnValue;
assembly ("memory-safe") {
success := call(gas(), token, 0, add(data, 0x20), mload(data), 0, 0x20)
returnSize := returndatasize()
returnValue := mload(0)
}
return success && (returnSize == 0 ? address(token).code.length > 0 : returnValue == 1);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)
pragma solidity ^0.8.20;
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
function _contextSuffixLength() internal view virtual returns (uint256) {
return 0;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.4.0) (utils/introspection/ERC165.sol)
pragma solidity ^0.8.20;
import {IERC165} from "./IERC165.sol";
/**
* @dev Implementation of the {IERC165} interface.
*
* Contracts that want to implement ERC-165 should inherit from this contract and override {supportsInterface} to check
* for the additional interface id that will be supported. For example:
*
* ```solidity
* function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
* return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
* }
* ```
*/
abstract contract ERC165 is IERC165 {
/// @inheritdoc IERC165
function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) {
return interfaceId == type(IERC165).interfaceId;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.4.0) (utils/introspection/IERC165.sol)
pragma solidity >=0.4.16;
/**
* @dev Interface of the ERC-165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[ERC].
*
* Implementers can declare support of contract interfaces, which can then be
* queried by others ({ERC165Checker}).
*
* For an implementation, see {ERC165}.
*/
interface IERC165 {
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[ERC section]
* to learn more about how these ids are created.
*
* This function call must use less than 30 000 gas.
*/
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.3.0) (utils/Pausable.sol)
pragma solidity ^0.8.20;
import {Context} from "../utils/Context.sol";
/**
* @dev Contract module which allows children to implement an emergency stop
* mechanism that can be triggered by an authorized account.
*
* This module is used through inheritance. It will make available the
* modifiers `whenNotPaused` and `whenPaused`, which can be applied to
* the functions of your contract. Note that they will not be pausable by
* simply including this module, only once the modifiers are put in place.
*/
abstract contract Pausable is Context {
bool private _paused;
/**
* @dev Emitted when the pause is triggered by `account`.
*/
event Paused(address account);
/**
* @dev Emitted when the pause is lifted by `account`.
*/
event Unpaused(address account);
/**
* @dev The operation failed because the contract is paused.
*/
error EnforcedPause();
/**
* @dev The operation failed because the contract is not paused.
*/
error ExpectedPause();
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*
* Requirements:
*
* - The contract must not be paused.
*/
modifier whenNotPaused() {
_requireNotPaused();
_;
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*
* Requirements:
*
* - The contract must be paused.
*/
modifier whenPaused() {
_requirePaused();
_;
}
/**
* @dev Returns true if the contract is paused, and false otherwise.
*/
function paused() public view virtual returns (bool) {
return _paused;
}
/**
* @dev Throws if the contract is paused.
*/
function _requireNotPaused() internal view virtual {
if (paused()) {
revert EnforcedPause();
}
}
/**
* @dev Throws if the contract is not paused.
*/
function _requirePaused() internal view virtual {
if (!paused()) {
revert ExpectedPause();
}
}
/**
* @dev Triggers stopped state.
*
* Requirements:
*
* - The contract must not be paused.
*/
function _pause() internal virtual whenNotPaused {
_paused = true;
emit Paused(_msgSender());
}
/**
* @dev Returns to normal state.
*
* Requirements:
*
* - The contract must be paused.
*/
function _unpause() internal virtual whenPaused {
_paused = false;
emit Unpaused(_msgSender());
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (utils/ReentrancyGuard.sol)
pragma solidity ^0.8.20;
/**
* @dev Contract module that helps prevent reentrant calls to a function.
*
* Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
* available, which can be applied to functions to make sure there are no nested
* (reentrant) calls to them.
*
* Note that because there is a single `nonReentrant` guard, functions marked as
* `nonReentrant` may not call one another. This can be worked around by making
* those functions `private`, and then adding `external` `nonReentrant` entry
* points to them.
*
* TIP: If EIP-1153 (transient storage) is available on the chain you're deploying at,
* consider using {ReentrancyGuardTransient} instead.
*
* TIP: If you would like to learn more about reentrancy and alternative ways
* to protect against it, check out our blog post
* https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
*/
abstract contract ReentrancyGuard {
// Booleans are more expensive than uint256 or any type that takes up a full
// word because each write operation emits an extra SLOAD to first read the
// slot's contents, replace the bits taken up by the boolean, and then write
// back. This is the compiler's defense against contract upgrades and
// pointer aliasing, and it cannot be disabled.
// The values being non-zero value makes deployment a bit more expensive,
// but in exchange the refund on every call to nonReentrant will be lower in
// amount. Since refunds are capped to a percentage of the total
// transaction's gas, it is best to keep them low in cases like this one, to
// increase the likelihood of the full refund coming into effect.
uint256 private constant NOT_ENTERED = 1;
uint256 private constant ENTERED = 2;
uint256 private _status;
/**
* @dev Unauthorized reentrant call.
*/
error ReentrancyGuardReentrantCall();
constructor() {
_status = NOT_ENTERED;
}
/**
* @dev Prevents a contract from calling itself, directly or indirectly.
* Calling a `nonReentrant` function from another `nonReentrant`
* function is not supported. It is possible to prevent this from happening
* by making the `nonReentrant` function external, and making it call a
* `private` function that does the actual work.
*/
modifier nonReentrant() {
_nonReentrantBefore();
_;
_nonReentrantAfter();
}
function _nonReentrantBefore() private {
// On the first call to nonReentrant, _status will be NOT_ENTERED
if (_status == ENTERED) {
revert ReentrancyGuardReentrantCall();
}
// Any calls to nonReentrant after this point will fail
_status = ENTERED;
}
function _nonReentrantAfter() private {
// By storing the original value once again, a refund is triggered (see
// https://eips.ethereum.org/EIPS/eip-2200)
_status = NOT_ENTERED;
}
/**
* @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a
* `nonReentrant` function in the call stack.
*/
function _reentrancyGuardEntered() internal view returns (bool) {
return _status == ENTERED;
}
}{
"optimizer": {
"enabled": true,
"runs": 200
},
"viaIR": true,
"evmVersion": "paris",
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"address","name":"_positionManager","type":"address"},{"internalType":"address","name":"_pool","type":"address"},{"internalType":"uint256","name":"_initialAmount0Desired","type":"uint256"},{"internalType":"uint256","name":"_initialAmount1Desired","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"AccessControlBadConfirmation","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"bytes32","name":"neededRole","type":"bytes32"}],"name":"AccessControlUnauthorizedAccount","type":"error"},{"inputs":[],"name":"EnforcedPause","type":"error"},{"inputs":[],"name":"ExpectedPause","type":"error"},{"inputs":[],"name":"ReentrancyGuardReentrantCall","type":"error"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"SafeERC20FailedOperation","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amount0Desired","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount1Desired","type":"uint256"}],"name":"AmountsUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"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":"LiquidityAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount0","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount1","type":"uint256"}],"name":"LiquidityRemoved","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"oldTokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newTokenId","type":"uint256"}],"name":"PositionRebalanced","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"newSlippageBps","type":"uint256"}],"name":"SlippageUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"inputs":[],"name":"ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"POOL","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"POSITION_MANAGER","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"SERVER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"TOKEN0","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"TOKEN1","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"addLiquidity","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"amount0Desired","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"amount1Desired","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"amountDesiredIsBalance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"currentTokenId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"deadlineBuffer","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"deposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"emergencyWithdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getActiveTickRange","outputs":[{"internalType":"int24","name":"tickLower","type":"int24"},{"internalType":"int24","name":"tickUpper","type":"int24"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getBalances","outputs":[{"internalType":"uint256","name":"balance0","type":"uint256"},{"internalType":"uint256","name":"balance1","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getCurrentPosition","outputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"int24","name":"tickLower","type":"int24"},{"internalType":"int24","name":"tickUpper","type":"int24"},{"internalType":"uint128","name":"liquidity","type":"uint128"},{"internalType":"bool","name":"isActive","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getCurrentTick","outputs":[{"internalType":"int24","name":"tick","type":"int24"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTickSpacing","outputs":[{"internalType":"int24","name":"","type":"int24"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"int24","name":"tick","type":"int24"},{"internalType":"int24","name":"tickSpacing","type":"int24"}],"name":"getUsableTick","outputs":[{"internalType":"int24","name":"","type":"int24"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isPositionActive","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rebalance","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"removeLiquidity","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"callerConfirmation","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_isBalance","type":"bool"}],"name":"setDesiredAmountIsBalance","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount0Desired","type":"uint256"},{"internalType":"uint256","name":"_amount1Desired","type":"uint256"}],"name":"setDesiredAmounts","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_slippageBps","type":"uint256"}],"name":"setSlippageBps","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"slippageBps","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"}]Contract Creation Code
61010080604052346101aa5760808161245f80380380916100208285610204565b8339810103126101aa576100338161023d565b906100406020820161023d565b60606040830151920151926001600255600160ff19600454161760045560326007556103846008556080528060a05260018060a01b0316604051630dfe168160e01b8152602081600481855afa9081156101b7576000916101c3575b5060c05260405163d21220a760e01b815290602090829060049082905afa9081156101b757600091610178575b5060e0526005556006556100dc33610251565b506100e6336102cd565b506100f033610365565b50604051611fe190816103fe823960805181818161037a01528181610c1601528181611163015281816113a201526119ee015260a051818181610b9f015281816118f20152611ade015260c051818181610219015281816102cf015281816110b80152611575015260e0518181816102740152818161032e01528181610fbe01526115c90152f35b90506020813d6020116101af575b8161019360209383610204565b810103126101aa576101a49061023d565b386100c9565b600080fd5b3d9150610186565b6040513d6000823e3d90fd5b90506020813d6020116101fc575b816101de60209383610204565b810103126101aa576004916101f460209261023d565b91509161009c565b3d91506101d1565b601f909101601f19168101906001600160401b0382119082101761022757604052565b634e487b7160e01b600052604160045260246000fd5b51906001600160a01b03821682036101aa57565b6001600160a01b038116600090815260008051602061243f833981519152602052604090205460ff166102c7576001600160a01b0316600081815260008051602061243f83398151915260205260408120805460ff191660011790553391906000805160206123df8339815191528180a4600190565b50600090565b6001600160a01b03811660009081526000805160206123ff833981519152602052604090205460ff166102c7576001600160a01b031660008181526000805160206123ff83398151915260205260408120805460ff191660011790553391907fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c21775906000805160206123df8339815191529080a4600190565b6001600160a01b038116600090815260008051602061241f833981519152602052604090205460ff166102c7576001600160a01b0316600081815260008051602061241f83398151915260205260408120805460ff191660011790553391907fa8a7bc421f721cb936ea99efdad79237e6ee0b871a2a08cf648691f9584cdc77906000805160206123df8339815191529080a460019056fe608080604052600436101561001357600080fd5b600090813560e01c908162113e081461154b575080629a9b7b1461152d57806301ffc9a7146114d657806314a1834b146114a957806318cf28341461146e5780631a3ce4e6146113d15780631bea83fe1461138c578063248a9ca3146113565780632f2ff15d1461131557806335953caf146112dd57806336568abe146112985780633a9517c81461127a5780633a9dd259146112575780633ef31035146112395780633f4ba83a146111e1578063418f35cc146110e7578063443ec74d146110a257806347e7ef241461104957806353aad1d91461102e578063578c71d9146110105780635c975abb14610fed5780635ee04d7814610fa85780636021226814610f83578063657d27cd14610f2a57806366b141f314610f0c57806367b9a28614610bce5780637535d24614610b8957806375b238fc14610b4e5780637d7c2a1c14610a115780637db3fd69146109f65780638456cb591461099c57806391d148541461095157806395ccea67146108e1578063a217fddf146108c5578063b41f4fcb14610878578063d547741f1461082e5763e8078d94146101b657600080fd5b3461082b578060031936011261082b576101ce611bf6565b6101d6611da9565b6101de611dc6565b6003546107e6576101ed611736565b919060ff6004541690816000146107dd576040516370a0823160e01b81523060048201526020816024817f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03165afa9081156107985784916107ab575b50915b156107a3576040516370a0823160e01b81523060048201526020816024817f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03165afa908115610798578491610766575b505b82158061075e575b61070f576040516370a0823160e01b81523060048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031695906020816024818a5afa9081156107045790859187916106cf575b501061068a576040516370a0823160e01b81523060048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169490602081602481895afa90811561067f579084918891610645575b5010610600577f0000000000000000000000000000000000000000000000000000000000000000926103a582858a611e04565b6103b0818588611e04565b6007546127100361271081116105ec576127106103d9816103d18487611b71565b049284611b71565b04916103e3611ac9565b936103f060085442611aa6565b95604051986101608a019c8d67ffffffffffffffff8c82109111176105d85760409d8e528a5260208a019a8b52600296870b8a8e0190815290870b60608b0190815291870b60808b0190815260a08b0193845260c08b0194855260e08b019586526101008b01968752306101208c019081526101408c01998a529d51636d70c41560e01b81529a516001600160a01b0390811660048d01529b518c1660248c01529051870b60448b01529051860b60648a01525190940b6084880152925160a4870152915160c4860152905160e48501525161010484015294518316610124830152935161014482015291928391839116815a9361016492608095f180156105cd5782918384918593610551575b509183916001600160801b036080947f349a5134d5729502d70a88264720af4ccfc9b5dbf3866f51a0dc4e11401951ac9660035560405194855216602084015260408301526060820152a1600160025580f35b93505050506080813d6080116105c5575b8161056f608093836116a9565b810103126105c1576080817f349a5134d5729502d70a88264720af4ccfc9b5dbf3866f51a0dc4e11401951ac9251906105aa60208201611839565b6040820151606090920151929492935090916104fe565b5080fd5b3d9150610562565b6040513d84823e3d90fd5b634e487b7160e01b8d52604160045260248dfd5b634e487b7160e01b88526011600452602488fd5b60405162461bcd60e51b815260206004820152601b60248201527f496e73756666696369656e7420544f4b454e312062616c616e636500000000006044820152606490fd5b9150506020813d602011610677575b81610661602093836116a9565b810103126106725783905138610372565b600080fd5b3d9150610654565b6040513d89823e3d90fd5b60405162461bcd60e51b815260206004820152601b60248201527f496e73756666696369656e7420544f4b454e302062616c616e636500000000006044820152606490fd5b9150506020813d6020116106fc575b816106eb602093836116a9565b810103126106725784905138610313565b3d91506106de565b6040513d88823e3d90fd5b60405162461bcd60e51b815260206004820152602160248201527f4e6f20746f6b656e7320617661696c61626c6520666f72206c697175696469746044820152607960f81b6064820152608490fd5b5080156102b6565b90506020813d602011610790575b81610781602093836116a9565b810103126106725751386102ac565b3d9150610774565b6040513d86823e3d90fd5b6006546102ae565b90506020813d6020116107d5575b816107c6602093836116a9565b81010312610672575138610251565b3d91506107b9565b60055491610254565b60405162461bcd60e51b815260206004820152601760248201527f506f736974696f6e20616c7265616479206578697374730000000000000000006044820152606490fd5b80fd5b503461082b57604036600319011261082b5761087460043561084e61167d565b9061086f61086a82600052600060205260016040600020015490565b611c68565b611d27565b5080f35b503461082b57604036600319011261082b576004358060020b81036105c157602435918260020b830361082b5760206108ba846108b58186611b4e565b6116e1565b6040519060020b8152f35b503461082b578060031936011261082b57602090604051908152f35b503461082b57604036600319011261082b5761094e6108fe611693565b610906611b84565b61090e611de6565b60405163a9059cbb60e01b602082015233602480830191909152356044808301919091528152906109406064836116a9565b6001600160a01b0316611f50565b80f35b503461082b57604036600319011261082b57604061096d61167d565b91600435815280602052209060018060a01b0316600052602052602060ff604060002054166040519015158152f35b503461082b578060031936011261082b576109b5611b84565b6109bd611da9565b600160ff19815416176001557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586020604051338152a180f35b503461082b578060031936011261082b5760206108ba611ac9565b503461082b578060031936011261082b57610a2a611bf6565b610a32611da9565b610a3a611dc6565b610a426119c7565b610b095760035480610ac9575b303b156105c157604051633a01e36560e21b81528290818160048183305af180156105cd57610ab4575b507f85d2a3a25436cf1120b0ebb764a372697b7756886739b13de9679f2e8f47bffe60408360035482519182526020820152a1600160025580f35b81610abe916116a9565b6105c1578138610a79565b90303b1561082b576040516333dcd14360e11b8152818160048183305af180156105cd57610af9575b5090610a4f565b81610b03916116a9565b38610af2565b60405162461bcd60e51b815260206004820152601860248201527f506f736974696f6e206973207374696c6c2061637469766500000000000000006044820152606490fd5b503461082b578060031936011261082b5760206040517fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c217758152f35b503461082b578060031936011261082b576040517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b503461082b578060031936011261082b57610be7611bf6565b610bef611da9565b610bf7611dc6565b6003548015610ecf5760405163133f757160e31b8152600481018290527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316919061014081602481865afa8015610798576001600160801b03918591610e96575b50168015610e5857610c7460085442611aa6565b906040519260a0840184811067ffffffffffffffff821117610e4457604052835260208301908152604083018581526001600160801b0360608501928784526080860194855260405195630624e65f60e11b87525160048701525116602485015251604484015251606483015251608482015260408160a48186865af18015610e3957610e1b575b50600354604051906080820182811067ffffffffffffffff821117610e0757604090815290825230602083019081526001600160801b0383830181815260608501828152845163fc6f786560e01b81529551600487015292516001600160a01b031660248601525181166044850152905116606483015290918290608490829086905af180156105cd577f0bb89aa54ed6940a7e7167bd262b2400d63945045ceff1a52a05f2601ed215f19160609184918591610dd6575b506003549160405192835260208301526040820152a180600355600160025580f35b9050610dfa915060403d604011610e00575b610df281836116a9565b810190611ab3565b38610db4565b503d610de8565b634e487b7160e01b85526041600452602485fd5b610e339060403d604011610e0057610df281836116a9565b50610cfc565b6040513d85823e3d90fd5b634e487b7160e01b87526041600452602487fd5b60405162461bcd60e51b81526020600482015260166024820152754e6f206c697175696469747920746f2072656d6f766560501b6044820152606490fd5b610eb891506101403d8111610ec8575b610eb081836116a9565b81019061184d565b5050505094505050505038610c60565b503d610ea6565b60405162461bcd60e51b81526020600482015260156024820152744e6f20706f736974696f6e20746f2072656d6f766560581b6044820152606490fd5b503461082b578060031936011261082b576020600554604051908152f35b503461082b57604036600319011261082b577f95c7f3360e0da233d0b286e0bfd9749479d79c1ffac32e198f3324295de668fd6040600435602435610f6d611b84565b816005558060065582519182526020820152a180f35b503461082b578060031936011261082b576020610f9e6119c7565b6040519015158152f35b503461082b578060031936011261082b576040517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b503461082b578060031936011261082b57602060ff600154166040519015158152f35b503461082b578060031936011261082b576020600754604051908152f35b503461082b578060031936011261082b5760206108ba6118dd565b503461082b57604036600319011261082b5761094e611066611693565b61106e611b84565b604051906323b872dd60e01b60208301523360248301523060448301526024356064830152606482526109406084836116a9565b503461082b578060031936011261082b576040517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b503461082b578060031936011261082b576003548180808361113f575b5060a0936001600160801b03916111196119c7565b9360405195865260020b602086015260020b604085015216606083015215156080820152f35b60405163133f757160e31b81526004810185905290945091506101409050816024817f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03165afa8015610e39578360a0949181906111a9575b9491925090611104565b5050506111cc6001600160801b03916101403d8111610ec857610eb081836116a9565b5050505093509493509050929083925061119f565b503461082b578060031936011261082b576111fa611b84565b611202611de6565b60ff19600154166001557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa6020604051338152a180f35b503461082b578060031936011261082b576020600654604051908152f35b503461082b578060031936011261082b57602060ff600454166040519015158152f35b503461082b578060031936011261082b576020600854604051908152f35b503461082b57604036600319011261082b576112b261167d565b336001600160a01b038216036112ce5761087490600435611d27565b63334bd91960e11b8252600482fd5b503461082b57602036600319011261082b576004358015158091036105c157611304611b84565b60ff80196004541691161760045580f35b503461082b57604036600319011261082b5761087460043561133561167d565b9061135161086a82600052600060205260016040600020015490565b611ca3565b503461082b57602036600319011261082b576020611384600435600052600060205260016040600020015490565b604051908152f35b503461082b578060031936011261082b576040517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b503461082b57602036600319011261082b576004356113ee611b84565b6127108111611429576020817ff5a802650e0a86db227cc342f06327d2ca0ff5cf2b12e0084fc5d8a7db2c54fd92600755604051908152a180f35b60405162461bcd60e51b815260206004820152601d60248201527f496e76616c696420736c69707061676520626173697320706f696e74730000006044820152606490fd5b503461082b578060031936011261082b5760206040517fa8a7bc421f721cb936ea99efdad79237e6ee0b871a2a08cf648691f9584cdc778152f35b503461082b578060031936011261082b5760406114c4611736565b82519160020b825260020b6020820152f35b503461082b57602036600319011261082b5760043563ffffffff60e01b81168091036105c157602090637965db0b60e01b811490811561151c575b506040519015158152f35b6301ffc9a760e01b14905082611511565b503461082b578060031936011261082b576020600354604051908152f35b9050346105c157816003193601126105c1576370a0823160e01b81523060048201526020816024817f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03165afa9081156105cd57829161164b575b506040516370a0823160e01b81523060048201526020816024817f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03165afa908115610e39578391611611575b6040838382519182526020820152f35b90506020813d602011611643575b8161162c602093836116a9565b8101031261163f57604092505138611601565b8280fd5b3d915061161f565b90506020813d602011611675575b81611666602093836116a9565b810103126105c15751386115ad565b3d9150611659565b602435906001600160a01b038216820361067257565b600435906001600160a01b038216820361067257565b90601f8019910116810190811067ffffffffffffffff8211176116cb57604052565b634e487b7160e01b600052604160045260246000fd5b9060020b9060020b02908160020b9182036116f857565b634e487b7160e01b600052601160045260246000fd5b9060020b9081156117205760020b0790565b634e487b7160e01b600052601260045260246000fd5b61173e6118dd565b611746611ac9565b918260020b60c802918260020b9283036116f85760020b91808303627fffff198112627fffff8213176116f857846108b58161178193611b4e565b9201627fffff8113627fffff198212176116f857836108b5816117a393611b4e565b82936117b081839561170e565b60020b159182611802575b5050156117c457565b60405162461bcd60e51b8152602060048201526016602482015275125b9d985b1a59081d1a58dac8185b1a59db9b595b9d60521b6044820152606490fd5b61180c925061170e565b60020b1538806117bb565b51906001600160a01b038216820361067257565b51908160020b820361067257565b51906001600160801b038216820361067257565b9190826101409103126106725761186382611817565b9161187060208201611817565b9161187d6040830161182b565b9161188a6060820161182b565b916118976080830161182b565b916118a460a08201611839565b9160c08201519160e0810151916118cb6101206118c46101008501611839565b9301611839565b90565b519061ffff8216820361067257565b604051633850c7bd60e01b815260e0816004817f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03165afa9081156119bb5760009161192e575090565b9060e0823d60e0116119b3575b8161194860e093836116a9565b8101031261082b5781516001600160a01b0381160361082b5761196d6020830161182b565b9161197a604082016118ce565b50611987606082016118ce565b50611994608082016118ce565b5060a081015160ff8116036105c15760c001518015150361082b575090565b3d915061193b565b6040513d6000823e3d90fd5b6003548015611aa05760405163133f757160e31b81526004810191909152610140816024817f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03165afa80156119bb57600090600092600091611a68575b506001600160801b031615611a6157611a436118dd565b60020b9060020b8112159182611a5857505090565b60020b13919050565b5050600090565b90506001600160801b039250611a8d91506101403d8111610ec857610eb081836116a9565b5050505095935093509050919290611a2c565b50600090565b919082018092116116f857565b9190826040910312610672576020825192015190565b6040516334324e9f60e21b81526020816004817f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03165afa9081156119bb57600091611b1a575090565b90506020813d602011611b46575b81611b35602093836116a9565b81010312610672576118cb9061182b565b3d9150611b28565b60020b9060020b90811561172057627fffff1981146000198314166116f8570590565b818102929181159184041417156116f857565b3360009081527f7d7ffb7a348e1c6a02869081a26547b49160dd3df72d1d75a570eb9b698292ec602052604090205460ff1615611bbd57565b63e2517d3f60e01b600052336004527fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c2177560245260446000fd5b3360009081527f9c5aa8bf4d93dca6430115e88fa8c1700204beda30fff3ec04054c8739a0a2b5602052604090205460ff1615611c2f57565b63e2517d3f60e01b600052336004527fa8a7bc421f721cb936ea99efdad79237e6ee0b871a2a08cf648691f9584cdc7760245260446000fd5b60008181526020818152604080832033845290915290205460ff1615611c8b5750565b63e2517d3f60e01b6000523360045260245260446000fd5b6000818152602081815260408083206001600160a01b038616845290915290205460ff16611a61576000818152602081815260408083206001600160a01b0395909516808452949091528120805460ff19166001179055339291907f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d9080a4600190565b6000818152602081815260408083206001600160a01b038616845290915290205460ff1615611a61576000818152602081815260408083206001600160a01b0395909516808452949091528120805460ff19169055339291907ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9080a4600190565b60ff60015416611db557565b63d93c066560e01b60005260046000fd5b6002805414611dd55760028055565b633ee5aeb560e01b60005260046000fd5b60ff6001541615611df357565b638dfc202b60e01b60005260046000fd5b604051636eb1769f60e11b81523060048201526001600160a01b03838116602483018190529490831691602081604481865afa9081156119bb57600091611f1c575b50611e8f94611e9d611e5c602094600094611aa6565b60405163095ea7b360e01b8682019081526001600160a01b03909416602482015260448101919091529687906064820190565b03601f1981018852876116a9565b85519082865af1903d6000519083611efd575b50505015611ebd57505050565b611ef6611efb936040519063095ea7b360e01b602083015260248201526000604482015260448152611ef06064826116a9565b82611f50565b611f50565b565b91925090611f1257503b15155b388080611eb0565b6001915014611f0a565b90506020813d602011611f48575b81611f37602093836116a9565b810103126106725751611e8f611e46565b3d9150611f2a565b906000602091828151910182855af1156119bb576000513d611fa257506001600160a01b0381163b155b611f815750565b635274afe760e01b60009081526001600160a01b0391909116600452602490fd5b60011415611f7a56fea2646970667358221220a07bd8735b4e59fa59b39fc315e4c772aa89aea9f157ec497e1fb76f7f9e380d64736f6c634300081c00332f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d7d7ffb7a348e1c6a02869081a26547b49160dd3df72d1d75a570eb9b698292ec9c5aa8bf4d93dca6430115e88fa8c1700204beda30fff3ec04054c8739a0a2b5ad3228b676f7d3cd4284a5443f17f1962b36e491b30a40b2405849e597ba5fb500000000000000000000000012e66c8f215ddd5d48d150c8f46ad0c6fb0f44060000000000000000000000002c13383855377faf5a562f1aef47e4be7a0f12ac00000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f4240
Deployed Bytecode
0x608080604052600436101561001357600080fd5b600090813560e01c908162113e081461154b575080629a9b7b1461152d57806301ffc9a7146114d657806314a1834b146114a957806318cf28341461146e5780631a3ce4e6146113d15780631bea83fe1461138c578063248a9ca3146113565780632f2ff15d1461131557806335953caf146112dd57806336568abe146112985780633a9517c81461127a5780633a9dd259146112575780633ef31035146112395780633f4ba83a146111e1578063418f35cc146110e7578063443ec74d146110a257806347e7ef241461104957806353aad1d91461102e578063578c71d9146110105780635c975abb14610fed5780635ee04d7814610fa85780636021226814610f83578063657d27cd14610f2a57806366b141f314610f0c57806367b9a28614610bce5780637535d24614610b8957806375b238fc14610b4e5780637d7c2a1c14610a115780637db3fd69146109f65780638456cb591461099c57806391d148541461095157806395ccea67146108e1578063a217fddf146108c5578063b41f4fcb14610878578063d547741f1461082e5763e8078d94146101b657600080fd5b3461082b578060031936011261082b576101ce611bf6565b6101d6611da9565b6101de611dc6565b6003546107e6576101ed611736565b919060ff6004541690816000146107dd576040516370a0823160e01b81523060048201526020816024817f00000000000000000000000029219dd400f2bf60e5a23d13be72b486d40388946001600160a01b03165afa9081156107985784916107ab575b50915b156107a3576040516370a0823160e01b81523060048201526020816024817f000000000000000000000000d3dce716f3ef535c5ff8d041c1a41c3bd89b97ae6001600160a01b03165afa908115610798578491610766575b505b82158061075e575b61070f576040516370a0823160e01b81523060048201527f00000000000000000000000029219dd400f2bf60e5a23d13be72b486d40388946001600160a01b031695906020816024818a5afa9081156107045790859187916106cf575b501061068a576040516370a0823160e01b81523060048201527f000000000000000000000000d3dce716f3ef535c5ff8d041c1a41c3bd89b97ae6001600160a01b03169490602081602481895afa90811561067f579084918891610645575b5010610600577f00000000000000000000000012e66c8f215ddd5d48d150c8f46ad0c6fb0f4406926103a582858a611e04565b6103b0818588611e04565b6007546127100361271081116105ec576127106103d9816103d18487611b71565b049284611b71565b04916103e3611ac9565b936103f060085442611aa6565b95604051986101608a019c8d67ffffffffffffffff8c82109111176105d85760409d8e528a5260208a019a8b52600296870b8a8e0190815290870b60608b0190815291870b60808b0190815260a08b0193845260c08b0194855260e08b019586526101008b01968752306101208c019081526101408c01998a529d51636d70c41560e01b81529a516001600160a01b0390811660048d01529b518c1660248c01529051870b60448b01529051860b60648a01525190940b6084880152925160a4870152915160c4860152905160e48501525161010484015294518316610124830152935161014482015291928391839116815a9361016492608095f180156105cd5782918384918593610551575b509183916001600160801b036080947f349a5134d5729502d70a88264720af4ccfc9b5dbf3866f51a0dc4e11401951ac9660035560405194855216602084015260408301526060820152a1600160025580f35b93505050506080813d6080116105c5575b8161056f608093836116a9565b810103126105c1576080817f349a5134d5729502d70a88264720af4ccfc9b5dbf3866f51a0dc4e11401951ac9251906105aa60208201611839565b6040820151606090920151929492935090916104fe565b5080fd5b3d9150610562565b6040513d84823e3d90fd5b634e487b7160e01b8d52604160045260248dfd5b634e487b7160e01b88526011600452602488fd5b60405162461bcd60e51b815260206004820152601b60248201527f496e73756666696369656e7420544f4b454e312062616c616e636500000000006044820152606490fd5b9150506020813d602011610677575b81610661602093836116a9565b810103126106725783905138610372565b600080fd5b3d9150610654565b6040513d89823e3d90fd5b60405162461bcd60e51b815260206004820152601b60248201527f496e73756666696369656e7420544f4b454e302062616c616e636500000000006044820152606490fd5b9150506020813d6020116106fc575b816106eb602093836116a9565b810103126106725784905138610313565b3d91506106de565b6040513d88823e3d90fd5b60405162461bcd60e51b815260206004820152602160248201527f4e6f20746f6b656e7320617661696c61626c6520666f72206c697175696469746044820152607960f81b6064820152608490fd5b5080156102b6565b90506020813d602011610790575b81610781602093836116a9565b810103126106725751386102ac565b3d9150610774565b6040513d86823e3d90fd5b6006546102ae565b90506020813d6020116107d5575b816107c6602093836116a9565b81010312610672575138610251565b3d91506107b9565b60055491610254565b60405162461bcd60e51b815260206004820152601760248201527f506f736974696f6e20616c7265616479206578697374730000000000000000006044820152606490fd5b80fd5b503461082b57604036600319011261082b5761087460043561084e61167d565b9061086f61086a82600052600060205260016040600020015490565b611c68565b611d27565b5080f35b503461082b57604036600319011261082b576004358060020b81036105c157602435918260020b830361082b5760206108ba846108b58186611b4e565b6116e1565b6040519060020b8152f35b503461082b578060031936011261082b57602090604051908152f35b503461082b57604036600319011261082b5761094e6108fe611693565b610906611b84565b61090e611de6565b60405163a9059cbb60e01b602082015233602480830191909152356044808301919091528152906109406064836116a9565b6001600160a01b0316611f50565b80f35b503461082b57604036600319011261082b57604061096d61167d565b91600435815280602052209060018060a01b0316600052602052602060ff604060002054166040519015158152f35b503461082b578060031936011261082b576109b5611b84565b6109bd611da9565b600160ff19815416176001557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586020604051338152a180f35b503461082b578060031936011261082b5760206108ba611ac9565b503461082b578060031936011261082b57610a2a611bf6565b610a32611da9565b610a3a611dc6565b610a426119c7565b610b095760035480610ac9575b303b156105c157604051633a01e36560e21b81528290818160048183305af180156105cd57610ab4575b507f85d2a3a25436cf1120b0ebb764a372697b7756886739b13de9679f2e8f47bffe60408360035482519182526020820152a1600160025580f35b81610abe916116a9565b6105c1578138610a79565b90303b1561082b576040516333dcd14360e11b8152818160048183305af180156105cd57610af9575b5090610a4f565b81610b03916116a9565b38610af2565b60405162461bcd60e51b815260206004820152601860248201527f506f736974696f6e206973207374696c6c2061637469766500000000000000006044820152606490fd5b503461082b578060031936011261082b5760206040517fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c217758152f35b503461082b578060031936011261082b576040517f0000000000000000000000002c13383855377faf5a562f1aef47e4be7a0f12ac6001600160a01b03168152602090f35b503461082b578060031936011261082b57610be7611bf6565b610bef611da9565b610bf7611dc6565b6003548015610ecf5760405163133f757160e31b8152600481018290527f00000000000000000000000012e66c8f215ddd5d48d150c8f46ad0c6fb0f44066001600160a01b0316919061014081602481865afa8015610798576001600160801b03918591610e96575b50168015610e5857610c7460085442611aa6565b906040519260a0840184811067ffffffffffffffff821117610e4457604052835260208301908152604083018581526001600160801b0360608501928784526080860194855260405195630624e65f60e11b87525160048701525116602485015251604484015251606483015251608482015260408160a48186865af18015610e3957610e1b575b50600354604051906080820182811067ffffffffffffffff821117610e0757604090815290825230602083019081526001600160801b0383830181815260608501828152845163fc6f786560e01b81529551600487015292516001600160a01b031660248601525181166044850152905116606483015290918290608490829086905af180156105cd577f0bb89aa54ed6940a7e7167bd262b2400d63945045ceff1a52a05f2601ed215f19160609184918591610dd6575b506003549160405192835260208301526040820152a180600355600160025580f35b9050610dfa915060403d604011610e00575b610df281836116a9565b810190611ab3565b38610db4565b503d610de8565b634e487b7160e01b85526041600452602485fd5b610e339060403d604011610e0057610df281836116a9565b50610cfc565b6040513d85823e3d90fd5b634e487b7160e01b87526041600452602487fd5b60405162461bcd60e51b81526020600482015260166024820152754e6f206c697175696469747920746f2072656d6f766560501b6044820152606490fd5b610eb891506101403d8111610ec8575b610eb081836116a9565b81019061184d565b5050505094505050505038610c60565b503d610ea6565b60405162461bcd60e51b81526020600482015260156024820152744e6f20706f736974696f6e20746f2072656d6f766560581b6044820152606490fd5b503461082b578060031936011261082b576020600554604051908152f35b503461082b57604036600319011261082b577f95c7f3360e0da233d0b286e0bfd9749479d79c1ffac32e198f3324295de668fd6040600435602435610f6d611b84565b816005558060065582519182526020820152a180f35b503461082b578060031936011261082b576020610f9e6119c7565b6040519015158152f35b503461082b578060031936011261082b576040517f000000000000000000000000d3dce716f3ef535c5ff8d041c1a41c3bd89b97ae6001600160a01b03168152602090f35b503461082b578060031936011261082b57602060ff600154166040519015158152f35b503461082b578060031936011261082b576020600754604051908152f35b503461082b578060031936011261082b5760206108ba6118dd565b503461082b57604036600319011261082b5761094e611066611693565b61106e611b84565b604051906323b872dd60e01b60208301523360248301523060448301526024356064830152606482526109406084836116a9565b503461082b578060031936011261082b576040517f00000000000000000000000029219dd400f2bf60e5a23d13be72b486d40388946001600160a01b03168152602090f35b503461082b578060031936011261082b576003548180808361113f575b5060a0936001600160801b03916111196119c7565b9360405195865260020b602086015260020b604085015216606083015215156080820152f35b60405163133f757160e31b81526004810185905290945091506101409050816024817f00000000000000000000000012e66c8f215ddd5d48d150c8f46ad0c6fb0f44066001600160a01b03165afa8015610e39578360a0949181906111a9575b9491925090611104565b5050506111cc6001600160801b03916101403d8111610ec857610eb081836116a9565b5050505093509493509050929083925061119f565b503461082b578060031936011261082b576111fa611b84565b611202611de6565b60ff19600154166001557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa6020604051338152a180f35b503461082b578060031936011261082b576020600654604051908152f35b503461082b578060031936011261082b57602060ff600454166040519015158152f35b503461082b578060031936011261082b576020600854604051908152f35b503461082b57604036600319011261082b576112b261167d565b336001600160a01b038216036112ce5761087490600435611d27565b63334bd91960e11b8252600482fd5b503461082b57602036600319011261082b576004358015158091036105c157611304611b84565b60ff80196004541691161760045580f35b503461082b57604036600319011261082b5761087460043561133561167d565b9061135161086a82600052600060205260016040600020015490565b611ca3565b503461082b57602036600319011261082b576020611384600435600052600060205260016040600020015490565b604051908152f35b503461082b578060031936011261082b576040517f00000000000000000000000012e66c8f215ddd5d48d150c8f46ad0c6fb0f44066001600160a01b03168152602090f35b503461082b57602036600319011261082b576004356113ee611b84565b6127108111611429576020817ff5a802650e0a86db227cc342f06327d2ca0ff5cf2b12e0084fc5d8a7db2c54fd92600755604051908152a180f35b60405162461bcd60e51b815260206004820152601d60248201527f496e76616c696420736c69707061676520626173697320706f696e74730000006044820152606490fd5b503461082b578060031936011261082b5760206040517fa8a7bc421f721cb936ea99efdad79237e6ee0b871a2a08cf648691f9584cdc778152f35b503461082b578060031936011261082b5760406114c4611736565b82519160020b825260020b6020820152f35b503461082b57602036600319011261082b5760043563ffffffff60e01b81168091036105c157602090637965db0b60e01b811490811561151c575b506040519015158152f35b6301ffc9a760e01b14905082611511565b503461082b578060031936011261082b576020600354604051908152f35b9050346105c157816003193601126105c1576370a0823160e01b81523060048201526020816024817f00000000000000000000000029219dd400f2bf60e5a23d13be72b486d40388946001600160a01b03165afa9081156105cd57829161164b575b506040516370a0823160e01b81523060048201526020816024817f000000000000000000000000d3dce716f3ef535c5ff8d041c1a41c3bd89b97ae6001600160a01b03165afa908115610e39578391611611575b6040838382519182526020820152f35b90506020813d602011611643575b8161162c602093836116a9565b8101031261163f57604092505138611601565b8280fd5b3d915061161f565b90506020813d602011611675575b81611666602093836116a9565b810103126105c15751386115ad565b3d9150611659565b602435906001600160a01b038216820361067257565b600435906001600160a01b038216820361067257565b90601f8019910116810190811067ffffffffffffffff8211176116cb57604052565b634e487b7160e01b600052604160045260246000fd5b9060020b9060020b02908160020b9182036116f857565b634e487b7160e01b600052601160045260246000fd5b9060020b9081156117205760020b0790565b634e487b7160e01b600052601260045260246000fd5b61173e6118dd565b611746611ac9565b918260020b60c802918260020b9283036116f85760020b91808303627fffff198112627fffff8213176116f857846108b58161178193611b4e565b9201627fffff8113627fffff198212176116f857836108b5816117a393611b4e565b82936117b081839561170e565b60020b159182611802575b5050156117c457565b60405162461bcd60e51b8152602060048201526016602482015275125b9d985b1a59081d1a58dac8185b1a59db9b595b9d60521b6044820152606490fd5b61180c925061170e565b60020b1538806117bb565b51906001600160a01b038216820361067257565b51908160020b820361067257565b51906001600160801b038216820361067257565b9190826101409103126106725761186382611817565b9161187060208201611817565b9161187d6040830161182b565b9161188a6060820161182b565b916118976080830161182b565b916118a460a08201611839565b9160c08201519160e0810151916118cb6101206118c46101008501611839565b9301611839565b90565b519061ffff8216820361067257565b604051633850c7bd60e01b815260e0816004817f0000000000000000000000002c13383855377faf5a562f1aef47e4be7a0f12ac6001600160a01b03165afa9081156119bb5760009161192e575090565b9060e0823d60e0116119b3575b8161194860e093836116a9565b8101031261082b5781516001600160a01b0381160361082b5761196d6020830161182b565b9161197a604082016118ce565b50611987606082016118ce565b50611994608082016118ce565b5060a081015160ff8116036105c15760c001518015150361082b575090565b3d915061193b565b6040513d6000823e3d90fd5b6003548015611aa05760405163133f757160e31b81526004810191909152610140816024817f00000000000000000000000012e66c8f215ddd5d48d150c8f46ad0c6fb0f44066001600160a01b03165afa80156119bb57600090600092600091611a68575b506001600160801b031615611a6157611a436118dd565b60020b9060020b8112159182611a5857505090565b60020b13919050565b5050600090565b90506001600160801b039250611a8d91506101403d8111610ec857610eb081836116a9565b5050505095935093509050919290611a2c565b50600090565b919082018092116116f857565b9190826040910312610672576020825192015190565b6040516334324e9f60e21b81526020816004817f0000000000000000000000002c13383855377faf5a562f1aef47e4be7a0f12ac6001600160a01b03165afa9081156119bb57600091611b1a575090565b90506020813d602011611b46575b81611b35602093836116a9565b81010312610672576118cb9061182b565b3d9150611b28565b60020b9060020b90811561172057627fffff1981146000198314166116f8570590565b818102929181159184041417156116f857565b3360009081527f7d7ffb7a348e1c6a02869081a26547b49160dd3df72d1d75a570eb9b698292ec602052604090205460ff1615611bbd57565b63e2517d3f60e01b600052336004527fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c2177560245260446000fd5b3360009081527f9c5aa8bf4d93dca6430115e88fa8c1700204beda30fff3ec04054c8739a0a2b5602052604090205460ff1615611c2f57565b63e2517d3f60e01b600052336004527fa8a7bc421f721cb936ea99efdad79237e6ee0b871a2a08cf648691f9584cdc7760245260446000fd5b60008181526020818152604080832033845290915290205460ff1615611c8b5750565b63e2517d3f60e01b6000523360045260245260446000fd5b6000818152602081815260408083206001600160a01b038616845290915290205460ff16611a61576000818152602081815260408083206001600160a01b0395909516808452949091528120805460ff19166001179055339291907f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d9080a4600190565b6000818152602081815260408083206001600160a01b038616845290915290205460ff1615611a61576000818152602081815260408083206001600160a01b0395909516808452949091528120805460ff19169055339291907ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9080a4600190565b60ff60015416611db557565b63d93c066560e01b60005260046000fd5b6002805414611dd55760028055565b633ee5aeb560e01b60005260046000fd5b60ff6001541615611df357565b638dfc202b60e01b60005260046000fd5b604051636eb1769f60e11b81523060048201526001600160a01b03838116602483018190529490831691602081604481865afa9081156119bb57600091611f1c575b50611e8f94611e9d611e5c602094600094611aa6565b60405163095ea7b360e01b8682019081526001600160a01b03909416602482015260448101919091529687906064820190565b03601f1981018852876116a9565b85519082865af1903d6000519083611efd575b50505015611ebd57505050565b611ef6611efb936040519063095ea7b360e01b602083015260248201526000604482015260448152611ef06064826116a9565b82611f50565b611f50565b565b91925090611f1257503b15155b388080611eb0565b6001915014611f0a565b90506020813d602011611f48575b81611f37602093836116a9565b810103126106725751611e8f611e46565b3d9150611f2a565b906000602091828151910182855af1156119bb576000513d611fa257506001600160a01b0381163b155b611f815750565b635274afe760e01b60009081526001600160a01b0391909116600452602490fd5b60011415611f7a56fea2646970667358221220a07bd8735b4e59fa59b39fc315e4c772aa89aea9f157ec497e1fb76f7f9e380d64736f6c634300081c0033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
00000000000000000000000012e66c8f215ddd5d48d150c8f46ad0c6fb0f44060000000000000000000000002c13383855377faf5a562f1aef47e4be7a0f12ac00000000000000000000000000000000000000000000000000000000000f424000000000000000000000000000000000000000000000000000000000000f4240
-----Decoded View---------------
Arg [0] : _positionManager (address): 0x12E66C8F215DdD5d48d150c8f46aD0c6fB0F4406
Arg [1] : _pool (address): 0x2C13383855377faf5A562F1AeF47E4be7A0f12Ac
Arg [2] : _initialAmount0Desired (uint256): 1000000
Arg [3] : _initialAmount1Desired (uint256): 1000000
-----Encoded View---------------
4 Constructor Arguments found :
Arg [0] : 00000000000000000000000012e66c8f215ddd5d48d150c8f46ad0c6fb0f4406
Arg [1] : 0000000000000000000000002c13383855377faf5a562f1aef47e4be7a0f12ac
Arg [2] : 00000000000000000000000000000000000000000000000000000000000f4240
Arg [3] : 00000000000000000000000000000000000000000000000000000000000f4240
Loading...
Loading
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in S
Multichain Portfolio | 35 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.