Overview
ETH Balance
ETH Value
$0.00Latest 1 from a total of 1 transactions
| Transaction Hash |
|
Block
|
From
|
To
|
|||||
|---|---|---|---|---|---|---|---|---|---|
| Set Authorized F... | 38487643 | 7 hrs ago | IN | 0 ETH | 0.00000006 |
Latest 2 internal transactions
| Parent Transaction Hash | Block | From | To | |||
|---|---|---|---|---|---|---|
| 38492729 | 6 hrs ago | Contract Creation | 0 ETH | |||
| 38488298 | 7 hrs ago | Contract Creation | 0 ETH |
Cross-Chain Transactions
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.26;
import {Buyback} from "./Buyback.sol";
/// @title BuybackDeployer
/// @notice Deploys Buyback contracts for TokenLaunchFactory
contract BuybackDeployer {
address public authorizedFactory;
address public immutable admin;
error UnauthorizedCaller();
constructor(address _admin) {
if (_admin == address(0)) revert UnauthorizedCaller();
admin = _admin;
}
function setAuthorizedFactory(address factory) external {
if (msg.sender != admin) revert UnauthorizedCaller();
if (authorizedFactory != address(0)) revert UnauthorizedCaller();
authorizedFactory = factory;
}
function deploy(
address treasury,
address token,
address buybackRouter
) external returns (address buyback) {
if (msg.sender != authorizedFactory) revert UnauthorizedCaller();
buyback = address(new Buyback(treasury, token, buybackRouter, authorizedFactory));
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;
import {AccessControl} from "@openzeppelin/contracts/access/AccessControl.sol";
import {PoolKey} from "v4-core/types/PoolKey.sol";
import {BalanceDelta} from "v4-core/types/BalanceDelta.sol";
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
interface ISwapRouter {
function swapExactTokensForTokens(
uint256 amountIn,
uint256 amountOutMin,
bool zeroForOne,
PoolKey calldata poolKey,
bytes calldata hookData,
address receiver,
uint256 deadline
) external payable returns (BalanceDelta balanceDelta);
}
/// @title Buyback
/// @notice Executes ETH buybacks and burns tokens
contract Buyback is AccessControl {
using SafeERC20 for IERC20;
bytes32 public constant BUYBACK_EXECUTOR_ROLE = keccak256("BUYBACK_EXECUTOR_ROLE");
IERC20 public immutable token;
address public strategy;
bool public strategySet;
address public immutable strategySetter;
address public constant BURN_ADDRESS = 0x000000000000000000000000000000000000dEaD;
address public router;
PoolKey public poolKey;
bool public poolKeySet;
uint256 public totalETHUsed;
uint256 public totalTokenBurned;
event PoolKeySet();
event RouterUpdated(address indexed newRouter);
event BuybackExecuted(uint256 ethUsed, uint256 tokensBurned, uint256 totalETHUsed, uint256 totalTokenBurned);
error InvalidAddress();
error PoolKeyAlreadySet();
error PoolKeyNotSet();
error InvalidPercentage();
error InsufficientBalance();
error SwapFailed();
constructor(address admin, address _token, address _router, address _strategySetter) {
if (admin == address(0) || _token == address(0) || _router == address(0)) {
revert InvalidAddress();
}
token = IERC20(_token);
router = _router;
strategySetter = _strategySetter;
_grantRole(DEFAULT_ADMIN_ROLE, admin);
_grantRole(BUYBACK_EXECUTOR_ROLE, admin);
}
function setStrategy(address newStrategy) external {
if (msg.sender != strategySetter) revert InvalidAddress();
if (newStrategy == address(0)) revert InvalidAddress();
if (strategySet) revert InvalidAddress();
strategy = newStrategy;
strategySet = true;
}
function setPoolKey(PoolKey calldata key) external {
if (msg.sender != strategy) revert InvalidAddress();
if (poolKeySet) revert PoolKeyAlreadySet();
poolKey = key;
poolKeySet = true;
emit PoolKeySet();
}
function setRouter(address newRouter) external onlyRole(DEFAULT_ADMIN_ROLE) {
if (newRouter == address(0)) revert InvalidAddress();
router = newRouter;
emit RouterUpdated(newRouter);
}
function executeBuyback(uint24 percentageToUse, uint256 amountOutMin) external onlyRole(BUYBACK_EXECUTOR_ROLE) {
if (!poolKeySet) revert PoolKeyNotSet();
if (percentageToUse == 0 || percentageToUse > 10000) revert InvalidPercentage();
uint256 contractBalance = address(this).balance;
if (contractBalance == 0) revert InsufficientBalance();
uint256 ethToUse = (contractBalance * percentageToUse) / 10000;
if (ethToUse == 0) revert InsufficientBalance();
try ISwapRouter(router).swapExactTokensForTokens{value: ethToUse}(
ethToUse,
amountOutMin,
true,
poolKey,
"",
address(this),
block.timestamp + 1000
) {
uint256 tokenBalance = token.balanceOf(address(this));
if (tokenBalance == 0) revert SwapFailed();
token.safeTransfer(BURN_ADDRESS, tokenBalance);
totalETHUsed += ethToUse;
totalTokenBurned += tokenBalance;
emit BuybackExecuted(ethToUse, tokenBalance, totalETHUsed, totalTokenBurned);
} catch {
revert SwapFailed();
}
}
receive() external payable {}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.3.0) (access/AccessControl.sol)
pragma solidity ^0.8.20;
import {IAccessControl} from "./IAccessControl.sol";
import {Context} from "../utils/Context.sol";
import {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);
_;
}
/**
* @dev See {IERC165-supportsInterface}.
*/
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
pragma solidity ^0.8.0;
import {Currency} from "./Currency.sol";
import {IHooks} from "../interfaces/IHooks.sol";
import {PoolIdLibrary} from "./PoolId.sol";
using PoolIdLibrary for PoolKey global;
/// @notice Returns the key for identifying a pool
struct PoolKey {
/// @notice The lower currency of the pool, sorted numerically
Currency currency0;
/// @notice The higher currency of the pool, sorted numerically
Currency currency1;
/// @notice The pool LP fee, capped at 1_000_000. If the highest bit is 1, the pool has a dynamic fee and must be exactly equal to 0x800000
uint24 fee;
/// @notice Ticks that involve positions must be a multiple of tick spacing
int24 tickSpacing;
/// @notice The hooks of the pool
IHooks hooks;
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import {SafeCast} from "../libraries/SafeCast.sol";
/// @dev Two `int128` values packed into a single `int256` where the upper 128 bits represent the amount0
/// and the lower 128 bits represent the amount1.
type BalanceDelta is int256;
using {add as +, sub as -, eq as ==, neq as !=} for BalanceDelta global;
using BalanceDeltaLibrary for BalanceDelta global;
using SafeCast for int256;
function toBalanceDelta(int128 _amount0, int128 _amount1) pure returns (BalanceDelta balanceDelta) {
assembly ("memory-safe") {
balanceDelta := or(shl(128, _amount0), and(sub(shl(128, 1), 1), _amount1))
}
}
function add(BalanceDelta a, BalanceDelta b) pure returns (BalanceDelta) {
int256 res0;
int256 res1;
assembly ("memory-safe") {
let a0 := sar(128, a)
let a1 := signextend(15, a)
let b0 := sar(128, b)
let b1 := signextend(15, b)
res0 := add(a0, b0)
res1 := add(a1, b1)
}
return toBalanceDelta(res0.toInt128(), res1.toInt128());
}
function sub(BalanceDelta a, BalanceDelta b) pure returns (BalanceDelta) {
int256 res0;
int256 res1;
assembly ("memory-safe") {
let a0 := sar(128, a)
let a1 := signextend(15, a)
let b0 := sar(128, b)
let b1 := signextend(15, b)
res0 := sub(a0, b0)
res1 := sub(a1, b1)
}
return toBalanceDelta(res0.toInt128(), res1.toInt128());
}
function eq(BalanceDelta a, BalanceDelta b) pure returns (bool) {
return BalanceDelta.unwrap(a) == BalanceDelta.unwrap(b);
}
function neq(BalanceDelta a, BalanceDelta b) pure returns (bool) {
return BalanceDelta.unwrap(a) != BalanceDelta.unwrap(b);
}
/// @notice Library for getting the amount0 and amount1 deltas from the BalanceDelta type
library BalanceDeltaLibrary {
/// @notice A BalanceDelta of 0
BalanceDelta public constant ZERO_DELTA = BalanceDelta.wrap(0);
function amount0(BalanceDelta balanceDelta) internal pure returns (int128 _amount0) {
assembly ("memory-safe") {
_amount0 := sar(128, balanceDelta)
}
}
function amount1(BalanceDelta balanceDelta) internal pure returns (int128 _amount1) {
assembly ("memory-safe") {
_amount1 := signextend(15, balanceDelta)
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC20/IERC20.sol)
pragma solidity ^0.8.20;
/**
* @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.3.0) (access/IAccessControl.sol)
pragma solidity ^0.8.20;
/**
* @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.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.1.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 {
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) {
return interfaceId == type(IERC165).interfaceId;
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import {IERC20Minimal} from "../interfaces/external/IERC20Minimal.sol";
import {CustomRevert} from "../libraries/CustomRevert.sol";
type Currency is address;
using {greaterThan as >, lessThan as <, greaterThanOrEqualTo as >=, equals as ==} for Currency global;
using CurrencyLibrary for Currency global;
function equals(Currency currency, Currency other) pure returns (bool) {
return Currency.unwrap(currency) == Currency.unwrap(other);
}
function greaterThan(Currency currency, Currency other) pure returns (bool) {
return Currency.unwrap(currency) > Currency.unwrap(other);
}
function lessThan(Currency currency, Currency other) pure returns (bool) {
return Currency.unwrap(currency) < Currency.unwrap(other);
}
function greaterThanOrEqualTo(Currency currency, Currency other) pure returns (bool) {
return Currency.unwrap(currency) >= Currency.unwrap(other);
}
/// @title CurrencyLibrary
/// @dev This library allows for transferring and holding native tokens and ERC20 tokens
library CurrencyLibrary {
/// @notice Additional context for ERC-7751 wrapped error when a native transfer fails
error NativeTransferFailed();
/// @notice Additional context for ERC-7751 wrapped error when an ERC20 transfer fails
error ERC20TransferFailed();
/// @notice A constant to represent the native currency
Currency public constant ADDRESS_ZERO = Currency.wrap(address(0));
function transfer(Currency currency, address to, uint256 amount) internal {
// altered from https://github.com/transmissions11/solmate/blob/44a9963d4c78111f77caa0e65d677b8b46d6f2e6/src/utils/SafeTransferLib.sol
// modified custom error selectors
bool success;
if (currency.isAddressZero()) {
assembly ("memory-safe") {
// Transfer the ETH and revert if it fails.
success := call(gas(), to, amount, 0, 0, 0, 0)
}
// revert with NativeTransferFailed, containing the bubbled up error as an argument
if (!success) {
CustomRevert.bubbleUpAndRevertWith(to, bytes4(0), NativeTransferFailed.selector);
}
} else {
assembly ("memory-safe") {
// Get a pointer to some free memory.
let fmp := mload(0x40)
// Write the abi-encoded calldata into memory, beginning with the function selector.
mstore(fmp, 0xa9059cbb00000000000000000000000000000000000000000000000000000000)
mstore(add(fmp, 4), and(to, 0xffffffffffffffffffffffffffffffffffffffff)) // Append and mask the "to" argument.
mstore(add(fmp, 36), amount) // Append the "amount" argument. Masking not required as it's a full 32 byte type.
success :=
and(
// Set success to whether the call reverted, if not we check it either
// returned exactly 1 (can't just be non-zero data), or had no return data.
or(and(eq(mload(0), 1), gt(returndatasize(), 31)), iszero(returndatasize())),
// We use 68 because the length of our calldata totals up like so: 4 + 32 * 2.
// We use 0 and 32 to copy up to 32 bytes of return data into the scratch space.
// Counterintuitively, this call must be positioned second to the or() call in the
// surrounding and() call or else returndatasize() will be zero during the computation.
call(gas(), currency, 0, fmp, 68, 0, 32)
)
// Now clean the memory we used
mstore(fmp, 0) // 4 byte `selector` and 28 bytes of `to` were stored here
mstore(add(fmp, 0x20), 0) // 4 bytes of `to` and 28 bytes of `amount` were stored here
mstore(add(fmp, 0x40), 0) // 4 bytes of `amount` were stored here
}
// revert with ERC20TransferFailed, containing the bubbled up error as an argument
if (!success) {
CustomRevert.bubbleUpAndRevertWith(
Currency.unwrap(currency), IERC20Minimal.transfer.selector, ERC20TransferFailed.selector
);
}
}
}
function balanceOfSelf(Currency currency) internal view returns (uint256) {
if (currency.isAddressZero()) {
return address(this).balance;
} else {
return IERC20Minimal(Currency.unwrap(currency)).balanceOf(address(this));
}
}
function balanceOf(Currency currency, address owner) internal view returns (uint256) {
if (currency.isAddressZero()) {
return owner.balance;
} else {
return IERC20Minimal(Currency.unwrap(currency)).balanceOf(owner);
}
}
function isAddressZero(Currency currency) internal pure returns (bool) {
return Currency.unwrap(currency) == Currency.unwrap(ADDRESS_ZERO);
}
function toId(Currency currency) internal pure returns (uint256) {
return uint160(Currency.unwrap(currency));
}
// If the upper 12 bytes are non-zero, they will be zero-ed out
// Therefore, fromId() and toId() are not inverses of each other
function fromId(uint256 id) internal pure returns (Currency) {
return Currency.wrap(address(uint160(id)));
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import {PoolKey} from "../types/PoolKey.sol";
import {BalanceDelta} from "../types/BalanceDelta.sol";
import {ModifyLiquidityParams, SwapParams} from "../types/PoolOperation.sol";
import {BeforeSwapDelta} from "../types/BeforeSwapDelta.sol";
/// @notice V4 decides whether to invoke specific hooks by inspecting the least significant bits
/// of the address that the hooks contract is deployed to.
/// For example, a hooks contract deployed to address: 0x0000000000000000000000000000000000002400
/// has the lowest bits '10 0100 0000 0000' which would cause the 'before initialize' and 'after add liquidity' hooks to be used.
/// See the Hooks library for the full spec.
/// @dev Should only be callable by the v4 PoolManager.
interface IHooks {
/// @notice The hook called before the state of a pool is initialized
/// @param sender The initial msg.sender for the initialize call
/// @param key The key for the pool being initialized
/// @param sqrtPriceX96 The sqrt(price) of the pool as a Q64.96
/// @return bytes4 The function selector for the hook
function beforeInitialize(address sender, PoolKey calldata key, uint160 sqrtPriceX96) external returns (bytes4);
/// @notice The hook called after the state of a pool is initialized
/// @param sender The initial msg.sender for the initialize call
/// @param key The key for the pool being initialized
/// @param sqrtPriceX96 The sqrt(price) of the pool as a Q64.96
/// @param tick The current tick after the state of a pool is initialized
/// @return bytes4 The function selector for the hook
function afterInitialize(address sender, PoolKey calldata key, uint160 sqrtPriceX96, int24 tick)
external
returns (bytes4);
/// @notice The hook called before liquidity is added
/// @param sender The initial msg.sender for the add liquidity call
/// @param key The key for the pool
/// @param params The parameters for adding liquidity
/// @param hookData Arbitrary data handed into the PoolManager by the liquidity provider to be passed on to the hook
/// @return bytes4 The function selector for the hook
function beforeAddLiquidity(
address sender,
PoolKey calldata key,
ModifyLiquidityParams calldata params,
bytes calldata hookData
) external returns (bytes4);
/// @notice The hook called after liquidity is added
/// @param sender The initial msg.sender for the add liquidity call
/// @param key The key for the pool
/// @param params The parameters for adding liquidity
/// @param delta The caller's balance delta after adding liquidity; the sum of principal delta, fees accrued, and hook delta
/// @param feesAccrued The fees accrued since the last time fees were collected from this position
/// @param hookData Arbitrary data handed into the PoolManager by the liquidity provider to be passed on to the hook
/// @return bytes4 The function selector for the hook
/// @return BalanceDelta The hook's delta in token0 and token1. Positive: the hook is owed/took currency, negative: the hook owes/sent currency
function afterAddLiquidity(
address sender,
PoolKey calldata key,
ModifyLiquidityParams calldata params,
BalanceDelta delta,
BalanceDelta feesAccrued,
bytes calldata hookData
) external returns (bytes4, BalanceDelta);
/// @notice The hook called before liquidity is removed
/// @param sender The initial msg.sender for the remove liquidity call
/// @param key The key for the pool
/// @param params The parameters for removing liquidity
/// @param hookData Arbitrary data handed into the PoolManager by the liquidity provider to be be passed on to the hook
/// @return bytes4 The function selector for the hook
function beforeRemoveLiquidity(
address sender,
PoolKey calldata key,
ModifyLiquidityParams calldata params,
bytes calldata hookData
) external returns (bytes4);
/// @notice The hook called after liquidity is removed
/// @param sender The initial msg.sender for the remove liquidity call
/// @param key The key for the pool
/// @param params The parameters for removing liquidity
/// @param delta The caller's balance delta after removing liquidity; the sum of principal delta, fees accrued, and hook delta
/// @param feesAccrued The fees accrued since the last time fees were collected from this position
/// @param hookData Arbitrary data handed into the PoolManager by the liquidity provider to be be passed on to the hook
/// @return bytes4 The function selector for the hook
/// @return BalanceDelta The hook's delta in token0 and token1. Positive: the hook is owed/took currency, negative: the hook owes/sent currency
function afterRemoveLiquidity(
address sender,
PoolKey calldata key,
ModifyLiquidityParams calldata params,
BalanceDelta delta,
BalanceDelta feesAccrued,
bytes calldata hookData
) external returns (bytes4, BalanceDelta);
/// @notice The hook called before a swap
/// @param sender The initial msg.sender for the swap call
/// @param key The key for the pool
/// @param params The parameters for the swap
/// @param hookData Arbitrary data handed into the PoolManager by the swapper to be be passed on to the hook
/// @return bytes4 The function selector for the hook
/// @return BeforeSwapDelta The hook's delta in specified and unspecified currencies. Positive: the hook is owed/took currency, negative: the hook owes/sent currency
/// @return uint24 Optionally override the lp fee, only used if three conditions are met: 1. the Pool has a dynamic fee, 2. the value's 2nd highest bit is set (23rd bit, 0x400000), and 3. the value is less than or equal to the maximum fee (1 million)
function beforeSwap(address sender, PoolKey calldata key, SwapParams calldata params, bytes calldata hookData)
external
returns (bytes4, BeforeSwapDelta, uint24);
/// @notice The hook called after a swap
/// @param sender The initial msg.sender for the swap call
/// @param key The key for the pool
/// @param params The parameters for the swap
/// @param delta The amount owed to the caller (positive) or owed to the pool (negative)
/// @param hookData Arbitrary data handed into the PoolManager by the swapper to be be passed on to the hook
/// @return bytes4 The function selector for the hook
/// @return int128 The hook's delta in unspecified currency. Positive: the hook is owed/took currency, negative: the hook owes/sent currency
function afterSwap(
address sender,
PoolKey calldata key,
SwapParams calldata params,
BalanceDelta delta,
bytes calldata hookData
) external returns (bytes4, int128);
/// @notice The hook called before donate
/// @param sender The initial msg.sender for the donate call
/// @param key The key for the pool
/// @param amount0 The amount of token0 being donated
/// @param amount1 The amount of token1 being donated
/// @param hookData Arbitrary data handed into the PoolManager by the donor to be be passed on to the hook
/// @return bytes4 The function selector for the hook
function beforeDonate(
address sender,
PoolKey calldata key,
uint256 amount0,
uint256 amount1,
bytes calldata hookData
) external returns (bytes4);
/// @notice The hook called after donate
/// @param sender The initial msg.sender for the donate call
/// @param key The key for the pool
/// @param amount0 The amount of token0 being donated
/// @param amount1 The amount of token1 being donated
/// @param hookData Arbitrary data handed into the PoolManager by the donor to be be passed on to the hook
/// @return bytes4 The function selector for the hook
function afterDonate(
address sender,
PoolKey calldata key,
uint256 amount0,
uint256 amount1,
bytes calldata hookData
) external returns (bytes4);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import {PoolKey} from "./PoolKey.sol";
type PoolId is bytes32;
/// @notice Library for computing the ID of a pool
library PoolIdLibrary {
/// @notice Returns value equal to keccak256(abi.encode(poolKey))
function toId(PoolKey memory poolKey) internal pure returns (PoolId poolId) {
assembly ("memory-safe") {
// 0xa0 represents the total size of the poolKey struct (5 slots of 32 bytes)
poolId := keccak256(poolKey, 0xa0)
}
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import {CustomRevert} from "./CustomRevert.sol";
/// @title Safe casting methods
/// @notice Contains methods for safely casting between types
library SafeCast {
using CustomRevert for bytes4;
error SafeCastOverflow();
/// @notice Cast a uint256 to a uint160, revert on overflow
/// @param x The uint256 to be downcasted
/// @return y The downcasted integer, now type uint160
function toUint160(uint256 x) internal pure returns (uint160 y) {
y = uint160(x);
if (y != x) SafeCastOverflow.selector.revertWith();
}
/// @notice Cast a uint256 to a uint128, revert on overflow
/// @param x The uint256 to be downcasted
/// @return y The downcasted integer, now type uint128
function toUint128(uint256 x) internal pure returns (uint128 y) {
y = uint128(x);
if (x != y) SafeCastOverflow.selector.revertWith();
}
/// @notice Cast a int128 to a uint128, revert on overflow or underflow
/// @param x The int128 to be casted
/// @return y The casted integer, now type uint128
function toUint128(int128 x) internal pure returns (uint128 y) {
if (x < 0) SafeCastOverflow.selector.revertWith();
y = uint128(x);
}
/// @notice Cast a int256 to a int128, revert on overflow or underflow
/// @param x The int256 to be downcasted
/// @return y The downcasted integer, now type int128
function toInt128(int256 x) internal pure returns (int128 y) {
y = int128(x);
if (y != x) SafeCastOverflow.selector.revertWith();
}
/// @notice Cast a uint256 to a int256, revert on overflow
/// @param x The uint256 to be casted
/// @return y The casted integer, now type int256
function toInt256(uint256 x) internal pure returns (int256 y) {
y = int256(x);
if (y < 0) SafeCastOverflow.selector.revertWith();
}
/// @notice Cast a uint256 to a int128, revert on overflow
/// @param x The uint256 to be downcasted
/// @return The downcasted integer, now type int128
function toInt128(uint256 x) internal pure returns (int128) {
if (x >= 1 << 127) SafeCastOverflow.selector.revertWith();
return int128(int256(x));
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (interfaces/IERC1363.sol)
pragma solidity ^0.8.20;
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.1.0) (utils/introspection/IERC165.sol)
pragma solidity ^0.8.20;
/**
* @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
pragma solidity ^0.8.0;
/// @title Minimal ERC20 interface for Uniswap
/// @notice Contains a subset of the full ERC20 interface that is used in Uniswap V3
interface IERC20Minimal {
/// @notice Returns an account's balance in the token
/// @param account The account for which to look up the number of tokens it has, i.e. its balance
/// @return The number of tokens held by the account
function balanceOf(address account) external view returns (uint256);
/// @notice Transfers the amount of token from the `msg.sender` to the recipient
/// @param recipient The account that will receive the amount transferred
/// @param amount The number of tokens to send from the sender to the recipient
/// @return Returns true for a successful transfer, false for an unsuccessful transfer
function transfer(address recipient, uint256 amount) external returns (bool);
/// @notice Returns the current allowance given to a spender by an owner
/// @param owner The account of the token owner
/// @param spender The account of the token spender
/// @return The current allowance granted by `owner` to `spender`
function allowance(address owner, address spender) external view returns (uint256);
/// @notice Sets the allowance of a spender from the `msg.sender` to the value `amount`
/// @param spender The account which will be allowed to spend a given amount of the owners tokens
/// @param amount The amount of tokens allowed to be used by `spender`
/// @return Returns true for a successful approval, false for unsuccessful
function approve(address spender, uint256 amount) external returns (bool);
/// @notice Transfers `amount` tokens from `sender` to `recipient` up to the allowance given to the `msg.sender`
/// @param sender The account from which the transfer will be initiated
/// @param recipient The recipient of the transfer
/// @param amount The amount of the transfer
/// @return Returns true for a successful transfer, false for unsuccessful
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
/// @notice Event emitted when tokens are transferred from one address to another, either via `#transfer` or `#transferFrom`.
/// @param from The account from which the tokens were sent, i.e. the balance decreased
/// @param to The account to which the tokens were sent, i.e. the balance increased
/// @param value The amount of tokens that were transferred
event Transfer(address indexed from, address indexed to, uint256 value);
/// @notice Event emitted when the approval amount for the spender of a given owner's tokens changes.
/// @param owner The account that approved spending of its tokens
/// @param spender The account for which the spending allowance was modified
/// @param value The new allowance from the owner to the spender
event Approval(address indexed owner, address indexed spender, uint256 value);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/// @title Library for reverting with custom errors efficiently
/// @notice Contains functions for reverting with custom errors with different argument types efficiently
/// @dev To use this library, declare `using CustomRevert for bytes4;` and replace `revert CustomError()` with
/// `CustomError.selector.revertWith()`
/// @dev The functions may tamper with the free memory pointer but it is fine since the call context is exited immediately
library CustomRevert {
/// @dev ERC-7751 error for wrapping bubbled up reverts
error WrappedError(address target, bytes4 selector, bytes reason, bytes details);
/// @dev Reverts with the selector of a custom error in the scratch space
function revertWith(bytes4 selector) internal pure {
assembly ("memory-safe") {
mstore(0, selector)
revert(0, 0x04)
}
}
/// @dev Reverts with a custom error with an address argument in the scratch space
function revertWith(bytes4 selector, address addr) internal pure {
assembly ("memory-safe") {
mstore(0, selector)
mstore(0x04, and(addr, 0xffffffffffffffffffffffffffffffffffffffff))
revert(0, 0x24)
}
}
/// @dev Reverts with a custom error with an int24 argument in the scratch space
function revertWith(bytes4 selector, int24 value) internal pure {
assembly ("memory-safe") {
mstore(0, selector)
mstore(0x04, signextend(2, value))
revert(0, 0x24)
}
}
/// @dev Reverts with a custom error with a uint160 argument in the scratch space
function revertWith(bytes4 selector, uint160 value) internal pure {
assembly ("memory-safe") {
mstore(0, selector)
mstore(0x04, and(value, 0xffffffffffffffffffffffffffffffffffffffff))
revert(0, 0x24)
}
}
/// @dev Reverts with a custom error with two int24 arguments
function revertWith(bytes4 selector, int24 value1, int24 value2) internal pure {
assembly ("memory-safe") {
let fmp := mload(0x40)
mstore(fmp, selector)
mstore(add(fmp, 0x04), signextend(2, value1))
mstore(add(fmp, 0x24), signextend(2, value2))
revert(fmp, 0x44)
}
}
/// @dev Reverts with a custom error with two uint160 arguments
function revertWith(bytes4 selector, uint160 value1, uint160 value2) internal pure {
assembly ("memory-safe") {
let fmp := mload(0x40)
mstore(fmp, selector)
mstore(add(fmp, 0x04), and(value1, 0xffffffffffffffffffffffffffffffffffffffff))
mstore(add(fmp, 0x24), and(value2, 0xffffffffffffffffffffffffffffffffffffffff))
revert(fmp, 0x44)
}
}
/// @dev Reverts with a custom error with two address arguments
function revertWith(bytes4 selector, address value1, address value2) internal pure {
assembly ("memory-safe") {
let fmp := mload(0x40)
mstore(fmp, selector)
mstore(add(fmp, 0x04), and(value1, 0xffffffffffffffffffffffffffffffffffffffff))
mstore(add(fmp, 0x24), and(value2, 0xffffffffffffffffffffffffffffffffffffffff))
revert(fmp, 0x44)
}
}
/// @notice bubble up the revert message returned by a call and revert with a wrapped ERC-7751 error
/// @dev this method can be vulnerable to revert data bombs
function bubbleUpAndRevertWith(
address revertingContract,
bytes4 revertingFunctionSelector,
bytes4 additionalContext
) internal pure {
bytes4 wrappedErrorSelector = WrappedError.selector;
assembly ("memory-safe") {
// Ensure the size of the revert data is a multiple of 32 bytes
let encodedDataSize := mul(div(add(returndatasize(), 31), 32), 32)
let fmp := mload(0x40)
// Encode wrapped error selector, address, function selector, offset, additional context, size, revert reason
mstore(fmp, wrappedErrorSelector)
mstore(add(fmp, 0x04), and(revertingContract, 0xffffffffffffffffffffffffffffffffffffffff))
mstore(
add(fmp, 0x24),
and(revertingFunctionSelector, 0xffffffff00000000000000000000000000000000000000000000000000000000)
)
// offset revert reason
mstore(add(fmp, 0x44), 0x80)
// offset additional context
mstore(add(fmp, 0x64), add(0xa0, encodedDataSize))
// size revert reason
mstore(add(fmp, 0x84), returndatasize())
// revert reason
returndatacopy(add(fmp, 0xa4), 0, returndatasize())
// size additional context
mstore(add(fmp, add(0xa4, encodedDataSize)), 0x04)
// additional context
mstore(
add(fmp, add(0xc4, encodedDataSize)),
and(additionalContext, 0xffffffff00000000000000000000000000000000000000000000000000000000)
)
revert(fmp, add(0xe4, encodedDataSize))
}
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;
import {PoolKey} from "../types/PoolKey.sol";
import {BalanceDelta} from "../types/BalanceDelta.sol";
/// @notice Parameter struct for `ModifyLiquidity` pool operations
struct ModifyLiquidityParams {
// the lower and upper tick of the position
int24 tickLower;
int24 tickUpper;
// how to modify the liquidity
int256 liquidityDelta;
// a value to set if you want unique liquidity positions at the same range
bytes32 salt;
}
/// @notice Parameter struct for `Swap` pool operations
struct SwapParams {
/// Whether to swap token0 for token1 or vice versa
bool zeroForOne;
/// The desired input amount if negative (exactIn), or the desired output amount if positive (exactOut)
int256 amountSpecified;
/// The sqrt price at which, if reached, the swap will stop executing
uint160 sqrtPriceLimitX96;
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
// Return type of the beforeSwap hook.
// Upper 128 bits is the delta in specified tokens. Lower 128 bits is delta in unspecified tokens (to match the afterSwap hook)
type BeforeSwapDelta is int256;
// Creates a BeforeSwapDelta from specified and unspecified
function toBeforeSwapDelta(int128 deltaSpecified, int128 deltaUnspecified)
pure
returns (BeforeSwapDelta beforeSwapDelta)
{
assembly ("memory-safe") {
beforeSwapDelta := or(shl(128, deltaSpecified), and(sub(shl(128, 1), 1), deltaUnspecified))
}
}
/// @notice Library for getting the specified and unspecified deltas from the BeforeSwapDelta type
library BeforeSwapDeltaLibrary {
/// @notice A BeforeSwapDelta of 0
BeforeSwapDelta public constant ZERO_DELTA = BeforeSwapDelta.wrap(0);
/// extracts int128 from the upper 128 bits of the BeforeSwapDelta
/// returned by beforeSwap
function getSpecifiedDelta(BeforeSwapDelta delta) internal pure returns (int128 deltaSpecified) {
assembly ("memory-safe") {
deltaSpecified := sar(128, delta)
}
}
/// extracts int128 from the lower 128 bits of the BeforeSwapDelta
/// returned by beforeSwap and afterSwap
function getUnspecifiedDelta(BeforeSwapDelta delta) internal pure returns (int128 deltaUnspecified) {
assembly ("memory-safe") {
deltaUnspecified := signextend(15, delta)
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC20.sol)
pragma solidity ^0.8.20;
import {IERC20} from "../token/ERC20/IERC20.sol";// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC165.sol)
pragma solidity ^0.8.20;
import {IERC165} from "../utils/introspection/IERC165.sol";{
"remappings": [
"@ensdomains/=lib/v4-periphery/lib/v4-core/node_modules/@ensdomains/",
"@openzeppelin/=lib/liquidity-launcher/lib/openzeppelin-contracts/",
"@openzeppelin/contracts/=lib/liquidity-launcher/lib/openzeppelin-contracts/contracts/",
"@openzeppelin-latest/=lib/liquidity-launcher/lib/openzeppelin-contracts/",
"@optimism/=lib/liquidity-launcher/lib/optimism/packages/contracts-bedrock/",
"@solady/=lib/liquidity-launcher/lib/solady/",
"@uniswap/v4-core/=lib/v4-periphery/lib/v4-core/",
"@uniswap/v4-periphery/=lib/v4-periphery/",
"@uniswap/uerc20-factory/=lib/liquidity-launcher/lib/uerc20-factory/src/",
"blocknumberish/=lib/liquidity-launcher/lib/blocknumberish/",
"ds-test/=lib/v4-periphery/lib/v4-core/lib/forge-std/lib/ds-test/src/",
"erc4626-tests/=lib/liquidity-launcher/lib/openzeppelin-contracts/lib/erc4626-tests/",
"forge-gas-snapshot/=lib/v4-periphery/lib/forge-gas-snapshot/src/",
"forge-std/=lib/forge-std/src/",
"hardhat/=lib/v4-periphery/lib/v4-core/node_modules/hardhat/",
"openzeppelin-contracts/=lib/liquidity-launcher/lib/openzeppelin-contracts/",
"openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/",
"permit2/=lib/v4-periphery/lib/permit2/",
"solady/=lib/liquidity-launcher/lib/solady/src/",
"solmate/=lib/v4-periphery/lib/v4-core/lib/solmate/",
"v4-core/=lib/v4-periphery/lib/v4-core/src/",
"v4-periphery/=lib/v4-periphery/",
"scripts/=lib/liquidity-launcher/lib/optimism/packages/contracts-bedrock/scripts/",
"liquidity-launcher/src/token-factories/uerc20-factory/=lib/liquidity-launcher/lib/uerc20-factory/src/",
"liquidity-launcher/src/=lib/liquidity-launcher/src/",
"liquidity-launcher/=lib/liquidity-launcher/",
"periphery/=lib/liquidity-launcher/src/periphery/",
"continuous-clearing-auction/=lib/liquidity-launcher/lib/continuous-clearing-auction/",
"ll/=lib/liquidity-launcher/src/"
],
"optimizer": {
"enabled": true,
"runs": 800
},
"metadata": {
"useLiteralContent": false,
"bytecodeHash": "ipfs",
"appendCBOR": true
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"evmVersion": "cancun",
"viaIR": false
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"address","name":"_admin","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"UnauthorizedCaller","type":"error"},{"inputs":[],"name":"admin","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"authorizedFactory","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"treasury","type":"address"},{"internalType":"address","name":"token","type":"address"},{"internalType":"address","name":"buybackRouter","type":"address"}],"name":"deploy","outputs":[{"internalType":"address","name":"buyback","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"factory","type":"address"}],"name":"setAuthorizedFactory","outputs":[],"stateMutability":"nonpayable","type":"function"}]Contract Creation Code
60a0604052348015600e575f80fd5b5060405161162f38038061162f833981016040819052602b916061565b6001600160a01b038116605157604051635c427cd960e01b815260040160405180910390fd5b6001600160a01b0316608052608c565b5f602082840312156070575f80fd5b81516001600160a01b03811681146085575f80fd5b9392505050565b6080516115866100a95f395f818160a9015260d601526115865ff3fe608060405234801561000f575f80fd5b506004361061004a575f3560e01c80630852f9f31461004e5780632625dbae1461007c578063d9181cd314610091578063f851a440146100a4575b5f80fd5b5f54610060906001600160a01b031681565b6040516001600160a01b03909116815260200160405180910390f35b61008f61008a366004610231565b6100cb565b005b61006061009f366004610251565b610176565b6100607f000000000000000000000000000000000000000000000000000000000000000081565b336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161461011457604051635c427cd960e01b815260040160405180910390fd5b5f546001600160a01b03161561013d57604051635c427cd960e01b815260040160405180910390fd5b5f80547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b5f80546001600160a01b031633146101a157604051635c427cd960e01b815260040160405180910390fd5b5f546040518591859185916001600160a01b0316906101bf90610209565b6001600160a01b039485168152928416602084015290831660408301529091166060820152608001604051809103905ff080158015610200573d5f803e3d5ffd5b50949350505050565b6112bf8061029283390190565b80356001600160a01b038116811461022c575f80fd5b919050565b5f60208284031215610241575f80fd5b61024a82610216565b9392505050565b5f805f60608486031215610263575f80fd5b61026c84610216565b925061027a60208501610216565b915061028860408501610216565b9050925092509256fe60c060405234801561000f575f80fd5b506040516112bf3803806112bf83398101604081905261002e916101a5565b6001600160a01b038416158061004b57506001600160a01b038316155b8061005d57506001600160a01b038216155b1561007b5760405163e6c4247b60e01b815260040160405180910390fd5b6001600160a01b03838116608052600280546001600160a01b031916848316179055811660a0526100ac5f856100e1565b506100d77f2428c18a3329b64725bb2335478a6d7d04d4165bd1ef6929879fae9b7ae51e70856100e1565b50505050506101f6565b5f828152602081815260408083206001600160a01b038516845290915281205460ff16610181575f838152602081815260408083206001600160a01b03861684529091529020805460ff191660011790556101393390565b6001600160a01b0316826001600160a01b0316847f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a4506001610184565b505f5b92915050565b80516001600160a01b03811681146101a0575f80fd5b919050565b5f805f80608085870312156101b8575f80fd5b6101c18561018a565b93506101cf6020860161018a565b92506101dd6040860161018a565b91506101eb6060860161018a565b905092959194509250565b60805160a05161109361022c5f395f81816101c0015261058701525f81816104e50152818161082801526108c801526110935ff3fe608060405260043610610170575f3560e01c806391d14854116100c6578063d547741f1161007c578063f887ea4011610057578063f887ea40146104b5578063fc0c546a146104d4578063fccc281314610507575f80fd5b8063d547741f14610444578063db684c0b14610463578063f0ec98d714610496575f80fd5b8063a8c62e76116100ac578063a8c62e76146103ed578063ab0abb4a1461040c578063c0d7865514610425575f80fd5b806391d1485414610398578063a217fddf146103da575f80fd5b80632f2ff15d1161012657806354d25faf1161010157806354d25faf1461034457806375dbec12146103595780637ee383be14610378575f80fd5b80632f2ff15d146102e557806333a100ca1461030657806336568abe14610325575f80fd5b8063182148ef11610156578063182148ef146101fa5780632221466c14610294578063248a9ca3146102b7575f80fd5b806301ffc9a71461017b57806313074d76146101af575f80fd5b3661017757005b5f80fd5b348015610186575f80fd5b5061019a610195366004610d0c565b61051c565b60405190151581526020015b60405180910390f35b3480156101ba575f80fd5b506101e27f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016101a6565b348015610205575f80fd5b50600354600454600554610254926001600160a01b03908116928082169262ffffff600160a01b830416927701000000000000000000000000000000000000000000000090920460020b911685565b604080516001600160a01b039687168152948616602086015262ffffff9093169284019290925260020b606083015291909116608082015260a0016101a6565b34801561029f575f80fd5b506102a960085481565b6040519081526020016101a6565b3480156102c2575f80fd5b506102a96102d1366004610d3a565b5f9081526020819052604090206001015490565b3480156102f0575f80fd5b506103046102ff366004610d65565b610552565b005b348015610311575f80fd5b50610304610320366004610d93565b61057c565b348015610330575f80fd5b5061030461033f366004610d65565b610656565b34801561034f575f80fd5b506102a960075481565b348015610364575f80fd5b50610304610373366004610dbe565b61068e565b348015610383575f80fd5b5060015461019a90600160a01b900460ff1681565b3480156103a3575f80fd5b5061019a6103b2366004610d65565b5f918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b3480156103e5575f80fd5b506102a95f81565b3480156103f8575f80fd5b506001546101e2906001600160a01b031681565b348015610417575f80fd5b5060065461019a9060ff1681565b348015610430575f80fd5b5061030461043f366004610d93565b610974565b34801561044f575f80fd5b5061030461045e366004610d65565b6109ef565b34801561046e575f80fd5b506102a97f2428c18a3329b64725bb2335478a6d7d04d4165bd1ef6929879fae9b7ae51e7081565b3480156104a1575f80fd5b506103046104b0366004610de8565b610a13565b3480156104c0575f80fd5b506002546101e2906001600160a01b031681565b3480156104df575f80fd5b506101e27f000000000000000000000000000000000000000000000000000000000000000081565b348015610512575f80fd5b506101e261dead81565b5f6001600160e01b03198216637965db0b60e01b148061054c57506301ffc9a760e01b6001600160e01b03198316145b92915050565b5f8281526020819052604090206001015461056c81610aa9565b6105768383610ab6565b50505050565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146105c55760405163e6c4247b60e01b815260040160405180910390fd5b6001600160a01b0381166105ec5760405163e6c4247b60e01b815260040160405180910390fd5b600154600160a01b900460ff16156106175760405163e6c4247b60e01b815260040160405180910390fd5b600180547fffffffffffffffffffffff000000000000000000000000000000000000000000166001600160a01b0390921691909117600160a01b179055565b6001600160a01b038116331461067f5760405163334bd91960e11b815260040160405180910390fd5b6106898282610b5d565b505050565b7f2428c18a3329b64725bb2335478a6d7d04d4165bd1ef6929879fae9b7ae51e706106b881610aa9565b60065460ff166106db57604051633382f3a560e01b815260040160405180910390fd5b62ffffff831615806106f357506127108362ffffff16115b1561071157604051631f3b85d360e01b815260040160405180910390fd5b475f81900361073357604051631e9acf1760e31b815260040160405180910390fd5b5f61271061074662ffffff871684610e15565b6107509190610e2c565b9050805f0361077257604051631e9acf1760e31b815260040160405180910390fd5b6002546001600160a01b031663b1a0d5718280876001600330610797426103e8610e4b565b6040518863ffffffff1660e01b81526004016107b896959493929190610e5e565b60206040518083038185885af1935050505080156107f3575060408051601f3d908101601f191682019092526107f091810190610f06565b60015b6108105760405163081ceff360e41b815260040160405180910390fd5b506040516370a0823160e01b81523060048201525f907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a0823190602401602060405180830381865afa158015610875573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906108999190610f06565b9050805f036108bb5760405163081ceff360e41b815260040160405180910390fd5b6108f16001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001661dead83610bde565b8160075f8282546109029190610e4b565b925050819055508060085f82825461091a9190610e4b565b909155505060075460085460408051858152602081018590529081019290925260608201527f42659a4aa613c1e350c764f0ff2be36a175ac2a1e4b77b8e1467d1fed32becc89060800160405180910390a1505050505050565b5f61097e81610aa9565b6001600160a01b0382166109a55760405163e6c4247b60e01b815260040160405180910390fd5b600280546001600160a01b0319166001600160a01b0384169081179091556040517f7aed1d3e8155a07ccf395e44ea3109a0e2d6c9b29bbbe9f142d9790596f4dc80905f90a25050565b5f82815260208190526040902060010154610a0981610aa9565b6105768383610b5d565b6001546001600160a01b03163314610a3e5760405163e6c4247b60e01b815260040160405180910390fd5b60065460ff1615610a6257604051635a4ef2d360e01b815260040160405180910390fd5b806003610a6f8282610f29565b50506006805460ff191660011790556040517f124339d9fade6161abb9b8aa74ff4ab3c07a643fdaa2eac599ec96985268f47b905f90a150565b610ab38133610c45565b50565b5f828152602081815260408083206001600160a01b038516845290915281205460ff16610b56575f838152602081815260408083206001600160a01b03861684529091529020805460ff19166001179055610b0e3390565b6001600160a01b0316826001600160a01b0316847f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a450600161054c565b505f61054c565b5f828152602081815260408083206001600160a01b038516845290915281205460ff1615610b56575f838152602081815260408083206001600160a01b0386168085529252808320805460ff1916905551339286917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a450600161054c565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1663a9059cbb60e01b179052610689908490610ca0565b5f828152602081815260408083206001600160a01b038516845290915290205460ff16610c9c5760405163e2517d3f60e01b81526001600160a01b0382166004820152602481018390526044015b60405180910390fd5b5050565b5f8060205f8451602086015f885af180610cbf576040513d5f823e3d81fd5b50505f513d91508115610cd6578060011415610ce3565b6001600160a01b0384163b155b1561057657604051635274afe760e01b81526001600160a01b0385166004820152602401610c93565b5f60208284031215610d1c575f80fd5b81356001600160e01b031981168114610d33575f80fd5b9392505050565b5f60208284031215610d4a575f80fd5b5035919050565b6001600160a01b0381168114610ab3575f80fd5b5f8060408385031215610d76575f80fd5b823591506020830135610d8881610d51565b809150509250929050565b5f60208284031215610da3575f80fd5b8135610d3381610d51565b62ffffff81168114610ab3575f80fd5b5f8060408385031215610dcf575f80fd5b8235610dda81610dae565b946020939093013593505050565b5f60a0828403128015610df9575f80fd5b509092915050565b634e487b7160e01b5f52601160045260245ffd5b808202811582820484141761054c5761054c610e01565b5f82610e4657634e487b7160e01b5f52601260045260245ffd5b500490565b8082018082111561054c5761054c610e01565b86815285602082015284151560408201526001600160a01b0384541660608201525f60018501546001600160a01b038116608084015262ffffff8160a01c1660a08401528060b81c60020b60c084015250610ec360028601546001600160a01b031690565b6001600160a01b031660e083015261016061010083018190525f9083015261018082016001600160a01b0394909416610120830152506101400152949350505050565b5f60208284031215610f16575f80fd5b5051919050565b5f813561054c81610d51565b8135610f3481610d51565b81546001600160a01b0319166001600160a01b03821617825550600181016020830135610f6081610d51565b81546001600160a01b0319166001600160a01b038216178255506040830135610f8881610dae565b815476ffffff00000000000000000000000000000000000000008260a01b167fffffffffffffffffff000000ffffffffffffffffffffffffffffffffffffffff8216178355505060608301358060020b8114610fe2575f80fd5b81548160b81b79ffffff0000000000000000000000000000000000000000000000167fffffffffffff000000ffffffffffffffffffffffffffffffffffffffffffffff8216178355505050610c9c61103c60808401610f1d565b600283016001600160a01b0382166001600160a01b0319825416178155505056fea2646970667358221220868a577153f35a458f1c60e861156bbfea7a508f8476e24b38a6583d4719700c64736f6c634300081a0033a26469706673582212202e85b467eb5bb34bf78f3e7dfce44d9ccf46303441a3220b96c33466b8ecd6eb64736f6c634300081a0033000000000000000000000000e911f518449ba0011d84b047b4cde50daa081ec1
Deployed Bytecode
0x608060405234801561000f575f80fd5b506004361061004a575f3560e01c80630852f9f31461004e5780632625dbae1461007c578063d9181cd314610091578063f851a440146100a4575b5f80fd5b5f54610060906001600160a01b031681565b6040516001600160a01b03909116815260200160405180910390f35b61008f61008a366004610231565b6100cb565b005b61006061009f366004610251565b610176565b6100607f000000000000000000000000e911f518449ba0011d84b047b4cde50daa081ec181565b336001600160a01b037f000000000000000000000000e911f518449ba0011d84b047b4cde50daa081ec1161461011457604051635c427cd960e01b815260040160405180910390fd5b5f546001600160a01b03161561013d57604051635c427cd960e01b815260040160405180910390fd5b5f80547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b5f80546001600160a01b031633146101a157604051635c427cd960e01b815260040160405180910390fd5b5f546040518591859185916001600160a01b0316906101bf90610209565b6001600160a01b039485168152928416602084015290831660408301529091166060820152608001604051809103905ff080158015610200573d5f803e3d5ffd5b50949350505050565b6112bf8061029283390190565b80356001600160a01b038116811461022c575f80fd5b919050565b5f60208284031215610241575f80fd5b61024a82610216565b9392505050565b5f805f60608486031215610263575f80fd5b61026c84610216565b925061027a60208501610216565b915061028860408501610216565b9050925092509256fe60c060405234801561000f575f80fd5b506040516112bf3803806112bf83398101604081905261002e916101a5565b6001600160a01b038416158061004b57506001600160a01b038316155b8061005d57506001600160a01b038216155b1561007b5760405163e6c4247b60e01b815260040160405180910390fd5b6001600160a01b03838116608052600280546001600160a01b031916848316179055811660a0526100ac5f856100e1565b506100d77f2428c18a3329b64725bb2335478a6d7d04d4165bd1ef6929879fae9b7ae51e70856100e1565b50505050506101f6565b5f828152602081815260408083206001600160a01b038516845290915281205460ff16610181575f838152602081815260408083206001600160a01b03861684529091529020805460ff191660011790556101393390565b6001600160a01b0316826001600160a01b0316847f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a4506001610184565b505f5b92915050565b80516001600160a01b03811681146101a0575f80fd5b919050565b5f805f80608085870312156101b8575f80fd5b6101c18561018a565b93506101cf6020860161018a565b92506101dd6040860161018a565b91506101eb6060860161018a565b905092959194509250565b60805160a05161109361022c5f395f81816101c0015261058701525f81816104e50152818161082801526108c801526110935ff3fe608060405260043610610170575f3560e01c806391d14854116100c6578063d547741f1161007c578063f887ea4011610057578063f887ea40146104b5578063fc0c546a146104d4578063fccc281314610507575f80fd5b8063d547741f14610444578063db684c0b14610463578063f0ec98d714610496575f80fd5b8063a8c62e76116100ac578063a8c62e76146103ed578063ab0abb4a1461040c578063c0d7865514610425575f80fd5b806391d1485414610398578063a217fddf146103da575f80fd5b80632f2ff15d1161012657806354d25faf1161010157806354d25faf1461034457806375dbec12146103595780637ee383be14610378575f80fd5b80632f2ff15d146102e557806333a100ca1461030657806336568abe14610325575f80fd5b8063182148ef11610156578063182148ef146101fa5780632221466c14610294578063248a9ca3146102b7575f80fd5b806301ffc9a71461017b57806313074d76146101af575f80fd5b3661017757005b5f80fd5b348015610186575f80fd5b5061019a610195366004610d0c565b61051c565b60405190151581526020015b60405180910390f35b3480156101ba575f80fd5b506101e27f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016101a6565b348015610205575f80fd5b50600354600454600554610254926001600160a01b03908116928082169262ffffff600160a01b830416927701000000000000000000000000000000000000000000000090920460020b911685565b604080516001600160a01b039687168152948616602086015262ffffff9093169284019290925260020b606083015291909116608082015260a0016101a6565b34801561029f575f80fd5b506102a960085481565b6040519081526020016101a6565b3480156102c2575f80fd5b506102a96102d1366004610d3a565b5f9081526020819052604090206001015490565b3480156102f0575f80fd5b506103046102ff366004610d65565b610552565b005b348015610311575f80fd5b50610304610320366004610d93565b61057c565b348015610330575f80fd5b5061030461033f366004610d65565b610656565b34801561034f575f80fd5b506102a960075481565b348015610364575f80fd5b50610304610373366004610dbe565b61068e565b348015610383575f80fd5b5060015461019a90600160a01b900460ff1681565b3480156103a3575f80fd5b5061019a6103b2366004610d65565b5f918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b3480156103e5575f80fd5b506102a95f81565b3480156103f8575f80fd5b506001546101e2906001600160a01b031681565b348015610417575f80fd5b5060065461019a9060ff1681565b348015610430575f80fd5b5061030461043f366004610d93565b610974565b34801561044f575f80fd5b5061030461045e366004610d65565b6109ef565b34801561046e575f80fd5b506102a97f2428c18a3329b64725bb2335478a6d7d04d4165bd1ef6929879fae9b7ae51e7081565b3480156104a1575f80fd5b506103046104b0366004610de8565b610a13565b3480156104c0575f80fd5b506002546101e2906001600160a01b031681565b3480156104df575f80fd5b506101e27f000000000000000000000000000000000000000000000000000000000000000081565b348015610512575f80fd5b506101e261dead81565b5f6001600160e01b03198216637965db0b60e01b148061054c57506301ffc9a760e01b6001600160e01b03198316145b92915050565b5f8281526020819052604090206001015461056c81610aa9565b6105768383610ab6565b50505050565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146105c55760405163e6c4247b60e01b815260040160405180910390fd5b6001600160a01b0381166105ec5760405163e6c4247b60e01b815260040160405180910390fd5b600154600160a01b900460ff16156106175760405163e6c4247b60e01b815260040160405180910390fd5b600180547fffffffffffffffffffffff000000000000000000000000000000000000000000166001600160a01b0390921691909117600160a01b179055565b6001600160a01b038116331461067f5760405163334bd91960e11b815260040160405180910390fd5b6106898282610b5d565b505050565b7f2428c18a3329b64725bb2335478a6d7d04d4165bd1ef6929879fae9b7ae51e706106b881610aa9565b60065460ff166106db57604051633382f3a560e01b815260040160405180910390fd5b62ffffff831615806106f357506127108362ffffff16115b1561071157604051631f3b85d360e01b815260040160405180910390fd5b475f81900361073357604051631e9acf1760e31b815260040160405180910390fd5b5f61271061074662ffffff871684610e15565b6107509190610e2c565b9050805f0361077257604051631e9acf1760e31b815260040160405180910390fd5b6002546001600160a01b031663b1a0d5718280876001600330610797426103e8610e4b565b6040518863ffffffff1660e01b81526004016107b896959493929190610e5e565b60206040518083038185885af1935050505080156107f3575060408051601f3d908101601f191682019092526107f091810190610f06565b60015b6108105760405163081ceff360e41b815260040160405180910390fd5b506040516370a0823160e01b81523060048201525f907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a0823190602401602060405180830381865afa158015610875573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906108999190610f06565b9050805f036108bb5760405163081ceff360e41b815260040160405180910390fd5b6108f16001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001661dead83610bde565b8160075f8282546109029190610e4b565b925050819055508060085f82825461091a9190610e4b565b909155505060075460085460408051858152602081018590529081019290925260608201527f42659a4aa613c1e350c764f0ff2be36a175ac2a1e4b77b8e1467d1fed32becc89060800160405180910390a1505050505050565b5f61097e81610aa9565b6001600160a01b0382166109a55760405163e6c4247b60e01b815260040160405180910390fd5b600280546001600160a01b0319166001600160a01b0384169081179091556040517f7aed1d3e8155a07ccf395e44ea3109a0e2d6c9b29bbbe9f142d9790596f4dc80905f90a25050565b5f82815260208190526040902060010154610a0981610aa9565b6105768383610b5d565b6001546001600160a01b03163314610a3e5760405163e6c4247b60e01b815260040160405180910390fd5b60065460ff1615610a6257604051635a4ef2d360e01b815260040160405180910390fd5b806003610a6f8282610f29565b50506006805460ff191660011790556040517f124339d9fade6161abb9b8aa74ff4ab3c07a643fdaa2eac599ec96985268f47b905f90a150565b610ab38133610c45565b50565b5f828152602081815260408083206001600160a01b038516845290915281205460ff16610b56575f838152602081815260408083206001600160a01b03861684529091529020805460ff19166001179055610b0e3390565b6001600160a01b0316826001600160a01b0316847f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a450600161054c565b505f61054c565b5f828152602081815260408083206001600160a01b038516845290915281205460ff1615610b56575f838152602081815260408083206001600160a01b0386168085529252808320805460ff1916905551339286917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a450600161054c565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1663a9059cbb60e01b179052610689908490610ca0565b5f828152602081815260408083206001600160a01b038516845290915290205460ff16610c9c5760405163e2517d3f60e01b81526001600160a01b0382166004820152602481018390526044015b60405180910390fd5b5050565b5f8060205f8451602086015f885af180610cbf576040513d5f823e3d81fd5b50505f513d91508115610cd6578060011415610ce3565b6001600160a01b0384163b155b1561057657604051635274afe760e01b81526001600160a01b0385166004820152602401610c93565b5f60208284031215610d1c575f80fd5b81356001600160e01b031981168114610d33575f80fd5b9392505050565b5f60208284031215610d4a575f80fd5b5035919050565b6001600160a01b0381168114610ab3575f80fd5b5f8060408385031215610d76575f80fd5b823591506020830135610d8881610d51565b809150509250929050565b5f60208284031215610da3575f80fd5b8135610d3381610d51565b62ffffff81168114610ab3575f80fd5b5f8060408385031215610dcf575f80fd5b8235610dda81610dae565b946020939093013593505050565b5f60a0828403128015610df9575f80fd5b509092915050565b634e487b7160e01b5f52601160045260245ffd5b808202811582820484141761054c5761054c610e01565b5f82610e4657634e487b7160e01b5f52601260045260245ffd5b500490565b8082018082111561054c5761054c610e01565b86815285602082015284151560408201526001600160a01b0384541660608201525f60018501546001600160a01b038116608084015262ffffff8160a01c1660a08401528060b81c60020b60c084015250610ec360028601546001600160a01b031690565b6001600160a01b031660e083015261016061010083018190525f9083015261018082016001600160a01b0394909416610120830152506101400152949350505050565b5f60208284031215610f16575f80fd5b5051919050565b5f813561054c81610d51565b8135610f3481610d51565b81546001600160a01b0319166001600160a01b03821617825550600181016020830135610f6081610d51565b81546001600160a01b0319166001600160a01b038216178255506040830135610f8881610dae565b815476ffffff00000000000000000000000000000000000000008260a01b167fffffffffffffffffff000000ffffffffffffffffffffffffffffffffffffffff8216178355505060608301358060020b8114610fe2575f80fd5b81548160b81b79ffffff0000000000000000000000000000000000000000000000167fffffffffffff000000ffffffffffffffffffffffffffffffffffffffffffffff8216178355505050610c9c61103c60808401610f1d565b600283016001600160a01b0382166001600160a01b0319825416178155505056fea2646970667358221220868a577153f35a458f1c60e861156bbfea7a508f8476e24b38a6583d4719700c64736f6c634300081a0033a26469706673582212202e85b467eb5bb34bf78f3e7dfce44d9ccf46303441a3220b96c33466b8ecd6eb64736f6c634300081a0033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000e911f518449ba0011d84b047b4cde50daa081ec1
-----Decoded View---------------
Arg [0] : _admin (address): 0xe911f518449ba0011D84b047B4cde50dAA081eC1
-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 000000000000000000000000e911f518449ba0011d84b047b4cde50daa081ec1
Net Worth in USD
Net Worth in ETH
Multichain Portfolio | 35 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
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.