ETH Price: $2,976.21 (+2.67%)

Contract

0x56E3Dd5513C5a6Df54EE58d23E026Bf333473ac1
 

Overview

ETH Balance

0 ETH

ETH Value

$0.00

More Info

Private Name Tags

Multichain Info

No addresses found
Transaction Hash
Block
From
To
Create Accounts28707732024-05-01 8:16:01636 days ago1714551361IN
0x56E3Dd55...333473ac1
0 ETH0.000021940.00001409
Create Accounts28707642024-05-01 8:15:43636 days ago1714551343IN
0x56E3Dd55...333473ac1
0 ETH0.000022560.00001414
Create Accounts28707562024-05-01 8:15:27636 days ago1714551327IN
0x56E3Dd55...333473ac1
0 ETH0.00002340.00001416
Create Accounts28707492024-05-01 8:15:13636 days ago1714551313IN
0x56E3Dd55...333473ac1
0 ETH0.000023330.00001415
Create Accounts28707402024-05-01 8:14:55636 days ago1714551295IN
0x56E3Dd55...333473ac1
0 ETH0.000024340.00001408
Create Accounts28707322024-05-01 8:14:39636 days ago1714551279IN
0x56E3Dd55...333473ac1
0 ETH0.000023320.00001407
Create Accounts28707252024-05-01 8:14:25636 days ago1714551265IN
0x56E3Dd55...333473ac1
0 ETH0.000023330.00001409
Create Accounts28707182024-05-01 8:14:11636 days ago1714551251IN
0x56E3Dd55...333473ac1
0 ETH0.000022160.00001408
Create Accounts28707102024-05-01 8:13:55636 days ago1714551235IN
0x56E3Dd55...333473ac1
0 ETH0.000025820.00001409
Create Accounts28707012024-05-01 8:13:37636 days ago1714551217IN
0x56E3Dd55...333473ac1
0 ETH0.000025820.00001411
Create Accounts28706942024-05-01 8:13:23636 days ago1714551203IN
0x56E3Dd55...333473ac1
0 ETH0.000025310.00001412
Create Accounts28706862024-05-01 8:13:07636 days ago1714551187IN
0x56E3Dd55...333473ac1
0 ETH0.000025590.00001409
Create Accounts28706792024-05-01 8:12:53636 days ago1714551173IN
0x56E3Dd55...333473ac1
0 ETH0.000025860.00001409
Create Accounts28706702024-05-01 8:12:35636 days ago1714551155IN
0x56E3Dd55...333473ac1
0 ETH0.000027170.00001411
Create Accounts28706622024-05-01 8:12:19636 days ago1714551139IN
0x56E3Dd55...333473ac1
0 ETH0.000027080.00001411
Create Accounts28706552024-05-01 8:12:05636 days ago1714551125IN
0x56E3Dd55...333473ac1
0 ETH0.000026490.00001409
Create Accounts28706472024-05-01 8:11:49636 days ago1714551109IN
0x56E3Dd55...333473ac1
0 ETH0.000025070.00001405
Create Accounts28706382024-05-01 8:11:31636 days ago1714551091IN
0x56E3Dd55...333473ac1
0 ETH0.00002560.00001404
Create Accounts28706312024-05-01 8:11:17636 days ago1714551077IN
0x56E3Dd55...333473ac1
0 ETH0.000026740.000014
Create Accounts28706222024-05-01 8:10:59636 days ago1714551059IN
0x56E3Dd55...333473ac1
0 ETH0.000026080.00001399
Create Accounts28706142024-05-01 8:10:43636 days ago1714551043IN
0x56E3Dd55...333473ac1
0 ETH0.000026080.00001398
Create Accounts28706072024-05-01 8:10:29636 days ago1714551029IN
0x56E3Dd55...333473ac1
0 ETH0.000026630.00001392
Create Accounts28705992024-05-01 8:10:13636 days ago1714551013IN
0x56E3Dd55...333473ac1
0 ETH0.000027520.00001386
Create Accounts28705922024-05-01 8:09:59636 days ago1714550999IN
0x56E3Dd55...333473ac1
0 ETH0.000027680.00001382
Create Accounts28705852024-05-01 8:09:45636 days ago1714550985IN
0x56E3Dd55...333473ac1
0 ETH0.000028540.00001381
View all transactions

Latest 1 internal transaction

Advanced mode:
Parent Transaction Hash Block From To
28689202024-05-01 7:14:15636 days ago1714547655  Contract Creation0 ETH

Cross-Chain Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
BlastooorAccountFactoryV2

Compiler Version
v0.8.24+commit.e11b9ed9

Optimization Enabled:
Yes with 200000 runs

Other Settings:
default evmVersion
// SPDX-License-Identifier: none
pragma solidity 0.8.24;

import { Calls } from "./../libraries/Calls.sol";
import { Errors } from "./../libraries/Errors.sol";
import { IAgents } from "./../interfaces/tokens/IAgents.sol";
import { IBlastooorAccountFactoryV2 } from "./../interfaces/factory/IBlastooorAccountFactoryV2.sol";
import { IAgentRegistry } from "./../interfaces/utils/IAgentRegistry.sol";
import { IERC6551Registry } from "./../interfaces/erc6551/IERC6551Registry.sol";
import { Blastable } from "./../utils/Blastable.sol";
import { Ownable2Step } from "./../utils/Ownable2Step.sol";
import { Multicall } from "./../utils/Multicall.sol";


/**
 * @title BlastooorAccountFactoryV2
 * @author AgentFi
 * @notice A factory for Agent accounts.
 *
 * Creates new agents for an existing collection. Loops over the supply and if an nft doesn't have an account, creates one.
 */
contract BlastooorAccountFactoryV2 is IBlastooorAccountFactoryV2, Blastable, Ownable2Step, Multicall {

    /***************************************
    STATE VARIABLES
    ***************************************/

    address internal immutable _agentNft;
    address internal immutable _agentRegistry;
    address internal immutable _erc6551Registry;

    AgentCreationSettings internal _agentCreationSettings;

    uint256 internal _lastCheckedAgentID;

    /***************************************
    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 agentNft_ The Agents contract.
     * @param agentRegistry_ The AgentRegistry contract.
     * @param erc6551Registry_ The ERC6551Registry contract.
     */
    constructor(
        address owner_,
        address blast_,
        address gasCollector_,
        address blastPoints_,
        address pointsOperator_,
        address agentNft_,
        address agentRegistry_,
        address erc6551Registry_
    ) Blastable(blast_, gasCollector_, blastPoints_, pointsOperator_) {
        _transferOwnership(owner_);
        _agentNft = agentNft_;
        _agentRegistry = agentRegistry_;
        _erc6551Registry = erc6551Registry_;
    }

    /***************************************
    VIEW FUNCTIONS
    ***************************************/

    /**
     * @notice Gets the agent creation settings.
     * @return agentNft The agents contract.
     * @return agentImplementation The agent implementation.
     * @return initializationCalls The calls to initialize the agent.
     */
    function getAgentCreationSettings() external view override returns (
        address agentNft,
        address agentImplementation,
        bytes[] memory initializationCalls
    ) {
        agentNft = _agentNft;
        AgentCreationSettings memory creationSettings = _agentCreationSettings;
        agentImplementation = creationSettings.agentImplementation;
        initializationCalls = creationSettings.initializationCalls;
    }

    /**
    * @notice Gets the ID of the last checked agent.
    * @return agentID The ID of the agent.
    */
    function lastCheckedAgentID() external view override returns (uint256 agentID) {
        agentID = _lastCheckedAgentID;
    }

    /***************************************
    OWNER FUNCTIONS
    ***************************************/

    /**
     * @notice Posts a new AgentCreationSettings.
     * Can only be called by the contract owner.
     * @param creationSettings The new creation settings to post.
     */
    function postAgentCreationSettings(
        AgentCreationSettings calldata creationSettings
    ) external payable override onlyOwner {
        // checks
        Calls.verifyHasCode(creationSettings.agentImplementation);
        // post
        _agentCreationSettings = creationSettings;
        emit AgentCreationSettingsPosted();
    }

    /**
     * @notice Creates new accounts.
     * Can only be called by the contract owner.
     */
    function createAccounts() external payable override onlyOwner {
        // checks and early exit
        address agentNft = _agentNft;
        uint256 agentID = _lastCheckedAgentID;
        uint256 supply = IAgents(agentNft).totalSupply();
        if(agentID >= supply) revert Errors.NoMoreItemsInQueue();
        // setup
        IAgentRegistry registry = IAgentRegistry(_agentRegistry);
        AgentCreationSettings memory creationSettings = _agentCreationSettings;
        bytes32 salt = bytes32(uint256(1));
        // loop over agents
        while(true) {
            // exit when done
            ++agentID;
            if(agentID > supply) {
                --agentID; // mark this one as not yet processed
                break;
            }
            // early exit for out of gas
            uint256 gasl = gasleft();
            uint256 gasStart = gasl;
            if(gasl < 50_000) {
                --agentID; // mark this one as not yet processed
                break;
            }
            // if the agent doesnt have an account
            if(registry.getTbasOfNft(agentNft, agentID).length == 0) {
                // early exit for out of gas 2
                gasl = gasleft();
                if(gasl < 800_000) {
                    --agentID; // mark this one as not yet processed
                    break;
                }
                // create account
                address account = IERC6551Registry(_erc6551Registry).createAccount(
                    creationSettings.agentImplementation,
                    salt,
                    block.chainid,
                    agentNft,
                    agentID
                );
                // register account
                registry.registerAgent(IAgentRegistry.RegisterAgentParam({
                    agentAddress: account,
                    implementationAddress: creationSettings.agentImplementation,
                    collection: agentNft,
                    agentID: agentID
                }));
                // initialize account
                for(uint256 i = 0; i < creationSettings.initializationCalls.length; ++i) {
                    Calls.functionCall(account, creationSettings.initializationCalls[i]);
                }
            }
        }
        // save progress
        _lastCheckedAgentID = agentID;
    }

}

// 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.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: none
pragma solidity 0.8.24;


/**
 * @title IBlastooorAccountFactoryV2
 * @author AgentFi
 * @notice A factory for Agent accounts.
 *
 * Creates new agents for an existing collection. Loops over the supply and if an nft doesn't have an account, creates one.
 */
interface IBlastooorAccountFactoryV2 {

    /***************************************
    EVENTS
    ***************************************/

    /// @notice Emitted when a new AgentCreationSettings is posted.
    event AgentCreationSettingsPosted();

    /***************************************
    VIEW FUNCTIONS
    ***************************************/

    /**
     * @notice Gets the agent creation settings.
     * @return agentNft The agents contract.
     * @return agentImplementation The agent implementation.
     * @return initializationCalls The calls to initialize the agent.
     */
    function getAgentCreationSettings() external view returns (
        address agentNft,
        address agentImplementation,
        bytes[] memory initializationCalls
    );

    /**
    * @notice Gets the ID of the last checked agent.
    * @return agentID The ID of the agent.
    */
    function lastCheckedAgentID() external view returns (uint256 agentID);

    /***************************************
    OWNER FUNCTIONS
    ***************************************/

    struct AgentCreationSettings {
        address agentImplementation;
        bytes[] initializationCalls;
    }

    /**
     * @notice Posts a new AgentCreationSettings.
     * Can only be called by the contract owner.
     * @param creationSettings The new creation settings to post.
     */
    function postAgentCreationSettings(
        AgentCreationSettings calldata creationSettings
    ) external payable;

    /**
     * @notice Creates new accounts.
     * Can only be called by the contract owner.
     */
    function createAccounts() external payable;
}

// SPDX-License-Identifier: none
pragma solidity 0.8.24;

import { IERC721Enumerable } from "@openzeppelin/contracts/token/ERC721/extensions/IERC721Enumerable.sol";


/**
 * @title IAgents
 * @author AgentFi
 * @notice The Agents 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 extension. Additional information about each agent can be queried via [`getAgentInfo()`](#getagentinfo) and [`exists()`](#exists).
 */
interface IAgents 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 the address of an agent.
     * Reverts if the agent does not exist.
     * @param agentID The ID of the agent to query.
     * @return agentAddress The address of the agent account.
     * @return implementationAddress The address of the agent implementation.
     */
    function getAgentInfo(uint256 agentID) external view returns (
        address agentAddress,
        address implementationAddress
    );

    /**
     * @notice Returns the ID of an agent given its address.
     * Returns ID 0 if the address is not an agent.
     * @param agentAddress The address of the agent to query.
     * @return agentID The ID of the agent.
     */
    function getAgentID(address agentAddress) external view returns (uint256 agentID);

    /**
     * @notice Given the address of the agent, returns if it is a known agent.
     * @param agentAddress The address of the agent to query.
     * @return isAgent True if is a known agent, false otherwise.
     */
    function isAddressAgent(address agentAddress) external view returns (bool isAgent);

    /**
     * @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);

    /**
     * @notice Returns the address of the ERC6551 registry.
     * @return registry_ The address of the registry.
     */
    function getERC6551Registry() external view returns (address registry_);

    /***************************************
    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.
     * @param implementation The address of the implementation to use in the new agent.
     * @return agentID The ID of the newly created agent.
     * @return agentAddress The address of the newly created agent.
     */
    function createAgent(
        address implementation
    ) external payable returns (
        uint256 agentID,
        address agentAddress
    );

    /***************************************
    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 IMulticall
 * @author AgentFi
 * @notice Provides a function to batch together multiple calls in a single external call.
 */
interface IMulticall {

    /**
     * @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 payable 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();
    }
}

File 17 of 20 : Errors.sol
// 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();
    /// @notice Thrown when trying to create an account that already exists.
    error AccountAlreadyExists();

    // 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

    // 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 {}
}

File 19 of 20 : Multicall.sol
// SPDX-License-Identifier: none
pragma solidity 0.8.24;

import { Calls } from "./../libraries/Calls.sol";
import { IMulticall } from "./../interfaces/utils/IMulticall.sol";


/**
 * @title Multicall
 * @author AgentFi
 * @notice Provides a function to batch together multiple calls in a single external call.
 */
abstract contract Multicall is IMulticall {

    /**
     * @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 payable virtual returns (bytes[] memory results) {
        results = new bytes[](data.length);
        for (uint256 i = 0; i < data.length; ) {
            results[i] = Calls.functionDelegateCall(address(this), data[i]);
            unchecked { i++; }
        }
        return results;
    }
}

// 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);
    }
}

Settings
{
  "optimizer": {
    "enabled": true,
    "runs": 200000
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "libraries": {}
}

Contract Security Audit

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":"agentNft_","type":"address"},{"internalType":"address","name":"agentRegistry_","type":"address"},{"internalType":"address","name":"erc6551Registry_","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":"DelegateCallFailed","type":"error"},{"inputs":[],"name":"FailedInnerCall","type":"error"},{"inputs":[],"name":"InsufficientBalance","type":"error"},{"inputs":[],"name":"NoMoreItemsInQueue","type":"error"},{"inputs":[],"name":"NotAContract","type":"error"},{"inputs":[],"name":"NotContractOwner","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":[],"name":"createAccounts","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"getAgentCreationSettings","outputs":[{"internalType":"address","name":"agentNft","type":"address"},{"internalType":"address","name":"agentImplementation","type":"address"},{"internalType":"bytes[]","name":"initializationCalls","type":"bytes[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lastCheckedAgentID","outputs":[{"internalType":"uint256","name":"agentID","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes[]","name":"data","type":"bytes[]"}],"name":"multicall","outputs":[{"internalType":"bytes[]","name":"results","type":"bytes[]"}],"stateMutability":"payable","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":"agentImplementation","type":"address"},{"internalType":"bytes[]","name":"initializationCalls","type":"bytes[]"}],"internalType":"struct IBlastooorAccountFactoryV2.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"},{"stateMutability":"payable","type":"receive"}]

61016060405234801562000011575f80fd5b5060405162001f2338038062001f23833981016040819052620000349162000354565b6001600160a01b03808816608081905281881660a05281871660c05290851660e05260408051600481526024810182526020810180516001600160e01b031663388a0bbd60e11b17905290518992899289928992916200009491620003f7565b5f604051808303815f865af19150503d805f8114620000cf576040519150601f19603f3d011682016040523d82523d5f602084013e620000d4565b606091505b505060408051600481526024810182526020810180516001600160e01b0316634e606c4760e01b17905290516001600160a01b0387169250620001189190620003f7565b5f604051808303815f865af19150503d805f811462000153576040519150601f19603f3d011682016040523d82523d5f602084013e62000158565b606091505b5050506001600160a01b03831615620001ff576040516001600160a01b03848116602483015285169060440160408051601f198184030181529181526020820180516001600160e01b0316631d70c8d360e31b17905251620001bb9190620003f7565b5f604051808303815f865af19150503d805f8114620001f6576040519150601f19603f3d011682016040523d82523d5f602084013e620001fb565b606091505b5050505b6001600160a01b03811615620002a3576040516001600160a01b03828116602483015283169060440160408051601f198184030181529181526020820180516001600160e01b03166336b91f2b60e01b179052516200025f9190620003f7565b5f604051808303815f865af19150503d805f81146200029a576040519150601f19603f3d011682016040523d82523d5f602084013e6200029f565b606091505b5050505b50505050620002b888620002df60201b60201c565b6001600160a01b039283166101005290821661012052166101405250620004259350505050565b600180546001600160a01b03199081169091555f80546001600160a01b03848116938216841783556040519116929183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b80516001600160a01b03811681146200034f575f80fd5b919050565b5f805f805f805f80610100898b0312156200036d575f80fd5b620003788962000338565b97506200038860208a0162000338565b96506200039860408a0162000338565b9550620003a860608a0162000338565b9450620003b860808a0162000338565b9350620003c860a08a0162000338565b9250620003d860c08a0162000338565b9150620003e860e08a0162000338565b90509295985092959890939650565b5f82515f5b81811015620004185760208186018101518583015201620003fc565b505f920191825250919050565b60805160a05160c05160e051610100516101205161014051611aac620004775f395f6109de01525f61077d01525f81816102a8015261067101525f50505f61020301525f50505f60ea0152611aac5ff3fe6080604052600436106100d1575f3560e01c80638dccd3201161007c578063b2bd6b5011610057578063b2bd6b50146101f5578063e30c397814610227578063e5330ef314610251578063f2fde38b14610259575f80fd5b80638dccd320146101a557806399f6b401146101c2578063ac9650d8146101d5575f80fd5b806379ba5097116100ac57806379ba5097146101615780638a179be4146101695780638da5cb5b1461017c575f80fd5b8063175e1a7d146100dc57806356b1c3e914610134578063715018a614610157575f80fd5b366100d857005b5f80fd5b3480156100e7575f80fd5b507f00000000000000000000000000000000000000000000000000000000000000005b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b34801561013f575f80fd5b5061014861026c565b60405161012b93929190611279565b61015f6103a2565b005b61015f6103b5565b61015f610177366004611323565b610414565b348015610187575f80fd5b505f5473ffffffffffffffffffffffffffffffffffffffff1661010a565b3480156101b0575f80fd5b5060045460405190815260200161012b565b61015f6101d0366004611374565b610527565b6101e86101e33660046113ab565b61057e565b60405161012b91906113ea565b348015610200575f80fd5b507f000000000000000000000000000000000000000000000000000000000000000061010a565b348015610232575f80fd5b5060015473ffffffffffffffffffffffffffffffffffffffff1661010a565b61015f610666565b61015f6102673660046113fc565b610b5f565b6040805180820182526002805473ffffffffffffffffffffffffffffffffffffffff1682526003805484516020828102820181019096528181527f0000000000000000000000000000000000000000000000000000000000000000955f956060958795919490938386019390929190879084015b82821015610388578382905f5260205f200180546102fd90611417565b80601f016020809104026020016040519081016040528092919081815260200182805461032990611417565b80156103745780601f1061034b57610100808354040283529160200191610374565b820191905f5260205f20905b81548152906001019060200180831161035757829003601f168201915b5050505050815260200190600101906102e0565b505050915250508051602090910151949590949350915050565b6103aa610bdc565b6103b35f610c2c565b565b600154339073ffffffffffffffffffffffffffffffffffffffff168114610408576040517f3d6f519e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61041181610c2c565b50565b61041c610bdc565b5f5b81811015610521575f83838381811061043957610439611468565b905060200201602081019061044e91906113fc565b905073ffffffffffffffffffffffffffffffffffffffff811661047b576104758547610caa565b50610518565b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201528190610516908290889073ffffffffffffffffffffffffffffffffffffffff8316906370a0823190602401602060405180830381865afa1580156104ed573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906105119190611495565b610d9f565b505b5060010161041e565b50505050565b61052f610bdc565b61054461053f60208301836113fc565b610e31565b80600261055182826116cf565b50506040517fec0a2ce18c2c66448518f6a0f7199cd7066aba5a22fbab83e615f7df3195dfef905f90a150565b60608167ffffffffffffffff8111156105995761059961150d565b6040519080825280602002602001820160405280156105cc57816020015b60608152602001906001900390816105b75790505b5090505f5b8281101561065f5761063a308585848181106105ef576105ef611468565b905060200281019061060191906114ac565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284375f92019190915250610e7192505050565b82828151811061064c5761064c611468565b60209081029190910101526001016105d1565b5092915050565b61066e610bdc565b5f7f000000000000000000000000000000000000000000000000000000000000000090505f60045490505f8273ffffffffffffffffffffffffffffffffffffffff166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156106e2573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906107069190611495565b9050808210610741576040517f22ba3f2a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040805180820182526002805473ffffffffffffffffffffffffffffffffffffffff1682526003805484516020828102820181019096528181527f0000000000000000000000000000000000000000000000000000000000000000955f959493818601939091879084015b82821015610854578382905f5260205f200180546107c990611417565b80601f01602080910402602001604051908101604052809291908181526020018280546107f590611417565b80156108405780601f1061081757610100808354040283529160200191610840565b820191905f5260205f20905b81548152906001019060200180831161082357829003601f168201915b5050505050815260200190600101906107ac565b505050915250909150600190505b61086b85611865565b9450838511156108855761087e8561189c565b9450610b52565b5f5a90508061c3508110156108a65761089d8761189c565b96505050610b52565b6040517fed250bf300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff89811660048301526024820189905286169063ed250bf3906044015f60405180830381865afa158015610916573d5f803e3d5ffd5b505050506040513d5f823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016820160405261095b9190810190611948565b515f03610b4b575a9150620c35008210156109795761089d8761189c565b83516040517f8a54c52f00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9182166004820152602481018590524660448201528982166064820152608481018990525f917f00000000000000000000000000000000000000000000000000000000000000001690638a54c52f9060a4016020604051808303815f875af1158015610a24573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610a489190611a21565b6040805160808101825273ffffffffffffffffffffffffffffffffffffffff838116825288518116602083019081528d8216838501908152606084018e815294517f2b2ea107000000000000000000000000000000000000000000000000000000008152935183166004850152905182166024840152518116604483015291516064820152919250871690632b2ea107906084015f604051808303815f87803b158015610af3575f80fd5b505af1158015610b05573d5f803e3d5ffd5b505050505f5b856020015151811015610b4857610b3f8287602001518381518110610b3257610b32611468565b6020026020010151610f2c565b50600101610b0b565b50505b5050610862565b5050506004919091555050565b610b67610bdc565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff8381169182179092555f8054604051929316917f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e227009190a350565b5f5473ffffffffffffffffffffffffffffffffffffffff1633146103b3576040517fbfcafd3700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000009081169091555f805473ffffffffffffffffffffffffffffffffffffffff848116938216841783556040519116929183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b606081471015610ce6576040517ff4d678b800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f808473ffffffffffffffffffffffffffffffffffffffff16846040515f6040518083038185875af1925050503d805f8114610d3d576040519150601f19603f3d011682016040523d82523d5f602084013e610d42565b606091505b50915091508115610d5557809250610d97565b805115610d655780518082602001fd5b6040517f3204506f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b505092915050565b6040805173ffffffffffffffffffffffffffffffffffffffff8416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb00000000000000000000000000000000000000000000000000000000179052610e2c908490610f8e565b505050565b803b5f819003610e6d576040517f09ee12d500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5050565b60605f808473ffffffffffffffffffffffffffffffffffffffff1684604051610e9a9190611a3c565b5f60405180830381855af49150503d805f8114610ed2576040519150601f19603f3d011682016040523d82523d5f602084013e610ed7565b606091505b50915091508115610eea57809250610d97565b805115610efa5780518082602001fd5b6040517f18cecad500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60605f808473ffffffffffffffffffffffffffffffffffffffff1684604051610f559190611a3c565b5f604051808303815f865af19150503d805f8114610d3d576040519150601f19603f3d011682016040523d82523d5f602084013e610d42565b5f610faf73ffffffffffffffffffffffffffffffffffffffff841683611027565b905080515f14158015610fd3575080806020019051810190610fd19190611a57565b155b15610e2c576040517f5274afe700000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff841660048201526024015b60405180910390fd5b606061103483835f61103b565b9392505050565b606081471015611079576040517fcd78605900000000000000000000000000000000000000000000000000000000815230600482015260240161101e565b5f808573ffffffffffffffffffffffffffffffffffffffff1684866040516110a19190611a3c565b5f6040518083038185875af1925050503d805f81146110db576040519150601f19603f3d011682016040523d82523d5f602084013e6110e0565b606091505b50915091506110f08683836110fa565b9695505050505050565b60608261110f5761110a82611189565b611034565b8151158015611133575073ffffffffffffffffffffffffffffffffffffffff84163b155b15611182576040517f9996b31500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8516600482015260240161101e565b5080611034565b8051156111995780518082602001fd5b6040517f1425ea4200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b838110156111e55781810151838201526020016111cd565b50505f910152565b5f82825180855260208086019550808260051b8401018186015f5b8481101561126c577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe080878503018a528251805180865261124e818888018985016111cb565b9a86019a601f01909116939093018401925090830190600101611208565b5090979650505050505050565b5f73ffffffffffffffffffffffffffffffffffffffff8086168352808516602084015250606060408301526112b160608301846111ed565b95945050505050565b73ffffffffffffffffffffffffffffffffffffffff81168114610411575f80fd5b5f8083601f8401126112eb575f80fd5b50813567ffffffffffffffff811115611302575f80fd5b6020830191508360208260051b850101111561131c575f80fd5b9250929050565b5f805f60408486031215611335575f80fd5b8335611340816112ba565b9250602084013567ffffffffffffffff81111561135b575f80fd5b611367868287016112db565b9497909650939450505050565b5f60208284031215611384575f80fd5b813567ffffffffffffffff81111561139a575f80fd5b820160408185031215611034575f80fd5b5f80602083850312156113bc575f80fd5b823567ffffffffffffffff8111156113d2575f80fd5b6113de858286016112db565b90969095509350505050565b602081525f61103460208301846111ed565b5f6020828403121561140c575f80fd5b8135611034816112ba565b600181811c9082168061142b57607f821691505b602082108103611462577f4e487b71000000000000000000000000000000000000000000000000000000005f52602260045260245ffd5b50919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b5f602082840312156114a5575f80fd5b5051919050565b5f8083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe18436030181126114df575f80fd5b83018035915067ffffffffffffffff8211156114f9575f80fd5b60200191503681900382131561131c575f80fd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5b81811015610e6d575f8155600101611568565b601f821115610e2c57805f5260205f20601f840160051c810160208510156115a05750805b6115b2601f850160051c830182611567565b5050505050565b67ffffffffffffffff8311156115d1576115d161150d565b6115e5836115df8354611417565b8361157b565b5f601f841160018114611635575f85156115ff5750838201355b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600387901b1c1916600186901b1783556115b2565b5f838152602081207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08716915b828110156116825786850135825560209485019460019092019101611662565b50868210156116bd577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff60f88860031b161c19848701351681555b505060018560011b0183555050505050565b81356116da816112ba565b73ffffffffffffffffffffffffffffffffffffffff81167fffffffffffffffffffffffff00000000000000000000000000000000000000008354161782555060018082016020808501357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1863603018112611753575f80fd5b8501803567ffffffffffffffff81111561176b575f80fd5b60208201915060058160051b3603831315611784575f80fd5b6801000000000000000082111561179d5761179d61150d565b84548286558083101561181e575f868152602090208381019082015b8082101561181b576117cb8254611417565b801561181157601f808211600181146117e6575f855561180e565b5f85815260209020611800838501891c82018e8301611567565b505f85815260208120818755555b50505b50908801906117b9565b50505b50505f938452602084209382905b8281101561185a5761183e82856114ac565b61184981838a6115b9565b50509486019490840190860161182c565b505050505050505050565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036118955761189561153a565b5060010190565b5f816118aa576118aa61153a565b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190565b6040805190810167ffffffffffffffff811182821017156118f3576118f361150d565b60405290565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff811182821017156119405761194061150d565b604052919050565b5f6020808385031215611959575f80fd5b825167ffffffffffffffff80821115611970575f80fd5b818501915085601f830112611983575f80fd5b8151818111156119955761199561150d565b6119a3848260051b016118f9565b818152848101925060069190911b8301840190878211156119c2575f80fd5b928401925b81841015611a1657604084890312156119de575f80fd5b6119e66118d0565b84516119f1816112ba565b815284860151611a00816112ba565b81870152835260409390930192918401916119c7565b979650505050505050565b5f60208284031215611a31575f80fd5b8151611034816112ba565b5f8251611a4d8184602087016111cb565b9190910192915050565b5f60208284031215611a67575f80fd5b81518015158114611034575f80fdfea264697066735822122013cba55b3dcb956de986edd80495d1a6636499efd22232f16b2dcccb0fb3408264736f6c63430008180033000000000000000000000000a214a4fc09c42202c404e2976c50373fe5f5b7890000000000000000000000004300000000000000000000000000000000000002000000000000000000000000f237c20584daca970498917470864f4d027de4ca0000000000000000000000002536fe9ab3f511540f2f9e2ec2a805005c3dd800000000000000000000000000454c0c1cf7be9341d82ce0f16979b8689ed4aad00000000000000000000000005066a1975be96b777dddf57b496397effddcb4a900000000000000000000000012f0a3453f63516815fe41c89fae84d218af0faf000000000000000000000000000000006551c19487814612e58fe06813775758

Deployed Bytecode

0x6080604052600436106100d1575f3560e01c80638dccd3201161007c578063b2bd6b5011610057578063b2bd6b50146101f5578063e30c397814610227578063e5330ef314610251578063f2fde38b14610259575f80fd5b80638dccd320146101a557806399f6b401146101c2578063ac9650d8146101d5575f80fd5b806379ba5097116100ac57806379ba5097146101615780638a179be4146101695780638da5cb5b1461017c575f80fd5b8063175e1a7d146100dc57806356b1c3e914610134578063715018a614610157575f80fd5b366100d857005b5f80fd5b3480156100e7575f80fd5b507f00000000000000000000000043000000000000000000000000000000000000025b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b34801561013f575f80fd5b5061014861026c565b60405161012b93929190611279565b61015f6103a2565b005b61015f6103b5565b61015f610177366004611323565b610414565b348015610187575f80fd5b505f5473ffffffffffffffffffffffffffffffffffffffff1661010a565b3480156101b0575f80fd5b5060045460405190815260200161012b565b61015f6101d0366004611374565b610527565b6101e86101e33660046113ab565b61057e565b60405161012b91906113ea565b348015610200575f80fd5b507f0000000000000000000000002536fe9ab3f511540f2f9e2ec2a805005c3dd80061010a565b348015610232575f80fd5b5060015473ffffffffffffffffffffffffffffffffffffffff1661010a565b61015f610666565b61015f6102673660046113fc565b610b5f565b6040805180820182526002805473ffffffffffffffffffffffffffffffffffffffff1682526003805484516020828102820181019096528181527f0000000000000000000000005066a1975be96b777dddf57b496397effddcb4a9955f956060958795919490938386019390929190879084015b82821015610388578382905f5260205f200180546102fd90611417565b80601f016020809104026020016040519081016040528092919081815260200182805461032990611417565b80156103745780601f1061034b57610100808354040283529160200191610374565b820191905f5260205f20905b81548152906001019060200180831161035757829003601f168201915b5050505050815260200190600101906102e0565b505050915250508051602090910151949590949350915050565b6103aa610bdc565b6103b35f610c2c565b565b600154339073ffffffffffffffffffffffffffffffffffffffff168114610408576040517f3d6f519e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61041181610c2c565b50565b61041c610bdc565b5f5b81811015610521575f83838381811061043957610439611468565b905060200201602081019061044e91906113fc565b905073ffffffffffffffffffffffffffffffffffffffff811661047b576104758547610caa565b50610518565b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201528190610516908290889073ffffffffffffffffffffffffffffffffffffffff8316906370a0823190602401602060405180830381865afa1580156104ed573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906105119190611495565b610d9f565b505b5060010161041e565b50505050565b61052f610bdc565b61054461053f60208301836113fc565b610e31565b80600261055182826116cf565b50506040517fec0a2ce18c2c66448518f6a0f7199cd7066aba5a22fbab83e615f7df3195dfef905f90a150565b60608167ffffffffffffffff8111156105995761059961150d565b6040519080825280602002602001820160405280156105cc57816020015b60608152602001906001900390816105b75790505b5090505f5b8281101561065f5761063a308585848181106105ef576105ef611468565b905060200281019061060191906114ac565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284375f92019190915250610e7192505050565b82828151811061064c5761064c611468565b60209081029190910101526001016105d1565b5092915050565b61066e610bdc565b5f7f0000000000000000000000005066a1975be96b777dddf57b496397effddcb4a990505f60045490505f8273ffffffffffffffffffffffffffffffffffffffff166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156106e2573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906107069190611495565b9050808210610741576040517f22ba3f2a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040805180820182526002805473ffffffffffffffffffffffffffffffffffffffff1682526003805484516020828102820181019096528181527f00000000000000000000000012f0a3453f63516815fe41c89fae84d218af0faf955f959493818601939091879084015b82821015610854578382905f5260205f200180546107c990611417565b80601f01602080910402602001604051908101604052809291908181526020018280546107f590611417565b80156108405780601f1061081757610100808354040283529160200191610840565b820191905f5260205f20905b81548152906001019060200180831161082357829003601f168201915b5050505050815260200190600101906107ac565b505050915250909150600190505b61086b85611865565b9450838511156108855761087e8561189c565b9450610b52565b5f5a90508061c3508110156108a65761089d8761189c565b96505050610b52565b6040517fed250bf300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff89811660048301526024820189905286169063ed250bf3906044015f60405180830381865afa158015610916573d5f803e3d5ffd5b505050506040513d5f823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016820160405261095b9190810190611948565b515f03610b4b575a9150620c35008210156109795761089d8761189c565b83516040517f8a54c52f00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9182166004820152602481018590524660448201528982166064820152608481018990525f917f000000000000000000000000000000006551c19487814612e58fe068137757581690638a54c52f9060a4016020604051808303815f875af1158015610a24573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610a489190611a21565b6040805160808101825273ffffffffffffffffffffffffffffffffffffffff838116825288518116602083019081528d8216838501908152606084018e815294517f2b2ea107000000000000000000000000000000000000000000000000000000008152935183166004850152905182166024840152518116604483015291516064820152919250871690632b2ea107906084015f604051808303815f87803b158015610af3575f80fd5b505af1158015610b05573d5f803e3d5ffd5b505050505f5b856020015151811015610b4857610b3f8287602001518381518110610b3257610b32611468565b6020026020010151610f2c565b50600101610b0b565b50505b5050610862565b5050506004919091555050565b610b67610bdc565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff8381169182179092555f8054604051929316917f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e227009190a350565b5f5473ffffffffffffffffffffffffffffffffffffffff1633146103b3576040517fbfcafd3700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000009081169091555f805473ffffffffffffffffffffffffffffffffffffffff848116938216841783556040519116929183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b606081471015610ce6576040517ff4d678b800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f808473ffffffffffffffffffffffffffffffffffffffff16846040515f6040518083038185875af1925050503d805f8114610d3d576040519150601f19603f3d011682016040523d82523d5f602084013e610d42565b606091505b50915091508115610d5557809250610d97565b805115610d655780518082602001fd5b6040517f3204506f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b505092915050565b6040805173ffffffffffffffffffffffffffffffffffffffff8416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb00000000000000000000000000000000000000000000000000000000179052610e2c908490610f8e565b505050565b803b5f819003610e6d576040517f09ee12d500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5050565b60605f808473ffffffffffffffffffffffffffffffffffffffff1684604051610e9a9190611a3c565b5f60405180830381855af49150503d805f8114610ed2576040519150601f19603f3d011682016040523d82523d5f602084013e610ed7565b606091505b50915091508115610eea57809250610d97565b805115610efa5780518082602001fd5b6040517f18cecad500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60605f808473ffffffffffffffffffffffffffffffffffffffff1684604051610f559190611a3c565b5f604051808303815f865af19150503d805f8114610d3d576040519150601f19603f3d011682016040523d82523d5f602084013e610d42565b5f610faf73ffffffffffffffffffffffffffffffffffffffff841683611027565b905080515f14158015610fd3575080806020019051810190610fd19190611a57565b155b15610e2c576040517f5274afe700000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff841660048201526024015b60405180910390fd5b606061103483835f61103b565b9392505050565b606081471015611079576040517fcd78605900000000000000000000000000000000000000000000000000000000815230600482015260240161101e565b5f808573ffffffffffffffffffffffffffffffffffffffff1684866040516110a19190611a3c565b5f6040518083038185875af1925050503d805f81146110db576040519150601f19603f3d011682016040523d82523d5f602084013e6110e0565b606091505b50915091506110f08683836110fa565b9695505050505050565b60608261110f5761110a82611189565b611034565b8151158015611133575073ffffffffffffffffffffffffffffffffffffffff84163b155b15611182576040517f9996b31500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8516600482015260240161101e565b5080611034565b8051156111995780518082602001fd5b6040517f1425ea4200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b838110156111e55781810151838201526020016111cd565b50505f910152565b5f82825180855260208086019550808260051b8401018186015f5b8481101561126c577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe080878503018a528251805180865261124e818888018985016111cb565b9a86019a601f01909116939093018401925090830190600101611208565b5090979650505050505050565b5f73ffffffffffffffffffffffffffffffffffffffff8086168352808516602084015250606060408301526112b160608301846111ed565b95945050505050565b73ffffffffffffffffffffffffffffffffffffffff81168114610411575f80fd5b5f8083601f8401126112eb575f80fd5b50813567ffffffffffffffff811115611302575f80fd5b6020830191508360208260051b850101111561131c575f80fd5b9250929050565b5f805f60408486031215611335575f80fd5b8335611340816112ba565b9250602084013567ffffffffffffffff81111561135b575f80fd5b611367868287016112db565b9497909650939450505050565b5f60208284031215611384575f80fd5b813567ffffffffffffffff81111561139a575f80fd5b820160408185031215611034575f80fd5b5f80602083850312156113bc575f80fd5b823567ffffffffffffffff8111156113d2575f80fd5b6113de858286016112db565b90969095509350505050565b602081525f61103460208301846111ed565b5f6020828403121561140c575f80fd5b8135611034816112ba565b600181811c9082168061142b57607f821691505b602082108103611462577f4e487b71000000000000000000000000000000000000000000000000000000005f52602260045260245ffd5b50919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b5f602082840312156114a5575f80fd5b5051919050565b5f8083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe18436030181126114df575f80fd5b83018035915067ffffffffffffffff8211156114f9575f80fd5b60200191503681900382131561131c575f80fd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5b81811015610e6d575f8155600101611568565b601f821115610e2c57805f5260205f20601f840160051c810160208510156115a05750805b6115b2601f850160051c830182611567565b5050505050565b67ffffffffffffffff8311156115d1576115d161150d565b6115e5836115df8354611417565b8361157b565b5f601f841160018114611635575f85156115ff5750838201355b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600387901b1c1916600186901b1783556115b2565b5f838152602081207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08716915b828110156116825786850135825560209485019460019092019101611662565b50868210156116bd577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff60f88860031b161c19848701351681555b505060018560011b0183555050505050565b81356116da816112ba565b73ffffffffffffffffffffffffffffffffffffffff81167fffffffffffffffffffffffff00000000000000000000000000000000000000008354161782555060018082016020808501357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1863603018112611753575f80fd5b8501803567ffffffffffffffff81111561176b575f80fd5b60208201915060058160051b3603831315611784575f80fd5b6801000000000000000082111561179d5761179d61150d565b84548286558083101561181e575f868152602090208381019082015b8082101561181b576117cb8254611417565b801561181157601f808211600181146117e6575f855561180e565b5f85815260209020611800838501891c82018e8301611567565b505f85815260208120818755555b50505b50908801906117b9565b50505b50505f938452602084209382905b8281101561185a5761183e82856114ac565b61184981838a6115b9565b50509486019490840190860161182c565b505050505050505050565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036118955761189561153a565b5060010190565b5f816118aa576118aa61153a565b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190565b6040805190810167ffffffffffffffff811182821017156118f3576118f361150d565b60405290565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff811182821017156119405761194061150d565b604052919050565b5f6020808385031215611959575f80fd5b825167ffffffffffffffff80821115611970575f80fd5b818501915085601f830112611983575f80fd5b8151818111156119955761199561150d565b6119a3848260051b016118f9565b818152848101925060069190911b8301840190878211156119c2575f80fd5b928401925b81841015611a1657604084890312156119de575f80fd5b6119e66118d0565b84516119f1816112ba565b815284860151611a00816112ba565b81870152835260409390930192918401916119c7565b979650505050505050565b5f60208284031215611a31575f80fd5b8151611034816112ba565b5f8251611a4d8184602087016111cb565b9190910192915050565b5f60208284031215611a67575f80fd5b81518015158114611034575f80fdfea264697066735822122013cba55b3dcb956de986edd80495d1a6636499efd22232f16b2dcccb0fb3408264736f6c63430008180033

Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)

000000000000000000000000a214a4fc09c42202c404e2976c50373fe5f5b7890000000000000000000000004300000000000000000000000000000000000002000000000000000000000000f237c20584daca970498917470864f4d027de4ca0000000000000000000000002536fe9ab3f511540f2f9e2ec2a805005c3dd800000000000000000000000000454c0c1cf7be9341d82ce0f16979b8689ed4aad00000000000000000000000005066a1975be96b777dddf57b496397effddcb4a900000000000000000000000012f0a3453f63516815fe41c89fae84d218af0faf000000000000000000000000000000006551c19487814612e58fe06813775758

-----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] : agentNft_ (address): 0x5066A1975BE96B777ddDf57b496397efFdDcB4A9
Arg [6] : agentRegistry_ (address): 0x12F0A3453F63516815fe41c89fAe84d218Af0FAF
Arg [7] : erc6551Registry_ (address): 0x000000006551c19487814612e58FE06813775758

-----Encoded View---------------
8 Constructor Arguments found :
Arg [0] : 000000000000000000000000a214a4fc09c42202c404e2976c50373fe5f5b789
Arg [1] : 0000000000000000000000004300000000000000000000000000000000000002
Arg [2] : 000000000000000000000000f237c20584daca970498917470864f4d027de4ca
Arg [3] : 0000000000000000000000002536fe9ab3f511540f2f9e2ec2a805005c3dd800
Arg [4] : 000000000000000000000000454c0c1cf7be9341d82ce0f16979b8689ed4aad0
Arg [5] : 0000000000000000000000005066a1975be96b777dddf57b496397effddcb4a9
Arg [6] : 00000000000000000000000012f0a3453f63516815fe41c89fae84d218af0faf
Arg [7] : 000000000000000000000000000000006551c19487814612e58fe06813775758


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
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.