Source Code
Latest 25 from a total of 124 transactions
| Transaction Hash |
|
Block
|
From
|
To
|
|||||
|---|---|---|---|---|---|---|---|---|---|
| Create Concentra... | 23718768 | 152 days ago | IN | 0.0030541 ETH | 0.00000049 | ||||
| Create Concentra... | 20769671 | 220 days ago | IN | 0.005 ETH | 0.00000041 | ||||
| Create Concentra... | 10180077 | 465 days ago | IN | 0.00006 ETH | 0.00000819 | ||||
| Create Concentra... | 9609907 | 479 days ago | IN | 0.00083528 ETH | 0.00000961 | ||||
| Create Concentra... | 5571214 | 572 days ago | IN | 0 ETH | 0.00000178 | ||||
| Create Concentra... | 5528520 | 573 days ago | IN | 0.25 ETH | 0.00002977 | ||||
| Create Concentra... | 5279964 | 579 days ago | IN | 0.00001 ETH | 0.00002236 | ||||
| Create Concentra... | 5163739 | 582 days ago | IN | 0 ETH | 0.00085023 | ||||
| Create Concentra... | 5143097 | 582 days ago | IN | 0 ETH | 0.00042309 | ||||
| Create Concentra... | 5126292 | 582 days ago | IN | 0.29861359 ETH | 0.00074858 | ||||
| Create Concentra... | 5060404 | 584 days ago | IN | 0.03006896 ETH | 0.00045696 | ||||
| Create Concentra... | 5036309 | 585 days ago | IN | 1.53480051 ETH | 0.00117686 | ||||
| Create Concentra... | 5036176 | 585 days ago | IN | 1.59902356 ETH | 0.00119313 | ||||
| Create Concentra... | 5030047 | 585 days ago | IN | 0.01388888 ETH | 0.00127536 | ||||
| Create Concentra... | 4983124 | 586 days ago | IN | 0.00028105 ETH | 0.00035867 | ||||
| Create Concentra... | 4983038 | 586 days ago | IN | 0.00028105 ETH | 0.00035954 | ||||
| Create Concentra... | 4977426 | 586 days ago | IN | 0.00001 ETH | 0.00051043 | ||||
| Create Concentra... | 4937288 | 587 days ago | IN | 0.17330777 ETH | 0.0002889 | ||||
| Create Concentra... | 4936688 | 587 days ago | IN | 0.15040995 ETH | 0.00029383 | ||||
| Create Concentra... | 4936443 | 587 days ago | IN | 0 ETH | 0.00036667 | ||||
| Create Concentra... | 4865035 | 589 days ago | IN | 0.01402918 ETH | 0.00032062 | ||||
| Create Concentra... | 4853293 | 589 days ago | IN | 0 ETH | 0.00019262 | ||||
| Create Concentra... | 4853292 | 589 days ago | IN | 280 wei | 0.00019245 | ||||
| Create Concentra... | 4853291 | 589 days ago | IN | 0 ETH | 0.00019151 | ||||
| Create Concentra... | 4853290 | 589 days ago | IN | 0 ETH | 0.0001909 |
Latest 25 internal transactions (View All)
Advanced mode:
| Parent Transaction Hash | Block | From | To | |||
|---|---|---|---|---|---|---|
| 23718768 | 152 days ago | 0.0030541 ETH | ||||
| 20769671 | 220 days ago | 0.005 ETH | ||||
| 10180077 | 465 days ago | 0.00006 ETH | ||||
| 9609907 | 479 days ago | 0.00083528 ETH | ||||
| 5528520 | 573 days ago | 0.25 ETH | ||||
| 5126292 | 582 days ago | 0.29861359 ETH | ||||
| 5060404 | 584 days ago | 0.03006896 ETH | ||||
| 5036309 | 585 days ago | 1.53480051 ETH | ||||
| 5036176 | 585 days ago | 1.59902356 ETH | ||||
| 5030047 | 585 days ago | 0.01388888 ETH | ||||
| 4983124 | 586 days ago | 0.00028105 ETH | ||||
| 4983038 | 586 days ago | 0.00028105 ETH | ||||
| 4977426 | 586 days ago | 0.00001 ETH | ||||
| 4937288 | 587 days ago | 0.17330777 ETH | ||||
| 4936688 | 587 days ago | 0.15040995 ETH | ||||
| 4865035 | 589 days ago | 0.01402918 ETH | ||||
| 4853293 | 589 days ago | 0 ETH | ||||
| 4853292 | 589 days ago | 280 wei | ||||
| 4853291 | 589 days ago | 0 ETH | ||||
| 4853290 | 589 days ago | 0 ETH | ||||
| 4853288 | 589 days ago | 280 wei | ||||
| 4853281 | 589 days ago | 0 ETH | ||||
| 4841696 | 589 days ago | 0 ETH | ||||
| 4841671 | 589 days ago | 0 ETH | ||||
| 4841660 | 589 days ago | 840 wei |
Cross-Chain Transactions
Loading...
Loading
This contract may be a proxy contract. Click on More Options and select Is this a proxy? to confirm and enable the "Read as Proxy" & "Write as Proxy" tabs.
Contract Name:
ConcentratedLiquidityAgentFactory
Compiler Version
v0.8.24+commit.e11b9ed9
Optimization Enabled:
Yes with 200000 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: none
pragma solidity 0.8.24;
import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import { SafeERC20 } from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import { IERC721 } from "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import { MulticallableERC2771Context } from "./../utils/MulticallableERC2771Context.sol";
import { Calls } from "./../libraries/Calls.sol";
import { Errors } from "./../libraries/Errors.sol";
import { IBlastooorStrategyAgents } from "./../interfaces/tokens/IBlastooorStrategyAgents.sol";
import { IExplorerAgents } from "./../interfaces/tokens/IExplorerAgents.sol";
import { IERC6551Registry } from "./../interfaces/erc6551/IERC6551Registry.sol";
import { IAgentRegistry } from "./../interfaces/utils/IAgentRegistry.sol";
import { IConcentratedLiquidityAgentFactory } from "./../interfaces/factory/IConcentratedLiquidityAgentFactory.sol";
import { IUniswapV2Pair } from "./../interfaces/external/UniswapV2/IUniswapV2Pair.sol";
import { Blastable } from "./../utils/Blastable.sol";
import { Ownable2Step } from "./../utils/Ownable2Step.sol";
import { IConcentratedLiquidityModuleC } from "./../interfaces/modules/IConcentratedLiquidityModuleC.sol";
/**
* @title ConcentratedLiquidityAgentFactory
* @author AgentFi
* @notice A factory for strategy agents.
*
* Agent operators can use one of the create methods to create a new agent. The agent will be created based on settings stored in the factory by the contract owner. These settings can be viewed via [`getAgentCreationSettings()`](#getagentcreationsettings).
*/
contract ConcentratedLiquidityAgentFactory is Blastable, Ownable2Step, MulticallableERC2771Context, IConcentratedLiquidityAgentFactory {
/***************************************
STATE VARIABLES
***************************************/
// addresses
address internal immutable _erc6551Registry;
address internal immutable _agentRegistry;
address internal immutable _genesisAgentNft;
address internal immutable _strategyAgentNft;
address internal immutable _explorerAgentNft;
address internal immutable _weth;
// agent creation settings
bool internal _isActive;
address internal _strategyAccountImpl;
address internal _explorerAccountImpl;
bytes internal _strategyInitializationCall;
bytes internal _explorerInitializationCall;
/***************************************
CONSTRUCTOR
***************************************/
/**
* @notice Constructs the factory contract.
* @param owner_ The owner of the contract.
* @param blast_ The address of the blast gas reward contract.
* @param gasCollector_ The address of the gas collector.
* @param blastPoints_ The address of the blast points contract.
* @param pointsOperator_ The address of the blast points operator.
* @param multicallForwarder_ The MulticallForwarder address.
* @param genesisAgentNft_ The genesis agents contract.
* @param strategyAgentNft_ The strategy agents contract.
* @param explorerAgentNft_ The explorer agents contract.
* @param erc6551Registry_ The erc6551 registry contract.
* @param agentRegistry_ The agent registry contract.
* @param weth_ The address of wrapped ether.
*/
constructor(
address owner_,
address blast_,
address gasCollector_,
address blastPoints_,
address pointsOperator_,
address multicallForwarder_,
address genesisAgentNft_,
address strategyAgentNft_,
address explorerAgentNft_,
address erc6551Registry_,
address agentRegistry_,
address weth_
) Blastable(blast_, gasCollector_, blastPoints_, pointsOperator_) MulticallableERC2771Context(multicallForwarder_) {
_transferOwnership(owner_);
_genesisAgentNft = genesisAgentNft_;
_strategyAgentNft = strategyAgentNft_;
_explorerAgentNft = explorerAgentNft_;
_erc6551Registry = erc6551Registry_;
_agentRegistry = agentRegistry_;
_weth = weth_;
}
/***************************************
VIEW FUNCTIONS
***************************************/
/**
* @notice Gets the addresses that have been statically set.
*/
function getStaticAddresses() external view override returns (
address erc6551Registry_,
address agentRegistry_,
address genesisAgentNft_,
address strategyAgentNft_,
address explorerAgentNft_,
address weth_
) {
erc6551Registry_ = _erc6551Registry;
agentRegistry_ = _agentRegistry;
genesisAgentNft_ = _genesisAgentNft;
strategyAgentNft_ = _strategyAgentNft;
explorerAgentNft_ = _explorerAgentNft;
weth_ = _weth;
}
/**
* @notice Gets the agent creation settings.
*/
function getAgentCreationSettings() external view override returns (
address strategyAccountImpl_,
address explorerAccountImpl_,
bytes memory strategyInitializationCall_,
bytes memory explorerInitializationCall_,
bool isActive_
) {
strategyAccountImpl_ = _strategyAccountImpl;
explorerAccountImpl_ = _explorerAccountImpl;
strategyInitializationCall_ = _strategyInitializationCall;
explorerInitializationCall_ = _explorerInitializationCall;
isActive_ = _isActive;
}
/***************************************
CREATE AGENT FUNCTIONS
***************************************/
/**
* @notice Creates a new V3 strategy agent.
* The new agent will be minted to an existing root agent.
* Can only be called by the owner of the root agent.
* @param mintParams Parameters to use to mint the position.
* @param deposit0 The first token and amount to deposit.
* @param deposit1 The second token and amount to deposit.
* @param rootAgentAddress The address of the root agent to transfer the v3 agent to.
* @return nonfungiblePositionTokenId The ID of the concentrated liquidity position.
* @return strategyAgentID The ID of the newly created strategy agent.
* @return strategyAddress The address of the newly created strategy agent.
*/
function createConcentratedLiquidityAgentForRoot(
MintBalanceParams calldata mintParams,
TokenDeposit calldata deposit0,
TokenDeposit calldata deposit1,
address rootAgentAddress
) external payable override returns (
uint256 nonfungiblePositionTokenId,
uint256 strategyAgentID,
address strategyAddress
) {
// checks
_createAgentForRootPrecheck(rootAgentAddress);
// create v3 agent
(nonfungiblePositionTokenId, strategyAgentID, strategyAddress) =
_createConcentratedLiquidityAgent(mintParams, deposit0, deposit1);
// transfer strategy agent to root agent
IBlastooorStrategyAgents(_strategyAgentNft).transferFrom(address(this), rootAgentAddress, strategyAgentID);
}
/**
* @notice Creates a new V3 strategy agent.
* The new agent will be minted to a new explorer agent.
* @param mintParams Parameters to use to mint the position.
* @param deposit0 The first token and amount to deposit.
* @param deposit1 The second token and amount to deposit.
* @return nonfungiblePositionTokenId The ID of the concentrated liquidity position.
* @return strategyAgentID The ID of the newly created strategy agent.
* @return strategyAddress The address of the newly created strategy agent.
* @return explorerAgentID The ID of the newly created explorer agent.
* @return explorerAddress The address of the newly created explorer agent.
*/
function createConcentratedLiquidityAgentAndExplorer(
MintBalanceParams calldata mintParams,
TokenDeposit calldata deposit0,
TokenDeposit calldata deposit1
) external payable override returns (
uint256 nonfungiblePositionTokenId,
uint256 strategyAgentID,
address strategyAddress,
uint256 explorerAgentID,
address explorerAddress
) {
// checks
if(!_isActive) revert Errors.CreationSettingsPaused();
// create explorer agent
(explorerAgentID, explorerAddress) = _createExplorerAgent();
// create v3 agent
(nonfungiblePositionTokenId, strategyAgentID, strategyAddress) =
_createConcentratedLiquidityAgent(mintParams, deposit0, deposit1);
// transfer v3 agent to explorer agent
IBlastooorStrategyAgents(_strategyAgentNft).transferFrom(address(this), explorerAddress, strategyAgentID);
// transfer explorer agent to msg sender
IExplorerAgents(_explorerAgentNft).transferFrom(address(this), _msgSender(), explorerAgentID);
}
/**
* @notice Creates a new V3 strategy agent.
* The new agent will be minted to an existing root agent.
* Can only be called by the owner of the root agent.
* @param mintParams Parameters to use to mint the position.
* @param deposit0 The first token and amount to deposit.
* @param deposit1 The second token and amount to deposit.
* @param rootAgentAddress The address of the root agent to transfer the v3 agent to.
* @return nonfungiblePositionTokenId The ID of the concentrated liquidity position.
* @return strategyAgentID The ID of the newly created strategy agent.
* @return strategyAddress The address of the newly created strategy agent.
*/
function createConcentratedLiquidityAgentForRootAndRefundExcess(
MintBalanceParams calldata mintParams,
TokenDeposit calldata deposit0,
TokenDeposit calldata deposit1,
address rootAgentAddress
) external payable override returns (
uint256 nonfungiblePositionTokenId,
uint256 strategyAgentID,
address strategyAddress
) {
// checks
_createAgentForRootPrecheck(rootAgentAddress);
// create v3 agent
(nonfungiblePositionTokenId, strategyAgentID, strategyAddress) =
_createConcentratedLiquidityAgentAndRefundExcess(mintParams, deposit0, deposit1);
// transfer strategy agent to root agent
IBlastooorStrategyAgents(_strategyAgentNft).transferFrom(address(this), rootAgentAddress, strategyAgentID);
}
/**
* @notice Creates a new V3 strategy agent.
* The new agent will be minted to a new explorer agent.
* @param mintParams Parameters to use to mint the position.
* @param deposit0 The first token and amount to deposit.
* @param deposit1 The second token and amount to deposit.
* @return nonfungiblePositionTokenId The ID of the concentrated liquidity position.
* @return strategyAgentID The ID of the newly created strategy agent.
* @return strategyAddress The address of the newly created strategy agent.
* @return explorerAgentID The ID of the newly created explorer agent.
* @return explorerAddress The address of the newly created explorer agent.
*/
function createConcentratedLiquidityAgentAndExplorerAndRefundExcess(
MintBalanceParams calldata mintParams,
TokenDeposit calldata deposit0,
TokenDeposit calldata deposit1
) external payable override returns (
uint256 nonfungiblePositionTokenId,
uint256 strategyAgentID,
address strategyAddress,
uint256 explorerAgentID,
address explorerAddress
) {
// checks
if(!_isActive) revert Errors.CreationSettingsPaused();
// create explorer agent
(explorerAgentID, explorerAddress) = _createExplorerAgent();
// create v3 agent
(nonfungiblePositionTokenId, strategyAgentID, strategyAddress) =
_createConcentratedLiquidityAgentAndRefundExcess(mintParams, deposit0, deposit1);
// transfer v3 agent to explorer agent
IBlastooorStrategyAgents(_strategyAgentNft).transferFrom(address(this), explorerAddress, strategyAgentID);
// transfer explorer agent to msg sender
IExplorerAgents(_explorerAgentNft).transferFrom(address(this), _msgSender(), explorerAgentID);
}
/**
* @notice Creates a new V3 strategy agent.
* The new agent will be minted to an existing root agent.
* Can only be called by the owner of the root agent.
* @param mintParams Parameters to use to mint the position.
* @param depositLpToken The lp token and amount to migrate.
* @param rootAgentAddress The address of the root agent to transfer the v3 agent to.
* @return nonfungiblePositionTokenId The ID of the concentrated liquidity position.
* @return strategyAgentID The ID of the newly created strategy agent.
* @return strategyAddress The address of the newly created strategy agent.
*/
function createConcentratedLiquidityAgentForRootAndMigrate(
MintBalanceParams calldata mintParams,
TokenDeposit calldata depositLpToken,
address rootAgentAddress
) public payable override returns (
uint256 nonfungiblePositionTokenId,
uint256 strategyAgentID,
address strategyAddress
) {
// checks
_createAgentForRootPrecheck(rootAgentAddress);
// create v3 agent
(nonfungiblePositionTokenId, strategyAgentID, strategyAddress) =
_createConcentratedLiquidityAgentAndMigrate(mintParams, depositLpToken);
// transfer strategy agent to root agent
IBlastooorStrategyAgents(_strategyAgentNft).transferFrom(address(this), rootAgentAddress, strategyAgentID);
}
/**
* @notice Creates a new V3 strategy agent.
* The new agent will be minted to a new explorer agent.
* @param mintParams Parameters to use to mint the position.
* @param depositLpToken The lp token and amount to migrate.
* @return nonfungiblePositionTokenId The ID of the concentrated liquidity position.
* @return strategyAgentID The ID of the newly created strategy agent.
* @return strategyAddress The address of the newly created strategy agent.
* @return explorerAgentID The ID of the newly created explorer agent.
* @return explorerAddress The address of the newly created explorer agent.
*/
function createConcentratedLiquidityAgentAndExplorerAndMigrate(
MintBalanceParams calldata mintParams,
TokenDeposit calldata depositLpToken
) public payable override returns (
uint256 nonfungiblePositionTokenId,
uint256 strategyAgentID,
address strategyAddress,
uint256 explorerAgentID,
address explorerAddress
) {
// checks
if(!_isActive) revert Errors.CreationSettingsPaused();
// create explorer agent
(explorerAgentID, explorerAddress) = _createExplorerAgent();
// create v3 agent
(nonfungiblePositionTokenId, strategyAgentID, strategyAddress) =
_createConcentratedLiquidityAgentAndMigrate(mintParams, depositLpToken);
// transfer v3 agent to explorer agent
IBlastooorStrategyAgents(_strategyAgentNft).transferFrom(address(this), explorerAddress, strategyAgentID);
// transfer explorer agent to msg sender
IExplorerAgents(_explorerAgentNft).transferFrom(address(this), _msgSender(), explorerAgentID);
}
/**
* @notice Creates a new V3 strategy agent.
* The new agent will be minted to an existing root agent.
* Can only be called by the owner of the root agent.
* @param mintParams Parameters to use to mint the position.
* @param depositLpToken The lp token and amount to migrate.
* @param rootAgentAddress The address of the root agent to transfer the v3 agent to.
* @return nonfungiblePositionTokenId The ID of the concentrated liquidity position.
* @return strategyAgentID The ID of the newly created strategy agent.
* @return strategyAddress The address of the newly created strategy agent.
*/
function createConcentratedLiquidityAgentForRootAndMigrateWithPermit(
MintBalanceParams calldata mintParams,
TokenDeposit calldata depositLpToken,
address rootAgentAddress,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) external payable override returns (
uint256 nonfungiblePositionTokenId,
uint256 strategyAgentID,
address strategyAddress
) {
// permit lp token
IUniswapV2Pair(depositLpToken.token).permit(
_msgSender(),
address(this),
depositLpToken.amount,
deadline,
v,
r,
s
);
// create agent
(
nonfungiblePositionTokenId,
strategyAgentID,
strategyAddress
) = createConcentratedLiquidityAgentForRootAndMigrate(mintParams, depositLpToken, rootAgentAddress);
}
/**
* @notice Creates a new V3 strategy agent.
* The new agent will be minted to a new explorer agent.
* @param mintParams Parameters to use to mint the position.
* @param depositLpToken The lp token and amount to migrate.
* @return nonfungiblePositionTokenId The ID of the concentrated liquidity position.
* @return strategyAgentID The ID of the newly created strategy agent.
* @return strategyAddress The address of the newly created strategy agent.
* @return explorerAgentID The ID of the newly created explorer agent.
* @return explorerAddress The address of the newly created explorer agent.
*/
function createConcentratedLiquidityAgentAndExplorerAndMigrateWithPermit(
MintBalanceParams calldata mintParams,
TokenDeposit calldata depositLpToken,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) external payable override returns (
uint256 nonfungiblePositionTokenId,
uint256 strategyAgentID,
address strategyAddress,
uint256 explorerAgentID,
address explorerAddress
) {
// permit lp token
IUniswapV2Pair(depositLpToken.token).permit(
_msgSender(),
address(this),
depositLpToken.amount,
deadline,
v,
r,
s
);
// create agent
(
nonfungiblePositionTokenId,
strategyAgentID,
strategyAddress,
explorerAgentID,
explorerAddress
) = createConcentratedLiquidityAgentAndExplorerAndMigrate(mintParams, depositLpToken);
}
/***************************************
HELPER FUNCTIONS
***************************************/
/**
* @notice Creates a new concentrated liquidity agent.
* @param mintParams Parameters to use to mint the position.
* @param deposit0 The first token and amount to deposit.
* @param deposit1 The second token and amount to deposit.
* @return nonfungiblePositionTokenId The ID of the concentrated liquidity position.
* @return strategyAgentID The ID of the newly created strategy agent.
* @return strategyAddress The address of the newly created strategy agent.
*/
function _createConcentratedLiquidityAgent(
MintBalanceParams calldata mintParams,
TokenDeposit calldata deposit0,
TokenDeposit calldata deposit1
) internal returns (
uint256 nonfungiblePositionTokenId,
uint256 strategyAgentID,
address strategyAddress
) {
// create nft
(strategyAgentID, strategyAddress) = _createStrategyAgent();
address weth = _weth;
// handle token deposits
if(deposit0.token == address(0)) {
Calls.sendValue(weth, deposit0.amount);
SafeERC20.safeTransfer(IERC20(weth), strategyAddress, deposit0.amount);
}
else {
SafeERC20.safeTransferFrom(IERC20(deposit0.token), _msgSender(), strategyAddress, deposit0.amount);
}
if(deposit1.token == address(0)) {
Calls.sendValue(weth, deposit1.amount);
SafeERC20.safeTransfer(IERC20(weth), strategyAddress, deposit1.amount);
}
else {
SafeERC20.safeTransferFrom(IERC20(deposit1.token), _msgSender(), strategyAddress, deposit1.amount);
}
// create the position in the strategy agent
(nonfungiblePositionTokenId, , , ) =
IConcentratedLiquidityModuleC(payable(strategyAddress)).moduleC_mintWithBalance(
IConcentratedLiquidityModuleC.MintBalanceParams({
manager: mintParams.manager,
pool: mintParams.pool,
slippageLiquidity: mintParams.slippageLiquidity,
tickLower: mintParams.tickLower,
tickUpper: mintParams.tickUpper,
sqrtPriceX96: mintParams.sqrtPriceX96
})
);
}
/**
* @notice Creates a new concentrated liquidity agent.
* @param mintParams Parameters to use to mint the position.
* @param deposit0 The first token and amount to deposit.
* @param deposit1 The second token and amount to deposit.
* @return nonfungiblePositionTokenId The ID of the concentrated liquidity position.
* @return strategyAgentID The ID of the newly created strategy agent.
* @return strategyAddress The address of the newly created strategy agent.
*/
function _createConcentratedLiquidityAgentAndRefundExcess(
MintBalanceParams calldata mintParams,
TokenDeposit calldata deposit0,
TokenDeposit calldata deposit1
) internal returns (
uint256 nonfungiblePositionTokenId,
uint256 strategyAgentID,
address strategyAddress
) {
// create nft
(strategyAgentID, strategyAddress) = _createStrategyAgent();
address weth = _weth;
// handle token deposits
if(deposit0.token == address(0)) {
Calls.sendValue(weth, deposit0.amount);
SafeERC20.safeTransfer(IERC20(weth), strategyAddress, deposit0.amount);
}
else {
SafeERC20.safeTransferFrom(IERC20(deposit0.token), _msgSender(), strategyAddress, deposit0.amount);
}
if(deposit1.token == address(0)) {
Calls.sendValue(weth, deposit1.amount);
SafeERC20.safeTransfer(IERC20(weth), strategyAddress, deposit1.amount);
}
else {
SafeERC20.safeTransferFrom(IERC20(deposit1.token), _msgSender(), strategyAddress, deposit1.amount);
}
// create the position in the strategy agent
(nonfungiblePositionTokenId, , , ) =
IConcentratedLiquidityModuleC(payable(strategyAddress)).moduleC_mintWithBalanceAndRefundTo(
IConcentratedLiquidityModuleC.MintBalanceAndRefundParams({
manager: mintParams.manager,
pool: mintParams.pool,
slippageLiquidity: mintParams.slippageLiquidity,
tickLower: mintParams.tickLower,
tickUpper: mintParams.tickUpper,
sqrtPriceX96: mintParams.sqrtPriceX96,
receiver: _msgSender()
})
);
}
/**
* @notice Creates a new concentrated liquidity agent.
* @param mintParams Parameters to use to mint the position.
* @param depositLpToken The lp token and amount to migrate.
* @return nonfungiblePositionTokenId The ID of the concentrated liquidity position.
* @return strategyAgentID The ID of the newly created strategy agent.
* @return strategyAddress The address of the newly created strategy agent.
*/
function _createConcentratedLiquidityAgentAndMigrate(
MintBalanceParams calldata mintParams,
TokenDeposit calldata depositLpToken
) internal returns (
uint256 nonfungiblePositionTokenId,
uint256 strategyAgentID,
address strategyAddress
) {
// create nft
(strategyAgentID, strategyAddress) = _createStrategyAgent();
// handle token deposits
SafeERC20.safeTransferFrom(IERC20(depositLpToken.token), _msgSender(), depositLpToken.token, depositLpToken.amount);
IUniswapV2Pair(depositLpToken.token).burn(strategyAddress);
// create the position in the strategy agent
(nonfungiblePositionTokenId, , , ) =
IConcentratedLiquidityModuleC(payable(strategyAddress)).moduleC_mintWithBalance(
IConcentratedLiquidityModuleC.MintBalanceParams({
manager: mintParams.manager,
pool: mintParams.pool,
slippageLiquidity: mintParams.slippageLiquidity,
tickLower: mintParams.tickLower,
tickUpper: mintParams.tickUpper,
sqrtPriceX96: mintParams.sqrtPriceX96
})
);
}
/***************************************
HELPER FUNCTIONS for creating the agent nft and tba
***************************************/
/**
* @notice Creates a new strategy agent.
* Includes the agent NFT and TBA.
* Initializes the strategy but doesn't initialize the position.
* @return strategyAgentID The ID of the new agent.
* @return strategyAddress The address of the new agent.
*/
function _createStrategyAgent() internal returns (
uint256 strategyAgentID,
address strategyAddress
) {
// create nft
address strategies = _strategyAgentNft;
strategyAgentID = IBlastooorStrategyAgents(strategies).createAgent();
// create account
address accountImpl = _strategyAccountImpl;
bytes32 salt = bytes32(uint256(0));
strategyAddress = IERC6551Registry(_erc6551Registry).createAccount(
accountImpl,
salt,
block.chainid,
strategies,
strategyAgentID
);
// register account
IAgentRegistry(_agentRegistry).registerAgent(IAgentRegistry.RegisterAgentParam({
agentAddress: strategyAddress,
implementationAddress: accountImpl,
collection: strategies,
agentID: strategyAgentID
}));
// initialize account
Calls.functionCall(strategyAddress, _strategyInitializationCall);
}
/**
* @notice Creates a new explorer agent.
* Includes the agent NFT and TBA.
* Initializes the explorer but doesn't initialize the position.
* @return explorerAgentID The ID of the new agent.
* @return explorerAddress The address of the new agent.
*/
function _createExplorerAgent() internal returns (
uint256 explorerAgentID,
address explorerAddress
) {
// create nft
address explorers = _explorerAgentNft;
explorerAgentID = IExplorerAgents(explorers).createAgent();
// create account
address accountImpl = _explorerAccountImpl;
bytes32 salt = bytes32(uint256(0));
explorerAddress = IERC6551Registry(_erc6551Registry).createAccount(
accountImpl,
salt,
block.chainid,
explorers,
explorerAgentID
);
// register account
IAgentRegistry(_agentRegistry).registerAgent(IAgentRegistry.RegisterAgentParam({
agentAddress: explorerAddress,
implementationAddress: accountImpl,
collection: explorers,
agentID: explorerAgentID
}));
// initialize account
Calls.functionCall(explorerAddress, _explorerInitializationCall);
}
/***************************************
HELPER FUNCTIONS for prechecks
***************************************/
/**
* @notice A precheck for creating new agents to an exist root agent.
* @param rootAgentAddress The address of the root agent to mint to.
*/
function _createAgentForRootPrecheck(
address rootAgentAddress
) internal {
// check if is active
if(!_isActive) revert Errors.CreationSettingsPaused();
// check agent registry
(address collection, uint256 rootAgentID) = IAgentRegistry(_agentRegistry).getNftOfTba(rootAgentAddress);
// check if in one of permitted collections
if(
(collection == address(0)) || (
(collection != _genesisAgentNft) &&
(collection != _strategyAgentNft) &&
(collection != _explorerAgentNft)
)
) revert Errors.NotAnAgent();
// check if owner
if(IERC721(collection).ownerOf(rootAgentID) != _msgSender()) revert Errors.NotOwnerOfAgent();
}
/***************************************
OWNER FUNCTIONS
***************************************/
/**
* @notice Posts a new AgentCreationSettings.
* Can only be called by the contract owner.
*/
function postAgentCreationSettings(
AgentCreationSettings calldata creationSettings
) external payable override onlyOwner {
_strategyAccountImpl = creationSettings.strategyAccountImpl;
_explorerAccountImpl = creationSettings.explorerAccountImpl;
_strategyInitializationCall = creationSettings.strategyInitializationCall;
_explorerInitializationCall = creationSettings.explorerInitializationCall;
_isActive = creationSettings.isActive;
emit AgentCreationSettingsPosted();
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.1) (metatx/ERC2771Context.sol)
pragma solidity ^0.8.20;
import {Context} from "../utils/Context.sol";
/**
* @dev Context variant with ERC2771 support.
*
* WARNING: Avoid using this pattern in contracts that rely in a specific calldata length as they'll
* be affected by any forwarder whose `msg.data` is suffixed with the `from` address according to the ERC2771
* specification adding the address size in bytes (20) to the calldata size. An example of an unexpected
* behavior could be an unintended fallback (or another function) invocation while trying to invoke the `receive`
* function only accessible if `msg.data.length == 0`.
*
* WARNING: The usage of `delegatecall` in this contract is dangerous and may result in context corruption.
* Any forwarded request to this contract triggering a `delegatecall` to itself will result in an invalid {_msgSender}
* recovery.
*/
abstract contract ERC2771Context is Context {
/// @custom:oz-upgrades-unsafe-allow state-variable-immutable
address private immutable _trustedForwarder;
/**
* @dev Initializes the contract with a trusted forwarder, which will be able to
* invoke functions on this contract on behalf of other accounts.
*
* NOTE: The trusted forwarder can be replaced by overriding {trustedForwarder}.
*/
/// @custom:oz-upgrades-unsafe-allow constructor
constructor(address trustedForwarder_) {
_trustedForwarder = trustedForwarder_;
}
/**
* @dev Returns the address of the trusted forwarder.
*/
function trustedForwarder() public view virtual returns (address) {
return _trustedForwarder;
}
/**
* @dev Indicates whether any particular address is the trusted forwarder.
*/
function isTrustedForwarder(address forwarder) public view virtual returns (bool) {
return forwarder == trustedForwarder();
}
/**
* @dev Override for `msg.sender`. Defaults to the original `msg.sender` whenever
* a call is not performed by the trusted forwarder or the calldata length is less than
* 20 bytes (an address length).
*/
function _msgSender() internal view virtual override returns (address) {
uint256 calldataLength = msg.data.length;
uint256 contextSuffixLength = _contextSuffixLength();
if (isTrustedForwarder(msg.sender) && calldataLength >= contextSuffixLength) {
return address(bytes20(msg.data[calldataLength - contextSuffixLength:]));
} else {
return super._msgSender();
}
}
/**
* @dev Override for `msg.data`. Defaults to the original `msg.data` whenever
* a call is not performed by the trusted forwarder or the calldata length is less than
* 20 bytes (an address length).
*/
function _msgData() internal view virtual override returns (bytes calldata) {
uint256 calldataLength = msg.data.length;
uint256 contextSuffixLength = _contextSuffixLength();
if (isTrustedForwarder(msg.sender) && calldataLength >= contextSuffixLength) {
return msg.data[:calldataLength - contextSuffixLength];
} else {
return super._msgData();
}
}
/**
* @dev ERC-2771 specifies the context as being a single address (20 bytes).
*/
function _contextSuffixLength() internal view virtual override returns (uint256) {
return 20;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/extensions/IERC20Permit.sol)
pragma solidity ^0.8.20;
/**
* @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
* https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
*
* Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
* presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't
* need to send a transaction, and thus is not required to hold Ether at all.
*
* ==== Security Considerations
*
* There are two important considerations concerning the use of `permit`. The first is that a valid permit signature
* expresses an allowance, and it should not be assumed to convey additional meaning. In particular, it should not be
* considered as an intention to spend the allowance in any specific way. The second is that because permits have
* built-in replay protection and can be submitted by anyone, they can be frontrun. A protocol that uses permits should
* take this into consideration and allow a `permit` call to fail. Combining these two aspects, a pattern that may be
* generally recommended is:
*
* ```solidity
* function doThingWithPermit(..., uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public {
* try token.permit(msg.sender, address(this), value, deadline, v, r, s) {} catch {}
* doThing(..., value);
* }
*
* function doThing(..., uint256 value) public {
* token.safeTransferFrom(msg.sender, address(this), value);
* ...
* }
* ```
*
* Observe that: 1) `msg.sender` is used as the owner, leaving no ambiguity as to the signer intent, and 2) the use of
* `try/catch` allows the permit to fail and makes the code tolerant to frontrunning. (See also
* {SafeERC20-safeTransferFrom}).
*
* Additionally, note that smart contract wallets (such as Argent or Safe) are not able to produce permit signatures, so
* contracts should have entry points that don't rely on permit.
*/
interface IERC20Permit {
/**
* @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,
* given ``owner``'s signed approval.
*
* IMPORTANT: The same issues {IERC20-approve} has related to transaction
* ordering also apply here.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `deadline` must be a timestamp in the future.
* - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`
* over the EIP712-formatted function arguments.
* - the signature must use ``owner``'s current nonce (see {nonces}).
*
* For more information on the signature format, see the
* https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP
* section].
*
* CAUTION: See Security Considerations above.
*/
function permit(
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) external;
/**
* @dev Returns the current nonce for `owner`. This value must be
* included whenever a signature is generated for {permit}.
*
* Every successful call to {permit} increases ``owner``'s nonce by one. This
* prevents a signature from being used multiple times.
*/
function nonces(address owner) external view returns (uint256);
/**
* @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.
*/
// solhint-disable-next-line func-name-mixedcase
function DOMAIN_SEPARATOR() external view returns (bytes32);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol)
pragma solidity ^0.8.20;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
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.0.0) (token/ERC20/utils/SafeERC20.sol)
pragma solidity ^0.8.20;
import {IERC20} from "../IERC20.sol";
import {IERC20Permit} from "../extensions/IERC20Permit.sol";
import {Address} from "../../../utils/Address.sol";
/**
* @title SafeERC20
* @dev Wrappers around ERC20 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 {
using Address for address;
/**
* @dev An operation with an ERC20 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 Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
* non-reverting calls are assumed to be successful.
*/
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.
*/
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.
*/
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 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).
*/
function _callOptionalReturn(IERC20 token, bytes memory data) private {
// We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
// we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that
// the target address contains contract code and also asserts for success in the low-level call.
bytes memory returndata = address(token).functionCall(data);
if (returndata.length != 0 && !abi.decode(returndata, (bool))) {
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 silents catches all reverts and returns a bool instead.
*/
function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {
// We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
// we're implementing it ourselves. We cannot use {Address-functionCall} here since this should return false
// and not revert is the subcall reverts.
(bool success, bytes memory returndata) = address(token).call(data);
return success && (returndata.length == 0 || abi.decode(returndata, (bool))) && address(token).code.length > 0;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/extensions/IERC721Enumerable.sol)
pragma solidity ^0.8.20;
import {IERC721} from "../IERC721.sol";
/**
* @title ERC-721 Non-Fungible Token Standard, optional enumeration extension
* @dev See https://eips.ethereum.org/EIPS/eip-721
*/
interface IERC721Enumerable is IERC721 {
/**
* @dev Returns the total amount of tokens stored by the contract.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns a token ID owned by `owner` at a given `index` of its token list.
* Use along with {balanceOf} to enumerate all of ``owner``'s tokens.
*/
function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256);
/**
* @dev Returns a token ID at a given `index` of all the tokens stored by the contract.
* Use along with {totalSupply} to enumerate all tokens.
*/
function tokenByIndex(uint256 index) external view returns (uint256);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/IERC721.sol)
pragma solidity ^0.8.20;
import {IERC165} from "../../utils/introspection/IERC165.sol";
/**
* @dev Required interface of an ERC721 compliant contract.
*/
interface IERC721 is IERC165 {
/**
* @dev Emitted when `tokenId` token is transferred from `from` to `to`.
*/
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.
*/
event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.
*/
event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
/**
* @dev Returns the number of tokens in ``owner``'s account.
*/
function balanceOf(address owner) external view returns (uint256 balance);
/**
* @dev Returns the owner of the `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function ownerOf(uint256 tokenId) external view returns (address owner);
/**
* @dev Safely transfers `tokenId` token from `from` to `to`.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon
* a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(address from, address to, uint256 tokenId, bytes calldata data) external;
/**
* @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
* are aware of the ERC721 protocol to prevent tokens from being forever locked.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must have been allowed to move this token by either {approve} or
* {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon
* a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(address from, address to, uint256 tokenId) external;
/**
* @dev Transfers `tokenId` token from `from` to `to`.
*
* WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721
* or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must
* understand this adds an external call which potentially creates a reentrancy vulnerability.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
*
* Emits a {Transfer} event.
*/
function transferFrom(address from, address to, uint256 tokenId) external;
/**
* @dev Gives permission to `to` to transfer `tokenId` token to another account.
* The approval is cleared when the token is transferred.
*
* Only a single account can be approved at a time, so approving the zero address clears previous approvals.
*
* Requirements:
*
* - The caller must own the token or be an approved operator.
* - `tokenId` must exist.
*
* Emits an {Approval} event.
*/
function approve(address to, uint256 tokenId) external;
/**
* @dev Approve or remove `operator` as an operator for the caller.
* Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.
*
* Requirements:
*
* - The `operator` cannot be the address zero.
*
* Emits an {ApprovalForAll} event.
*/
function setApprovalForAll(address operator, bool approved) external;
/**
* @dev Returns the account approved for `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function getApproved(uint256 tokenId) external view returns (address operator);
/**
* @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
*
* See {setApprovalForAll}
*/
function isApprovedForAll(address owner, address operator) external view returns (bool);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/Address.sol)
pragma solidity ^0.8.20;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev The ETH balance of the account is not enough to perform the operation.
*/
error AddressInsufficientBalance(address account);
/**
* @dev There's no code at `target` (it is not a contract).
*/
error AddressEmptyCode(address target);
/**
* @dev A call to an address target failed. The target may have reverted.
*/
error FailedInnerCall();
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.8.20/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
if (address(this).balance < amount) {
revert AddressInsufficientBalance(address(this));
}
(bool success, ) = recipient.call{value: amount}("");
if (!success) {
revert FailedInnerCall();
}
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain `call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason or custom error, it is bubbled
* up by this function (like regular Solidity function calls). However, if
* the call reverted with no returned reason, this function reverts with a
* {FailedInnerCall} error.
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*/
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
if (address(this).balance < value) {
revert AddressInsufficientBalance(address(this));
}
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResultFromTarget(target, success, returndata);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResultFromTarget(target, success, returndata);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a delegate call.
*/
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResultFromTarget(target, success, returndata);
}
/**
* @dev Tool to verify that a low level call to smart-contract was successful, and reverts if the target
* was not a contract or bubbling up the revert reason (falling back to {FailedInnerCall}) in case of an
* unsuccessful call.
*/
function verifyCallResultFromTarget(
address target,
bool success,
bytes memory returndata
) internal view returns (bytes memory) {
if (!success) {
_revert(returndata);
} else {
// only check if target is a contract if the call was successful and the return data is empty
// otherwise we already know that it was a contract
if (returndata.length == 0 && target.code.length == 0) {
revert AddressEmptyCode(target);
}
return returndata;
}
}
/**
* @dev Tool to verify that a low level call was successful, and reverts if it wasn't, either by bubbling the
* revert reason or with a default {FailedInnerCall} error.
*/
function verifyCallResult(bool success, bytes memory returndata) internal pure returns (bytes memory) {
if (!success) {
_revert(returndata);
} else {
return returndata;
}
}
/**
* @dev Reverts with returndata if present. Otherwise reverts with {FailedInnerCall}.
*/
function _revert(bytes memory returndata) private pure {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
/// @solidity memory-safe-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert FailedInnerCall();
}
}
}// 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.0.0) (utils/introspection/IERC165.sol)
pragma solidity ^0.8.20;
/**
* @dev Interface of the ERC165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[EIP].
*
* 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[EIP 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: none
pragma solidity 0.8.24;
/**
* @title IERC6551Registry
* @notice The registry is a singleton contract that serves as the entry point for all token bound account address queries.
*/
interface IERC6551Registry {
/**
* @notice The registry MUST emit the ERC6551AccountCreated event upon successful account creation.
*/
event ERC6551AccountCreated(
address account,
address indexed implementation,
bytes32 salt,
uint256 chainId,
address indexed tokenContract,
uint256 indexed tokenId
);
/**
* @notice The registry MUST revert with AccountCreationFailed error if the create2 operation fails.
*/
error AccountCreationFailed();
/**
* @notice Creates a token bound account for a non-fungible token.
*
* If account has already been created, returns the account address without calling create2.
*
* Emits ERC6551AccountCreated event.
*
* @param implementation The address of the implementation contract.
* @param salt Arbitrary value to modify resulting address.
* @param chainId The id of the chain that the tokenContract is deployed on.
* @param tokenContract The address of the nft contract.
* @param tokenId The id of the nft.
* @return account_ The address of the token bound account.
*/
function createAccount(
address implementation,
bytes32 salt,
uint256 chainId,
address tokenContract,
uint256 tokenId
) external returns (address account_);
/**
* @notice Returns the computed token bound account address for a non-fungible token.
* @param implementation The address of the implementation contract.
* @param salt Arbitrary value to modify resulting address.
* @param chainId The id of the chain that the tokenContract is deployed on.
* @param tokenContract The address of the nft contract.
* @param tokenId The id of the nft.
* @return account_ The address of the token bound account.
*/
function account(
address implementation,
bytes32 salt,
uint256 chainId,
address tokenContract,
uint256 tokenId
) external view returns (address account_);
}// SPDX-License-Identifier: MIT
pragma solidity 0.8.24;
interface IUniswapV2Pair {
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
function name() external pure returns (string memory);
function symbol() external pure returns (string memory);
function decimals() external pure returns (uint8);
function totalSupply() external view returns (uint);
function balanceOf(address owner) external view returns (uint);
function allowance(address owner, address spender) external view returns (uint);
function approve(address spender, uint value) external returns (bool);
function transfer(address to, uint value) external returns (bool);
function transferFrom(address from, address to, uint value) external returns (bool);
function DOMAIN_SEPARATOR() external view returns (bytes32);
function PERMIT_TYPEHASH() external pure returns (bytes32);
function nonces(address owner) external view returns (uint);
function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external;
event Mint(address indexed sender, uint amount0, uint amount1);
event Burn(address indexed sender, uint amount0, uint amount1, address indexed to);
event Swap(
address indexed sender,
uint amount0In,
uint amount1In,
uint amount0Out,
uint amount1Out,
address indexed to
);
event Sync(uint112 reserve0, uint112 reserve1);
function MINIMUM_LIQUIDITY() external pure returns (uint);
function factory() external view returns (address);
function token0() external view returns (address);
function token1() external view returns (address);
function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast);
function price0CumulativeLast() external view returns (uint);
function price1CumulativeLast() external view returns (uint);
function kLast() external view returns (uint);
function mint(address to) external returns (uint liquidity);
function burn(address to) external returns (uint amount0, uint amount1);
function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external;
function skim(address to) external;
function sync() external;
function initialize(address, address) external;
}// SPDX-License-Identifier: none
pragma solidity 0.8.24;
/**
* @title IConcentratedLiquidityAgentFactory
* @author AgentFi
* @notice A factory for v3 strategy agents.
*
* Agent operators can use one of the create methods to create a new agent. The agent will be created based on settings stored in the factory by the contract owner. These settings can be viewed via [`getAgentCreationSettings()`](#getagentcreationsettings).
*/
interface IConcentratedLiquidityAgentFactory {
/***************************************
EVENTS
***************************************/
/// @notice Emitted when a new AgentCreationSettings is posted.
event AgentCreationSettingsPosted();
/***************************************
VIEW FUNCTIONS
***************************************/
/**
* @notice Gets the addresses that have been statically set.
*/
function getStaticAddresses() external view returns (
address erc6551Registry_,
address agentRegistry_,
address genesisAgentNft_,
address strategyAgentNft_,
address explorerAgentNft_,
address weth_
);
/**
* @notice Gets the agent creation settings.
*/
function getAgentCreationSettings() external view returns (
address strategyAccountImpl_,
address explorerAccountImpl_,
bytes memory strategyInitializationCall_,
bytes memory explorerInitializationCall_,
bool isActive_
);
/***************************************
CREATE AGENT FUNCTIONS
***************************************/
struct MintBalanceParams {
address manager;
address pool;
uint24 slippageLiquidity;
int24 tickLower;
int24 tickUpper;
uint160 sqrtPriceX96;
}
struct TokenDeposit {
address token;
uint256 amount;
}
/**
* @notice Creates a new V3 strategy agent.
* The new agent will be minted to an existing root agent.
* Can only be called by the owner of the root agent.
* @param mintParams Parameters to use to mint the position.
* @param deposit0 The first token and amount to deposit.
* @param deposit1 The second token and amount to deposit.
* @param rootAgentAddress The address of the root agent to transfer the v3 agent to.
* @return nonfungiblePositionTokenId The ID of the concentrated liquidity position.
* @return strategyAgentID The ID of the newly created strategy agent.
* @return strategyAddress The address of the newly created strategy agent.
*/
function createConcentratedLiquidityAgentForRoot(
MintBalanceParams calldata mintParams,
TokenDeposit calldata deposit0,
TokenDeposit calldata deposit1,
address rootAgentAddress
) external payable returns (
uint256 nonfungiblePositionTokenId,
uint256 strategyAgentID,
address strategyAddress
);
/**
* @notice Creates a new V3 strategy agent.
* The new agent will be minted to a new explorer agent.
* @param mintParams Parameters to use to mint the position.
* @param deposit0 The first token and amount to deposit.
* @param deposit1 The second token and amount to deposit.
* @return nonfungiblePositionTokenId The ID of the concentrated liquidity position.
* @return strategyAgentID The ID of the newly created strategy agent.
* @return strategyAddress The address of the newly created strategy agent.
* @return explorerAgentID The ID of the newly created explorer agent.
* @return explorerAddress The address of the newly created explorer agent.
*/
function createConcentratedLiquidityAgentAndExplorer(
MintBalanceParams calldata mintParams,
TokenDeposit calldata deposit0,
TokenDeposit calldata deposit1
) external payable returns (
uint256 nonfungiblePositionTokenId,
uint256 strategyAgentID,
address strategyAddress,
uint256 explorerAgentID,
address explorerAddress
);
/**
* @notice Creates a new V3 strategy agent.
* The new agent will be minted to an existing root agent.
* Can only be called by the owner of the root agent.
* @param mintParams Parameters to use to mint the position.
* @param deposit0 The first token and amount to deposit.
* @param deposit1 The second token and amount to deposit.
* @param rootAgentAddress The address of the root agent to transfer the v3 agent to.
* @return nonfungiblePositionTokenId The ID of the concentrated liquidity position.
* @return strategyAgentID The ID of the newly created strategy agent.
* @return strategyAddress The address of the newly created strategy agent.
*/
function createConcentratedLiquidityAgentForRootAndRefundExcess(
MintBalanceParams calldata mintParams,
TokenDeposit calldata deposit0,
TokenDeposit calldata deposit1,
address rootAgentAddress
) external payable returns (
uint256 nonfungiblePositionTokenId,
uint256 strategyAgentID,
address strategyAddress
);
/**
* @notice Creates a new V3 strategy agent.
* The new agent will be minted to a new explorer agent.
* @param mintParams Parameters to use to mint the position.
* @param deposit0 The first token and amount to deposit.
* @param deposit1 The second token and amount to deposit.
* @return nonfungiblePositionTokenId The ID of the concentrated liquidity position.
* @return strategyAgentID The ID of the newly created strategy agent.
* @return strategyAddress The address of the newly created strategy agent.
* @return explorerAgentID The ID of the newly created explorer agent.
* @return explorerAddress The address of the newly created explorer agent.
*/
function createConcentratedLiquidityAgentAndExplorerAndRefundExcess(
MintBalanceParams calldata mintParams,
TokenDeposit calldata deposit0,
TokenDeposit calldata deposit1
) external payable returns (
uint256 nonfungiblePositionTokenId,
uint256 strategyAgentID,
address strategyAddress,
uint256 explorerAgentID,
address explorerAddress
);
/**
* @notice Creates a new V3 strategy agent.
* The new agent will be minted to an existing root agent.
* Can only be called by the owner of the root agent.
* @param mintParams Parameters to use to mint the position.
* @param depositLpToken The lp token and amount to migrate.
* @param rootAgentAddress The address of the root agent to transfer the v3 agent to.
* @return nonfungiblePositionTokenId The ID of the concentrated liquidity position.
* @return strategyAgentID The ID of the newly created strategy agent.
* @return strategyAddress The address of the newly created strategy agent.
*/
function createConcentratedLiquidityAgentForRootAndMigrate(
MintBalanceParams calldata mintParams,
TokenDeposit calldata depositLpToken,
address rootAgentAddress
) external payable returns (
uint256 nonfungiblePositionTokenId,
uint256 strategyAgentID,
address strategyAddress
);
/**
* @notice Creates a new V3 strategy agent.
* The new agent will be minted to a new explorer agent.
* @param mintParams Parameters to use to mint the position.
* @param depositLpToken The lp token and amount to migrate.
* @return nonfungiblePositionTokenId The ID of the concentrated liquidity position.
* @return strategyAgentID The ID of the newly created strategy agent.
* @return strategyAddress The address of the newly created strategy agent.
* @return explorerAgentID The ID of the newly created explorer agent.
* @return explorerAddress The address of the newly created explorer agent.
*/
function createConcentratedLiquidityAgentAndExplorerAndMigrate(
MintBalanceParams calldata mintParams,
TokenDeposit calldata depositLpToken
) external payable returns (
uint256 nonfungiblePositionTokenId,
uint256 strategyAgentID,
address strategyAddress,
uint256 explorerAgentID,
address explorerAddress
);
/**
* @notice Creates a new V3 strategy agent.
* The new agent will be minted to an existing root agent.
* Can only be called by the owner of the root agent.
* @param mintParams Parameters to use to mint the position.
* @param depositLpToken The lp token and amount to migrate.
* @param rootAgentAddress The address of the root agent to transfer the v3 agent to.
* @return nonfungiblePositionTokenId The ID of the concentrated liquidity position.
* @return strategyAgentID The ID of the newly created strategy agent.
* @return strategyAddress The address of the newly created strategy agent.
*/
function createConcentratedLiquidityAgentForRootAndMigrateWithPermit(
MintBalanceParams calldata mintParams,
TokenDeposit calldata depositLpToken,
address rootAgentAddress,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) external payable returns (
uint256 nonfungiblePositionTokenId,
uint256 strategyAgentID,
address strategyAddress
);
/**
* @notice Creates a new V3 strategy agent.
* The new agent will be minted to a new explorer agent.
* @param mintParams Parameters to use to mint the position.
* @param depositLpToken The lp token and amount to migrate.
* @return nonfungiblePositionTokenId The ID of the concentrated liquidity position.
* @return strategyAgentID The ID of the newly created strategy agent.
* @return strategyAddress The address of the newly created strategy agent.
* @return explorerAgentID The ID of the newly created explorer agent.
* @return explorerAddress The address of the newly created explorer agent.
*/
function createConcentratedLiquidityAgentAndExplorerAndMigrateWithPermit(
MintBalanceParams calldata mintParams,
TokenDeposit calldata depositLpToken,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) external payable returns (
uint256 nonfungiblePositionTokenId,
uint256 strategyAgentID,
address strategyAddress,
uint256 explorerAgentID,
address explorerAddress
);
/***************************************
OWNER FUNCTIONS
***************************************/
struct AgentCreationSettings {
address strategyAccountImpl;
address explorerAccountImpl;
bytes strategyInitializationCall;
bytes explorerInitializationCall;
bool isActive;
}
/**
* @notice Posts a new AgentCreationSettings.
* Can only be called by the contract owner.
*/
function postAgentCreationSettings(
AgentCreationSettings calldata creationSettings
) external payable;
}// SPDX-License-Identifier: none
pragma solidity 0.8.24;
/**
* @title IConcentratedLiquidityModuleC
* @author AgentFi
* @notice A module used in the Concentrated liquidity strategy.
* @dev Designed for use on Blast Mainnet only
*/
interface IConcentratedLiquidityModuleC {
/***************************************
VIEW FUNCTIONS
***************************************/
function moduleName() external pure returns (string memory name_);
function strategyType() external pure returns (string memory type_);
/// @notice Address for the NonfungiblePositionManager
function manager() external view returns (address manager_);
function pool() external view returns (address pool_);
function slot0()
external
view
returns (
uint160 sqrtPriceX96,
int24 tick,
uint16 observationIndex,
uint16 observationCardinality,
uint16 observationCardinalityNext,
uint8 feeProtocol,
bool unlocked
);
/// @notice TokenId of NFT position (if exists)
function tokenId() external view returns (uint256 tokenId_);
/***************************************
Wrapper functions around NonfungiblePositionManager
***************************************/
/**
* @notice Get the underlying pool position
* @dev reverts if no position exists
*/
function position()
external
view
returns (
uint96 nonce,
address operator,
address token0,
address token1,
uint24 fee,
int24 tickLower,
int24 tickUpper,
uint128 liquidity,
uint256 feeGrowthInside0LastX128,
uint256 feeGrowthInside1LastX128,
uint128 tokensOwed0,
uint128 tokensOwed1
);
struct MintParams {
address manager;
address pool;
address token0;
address token1;
uint24 fee;
int24 tickLower;
int24 tickUpper;
uint256 amount0Desired;
uint256 amount1Desired;
uint256 amount0Min;
uint256 amount1Min;
uint256 deadline;
}
/// @notice Creates a new position wrapped in a NFT
/// @dev Call this when the pool does exist and is initialized. Note that if the pool is created but not initialized
/// a method does not exist, i.e. the pool is assumed to be initialized.
/// @param params The params necessary to mint a position, encoded as `MintParams` in calldata
/// @return tokenId_ The ID of the token that represents the minted position
/// @return liquidity The amount of liquidity for this position
/// @return amount0 The amount of token0
/// @return amount1 The amount of token1
function moduleC_mint(
MintParams memory params
) external payable returns (uint256 tokenId_, uint128 liquidity, uint256 amount0, uint256 amount1);
// As INonfungiblePositionManager.IncreaseLiquiditParams, but without tokenId
struct IncreaseLiquidityParams {
uint256 amount0Desired;
uint256 amount1Desired;
uint256 amount0Min;
uint256 amount1Min;
uint256 deadline;
}
/// @notice Increases the amount of liquidity in a position, with tokens paid by the `msg.sender`
/// amount0Desired The desired amount of token0 to be spent,
/// amount1Desired The desired amount of token1 to be spent,
/// amount0Min The minimum amount of token0 to spend, which serves as a slippage check,
/// amount1Min The minimum amount of token1 to spend, which serves as a slippage check,
/// deadline The time by which the transaction must be included to effect the change
/// @return liquidity The new liquidity amount as a result of the increase
/// @return amount0 The amount of token0 to acheive resulting liquidity
/// @return amount1 The amount of token1 to acheive resulting liquidity
function moduleC_increaseLiquidity(
IncreaseLiquidityParams memory params
) external payable returns (uint128 liquidity, uint256 amount0, uint256 amount1);
// As INonfungiblePositionManager.DecreaseLiquiditParams, but without tokenId
struct DecreaseLiquidityParams {
uint128 liquidity;
uint256 amount0Min;
uint256 amount1Min;
uint256 deadline;
}
function moduleC_decreaseLiquidity(
DecreaseLiquidityParams memory params
) external payable returns (uint256 amount0, uint256 amount1);
// As INonfungiblePositionManager.CollectParams, but without tokenId and recipient
struct CollectParams {
uint128 amount0Max;
uint128 amount1Max;
}
function moduleC_collect(
CollectParams memory params
) external payable returns (uint256 amount0, uint256 amount1);
function moduleC_burn() external payable;
struct ExactInputSingleParams {
address tokenIn;
address tokenOut;
uint24 fee;
uint256 deadline;
uint256 amountIn;
uint256 amountOutMinimum;
uint160 sqrtPriceLimitX96;
}
/// @notice Swaps `amountIn` of one token for as much as possible of another token
/// @param params The parameters necessary for the swap, encoded as `ExactInputSingleParams` in calldata
/// @return amountOut The amount of the received token
function moduleC_exactInputSingle(
address router,
ExactInputSingleParams memory params
) external payable returns (uint256 amountOut);
struct ExactInputSingle02Params {
address tokenIn;
address tokenOut;
uint24 fee;
uint256 amountIn;
uint256 amountOutMinimum;
uint160 sqrtPriceLimitX96;
}
/// @notice Swaps `amountIn` of one token for as much as possible of another token
/// @param params The parameters necessary for the swap, encoded as `ExactInputSingleParams` in calldata
/// @return amountOut The amount of the received token
function moduleC_exactInputSingle02(
address router,
ExactInputSingle02Params memory params
) external payable returns (uint256 amountOut);
/***************************************
AGENT HIGH LEVEL FUNCTIONS
***************************************/
/// @notice Sends token balance to a specified receiver.
function moduleC_sendBalanceTo(address receiver) external payable;
struct MintBalanceParams {
address manager;
address pool;
uint24 slippageLiquidity;
int24 tickLower;
int24 tickUpper;
uint160 sqrtPriceX96;
}
/// @notice Mints new position with all assets in this contract
function moduleC_mintWithBalance(
MintBalanceParams memory params
) external payable returns (uint256, uint128, uint256, uint256);
struct MintBalanceAndRefundParams {
address manager;
address pool;
uint24 slippageLiquidity;
int24 tickLower;
int24 tickUpper;
uint160 sqrtPriceX96;
address receiver;
}
/// @notice Mints new position with all assets in this contract
function moduleC_mintWithBalanceAndRefundTo(
MintBalanceAndRefundParams memory params
) external payable returns (uint256 tokenId_, uint128 liquidity, uint256 amount0, uint256 amount1);
/// @notice Deposit all assets in contract to existing position (does not change range)
function moduleC_increaseLiquidityWithBalance(
uint160 sqrtPriceX96,
uint24 slippageLiquidity
) external payable returns (uint128 liquidity, uint256 amount0, uint256 amount1);
function moduleC_increaseLiquidityWithBalanceAndRefundTo(
address receiver,
uint160 sqrtPriceX96,
uint24 slippageLiquidity
) external payable returns (uint128 liquidity, uint256 amount0, uint256 amount1);
/// @notice Collect tokens owned in position, keeping funds in the this contract
function moduleC_collectToSelf() external payable returns (uint256, uint256);
/// @notice Perform partial withdrawal, keeping funds in the this contract
function moduleC_decreaseLiquidityWithSlippage(
uint128 liquidity,
uint160 sqrtPriceX96,
uint24 slippageLiquidity
) external payable returns (uint256, uint256);
function moduleC_partialWithdrawalToSelf(
uint128 liquidity,
uint160 sqrtPriceX96,
uint24 slippageLiquidity
) external payable returns (uint256, uint256);
/// @notice Withdrawals principal and fee, and burns position, returning the funds to this contract
function moduleC_fullWithdrawToSelf(
uint160 sqrtPriceX96,
uint24 slippageLiquidity
) external payable returns (uint256 amount0, uint256 amount1);
/// @notice Collect tokens owned in position, sending funds to the receiver
function moduleC_collectTo(address receiver) external payable;
/// @notice Perform partial withdrawal, sending funds to the receiver
function moduleC_partialWithdrawTo(
address receiver,
uint128 liquidity,
uint160 sqrtPriceX96,
uint24 slippageLiquidity
) external payable;
/// @notice Sends funds to receiver after withdrawaling position
function moduleC_fullWithdrawTo(address receiver, uint160 sqrtPriceX96, uint24 slippageLiquidity) external payable;
struct RebalanceParams {
address router; // Address of router contract
uint24 fee; // Fee pool to use
uint24 slippageSwap; // slippageSwap to tolerate
uint24 slippageLiquidity; // slippageSwap to tolerate
int24 tickLower;
int24 tickUpper;
uint160 sqrtPriceX96;
}
/// @notice Withdrawals, swaps and creates a new position at the new range
function moduleC_rebalance(RebalanceParams memory params) external payable;
/// @notice Withdrawals, swaps and creates a new position at the new range
function moduleC_rebalance02(RebalanceParams memory params) external payable;
/***************************************
INTERNAL FUNCTIONS
***************************************/
/// @notice Perform a swap of tokens
struct PerformSwapParams {
address router;
address tokenIn;
address tokenOut;
uint256 amountIn;
uint160 sqrtPriceX96;
uint24 slippageSwap;
uint24 fee;
}
}// SPDX-License-Identifier: none
pragma solidity 0.8.24;
import { IERC721Enumerable } from "@openzeppelin/contracts/token/ERC721/extensions/IERC721Enumerable.sol";
/**
* @title IBlastooorStrategyAgents
* @author AgentFi
* @notice The Blastooor Strategy ERC721 token contract. Creates new agents and manages ownership of agents in the AgentFi protocol.
*
* Each agent is represented as an NFT. The owner of the NFT is the owner of the agent. Transferring the NFT means transferring the agent and its contents.
*
* Each agent is also a smart contract account. The account is created at the same time the agent is created. Ownership of the account is delegated to the owner of the NFT using ERC6551 Token Bound Accounts.
*
* Agents can be created via [`createAgent()`](#createagent). Only whitelisted accounts may create agents - these may be any address, but are designed to be smart contracts called factories. This ERC721 contract manages the creation and registration of agents. The factory contract handles any additional logic - verifying implementation, initializing the agent, etc. A user that wants to create an agent should call a factory contract, which in turn calls this contract.
*
* The list of factories can be queried via [`factoryIsWhitelisted()`](#factoryiswhitelisted) and maintained by the contract owner via [`setWhitelist()`](#setwhitelist).
*
* Agents are ERC721s with the enumerable, metadata, and exists extensions. Info about the associated TBAs is stored in another contract.
*/
interface IBlastooorStrategyAgents is IERC721Enumerable {
/// @notice Emitted when a factory is whitelisted or blacklisted.
event FactoryWhitelisted(address indexed factory, bool wasWhitelisted);
/// @notice Emitted when the base URI is set.
event BaseURISet(string baseURI);
/// @notice Emitted when the contract URI is set.
event ContractURISet(string contractURI);
/***************************************
VIEW FUNCTIONS
***************************************/
/**
* @notice Returns true if the agent exists.
* @param agentID The ID of the agent to query.
* @return status True if the agent exists, false otherwise.
*/
function exists(uint256 agentID) external view returns (bool status);
/***************************************
CREATE AGENT FUNCTIONS
***************************************/
/**
* @notice Creates a new agent.
* @dev The new agent will be minted to `msg.sender`. This function is designed to be called from another contract to perform additional setup.
* @return agentID The ID of the newly created agent.
*/
function createAgent() external payable returns (uint256 agentID);
/***************************************
WHITELIST FUNCTIONS
***************************************/
/**
* @notice Returns true if the factory has been whitelisted.
* All addresses are whitelisted if address zero is whitelisted.
* @param factory The address of the factory to query.
* @return isWhitelisted True if the factory has been whitelisted, false otherwise.
*/
function factoryIsWhitelisted(address factory) external view returns (bool isWhitelisted);
struct SetWhitelistParam {
address factory;
bool shouldWhitelist;
}
/**
* @notice Adds or removes factories to the whitelist.
* Can only be called by the contract owner.
* @param params The list of factories and if they should be whitelisted or blacklisted.
*/
function setWhitelist(SetWhitelistParam[] memory params) external payable;
/***************************************
METADATA FUNCTIONS
***************************************/
/**
* @notice Returns the base URI for computing tokenURI.
* @return uri The base URI.
*/
function baseURI() external view returns (string memory uri);
/**
* @notice Sets the base URI for computing tokenURI.
* Can only be called by the contract owner.
* @param uri The new base URI.
*/
function setBaseURI(string calldata uri) external payable;
/**
* @notice Returns the contract URI.
* @return uri The contract URI.
*/
function contractURI() external view returns (string memory uri);
/**
* @notice Sets the contract URI.
* Can only be called by the contract owner.
* @param uri The new contract URI.
*/
function setContractURI(string calldata uri) external payable;
}// SPDX-License-Identifier: none
pragma solidity 0.8.24;
import { IERC721Enumerable } from "@openzeppelin/contracts/token/ERC721/extensions/IERC721Enumerable.sol";
/**
* @title IExplorerAgents
* @author AgentFi
* @notice The Explorers ERC721 token contract. Creates new agents and manages ownership of agents in the AgentFi protocol.
*
* Each agent is represented as an NFT. The owner of the NFT is the owner of the agent. Transferring the NFT means transferring the agent and its contents.
*
* Each agent is also a smart contract account. The account is created at the same time the agent is created. Ownership of the account is delegated to the owner of the NFT using ERC6551 Token Bound Accounts.
*
* Agents can be created via [`createAgent()`](#createagent). Only whitelisted accounts may create agents - these may be any address, but are designed to be smart contracts called factories. This ERC721 contract manages the creation and registration of agents. The factory contract handles any additional logic - verifying implementation, initializing the agent, etc. A user that wants to create an agent should call a factory contract, which in turn calls this contract.
*
* The list of factories can be queried via [`factoryIsWhitelisted()`](#factoryiswhitelisted) and maintained by the contract owner via [`setWhitelist()`](#setwhitelist).
*
* Agents are ERC721s with the enumerable, metadata, and exists extensions. Info about the associated TBAs is stored in another contract.
*/
interface IExplorerAgents is IERC721Enumerable {
/// @notice Emitted when a factory is whitelisted or blacklisted.
event FactoryWhitelisted(address indexed factory, bool wasWhitelisted);
/// @notice Emitted when the base URI is set.
event BaseURISet(string baseURI);
/// @notice Emitted when the contract URI is set.
event ContractURISet(string contractURI);
/***************************************
VIEW FUNCTIONS
***************************************/
/**
* @notice Returns true if the agent exists.
* @param agentID The ID of the agent to query.
* @return status True if the agent exists, false otherwise.
*/
function exists(uint256 agentID) external view returns (bool status);
/***************************************
CREATE AGENT FUNCTIONS
***************************************/
/**
* @notice Creates a new agent.
* @dev The new agent will be minted to `msg.sender`. This function is designed to be called from another contract to perform additional setup.
* @return agentID The ID of the newly created agent.
*/
function createAgent() external payable returns (uint256 agentID);
/***************************************
WHITELIST FUNCTIONS
***************************************/
/**
* @notice Returns true if the factory has been whitelisted.
* All addresses are whitelisted if address zero is whitelisted.
* @param factory The address of the factory to query.
* @return isWhitelisted True if the factory has been whitelisted, false otherwise.
*/
function factoryIsWhitelisted(address factory) external view returns (bool isWhitelisted);
struct SetWhitelistParam {
address factory;
bool shouldWhitelist;
}
/**
* @notice Adds or removes factories to the whitelist.
* Can only be called by the contract owner.
* @param params The list of factories and if they should be whitelisted or blacklisted.
*/
function setWhitelist(SetWhitelistParam[] memory params) external payable;
/***************************************
METADATA FUNCTIONS
***************************************/
/**
* @notice Returns the base URI for computing tokenURI.
* @return uri The base URI.
*/
function baseURI() external view returns (string memory uri);
/**
* @notice Sets the base URI for computing tokenURI.
* Can only be called by the contract owner.
* @param uri The new base URI.
*/
function setBaseURI(string calldata uri) external payable;
/**
* @notice Returns the contract URI.
* @return uri The contract URI.
*/
function contractURI() external view returns (string memory uri);
/**
* @notice Sets the contract URI.
* Can only be called by the contract owner.
* @param uri The new contract URI.
*/
function setContractURI(string calldata uri) external payable;
}// SPDX-License-Identifier: none
pragma solidity 0.8.24;
/**
* @title IAgentRegistry
* @author AgentFi
* @notice Tracks Agents, NFTs, and TBAs in the AgentFi ecosystem.
*
* Does NOT replace the ERC6551Registry, merely an enumeration on top of it.
*/
interface IAgentRegistry {
/***************************************
STATE VARIABLES
***************************************/
/// @notice Emitted when an operator is added or removed.
event OperatorSet(address indexed account, bool isOperator);
/// @notice Emitted when an agent is registered.
event AgentRegistered(address indexed agentAddress, address indexed collection, uint256 indexed agentID);
struct AgentInfo {
address agentAddress;
address implementationAddress;
}
struct TokenInfo {
address collection;
uint256 agentID;
}
/***************************************
VIEW FUNCTIONS
***************************************/
/**
* @notice Returns true if the account is an operator.
* @param account The account to query.
* @return isAuthorized True if is an operator, false otherwise.
*/
function isOperator(address account) external view returns (bool isAuthorized);
/**
* @notice Returns the list of known agent TBAs for an agent NFT.
* @param collection The address of the collection to query.
* @param agentID The ID of the agent to query.
* @return tbas The list of registered TBAs for this agent.
*/
function getTbasOfNft(address collection, uint256 agentID) external view returns (AgentInfo[] memory tbas);
/**
* @notice Returns the NFT associated with an agent TBA.
* Returns zeros if not registered.
* @param tba The address of the TBA to query.
* @return collection The address of the NFT collection.
* @return agentID The ID of the agent.
*/
function getNftOfTba(address tba) external view returns (address collection, uint256 agentID);
/**
* @notice Returns true if the TBA is known.
* @param tba The address of the TBA to query.
* @return isRegistered True if the agent is registerd, false otherwise.
*/
function isTbaRegisteredAgent(address tba) external view returns (bool isRegistered);
/***************************************
OPERATOR FUNCTIONS
***************************************/
struct RegisterAgentParam {
address agentAddress;
address implementationAddress;
address collection;
uint256 agentID;
}
/**
* @notice Registers a new agent.
* Can only be called by an operator.
* @param params The agent to register.
*/
function registerAgent(RegisterAgentParam calldata params) external payable;
/**
* @notice Registers a new agent. Fails gracefully if the agent has already been registered.
* Can only be called by an operator.
* @param params The agent to register.
*/
function tryRegisterAgent(RegisterAgentParam calldata params) external payable;
/**
* @notice Registers a list of new agents.
* Can only be called by an operator.
* @param params The agents to register.
*/
function registerAgents(RegisterAgentParam[] calldata params) external payable;
/**
* @notice Registers a list of new agents. Fails gracefully if the agent has already been registered.
* Can only be called by an operator.
* @param params The agents to register.
*/
function tryRegisterAgents(RegisterAgentParam[] calldata params) external payable;
/***************************************
OWNER FUNCTIONS
***************************************/
struct SetOperatorParam {
address account;
bool isAuthorized;
}
/**
* @notice Sets the status of a list of operators.
* Can only be called by the contract owner.
* @param params The list to set.
*/
function setOperators(SetOperatorParam[] calldata params) external payable;
}// SPDX-License-Identifier: none
pragma solidity 0.8.24;
/**
* @title IBlastable
* @author AgentFi
* @notice An abstract contract that configures the connection to Blast during deployment
*
* This involves collecting ETH yield, gas rewards, and Blast Points. ETH yield is earned by this contract automatically, while gas rewards and Blast Points are delegated to dedicated collectors.
*/
interface IBlastable {
/**
* @notice Returns the address of the Blast contract.
* @return blast_ The adress of the Blast contract.
*/
function blast() external view returns (address blast_);
/**
* @notice Returns the address of the BlastPoints contract.
* @return blastPoints_ The adress of the BlastPoints contract.
*/
function blastPoints() external view returns (address blastPoints_);
}// SPDX-License-Identifier: none
pragma solidity 0.8.24;
/**
* @title IMulticallableERC2771Context
* @author AgentFi
* @notice An extension to ERC2771Context that also allows for self `multicall()`.
*
* Separately these two standards are safe. The combination of the two can cause an address spoofing vulnerability if not implemented properly.
*
* If your contract has the two (extends both Multicall and ERC2771Context) then inherit this contract instead.
*/
interface IMulticallableERC2771Context {
/***************************************
MULTICALL
***************************************/
/**
* @notice Receives and executes a batch of function calls on this contract.
* @param data A list of function calls to execute.
* @return results The results of each function call.
*/
function multicall(bytes[] calldata data) external returns (bytes[] memory results);
}// SPDX-License-Identifier: none
pragma solidity 0.8.24;
/**
* @title IOwnable2Step
* @author AgentFi
* @notice An abstract contract that provides a basic access control system through ERC173.
*/
interface IOwnable2Step {
/***************************************
EVENTS
***************************************/
/// @notice Emitted when the contract ownership process is started.
event OwnershipTransferStarted(address indexed previousOwner, address indexed newOwner);
/// @notice Emitted when the contract ownership process is completed.
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/***************************************
VIEW FUNCTIONS
***************************************/
/**
* @notice Returns the address of the current owner.
* @return owner_ The current owner.
*/
function owner() external view returns (address owner_);
/**
* @notice Returns the address of the pending owner.
* @return pendingOwner_ The pending owner.
*/
function pendingOwner() external view returns (address pendingOwner_);
/***************************************
MUTATOR FUNCTIONS
***************************************/
/**
* @notice Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby disabling any functionality that is only available to the owner.
*/
function renounceOwnership() external payable;
/**
* @notice Starts the ownership transfer of the contract to a new account. Replaces the pending transfer if there is one.
* Can only be called by the current owner.
* @param newOwner The address of the new owner.
*/
function transferOwnership(address newOwner) external payable;
/**
* @notice Completes the ownership transfer of the contract to the new account.
* Can only be called by the pending owner.
*/
function acceptOwnership() external payable;
/***************************************
TOKEN BALANCE FUNCTIONS
***************************************/
/**
* @notice Rescues tokens that may have been accidentally transferred in.
* Can only be called by the contract owner.
* @dev If the inheriting contract requires tokens in the contract, overwrite this with a revert.
* @param receiver The receiver of the rescued tokens.
* @param tokens The tokens to rescue. Can be ETH or ERC20s.
*/
function sweep(address receiver, address[] calldata tokens) external payable;
}// SPDX-License-Identifier: none
pragma solidity 0.8.24;
import { Errors } from "./Errors.sol";
/**
* @title Calls
* @author AgentFi
* @notice A library for safely making low level calls.
*/
library Calls {
/**
* @notice Safely transfers the gas token using a low level `call`.
* @dev If `target` reverts with a revert reason, it is bubbled up by this function.
* @param target The address of the contract to `call`.
* @return result The result of the function call.
*/
function sendValue(
address target,
uint256 value
) internal returns (bytes memory result) {
if (address(this).balance < value) {
revert Errors.InsufficientBalance();
}
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.call{value:value}("");
if(success) {
result = returndata;
} else {
// look for revert reason and bubble it up if present
if(returndata.length > 0) {
// the easiest way to bubble the revert reason is using memory via assembly
// solhint-disable-next-line no-inline-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert Errors.CallFailed();
}
}
}
/**
* @notice Safely performs a Solidity function call using a low level `call`.
* @dev If `target` reverts with a revert reason, it is bubbled up by this function.
* @param target The address of the contract to `delegatecall`.
* @param data The data to pass to the target.
* @return result The result of the function call.
*/
function functionCall(
address target,
bytes memory data
) internal returns (bytes memory result) {
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.call(data);
if(success) {
result = returndata;
} else {
// look for revert reason and bubble it up if present
if(returndata.length > 0) {
// the easiest way to bubble the revert reason is using memory via assembly
// solhint-disable-next-line no-inline-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert Errors.CallFailed();
}
}
}
/**
* @notice Safely performs a Solidity function call using a low level `call`.
* @dev If `target` reverts with a revert reason, it is bubbled up by this function.
* @param target The address of the contract to `delegatecall`.
* @param data The data to pass to the target.
* @return result The result of the function call.
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value
) internal returns (bytes memory result) {
if (address(this).balance < value) {
revert Errors.InsufficientBalance();
}
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.call{value:value}(data);
if(success) {
result = returndata;
} else {
// look for revert reason and bubble it up if present
if(returndata.length > 0) {
// the easiest way to bubble the revert reason is using memory via assembly
// solhint-disable-next-line no-inline-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert Errors.CallFailed();
}
}
}
/**
* @notice Safely performs a Solidity function call using a low level `delegatecall`.
* @dev If `target` reverts with a revert reason, it is bubbled up by this function.
* @param target The address of the contract to `delegatecall`.
* @param data The data to pass to the target.
* @return result The result of the function call.
*/
function functionDelegateCall(
address target,
bytes memory data
) internal returns (bytes memory result) {
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.delegatecall(data);
if(success) {
result = returndata;
} else {
// look for revert reason and bubble it up if present
if(returndata.length > 0) {
// the easiest way to bubble the revert reason is using memory via assembly
// solhint-disable-next-line no-inline-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert Errors.DelegateCallFailed();
}
}
}
/**
* @notice Verify that an address has contract code, otherwise reverts.
* @param target The address to verify.
*/
function verifyHasCode(
address target
) internal view {
// checks
uint256 contractSize;
// solhint-disable-next-line no-inline-assembly
assembly {
contractSize := extcodesize(target)
}
if(contractSize == 0) revert Errors.NotAContract();
}
}// SPDX-License-Identifier: none
pragma solidity 0.8.24;
/**
* @title Errors
* @author AgentFi
* @notice A library of custom error types used in BOOM!.
*/
library Errors {
// call errors
/// @notice Thrown when a low level call reverts without a reason.
error CallFailed();
/// @notice Thrown when a low level delegatecall reverts without a reason.
error DelegateCallFailed();
/// @notice Thrown if the owner tries to execute an operation that is not a call.
error OnlyCallsAllowed();
/// @notice Thrown when a function should not be delegatecalled.
error NoDelegateCall();
/// @notice Thrown when using an address with no code.
error NotAContract();
/// @notice Thrown when a contract deployment fails.
error ContractNotDeployed();
/// @notice Thrown when the sender has an insufficient balance of the token they are sending.
error InsufficientBalance();
// ownership & authentication errors
/// @notice Thrown when calling a function reserved for the contract owner.
error NotContractOwner();
/// @notice Thrown when calling a function reserved for the pending contract owner.
error NotPendingContractOwner();
/// @notice Thrown when calling a function reserved for the owner of a erc6551 account.
error ERC6551InvalidSigner();
/// @notice Thrown when attempting a function reserved for the owner of the agent.
error NotOwnerOfAgent();
/// @notice Thrown when a signature is invalid.
error InvalidSignature();
// generic input errors
/// @notice Thrown when address zero is used where it should not be.
error AddressZero();
/// @notice Thrown when a nonzero address is used where the zero address is expected
error AddressNotZero();
/// @notice Thrown when an address is used where it should not be.
//error AddressIllegal();
/// @notice Thrown when a zero amount used where it should not be.
error AmountZero();
/// @notice Thrown when the number of elements in an array is not what was expected.
error LengthMismatch();
/// @notice Thrown when receiving an array of length zero.
error LengthZero();
/// @notice Thrown when looking up a name that is unknown.
error UnknownName();
/// @notice Thrown when accessing an element that is out of range.
error OutOfRange();
/// @notice Thrown when gas token values do not match.
error ValueMismatch();
/// @notice Thrown when an entry has already been registered.
error AlreadyRegistered();
// execution errors
/// @notice Thrown when a call reenters illegally.
error ReentrancyGuard();
/// @notice Thrown when attempting to initialize a contract that has already been initialized.
error AlreadyInitialized();
// nft errors
/// @notice Thrown when querying an agent that does not exist.
error AgentDoesNotExist();
/// @notice Thrown when transferring an agent nft to the agent account.
error OwnershipCycle();
/// @notice Thrown when referrencing an account that is not an agent.
error NotAnAgent();
// agent creation errors
/// @notice Thrown when attempting to create an agent from an account that is not whitelisted.
error FactoryNotWhitelisted();
/// @notice Thrown when call a contract that has been paused.
error ContractPaused();
/// @notice Thrown when using a factory and a creation settings that has been paused.
error CreationSettingsPaused();
/// @notice Thrown when minting an nft over the max total supply.
error OverMaxSupply();
/// @notice Thrown when minting an nft over the max public mint.
error OverMaxPublicMint();
/// @notice Thrown when minting an nft but the mint has not been started.
error MintNotStarted();
/// @notice Thrown when minting via the allowlist but the period has ended.
error AllowlistMintEnded();
/// @notice Thrown when minting too many agents at once.
error OverMaxMintPerTx();
/// @notice Thrown when minting an nft over the max allowlist mint total.
error OverMaxAllowlistMintTotal();
/// @notice Thrown when minting an nft over the max allowlist mint per user.
error OverMaxAllowlistMintPerAccount();
/// @notice Thrown when minting from the treasury allocation before treasury mint starts.
error TreasuryMintNotStarted();
/// @notice Thrown when not paying enough to mint an nft.
error InsufficientPayment();
/// @notice Thrown when minting from the treasury allocation without approval.
error NotTreasuryMinter();
/// @notice Thrown when minting more agents than allowed per user.
error OverMaxCreationsPerUser();
/// @notice Thrown when minting more agents than allowed per agent.
error OverMaxCreationsPerAgent();
// erc2535 errors
/// @notice Thrown when installing a function that is already installed.
error AddFunctionDuplicate();
/// @notice Thrown when replacing a function with itself.
error ReplaceFunctionSame();
/// @notice Thrown when removing a function that has not currently installed.
error RemoveFunctionDoesNotExist();
/// @notice Thrown when removing a function that cannot be removed.
error RemoveFunctionImmutable();
/// @notice Thrown when calling a function that does not exist in this contract.
error FunctionDoesNotExist();
/// @notice Thrown when attempting to install a module that is not whitelisted.
error ModuleNotWhitelisted();
// quoter errors
/// @notice Thrown when failing to decode an error message.
error UnknownError();
/// @notice Thrown when a revert was intentionally thrown in order to return a value.
error RevertForAmount(uint256 amount);
/// @notice Thrown when calling a function on a proxy that should only be called on the implementation.
error NotImplementation();
/// @notice Thrown when calling a function on an implementation contract that can only be called by the gas collector.
error NotGasCollector();
/// @notice Thrown when trying to mint without the minter role.
error NotMinter();
/// @notice Thrown when calling the dispatcher without the operator role.
error NotOperator();
// erc6551 errors
error InvalidOperation();
error ContractCreationFailed();
error NotAuthorized();
error InvalidInput();
error ExceedsMaxLockTime();
error AccountLocked();
error InvalidAccountProof();
error InvalidGuardian();
error InvalidImplementation();
//error AlreadyInitialized();
error InvalidEntryPoint();
error InvalidMulticallForwarder();
error InvalidERC6551Registry();
error InvalidSender();
//ModuleC Errors
error PositionAlreadyExists(); // Throw if trying to create a position, but one exists
error NoPositionFound(); // Throw if trying to operate on a position, but none exists
error InvalidTickParam(); // Throw if tick params is invalid
error InvalidSlippageParam(); // Throw if slippage params is invalid
error InvalidManagerParam(); // Throw if nfp manager param is invalid
// ModuleD errors
/// @notice Thrown when creating an agent with an invalid mode.
error InvalidMode();
// processing errors
/// @notice Thrown when processing an empty queue.
error NoMoreItemsInQueue();
}// SPDX-License-Identifier: none
pragma solidity 0.8.24;
import { IBlastable } from "./../interfaces/utils/IBlastable.sol";
/**
* @title Blastable
* @author AgentFi
* @notice An abstract contract that configures the connection to Blast during deployment
*
* This involves collecting ETH yield, gas rewards, and Blast Points. ETH yield is earned by this contract automatically, while gas rewards and Blast Points are delegated to dedicated collectors.
*/
abstract contract Blastable is IBlastable {
address internal immutable __blast;
address internal immutable __gasCollector;
address internal immutable __blastPoints;
address internal immutable __pointsOperator;
/**
* @notice Constructs the Blastable contract.
* Configures the contract to receive automatic yield, claimable gas, and assigns a gas collector.
* @param blast_ The address of the blast gas reward contract.
* @param gasCollector_ The address of the gas collector.
* @param blastPoints_ The address of the blast points contract.
* @param pointsOperator_ The address of the blast points operator.
*/
constructor(
address blast_,
address gasCollector_,
address blastPoints_,
address pointsOperator_
) {
__blast = blast_;
__gasCollector = gasCollector_;
__blastPoints = blastPoints_;
__pointsOperator = pointsOperator_;
// allow these calls to fail on local fork
// check success after deployment
blast_.call(abi.encodeWithSignature("configureAutomaticYield()"));
blast_.call(abi.encodeWithSignature("configureClaimableGas()"));
if(gasCollector_ != address(0)) blast_.call(abi.encodeWithSignature("configureGovernor(address)", gasCollector_));
if(pointsOperator_ != address(0)) blastPoints_.call(abi.encodeWithSignature("configurePointsOperator(address)", pointsOperator_));
}
/**
* @notice Returns the address of the Blast contract.
* @return blast_ The adress of the Blast contract.
*/
function blast() public view override returns (address blast_) {
blast_ = __blast;
}
/**
* @notice Returns the address of the BlastPoints contract.
* @return blastPoints_ The adress of the BlastPoints contract.
*/
function blastPoints() public view override returns (address blastPoints_) {
blastPoints_ = __blastPoints;
}
/**
* @notice Allows this contract to receive the gas token.
*/
// solhint-disable-next-line no-empty-blocks
receive() external payable virtual {}
}// SPDX-License-Identifier: MIT
pragma solidity 0.8.24;
import { ERC2771Context } from "@openzeppelin/contracts/metatx/ERC2771Context.sol";
import { Calls } from "./../libraries/Calls.sol";
import { IMulticallableERC2771Context } from "./../interfaces/utils/IMulticallableERC2771Context.sol";
/**
* @title MulticallableERC2771Context
* @author AgentFi
* @notice An extension to ERC2771Context that also allows for self `multicall()`.
*
* Separately these two standards are safe. The combination of the two can cause an address spoofing vulnerability if not implemented properly.
*
* If your contract has the two (extends both Multicall and ERC2771Context) then inherit this contract instead.
*/
abstract contract MulticallableERC2771Context is ERC2771Context, IMulticallableERC2771Context {
/***************************************
CONSTRUCTOR
***************************************/
/**
* @notice Initializes the contract with a trusted forwarder, which will be able to invoke functions on this contract on behalf of other accounts.
* @param multicallForwarder_ The MulticallForwarder address.
*/
constructor(address multicallForwarder_) ERC2771Context(multicallForwarder_) {}
/***************************************
MULTICALL
***************************************/
/**
* @notice Receives and executes a batch of function calls on this contract.
* @param data A list of function calls to execute.
* @return results The results of each function call.
*/
function multicall(bytes[] calldata data) external override returns (bytes[] memory results) {
results = new bytes[](data.length);
address sender = _msgSender();
bool isForwarder = msg.sender != sender;
for(uint256 i = 0; i < data.length; ++i) {
if(isForwarder) {
results[i] = Calls.functionDelegateCall(address(this), abi.encodePacked(data[i], sender));
} else {
results[i] = Calls.functionDelegateCall(address(this), data[i]);
}
}
}
}// SPDX-License-Identifier: none
pragma solidity 0.8.24;
import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import { SafeERC20 } from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import { IOwnable2Step } from "./../interfaces/utils/IOwnable2Step.sol";
import { Calls } from "./../libraries/Calls.sol";
import { Errors } from "./../libraries/Errors.sol";
/**
* @title Ownable2Step
* @author AgentFi
* @notice An abstract contract that provides a basic access control system through ERC173.
*
* Based on OpenZeppelins's implementation.
*
* Also includes [`sweep()`](#sweep) to allow the owner to rescue any tokens that may have been sent in.
*/
abstract contract Ownable2Step is IOwnable2Step {
/***************************************
VARIABLES
***************************************/
address private _owner;
address private _pendingOwner;
/**
* @notice Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
_checkOwner();
_;
}
/***************************************
VIEW FUNCTIONS
***************************************/
/**
* @notice Returns the address of the current owner.
* @return owner_ The current owner.
*/
function owner() public view override returns (address owner_) {
owner_ = _owner;
}
/**
* @notice Returns the address of the pending owner.
* @return pendingOwner_ The pending owner.
*/
function pendingOwner() public view override returns (address pendingOwner_) {
pendingOwner_ = _pendingOwner;
}
/***************************************
MUTATOR FUNCTIONS
***************************************/
/**
* @notice Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby disabling any functionality that is only available to the owner.
*/
function renounceOwnership() public payable override onlyOwner {
_transferOwnership(address(0));
}
/**
* @notice Starts the ownership transfer of the contract to a new account. Replaces the pending transfer if there is one.
* Can only be called by the current owner.
* @param newOwner The address of the new owner.
*/
function transferOwnership(address newOwner) public payable override onlyOwner {
_pendingOwner = newOwner;
emit OwnershipTransferStarted(_owner, newOwner);
}
/**
* @notice Completes the ownership transfer of the contract to the new account.
* Can only be called by the pending owner.
*/
function acceptOwnership() public payable override {
address sender = msg.sender;
if(_pendingOwner != sender) revert Errors.NotPendingContractOwner();
_transferOwnership(sender);
}
/***************************************
TOKEN BALANCE FUNCTIONS
***************************************/
/**
* @notice Rescues tokens that may have been accidentally transferred in.
* Can only be called by the contract owner.
* @dev If the inheriting contract requires tokens in the contract, overwrite this with a revert.
* @param receiver The receiver of the rescued tokens.
* @param tokens The tokens to rescue. Can be ETH or ERC20s.
*/
function sweep(address receiver, address[] calldata tokens) external payable virtual override onlyOwner {
for(uint256 i = 0; i < tokens.length; ++i) {
address token = tokens[i];
if(token == address(0)) {
Calls.sendValue(payable(receiver), address(this).balance);
} else {
IERC20 tkn = IERC20(token);
SafeERC20.safeTransfer(tkn, receiver, tkn.balanceOf(address(this)));
}
}
}
/***************************************
HELPER FUNCTIONS
***************************************/
/**
* @notice Throws if the sender is not the owner.
*/
function _checkOwner() internal view {
if(_owner != msg.sender) revert Errors.NotContractOwner();
}
/**
* @notice Transfers ownership of the contract to a new account (`newOwner`) and deletes any pending owner.
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal {
_pendingOwner = address(0);
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}{
"optimizer": {
"enabled": true,
"runs": 200000
},
"evmVersion": "paris",
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"libraries": {}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"address","name":"owner_","type":"address"},{"internalType":"address","name":"blast_","type":"address"},{"internalType":"address","name":"gasCollector_","type":"address"},{"internalType":"address","name":"blastPoints_","type":"address"},{"internalType":"address","name":"pointsOperator_","type":"address"},{"internalType":"address","name":"multicallForwarder_","type":"address"},{"internalType":"address","name":"genesisAgentNft_","type":"address"},{"internalType":"address","name":"strategyAgentNft_","type":"address"},{"internalType":"address","name":"explorerAgentNft_","type":"address"},{"internalType":"address","name":"erc6551Registry_","type":"address"},{"internalType":"address","name":"agentRegistry_","type":"address"},{"internalType":"address","name":"weth_","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"target","type":"address"}],"name":"AddressEmptyCode","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"AddressInsufficientBalance","type":"error"},{"inputs":[],"name":"CallFailed","type":"error"},{"inputs":[],"name":"CreationSettingsPaused","type":"error"},{"inputs":[],"name":"DelegateCallFailed","type":"error"},{"inputs":[],"name":"FailedInnerCall","type":"error"},{"inputs":[],"name":"InsufficientBalance","type":"error"},{"inputs":[],"name":"NotAnAgent","type":"error"},{"inputs":[],"name":"NotContractOwner","type":"error"},{"inputs":[],"name":"NotOwnerOfAgent","type":"error"},{"inputs":[],"name":"NotPendingContractOwner","type":"error"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"SafeERC20FailedOperation","type":"error"},{"anonymous":false,"inputs":[],"name":"AgentCreationSettingsPosted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferStarted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[],"name":"acceptOwnership","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"blast","outputs":[{"internalType":"address","name":"blast_","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"blastPoints","outputs":[{"internalType":"address","name":"blastPoints_","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"manager","type":"address"},{"internalType":"address","name":"pool","type":"address"},{"internalType":"uint24","name":"slippageLiquidity","type":"uint24"},{"internalType":"int24","name":"tickLower","type":"int24"},{"internalType":"int24","name":"tickUpper","type":"int24"},{"internalType":"uint160","name":"sqrtPriceX96","type":"uint160"}],"internalType":"struct IConcentratedLiquidityAgentFactory.MintBalanceParams","name":"mintParams","type":"tuple"},{"components":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct IConcentratedLiquidityAgentFactory.TokenDeposit","name":"deposit0","type":"tuple"},{"components":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct IConcentratedLiquidityAgentFactory.TokenDeposit","name":"deposit1","type":"tuple"}],"name":"createConcentratedLiquidityAgentAndExplorer","outputs":[{"internalType":"uint256","name":"nonfungiblePositionTokenId","type":"uint256"},{"internalType":"uint256","name":"strategyAgentID","type":"uint256"},{"internalType":"address","name":"strategyAddress","type":"address"},{"internalType":"uint256","name":"explorerAgentID","type":"uint256"},{"internalType":"address","name":"explorerAddress","type":"address"}],"stateMutability":"payable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"manager","type":"address"},{"internalType":"address","name":"pool","type":"address"},{"internalType":"uint24","name":"slippageLiquidity","type":"uint24"},{"internalType":"int24","name":"tickLower","type":"int24"},{"internalType":"int24","name":"tickUpper","type":"int24"},{"internalType":"uint160","name":"sqrtPriceX96","type":"uint160"}],"internalType":"struct IConcentratedLiquidityAgentFactory.MintBalanceParams","name":"mintParams","type":"tuple"},{"components":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct IConcentratedLiquidityAgentFactory.TokenDeposit","name":"depositLpToken","type":"tuple"}],"name":"createConcentratedLiquidityAgentAndExplorerAndMigrate","outputs":[{"internalType":"uint256","name":"nonfungiblePositionTokenId","type":"uint256"},{"internalType":"uint256","name":"strategyAgentID","type":"uint256"},{"internalType":"address","name":"strategyAddress","type":"address"},{"internalType":"uint256","name":"explorerAgentID","type":"uint256"},{"internalType":"address","name":"explorerAddress","type":"address"}],"stateMutability":"payable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"manager","type":"address"},{"internalType":"address","name":"pool","type":"address"},{"internalType":"uint24","name":"slippageLiquidity","type":"uint24"},{"internalType":"int24","name":"tickLower","type":"int24"},{"internalType":"int24","name":"tickUpper","type":"int24"},{"internalType":"uint160","name":"sqrtPriceX96","type":"uint160"}],"internalType":"struct IConcentratedLiquidityAgentFactory.MintBalanceParams","name":"mintParams","type":"tuple"},{"components":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct IConcentratedLiquidityAgentFactory.TokenDeposit","name":"depositLpToken","type":"tuple"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"createConcentratedLiquidityAgentAndExplorerAndMigrateWithPermit","outputs":[{"internalType":"uint256","name":"nonfungiblePositionTokenId","type":"uint256"},{"internalType":"uint256","name":"strategyAgentID","type":"uint256"},{"internalType":"address","name":"strategyAddress","type":"address"},{"internalType":"uint256","name":"explorerAgentID","type":"uint256"},{"internalType":"address","name":"explorerAddress","type":"address"}],"stateMutability":"payable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"manager","type":"address"},{"internalType":"address","name":"pool","type":"address"},{"internalType":"uint24","name":"slippageLiquidity","type":"uint24"},{"internalType":"int24","name":"tickLower","type":"int24"},{"internalType":"int24","name":"tickUpper","type":"int24"},{"internalType":"uint160","name":"sqrtPriceX96","type":"uint160"}],"internalType":"struct IConcentratedLiquidityAgentFactory.MintBalanceParams","name":"mintParams","type":"tuple"},{"components":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct IConcentratedLiquidityAgentFactory.TokenDeposit","name":"deposit0","type":"tuple"},{"components":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct IConcentratedLiquidityAgentFactory.TokenDeposit","name":"deposit1","type":"tuple"}],"name":"createConcentratedLiquidityAgentAndExplorerAndRefundExcess","outputs":[{"internalType":"uint256","name":"nonfungiblePositionTokenId","type":"uint256"},{"internalType":"uint256","name":"strategyAgentID","type":"uint256"},{"internalType":"address","name":"strategyAddress","type":"address"},{"internalType":"uint256","name":"explorerAgentID","type":"uint256"},{"internalType":"address","name":"explorerAddress","type":"address"}],"stateMutability":"payable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"manager","type":"address"},{"internalType":"address","name":"pool","type":"address"},{"internalType":"uint24","name":"slippageLiquidity","type":"uint24"},{"internalType":"int24","name":"tickLower","type":"int24"},{"internalType":"int24","name":"tickUpper","type":"int24"},{"internalType":"uint160","name":"sqrtPriceX96","type":"uint160"}],"internalType":"struct IConcentratedLiquidityAgentFactory.MintBalanceParams","name":"mintParams","type":"tuple"},{"components":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct IConcentratedLiquidityAgentFactory.TokenDeposit","name":"deposit0","type":"tuple"},{"components":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct IConcentratedLiquidityAgentFactory.TokenDeposit","name":"deposit1","type":"tuple"},{"internalType":"address","name":"rootAgentAddress","type":"address"}],"name":"createConcentratedLiquidityAgentForRoot","outputs":[{"internalType":"uint256","name":"nonfungiblePositionTokenId","type":"uint256"},{"internalType":"uint256","name":"strategyAgentID","type":"uint256"},{"internalType":"address","name":"strategyAddress","type":"address"}],"stateMutability":"payable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"manager","type":"address"},{"internalType":"address","name":"pool","type":"address"},{"internalType":"uint24","name":"slippageLiquidity","type":"uint24"},{"internalType":"int24","name":"tickLower","type":"int24"},{"internalType":"int24","name":"tickUpper","type":"int24"},{"internalType":"uint160","name":"sqrtPriceX96","type":"uint160"}],"internalType":"struct IConcentratedLiquidityAgentFactory.MintBalanceParams","name":"mintParams","type":"tuple"},{"components":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct IConcentratedLiquidityAgentFactory.TokenDeposit","name":"depositLpToken","type":"tuple"},{"internalType":"address","name":"rootAgentAddress","type":"address"}],"name":"createConcentratedLiquidityAgentForRootAndMigrate","outputs":[{"internalType":"uint256","name":"nonfungiblePositionTokenId","type":"uint256"},{"internalType":"uint256","name":"strategyAgentID","type":"uint256"},{"internalType":"address","name":"strategyAddress","type":"address"}],"stateMutability":"payable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"manager","type":"address"},{"internalType":"address","name":"pool","type":"address"},{"internalType":"uint24","name":"slippageLiquidity","type":"uint24"},{"internalType":"int24","name":"tickLower","type":"int24"},{"internalType":"int24","name":"tickUpper","type":"int24"},{"internalType":"uint160","name":"sqrtPriceX96","type":"uint160"}],"internalType":"struct IConcentratedLiquidityAgentFactory.MintBalanceParams","name":"mintParams","type":"tuple"},{"components":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct IConcentratedLiquidityAgentFactory.TokenDeposit","name":"depositLpToken","type":"tuple"},{"internalType":"address","name":"rootAgentAddress","type":"address"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"createConcentratedLiquidityAgentForRootAndMigrateWithPermit","outputs":[{"internalType":"uint256","name":"nonfungiblePositionTokenId","type":"uint256"},{"internalType":"uint256","name":"strategyAgentID","type":"uint256"},{"internalType":"address","name":"strategyAddress","type":"address"}],"stateMutability":"payable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"manager","type":"address"},{"internalType":"address","name":"pool","type":"address"},{"internalType":"uint24","name":"slippageLiquidity","type":"uint24"},{"internalType":"int24","name":"tickLower","type":"int24"},{"internalType":"int24","name":"tickUpper","type":"int24"},{"internalType":"uint160","name":"sqrtPriceX96","type":"uint160"}],"internalType":"struct IConcentratedLiquidityAgentFactory.MintBalanceParams","name":"mintParams","type":"tuple"},{"components":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct IConcentratedLiquidityAgentFactory.TokenDeposit","name":"deposit0","type":"tuple"},{"components":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct IConcentratedLiquidityAgentFactory.TokenDeposit","name":"deposit1","type":"tuple"},{"internalType":"address","name":"rootAgentAddress","type":"address"}],"name":"createConcentratedLiquidityAgentForRootAndRefundExcess","outputs":[{"internalType":"uint256","name":"nonfungiblePositionTokenId","type":"uint256"},{"internalType":"uint256","name":"strategyAgentID","type":"uint256"},{"internalType":"address","name":"strategyAddress","type":"address"}],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"getAgentCreationSettings","outputs":[{"internalType":"address","name":"strategyAccountImpl_","type":"address"},{"internalType":"address","name":"explorerAccountImpl_","type":"address"},{"internalType":"bytes","name":"strategyInitializationCall_","type":"bytes"},{"internalType":"bytes","name":"explorerInitializationCall_","type":"bytes"},{"internalType":"bool","name":"isActive_","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getStaticAddresses","outputs":[{"internalType":"address","name":"erc6551Registry_","type":"address"},{"internalType":"address","name":"agentRegistry_","type":"address"},{"internalType":"address","name":"genesisAgentNft_","type":"address"},{"internalType":"address","name":"strategyAgentNft_","type":"address"},{"internalType":"address","name":"explorerAgentNft_","type":"address"},{"internalType":"address","name":"weth_","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"forwarder","type":"address"}],"name":"isTrustedForwarder","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes[]","name":"data","type":"bytes[]"}],"name":"multicall","outputs":[{"internalType":"bytes[]","name":"results","type":"bytes[]"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"owner_","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"pendingOwner_","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"strategyAccountImpl","type":"address"},{"internalType":"address","name":"explorerAccountImpl","type":"address"},{"internalType":"bytes","name":"strategyInitializationCall","type":"bytes"},{"internalType":"bytes","name":"explorerInitializationCall","type":"bytes"},{"internalType":"bool","name":"isActive","type":"bool"}],"internalType":"struct IConcentratedLiquidityAgentFactory.AgentCreationSettings","name":"creationSettings","type":"tuple"}],"name":"postAgentCreationSettings","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"},{"internalType":"address[]","name":"tokens","type":"address[]"}],"name":"sweep","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"trustedForwarder","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"stateMutability":"payable","type":"receive"}]Contract Creation Code
6101e06040523480156200001257600080fd5b5060405162003b4e38038062003b4e833981016040819052620000359162000387565b6001600160a01b03808c166080819052818c1660a052818b1660c05290891660e05260408051600481526024810182526020810180516001600160e01b031663388a0bbd60e11b1790529051899283928f928f928f928f926200009991906200047c565b6000604051808303816000865af19150503d8060008114620000d8576040519150601f19603f3d011682016040523d82523d6000602084013e620000dd565b606091505b505060408051600481526024810182526020810180516001600160e01b0316634e606c4760e01b17905290516001600160a01b03871692506200012191906200047c565b6000604051808303816000865af19150503d806000811462000160576040519150601f19603f3d011682016040523d82523d6000602084013e62000165565b606091505b5050506001600160a01b0383161562000210576040516001600160a01b03848116602483015285169060440160408051601f198184030181529181526020820180516001600160e01b0316631d70c8d360e31b17905251620001c891906200047c565b6000604051808303816000865af19150503d806000811462000207576040519150601f19603f3d011682016040523d82523d6000602084013e6200020c565b606091505b5050505b6001600160a01b03811615620002b8576040516001600160a01b03828116602483015283169060440160408051601f198184030181529181526020820180516001600160e01b03166336b91f2b60e01b179052516200027091906200047c565b6000604051808303816000865af19150503d8060008114620002af576040519150601f19603f3d011682016040523d82523d6000602084013e620002b4565b606091505b5050505b505050506001600160a01b03166101005250620002d58c62000310565b6001600160a01b0395861661016052938516610180529184166101a052831661012052821661014052166101c05250620004ad945050505050565b600180546001600160a01b0319908116909155600080546001600160a01b03848116938216841783556040519116929183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b80516001600160a01b03811681146200038257600080fd5b919050565b6000806000806000806000806000806000806101808d8f031215620003ab57600080fd5b620003b68d6200036a565b9b50620003c660208e016200036a565b9a50620003d660408e016200036a565b9950620003e660608e016200036a565b9850620003f660808e016200036a565b97506200040660a08e016200036a565b96506200041660c08e016200036a565b95506200042660e08e016200036a565b9450620004376101008e016200036a565b9350620004486101208e016200036a565b9250620004596101408e016200036a565b91506200046a6101608e016200036a565b90509295989b509295989b509295989b565b6000825160005b818110156200049f576020818601810151858301520162000483565b506000920191825250919050565b60805160a05160c05160e05161010051610120516101405161016051610180516101a0516101c051613594620005ba6000396000818161053701528181611a7c0152611d8301526000818161050f015281816106ea015281816108e30152818161145401526121ac0152600081816104e70152818161068a0152818161088301528181610cf801528181610de60152818161215401526126960152600081816104bd01526120fd015260008181610495015281816116490152818161206e015261288b01526000818161047001528181611553015261279501526000818161029b0152818161037301526119ed015260005050600061042401526000505060006101ed01526135946000f3fe6080604052600436106101795760003560e01c80637da0a877116100cb578063b2bd6b501161007f578063de487ac511610059578063de487ac51461057a578063e30c39781461058d578063f2fde38b146105b857600080fd5b8063b2bd6b5014610415578063b3ed220b14610448578063c175a3451461056757600080fd5b80638da5cb5b116100b05780638da5cb5b146103aa578063ac9650d8146103d5578063b0a644bf1461040257600080fd5b80637da0a877146103645780638a179be41461039757600080fd5b8063572b6c051161012d578063715018a611610107578063715018a61461033f578063743ba2111461034957806379ba50971461035c57600080fd5b8063572b6c051461027e5780635b0602b0146102e857806363836442146102fb57600080fd5b80632e5ee97f1161015e5780632e5ee97f14610232578063407de76b1461024557806356b1c3e91461025857600080fd5b806311a5d55714610185578063175e1a7d146101de57600080fd5b3661018057005b600080fd5b610198610193366004612bb0565b6105cb565b60408051958652602086019490945273ffffffffffffffffffffffffffffffffffffffff92831693850193909352606084015216608082015260a0015b60405180910390f35b3480156101ea57600080fd5b507f00000000000000000000000000000000000000000000000000000000000000005b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016101d5565b610198610240366004612be6565b6107c3565b610198610253366004612c44565b6109bd565b34801561026457600080fd5b5061026d610ac0565b6040516101d5959493929190612d18565b34801561028a57600080fd5b506102d8610299366004612d9a565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff90811691161490565b60405190151581526020016101d5565b6101986102f6366004612be6565b610c1f565b61030e610309366004612db7565b610c85565b60408051938452602084019290925273ffffffffffffffffffffffffffffffffffffffff16908201526060016101d5565b610347610d60565b005b61030e610357366004612e13565b610d74565b610347610e4d565b34801561037057600080fd5b507f000000000000000000000000000000000000000000000000000000000000000061020d565b6103476103a5366004612eaa565b610eac565b3480156103b657600080fd5b5060005473ffffffffffffffffffffffffffffffffffffffff1661020d565b3480156103e157600080fd5b506103f56103f0366004612eff565b610fc3565b6040516101d59190612f41565b61030e610410366004612db7565b61114d565b34801561042157600080fd5b507f000000000000000000000000000000000000000000000000000000000000000061020d565b34801561045457600080fd5b506040805173ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000811682527f0000000000000000000000000000000000000000000000000000000000000000811660208301527f00000000000000000000000000000000000000000000000000000000000000008116928201929092527f0000000000000000000000000000000000000000000000000000000000000000821660608201527f0000000000000000000000000000000000000000000000000000000000000000821660808201527f00000000000000000000000000000000000000000000000000000000000000009190911660a082015260c0016101d5565b61030e610575366004612fc3565b611166565b61034761058836600461303e565b611264565b34801561059957600080fd5b5060015473ffffffffffffffffffffffffffffffffffffffff1661020d565b6103476105c6366004612d9a565b6113cf565b6000806000806000600160149054906101000a900460ff16610619576040517f680d9f2700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61062161144d565b90925090506106308787611741565b6040517f23b872dd00000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff85811660248301526044820184905293985091965094507f0000000000000000000000000000000000000000000000000000000000000000909116906323b872dd90606401600060405180830381600087803b1580156106d057600080fd5b505af11580156106e4573d6000803e3d6000fd5b505050507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166323b872dd3061072d6119e6565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b16815273ffffffffffffffffffffffffffffffffffffffff92831660048201529116602482015260448101859052606401600060405180830381600087803b1580156107a157600080fd5b505af11580156107b5573d6000803e3d6000fd5b505050509295509295909350565b6000806000806000600160149054906101000a900460ff16610811576040517f680d9f2700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61081961144d565b9092509050610829888888611a68565b6040517f23b872dd00000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff85811660248301526044820184905293985091965094507f0000000000000000000000000000000000000000000000000000000000000000909116906323b872dd90606401600060405180830381600087803b1580156108c957600080fd5b505af11580156108dd573d6000803e3d6000fd5b505050507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166323b872dd306109266119e6565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b16815273ffffffffffffffffffffffffffffffffffffffff92831660048201529116602482015260448101859052606401600060405180830381600087803b15801561099a57600080fd5b505af11580156109ae573d6000803e3d6000fd5b50505050939792965093509350565b6000808080806109d060208b018b612d9a565b73ffffffffffffffffffffffffffffffffffffffff1663d505accf6109f36119e6565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b16815273ffffffffffffffffffffffffffffffffffffffff909116600482015230602482015260208d01356044820152606481018c905260ff8b16608482015260a481018a905260c4810189905260e401600060405180830381600087803b158015610a8757600080fd5b505af1158015610a9b573d6000803e3d6000fd5b50505050610aa98b8b6105cb565b939f929e50909c509a509098509650505050505050565b6002546003546004805473ffffffffffffffffffffffffffffffffffffffff9384169390921691606091829160009190610af990613079565b80601f0160208091040260200160405190810160405280929190818152602001828054610b2590613079565b8015610b725780601f10610b4757610100808354040283529160200191610b72565b820191906000526020600020905b815481529060010190602001808311610b5557829003601f168201915b5050505050925060058054610b8690613079565b80601f0160208091040260200160405190810160405280929190818152602001828054610bb290613079565b8015610bff5780601f10610bd457610100808354040283529160200191610bff565b820191906000526020600020905b815481529060010190602001808311610be257829003601f168201915b50505050509150600160149054906101000a900460ff1690509091929394565b6000806000806000600160149054906101000a900460ff16610c6d576040517f680d9f2700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610c7561144d565b9092509050610829888888611d6f565b6000806000610c9384611fd0565b610c9e878787611a68565b6040517f23b872dd00000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff88811660248301526044820184905293965091945092507f0000000000000000000000000000000000000000000000000000000000000000909116906323b872dd90606401600060405180830381600087803b158015610d3e57600080fd5b505af1158015610d52573d6000803e3d6000fd5b505050509450945094915050565b610d6861231f565b610d726000612370565b565b6000806000610d8284611fd0565b610d8c8686611741565b6040517f23b872dd00000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff88811660248301526044820184905293965091945092507f0000000000000000000000000000000000000000000000000000000000000000909116906323b872dd90606401600060405180830381600087803b158015610e2c57600080fd5b505af1158015610e40573d6000803e3d6000fd5b5050505093509350939050565b600154339073ffffffffffffffffffffffffffffffffffffffff168114610ea0576040517f3d6f519e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610ea981612370565b50565b610eb461231f565b60005b81811015610fbd576000838383818110610ed357610ed36130c6565b9050602002016020810190610ee89190612d9a565b905073ffffffffffffffffffffffffffffffffffffffff8116610f1557610f0f85476123ef565b50610fb4565b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201528190610fb2908290889073ffffffffffffffffffffffffffffffffffffffff8316906370a0823190602401602060405180830381865afa158015610f89573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fad91906130f5565b6124e8565b505b50600101610eb7565b50505050565b60608167ffffffffffffffff811115610fde57610fde61310e565b60405190808252806020026020018201604052801561101157816020015b6060815260200190600190039081610ffc5790505b509050600061101e6119e6565b90503373ffffffffffffffffffffffffffffffffffffffff8216141560005b848110156111445781156110bc5761109a30878784818110611061576110616130c6565b9050602002810190611073919061313d565b86604051602001611086939291906131a2565b604051602081830303815290604052612569565b8482815181106110ac576110ac6130c6565b602002602001018190525061113c565b61111e308787848181106110d2576110d26130c6565b90506020028101906110e4919061313d565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061256992505050565b848281518110611130576111306130c6565b60200260200101819052505b60010161103d565b50505092915050565b600080600061115b84611fd0565b610c9e878787611d6f565b6000808061117760208a018a612d9a565b73ffffffffffffffffffffffffffffffffffffffff1663d505accf61119a6119e6565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b16815273ffffffffffffffffffffffffffffffffffffffff909116600482015230602482015260208c01356044820152606481018a905260ff8916608482015260a4810188905260c4810187905260e401600060405180830381600087803b15801561122e57600080fd5b505af1158015611242573d6000803e3d6000fd5b505050506112518a8a8a610d74565b919c909b50909950975050505050505050565b61126c61231f565b6112796020820182612d9a565b600280547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff929092169190911790556112ce6040820160208301612d9a565b600380547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055611320604082018261313d565b60049161132e91908361322b565b5061133c606082018261313d565b60059161134a91908361322b565b5061135b60a0820160808301613354565b6001805491151574010000000000000000000000000000000000000000027fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff9092169190911790556040517fec0a2ce18c2c66448518f6a0f7199cd7066aba5a22fbab83e615f7df3195dfef90600090a150565b6113d761231f565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691821790925560008054604051929316917f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e227009190a350565b60008060007f000000000000000000000000000000000000000000000000000000000000000090508073ffffffffffffffffffffffffffffffffffffffff1663457e8e1e6040518163ffffffff1660e01b81526004016020604051808303816000875af11580156114c2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114e691906130f5565b6003546040517f8a54c52f00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9182166004820181905260006024830181905246604484015285841660648401526084830185905293965092917f00000000000000000000000000000000000000000000000000000000000000001690638a54c52f9060a4016020604051808303816000875af115801561159c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115c09190613371565b6040805160808101825273ffffffffffffffffffffffffffffffffffffffff808416825285811660208301908152878216838501908152606084018b815294517f2b2ea1070000000000000000000000000000000000000000000000000000000081529351831660048501529051821660248401525181166044830152915160648201529195507f00000000000000000000000000000000000000000000000000000000000000001690632b2ea10790608401600060405180830381600087803b15801561168d57600080fd5b505af11580156116a1573d6000803e3d6000fd5b5050505061173984600580546116b690613079565b80601f01602080910402602001604051908101604052809291908181526020018280546116e290613079565b801561172f5780601f106117045761010080835404028352916020019161172f565b820191906000526020600020905b81548152906001019060200180831161171257829003601f168201915b5050505050612628565b505050509091565b600080600061174e61268f565b90925090506117826117636020860186612d9a565b61176b6119e6565b6117786020880188612d9a565b87602001356128f8565b61178f6020850185612d9a565b6040517f89afcb4400000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff838116600483015291909116906389afcb449060240160408051808303816000875af11580156117fe573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611822919061338e565b50506040805160c0810190915273ffffffffffffffffffffffffffffffffffffffff82169063aeb0ea21908061185b60208a018a612d9a565b73ffffffffffffffffffffffffffffffffffffffff1681526020018860200160208101906118899190612d9a565b73ffffffffffffffffffffffffffffffffffffffff1681526020016118b460608a0160408b016133b2565b62ffffff1681526020016118ce60808a0160608b016133d7565b60020b81526020016118e660a08a0160808b016133d7565b60020b81526020016118fe60c08a0160a08b01612d9a565b73ffffffffffffffffffffffffffffffffffffffff908116909152604080517fffffffff0000000000000000000000000000000000000000000000000000000060e086901b1681528351831660048201526020840151831660248201529083015162ffffff1660448201526060830151600290810b60648301526080840151900b608482015260a0909201511660a482015260c4016080604051808303816000875af11580156119b2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119d691906133fa565b5091979396509194509192505050565b60003660147f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1633148015611a305750808210155b15611a6057600036611a42838561344d565b611a4d928290613487565b611a56916134b1565b60601c9250505090565b339250505090565b6000806000611a7561268f565b90925090507f00000000000000000000000000000000000000000000000000000000000000006000611aaa6020880188612d9a565b73ffffffffffffffffffffffffffffffffffffffff1603611ae857611ad38187602001356123ef565b50611ae3818388602001356124e8565b611b0b565b611b0b611af86020880188612d9a565b611b006119e6565b8489602001356128f8565b6000611b1a6020870187612d9a565b73ffffffffffffffffffffffffffffffffffffffff1603611b5857611b438186602001356123ef565b50611b53818387602001356124e8565b611b7b565b611b7b611b686020870187612d9a565b611b706119e6565b8488602001356128f8565b6040805160e0810190915273ffffffffffffffffffffffffffffffffffffffff831690636dd4afce9080611bb260208c018c612d9a565b73ffffffffffffffffffffffffffffffffffffffff1681526020018a6020016020810190611be09190612d9a565b73ffffffffffffffffffffffffffffffffffffffff168152602001611c0b60608c0160408d016133b2565b62ffffff168152602001611c2560808c0160608d016133d7565b60020b8152602001611c3d60a08c0160808d016133d7565b60020b8152602001611c5560c08c0160a08d01612d9a565b73ffffffffffffffffffffffffffffffffffffffff168152602001611c786119e6565b73ffffffffffffffffffffffffffffffffffffffff908116909152604080517fffffffff0000000000000000000000000000000000000000000000000000000060e086901b1681528351831660048201526020840151831660248201529083015162ffffff1660448201526060830151600290810b60648301526080840151900b608482015260a0830151821660a482015260c0909201511660c482015260e4015b6080604051808303816000875af1158015611d39573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d5d91906133fa565b50919994985092965092945050505050565b6000806000611d7c61268f565b90925090507f00000000000000000000000000000000000000000000000000000000000000006000611db16020880188612d9a565b73ffffffffffffffffffffffffffffffffffffffff1603611def57611dda8187602001356123ef565b50611dea818388602001356124e8565b611dff565b611dff611af86020880188612d9a565b6000611e0e6020870187612d9a565b73ffffffffffffffffffffffffffffffffffffffff1603611e4c57611e378186602001356123ef565b50611e47818387602001356124e8565b611e5c565b611e5c611b686020870187612d9a565b6040805160c0810190915273ffffffffffffffffffffffffffffffffffffffff83169063aeb0ea219080611e9360208c018c612d9a565b73ffffffffffffffffffffffffffffffffffffffff1681526020018a6020016020810190611ec19190612d9a565b73ffffffffffffffffffffffffffffffffffffffff168152602001611eec60608c0160408d016133b2565b62ffffff168152602001611f0660808c0160608d016133d7565b60020b8152602001611f1e60a08c0160808d016133d7565b60020b8152602001611f3660c08c0160a08d01612d9a565b73ffffffffffffffffffffffffffffffffffffffff908116909152604080517fffffffff0000000000000000000000000000000000000000000000000000000060e086901b1681528351831660048201526020840151831660248201529083015162ffffff1660448201526060830151600290810b60648301526080840151900b608482015260a0909201511660a482015260c401611d1a565b60015474010000000000000000000000000000000000000000900460ff16612024576040517f680d9f2700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040517f1e17c0ca00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff828116600483015260009182917f00000000000000000000000000000000000000000000000000000000000000001690631e17c0ca906024016040805180830381865afa1580156120b4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120d891906134f7565b909250905073ffffffffffffffffffffffffffffffffffffffff821615806121fb57507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141580156121a357507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156121fb57507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15612232576040517f0907fef200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61223a6119e6565b6040517f6352211e0000000000000000000000000000000000000000000000000000000081526004810183905273ffffffffffffffffffffffffffffffffffffffff91821691841690636352211e90602401602060405180830381865afa1580156122a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122cd9190613371565b73ffffffffffffffffffffffffffffffffffffffff161461231a576040517f4c90cf4400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b505050565b60005473ffffffffffffffffffffffffffffffffffffffff163314610d72576040517fbfcafd3700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000009081169091556000805473ffffffffffffffffffffffffffffffffffffffff848116938216841783556040519116929183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60608147101561242b576040517ff4d678b800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000808473ffffffffffffffffffffffffffffffffffffffff168460405160006040518083038185875af1925050503d8060008114612486576040519150601f19603f3d011682016040523d82523d6000602084013e61248b565b606091505b5091509150811561249e578092506124e0565b8051156124ae5780518082602001fd5b6040517f3204506f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b505092915050565b60405173ffffffffffffffffffffffffffffffffffffffff83811660248301526044820183905261231a91859182169063a9059cbb906064015b604051602081830303815290604052915060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505061293e565b60606000808473ffffffffffffffffffffffffffffffffffffffff16846040516125939190613525565b600060405180830381855af49150503d80600081146125ce576040519150601f19603f3d011682016040523d82523d6000602084013e6125d3565b606091505b509150915081156125e6578092506124e0565b8051156125f65780518082602001fd5b6040517f18cecad500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60606000808473ffffffffffffffffffffffffffffffffffffffff16846040516126529190613525565b6000604051808303816000865af19150503d8060008114612486576040519150601f19603f3d011682016040523d82523d6000602084013e61248b565b60008060007f000000000000000000000000000000000000000000000000000000000000000090508073ffffffffffffffffffffffffffffffffffffffff1663457e8e1e6040518163ffffffff1660e01b81526004016020604051808303816000875af1158015612704573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061272891906130f5565b6002546040517f8a54c52f00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9182166004820181905260006024830181905246604484015285841660648401526084830185905293965092917f00000000000000000000000000000000000000000000000000000000000000001690638a54c52f9060a4016020604051808303816000875af11580156127de573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128029190613371565b6040805160808101825273ffffffffffffffffffffffffffffffffffffffff808416825285811660208301908152878216838501908152606084018b815294517f2b2ea1070000000000000000000000000000000000000000000000000000000081529351831660048501529051821660248401525181166044830152915160648201529195507f00000000000000000000000000000000000000000000000000000000000000001690632b2ea10790608401600060405180830381600087803b1580156128cf57600080fd5b505af11580156128e3573d6000803e3d6000fd5b5050505061173984600480546116b690613079565b60405173ffffffffffffffffffffffffffffffffffffffff8481166024830152838116604483015260648201839052610fbd9186918216906323b872dd90608401612522565b600061296073ffffffffffffffffffffffffffffffffffffffff8416836129d9565b905080516000141580156129855750808060200190518101906129839190613541565b155b1561231a576040517f5274afe700000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff841660048201526024015b60405180910390fd5b60606129e7838360006129f0565b90505b92915050565b606081471015612a2e576040517fcd7860590000000000000000000000000000000000000000000000000000000081523060048201526024016129d0565b6000808573ffffffffffffffffffffffffffffffffffffffff168486604051612a579190613525565b60006040518083038185875af1925050503d8060008114612a94576040519150601f19603f3d011682016040523d82523d6000602084013e612a99565b606091505b5091509150612aa9868383612ab5565b925050505b9392505050565b606082612aca57612ac582612b44565b612aae565b8151158015612aee575073ffffffffffffffffffffffffffffffffffffffff84163b155b15612b3d576040517f9996b31500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff851660048201526024016129d0565b5080612aae565b805115612b545780518082602001fd5b6040517f1425ea4200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600060c08284031215612b9857600080fd5b50919050565b600060408284031215612b9857600080fd5b6000806101008385031215612bc457600080fd5b612bce8484612b86565b9150612bdd8460c08501612b9e565b90509250929050565b60008060006101408486031215612bfc57600080fd5b612c068585612b86565b9250612c158560c08601612b9e565b9150612c25856101008601612b9e565b90509250925092565b803560ff81168114612c3f57600080fd5b919050565b6000806000806000806101808789031215612c5e57600080fd5b612c688888612b86565b9550612c778860c08901612b9e565b94506101008701359350612c8e6101208801612c2e565b9250610140870135915061016087013590509295509295509295565b60005b83811015612cc5578181015183820152602001612cad565b50506000910152565b60008151808452612ce6816020860160208601612caa565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b600073ffffffffffffffffffffffffffffffffffffffff808816835280871660208401525060a06040830152612d5160a0830186612cce565b8281036060840152612d638186612cce565b91505082151560808301529695505050505050565b73ffffffffffffffffffffffffffffffffffffffff81168114610ea957600080fd5b600060208284031215612dac57600080fd5b8135612aae81612d78565b6000806000806101608587031215612dce57600080fd5b612dd88686612b86565b9350612de78660c08701612b9e565b9250612df7866101008701612b9e565b9150610140850135612e0881612d78565b939692955090935050565b60008060006101208486031215612e2957600080fd5b612e338585612b86565b9250612e428560c08601612b9e565b9150610100840135612e5381612d78565b809150509250925092565b60008083601f840112612e7057600080fd5b50813567ffffffffffffffff811115612e8857600080fd5b6020830191508360208260051b8501011115612ea357600080fd5b9250929050565b600080600060408486031215612ebf57600080fd5b8335612eca81612d78565b9250602084013567ffffffffffffffff811115612ee657600080fd5b612ef286828701612e5e565b9497909650939450505050565b60008060208385031215612f1257600080fd5b823567ffffffffffffffff811115612f2957600080fd5b612f3585828601612e5e565b90969095509350505050565b600060208083016020845280855180835260408601915060408160051b87010192506020870160005b82811015612fb6577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc0888603018452612fa4858351612cce565b94509285019290850190600101612f6a565b5092979650505050505050565b60008060008060008060006101a0888a031215612fdf57600080fd5b612fe98989612b86565b9650612ff88960c08a01612b9e565b955061010088013561300981612d78565b945061012088013593506130206101408901612c2e565b92506101608801359150610180880135905092959891949750929550565b60006020828403121561305057600080fd5b813567ffffffffffffffff81111561306757600080fd5b820160a08185031215612aae57600080fd5b600181811c9082168061308d57607f821691505b602082108103612b98577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60006020828403121561310757600080fd5b5051919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe184360301811261317257600080fd5b83018035915067ffffffffffffffff82111561318d57600080fd5b602001915036819003821315612ea357600080fd5b8284823760609190911b7fffffffffffffffffffffffffffffffffffffffff000000000000000000000000169101908152601401919050565b601f82111561231a576000816000526020600020601f850160051c810160208610156132045750805b601f850160051c820191505b8181101561322357828155600101613210565b505050505050565b67ffffffffffffffff8311156132435761324361310e565b613257836132518354613079565b836131db565b6000601f8411600181146132a957600085156132735750838201355b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600387901b1c1916600186901b17835561333f565b6000838152602090207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0861690835b828110156132f857868501358255602094850194600190920191016132d8565b5086821015613333577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff60f88860031b161c19848701351681555b505060018560011b0183555b5050505050565b8015158114610ea957600080fd5b60006020828403121561336657600080fd5b8135612aae81613346565b60006020828403121561338357600080fd5b8151612aae81612d78565b600080604083850312156133a157600080fd5b505080516020909101519092909150565b6000602082840312156133c457600080fd5b813562ffffff81168114612aae57600080fd5b6000602082840312156133e957600080fd5b81358060020b8114612aae57600080fd5b6000806000806080858703121561341057600080fd5b8451935060208501516fffffffffffffffffffffffffffffffff8116811461343757600080fd5b6040860151606090960151949790965092505050565b818103818111156129ea577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000808585111561349757600080fd5b838611156134a457600080fd5b5050820193919092039150565b7fffffffffffffffffffffffffffffffffffffffff00000000000000000000000081358181169160148510156124e05760149490940360031b84901b1690921692915050565b6000806040838503121561350a57600080fd5b825161351581612d78565b6020939093015192949293505050565b60008251613537818460208701612caa565b9190910192915050565b60006020828403121561355357600080fd5b8151612aae8161334656fea2646970667358221220f570ac327e61b3737369b975c6b46a1152832debe8fa731be88da0a193427a8464736f6c63430008180033000000000000000000000000a214a4fc09c42202c404e2976c50373fe5f5b7890000000000000000000000004300000000000000000000000000000000000002000000000000000000000000f237c20584daca970498917470864f4d027de4ca0000000000000000000000002536fe9ab3f511540f2f9e2ec2a805005c3dd800000000000000000000000000454c0c1cf7be9341d82ce0f16979b8689ed4aad0000000000000000000000000ad55f8b65d5738c6f63b54e651a09cc5d873e4d80000000000000000000000005066a1975be96b777dddf57b496397effddcb4a900000000000000000000000073e75e837e4f3884ed474988c304de8a437acbef000000000000000000000000fb0b3c31eaf58743603e8ee1e122547ec053bf18000000000000000000000000000000006551c19487814612e58fe0681377575800000000000000000000000012f0a3453f63516815fe41c89fae84d218af0faf0000000000000000000000004300000000000000000000000000000000000004
Deployed Bytecode
0x6080604052600436106101795760003560e01c80637da0a877116100cb578063b2bd6b501161007f578063de487ac511610059578063de487ac51461057a578063e30c39781461058d578063f2fde38b146105b857600080fd5b8063b2bd6b5014610415578063b3ed220b14610448578063c175a3451461056757600080fd5b80638da5cb5b116100b05780638da5cb5b146103aa578063ac9650d8146103d5578063b0a644bf1461040257600080fd5b80637da0a877146103645780638a179be41461039757600080fd5b8063572b6c051161012d578063715018a611610107578063715018a61461033f578063743ba2111461034957806379ba50971461035c57600080fd5b8063572b6c051461027e5780635b0602b0146102e857806363836442146102fb57600080fd5b80632e5ee97f1161015e5780632e5ee97f14610232578063407de76b1461024557806356b1c3e91461025857600080fd5b806311a5d55714610185578063175e1a7d146101de57600080fd5b3661018057005b600080fd5b610198610193366004612bb0565b6105cb565b60408051958652602086019490945273ffffffffffffffffffffffffffffffffffffffff92831693850193909352606084015216608082015260a0015b60405180910390f35b3480156101ea57600080fd5b507f00000000000000000000000043000000000000000000000000000000000000025b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016101d5565b610198610240366004612be6565b6107c3565b610198610253366004612c44565b6109bd565b34801561026457600080fd5b5061026d610ac0565b6040516101d5959493929190612d18565b34801561028a57600080fd5b506102d8610299366004612d9a565b7f000000000000000000000000ad55f8b65d5738c6f63b54e651a09cc5d873e4d873ffffffffffffffffffffffffffffffffffffffff90811691161490565b60405190151581526020016101d5565b6101986102f6366004612be6565b610c1f565b61030e610309366004612db7565b610c85565b60408051938452602084019290925273ffffffffffffffffffffffffffffffffffffffff16908201526060016101d5565b610347610d60565b005b61030e610357366004612e13565b610d74565b610347610e4d565b34801561037057600080fd5b507f000000000000000000000000ad55f8b65d5738c6f63b54e651a09cc5d873e4d861020d565b6103476103a5366004612eaa565b610eac565b3480156103b657600080fd5b5060005473ffffffffffffffffffffffffffffffffffffffff1661020d565b3480156103e157600080fd5b506103f56103f0366004612eff565b610fc3565b6040516101d59190612f41565b61030e610410366004612db7565b61114d565b34801561042157600080fd5b507f0000000000000000000000002536fe9ab3f511540f2f9e2ec2a805005c3dd80061020d565b34801561045457600080fd5b506040805173ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000006551c19487814612e58fe06813775758811682527f00000000000000000000000012f0a3453f63516815fe41c89fae84d218af0faf811660208301527f0000000000000000000000005066a1975be96b777dddf57b496397effddcb4a98116928201929092527f00000000000000000000000073e75e837e4f3884ed474988c304de8a437acbef821660608201527f000000000000000000000000fb0b3c31eaf58743603e8ee1e122547ec053bf18821660808201527f00000000000000000000000043000000000000000000000000000000000000049190911660a082015260c0016101d5565b61030e610575366004612fc3565b611166565b61034761058836600461303e565b611264565b34801561059957600080fd5b5060015473ffffffffffffffffffffffffffffffffffffffff1661020d565b6103476105c6366004612d9a565b6113cf565b6000806000806000600160149054906101000a900460ff16610619576040517f680d9f2700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61062161144d565b90925090506106308787611741565b6040517f23b872dd00000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff85811660248301526044820184905293985091965094507f00000000000000000000000073e75e837e4f3884ed474988c304de8a437acbef909116906323b872dd90606401600060405180830381600087803b1580156106d057600080fd5b505af11580156106e4573d6000803e3d6000fd5b505050507f000000000000000000000000fb0b3c31eaf58743603e8ee1e122547ec053bf1873ffffffffffffffffffffffffffffffffffffffff166323b872dd3061072d6119e6565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b16815273ffffffffffffffffffffffffffffffffffffffff92831660048201529116602482015260448101859052606401600060405180830381600087803b1580156107a157600080fd5b505af11580156107b5573d6000803e3d6000fd5b505050509295509295909350565b6000806000806000600160149054906101000a900460ff16610811576040517f680d9f2700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61081961144d565b9092509050610829888888611a68565b6040517f23b872dd00000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff85811660248301526044820184905293985091965094507f00000000000000000000000073e75e837e4f3884ed474988c304de8a437acbef909116906323b872dd90606401600060405180830381600087803b1580156108c957600080fd5b505af11580156108dd573d6000803e3d6000fd5b505050507f000000000000000000000000fb0b3c31eaf58743603e8ee1e122547ec053bf1873ffffffffffffffffffffffffffffffffffffffff166323b872dd306109266119e6565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b16815273ffffffffffffffffffffffffffffffffffffffff92831660048201529116602482015260448101859052606401600060405180830381600087803b15801561099a57600080fd5b505af11580156109ae573d6000803e3d6000fd5b50505050939792965093509350565b6000808080806109d060208b018b612d9a565b73ffffffffffffffffffffffffffffffffffffffff1663d505accf6109f36119e6565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b16815273ffffffffffffffffffffffffffffffffffffffff909116600482015230602482015260208d01356044820152606481018c905260ff8b16608482015260a481018a905260c4810189905260e401600060405180830381600087803b158015610a8757600080fd5b505af1158015610a9b573d6000803e3d6000fd5b50505050610aa98b8b6105cb565b939f929e50909c509a509098509650505050505050565b6002546003546004805473ffffffffffffffffffffffffffffffffffffffff9384169390921691606091829160009190610af990613079565b80601f0160208091040260200160405190810160405280929190818152602001828054610b2590613079565b8015610b725780601f10610b4757610100808354040283529160200191610b72565b820191906000526020600020905b815481529060010190602001808311610b5557829003601f168201915b5050505050925060058054610b8690613079565b80601f0160208091040260200160405190810160405280929190818152602001828054610bb290613079565b8015610bff5780601f10610bd457610100808354040283529160200191610bff565b820191906000526020600020905b815481529060010190602001808311610be257829003601f168201915b50505050509150600160149054906101000a900460ff1690509091929394565b6000806000806000600160149054906101000a900460ff16610c6d576040517f680d9f2700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610c7561144d565b9092509050610829888888611d6f565b6000806000610c9384611fd0565b610c9e878787611a68565b6040517f23b872dd00000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff88811660248301526044820184905293965091945092507f00000000000000000000000073e75e837e4f3884ed474988c304de8a437acbef909116906323b872dd90606401600060405180830381600087803b158015610d3e57600080fd5b505af1158015610d52573d6000803e3d6000fd5b505050509450945094915050565b610d6861231f565b610d726000612370565b565b6000806000610d8284611fd0565b610d8c8686611741565b6040517f23b872dd00000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff88811660248301526044820184905293965091945092507f00000000000000000000000073e75e837e4f3884ed474988c304de8a437acbef909116906323b872dd90606401600060405180830381600087803b158015610e2c57600080fd5b505af1158015610e40573d6000803e3d6000fd5b5050505093509350939050565b600154339073ffffffffffffffffffffffffffffffffffffffff168114610ea0576040517f3d6f519e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610ea981612370565b50565b610eb461231f565b60005b81811015610fbd576000838383818110610ed357610ed36130c6565b9050602002016020810190610ee89190612d9a565b905073ffffffffffffffffffffffffffffffffffffffff8116610f1557610f0f85476123ef565b50610fb4565b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201528190610fb2908290889073ffffffffffffffffffffffffffffffffffffffff8316906370a0823190602401602060405180830381865afa158015610f89573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fad91906130f5565b6124e8565b505b50600101610eb7565b50505050565b60608167ffffffffffffffff811115610fde57610fde61310e565b60405190808252806020026020018201604052801561101157816020015b6060815260200190600190039081610ffc5790505b509050600061101e6119e6565b90503373ffffffffffffffffffffffffffffffffffffffff8216141560005b848110156111445781156110bc5761109a30878784818110611061576110616130c6565b9050602002810190611073919061313d565b86604051602001611086939291906131a2565b604051602081830303815290604052612569565b8482815181106110ac576110ac6130c6565b602002602001018190525061113c565b61111e308787848181106110d2576110d26130c6565b90506020028101906110e4919061313d565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061256992505050565b848281518110611130576111306130c6565b60200260200101819052505b60010161103d565b50505092915050565b600080600061115b84611fd0565b610c9e878787611d6f565b6000808061117760208a018a612d9a565b73ffffffffffffffffffffffffffffffffffffffff1663d505accf61119a6119e6565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b16815273ffffffffffffffffffffffffffffffffffffffff909116600482015230602482015260208c01356044820152606481018a905260ff8916608482015260a4810188905260c4810187905260e401600060405180830381600087803b15801561122e57600080fd5b505af1158015611242573d6000803e3d6000fd5b505050506112518a8a8a610d74565b919c909b50909950975050505050505050565b61126c61231f565b6112796020820182612d9a565b600280547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff929092169190911790556112ce6040820160208301612d9a565b600380547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055611320604082018261313d565b60049161132e91908361322b565b5061133c606082018261313d565b60059161134a91908361322b565b5061135b60a0820160808301613354565b6001805491151574010000000000000000000000000000000000000000027fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff9092169190911790556040517fec0a2ce18c2c66448518f6a0f7199cd7066aba5a22fbab83e615f7df3195dfef90600090a150565b6113d761231f565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691821790925560008054604051929316917f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e227009190a350565b60008060007f000000000000000000000000fb0b3c31eaf58743603e8ee1e122547ec053bf1890508073ffffffffffffffffffffffffffffffffffffffff1663457e8e1e6040518163ffffffff1660e01b81526004016020604051808303816000875af11580156114c2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114e691906130f5565b6003546040517f8a54c52f00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9182166004820181905260006024830181905246604484015285841660648401526084830185905293965092917f000000000000000000000000000000006551c19487814612e58fe068137757581690638a54c52f9060a4016020604051808303816000875af115801561159c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115c09190613371565b6040805160808101825273ffffffffffffffffffffffffffffffffffffffff808416825285811660208301908152878216838501908152606084018b815294517f2b2ea1070000000000000000000000000000000000000000000000000000000081529351831660048501529051821660248401525181166044830152915160648201529195507f00000000000000000000000012f0a3453f63516815fe41c89fae84d218af0faf1690632b2ea10790608401600060405180830381600087803b15801561168d57600080fd5b505af11580156116a1573d6000803e3d6000fd5b5050505061173984600580546116b690613079565b80601f01602080910402602001604051908101604052809291908181526020018280546116e290613079565b801561172f5780601f106117045761010080835404028352916020019161172f565b820191906000526020600020905b81548152906001019060200180831161171257829003601f168201915b5050505050612628565b505050509091565b600080600061174e61268f565b90925090506117826117636020860186612d9a565b61176b6119e6565b6117786020880188612d9a565b87602001356128f8565b61178f6020850185612d9a565b6040517f89afcb4400000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff838116600483015291909116906389afcb449060240160408051808303816000875af11580156117fe573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611822919061338e565b50506040805160c0810190915273ffffffffffffffffffffffffffffffffffffffff82169063aeb0ea21908061185b60208a018a612d9a565b73ffffffffffffffffffffffffffffffffffffffff1681526020018860200160208101906118899190612d9a565b73ffffffffffffffffffffffffffffffffffffffff1681526020016118b460608a0160408b016133b2565b62ffffff1681526020016118ce60808a0160608b016133d7565b60020b81526020016118e660a08a0160808b016133d7565b60020b81526020016118fe60c08a0160a08b01612d9a565b73ffffffffffffffffffffffffffffffffffffffff908116909152604080517fffffffff0000000000000000000000000000000000000000000000000000000060e086901b1681528351831660048201526020840151831660248201529083015162ffffff1660448201526060830151600290810b60648301526080840151900b608482015260a0909201511660a482015260c4016080604051808303816000875af11580156119b2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119d691906133fa565b5091979396509194509192505050565b60003660147f000000000000000000000000ad55f8b65d5738c6f63b54e651a09cc5d873e4d873ffffffffffffffffffffffffffffffffffffffff1633148015611a305750808210155b15611a6057600036611a42838561344d565b611a4d928290613487565b611a56916134b1565b60601c9250505090565b339250505090565b6000806000611a7561268f565b90925090507f00000000000000000000000043000000000000000000000000000000000000046000611aaa6020880188612d9a565b73ffffffffffffffffffffffffffffffffffffffff1603611ae857611ad38187602001356123ef565b50611ae3818388602001356124e8565b611b0b565b611b0b611af86020880188612d9a565b611b006119e6565b8489602001356128f8565b6000611b1a6020870187612d9a565b73ffffffffffffffffffffffffffffffffffffffff1603611b5857611b438186602001356123ef565b50611b53818387602001356124e8565b611b7b565b611b7b611b686020870187612d9a565b611b706119e6565b8488602001356128f8565b6040805160e0810190915273ffffffffffffffffffffffffffffffffffffffff831690636dd4afce9080611bb260208c018c612d9a565b73ffffffffffffffffffffffffffffffffffffffff1681526020018a6020016020810190611be09190612d9a565b73ffffffffffffffffffffffffffffffffffffffff168152602001611c0b60608c0160408d016133b2565b62ffffff168152602001611c2560808c0160608d016133d7565b60020b8152602001611c3d60a08c0160808d016133d7565b60020b8152602001611c5560c08c0160a08d01612d9a565b73ffffffffffffffffffffffffffffffffffffffff168152602001611c786119e6565b73ffffffffffffffffffffffffffffffffffffffff908116909152604080517fffffffff0000000000000000000000000000000000000000000000000000000060e086901b1681528351831660048201526020840151831660248201529083015162ffffff1660448201526060830151600290810b60648301526080840151900b608482015260a0830151821660a482015260c0909201511660c482015260e4015b6080604051808303816000875af1158015611d39573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d5d91906133fa565b50919994985092965092945050505050565b6000806000611d7c61268f565b90925090507f00000000000000000000000043000000000000000000000000000000000000046000611db16020880188612d9a565b73ffffffffffffffffffffffffffffffffffffffff1603611def57611dda8187602001356123ef565b50611dea818388602001356124e8565b611dff565b611dff611af86020880188612d9a565b6000611e0e6020870187612d9a565b73ffffffffffffffffffffffffffffffffffffffff1603611e4c57611e378186602001356123ef565b50611e47818387602001356124e8565b611e5c565b611e5c611b686020870187612d9a565b6040805160c0810190915273ffffffffffffffffffffffffffffffffffffffff83169063aeb0ea219080611e9360208c018c612d9a565b73ffffffffffffffffffffffffffffffffffffffff1681526020018a6020016020810190611ec19190612d9a565b73ffffffffffffffffffffffffffffffffffffffff168152602001611eec60608c0160408d016133b2565b62ffffff168152602001611f0660808c0160608d016133d7565b60020b8152602001611f1e60a08c0160808d016133d7565b60020b8152602001611f3660c08c0160a08d01612d9a565b73ffffffffffffffffffffffffffffffffffffffff908116909152604080517fffffffff0000000000000000000000000000000000000000000000000000000060e086901b1681528351831660048201526020840151831660248201529083015162ffffff1660448201526060830151600290810b60648301526080840151900b608482015260a0909201511660a482015260c401611d1a565b60015474010000000000000000000000000000000000000000900460ff16612024576040517f680d9f2700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040517f1e17c0ca00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff828116600483015260009182917f00000000000000000000000012f0a3453f63516815fe41c89fae84d218af0faf1690631e17c0ca906024016040805180830381865afa1580156120b4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120d891906134f7565b909250905073ffffffffffffffffffffffffffffffffffffffff821615806121fb57507f0000000000000000000000005066a1975be96b777dddf57b496397effddcb4a973ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141580156121a357507f00000000000000000000000073e75e837e4f3884ed474988c304de8a437acbef73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156121fb57507f000000000000000000000000fb0b3c31eaf58743603e8ee1e122547ec053bf1873ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15612232576040517f0907fef200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61223a6119e6565b6040517f6352211e0000000000000000000000000000000000000000000000000000000081526004810183905273ffffffffffffffffffffffffffffffffffffffff91821691841690636352211e90602401602060405180830381865afa1580156122a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122cd9190613371565b73ffffffffffffffffffffffffffffffffffffffff161461231a576040517f4c90cf4400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b505050565b60005473ffffffffffffffffffffffffffffffffffffffff163314610d72576040517fbfcafd3700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000009081169091556000805473ffffffffffffffffffffffffffffffffffffffff848116938216841783556040519116929183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60608147101561242b576040517ff4d678b800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000808473ffffffffffffffffffffffffffffffffffffffff168460405160006040518083038185875af1925050503d8060008114612486576040519150601f19603f3d011682016040523d82523d6000602084013e61248b565b606091505b5091509150811561249e578092506124e0565b8051156124ae5780518082602001fd5b6040517f3204506f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b505092915050565b60405173ffffffffffffffffffffffffffffffffffffffff83811660248301526044820183905261231a91859182169063a9059cbb906064015b604051602081830303815290604052915060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505061293e565b60606000808473ffffffffffffffffffffffffffffffffffffffff16846040516125939190613525565b600060405180830381855af49150503d80600081146125ce576040519150601f19603f3d011682016040523d82523d6000602084013e6125d3565b606091505b509150915081156125e6578092506124e0565b8051156125f65780518082602001fd5b6040517f18cecad500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60606000808473ffffffffffffffffffffffffffffffffffffffff16846040516126529190613525565b6000604051808303816000865af19150503d8060008114612486576040519150601f19603f3d011682016040523d82523d6000602084013e61248b565b60008060007f00000000000000000000000073e75e837e4f3884ed474988c304de8a437acbef90508073ffffffffffffffffffffffffffffffffffffffff1663457e8e1e6040518163ffffffff1660e01b81526004016020604051808303816000875af1158015612704573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061272891906130f5565b6002546040517f8a54c52f00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9182166004820181905260006024830181905246604484015285841660648401526084830185905293965092917f000000000000000000000000000000006551c19487814612e58fe068137757581690638a54c52f9060a4016020604051808303816000875af11580156127de573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128029190613371565b6040805160808101825273ffffffffffffffffffffffffffffffffffffffff808416825285811660208301908152878216838501908152606084018b815294517f2b2ea1070000000000000000000000000000000000000000000000000000000081529351831660048501529051821660248401525181166044830152915160648201529195507f00000000000000000000000012f0a3453f63516815fe41c89fae84d218af0faf1690632b2ea10790608401600060405180830381600087803b1580156128cf57600080fd5b505af11580156128e3573d6000803e3d6000fd5b5050505061173984600480546116b690613079565b60405173ffffffffffffffffffffffffffffffffffffffff8481166024830152838116604483015260648201839052610fbd9186918216906323b872dd90608401612522565b600061296073ffffffffffffffffffffffffffffffffffffffff8416836129d9565b905080516000141580156129855750808060200190518101906129839190613541565b155b1561231a576040517f5274afe700000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff841660048201526024015b60405180910390fd5b60606129e7838360006129f0565b90505b92915050565b606081471015612a2e576040517fcd7860590000000000000000000000000000000000000000000000000000000081523060048201526024016129d0565b6000808573ffffffffffffffffffffffffffffffffffffffff168486604051612a579190613525565b60006040518083038185875af1925050503d8060008114612a94576040519150601f19603f3d011682016040523d82523d6000602084013e612a99565b606091505b5091509150612aa9868383612ab5565b925050505b9392505050565b606082612aca57612ac582612b44565b612aae565b8151158015612aee575073ffffffffffffffffffffffffffffffffffffffff84163b155b15612b3d576040517f9996b31500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff851660048201526024016129d0565b5080612aae565b805115612b545780518082602001fd5b6040517f1425ea4200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600060c08284031215612b9857600080fd5b50919050565b600060408284031215612b9857600080fd5b6000806101008385031215612bc457600080fd5b612bce8484612b86565b9150612bdd8460c08501612b9e565b90509250929050565b60008060006101408486031215612bfc57600080fd5b612c068585612b86565b9250612c158560c08601612b9e565b9150612c25856101008601612b9e565b90509250925092565b803560ff81168114612c3f57600080fd5b919050565b6000806000806000806101808789031215612c5e57600080fd5b612c688888612b86565b9550612c778860c08901612b9e565b94506101008701359350612c8e6101208801612c2e565b9250610140870135915061016087013590509295509295509295565b60005b83811015612cc5578181015183820152602001612cad565b50506000910152565b60008151808452612ce6816020860160208601612caa565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b600073ffffffffffffffffffffffffffffffffffffffff808816835280871660208401525060a06040830152612d5160a0830186612cce565b8281036060840152612d638186612cce565b91505082151560808301529695505050505050565b73ffffffffffffffffffffffffffffffffffffffff81168114610ea957600080fd5b600060208284031215612dac57600080fd5b8135612aae81612d78565b6000806000806101608587031215612dce57600080fd5b612dd88686612b86565b9350612de78660c08701612b9e565b9250612df7866101008701612b9e565b9150610140850135612e0881612d78565b939692955090935050565b60008060006101208486031215612e2957600080fd5b612e338585612b86565b9250612e428560c08601612b9e565b9150610100840135612e5381612d78565b809150509250925092565b60008083601f840112612e7057600080fd5b50813567ffffffffffffffff811115612e8857600080fd5b6020830191508360208260051b8501011115612ea357600080fd5b9250929050565b600080600060408486031215612ebf57600080fd5b8335612eca81612d78565b9250602084013567ffffffffffffffff811115612ee657600080fd5b612ef286828701612e5e565b9497909650939450505050565b60008060208385031215612f1257600080fd5b823567ffffffffffffffff811115612f2957600080fd5b612f3585828601612e5e565b90969095509350505050565b600060208083016020845280855180835260408601915060408160051b87010192506020870160005b82811015612fb6577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc0888603018452612fa4858351612cce565b94509285019290850190600101612f6a565b5092979650505050505050565b60008060008060008060006101a0888a031215612fdf57600080fd5b612fe98989612b86565b9650612ff88960c08a01612b9e565b955061010088013561300981612d78565b945061012088013593506130206101408901612c2e565b92506101608801359150610180880135905092959891949750929550565b60006020828403121561305057600080fd5b813567ffffffffffffffff81111561306757600080fd5b820160a08185031215612aae57600080fd5b600181811c9082168061308d57607f821691505b602082108103612b98577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60006020828403121561310757600080fd5b5051919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe184360301811261317257600080fd5b83018035915067ffffffffffffffff82111561318d57600080fd5b602001915036819003821315612ea357600080fd5b8284823760609190911b7fffffffffffffffffffffffffffffffffffffffff000000000000000000000000169101908152601401919050565b601f82111561231a576000816000526020600020601f850160051c810160208610156132045750805b601f850160051c820191505b8181101561322357828155600101613210565b505050505050565b67ffffffffffffffff8311156132435761324361310e565b613257836132518354613079565b836131db565b6000601f8411600181146132a957600085156132735750838201355b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600387901b1c1916600186901b17835561333f565b6000838152602090207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0861690835b828110156132f857868501358255602094850194600190920191016132d8565b5086821015613333577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff60f88860031b161c19848701351681555b505060018560011b0183555b5050505050565b8015158114610ea957600080fd5b60006020828403121561336657600080fd5b8135612aae81613346565b60006020828403121561338357600080fd5b8151612aae81612d78565b600080604083850312156133a157600080fd5b505080516020909101519092909150565b6000602082840312156133c457600080fd5b813562ffffff81168114612aae57600080fd5b6000602082840312156133e957600080fd5b81358060020b8114612aae57600080fd5b6000806000806080858703121561341057600080fd5b8451935060208501516fffffffffffffffffffffffffffffffff8116811461343757600080fd5b6040860151606090960151949790965092505050565b818103818111156129ea577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000808585111561349757600080fd5b838611156134a457600080fd5b5050820193919092039150565b7fffffffffffffffffffffffffffffffffffffffff00000000000000000000000081358181169160148510156124e05760149490940360031b84901b1690921692915050565b6000806040838503121561350a57600080fd5b825161351581612d78565b6020939093015192949293505050565b60008251613537818460208701612caa565b9190910192915050565b60006020828403121561355357600080fd5b8151612aae8161334656fea2646970667358221220f570ac327e61b3737369b975c6b46a1152832debe8fa731be88da0a193427a8464736f6c63430008180033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000a214a4fc09c42202c404e2976c50373fe5f5b7890000000000000000000000004300000000000000000000000000000000000002000000000000000000000000f237c20584daca970498917470864f4d027de4ca0000000000000000000000002536fe9ab3f511540f2f9e2ec2a805005c3dd800000000000000000000000000454c0c1cf7be9341d82ce0f16979b8689ed4aad0000000000000000000000000ad55f8b65d5738c6f63b54e651a09cc5d873e4d80000000000000000000000005066a1975be96b777dddf57b496397effddcb4a900000000000000000000000073e75e837e4f3884ed474988c304de8a437acbef000000000000000000000000fb0b3c31eaf58743603e8ee1e122547ec053bf18000000000000000000000000000000006551c19487814612e58fe0681377575800000000000000000000000012f0a3453f63516815fe41c89fae84d218af0faf0000000000000000000000004300000000000000000000000000000000000004
-----Decoded View---------------
Arg [0] : owner_ (address): 0xA214a4fc09C42202C404E2976c50373fE5F5B789
Arg [1] : blast_ (address): 0x4300000000000000000000000000000000000002
Arg [2] : gasCollector_ (address): 0xf237c20584DaCA970498917470864f4d027de4ca
Arg [3] : blastPoints_ (address): 0x2536FE9ab3F511540F2f9e2eC2A805005C3Dd800
Arg [4] : pointsOperator_ (address): 0x454c0C1CF7be9341d82ce0F16979B8689ED4AAD0
Arg [5] : multicallForwarder_ (address): 0xAD55F8b65d5738C6f63b54E651A09cC5d873e4d8
Arg [6] : genesisAgentNft_ (address): 0x5066A1975BE96B777ddDf57b496397efFdDcB4A9
Arg [7] : strategyAgentNft_ (address): 0x73E75E837e4F3884ED474988c304dE8A437aCbEf
Arg [8] : explorerAgentNft_ (address): 0xFB0B3C31eAf58743603e8Ee1e122547EC053Bf18
Arg [9] : erc6551Registry_ (address): 0x000000006551c19487814612e58FE06813775758
Arg [10] : agentRegistry_ (address): 0x12F0A3453F63516815fe41c89fAe84d218Af0FAF
Arg [11] : weth_ (address): 0x4300000000000000000000000000000000000004
-----Encoded View---------------
12 Constructor Arguments found :
Arg [0] : 000000000000000000000000a214a4fc09c42202c404e2976c50373fe5f5b789
Arg [1] : 0000000000000000000000004300000000000000000000000000000000000002
Arg [2] : 000000000000000000000000f237c20584daca970498917470864f4d027de4ca
Arg [3] : 0000000000000000000000002536fe9ab3f511540f2f9e2ec2a805005c3dd800
Arg [4] : 000000000000000000000000454c0c1cf7be9341d82ce0f16979b8689ed4aad0
Arg [5] : 000000000000000000000000ad55f8b65d5738c6f63b54e651a09cc5d873e4d8
Arg [6] : 0000000000000000000000005066a1975be96b777dddf57b496397effddcb4a9
Arg [7] : 00000000000000000000000073e75e837e4f3884ed474988c304de8a437acbef
Arg [8] : 000000000000000000000000fb0b3c31eaf58743603e8ee1e122547ec053bf18
Arg [9] : 000000000000000000000000000000006551c19487814612e58fe06813775758
Arg [10] : 00000000000000000000000012f0a3453f63516815fe41c89fae84d218af0faf
Arg [11] : 0000000000000000000000004300000000000000000000000000000000000004
Loading...
Loading
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in ETH
0
Multichain Portfolio | 35 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
[ 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.