Base Sepolia Testnet

Contract

0x94563Bfe55D8Df522FE94e7D60D2D949ef21BF1c

Overview

ETH Balance

0 ETH

Token Holdings

More Info

Multichain Info

N/A
Transaction Hash
Method
Block
From
To
Amount
Deposit342828822025-11-28 12:47:3211 days ago1764334052IN
0x94563Bfe...9ef21BF1c
0 ETH0.000000760.00226598
Deposit336330732025-11-13 11:47:1426 days ago1763034434IN
0x94563Bfe...9ef21BF1c
0 ETH0.000000320.00097007
Deposit336266752025-11-13 8:13:5826 days ago1763021638IN
0x94563Bfe...9ef21BF1c
0 ETH0.000000320.00097006
Deposit336266562025-11-13 8:13:2026 days ago1763021600IN
0x94563Bfe...9ef21BF1c
0 ETH0.000000320.00097006
Deposit324121062025-10-16 5:28:2054 days ago1760592500IN
0x94563Bfe...9ef21BF1c
0 ETH0.000000310.00097008
Deposit323834952025-10-15 13:34:3855 days ago1760535278IN
0x94563Bfe...9ef21BF1c
0 ETH0.000000310.00097007
Deposit323828512025-10-15 13:13:1055 days ago1760533990IN
0x94563Bfe...9ef21BF1c
0 ETH0.000000310.00097008
Deposit323822912025-10-15 12:54:3055 days ago1760532870IN
0x94563Bfe...9ef21BF1c
0 ETH0.000000310.00097009
Deposit323822402025-10-15 12:52:4855 days ago1760532768IN
0x94563Bfe...9ef21BF1c
0 ETH0.000000310.00097009
Deposit323819592025-10-15 12:43:2655 days ago1760532206IN
0x94563Bfe...9ef21BF1c
0 ETH0.000000310.00097008
Deposit322972562025-10-13 13:40:0057 days ago1760362800IN
0x94563Bfe...9ef21BF1c
0 ETH0.000000350.00097014
Deposit322965762025-10-13 13:17:2057 days ago1760361440IN
0x94563Bfe...9ef21BF1c
0 ETH0.000000330.00097015
Deposit322573622025-10-12 15:30:1258 days ago1760283012IN
0x94563Bfe...9ef21BF1c
0 ETH0.000000310.0009701
Deposit285138512025-07-17 23:46:30145 days ago1752795990IN
0x94563Bfe...9ef21BF1c
0 ETH0.000000250.0007603
Set Allowed Peer271956242025-06-17 11:25:36175 days ago1750159536IN
0x94563Bfe...9ef21BF1c
0 ETH00.00000055
Set Allowed Chai...271956242025-06-17 11:25:36175 days ago1750159536IN
0x94563Bfe...9ef21BF1c
0 ETH00.00000055
Set Allowed Peer271956242025-06-17 11:25:36175 days ago1750159536IN
0x94563Bfe...9ef21BF1c
0 ETH00.00000055
Set Allowed Chai...271956242025-06-17 11:25:36175 days ago1750159536IN
0x94563Bfe...9ef21BF1c
0 ETH00.00000055
Set CCIP Gas Lim...271956242025-06-17 11:25:36175 days ago1750159536IN
0x94563Bfe...9ef21BF1c
0 ETH00.00000055

Parent Transaction Hash Block From To Amount
View All Internal Transactions

Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
ChildPeer

Compiler Version
v0.8.26+commit.8a97fa7a

Optimization Enabled:
Yes with 1000000 runs

Other Settings:
cancun EvmVersion

Contract Source Code (Solidity Standard Json-Input format)

// SPDX-License-Identifier: MIT
pragma solidity 0.8.26;

import {YieldPeer, Client, IRouterClient, CCIPOperations} from "./YieldPeer.sol";

/// @title CLY ChildPeer
/// @author @contractlevel
/// @notice This contract is a ChildPeer of the Contract Level Yield system
/// @notice This contract is deployed on every chain in the system except for the one the ParentPeer is deployed on
/// @notice Users can deposit and withdraw USDC to/from the system via this contract
contract ChildPeer is YieldPeer {
    /*//////////////////////////////////////////////////////////////
                               VARIABLES
    //////////////////////////////////////////////////////////////*/
    /// @dev The CCIP selector of the parent chain
    uint64 internal immutable i_parentChainSelector;

    /*//////////////////////////////////////////////////////////////
                              CONSTRUCTOR
    //////////////////////////////////////////////////////////////*/
    /// @param ccipRouter The address of the CCIP router
    /// @param link The address of the LINK token
    /// @param thisChainSelector The CCIP selector of the chain this peer is deployed on
    /// @param usdc The address of the USDC token
    /// @param aavePoolAddressesProvider The address of the Aave pool addresses provider
    /// @param comet The address of the Compound v3 cUSDCv3 contract
    /// @param share The address of the Share token, native to this system that is minted in return for deposits
    constructor(
        address ccipRouter,
        address link,
        uint64 thisChainSelector,
        address usdc,
        address aavePoolAddressesProvider,
        address comet,
        address share,
        uint64 parentChainSelector
    ) YieldPeer(ccipRouter, link, thisChainSelector, usdc, aavePoolAddressesProvider, comet, share) {
        i_parentChainSelector = parentChainSelector;
    }

    /*//////////////////////////////////////////////////////////////
                                EXTERNAL
    //////////////////////////////////////////////////////////////*/
    /// @notice Users can deposit USDC into the system via this function
    /// @notice As this is a ChildPeer, we handle two deposit cases:
    /// 1. This Child is the Strategy
    /// 2. This Child is not the Strategy
    /// @param amountToDeposit The amount of USDC to deposit into the system
    /// @dev Revert if amountToDeposit is 0
    function deposit(uint256 amountToDeposit) external override {
        _initiateDeposit(amountToDeposit);

        address strategyPool = _getStrategyPool();
        DepositData memory depositData = _buildDepositData(amountToDeposit);

        // 1. This Child is the Strategy
        if (strategyPool != address(0)) {
            /// @dev deposit USDC in strategy pool
            _depositToStrategy(strategyPool, amountToDeposit);
            /// @dev get totalValue from strategyPool and update depositData
            depositData.totalValue = _getTotalValueFromStrategy(strategyPool);

            /// @dev send a message to parent contract to request shareMintAmount
            _ccipSend(
                i_parentChainSelector, CcipTxType.DepositCallbackParent, abi.encode(depositData), ZERO_BRIDGE_AMOUNT
            );
        }
        // 2. This Child is not the Strategy
        else {
            /// @dev send a message to parent contract to deposit to strategy and request shareMintAmount
            _ccipSend(i_parentChainSelector, CcipTxType.DepositToParent, abi.encode(depositData), amountToDeposit);
        }
    }

    /// @notice This function is to facilitate USDC withdrawals from the system
    /// @notice This function is called when a SHARE holder transferAndCall()s to this contract
    /// @param withdrawer The address of the SHARE holder to send withdrawn USDC to
    /// @param shareBurnAmount The amount of SHARE to burn
    /// @param encodedWithdrawChainSelector The encoded chain selector to withdraw USDC to. If this is empty, the withdrawn USDC will be sent back to this chain
    /// @dev Revert if encodedWithdrawChainSelector doesn't decode to an allowed chain selector
    /// @dev Revert if msg.sender is not the SHARE token
    /// @dev Revert if shareBurnAmount is 0
    /// @dev Burn the SHARE tokens and send a message to the parent chain to withdraw USDC from the strategy
    function onTokenTransfer(address withdrawer, uint256 shareBurnAmount, bytes calldata encodedWithdrawChainSelector)
        external
        override
    {
        _revertIfMsgSenderIsNotShare();
        _revertIfZeroAmount(shareBurnAmount);
        _burnShares(withdrawer, shareBurnAmount);
        WithdrawData memory withdrawData =
            _buildWithdrawData(withdrawer, shareBurnAmount, _decodeWithdrawChainSelector(encodedWithdrawChainSelector));
        _ccipSend(i_parentChainSelector, CcipTxType.WithdrawToParent, abi.encode(withdrawData), ZERO_BRIDGE_AMOUNT);
        emit WithdrawInitiated(withdrawer, shareBurnAmount, i_thisChainSelector);
    }

    /*//////////////////////////////////////////////////////////////
                                INTERNAL
    //////////////////////////////////////////////////////////////*/
    /// @notice Receives a CCIP message from a peer
    ///  The CCIP message received
    /// - CcipTxType DepositToStrategy: A tx from parent to this-child-strategy to deposit USDC in strategy and get totalValue
    /// - CcipTxType DepositCallbackChild: A tx from parent to this-child to mint shares to the depositor
    /// - CcipTxType WithdrawToStrategy: A tx from parent to this-child-strategy to withdraw USDC from strategy and get usdcWithdrawAmount
    /// - CcipTxType WithdrawCallback: A tx from strategy to this-child to transfer USDC to withdrawer
    /// - CcipTxType RebalanceOldStrategy: A tx from parent to this-old-strategy to rebalance funds to the new strategy
    /// - CcipTxType RebalanceNewStrategy: A tx from the old strategy, sending rebalanced funds to this new strategy
    function _handleCCIPMessage(CcipTxType txType, Client.EVMTokenAmount[] memory tokenAmounts, bytes memory data)
        internal
        override
    {
        if (txType == CcipTxType.DepositToStrategy) _handleCCIPDepositToStrategy(tokenAmounts, data);
        if (txType == CcipTxType.DepositCallbackChild) _handleCCIPDepositCallbackChild(data);
        if (txType == CcipTxType.WithdrawToStrategy) _handleCCIPWithdrawToStrategy(data);
        if (txType == CcipTxType.WithdrawCallback) _handleCCIPWithdrawCallback(tokenAmounts, data);
        if (txType == CcipTxType.RebalanceOldStrategy) _handleCCIPRebalanceOldStrategy(data);
        if (txType == CcipTxType.RebalanceNewStrategy) _handleCCIPRebalanceNewStrategy(data);
    }

    /// @notice This function handles a deposit sent from Parent to this Strategy-Child
    /// @notice The purpose of this tx is to deposit USDC in the strategy and return the totalValue so that the parent can calculate the shareMintAmount.
    /// deposit -> parent -> strategy (HERE) -> callback to parent -> possible callback to child
    function _handleCCIPDepositToStrategy(Client.EVMTokenAmount[] memory tokenAmounts, bytes memory data) internal {
        DepositData memory depositData = _decodeDepositData(data);
        CCIPOperations._validateTokenAmounts(tokenAmounts, address(i_usdc), depositData.amount);

        depositData.totalValue = _depositToStrategyAndGetTotalValue(depositData.amount);

        /// @dev send a message to parent with totalValue to calculate shareMintAmount
        _ccipSend(i_parentChainSelector, CcipTxType.DepositCallbackParent, abi.encode(depositData), ZERO_BRIDGE_AMOUNT);
    }

    /// @notice This function handles a deposit callback from the parent chain
    /// @notice The purpose of this callback is to mint shares to the depositor on this chain
    /// deposit on this chain -> parent -> strategy -> callback to parent -> callback to child (HERE)
    function _handleCCIPDepositCallbackChild(bytes memory data) internal {
        DepositData memory depositData = _decodeDepositData(data);
        _mintShares(depositData.depositor, depositData.shareMintAmount);
    }

    /// @notice This function handles a withdraw request from the parent chain to this Strategy-Child
    /// @notice The purpose of this tx is to withdraw USDC from the strategy and then send it back to the withdraw chain
    /// withdraw -> parent -> strategy (HERE) -> callback to withdraw chain
    /// @notice If this strategy chain is the same as the withdraw chain, we transfer the USDC to the withdrawer, concluding the withdrawal process.
    function _handleCCIPWithdrawToStrategy(bytes memory data) internal {
        WithdrawData memory withdrawData = _decodeWithdrawData(data);
        withdrawData.usdcWithdrawAmount = _withdrawFromStrategyAndGetUsdcWithdrawAmount(withdrawData);

        if (i_thisChainSelector == withdrawData.chainSelector) {
            _transferUsdcTo(withdrawData.withdrawer, withdrawData.usdcWithdrawAmount);
            emit WithdrawCompleted(withdrawData.withdrawer, withdrawData.usdcWithdrawAmount);
        } else {
            _ccipSend(
                withdrawData.chainSelector,
                CcipTxType.WithdrawCallback,
                abi.encode(withdrawData),
                withdrawData.usdcWithdrawAmount
            );
        }
    }

    /// @notice Handles the CCIP message for a rebalance old strategy
    /// @notice The message this function handles is sent by the Parent when the Strategy is updated
    /// @notice This function should only be executed when this chain is the (old) strategy
    /// @dev Rebalances funds from the old strategy to the new strategy
    /// @param data The data to decode - decodes to Strategy (chainSelector, protocol)
    function _handleCCIPRebalanceOldStrategy(bytes memory data) internal {
        /// @dev withdraw from the old strategy
        address oldStrategyPool = _getStrategyPool();
        uint256 totalValue = _getTotalValueFromStrategy(oldStrategyPool);
        if (totalValue != 0) _withdrawFromStrategy(oldStrategyPool, totalValue);

        /// @dev update strategy pool to either protocol on this chain or address(0) if on a different chain
        Strategy memory newStrategy = abi.decode(data, (Strategy));
        address newStrategyPool = _updateStrategyPool(newStrategy.chainSelector, newStrategy.protocol);

        // if the new strategy is this chain, but different protocol, then we need to deposit to the new strategy
        if (newStrategy.chainSelector == i_thisChainSelector) {
            _depositToStrategy(newStrategyPool, i_usdc.balanceOf(address(this)));
        }
        // if the new strategy is a different chain, then we need to send the usdc we just withdrew to the new strategy
        else {
            _ccipSend(newStrategy.chainSelector, CcipTxType.RebalanceNewStrategy, data, i_usdc.balanceOf(address(this)));
        }
    }

    /*//////////////////////////////////////////////////////////////
                                 GETTER
    //////////////////////////////////////////////////////////////*/
    function getParentChainSelector() external view returns (uint64) {
        return i_parentChainSelector;
    }
}

File 2 of 25 : YieldPeer.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.26;

import {LinkTokenInterface} from "@chainlink/contracts/src/v0.8/shared/interfaces/LinkTokenInterface.sol";
import {CCIPReceiver} from "@chainlink/contracts/src/v0.8/ccip/applications/CCIPReceiver.sol";
import {IRouterClient, Client} from "@chainlink/contracts/src/v0.8/ccip/interfaces/IRouterClient.sol";
import {IERC677Receiver} from "@chainlink/contracts/src/v0.8/shared/interfaces/IERC677Receiver.sol";
import {Ownable2Step, Ownable} from "@openzeppelin/contracts/access/Ownable2Step.sol";
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import {IComet} from "../interfaces/IComet.sol";
import {IShare} from "../interfaces/IShare.sol";
import {IYieldPeer} from "../interfaces/IYieldPeer.sol";
import {IPoolAddressesProvider} from "@aave/core-v3/contracts/interfaces/IPoolAddressesProvider.sol";
import {ProtocolOperations} from "../libraries/ProtocolOperations.sol";
import {DataStructures} from "../libraries/DataStructures.sol";
import {CCIPOperations} from "../libraries/CCIPOperations.sol";

/// @title YieldPeer
/// @author @contractlevel
/// @notice YieldPeer is the base contract for the Parent and Child Peers in the Contract Level Yield system
abstract contract YieldPeer is CCIPReceiver, Ownable2Step, IERC677Receiver, IYieldPeer {
    // @review use SafeERC20

    /*//////////////////////////////////////////////////////////////
                                 ERRORS
    //////////////////////////////////////////////////////////////*/
    error YieldPeer__USDCTransferFailed();
    error YieldPeer__OnlyShare();
    error YieldPeer__ChainNotAllowed(uint64 chainSelector);
    error YieldPeer__PeerNotAllowed(address peer);
    error YieldPeer__NoZeroAmount();
    error YieldPeer__NotStrategyChain();

    /*//////////////////////////////////////////////////////////////
                               VARIABLES
    //////////////////////////////////////////////////////////////*/
    /// @dev Constant for the zero bridge amount - some CCIP messages don't need to send any USDC
    uint256 internal constant ZERO_BRIDGE_AMOUNT = 0;

    /// @dev Chainlink token
    LinkTokenInterface internal immutable i_link;
    /// @dev Chain selector for this chain
    uint64 internal immutable i_thisChainSelector;
    /// @dev USDC token
    IERC20 internal immutable i_usdc;
    /// @dev Aave v3 pool addresses provider
    IPoolAddressesProvider internal immutable i_aavePoolAddressesProvider;
    /// @dev Compound v3 pool
    IComet internal immutable i_comet;
    /// @dev Share token minted in exchange for deposits
    IShare internal immutable i_share;

    /// @dev Gas limit for CCIP
    uint256 internal s_ccipGasLimit;
    /// @dev Mapping of allowed chains
    /// @dev This must include the Parent Chain on the ParentPeer!
    mapping(uint64 chainSelector => bool isAllowed) internal s_allowedChains;
    /// @dev Mapping of peers (ie other Yield contracts)
    mapping(uint64 chainSelector => address peer) internal s_peers;
    /// @notice We use this as a flag to know if this chain is the strategy
    /// @dev This is either i_aavePool, i_comet, or address(0)
    address internal s_strategyPool;

    /*//////////////////////////////////////////////////////////////
                                 EVENTS
    //////////////////////////////////////////////////////////////*/
    /// @notice Emitted when a chain is set as allowed
    event AllowedChainSet(uint64 indexed chainSelector, bool indexed isAllowed);
    /// @notice Emitted when a peer is set as allowed for an allowed chain
    event AllowedPeerSet(uint64 indexed chainSelector, address indexed peer);
    /// @notice Emitted when the CCIP gas limit is set
    event CCIPGasLimitSet(uint256 indexed gasLimit);

    /// @notice Emitted when the strategy pool is updated
    event StrategyPoolUpdated(address indexed strategyPool);

    /// @notice Emitted when USDC is deposited to the strategy
    event DepositToStrategy(address indexed strategyPool, uint256 indexed amount);
    /// @notice Emitted when USDC is withdrawn from the strategy
    event WithdrawFromStrategy(address indexed strategyPool, uint256 indexed amount);

    /// @notice Emitted when a user deposits USDC into the system
    event DepositInitiated(address indexed depositor, uint256 indexed amount, uint64 indexed thisChainSelector);
    /// @notice Emitted when a deposit to the strategy is completed
    event DepositCompleted(address indexed strategyPool, uint256 indexed amount, uint256 indexed totalValue);
    /// @notice Emitted when a user initiates a withdrawal of USDC from the system
    event WithdrawInitiated(address indexed withdrawer, uint256 indexed amount, uint64 indexed thisChainSelector);
    /// @notice Emitted when a withdrawal is completed and the USDC is sent to the user
    event WithdrawCompleted(address indexed withdrawer, uint256 indexed amount);

    /// @notice Emitted when a CCIP message is sent to the parent chain
    event CCIPMessageSent(bytes32 indexed messageId, CcipTxType indexed txType, uint256 indexed amount);
    /// @notice Emitted when a CCIP message is received from the parent chain
    event CCIPMessageReceived(bytes32 indexed messageId, CcipTxType indexed txType, uint64 indexed sourceChainSelector);

    /// @notice Emitted when shares are minted
    event SharesMinted(address indexed to, uint256 indexed amount);
    /// @notice Emitted when shares are burned
    event SharesBurned(address indexed from, uint256 indexed amount);

    /*//////////////////////////////////////////////////////////////
                               MODIFIERS
    //////////////////////////////////////////////////////////////*/
    /// @notice Modifier to check if the chain selector and peer are allowed to send CCIP messages
    /// @param chainSelector The chain selector to check
    /// @param peer The peer to check
    modifier onlyAllowed(uint64 chainSelector, address peer) {
        // @review is the chainSelector check needed if we are checking the peer for the chainSelector too?
        if (!s_allowedChains[chainSelector]) revert YieldPeer__ChainNotAllowed(chainSelector);
        if (peer != s_peers[chainSelector]) revert YieldPeer__PeerNotAllowed(peer);
        _;
    }

    /*//////////////////////////////////////////////////////////////
                              CONSTRUCTOR
    //////////////////////////////////////////////////////////////*/
    /// @param ccipRouter The address of the CCIP router
    /// @param link The address of the Chainlink token
    /// @param thisChainSelector The chain selector for this chain
    /// @param usdc The address of the USDC token
    /// @param aavePoolAddressesProvider The address of the Aave v3 pool addresses provider
    /// @param comet The address of the Compound v3 cUSDCv3 contract
    /// @param share The address of the Share token, native to this system that is minted in return for deposits
    constructor(
        address ccipRouter,
        address link,
        uint64 thisChainSelector,
        address usdc,
        address aavePoolAddressesProvider,
        address comet,
        address share
    ) CCIPReceiver(ccipRouter) Ownable(msg.sender) {
        i_link = LinkTokenInterface(link);
        i_thisChainSelector = thisChainSelector;
        i_usdc = IERC20(usdc);
        i_aavePoolAddressesProvider = IPoolAddressesProvider(aavePoolAddressesProvider);
        i_comet = IComet(comet);
        i_share = IShare(share);
    }

    /*//////////////////////////////////////////////////////////////
                                EXTERNAL
    //////////////////////////////////////////////////////////////*/
    /// @dev Depositors must approve address(this) for spending on USDC contract
    /// @notice This function is overridden and implemented in the ChildPeer and ParentPeer contracts
    function deposit(uint256 amountToDeposit) external virtual;

    /// @notice ERC677Receiver interface implementation
    /// @dev This function is called when the Share token is transferAndCall'd to this contract
    /// @dev Redeems/withdraws USDC and sends to withdrawer
    /// @param withdrawer The address that sent the SHARE token to withdraw USDC
    /// @param shareBurnAmount The amount of SHARE token sent
    /// @notice This function is overridden and implemented in the ChildPeer and ParentPeer contracts
    function onTokenTransfer(address withdrawer, uint256 shareBurnAmount, bytes calldata /* data */ )
        external
        virtual;

    /*//////////////////////////////////////////////////////////////
                                INTERNAL
    //////////////////////////////////////////////////////////////*/
    /// @notice Receives a CCIP message from a peer
    /// @dev Revert if message came from a chain that is not allowed
    /// @dev Revert if message came from a contract that is not allowed
    /// @dev _handleCCIPMessage is overridden and implemented in the ChildPeer and ParentPeer contracts
    function _ccipReceive(Client.Any2EVMMessage memory message)
        internal
        override
        onlyAllowed(message.sourceChainSelector, abi.decode(message.sender, (address)))
    {
        (CcipTxType txType, bytes memory data) = abi.decode(message.data, (CcipTxType, bytes));
        emit CCIPMessageReceived(message.messageId, txType, message.sourceChainSelector);

        _handleCCIPMessage(txType, message.destTokenAmounts, data);

        // try this.processMessage(message) {
        //     // Intentionally empty in this example; no action needed if processMessage succeeds
        // } catch (bytes memory err) {
        //     emit MessageFailed(message.messageId, err);
        //     return;
        // }
    }

    // event MessageFailed(bytes32 indexed messageId, bytes err);

    // error OnlySelf();

    // function processMessage(Client.Any2EVMMessage calldata message) external {
    //     if (msg.sender != address(this)) revert OnlySelf();
    //     // (CcipTxType txType, bytes memory data) = abi.decode(message.data, (CcipTxType, bytes));
    //     (uint8 txTypeEnum, bytes memory data) = abi.decode(message.data, (uint8, bytes));
    //     CcipTxType txType = CcipTxType(txTypeEnum);
    //     emit CCIPMessageReceived(message.messageId, txType, message.sourceChainSelector);

    //     _handleCCIPMessage(txType, message.destTokenAmounts, data);
    // }

    /// @notice Handles CCIP messages based on transaction type
    /// @param txType The type of transaction
    /// @param tokenAmounts The token amounts in the message
    /// @param data The message data - decodes to DepositData, WithdrawData, or Strategy
    /// @notice This function is overridden and implemented in the ChildPeer and ParentPeer contracts
    function _handleCCIPMessage(CcipTxType txType, Client.EVMTokenAmount[] memory tokenAmounts, bytes memory data)
        internal
        virtual;

    /// @notice Send a CCIP message to a peer
    /// @param destChainSelector The chain selector of the peer
    /// @param txType The type of transaction - see ./interfaces/IYieldPeer.sol
    /// @param data The data to send
    /// @param bridgeAmount The amount of USDC to send
    function _ccipSend(uint64 destChainSelector, CcipTxType txType, bytes memory data, uint256 bridgeAmount) internal {
        Client.EVMTokenAmount[] memory tokenAmounts =
            CCIPOperations._prepareTokenAmounts(i_usdc, bridgeAmount, i_ccipRouter);

        Client.EVM2AnyMessage memory evm2AnyMessage = CCIPOperations._buildCCIPMessage(
            s_peers[destChainSelector], txType, data, tokenAmounts, s_ccipGasLimit, address(i_link)
        );

        CCIPOperations._handleCCIPFees(i_ccipRouter, address(i_link), destChainSelector, evm2AnyMessage);

        bytes32 ccipMessageId = IRouterClient(i_ccipRouter).ccipSend(destChainSelector, evm2AnyMessage);

        emit CCIPMessageSent(ccipMessageId, txType, bridgeAmount);
    }

    /// @notice Handles the CCIP message for a withdraw callback
    /// @notice This function is called as the last step in the withdraw flow and sends USDC to the withdrawer
    /// @param tokenAmounts The token amounts in the message
    /// @param data The message data - decodes to WithdrawData
    function _handleCCIPWithdrawCallback(Client.EVMTokenAmount[] memory tokenAmounts, bytes memory data) internal {
        WithdrawData memory withdrawData = _decodeWithdrawData(data);
        if (withdrawData.usdcWithdrawAmount != 0) {
            CCIPOperations._validateTokenAmounts(tokenAmounts, address(i_usdc), withdrawData.usdcWithdrawAmount);
            _transferUsdcTo(withdrawData.withdrawer, withdrawData.usdcWithdrawAmount);
        }
        emit WithdrawCompleted(withdrawData.withdrawer, withdrawData.usdcWithdrawAmount);
    }

    /// @notice Handles the CCIP message for a rebalance new strategy
    /// @notice The message this function handles is sent by the old strategy when the strategy is updated
    /// @dev Updates the strategy pool to the new strategy
    /// @dev Deposits USDC totalValue of the system into the new strategy
    /// @param data The data to decode - decodes to Strategy (chainSelector, protocol)
    function _handleCCIPRebalanceNewStrategy(bytes memory data) internal {
        /// @dev update strategy pool to protocol on this chain
        Strategy memory newStrategy = abi.decode(data, (Strategy));
        address newStrategyPool = _updateStrategyPool(newStrategy.chainSelector, newStrategy.protocol);

        /// @dev deposit to the new strategy
        uint256 usdcBalance = i_usdc.balanceOf(address(this));
        if (usdcBalance != 0) _depositToStrategy(newStrategyPool, usdcBalance);
    }

    /// @notice Internal helper to handle strategy pool updates
    /// @param chainSelector The chain selector for the strategy
    /// @param protocol The protocol for the strategy
    /// @return strategyPool The new strategy pool address
    function _updateStrategyPool(uint64 chainSelector, Protocol protocol) internal returns (address strategyPool) {
        if (chainSelector == i_thisChainSelector) {
            strategyPool = _getStrategyPoolFromProtocol(protocol);
            s_strategyPool = strategyPool;
        } else {
            s_strategyPool = address(0);
        }
        emit StrategyPoolUpdated(strategyPool);
    }

    /// @notice Internal helper to deposit to the strategy
    /// @param strategyPool The strategy pool to deposit to
    /// @param amount The amount of USDC to deposit
    /// @dev Emit DepositToStrategy event
    function _depositToStrategy(address strategyPool, uint256 amount) internal {
        ProtocolOperations._depositToStrategy(strategyPool, _getProtocolConfig(), amount);
        emit DepositToStrategy(strategyPool, amount);
    }

    /// @notice Internal helper to withdraw from the strategy
    /// @param strategyPool The strategy pool to withdraw from
    /// @param amount The amount of USDC to withdraw
    /// @dev Emit WithdrawFromStrategy event
    function _withdrawFromStrategy(address strategyPool, uint256 amount) internal {
        ProtocolOperations._withdrawFromStrategy(strategyPool, _getProtocolConfig(), amount);
        emit WithdrawFromStrategy(strategyPool, amount);
    }

    /// @notice Deposits USDC to the strategy and returns the total value of the system
    /// @param amount The amount of USDC to deposit
    /// @return totalValue The total value of the system
    function _depositToStrategyAndGetTotalValue(uint256 amount) internal returns (uint256 totalValue) {
        address strategyPool = _getStrategyPool();
        _depositToStrategy(strategyPool, amount);
        totalValue = _getTotalValueFromStrategy(strategyPool);
        // @review this event
        // is this event only emitted when a user deposits, and not a rebalance?
        // we should have some rebalance events
        emit DepositCompleted(strategyPool, amount, totalValue);
    }

    /// @notice Withdraws from the strategy and returns the USDC withdraw amount
    /// @param withdrawData The withdraw data
    /// @return usdcWithdrawAmount The USDC withdraw amount
    function _withdrawFromStrategyAndGetUsdcWithdrawAmount(WithdrawData memory withdrawData)
        internal
        returns (uint256 usdcWithdrawAmount)
    {
        address strategyPool = _getStrategyPool();
        uint256 totalValue = _getTotalValueFromStrategy(strategyPool);
        usdcWithdrawAmount =
            _calculateWithdrawAmount(totalValue, withdrawData.totalShares, withdrawData.shareBurnAmount);
        if (usdcWithdrawAmount != 0) _withdrawFromStrategy(strategyPool, usdcWithdrawAmount);
    }

    /// @notice Initiates a deposit
    /// @param amountToDeposit The amount of USDC to deposit
    /// @dev Revert if amountToDeposit is 0
    /// @dev Transfer USDC from msg.sender to this contract
    /// @dev Emit DepositInitiated event
    function _initiateDeposit(uint256 amountToDeposit) internal {
        // @review should we add a minimum deposit amount check? ie if (amountToDeposit < 1e6) revert;
        // _revertIfZeroAmount(amountToDeposit);
        // @review rename this error (if keeping it) and refactor relevant tests
        if (amountToDeposit < 1e6) revert YieldPeer__NoZeroAmount();
        _transferUsdcFrom(msg.sender, address(this), amountToDeposit);
        emit DepositInitiated(msg.sender, amountToDeposit, i_thisChainSelector);
    }

    /// @notice Transfer USDC to an address
    /// @param to The address to transfer USDC to
    /// @param amount The amount of USDC to transfer
    function _transferUsdcTo(address to, uint256 amount) internal {
        if (!i_usdc.transfer(to, amount)) revert YieldPeer__USDCTransferFailed();
    }

    /// @notice Transfer USDC from an address
    /// @param from The address to transfer USDC from
    /// @param to The address to transfer USDC to
    /// @param amount The amount of USDC to transfer
    function _transferUsdcFrom(address from, address to, uint256 amount) internal {
        if (!i_usdc.transferFrom(from, to, amount)) revert YieldPeer__USDCTransferFailed();
    }

    /// @notice Mints shares
    /// @param to The address to mint shares to
    /// @param amount The amount of shares to mint
    function _mintShares(address to, uint256 amount) internal {
        emit SharesMinted(to, amount);
        i_share.mint(to, amount);
    }

    /// @notice Burns shares
    /// @param from The address who transferAndCall'd the SHAREs to this contract
    /// @param amount The amount of shares to burn
    function _burnShares(address from, uint256 amount) internal {
        emit SharesBurned(from, amount);
        i_share.burn(amount);
    }

    /// @notice Decodes the chain selector to withdraw USDC to from the data
    /// @param data The data to decode
    /// @return withdrawChainSelector The chain selector to withdraw USDC to
    /// @dev Revert if the chain selector is not allowed
    /// @dev If the data is empty, the withdrawn USDC will be sent back to the chain the withdrawal was initiated on
    function _decodeWithdrawChainSelector(bytes calldata data) internal view returns (uint64 withdrawChainSelector) {
        if (data.length > 0) {
            withdrawChainSelector = abi.decode(data, (uint64));
            if (!s_allowedChains[withdrawChainSelector]) revert YieldPeer__ChainNotAllowed(withdrawChainSelector);
        } else {
            withdrawChainSelector = i_thisChainSelector;
        }
    }

    /*//////////////////////////////////////////////////////////////
                             INTERNAL VIEW
    //////////////////////////////////////////////////////////////*/
    /// @notice Helper function to make ProtocolOperations easier
    /// @return protocolConfig Struct containing USDC and strategy addresses
    function _getProtocolConfig() internal view returns (ProtocolOperations.ProtocolConfig memory protocolConfig) {
        protocolConfig =
            ProtocolOperations._createConfig(address(i_usdc), address(i_aavePoolAddressesProvider), address(i_comet));
    }

    /// @notice Builds DepositData struct, which gets used in CCIP deposit messages
    /// @param amount The amount of USDC to deposit
    /// @return depositData Struct containing depositor, amount, and chain selector
    function _buildDepositData(uint256 amount) internal view returns (IYieldPeer.DepositData memory depositData) {
        depositData = DataStructures.buildDepositData(msg.sender, amount, i_thisChainSelector);
    }

    /// @notice Builds WithdrawData struct, which gets used in CCIP withdraw messages
    /// @param withdrawer The address that initiated the withdrawal
    /// @param shareBurnAmount The amount of shares the withdrawer burned
    /// @param withdrawChainSelector The chain selector to withdraw USDC to
    /// @return withdrawData Struct containing withdrawer, share burn amount, and chain selector
    function _buildWithdrawData(address withdrawer, uint256 shareBurnAmount, uint64 withdrawChainSelector)
        internal
        pure
        returns (WithdrawData memory withdrawData)
    {
        withdrawData = DataStructures.buildWithdrawData(withdrawer, shareBurnAmount, withdrawChainSelector);
    }

    /// @notice Helper function to get the total value from the strategy
    /// @param strategyPool The strategy pool to get the total value from
    /// @return totalValue The total value in the Contract Level Yield system
    function _getTotalValueFromStrategy(address strategyPool) internal view returns (uint256 totalValue) {
        totalValue = ProtocolOperations._getTotalValueFromStrategy(strategyPool, _getProtocolConfig());
    }

    /// @notice Helper function to get the strategy pool from the protocol
    /// @param protocol The protocol to get the strategy pool from
    /// @return strategyPool The strategy pool address
    function _getStrategyPoolFromProtocol(IYieldPeer.Protocol protocol) internal view returns (address strategyPool) {
        strategyPool = ProtocolOperations._getStrategyPoolFromProtocol(protocol, _getProtocolConfig());
    }

    /// @notice Helper function to get the strategy pool
    /// @return strategyPool The strategy pool address
    /// @notice This will return address(0) if this chain is not the strategy chain
    function _getStrategyPool() internal view returns (address) {
        return s_strategyPool;
    }

    /// @notice Helper function to calculate the USDC withdraw amount
    /// @param totalValue The total value in the Contract Level Yield system
    /// @param totalShares The total shares in the Contract Level Yield system
    /// @param shareBurnAmount The amount of shares the withdrawer burned
    /// @return usdcWithdrawAmount The USDC withdraw amount
    function _calculateWithdrawAmount(uint256 totalValue, uint256 totalShares, uint256 shareBurnAmount)
        internal
        pure
        returns (uint256 usdcWithdrawAmount)
    {
        usdcWithdrawAmount = (shareBurnAmount * totalValue) / totalShares;
    }

    /// @dev Revert if the amount is 0
    /// @param amount The amount to check
    // @review currently not in coverage report
    function _revertIfZeroAmount(uint256 amount) internal pure {
        if (amount == 0) revert YieldPeer__NoZeroAmount();
    }

    /// @dev Revert if the msg.sender is not the Share token
    /// @notice This is used to protect ERC677Receiver.onTokenTransfer
    function _revertIfMsgSenderIsNotShare() internal view {
        if (msg.sender != address(i_share)) revert YieldPeer__OnlyShare();
    }

    /// @notice Decodes the DepositData struct from the data
    /// @param data The data to decode
    /// @return depositData Struct containing depositor, amount, totalValue, shareMintAmount, and chainSelector
    function _decodeDepositData(bytes memory data) internal pure returns (DepositData memory depositData) {
        depositData = abi.decode(data, (DepositData));
    }

    /// @notice Decodes the WithdrawData struct from the data
    /// @param data The data to decode
    /// @return withdrawData Struct containing withdrawer, share burn amount, usdc withdraw amount, total shares, and chain selector
    function _decodeWithdrawData(bytes memory data) internal pure returns (WithdrawData memory withdrawData) {
        withdrawData = abi.decode(data, (WithdrawData));
    }

    /// @notice Get the total value of the Contract Level Yield system
    /// @return totalValue The total value in the Contract Level Yield system
    /// @dev Revert if this chain is not the strategy chain because the totalValue will be on another chain
    function _getTotalValue() internal view returns (uint256 totalValue) {
        address strategyPool = _getStrategyPool();
        if (strategyPool != address(0)) totalValue = _getTotalValueFromStrategy(strategyPool);
        else revert YieldPeer__NotStrategyChain();
    }

    /*//////////////////////////////////////////////////////////////
                                 SETTER
    //////////////////////////////////////////////////////////////*/
    /// @notice Set chains that are allowed to send CCIP messages to this peer
    /// @param chainSelector The chain selector to set
    /// @param isAllowed Whether the chain is allowed to send CCIP messages to this peer
    /// @dev Access control: onlyOwner
    function setAllowedChain(uint64 chainSelector, bool isAllowed) external onlyOwner {
        s_allowedChains[chainSelector] = isAllowed;
        emit AllowedChainSet(chainSelector, isAllowed);
    }

    /// @notice Set the peer contract for an allowed chain selector
    /// @param chainSelector The chain selector to set
    /// @param peer The peer to set
    /// @dev Access control: onlyOwner
    function setAllowedPeer(uint64 chainSelector, address peer) external onlyOwner {
        if (!s_allowedChains[chainSelector]) revert YieldPeer__ChainNotAllowed(chainSelector);
        s_peers[chainSelector] = peer;
        emit AllowedPeerSet(chainSelector, peer);
    }

    /// @notice Set the CCIP gas limit
    /// @param gasLimit The gas limit to set
    /// @dev Access control: onlyOwner
    function setCCIPGasLimit(uint256 gasLimit) external onlyOwner {
        s_ccipGasLimit = gasLimit;
        emit CCIPGasLimitSet(gasLimit);
    }

    /*//////////////////////////////////////////////////////////////
                                 GETTER
    //////////////////////////////////////////////////////////////*/
    /// @notice Get the chain selector for this chain
    /// @return thisChainSelector The chain selector for this chain
    function getThisChainSelector() external view returns (uint64) {
        return i_thisChainSelector;
    }

    /// @notice Get whether a chain is allowed to send CCIP messages to this peer
    /// @param chainSelector The chain selector to check
    /// @return isAllowed Whether the chain is allowed to send CCIP messages to this peer
    function getAllowedChain(uint64 chainSelector) external view returns (bool) {
        return s_allowedChains[chainSelector];
    }

    /// @notice Get the peer contract for an allowed chain selector
    /// @param chainSelector The chain selector to check
    /// @return peer The peer contract for the chain selector
    function getAllowedPeer(uint64 chainSelector) external view returns (address) {
        return s_peers[chainSelector];
    }

    /// @notice Get the Chainlink token address
    /// @return link The Chainlink token address
    function getLink() external view returns (address) {
        return address(i_link);
    }

    /// @notice Get the USDC token address
    /// @return usdc The USDC token address
    function getUsdc() external view returns (address) {
        return address(i_usdc);
    }

    /// @notice Get the Share token address native to this system
    /// @return share The Share token address
    function getShare() external view returns (address) {
        return address(i_share);
    }

    /// @notice Get whether this chain is the strategy chain
    /// @return isStrategyChain Whether this chain is the strategy chain
    function getIsStrategyChain() external view returns (bool) {
        return s_strategyPool != address(0);
    }

    /// @notice Get the CCIP gas limit
    /// @return ccipGasLimit The CCIP gas limit
    function getCCIPGasLimit() external view returns (uint256) {
        return s_ccipGasLimit;
    }

    /// @notice Get the strategy pool address
    /// @return strategyPool The strategy pool address
    /// @notice This will return address(0) if this chain is not the strategy chain
    function getStrategyPool() external view returns (address) {
        return s_strategyPool;
    }

    /// @dev Reverts if this chain is not the strategy chain
    /// @return totalValue The total value in the Contract Level Yield system
    function getTotalValue() external view returns (uint256 totalValue) {
        totalValue = _getTotalValue();
    }

    /// @notice Get the Compound cUSDCv3 address
    /// @return compound The Compound cUSDCv3 address
    function getCompound() external view returns (address compound) {
        compound = address(i_comet);
    }

    /// @notice Get the Aave Pool Addresses Provider address
    /// @return aave Aave Pool Addresses Provider address
    function getAave() external view returns (address aave) {
        aave = address(i_aavePoolAddressesProvider);
    }
}

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

// solhint-disable-next-line interface-starts-with-i
interface LinkTokenInterface {
  function allowance(address owner, address spender) external view returns (uint256 remaining);

  function approve(address spender, uint256 value) external returns (bool success);

  function balanceOf(address owner) external view returns (uint256 balance);

  function decimals() external view returns (uint8 decimalPlaces);

  function decreaseApproval(address spender, uint256 addedValue) external returns (bool success);

  function increaseApproval(address spender, uint256 subtractedValue) external;

  function name() external view returns (string memory tokenName);

  function symbol() external view returns (string memory tokenSymbol);

  function totalSupply() external view returns (uint256 totalTokensIssued);

  function transfer(address to, uint256 value) external returns (bool success);

  function transferAndCall(address to, uint256 value, bytes calldata data) external returns (bool success);

  function transferFrom(address from, address to, uint256 value) external returns (bool success);
}

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

import {IAny2EVMMessageReceiver} from "../interfaces/IAny2EVMMessageReceiver.sol";

import {Client} from "../libraries/Client.sol";

import {IERC165} from "../../vendor/openzeppelin-solidity/v5.0.2/contracts/utils/introspection/IERC165.sol";

/// @title CCIPReceiver - Base contract for CCIP applications that can receive messages.
abstract contract CCIPReceiver is IAny2EVMMessageReceiver, IERC165 {
  address internal immutable i_ccipRouter;

  constructor(
    address router
  ) {
    if (router == address(0)) revert InvalidRouter(address(0));
    i_ccipRouter = router;
  }

  /// @notice IERC165 supports an interfaceId.
  /// @param interfaceId The interfaceId to check.
  /// @return true if the interfaceId is supported.
  /// @dev Should indicate whether the contract implements IAny2EVMMessageReceiver.
  /// e.g. return interfaceId == type(IAny2EVMMessageReceiver).interfaceId || interfaceId == type(IERC165).interfaceId
  /// This allows CCIP to check if ccipReceive is available before calling it.
  /// - If this returns false or reverts, only tokens are transferred to the receiver.
  /// - If this returns true, tokens are transferred and ccipReceive is called atomically.
  /// Additionally, if the receiver address does not have code associated with it at the time of
  /// execution (EXTCODESIZE returns 0), only tokens will be transferred.
  function supportsInterface(
    bytes4 interfaceId
  ) public view virtual override returns (bool) {
    return interfaceId == type(IAny2EVMMessageReceiver).interfaceId || interfaceId == type(IERC165).interfaceId;
  }

  /// @inheritdoc IAny2EVMMessageReceiver
  function ccipReceive(
    Client.Any2EVMMessage calldata message
  ) external virtual override onlyRouter {
    _ccipReceive(message);
  }

  /// @notice Override this function in your implementation.
  /// @param message Any2EVMMessage.
  function _ccipReceive(
    Client.Any2EVMMessage memory message
  ) internal virtual;

  /// @notice Return the current router
  /// @return CCIP router address
  function getRouter() public view virtual returns (address) {
    return address(i_ccipRouter);
  }

  error InvalidRouter(address router);

  /// @dev only calls from the set router are accepted.
  modifier onlyRouter() {
    if (msg.sender != getRouter()) revert InvalidRouter(msg.sender);
    _;
  }
}

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

import {Client} from "../libraries/Client.sol";

interface IRouterClient {
  error UnsupportedDestinationChain(uint64 destChainSelector);
  error InsufficientFeeTokenAmount();
  error InvalidMsgValue();

  /// @notice Checks if the given chain ID is supported for sending/receiving.
  /// @param destChainSelector The chain to check.
  /// @return supported is true if it is supported, false if not.
  function isChainSupported(
    uint64 destChainSelector
  ) external view returns (bool supported);

  /// @param destinationChainSelector The destination chainSelector.
  /// @param message The cross-chain CCIP message including data and/or tokens.
  /// @return fee returns execution fee for the message.
  /// delivery to destination chain, denominated in the feeToken specified in the message.
  /// @dev Reverts with appropriate reason upon invalid message.
  function getFee(
    uint64 destinationChainSelector,
    Client.EVM2AnyMessage memory message
  ) external view returns (uint256 fee);

  /// @notice Request a message to be sent to the destination chain.
  /// @param destinationChainSelector The destination chain ID.
  /// @param message The cross-chain CCIP message including data and/or tokens.
  /// @return messageId The message ID.
  /// @dev Note if msg.value is larger than the required fee (from getFee) we accept.
  /// the overpayment with no refund.
  /// @dev Reverts with appropriate reason upon invalid message.
  function ccipSend(
    uint64 destinationChainSelector,
    Client.EVM2AnyMessage calldata message
  ) external payable returns (bytes32);
}

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.6;

interface IERC677Receiver {
  function onTokenTransfer(address sender, uint256 amount, bytes calldata data) external;
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (access/Ownable2Step.sol)

pragma solidity ^0.8.20;

import {Ownable} from "./Ownable.sol";

/**
 * @dev Contract module which provides access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * This extension of the {Ownable} contract includes a two-step mechanism to transfer
 * ownership, where the new owner must call {acceptOwnership} in order to replace the
 * old one. This can help prevent common mistakes, such as transfers of ownership to
 * incorrect accounts, or to contracts that are unable to interact with the
 * permission system.
 *
 * The initial owner is specified at deployment time in the constructor for `Ownable`. This
 * can later be changed with {transferOwnership} and {acceptOwnership}.
 *
 * This module is used through inheritance. It will make available all functions
 * from parent (Ownable).
 */
abstract contract Ownable2Step is Ownable {
    address private _pendingOwner;

    event OwnershipTransferStarted(address indexed previousOwner, address indexed newOwner);

    /**
     * @dev Returns the address of the pending owner.
     */
    function pendingOwner() public view virtual returns (address) {
        return _pendingOwner;
    }

    /**
     * @dev 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.
     *
     * Setting `newOwner` to the zero address is allowed; this can be used to cancel an initiated ownership transfer.
     */
    function transferOwnership(address newOwner) public virtual override onlyOwner {
        _pendingOwner = newOwner;
        emit OwnershipTransferStarted(owner(), newOwner);
    }

    /**
     * @dev 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 virtual override {
        delete _pendingOwner;
        super._transferOwnership(newOwner);
    }

    /**
     * @dev The new owner accepts the ownership transfer.
     */
    function acceptOwnership() public virtual {
        address sender = _msgSender();
        if (pendingOwner() != sender) {
            revert OwnableUnauthorizedAccount(sender);
        }
        _transferOwnership(sender);
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.20;

/**
 * @dev Interface of the ERC-20 standard as defined in the ERC.
 */
interface IERC20 {
    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

    /**
     * @dev Emitted when the allowance of a `spender` for an `owner` is set by
     * a call to {approve}. `value` is the new allowance.
     */
    event Approval(address indexed owner, address indexed spender, uint256 value);

    /**
     * @dev Returns the value of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns the value of tokens owned by `account`.
     */
    function balanceOf(address account) external view returns (uint256);

    /**
     * @dev Moves a `value` amount of tokens from the caller's account to `to`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address to, uint256 value) external returns (bool);

    /**
     * @dev Returns the remaining number of tokens that `spender` will be
     * allowed to spend on behalf of `owner` through {transferFrom}. This is
     * zero by default.
     *
     * This value changes when {approve} or {transferFrom} are called.
     */
    function allowance(address owner, address spender) external view returns (uint256);

    /**
     * @dev Sets a `value` amount of tokens as the allowance of `spender` over the
     * caller's tokens.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * IMPORTANT: Beware that changing an allowance with this method brings the risk
     * that someone may use both the old and the new allowance by unfortunate
     * transaction ordering. One possible solution to mitigate this race
     * condition is to first reduce the spender's allowance to 0 and set the
     * desired value afterwards:
     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
     *
     * Emits an {Approval} event.
     */
    function approve(address spender, uint256 value) external returns (bool);

    /**
     * @dev Moves a `value` amount of tokens from `from` to `to` using the
     * allowance mechanism. `value` is then deducted from the caller's
     * allowance.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(address from, address to, uint256 value) external returns (bool);
}

// SPDX-License-Identifier: MIT
pragma solidity 0.8.26;

interface IComet {
    function supply(address asset, uint256 amount) external;
    function withdraw(address asset, uint256 amount) external;
    function balanceOf(address account) external view returns (uint256);
}

File 10 of 25 : IShare.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.26;

import {IBurnMintERC20} from "@chainlink/contracts/src/v0.8/shared/token/ERC20/IBurnMintERC20.sol";
import {IERC677} from "@chainlink/contracts/src/v0.8/shared/token/ERC677/IERC677.sol";

interface IShare is IBurnMintERC20, IERC677 {}

// SPDX-License-Identifier: MIT
pragma solidity 0.8.26;

interface IYieldPeer {
    struct Strategy {
        uint64 chainSelector;
        Protocol protocol;
    }

    enum Protocol {
        Aave,
        Compound
    }

    enum CcipTxType {
        DepositToParent, // 0 - deposit from child to parent (to get strategy chain)
        DepositToStrategy, // 1 - deposit from parent to strategy (to deposit to strategy and get totalValue)
        DepositCallbackParent, // 2 - deposit callback from strategy to parent (to calculate shareMintAmount and update totalShares)
        DepositCallbackChild, // 3 - deposit callback from parent to child (to mint shares)
        WithdrawToParent, // 4 - withdraw from child to parent (to get strategy chain and update totalShares)
        WithdrawToStrategy, // 5 - withdraw from parent to strategy (to withdraw from strategy and get usdcWithdrawAmount)
        WithdrawCallback, // 6 - withdraw callback from strategy to withdraw chain (to send USDC to withdrawer)
        RebalanceOldStrategy, // 7 - message from parent to old strategy (to move funds to new strategy)
        RebalanceNewStrategy // 8 - reallocate funds from old strategy to new strategy

    }

    struct DepositData {
        address depositor; // user who deposited USDC and will receive shares
        uint256 amount; // amount of USDC deposited // @review do we need this if we have tokenAmounts?
        uint256 totalValue; // total value of the system (this is updated on the strategy chain)
        uint256 shareMintAmount; // amount of shares minted to the depositor (this is updated on the parent chain callback)
        uint64 chainSelector; // chain selector of the chain the deposit originated from
    }

    struct WithdrawData {
        address withdrawer; // user who is withdrawing USDC
        uint256 shareBurnAmount; // amount of shares burned
        uint256 totalShares; // total shares in the system (updated on the parent chain)
        uint256 usdcWithdrawAmount; // amount of USDC to withdraw // @review do we need this if we have tokenAmounts?
        uint64 chainSelector; // chain selector of the chain the withdrawal originated from
    }

    function deposit(uint256 amountToDeposit) external;
    function getStrategyPool() external view returns (address);
    function getTotalValue() external view returns (uint256);
    function getCompound() external view returns (address);
    function getAave() external view returns (address);
    function setCCIPGasLimit(uint256 gasLimit) external;
    function setAllowedChain(uint64 chainSelector, bool allowed) external;
    function setAllowedPeer(uint64 chainSelector, address peer) external;
    function getAllowedChain(uint64 chainSelector) external view returns (bool);
    function getAllowedPeer(uint64 chainSelector) external view returns (address);
}

// SPDX-License-Identifier: AGPL-3.0
pragma solidity ^0.8.0;

/**
 * @title IPoolAddressesProvider
 * @author Aave
 * @notice Defines the basic interface for a Pool Addresses Provider.
 */
interface IPoolAddressesProvider {
  /**
   * @dev Emitted when the market identifier is updated.
   * @param oldMarketId The old id of the market
   * @param newMarketId The new id of the market
   */
  event MarketIdSet(string indexed oldMarketId, string indexed newMarketId);

  /**
   * @dev Emitted when the pool is updated.
   * @param oldAddress The old address of the Pool
   * @param newAddress The new address of the Pool
   */
  event PoolUpdated(address indexed oldAddress, address indexed newAddress);

  /**
   * @dev Emitted when the pool configurator is updated.
   * @param oldAddress The old address of the PoolConfigurator
   * @param newAddress The new address of the PoolConfigurator
   */
  event PoolConfiguratorUpdated(address indexed oldAddress, address indexed newAddress);

  /**
   * @dev Emitted when the price oracle is updated.
   * @param oldAddress The old address of the PriceOracle
   * @param newAddress The new address of the PriceOracle
   */
  event PriceOracleUpdated(address indexed oldAddress, address indexed newAddress);

  /**
   * @dev Emitted when the ACL manager is updated.
   * @param oldAddress The old address of the ACLManager
   * @param newAddress The new address of the ACLManager
   */
  event ACLManagerUpdated(address indexed oldAddress, address indexed newAddress);

  /**
   * @dev Emitted when the ACL admin is updated.
   * @param oldAddress The old address of the ACLAdmin
   * @param newAddress The new address of the ACLAdmin
   */
  event ACLAdminUpdated(address indexed oldAddress, address indexed newAddress);

  /**
   * @dev Emitted when the price oracle sentinel is updated.
   * @param oldAddress The old address of the PriceOracleSentinel
   * @param newAddress The new address of the PriceOracleSentinel
   */
  event PriceOracleSentinelUpdated(address indexed oldAddress, address indexed newAddress);

  /**
   * @dev Emitted when the pool data provider is updated.
   * @param oldAddress The old address of the PoolDataProvider
   * @param newAddress The new address of the PoolDataProvider
   */
  event PoolDataProviderUpdated(address indexed oldAddress, address indexed newAddress);

  /**
   * @dev Emitted when a new proxy is created.
   * @param id The identifier of the proxy
   * @param proxyAddress The address of the created proxy contract
   * @param implementationAddress The address of the implementation contract
   */
  event ProxyCreated(
    bytes32 indexed id,
    address indexed proxyAddress,
    address indexed implementationAddress
  );

  /**
   * @dev Emitted when a new non-proxied contract address is registered.
   * @param id The identifier of the contract
   * @param oldAddress The address of the old contract
   * @param newAddress The address of the new contract
   */
  event AddressSet(bytes32 indexed id, address indexed oldAddress, address indexed newAddress);

  /**
   * @dev Emitted when the implementation of the proxy registered with id is updated
   * @param id The identifier of the contract
   * @param proxyAddress The address of the proxy contract
   * @param oldImplementationAddress The address of the old implementation contract
   * @param newImplementationAddress The address of the new implementation contract
   */
  event AddressSetAsProxy(
    bytes32 indexed id,
    address indexed proxyAddress,
    address oldImplementationAddress,
    address indexed newImplementationAddress
  );

  /**
   * @notice Returns the id of the Aave market to which this contract points to.
   * @return The market id
   */
  function getMarketId() external view returns (string memory);

  /**
   * @notice Associates an id with a specific PoolAddressesProvider.
   * @dev This can be used to create an onchain registry of PoolAddressesProviders to
   * identify and validate multiple Aave markets.
   * @param newMarketId The market id
   */
  function setMarketId(string calldata newMarketId) external;

  /**
   * @notice Returns an address by its identifier.
   * @dev The returned address might be an EOA or a contract, potentially proxied
   * @dev It returns ZERO if there is no registered address with the given id
   * @param id The id
   * @return The address of the registered for the specified id
   */
  function getAddress(bytes32 id) external view returns (address);

  /**
   * @notice General function to update the implementation of a proxy registered with
   * certain `id`. If there is no proxy registered, it will instantiate one and
   * set as implementation the `newImplementationAddress`.
   * @dev IMPORTANT Use this function carefully, only for ids that don't have an explicit
   * setter function, in order to avoid unexpected consequences
   * @param id The id
   * @param newImplementationAddress The address of the new implementation
   */
  function setAddressAsProxy(bytes32 id, address newImplementationAddress) external;

  /**
   * @notice Sets an address for an id replacing the address saved in the addresses map.
   * @dev IMPORTANT Use this function carefully, as it will do a hard replacement
   * @param id The id
   * @param newAddress The address to set
   */
  function setAddress(bytes32 id, address newAddress) external;

  /**
   * @notice Returns the address of the Pool proxy.
   * @return The Pool proxy address
   */
  function getPool() external view returns (address);

  /**
   * @notice Updates the implementation of the Pool, or creates a proxy
   * setting the new `pool` implementation when the function is called for the first time.
   * @param newPoolImpl The new Pool implementation
   */
  function setPoolImpl(address newPoolImpl) external;

  /**
   * @notice Returns the address of the PoolConfigurator proxy.
   * @return The PoolConfigurator proxy address
   */
  function getPoolConfigurator() external view returns (address);

  /**
   * @notice Updates the implementation of the PoolConfigurator, or creates a proxy
   * setting the new `PoolConfigurator` implementation when the function is called for the first time.
   * @param newPoolConfiguratorImpl The new PoolConfigurator implementation
   */
  function setPoolConfiguratorImpl(address newPoolConfiguratorImpl) external;

  /**
   * @notice Returns the address of the price oracle.
   * @return The address of the PriceOracle
   */
  function getPriceOracle() external view returns (address);

  /**
   * @notice Updates the address of the price oracle.
   * @param newPriceOracle The address of the new PriceOracle
   */
  function setPriceOracle(address newPriceOracle) external;

  /**
   * @notice Returns the address of the ACL manager.
   * @return The address of the ACLManager
   */
  function getACLManager() external view returns (address);

  /**
   * @notice Updates the address of the ACL manager.
   * @param newAclManager The address of the new ACLManager
   */
  function setACLManager(address newAclManager) external;

  /**
   * @notice Returns the address of the ACL admin.
   * @return The address of the ACL admin
   */
  function getACLAdmin() external view returns (address);

  /**
   * @notice Updates the address of the ACL admin.
   * @param newAclAdmin The address of the new ACL admin
   */
  function setACLAdmin(address newAclAdmin) external;

  /**
   * @notice Returns the address of the price oracle sentinel.
   * @return The address of the PriceOracleSentinel
   */
  function getPriceOracleSentinel() external view returns (address);

  /**
   * @notice Updates the address of the price oracle sentinel.
   * @param newPriceOracleSentinel The address of the new PriceOracleSentinel
   */
  function setPriceOracleSentinel(address newPriceOracleSentinel) external;

  /**
   * @notice Returns the address of the data provider.
   * @return The address of the DataProvider
   */
  function getPoolDataProvider() external view returns (address);

  /**
   * @notice Updates the address of the data provider.
   * @param newDataProvider The address of the new DataProvider
   */
  function setPoolDataProvider(address newDataProvider) external;
}

// SPDX-License-Identifier: MIT
pragma solidity 0.8.26;

import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import {IPool} from "@aave/core-v3/contracts/interfaces/IPool.sol";
import {DataTypes} from "@aave/core-v3/contracts/protocol/libraries/types/DataTypes.sol";
import {IComet} from "../interfaces/IComet.sol";
import {IPoolAddressesProvider} from "@aave/core-v3/contracts/interfaces/IPoolAddressesProvider.sol";
import {IYieldPeer} from "../interfaces/IYieldPeer.sol";

/// @notice This library facilitates operations on Strategy Protocols (ie depositing and withdrawing from Aave and Compound)
library ProtocolOperations {
    /*//////////////////////////////////////////////////////////////
                                 ERRORS
    //////////////////////////////////////////////////////////////*/
    error ProtocolOperations__InvalidStrategyPool(address strategyPool);

    /*//////////////////////////////////////////////////////////////
                                 CONFIG
    //////////////////////////////////////////////////////////////*/
    /// @notice This will need to be updated as new protocols are added
    struct ProtocolConfig {
        address usdc;
        address aavePoolAddressesProvider;
        address comet;
    }

    /*//////////////////////////////////////////////////////////////
                                INTERNAL
    //////////////////////////////////////////////////////////////*/
    /// @notice Creates a ProtocolConfig struct
    /// @param usdc The address of the USDC token
    /// @param aavePoolAddressesProvider The address of the Aave v3 pool addresses provider
    /// @param comet The address of the Compound v3 pool
    /// @return config The ProtocolConfig struct
    function _createConfig(address usdc, address aavePoolAddressesProvider, address comet)
        internal
        pure
        returns (ProtocolConfig memory)
    {
        return ProtocolConfig({usdc: usdc, aavePoolAddressesProvider: aavePoolAddressesProvider, comet: comet});
    }

    function _depositToStrategy(address strategyPool, ProtocolConfig memory config, uint256 amount) internal {
        if (strategyPool == address(config.aavePoolAddressesProvider)) {
            _depositToAave(config.usdc, config.aavePoolAddressesProvider, amount);
        } else if (strategyPool == address(config.comet)) {
            _depositToCompound(config.usdc, config.comet, amount);
        } else {
            revert ProtocolOperations__InvalidStrategyPool(strategyPool);
        }
    }

    function _withdrawFromStrategy(address strategyPool, ProtocolConfig memory config, uint256 amount) internal {
        if (strategyPool == address(config.aavePoolAddressesProvider)) {
            _withdrawFromAave(config.usdc, config.aavePoolAddressesProvider, amount);
        } else if (strategyPool == address(config.comet)) {
            _withdrawFromCompound(config.usdc, config.comet, amount);
        } else {
            revert ProtocolOperations__InvalidStrategyPool(strategyPool);
        }
    }

    /*//////////////////////////////////////////////////////////////
                                 GETTER
    //////////////////////////////////////////////////////////////*/
    function _getTotalValueFromStrategy(address strategyPool, ProtocolConfig memory config)
        internal
        view
        returns (uint256)
    {
        if (strategyPool == address(config.aavePoolAddressesProvider)) {
            return _getTotalValueFromAave(config.usdc, config.aavePoolAddressesProvider);
        } else if (strategyPool == address(config.comet)) {
            return _getTotalValueFromCompound(config.comet);
        } else {
            revert ProtocolOperations__InvalidStrategyPool(strategyPool);
        }
    }

    function _getStrategyPoolFromProtocol(IYieldPeer.Protocol protocol, ProtocolConfig memory config)
        internal
        pure
        returns (address strategyPool)
    {
        if (protocol == IYieldPeer.Protocol.Aave) strategyPool = config.aavePoolAddressesProvider;
        else if (protocol == IYieldPeer.Protocol.Compound) strategyPool = config.comet;
    }

    /*//////////////////////////////////////////////////////////////
                                INTERNAL
    //////////////////////////////////////////////////////////////*/
    function _depositToAave(address usdc, address aavePoolAddressesProvider, uint256 amount) private {
        address aavePool = IPoolAddressesProvider(aavePoolAddressesProvider).getPool();
        IERC20(usdc).approve(aavePool, amount);
        IPool(aavePool).supply(usdc, amount, address(this), 0);
    }

    function _depositToCompound(address usdc, address comet, uint256 amount) private {
        IERC20(usdc).approve(comet, amount);
        IComet(comet).supply(usdc, amount);
    }

    function _withdrawFromAave(address usdc, address aavePoolAddressesProvider, uint256 amount) private {
        address aavePool = IPoolAddressesProvider(aavePoolAddressesProvider).getPool();
        IPool(aavePool).withdraw(usdc, amount, address(this));
    }

    function _withdrawFromCompound(address usdc, address comet, uint256 amount) private {
        IComet(comet).withdraw(usdc, amount);
    }

    /*//////////////////////////////////////////////////////////////
                             INTERNAL VIEW
    //////////////////////////////////////////////////////////////*/
    function _getTotalValueFromAave(address usdc, address aavePoolAddressesProvider) private view returns (uint256) {
        address aavePool = IPoolAddressesProvider(aavePoolAddressesProvider).getPool();
        DataTypes.ReserveData memory reserveData = IPool(aavePool).getReserveData(usdc);
        address aTokenAddress = reserveData.aTokenAddress;
        return IERC20(aTokenAddress).balanceOf(address(this));
    }

    function _getTotalValueFromCompound(address comet) private view returns (uint256) {
        return IComet(comet).balanceOf(address(this));
    }
}

// SPDX-License-Identifier: MIT
pragma solidity 0.8.26;

import {IYieldPeer} from "../interfaces/IYieldPeer.sol";

/// @notice This library handles building deposit and withdraw data structures for the Yield system
library DataStructures {
    /// @notice Builds a DepositData struct
    /// @param depositor The address of the depositor
    /// @param amount The amount of USDC to deposit
    /// @param chainSelector The CCIP chain selector of the chain the deposit originated from
    /// @return depositData The DepositData struct
    function buildDepositData(address depositor, uint256 amount, uint64 chainSelector)
        internal
        pure
        returns (IYieldPeer.DepositData memory)
    {
        return IYieldPeer.DepositData({
            depositor: depositor,
            amount: amount,
            totalValue: 0, // This will be set by the strategy chain
            shareMintAmount: 0, // This will be set by the parent chain
            chainSelector: chainSelector
        });
    }

    /// @notice Builds a WithdrawData struct
    /// @param withdrawer The address of the withdrawer
    /// @param shareBurnAmount The amount of shares that were burned to withdraw USDC
    /// @param chainSelector The CCIP chain selector of the chain the withdrawal originated from
    /// @return withdrawData The WithdrawData struct
    function buildWithdrawData(address withdrawer, uint256 shareBurnAmount, uint64 chainSelector)
        internal
        pure
        returns (IYieldPeer.WithdrawData memory)
    {
        return IYieldPeer.WithdrawData({
            withdrawer: withdrawer,
            shareBurnAmount: shareBurnAmount,
            usdcWithdrawAmount: 0, // This will be set by the strategy chain
            totalShares: 0, // This will be set by the parent chain
            chainSelector: chainSelector
        });
    }
}

// SPDX-License-Identifier: MIT
pragma solidity 0.8.26;

import {Client, IRouterClient} from "@chainlink/contracts/src/v0.8/ccip/interfaces/IRouterClient.sol";
import {LinkTokenInterface} from "@chainlink/contracts/src/v0.8/shared/interfaces/LinkTokenInterface.sol";
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import {IYieldPeer} from "../interfaces/IYieldPeer.sol";

library CCIPOperations {
    /*//////////////////////////////////////////////////////////////
                                 ERRORS
    //////////////////////////////////////////////////////////////*/
    error CCIPOperations__NotEnoughLink(uint256 linkBalance, uint256 fees);
    error CCIPOperations__InvalidToken(address invalidToken);
    error CCIPOperations__InvalidTokenAmount(uint256 invalidAmount);

    /*//////////////////////////////////////////////////////////////
                                INTERNAL
    //////////////////////////////////////////////////////////////*/
    function _buildCCIPMessage(
        address receiver,
        IYieldPeer.CcipTxType txType,
        bytes memory data,
        Client.EVMTokenAmount[] memory tokenAmounts,
        uint256 gasLimit,
        address link
    ) internal pure returns (Client.EVM2AnyMessage memory evm2AnyMessage) {
        evm2AnyMessage = Client.EVM2AnyMessage({
            receiver: abi.encode(receiver),
            data: abi.encode(txType, data),
            tokenAmounts: tokenAmounts,
            extraArgs: Client._argsToBytes(Client.GenericExtraArgsV2({gasLimit: gasLimit, allowOutOfOrderExecution: true})),
            feeToken: link
        });
    }

    function _handleCCIPFees(
        address ccipRouter,
        address link,
        uint64 dstChainSelector,
        Client.EVM2AnyMessage memory evm2AnyMessage
    ) internal {
        uint256 fees = IRouterClient(ccipRouter).getFee(dstChainSelector, evm2AnyMessage);
        uint256 linkBalance = LinkTokenInterface(link).balanceOf(address(this));
        if (fees > linkBalance) revert CCIPOperations__NotEnoughLink(linkBalance, fees);
        LinkTokenInterface(link).approve(ccipRouter, fees);
    }

    function _prepareTokenAmounts(IERC20 usdc, uint256 bridgeAmount, address ccipRouter)
        internal
        returns (Client.EVMTokenAmount[] memory tokenAmounts)
    {
        if (bridgeAmount > 0) {
            tokenAmounts = new Client.EVMTokenAmount[](1);
            tokenAmounts[0] = Client.EVMTokenAmount({token: address(usdc), amount: bridgeAmount});
            usdc.approve(ccipRouter, bridgeAmount);
        } else {
            tokenAmounts = new Client.EVMTokenAmount[](0);
        }
    }

    /*//////////////////////////////////////////////////////////////
                             INTERNAL VIEW
    //////////////////////////////////////////////////////////////*/
    function _validateTokenAmounts(Client.EVMTokenAmount[] memory tokenAmounts, address usdc, uint256 amount)
        internal
        pure
    {
        if (tokenAmounts[0].token != usdc) revert CCIPOperations__InvalidToken(tokenAmounts[0].token);
        if (tokenAmounts[0].amount != amount) revert CCIPOperations__InvalidTokenAmount(tokenAmounts[0].amount);
    }
}

File 16 of 25 : IAny2EVMMessageReceiver.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import {Client} from "../libraries/Client.sol";

/// @notice Application contracts that intend to receive messages from  the router should implement this interface.
interface IAny2EVMMessageReceiver {
  /// @notice Called by the Router to deliver a message. If this reverts, any token transfers also revert.
  /// The message will move to a FAILED state and become available for manual execution.
  /// @param message CCIP Message.
  /// @dev Note ensure you check the msg.sender is the OffRampRouter.
  function ccipReceive(
    Client.Any2EVMMessage calldata message
  ) external;
}

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

// End consumer library.
library Client {
  struct EVMTokenAmount {
    address token; // token address on the local chain.
    uint256 amount; // Amount of tokens.
  }

  struct Any2EVMMessage {
    bytes32 messageId; // MessageId corresponding to ccipSend on source.
    uint64 sourceChainSelector; // Source chain selector.
    bytes sender; // abi.decode(sender) if coming from an EVM chain.
    bytes data; // payload sent in original message.
    EVMTokenAmount[] destTokenAmounts; // Tokens and their amounts in their destination chain representation.
  }

  // If extraArgs is empty bytes, the default is 200k gas limit.
  struct EVM2AnyMessage {
    bytes receiver; // abi.encode(receiver address) for dest EVM chains.
    bytes data; // Data payload.
    EVMTokenAmount[] tokenAmounts; // Token transfers.
    address feeToken; // Address of feeToken. address(0) means you will send msg.value.
    bytes extraArgs; // Populate this with _argsToBytes(EVMExtraArgsV2).
  }

  // Tag to indicate only a gas limit. Only usable for EVM as destination chain.
  bytes4 public constant EVM_EXTRA_ARGS_V1_TAG = 0x97a657c9;

  struct EVMExtraArgsV1 {
    uint256 gasLimit;
  }

  function _argsToBytes(
    EVMExtraArgsV1 memory extraArgs
  ) internal pure returns (bytes memory bts) {
    return abi.encodeWithSelector(EVM_EXTRA_ARGS_V1_TAG, extraArgs);
  }

  // Tag to indicate a gas limit (or dest chain equivalent processing units) and Out Of Order Execution. This tag is
  // available for multiple chain families. If there is no chain family specific tag, this is the default available
  // for a chain.
  // Note: not available for Solana VM based chains.
  bytes4 public constant GENERIC_EXTRA_ARGS_V2_TAG = 0x181dcf10;

  /// @param gasLimit: gas limit for the callback on the destination chain.
  /// @param allowOutOfOrderExecution: if true, it indicates that the message can be executed in any order relative to
  /// other messages from the same sender. This value's default varies by chain. On some chains, a particular value is
  /// enforced, meaning if the expected value is not set, the message request will revert.
  /// @dev Fully compatible with the previously existing EVMExtraArgsV2.
  struct GenericExtraArgsV2 {
    uint256 gasLimit;
    bool allowOutOfOrderExecution;
  }

  // Extra args tag for chains that use the Solana VM.
  bytes4 public constant SVM_EXTRA_ARGS_V1_TAG = 0x1f3b3aba;

  struct SVMExtraArgsV1 {
    uint32 computeUnits;
    uint64 accountIsWritableBitmap;
    bool allowOutOfOrderExecution;
    bytes32 tokenReceiver;
    bytes32[] accounts;
  }

  /// @dev The maximum number of accounts that can be passed in SVMExtraArgs.
  uint256 public constant SVM_EXTRA_ARGS_MAX_ACCOUNTS = 64;

  function _argsToBytes(
    GenericExtraArgsV2 memory extraArgs
  ) internal pure returns (bytes memory bts) {
    return abi.encodeWithSelector(GENERIC_EXTRA_ARGS_V2_TAG, extraArgs);
  }

  function _svmArgsToBytes(
    SVMExtraArgsV1 memory extraArgs
  ) internal pure returns (bytes memory bts) {
    return abi.encodeWithSelector(SVM_EXTRA_ARGS_V1_TAG, extraArgs);
  }
}

// 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: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)

pragma solidity ^0.8.20;

import {Context} from "../utils/Context.sol";

/**
 * @dev Contract module which provides a basic access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * The initial owner is set to the address provided by the deployer. This can
 * later be changed with {transferOwnership}.
 *
 * This module is used through inheritance. It will make available the modifier
 * `onlyOwner`, which can be applied to your functions to restrict their use to
 * the owner.
 */
abstract contract Ownable is Context {
    address private _owner;

    /**
     * @dev The caller account is not authorized to perform an operation.
     */
    error OwnableUnauthorizedAccount(address account);

    /**
     * @dev The owner is not a valid owner account. (eg. `address(0)`)
     */
    error OwnableInvalidOwner(address owner);

    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    /**
     * @dev Initializes the contract setting the address provided by the deployer as the initial owner.
     */
    constructor(address initialOwner) {
        if (initialOwner == address(0)) {
            revert OwnableInvalidOwner(address(0));
        }
        _transferOwnership(initialOwner);
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        _checkOwner();
        _;
    }

    /**
     * @dev Returns the address of the current owner.
     */
    function owner() public view virtual returns (address) {
        return _owner;
    }

    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        if (owner() != _msgSender()) {
            revert OwnableUnauthorizedAccount(_msgSender());
        }
    }

    /**
     * @dev 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 virtual onlyOwner {
        _transferOwnership(address(0));
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        if (newOwner == address(0)) {
            revert OwnableInvalidOwner(address(0));
        }
        _transferOwnership(newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import {IERC20} from "../../../vendor/openzeppelin-solidity/v4.8.3/contracts/token/ERC20/IERC20.sol";

interface IBurnMintERC20 is IERC20 {
  /// @notice Mints new tokens for a given address.
  /// @param account The address to mint the new tokens to.
  /// @param amount The number of tokens to be minted.
  /// @dev this function increases the total supply.
  function mint(address account, uint256 amount) external;

  /// @notice Burns tokens from the sender.
  /// @param amount The number of tokens to be burned.
  /// @dev this function decreases the total supply.
  function burn(uint256 amount) external;

  /// @notice Burns tokens from a given address..
  /// @param account The address to burn tokens from.
  /// @param amount The number of tokens to be burned.
  /// @dev this function decreases the total supply.
  function burn(address account, uint256 amount) external;

  /// @notice Burns tokens from a given address..
  /// @param account The address to burn tokens from.
  /// @param amount The number of tokens to be burned.
  /// @dev this function decreases the total supply.
  function burnFrom(address account, uint256 amount) external;
}

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

interface IERC677 {
  event Transfer(address indexed from, address indexed to, uint256 value, bytes data);

  /// @notice Transfer tokens from `msg.sender` to another address and then call `onTransferReceived` on receiver
  /// @param to The address which you want to transfer to
  /// @param amount The amount of tokens to be transferred
  /// @param data bytes Additional data with no specified format, sent in call to `to`
  /// @return true unless throwing
  function transferAndCall(address to, uint256 amount, bytes memory data) external returns (bool);
}

File 22 of 25 : IPool.sol
// SPDX-License-Identifier: AGPL-3.0
pragma solidity ^0.8.0;

import {IPoolAddressesProvider} from './IPoolAddressesProvider.sol';
import {DataTypes} from '../protocol/libraries/types/DataTypes.sol';

/**
 * @title IPool
 * @author Aave
 * @notice Defines the basic interface for an Aave Pool.
 */
interface IPool {
  /**
   * @dev Emitted on mintUnbacked()
   * @param reserve The address of the underlying asset of the reserve
   * @param user The address initiating the supply
   * @param onBehalfOf The beneficiary of the supplied assets, receiving the aTokens
   * @param amount The amount of supplied assets
   * @param referralCode The referral code used
   */
  event MintUnbacked(
    address indexed reserve,
    address user,
    address indexed onBehalfOf,
    uint256 amount,
    uint16 indexed referralCode
  );

  /**
   * @dev Emitted on backUnbacked()
   * @param reserve The address of the underlying asset of the reserve
   * @param backer The address paying for the backing
   * @param amount The amount added as backing
   * @param fee The amount paid in fees
   */
  event BackUnbacked(address indexed reserve, address indexed backer, uint256 amount, uint256 fee);

  /**
   * @dev Emitted on supply()
   * @param reserve The address of the underlying asset of the reserve
   * @param user The address initiating the supply
   * @param onBehalfOf The beneficiary of the supply, receiving the aTokens
   * @param amount The amount supplied
   * @param referralCode The referral code used
   */
  event Supply(
    address indexed reserve,
    address user,
    address indexed onBehalfOf,
    uint256 amount,
    uint16 indexed referralCode
  );

  /**
   * @dev Emitted on withdraw()
   * @param reserve The address of the underlying asset being withdrawn
   * @param user The address initiating the withdrawal, owner of aTokens
   * @param to The address that will receive the underlying
   * @param amount The amount to be withdrawn
   */
  event Withdraw(address indexed reserve, address indexed user, address indexed to, uint256 amount);

  /**
   * @dev Emitted on borrow() and flashLoan() when debt needs to be opened
   * @param reserve The address of the underlying asset being borrowed
   * @param user The address of the user initiating the borrow(), receiving the funds on borrow() or just
   * initiator of the transaction on flashLoan()
   * @param onBehalfOf The address that will be getting the debt
   * @param amount The amount borrowed out
   * @param interestRateMode The rate mode: 1 for Stable, 2 for Variable
   * @param borrowRate The numeric rate at which the user has borrowed, expressed in ray
   * @param referralCode The referral code used
   */
  event Borrow(
    address indexed reserve,
    address user,
    address indexed onBehalfOf,
    uint256 amount,
    DataTypes.InterestRateMode interestRateMode,
    uint256 borrowRate,
    uint16 indexed referralCode
  );

  /**
   * @dev Emitted on repay()
   * @param reserve The address of the underlying asset of the reserve
   * @param user The beneficiary of the repayment, getting his debt reduced
   * @param repayer The address of the user initiating the repay(), providing the funds
   * @param amount The amount repaid
   * @param useATokens True if the repayment is done using aTokens, `false` if done with underlying asset directly
   */
  event Repay(
    address indexed reserve,
    address indexed user,
    address indexed repayer,
    uint256 amount,
    bool useATokens
  );

  /**
   * @dev Emitted on swapBorrowRateMode()
   * @param reserve The address of the underlying asset of the reserve
   * @param user The address of the user swapping his rate mode
   * @param interestRateMode The current interest rate mode of the position being swapped: 1 for Stable, 2 for Variable
   */
  event SwapBorrowRateMode(
    address indexed reserve,
    address indexed user,
    DataTypes.InterestRateMode interestRateMode
  );

  /**
   * @dev Emitted on borrow(), repay() and liquidationCall() when using isolated assets
   * @param asset The address of the underlying asset of the reserve
   * @param totalDebt The total isolation mode debt for the reserve
   */
  event IsolationModeTotalDebtUpdated(address indexed asset, uint256 totalDebt);

  /**
   * @dev Emitted when the user selects a certain asset category for eMode
   * @param user The address of the user
   * @param categoryId The category id
   */
  event UserEModeSet(address indexed user, uint8 categoryId);

  /**
   * @dev Emitted on setUserUseReserveAsCollateral()
   * @param reserve The address of the underlying asset of the reserve
   * @param user The address of the user enabling the usage as collateral
   */
  event ReserveUsedAsCollateralEnabled(address indexed reserve, address indexed user);

  /**
   * @dev Emitted on setUserUseReserveAsCollateral()
   * @param reserve The address of the underlying asset of the reserve
   * @param user The address of the user enabling the usage as collateral
   */
  event ReserveUsedAsCollateralDisabled(address indexed reserve, address indexed user);

  /**
   * @dev Emitted on rebalanceStableBorrowRate()
   * @param reserve The address of the underlying asset of the reserve
   * @param user The address of the user for which the rebalance has been executed
   */
  event RebalanceStableBorrowRate(address indexed reserve, address indexed user);

  /**
   * @dev Emitted on flashLoan()
   * @param target The address of the flash loan receiver contract
   * @param initiator The address initiating the flash loan
   * @param asset The address of the asset being flash borrowed
   * @param amount The amount flash borrowed
   * @param interestRateMode The flashloan mode: 0 for regular flashloan, 1 for Stable debt, 2 for Variable debt
   * @param premium The fee flash borrowed
   * @param referralCode The referral code used
   */
  event FlashLoan(
    address indexed target,
    address initiator,
    address indexed asset,
    uint256 amount,
    DataTypes.InterestRateMode interestRateMode,
    uint256 premium,
    uint16 indexed referralCode
  );

  /**
   * @dev Emitted when a borrower is liquidated.
   * @param collateralAsset The address of the underlying asset used as collateral, to receive as result of the liquidation
   * @param debtAsset The address of the underlying borrowed asset to be repaid with the liquidation
   * @param user The address of the borrower getting liquidated
   * @param debtToCover The debt amount of borrowed `asset` the liquidator wants to cover
   * @param liquidatedCollateralAmount The amount of collateral received by the liquidator
   * @param liquidator The address of the liquidator
   * @param receiveAToken True if the liquidators wants to receive the collateral aTokens, `false` if he wants
   * to receive the underlying collateral asset directly
   */
  event LiquidationCall(
    address indexed collateralAsset,
    address indexed debtAsset,
    address indexed user,
    uint256 debtToCover,
    uint256 liquidatedCollateralAmount,
    address liquidator,
    bool receiveAToken
  );

  /**
   * @dev Emitted when the state of a reserve is updated.
   * @param reserve The address of the underlying asset of the reserve
   * @param liquidityRate The next liquidity rate
   * @param stableBorrowRate The next stable borrow rate
   * @param variableBorrowRate The next variable borrow rate
   * @param liquidityIndex The next liquidity index
   * @param variableBorrowIndex The next variable borrow index
   */
  event ReserveDataUpdated(
    address indexed reserve,
    uint256 liquidityRate,
    uint256 stableBorrowRate,
    uint256 variableBorrowRate,
    uint256 liquidityIndex,
    uint256 variableBorrowIndex
  );

  /**
   * @dev Emitted when the protocol treasury receives minted aTokens from the accrued interest.
   * @param reserve The address of the reserve
   * @param amountMinted The amount minted to the treasury
   */
  event MintedToTreasury(address indexed reserve, uint256 amountMinted);

  /**
   * @notice Mints an `amount` of aTokens to the `onBehalfOf`
   * @param asset The address of the underlying asset to mint
   * @param amount The amount to mint
   * @param onBehalfOf The address that will receive the aTokens
   * @param referralCode Code used to register the integrator originating the operation, for potential rewards.
   *   0 if the action is executed directly by the user, without any middle-man
   */
  function mintUnbacked(
    address asset,
    uint256 amount,
    address onBehalfOf,
    uint16 referralCode
  ) external;

  /**
   * @notice Back the current unbacked underlying with `amount` and pay `fee`.
   * @param asset The address of the underlying asset to back
   * @param amount The amount to back
   * @param fee The amount paid in fees
   * @return The backed amount
   */
  function backUnbacked(address asset, uint256 amount, uint256 fee) external returns (uint256);

  /**
   * @notice Supplies an `amount` of underlying asset into the reserve, receiving in return overlying aTokens.
   * - E.g. User supplies 100 USDC and gets in return 100 aUSDC
   * @param asset The address of the underlying asset to supply
   * @param amount The amount to be supplied
   * @param onBehalfOf The address that will receive the aTokens, same as msg.sender if the user
   *   wants to receive them on his own wallet, or a different address if the beneficiary of aTokens
   *   is a different wallet
   * @param referralCode Code used to register the integrator originating the operation, for potential rewards.
   *   0 if the action is executed directly by the user, without any middle-man
   */
  function supply(address asset, uint256 amount, address onBehalfOf, uint16 referralCode) external;

  /**
   * @notice Supply with transfer approval of asset to be supplied done via permit function
   * see: https://eips.ethereum.org/EIPS/eip-2612 and https://eips.ethereum.org/EIPS/eip-713
   * @param asset The address of the underlying asset to supply
   * @param amount The amount to be supplied
   * @param onBehalfOf The address that will receive the aTokens, same as msg.sender if the user
   *   wants to receive them on his own wallet, or a different address if the beneficiary of aTokens
   *   is a different wallet
   * @param deadline The deadline timestamp that the permit is valid
   * @param referralCode Code used to register the integrator originating the operation, for potential rewards.
   *   0 if the action is executed directly by the user, without any middle-man
   * @param permitV The V parameter of ERC712 permit sig
   * @param permitR The R parameter of ERC712 permit sig
   * @param permitS The S parameter of ERC712 permit sig
   */
  function supplyWithPermit(
    address asset,
    uint256 amount,
    address onBehalfOf,
    uint16 referralCode,
    uint256 deadline,
    uint8 permitV,
    bytes32 permitR,
    bytes32 permitS
  ) external;

  /**
   * @notice Withdraws an `amount` of underlying asset from the reserve, burning the equivalent aTokens owned
   * E.g. User has 100 aUSDC, calls withdraw() and receives 100 USDC, burning the 100 aUSDC
   * @param asset The address of the underlying asset to withdraw
   * @param amount The underlying amount to be withdrawn
   *   - Send the value type(uint256).max in order to withdraw the whole aToken balance
   * @param to The address that will receive the underlying, same as msg.sender if the user
   *   wants to receive it on his own wallet, or a different address if the beneficiary is a
   *   different wallet
   * @return The final amount withdrawn
   */
  function withdraw(address asset, uint256 amount, address to) external returns (uint256);

  /**
   * @notice Allows users to borrow a specific `amount` of the reserve underlying asset, provided that the borrower
   * already supplied enough collateral, or he was given enough allowance by a credit delegator on the
   * corresponding debt token (StableDebtToken or VariableDebtToken)
   * - E.g. User borrows 100 USDC passing as `onBehalfOf` his own address, receiving the 100 USDC in his wallet
   *   and 100 stable/variable debt tokens, depending on the `interestRateMode`
   * @param asset The address of the underlying asset to borrow
   * @param amount The amount to be borrowed
   * @param interestRateMode The interest rate mode at which the user wants to borrow: 1 for Stable, 2 for Variable
   * @param referralCode The code used to register the integrator originating the operation, for potential rewards.
   *   0 if the action is executed directly by the user, without any middle-man
   * @param onBehalfOf The address of the user who will receive the debt. Should be the address of the borrower itself
   * calling the function if he wants to borrow against his own collateral, or the address of the credit delegator
   * if he has been given credit delegation allowance
   */
  function borrow(
    address asset,
    uint256 amount,
    uint256 interestRateMode,
    uint16 referralCode,
    address onBehalfOf
  ) external;

  /**
   * @notice Repays a borrowed `amount` on a specific reserve, burning the equivalent debt tokens owned
   * - E.g. User repays 100 USDC, burning 100 variable/stable debt tokens of the `onBehalfOf` address
   * @param asset The address of the borrowed underlying asset previously borrowed
   * @param amount The amount to repay
   * - Send the value type(uint256).max in order to repay the whole debt for `asset` on the specific `debtMode`
   * @param interestRateMode The interest rate mode at of the debt the user wants to repay: 1 for Stable, 2 for Variable
   * @param onBehalfOf The address of the user who will get his debt reduced/removed. Should be the address of the
   * user calling the function if he wants to reduce/remove his own debt, or the address of any other
   * other borrower whose debt should be removed
   * @return The final amount repaid
   */
  function repay(
    address asset,
    uint256 amount,
    uint256 interestRateMode,
    address onBehalfOf
  ) external returns (uint256);

  /**
   * @notice Repay with transfer approval of asset to be repaid done via permit function
   * see: https://eips.ethereum.org/EIPS/eip-2612 and https://eips.ethereum.org/EIPS/eip-713
   * @param asset The address of the borrowed underlying asset previously borrowed
   * @param amount The amount to repay
   * - Send the value type(uint256).max in order to repay the whole debt for `asset` on the specific `debtMode`
   * @param interestRateMode The interest rate mode at of the debt the user wants to repay: 1 for Stable, 2 for Variable
   * @param onBehalfOf Address of the user who will get his debt reduced/removed. Should be the address of the
   * user calling the function if he wants to reduce/remove his own debt, or the address of any other
   * other borrower whose debt should be removed
   * @param deadline The deadline timestamp that the permit is valid
   * @param permitV The V parameter of ERC712 permit sig
   * @param permitR The R parameter of ERC712 permit sig
   * @param permitS The S parameter of ERC712 permit sig
   * @return The final amount repaid
   */
  function repayWithPermit(
    address asset,
    uint256 amount,
    uint256 interestRateMode,
    address onBehalfOf,
    uint256 deadline,
    uint8 permitV,
    bytes32 permitR,
    bytes32 permitS
  ) external returns (uint256);

  /**
   * @notice Repays a borrowed `amount` on a specific reserve using the reserve aTokens, burning the
   * equivalent debt tokens
   * - E.g. User repays 100 USDC using 100 aUSDC, burning 100 variable/stable debt tokens
   * @dev  Passing uint256.max as amount will clean up any residual aToken dust balance, if the user aToken
   * balance is not enough to cover the whole debt
   * @param asset The address of the borrowed underlying asset previously borrowed
   * @param amount The amount to repay
   * - Send the value type(uint256).max in order to repay the whole debt for `asset` on the specific `debtMode`
   * @param interestRateMode The interest rate mode at of the debt the user wants to repay: 1 for Stable, 2 for Variable
   * @return The final amount repaid
   */
  function repayWithATokens(
    address asset,
    uint256 amount,
    uint256 interestRateMode
  ) external returns (uint256);

  /**
   * @notice Allows a borrower to swap his debt between stable and variable mode, or vice versa
   * @param asset The address of the underlying asset borrowed
   * @param interestRateMode The current interest rate mode of the position being swapped: 1 for Stable, 2 for Variable
   */
  function swapBorrowRateMode(address asset, uint256 interestRateMode) external;

  /**
   * @notice Rebalances the stable interest rate of a user to the current stable rate defined on the reserve.
   * - Users can be rebalanced if the following conditions are satisfied:
   *     1. Usage ratio is above 95%
   *     2. the current supply APY is below REBALANCE_UP_THRESHOLD * maxVariableBorrowRate, which means that too
   *        much has been borrowed at a stable rate and suppliers are not earning enough
   * @param asset The address of the underlying asset borrowed
   * @param user The address of the user to be rebalanced
   */
  function rebalanceStableBorrowRate(address asset, address user) external;

  /**
   * @notice Allows suppliers to enable/disable a specific supplied asset as collateral
   * @param asset The address of the underlying asset supplied
   * @param useAsCollateral True if the user wants to use the supply as collateral, false otherwise
   */
  function setUserUseReserveAsCollateral(address asset, bool useAsCollateral) external;

  /**
   * @notice Function to liquidate a non-healthy position collateral-wise, with Health Factor below 1
   * - The caller (liquidator) covers `debtToCover` amount of debt of the user getting liquidated, and receives
   *   a proportionally amount of the `collateralAsset` plus a bonus to cover market risk
   * @param collateralAsset The address of the underlying asset used as collateral, to receive as result of the liquidation
   * @param debtAsset The address of the underlying borrowed asset to be repaid with the liquidation
   * @param user The address of the borrower getting liquidated
   * @param debtToCover The debt amount of borrowed `asset` the liquidator wants to cover
   * @param receiveAToken True if the liquidators wants to receive the collateral aTokens, `false` if he wants
   * to receive the underlying collateral asset directly
   */
  function liquidationCall(
    address collateralAsset,
    address debtAsset,
    address user,
    uint256 debtToCover,
    bool receiveAToken
  ) external;

  /**
   * @notice Allows smartcontracts to access the liquidity of the pool within one transaction,
   * as long as the amount taken plus a fee is returned.
   * @dev IMPORTANT There are security concerns for developers of flashloan receiver contracts that must be kept
   * into consideration. For further details please visit https://docs.aave.com/developers/
   * @param receiverAddress The address of the contract receiving the funds, implementing IFlashLoanReceiver interface
   * @param assets The addresses of the assets being flash-borrowed
   * @param amounts The amounts of the assets being flash-borrowed
   * @param interestRateModes Types of the debt to open if the flash loan is not returned:
   *   0 -> Don't open any debt, just revert if funds can't be transferred from the receiver
   *   1 -> Open debt at stable rate for the value of the amount flash-borrowed to the `onBehalfOf` address
   *   2 -> Open debt at variable rate for the value of the amount flash-borrowed to the `onBehalfOf` address
   * @param onBehalfOf The address  that will receive the debt in the case of using on `modes` 1 or 2
   * @param params Variadic packed params to pass to the receiver as extra information
   * @param referralCode The code used to register the integrator originating the operation, for potential rewards.
   *   0 if the action is executed directly by the user, without any middle-man
   */
  function flashLoan(
    address receiverAddress,
    address[] calldata assets,
    uint256[] calldata amounts,
    uint256[] calldata interestRateModes,
    address onBehalfOf,
    bytes calldata params,
    uint16 referralCode
  ) external;

  /**
   * @notice Allows smartcontracts to access the liquidity of the pool within one transaction,
   * as long as the amount taken plus a fee is returned.
   * @dev IMPORTANT There are security concerns for developers of flashloan receiver contracts that must be kept
   * into consideration. For further details please visit https://docs.aave.com/developers/
   * @param receiverAddress The address of the contract receiving the funds, implementing IFlashLoanSimpleReceiver interface
   * @param asset The address of the asset being flash-borrowed
   * @param amount The amount of the asset being flash-borrowed
   * @param params Variadic packed params to pass to the receiver as extra information
   * @param referralCode The code used to register the integrator originating the operation, for potential rewards.
   *   0 if the action is executed directly by the user, without any middle-man
   */
  function flashLoanSimple(
    address receiverAddress,
    address asset,
    uint256 amount,
    bytes calldata params,
    uint16 referralCode
  ) external;

  /**
   * @notice Returns the user account data across all the reserves
   * @param user The address of the user
   * @return totalCollateralBase The total collateral of the user in the base currency used by the price feed
   * @return totalDebtBase The total debt of the user in the base currency used by the price feed
   * @return availableBorrowsBase The borrowing power left of the user in the base currency used by the price feed
   * @return currentLiquidationThreshold The liquidation threshold of the user
   * @return ltv The loan to value of The user
   * @return healthFactor The current health factor of the user
   */
  function getUserAccountData(
    address user
  )
    external
    view
    returns (
      uint256 totalCollateralBase,
      uint256 totalDebtBase,
      uint256 availableBorrowsBase,
      uint256 currentLiquidationThreshold,
      uint256 ltv,
      uint256 healthFactor
    );

  /**
   * @notice Initializes a reserve, activating it, assigning an aToken and debt tokens and an
   * interest rate strategy
   * @dev Only callable by the PoolConfigurator contract
   * @param asset The address of the underlying asset of the reserve
   * @param aTokenAddress The address of the aToken that will be assigned to the reserve
   * @param stableDebtAddress The address of the StableDebtToken that will be assigned to the reserve
   * @param variableDebtAddress The address of the VariableDebtToken that will be assigned to the reserve
   * @param interestRateStrategyAddress The address of the interest rate strategy contract
   */
  function initReserve(
    address asset,
    address aTokenAddress,
    address stableDebtAddress,
    address variableDebtAddress,
    address interestRateStrategyAddress
  ) external;

  /**
   * @notice Drop a reserve
   * @dev Only callable by the PoolConfigurator contract
   * @param asset The address of the underlying asset of the reserve
   */
  function dropReserve(address asset) external;

  /**
   * @notice Updates the address of the interest rate strategy contract
   * @dev Only callable by the PoolConfigurator contract
   * @param asset The address of the underlying asset of the reserve
   * @param rateStrategyAddress The address of the interest rate strategy contract
   */
  function setReserveInterestRateStrategyAddress(
    address asset,
    address rateStrategyAddress
  ) external;

  /**
   * @notice Sets the configuration bitmap of the reserve as a whole
   * @dev Only callable by the PoolConfigurator contract
   * @param asset The address of the underlying asset of the reserve
   * @param configuration The new configuration bitmap
   */
  function setConfiguration(
    address asset,
    DataTypes.ReserveConfigurationMap calldata configuration
  ) external;

  /**
   * @notice Returns the configuration of the reserve
   * @param asset The address of the underlying asset of the reserve
   * @return The configuration of the reserve
   */
  function getConfiguration(
    address asset
  ) external view returns (DataTypes.ReserveConfigurationMap memory);

  /**
   * @notice Returns the configuration of the user across all the reserves
   * @param user The user address
   * @return The configuration of the user
   */
  function getUserConfiguration(
    address user
  ) external view returns (DataTypes.UserConfigurationMap memory);

  /**
   * @notice Returns the normalized income of the reserve
   * @param asset The address of the underlying asset of the reserve
   * @return The reserve's normalized income
   */
  function getReserveNormalizedIncome(address asset) external view returns (uint256);

  /**
   * @notice Returns the normalized variable debt per unit of asset
   * @dev WARNING: This function is intended to be used primarily by the protocol itself to get a
   * "dynamic" variable index based on time, current stored index and virtual rate at the current
   * moment (approx. a borrower would get if opening a position). This means that is always used in
   * combination with variable debt supply/balances.
   * If using this function externally, consider that is possible to have an increasing normalized
   * variable debt that is not equivalent to how the variable debt index would be updated in storage
   * (e.g. only updates with non-zero variable debt supply)
   * @param asset The address of the underlying asset of the reserve
   * @return The reserve normalized variable debt
   */
  function getReserveNormalizedVariableDebt(address asset) external view returns (uint256);

  /**
   * @notice Returns the state and configuration of the reserve
   * @param asset The address of the underlying asset of the reserve
   * @return The state and configuration data of the reserve
   */
  function getReserveData(address asset) external view returns (DataTypes.ReserveData memory);

  /**
   * @notice Validates and finalizes an aToken transfer
   * @dev Only callable by the overlying aToken of the `asset`
   * @param asset The address of the underlying asset of the aToken
   * @param from The user from which the aTokens are transferred
   * @param to The user receiving the aTokens
   * @param amount The amount being transferred/withdrawn
   * @param balanceFromBefore The aToken balance of the `from` user before the transfer
   * @param balanceToBefore The aToken balance of the `to` user before the transfer
   */
  function finalizeTransfer(
    address asset,
    address from,
    address to,
    uint256 amount,
    uint256 balanceFromBefore,
    uint256 balanceToBefore
  ) external;

  /**
   * @notice Returns the list of the underlying assets of all the initialized reserves
   * @dev It does not include dropped reserves
   * @return The addresses of the underlying assets of the initialized reserves
   */
  function getReservesList() external view returns (address[] memory);

  /**
   * @notice Returns the address of the underlying asset of a reserve by the reserve id as stored in the DataTypes.ReserveData struct
   * @param id The id of the reserve as stored in the DataTypes.ReserveData struct
   * @return The address of the reserve associated with id
   */
  function getReserveAddressById(uint16 id) external view returns (address);

  /**
   * @notice Returns the PoolAddressesProvider connected to this contract
   * @return The address of the PoolAddressesProvider
   */
  function ADDRESSES_PROVIDER() external view returns (IPoolAddressesProvider);

  /**
   * @notice Updates the protocol fee on the bridging
   * @param bridgeProtocolFee The part of the premium sent to the protocol treasury
   */
  function updateBridgeProtocolFee(uint256 bridgeProtocolFee) external;

  /**
   * @notice Updates flash loan premiums. Flash loan premium consists of two parts:
   * - A part is sent to aToken holders as extra, one time accumulated interest
   * - A part is collected by the protocol treasury
   * @dev The total premium is calculated on the total borrowed amount
   * @dev The premium to protocol is calculated on the total premium, being a percentage of `flashLoanPremiumTotal`
   * @dev Only callable by the PoolConfigurator contract
   * @param flashLoanPremiumTotal The total premium, expressed in bps
   * @param flashLoanPremiumToProtocol The part of the premium sent to the protocol treasury, expressed in bps
   */
  function updateFlashloanPremiums(
    uint128 flashLoanPremiumTotal,
    uint128 flashLoanPremiumToProtocol
  ) external;

  /**
   * @notice Configures a new category for the eMode.
   * @dev In eMode, the protocol allows very high borrowing power to borrow assets of the same category.
   * The category 0 is reserved as it's the default for volatile assets
   * @param id The id of the category
   * @param config The configuration of the category
   */
  function configureEModeCategory(uint8 id, DataTypes.EModeCategory memory config) external;

  /**
   * @notice Returns the data of an eMode category
   * @param id The id of the category
   * @return The configuration data of the category
   */
  function getEModeCategoryData(uint8 id) external view returns (DataTypes.EModeCategory memory);

  /**
   * @notice Allows a user to use the protocol in eMode
   * @param categoryId The id of the category
   */
  function setUserEMode(uint8 categoryId) external;

  /**
   * @notice Returns the eMode the user is using
   * @param user The address of the user
   * @return The eMode id
   */
  function getUserEMode(address user) external view returns (uint256);

  /**
   * @notice Resets the isolation mode total debt of the given asset to zero
   * @dev It requires the given asset has zero debt ceiling
   * @param asset The address of the underlying asset to reset the isolationModeTotalDebt
   */
  function resetIsolationModeTotalDebt(address asset) external;

  /**
   * @notice Returns the percentage of available liquidity that can be borrowed at once at stable rate
   * @return The percentage of available liquidity to borrow, expressed in bps
   */
  function MAX_STABLE_RATE_BORROW_SIZE_PERCENT() external view returns (uint256);

  /**
   * @notice Returns the total fee on flash loans
   * @return The total fee on flashloans
   */
  function FLASHLOAN_PREMIUM_TOTAL() external view returns (uint128);

  /**
   * @notice Returns the part of the bridge fees sent to protocol
   * @return The bridge fee sent to the protocol treasury
   */
  function BRIDGE_PROTOCOL_FEE() external view returns (uint256);

  /**
   * @notice Returns the part of the flashloan fees sent to protocol
   * @return The flashloan fee sent to the protocol treasury
   */
  function FLASHLOAN_PREMIUM_TO_PROTOCOL() external view returns (uint128);

  /**
   * @notice Returns the maximum number of reserves supported to be listed in this Pool
   * @return The maximum number of reserves supported
   */
  function MAX_NUMBER_RESERVES() external view returns (uint16);

  /**
   * @notice Mints the assets accrued through the reserve factor to the treasury in the form of aTokens
   * @param assets The list of reserves for which the minting needs to be executed
   */
  function mintToTreasury(address[] calldata assets) external;

  /**
   * @notice Rescue and transfer tokens locked in this contract
   * @param token The address of the token
   * @param to The address of the recipient
   * @param amount The amount of token to transfer
   */
  function rescueTokens(address token, address to, uint256 amount) external;

  /**
   * @notice Supplies an `amount` of underlying asset into the reserve, receiving in return overlying aTokens.
   * - E.g. User supplies 100 USDC and gets in return 100 aUSDC
   * @dev Deprecated: Use the `supply` function instead
   * @param asset The address of the underlying asset to supply
   * @param amount The amount to be supplied
   * @param onBehalfOf The address that will receive the aTokens, same as msg.sender if the user
   *   wants to receive them on his own wallet, or a different address if the beneficiary of aTokens
   *   is a different wallet
   * @param referralCode Code used to register the integrator originating the operation, for potential rewards.
   *   0 if the action is executed directly by the user, without any middle-man
   */
  function deposit(address asset, uint256 amount, address onBehalfOf, uint16 referralCode) external;
}

File 23 of 25 : DataTypes.sol
// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.0;

library DataTypes {
  struct ReserveData {
    //stores the reserve configuration
    ReserveConfigurationMap configuration;
    //the liquidity index. Expressed in ray
    uint128 liquidityIndex;
    //the current supply rate. Expressed in ray
    uint128 currentLiquidityRate;
    //variable borrow index. Expressed in ray
    uint128 variableBorrowIndex;
    //the current variable borrow rate. Expressed in ray
    uint128 currentVariableBorrowRate;
    //the current stable borrow rate. Expressed in ray
    uint128 currentStableBorrowRate;
    //timestamp of last update
    uint40 lastUpdateTimestamp;
    //the id of the reserve. Represents the position in the list of the active reserves
    uint16 id;
    //aToken address
    address aTokenAddress;
    //stableDebtToken address
    address stableDebtTokenAddress;
    //variableDebtToken address
    address variableDebtTokenAddress;
    //address of the interest rate strategy
    address interestRateStrategyAddress;
    //the current treasury balance, scaled
    uint128 accruedToTreasury;
    //the outstanding unbacked aTokens minted through the bridging feature
    uint128 unbacked;
    //the outstanding debt borrowed against this asset in isolation mode
    uint128 isolationModeTotalDebt;
  }

  struct ReserveConfigurationMap {
    //bit 0-15: LTV
    //bit 16-31: Liq. threshold
    //bit 32-47: Liq. bonus
    //bit 48-55: Decimals
    //bit 56: reserve is active
    //bit 57: reserve is frozen
    //bit 58: borrowing is enabled
    //bit 59: stable rate borrowing enabled
    //bit 60: asset is paused
    //bit 61: borrowing in isolation mode is enabled
    //bit 62: siloed borrowing enabled
    //bit 63: flashloaning enabled
    //bit 64-79: reserve factor
    //bit 80-115 borrow cap in whole tokens, borrowCap == 0 => no cap
    //bit 116-151 supply cap in whole tokens, supplyCap == 0 => no cap
    //bit 152-167 liquidation protocol fee
    //bit 168-175 eMode category
    //bit 176-211 unbacked mint cap in whole tokens, unbackedMintCap == 0 => minting disabled
    //bit 212-251 debt ceiling for isolation mode with (ReserveConfiguration::DEBT_CEILING_DECIMALS) decimals
    //bit 252-255 unused

    uint256 data;
  }

  struct UserConfigurationMap {
    /**
     * @dev Bitmap of the users collaterals and borrows. It is divided in pairs of bits, one pair per asset.
     * The first bit indicates if an asset is used as collateral by the user, the second whether an
     * asset is borrowed by the user.
     */
    uint256 data;
  }

  struct EModeCategory {
    // each eMode category has a custom ltv and liquidation threshold
    uint16 ltv;
    uint16 liquidationThreshold;
    uint16 liquidationBonus;
    // each eMode category may or may not have a custom oracle to override the individual assets price oracles
    address priceSource;
    string label;
  }

  enum InterestRateMode {NONE, STABLE, VARIABLE}

  struct ReserveCache {
    uint256 currScaledVariableDebt;
    uint256 nextScaledVariableDebt;
    uint256 currPrincipalStableDebt;
    uint256 currAvgStableBorrowRate;
    uint256 currTotalStableDebt;
    uint256 nextAvgStableBorrowRate;
    uint256 nextTotalStableDebt;
    uint256 currLiquidityIndex;
    uint256 nextLiquidityIndex;
    uint256 currVariableBorrowIndex;
    uint256 nextVariableBorrowIndex;
    uint256 currLiquidityRate;
    uint256 currVariableBorrowRate;
    uint256 reserveFactor;
    ReserveConfigurationMap reserveConfiguration;
    address aTokenAddress;
    address stableDebtTokenAddress;
    address variableDebtTokenAddress;
    uint40 reserveLastUpdateTimestamp;
    uint40 stableDebtLastUpdateTimestamp;
  }

  struct ExecuteLiquidationCallParams {
    uint256 reservesCount;
    uint256 debtToCover;
    address collateralAsset;
    address debtAsset;
    address user;
    bool receiveAToken;
    address priceOracle;
    uint8 userEModeCategory;
    address priceOracleSentinel;
  }

  struct ExecuteSupplyParams {
    address asset;
    uint256 amount;
    address onBehalfOf;
    uint16 referralCode;
  }

  struct ExecuteBorrowParams {
    address asset;
    address user;
    address onBehalfOf;
    uint256 amount;
    InterestRateMode interestRateMode;
    uint16 referralCode;
    bool releaseUnderlying;
    uint256 maxStableRateBorrowSizePercent;
    uint256 reservesCount;
    address oracle;
    uint8 userEModeCategory;
    address priceOracleSentinel;
  }

  struct ExecuteRepayParams {
    address asset;
    uint256 amount;
    InterestRateMode interestRateMode;
    address onBehalfOf;
    bool useATokens;
  }

  struct ExecuteWithdrawParams {
    address asset;
    uint256 amount;
    address to;
    uint256 reservesCount;
    address oracle;
    uint8 userEModeCategory;
  }

  struct ExecuteSetUserEModeParams {
    uint256 reservesCount;
    address oracle;
    uint8 categoryId;
  }

  struct FinalizeTransferParams {
    address asset;
    address from;
    address to;
    uint256 amount;
    uint256 balanceFromBefore;
    uint256 balanceToBefore;
    uint256 reservesCount;
    address oracle;
    uint8 fromEModeCategory;
  }

  struct FlashloanParams {
    address receiverAddress;
    address[] assets;
    uint256[] amounts;
    uint256[] interestRateModes;
    address onBehalfOf;
    bytes params;
    uint16 referralCode;
    uint256 flashLoanPremiumToProtocol;
    uint256 flashLoanPremiumTotal;
    uint256 maxStableRateBorrowSizePercent;
    uint256 reservesCount;
    address addressesProvider;
    uint8 userEModeCategory;
    bool isAuthorizedFlashBorrower;
  }

  struct FlashloanSimpleParams {
    address receiverAddress;
    address asset;
    uint256 amount;
    bytes params;
    uint16 referralCode;
    uint256 flashLoanPremiumToProtocol;
    uint256 flashLoanPremiumTotal;
  }

  struct FlashLoanRepaymentParams {
    uint256 amount;
    uint256 totalPremium;
    uint256 flashLoanPremiumToProtocol;
    address asset;
    address receiverAddress;
    uint16 referralCode;
  }

  struct CalculateUserAccountDataParams {
    UserConfigurationMap userConfig;
    uint256 reservesCount;
    address user;
    address oracle;
    uint8 userEModeCategory;
  }

  struct ValidateBorrowParams {
    ReserveCache reserveCache;
    UserConfigurationMap userConfig;
    address asset;
    address userAddress;
    uint256 amount;
    InterestRateMode interestRateMode;
    uint256 maxStableLoanPercent;
    uint256 reservesCount;
    address oracle;
    uint8 userEModeCategory;
    address priceOracleSentinel;
    bool isolationModeActive;
    address isolationModeCollateralAddress;
    uint256 isolationModeDebtCeiling;
  }

  struct ValidateLiquidationCallParams {
    ReserveCache debtReserveCache;
    uint256 totalDebt;
    uint256 healthFactor;
    address priceOracleSentinel;
  }

  struct CalculateInterestRatesParams {
    uint256 unbacked;
    uint256 liquidityAdded;
    uint256 liquidityTaken;
    uint256 totalStableDebt;
    uint256 totalVariableDebt;
    uint256 averageStableBorrowRate;
    uint256 reserveFactor;
    address reserve;
    address aToken;
  }

  struct InitReserveParams {
    address asset;
    address aTokenAddress;
    address stableDebtAddress;
    address variableDebtAddress;
    address interestRateStrategyAddress;
    uint16 reservesCount;
    uint16 maxNumberReserves;
  }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)

pragma solidity ^0.8.20;

/**
 * @dev Provides information about the current execution context, including the
 * sender of the transaction and its data. While these are generally available
 * via msg.sender and msg.data, they should not be accessed in such a direct
 * manner, since when dealing with meta-transactions the account sending and
 * paying for execution may not be the actual sender (as far as an application
 * is concerned).
 *
 * This contract is only required for intermediate, library-like contracts.
 */
abstract contract Context {
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes calldata) {
        return msg.data;
    }

    function _contextSuffixLength() internal view virtual returns (uint256) {
        return 0;
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

/**
 * @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 amount of tokens in existence.
   */
  function totalSupply() external view returns (uint256);

  /**
   * @dev Returns the amount of tokens owned by `account`.
   */
  function balanceOf(address account) external view returns (uint256);

  /**
   * @dev Moves `amount` 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 amount) 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 `amount` 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 amount) external returns (bool);

  /**
   * @dev Moves `amount` tokens from `from` to `to` using the
   * allowance mechanism. `amount` 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 amount) external returns (bool);
}

Settings
{
  "remappings": [
    "@chainlink/contracts/=lib/chainlink/contracts/",
    "@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/",
    "@aave/core-v3/contracts/=lib/aave-v3-core/contracts/",
    "@chainlink-local/=lib/chainlink-local/",
    "@chainlink/contracts-ccip/=lib/chainlink-local/lib/ccip/contracts/",
    "@chainlink/local/src/=lib/chainlink-local/src/",
    "aave-v3-core/=lib/aave-v3-core/",
    "ccip/=lib/chainlink-local/lib/ccip/",
    "chainlink-brownie-contracts/=lib/chainlink-local/lib/chainlink-brownie-contracts/contracts/src/v0.6/vendor/@arbitrum/nitro-contracts/src/",
    "chainlink-local/=lib/chainlink-local/src/",
    "chainlink/=lib/chainlink/",
    "comet/=lib/comet/contracts/",
    "ds-test/=lib/chainlink-local/lib/forge-std/lib/ds-test/src/",
    "erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/",
    "forge-std/=lib/forge-std/src/",
    "halmos-cheatcodes/=lib/openzeppelin-contracts/lib/halmos-cheatcodes/src/",
    "openzeppelin-contracts/=lib/openzeppelin-contracts/"
  ],
  "optimizer": {
    "enabled": true,
    "runs": 1000000
  },
  "metadata": {
    "useLiteralContent": false,
    "bytecodeHash": "ipfs",
    "appendCBOR": true
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "evmVersion": "cancun",
  "viaIR": false,
  "libraries": {}
}

Contract ABI

API
[{"inputs":[{"internalType":"address","name":"ccipRouter","type":"address"},{"internalType":"address","name":"link","type":"address"},{"internalType":"uint64","name":"thisChainSelector","type":"uint64"},{"internalType":"address","name":"usdc","type":"address"},{"internalType":"address","name":"aavePoolAddressesProvider","type":"address"},{"internalType":"address","name":"comet","type":"address"},{"internalType":"address","name":"share","type":"address"},{"internalType":"uint64","name":"parentChainSelector","type":"uint64"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"invalidToken","type":"address"}],"name":"CCIPOperations__InvalidToken","type":"error"},{"inputs":[{"internalType":"uint256","name":"invalidAmount","type":"uint256"}],"name":"CCIPOperations__InvalidTokenAmount","type":"error"},{"inputs":[{"internalType":"uint256","name":"linkBalance","type":"uint256"},{"internalType":"uint256","name":"fees","type":"uint256"}],"name":"CCIPOperations__NotEnoughLink","type":"error"},{"inputs":[{"internalType":"address","name":"router","type":"address"}],"name":"InvalidRouter","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"OwnableInvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"OwnableUnauthorizedAccount","type":"error"},{"inputs":[{"internalType":"address","name":"strategyPool","type":"address"}],"name":"ProtocolOperations__InvalidStrategyPool","type":"error"},{"inputs":[{"internalType":"uint64","name":"chainSelector","type":"uint64"}],"name":"YieldPeer__ChainNotAllowed","type":"error"},{"inputs":[],"name":"YieldPeer__NoZeroAmount","type":"error"},{"inputs":[],"name":"YieldPeer__NotStrategyChain","type":"error"},{"inputs":[],"name":"YieldPeer__OnlyShare","type":"error"},{"inputs":[{"internalType":"address","name":"peer","type":"address"}],"name":"YieldPeer__PeerNotAllowed","type":"error"},{"inputs":[],"name":"YieldPeer__USDCTransferFailed","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint64","name":"chainSelector","type":"uint64"},{"indexed":true,"internalType":"bool","name":"isAllowed","type":"bool"}],"name":"AllowedChainSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint64","name":"chainSelector","type":"uint64"},{"indexed":true,"internalType":"address","name":"peer","type":"address"}],"name":"AllowedPeerSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"gasLimit","type":"uint256"}],"name":"CCIPGasLimitSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"messageId","type":"bytes32"},{"indexed":true,"internalType":"enum IYieldPeer.CcipTxType","name":"txType","type":"uint8"},{"indexed":true,"internalType":"uint64","name":"sourceChainSelector","type":"uint64"}],"name":"CCIPMessageReceived","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"messageId","type":"bytes32"},{"indexed":true,"internalType":"enum IYieldPeer.CcipTxType","name":"txType","type":"uint8"},{"indexed":true,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"CCIPMessageSent","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"strategyPool","type":"address"},{"indexed":true,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"totalValue","type":"uint256"}],"name":"DepositCompleted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"depositor","type":"address"},{"indexed":true,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":true,"internalType":"uint64","name":"thisChainSelector","type":"uint64"}],"name":"DepositInitiated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"strategyPool","type":"address"},{"indexed":true,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"DepositToStrategy","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"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"SharesBurned","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"SharesMinted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"strategyPool","type":"address"}],"name":"StrategyPoolUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"withdrawer","type":"address"},{"indexed":true,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"WithdrawCompleted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"strategyPool","type":"address"},{"indexed":true,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"WithdrawFromStrategy","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"withdrawer","type":"address"},{"indexed":true,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":true,"internalType":"uint64","name":"thisChainSelector","type":"uint64"}],"name":"WithdrawInitiated","type":"event"},{"inputs":[],"name":"acceptOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"bytes32","name":"messageId","type":"bytes32"},{"internalType":"uint64","name":"sourceChainSelector","type":"uint64"},{"internalType":"bytes","name":"sender","type":"bytes"},{"internalType":"bytes","name":"data","type":"bytes"},{"components":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct Client.EVMTokenAmount[]","name":"destTokenAmounts","type":"tuple[]"}],"internalType":"struct Client.Any2EVMMessage","name":"message","type":"tuple"}],"name":"ccipReceive","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amountToDeposit","type":"uint256"}],"name":"deposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getAave","outputs":[{"internalType":"address","name":"aave","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint64","name":"chainSelector","type":"uint64"}],"name":"getAllowedChain","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint64","name":"chainSelector","type":"uint64"}],"name":"getAllowedPeer","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getCCIPGasLimit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getCompound","outputs":[{"internalType":"address","name":"compound","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getIsStrategyChain","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getLink","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getParentChainSelector","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getRouter","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getShare","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getStrategyPool","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getThisChainSelector","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTotalValue","outputs":[{"internalType":"uint256","name":"totalValue","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getUsdc","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"withdrawer","type":"address"},{"internalType":"uint256","name":"shareBurnAmount","type":"uint256"},{"internalType":"bytes","name":"encodedWithdrawChainSelector","type":"bytes"}],"name":"onTokenTransfer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint64","name":"chainSelector","type":"uint64"},{"internalType":"bool","name":"isAllowed","type":"bool"}],"name":"setAllowedChain","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint64","name":"chainSelector","type":"uint64"},{"internalType":"address","name":"peer","type":"address"}],"name":"setAllowedPeer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"gasLimit","type":"uint256"}],"name":"setCCIPGasLimit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]

610180604052348015610010575f80fd5b5060405161404e38038061404e83398101604081905261002f91610187565b8787878787878733876001600160a01b038116610066576040516335fdcccd60e21b81525f60048201526024015b60405180910390fd5b6001600160a01b03908116608052811661009557604051631e4fbdf760e01b81525f600482015260240161005d565b61009e816100eb565b506001600160a01b0395861660a0526001600160401b0394851660c05292851660e05290841661010052831661012052909116610140529190911661016052506102199650505050505050565b600180546001600160a01b031916905561010481610107565b50565b5f80546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b80516001600160a01b038116811461016c575f80fd5b919050565b80516001600160401b038116811461016c575f80fd5b5f805f805f805f80610100898b03121561019f575f80fd5b6101a889610156565b97506101b660208a01610156565b96506101c460408a01610171565b95506101d260608a01610156565b94506101e060808a01610156565b93506101ee60a08a01610156565b92506101fc60c08a01610156565b915061020a60e08a01610171565b90509295985092959890939650565b60805160a05160c05160e05161010051610120516101405161016051613cc96103855f395f81816102400152818161081601528181610947015261098301525f818161030801528181610cd701528181610dd80152612a9001525f818161021a0152818161130a0152818161142801528181612cab0152612f6c01525f81816104ac015281816112e0015281816113fe01528181612c810152612f4201525f81816101d301528181610f50015281816112a5015281816113c301528181611bf501528181611e1701528181611f70015281816120e7015281816121a90152818161228801528181612b6601528181612c460152612f0701525f81816102da0152818161085f01528181610ec5015281816111a00152818161124101528181611e9b015281816120620152612d2601525f818161045501528181610fda015261102601525f81816103ac015281816106fb01528181610f7201528181611005015261108b0152613cc95ff3fe608060405234801561000f575f80fd5b50600436106101a5575f3560e01c8063944eadff116100e8578063ca0880cf11610093578063e2d84e231161006e578063e2d84e2314610453578063e30c397814610479578063f2fde38b14610497578063f7c1ec77146104aa575f80fd5b8063ca0880cf14610422578063caa648b414610435578063d83ce9491461044b575f80fd5b8063b0f479a1116100c3578063b0f479a1146103aa578063b1179538146103d0578063b6b55f251461040f575f80fd5b8063944eadff14610364578063a4c0ed3614610377578063aa5ff2601461038a575f80fd5b80634e03491611610153578063752987341161012e578063752987341461030657806379ba50971461032c57806385572ffb146103345780638da5cb5b14610347575f80fd5b80634e034916146102c357806364c90182146102d8578063715018a6146102fe575f80fd5b806320ee52111161018357806320ee52111461023e5780632ddd4793146102795780633f038fc314610297575f80fd5b806301ffc9a7146101a957806312f3fe76146101d15780631cc7e15714610218575b5f80fd5b6101bc6101b736600461314d565b6104d0565b60405190151581526020015b60405180910390f35b7f00000000000000000000000000000000000000000000000000000000000000005b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016101c8565b7f00000000000000000000000000000000000000000000000000000000000000006101f3565b7f00000000000000000000000000000000000000000000000000000000000000005b60405167ffffffffffffffff90911681526020016101c8565b60055473ffffffffffffffffffffffffffffffffffffffff166101f3565b6101bc6102a53660046131b1565b67ffffffffffffffff165f9081526003602052604090205460ff1690565b6102d66102d13660046131ed565b610568565b005b7f0000000000000000000000000000000000000000000000000000000000000000610260565b6102d6610659565b7f00000000000000000000000000000000000000000000000000000000000000006101f3565b6102d661066c565b6102d6610342366004613224565b6106e3565b5f5473ffffffffffffffffffffffffffffffffffffffff166101f3565b6102d6610372366004613268565b610765565b6102d6610385366004613294565b6107df565b60055473ffffffffffffffffffffffffffffffffffffffff1615156101bc565b7f00000000000000000000000000000000000000000000000000000000000000006101f3565b6101f36103de3660046131b1565b67ffffffffffffffff165f9081526004602052604090205473ffffffffffffffffffffffffffffffffffffffff1690565b6102d661041d366004613319565b6108d3565b6102d6610430366004613319565b6109c9565b61043d610a03565b6040519081526020016101c8565b60025461043d565b7f00000000000000000000000000000000000000000000000000000000000000006101f3565b60015473ffffffffffffffffffffffffffffffffffffffff166101f3565b6102d66104a5366004613330565b610a11565b7f00000000000000000000000000000000000000000000000000000000000000006101f3565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167f85572ffb00000000000000000000000000000000000000000000000000000000148061056257507fffffffff0000000000000000000000000000000000000000000000000000000082167f01ffc9a700000000000000000000000000000000000000000000000000000000145b92915050565b610570610ac0565b67ffffffffffffffff82165f9081526003602052604090205460ff166105d3576040517fc1b9269800000000000000000000000000000000000000000000000000000000815267ffffffffffffffff831660048201526024015b60405180910390fd5b67ffffffffffffffff82165f8181526004602052604080822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff861690811790915590519092917f14e51845b92c487641d948a073f73a08c932e03f3db5f1e1d0b4fd802dbe9d4f91a35050565b610661610ac0565b61066a5f610b12565b565b600154339073ffffffffffffffffffffffffffffffffffffffff1681146106d7576040517f118cdaa700000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff821660048201526024016105ca565b6106e081610b12565b50565b3373ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001614610754576040517fd7f733340000000000000000000000000000000000000000000000000000000081523360048201526024016105ca565b6106e06107608261357c565b610b43565b61076d610ac0565b67ffffffffffffffff82165f8181526003602052604080822080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001685151590811790915590519092917f42495b3125ef4e9597e7a2b5e95801bd4f99bd0303d24b38cbf449046b89281c91a35050565b6107e7610cbf565b6107f083610d2e565b6107fa8484610d67565b5f61080f858561080a8686610e49565b610eea565b905061085d7f00000000000000000000000000000000000000000000000000000000000000006004836040516020016108489190613630565b6040516020818303038152906040525f610f4a565b7f000000000000000000000000000000000000000000000000000000000000000067ffffffffffffffff16848673ffffffffffffffffffffffffffffffffffffffff167f071730c3ee1a890531b67cec0adad1806a898c172618e7da6b2f77205b17ab0f60405160405180910390a45050505050565b6108dc8161114a565b5f6108fc60055473ffffffffffffffffffffffffffffffffffffffff1690565b90505f610908836111ed565b905073ffffffffffffffffffffffffffffffffffffffff82161561097e576109308284611265565b61093982611382565b8160400181815250506109797f00000000000000000000000000000000000000000000000000000000000000006002836040516020016108489190613630565b505050565b6109797f00000000000000000000000000000000000000000000000000000000000000005f836040516020016109b49190613630565b60405160208183030381529060405286610f4a565b6109d1610ac0565b600281905560405181907f3b4d93bc2f3cc141ff9b9f3e05fad12abe4166256b2c3ee960e3a5f3f79480e8905f90a250565b5f610a0c611459565b905090565b610a19610ac0565b6001805473ffffffffffffffffffffffffffffffffffffffff83167fffffffffffffffffffffffff00000000000000000000000000000000000000009091168117909155610a7b5f5473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a350565b5f5473ffffffffffffffffffffffffffffffffffffffff16331461066a576040517f118cdaa70000000000000000000000000000000000000000000000000000000081523360048201526024016105ca565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001690556106e0816114d9565b80602001518160400151806020019051810190610b609190613689565b67ffffffffffffffff82165f9081526003602052604090205460ff16610bbe576040517fc1b9269800000000000000000000000000000000000000000000000000000000815267ffffffffffffffff831660048201526024016105ca565b67ffffffffffffffff82165f9081526004602052604090205473ffffffffffffffffffffffffffffffffffffffff828116911614610c40576040517f922dd1a000000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff821660048201526024016105ca565b5f808460600151806020019051810190610c5a91906136a4565b91509150846020015167ffffffffffffffff16826008811115610c7f57610c7f613730565b86516040517fcde62365c77ee9372df921a4ee8f4bff64fc3b4cc39417c70fc4a6d358c12f6e905f90a4610cb88286608001518361154d565b5050505050565b3373ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000161461066a576040517fdbad9d1300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b805f036106e0576040517ff38741e600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b604051819073ffffffffffffffffffffffffffffffffffffffff8416907fdb79cc492679ef2624944d6ed3cdbad5b974b5550de330ae18922f2944eec78a905f90a36040517f42966c68000000000000000000000000000000000000000000000000000000008152600481018290527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16906342966c68906024015b5f604051808303815f87803b158015610e2f575f80fd5b505af1158015610e41573d5f803e3d5ffd5b505050505050565b5f8115610ec257610e5c828401846131b1565b67ffffffffffffffff81165f9081526003602052604090205490915060ff16610ebd576040517fc1b9269800000000000000000000000000000000000000000000000000000000815267ffffffffffffffff821660048201526024016105ca565b610562565b507f000000000000000000000000000000000000000000000000000000000000000092915050565b610f376040518060a001604052805f73ffffffffffffffffffffffffffffffffffffffff1681526020015f81526020015f81526020015f81526020015f67ffffffffffffffff1681525090565b610f4284848461161b565b949350505050565b5f610f967f0000000000000000000000000000000000000000000000000000000000000000837f00000000000000000000000000000000000000000000000000000000000000006116b9565b67ffffffffffffffff86165f908152600460205260408120546002549293509091610ffe9173ffffffffffffffffffffffffffffffffffffffff16908790879086907f0000000000000000000000000000000000000000000000000000000000000000611826565b905061104c7f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000008884611996565b6040517f96f4e9f90000000000000000000000000000000000000000000000000000000081525f9073ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016906396f4e9f9906110c2908a9086906004016137a9565b6020604051808303815f875af11580156110de573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061110291906138fe565b90508386600881111561111757611117613730565b60405183907ff58bb6f6ec82990ff728621d18279c43cae3bc9777d052ed0d2316669e58cee6905f90a450505050505050565b620f4240811015611187576040517ff38741e600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611192333083611ba1565b60405167ffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001690829033907faa9f6c1bc844ba1793f5ed5d61d1dd6688efd3d0759386f21c10d07b2f8bdd27905f90a450565b61123a6040518060a001604052805f73ffffffffffffffffffffffffffffffffffffffff1681526020015f81526020015f81526020015f81526020015f67ffffffffffffffff1681525090565b61056233837f000000000000000000000000000000000000000000000000000000000000000061161b565b61133c8261133660408051606080820183525f808352602080840182905292840181905283518083018552818152808401829052840152825190810183527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff90811682527f00000000000000000000000000000000000000000000000000000000000000008116928201929092527f00000000000000000000000000000000000000000000000000000000000000009091169181019190915290565b83611c95565b604051819073ffffffffffffffffffffffffffffffffffffffff8416907f8125d05f0839eec6c1f6b1674833e01f11ab362bd9c60eb2e3b274fa3b47e4f4905f90a35050565b5f6105628261145460408051606080820183525f808352602080840182905292840181905283518083018552818152808401829052840152825190810183527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff90811682527f00000000000000000000000000000000000000000000000000000000000000008116928201929092527f00000000000000000000000000000000000000000000000000000000000000009091169181019190915290565b611d71565b5f8061147a60055473ffffffffffffffffffffffffffffffffffffffff1690565b905073ffffffffffffffffffffffffffffffffffffffff8116156114a7576114a181611382565b91505090565b6040517fa8436b2b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600183600881111561156157611561613730565b03611570576115708282611e05565b600383600881111561158457611584613730565b036115925761159281611e4d565b60058360088111156115a6576115a6613730565b036115b4576115b481611e6e565b60068360088111156115c8576115c8613730565b036115d7576115d78282611f53565b60078360088111156115eb576115eb613730565b036115f9576115f981611ff7565b600883600881111561160d5761160d613730565b036109795761097981612217565b6116686040518060a001604052805f73ffffffffffffffffffffffffffffffffffffffff1681526020015f81526020015f81526020015f81526020015f67ffffffffffffffff1681525090565b6040518060a001604052808573ffffffffffffffffffffffffffffffffffffffff1681526020018481526020015f81526020015f81526020018367ffffffffffffffff1681525090505b9392505050565b606082156117e25760408051600180825281830190925290816020015b604080518082019091525f80825260208201528152602001906001900390816116d657905050905060405180604001604052808573ffffffffffffffffffffffffffffffffffffffff16815260200184815250815f8151811061173b5761173b613915565b60209081029190910101526040517f095ea7b300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff83811660048301526024820185905285169063095ea7b3906044016020604051808303815f875af11580156117b8573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906117dc9190613942565b506116b2565b604080515f808252602082019092529061181d565b604080518082019091525f80825260208201528152602001906001900390816117f75790505b50949350505050565b61186d6040518060a001604052806060815260200160608152602001606081526020015f73ffffffffffffffffffffffffffffffffffffffff168152602001606081525090565b6040805160a0810190915273ffffffffffffffffffffffffffffffffffffffff881660c08201528060e08101604051602081830303815290604052815260200187876040516020016118c092919061395d565b60405160208183030381529060405281526020018581526020018373ffffffffffffffffffffffffffffffffffffffff1681526020016119896040518060400160405280878152602001600115158152506040805182516024820152602092830151151560448083019190915282518083039091018152606490910190915290810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f181dcf100000000000000000000000000000000000000000000000000000000017905290565b9052979650505050505050565b6040517f20487ded0000000000000000000000000000000000000000000000000000000081525f9073ffffffffffffffffffffffffffffffffffffffff8616906320487ded906119ec90869086906004016137a9565b602060405180830381865afa158015611a07573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611a2b91906138fe565b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529091505f9073ffffffffffffffffffffffffffffffffffffffff8616906370a0823190602401602060405180830381865afa158015611a98573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611abc91906138fe565b905080821115611b02576040517f2cf148f700000000000000000000000000000000000000000000000000000000815260048101829052602481018390526044016105ca565b6040517f095ea7b300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff87811660048301526024820184905286169063095ea7b3906044016020604051808303815f875af1158015611b74573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611b989190613942565b50505050505050565b6040517f23b872dd00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff84811660048301528381166024830152604482018390527f000000000000000000000000000000000000000000000000000000000000000016906323b872dd906064016020604051808303815f875af1158015611c3b573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611c5f9190613942565b610979576040517f49fbb83000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b816020015173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603611cde57610979825f0151836020015183612309565b816040015173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603611d2757610979825f01518360400151836124a7565b6040517ffd179e7900000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff841660048201526024016105ca565b5f816020015173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603611dc157611dba825f015183602001516125be565b9050610562565b816040015173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603611d2757611dba8260400151612761565b5f611e0f826127ef565b9050611e40837f00000000000000000000000000000000000000000000000000000000000000008360200151612850565b610939816020015161297f565b5f611e57826127ef565b9050611e6a815f01518260600151612a02565b5050565b5f611e78826127ef565b9050611e8381612abf565b6060820152608081015167ffffffffffffffff9081167f000000000000000000000000000000000000000000000000000000000000000090911603611f1f57611ed3815f01518260600151612b1a565b6060810151815160405173ffffffffffffffffffffffffffffffffffffffff909116907f60188009b974c2fa66ee3b916d93f64d6534ea2204e0c466f9784ace689e8e49905f90a35050565b611e6a8160800151600683604051602001611f3a9190613630565b6040516020818303038152906040528460600151610f4a565b5f611f5d826127ef565b905080606001515f14611faa57611f99837f00000000000000000000000000000000000000000000000000000000000000008360600151612850565b611faa815f01518260600151612b1a565b6060810151815160405173ffffffffffffffffffffffffffffffffffffffff909116907f60188009b974c2fa66ee3b916d93f64d6534ea2204e0c466f9784ace689e8e49905f90a3505050565b5f61201760055473ffffffffffffffffffffffffffffffffffffffff1690565b90505f61202382611382565b90508015612035576120358282612c06565b5f8380602001905181019061204a91906139aa565b90505f61205e825f01518360200151612d23565b90507f000000000000000000000000000000000000000000000000000000000000000067ffffffffffffffff16825f015167ffffffffffffffff160361215a576040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015261215590829073ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016906370a0823190602401602060405180830381865afa15801561212c573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061215091906138fe565b611265565b610cb8565b81516040517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152610cb89190600890889073ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016906370a0823190602401602060405180830381865afa1580156121ee573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061221291906138fe565b610f4a565b5f8180602001905181019061222c91906139aa565b90505f612240825f01518360200151612d23565b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529091505f9073ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016906370a0823190602401602060405180830381865afa1580156122cd573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906122f191906138fe565b90508015612303576123038282611265565b50505050565b5f8273ffffffffffffffffffffffffffffffffffffffff1663026b1d5f6040518163ffffffff1660e01b8152600401602060405180830381865afa158015612353573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906123779190613689565b6040517f095ea7b300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8083166004830152602482018590529192509085169063095ea7b3906044016020604051808303815f875af11580156123ed573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906124119190613942565b506040517f617ba03700000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8581166004830152602482018490523060448301525f606483015282169063617ba037906084015f604051808303815f87803b15801561248b575f80fd5b505af115801561249d573d5f803e3d5ffd5b5050505050505050565b6040517f095ea7b300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff83811660048301526024820183905284169063095ea7b3906044016020604051808303815f875af1158015612519573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061253d9190613942565b506040517ff2b9fdb800000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff84811660048301526024820183905283169063f2b9fdb8906044015b5f604051808303815f87803b1580156125ac575f80fd5b505af1158015611b98573d5f803e3d5ffd5b5f808273ffffffffffffffffffffffffffffffffffffffff1663026b1d5f6040518163ffffffff1660e01b8152600401602060405180830381865afa158015612609573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061262d9190613689565b6040517f35ea6a7500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff86811660048301529192505f918316906335ea6a75906024016101e060405180830381865afa15801561269d573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906126c19190613a7d565b6101008101516040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529192509073ffffffffffffffffffffffffffffffffffffffff8216906370a0823190602401602060405180830381865afa158015612733573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061275791906138fe565b9695505050505050565b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201525f9073ffffffffffffffffffffffffffffffffffffffff8316906370a0823190602401602060405180830381865afa1580156127cb573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061056291906138fe565b61283c6040518060a001604052805f73ffffffffffffffffffffffffffffffffffffffff1681526020015f81526020015f81526020015f81526020015f67ffffffffffffffff1681525090565b818060200190518101906105629190613c05565b8173ffffffffffffffffffffffffffffffffffffffff16835f8151811061287957612879613915565b60200260200101515f015173ffffffffffffffffffffffffffffffffffffffff161461290857825f815181106128b1576128b1613915565b6020908102919091010151516040517f411efc9d00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff90911660048201526024016105ca565b80835f8151811061291b5761291b613915565b6020026020010151602001511461097957825f8151811061293e5761293e613915565b6020026020010151602001516040517f104959a70000000000000000000000000000000000000000000000000000000081526004016105ca91815260200190565b5f806129a060055473ffffffffffffffffffffffffffffffffffffffff1690565b90506129ac8184611265565b6129b581611382565b915081838273ffffffffffffffffffffffffffffffffffffffff167f269bfb696b3465d8cfcab2af92c6e49cbbe72d60c28788178f8e88c5172d492460405160405180910390a450919050565b604051819073ffffffffffffffffffffffffffffffffffffffff8416907f6332ddaa8a69b5eb2524ec7ca317b7c2b01ecf678d584031415f81270977b8fc905f90a36040517f40c10f1900000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8381166004830152602482018390527f000000000000000000000000000000000000000000000000000000000000000016906340c10f1990604401610e18565b5f80612ae060055473ffffffffffffffffffffffffffffffffffffffff1690565b90505f612aec82611382565b9050612b018185604001518660200151612e1e565b92508215612b1357612b138284612c06565b5050919050565b6040517fa9059cbb00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8381166004830152602482018390527f0000000000000000000000000000000000000000000000000000000000000000169063a9059cbb906044016020604051808303815f875af1158015612bac573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190612bd09190613942565b611e6a576040517f49fbb83000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b612cdd82612cd760408051606080820183525f808352602080840182905292840181905283518083018552818152808401829052840152825190810183527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff90811682527f00000000000000000000000000000000000000000000000000000000000000008116928201929092527f00000000000000000000000000000000000000000000000000000000000000009091169181019190915290565b83612e34565b604051819073ffffffffffffffffffffffffffffffffffffffff8416907fb28e99afed98b3607aeea074f84c346dc4135d86f35b1c28bc35ab6782e7ce30905f90a35050565b5f7f000000000000000000000000000000000000000000000000000000000000000067ffffffffffffffff168367ffffffffffffffff1603612daf57612d6882612ec6565b600580547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83161790559050612dd8565b600580547fffffffffffffffffffffffff00000000000000000000000000000000000000001690555b60405173ffffffffffffffffffffffffffffffffffffffff8216907fe93cbfefd912dc9a1b30a0c2333d11e2bffb32d29ae125c33bbdba59af9e387c905f90a292915050565b5f82612e2a8584613c1f565b610f429190613c5b565b816020015173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603612e7d57610979825f0151836020015183612f9d565b816040015173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603611d2757610979825f01518360400151836130ab565b5f61056282612f9860408051606080820183525f808352602080840182905292840181905283518083018552818152808401829052840152825190810183527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff90811682527f00000000000000000000000000000000000000000000000000000000000000008116928201929092527f00000000000000000000000000000000000000000000000000000000000000009091169181019190915290565b613106565b5f8273ffffffffffffffffffffffffffffffffffffffff1663026b1d5f6040518163ffffffff1660e01b8152600401602060405180830381865afa158015612fe7573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061300b9190613689565b6040517f69328dec00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff868116600483015260248201859052306044830152919250908216906369328dec906064016020604051808303815f875af1158015613087573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610cb891906138fe565b6040517ff3fef3a300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff84811660048301526024820183905283169063f3fef3a390604401612595565b5f8083600181111561311a5761311a613730565b0361312a57506020810151610562565b600183600181111561313e5761313e613730565b03610562575060400151919050565b5f6020828403121561315d575f80fd5b81357fffffffff00000000000000000000000000000000000000000000000000000000811681146116b2575f80fd5b67ffffffffffffffff811681146106e0575f80fd5b80356131ac8161318c565b919050565b5f602082840312156131c1575f80fd5b81356116b28161318c565b73ffffffffffffffffffffffffffffffffffffffff811681146106e0575f80fd5b5f80604083850312156131fe575f80fd5b82356132098161318c565b91506020830135613219816131cc565b809150509250929050565b5f60208284031215613234575f80fd5b813567ffffffffffffffff81111561324a575f80fd5b820160a081850312156116b2575f80fd5b80151581146106e0575f80fd5b5f8060408385031215613279575f80fd5b82356132848161318c565b915060208301356132198161325b565b5f805f80606085870312156132a7575f80fd5b84356132b2816131cc565b935060208501359250604085013567ffffffffffffffff8111156132d4575f80fd5b8501601f810187136132e4575f80fd5b803567ffffffffffffffff8111156132fa575f80fd5b87602082840101111561330b575f80fd5b949793965060200194505050565b5f60208284031215613329575f80fd5b5035919050565b5f60208284031215613340575f80fd5b81356116b2816131cc565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b6040805190810167ffffffffffffffff8111828210171561339b5761339b61334b565b60405290565b60405160a0810167ffffffffffffffff8111828210171561339b5761339b61334b565b6040516101e0810167ffffffffffffffff8111828210171561339b5761339b61334b565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff8111828210171561342f5761342f61334b565b604052919050565b5f67ffffffffffffffff8211156134505761345061334b565b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01660200190565b5f82601f83011261348b575f80fd5b813561349e61349982613437565b6133e8565b8181528460208386010111156134b2575f80fd5b816020850160208301375f918101602001919091529392505050565b5f82601f8301126134dd575f80fd5b813567ffffffffffffffff8111156134f7576134f761334b565b61350660208260051b016133e8565b8082825260208201915060208360061b860101925085831115613527575f80fd5b602085015b838110156135725760408188031215613543575f80fd5b61354b613378565b8135613556816131cc565b815260208281013581830152908452929092019160400161352c565b5095945050505050565b5f60a0823603121561358c575f80fd5b6135946133a1565b823581526135a4602084016131a1565b6020820152604083013567ffffffffffffffff8111156135c2575f80fd5b6135ce3682860161347c565b604083015250606083013567ffffffffffffffff8111156135ed575f80fd5b6135f93682860161347c565b606083015250608083013567ffffffffffffffff811115613618575f80fd5b613624368286016134ce565b60808301525092915050565b60a08101610562828473ffffffffffffffffffffffffffffffffffffffff815116825260208101516020830152604081015160408301526060810151606083015267ffffffffffffffff60808201511660808301525050565b5f60208284031215613699575f80fd5b81516116b2816131cc565b5f80604083850312156136b5575f80fd5b8251600981106136c3575f80fd5b602084015190925067ffffffffffffffff8111156136df575f80fd5b8301601f810185136136ef575f80fd5b80516136fd61349982613437565b818152866020838501011115613711575f80fd5b8160208401602083015e5f602083830101528093505050509250929050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602160045260245ffd5b5f81518084528060208401602086015e5f6020828601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010191505092915050565b67ffffffffffffffff83168152604060208201525f825160a060408401526137d460e084018261375d565b905060208401517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc084830301606085015261380f828261375d565b60408601518582037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc00160808701528051808352602091820194505f93509101905b8083101561389757835173ffffffffffffffffffffffffffffffffffffffff81511683526020810151602084015250604082019150602084019350600183019250613851565b50606086015173ffffffffffffffffffffffffffffffffffffffff1660a086015260808601518582037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc00160c087015292506138f3818461375d565b979650505050505050565b5f6020828403121561390e575f80fd5b5051919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b5f60208284031215613952575f80fd5b81516116b28161325b565b5f60098410613993577f4e487b71000000000000000000000000000000000000000000000000000000005f52602160045260245ffd5b83825260406020830152610f42604083018461375d565b5f60408284031280156139bb575f80fd5b506139c4613378565b82516139cf8161318c565b81526020830151600281106139e2575f80fd5b60208201529392505050565b80516131ac816131cc565b5f60208284031215613a09575f80fd5b6040516020810167ffffffffffffffff81118282101715613a2c57613a2c61334b565b6040529151825250919050565b80516fffffffffffffffffffffffffffffffff811681146131ac575f80fd5b805164ffffffffff811681146131ac575f80fd5b805161ffff811681146131ac575f80fd5b5f6101e0828403128015613a8f575f80fd5b50613a986133c4565b613aa284846139f9565b8152613ab060208401613a39565b6020820152613ac160408401613a39565b6040820152613ad260608401613a39565b6060820152613ae360808401613a39565b6080820152613af460a08401613a39565b60a0820152613b0560c08401613a58565b60c0820152613b1660e08401613a6c565b60e0820152613b2861010084016139ee565b610100820152613b3b61012084016139ee565b610120820152613b4e61014084016139ee565b610140820152613b6161016084016139ee565b610160820152613b746101808401613a39565b610180820152613b876101a08401613a39565b6101a0820152613b9a6101c08401613a39565b6101c08201529392505050565b5f60a08284031215613bb7575f80fd5b613bbf6133a1565b90508151613bcc816131cc565b81526020828101519082015260408083015190820152606080830151908201526080820151613bfa8161318c565b608082015292915050565b5f60a08284031215613c15575f80fd5b6116b28383613ba7565b8082028115828204841417610562577f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f82613c8e577f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b50049056fea2646970667358221220e7df5efc1e9bd94017aaa14fdae4f4422d1097f6d88aac29391a5e792989e8eb64736f6c634300081a0033000000000000000000000000d3b06cebf099ce7da4accf578aaebfdbd6e88a93000000000000000000000000e4ab69c077896252fafbd49efd26b5d171a324100000000000000000000000000000000000000000000000008f90b8876dee6538000000000000000000000000036cbd53842c5426634e7929541ec2318f3dcf7e0000000000000000000000009bf12e915461a48bc61ddca5f295a0e20bbba5d7000000000000000000000000571621ce60cebb0c1d442b5afb38b1663c6bf0170000000000000000000000002df8c615858b479cbc3bfef3bbfe34842d7aaa90000000000000000000000000000000000000000000000000de41ba4fc9d91ad9

Deployed Bytecode

0x608060405234801561000f575f80fd5b50600436106101a5575f3560e01c8063944eadff116100e8578063ca0880cf11610093578063e2d84e231161006e578063e2d84e2314610453578063e30c397814610479578063f2fde38b14610497578063f7c1ec77146104aa575f80fd5b8063ca0880cf14610422578063caa648b414610435578063d83ce9491461044b575f80fd5b8063b0f479a1116100c3578063b0f479a1146103aa578063b1179538146103d0578063b6b55f251461040f575f80fd5b8063944eadff14610364578063a4c0ed3614610377578063aa5ff2601461038a575f80fd5b80634e03491611610153578063752987341161012e578063752987341461030657806379ba50971461032c57806385572ffb146103345780638da5cb5b14610347575f80fd5b80634e034916146102c357806364c90182146102d8578063715018a6146102fe575f80fd5b806320ee52111161018357806320ee52111461023e5780632ddd4793146102795780633f038fc314610297575f80fd5b806301ffc9a7146101a957806312f3fe76146101d15780631cc7e15714610218575b5f80fd5b6101bc6101b736600461314d565b6104d0565b60405190151581526020015b60405180910390f35b7f000000000000000000000000036cbd53842c5426634e7929541ec2318f3dcf7e5b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016101c8565b7f000000000000000000000000571621ce60cebb0c1d442b5afb38b1663c6bf0176101f3565b7f000000000000000000000000000000000000000000000000de41ba4fc9d91ad95b60405167ffffffffffffffff90911681526020016101c8565b60055473ffffffffffffffffffffffffffffffffffffffff166101f3565b6101bc6102a53660046131b1565b67ffffffffffffffff165f9081526003602052604090205460ff1690565b6102d66102d13660046131ed565b610568565b005b7f0000000000000000000000000000000000000000000000008f90b8876dee6538610260565b6102d6610659565b7f0000000000000000000000002df8c615858b479cbc3bfef3bbfe34842d7aaa906101f3565b6102d661066c565b6102d6610342366004613224565b6106e3565b5f5473ffffffffffffffffffffffffffffffffffffffff166101f3565b6102d6610372366004613268565b610765565b6102d6610385366004613294565b6107df565b60055473ffffffffffffffffffffffffffffffffffffffff1615156101bc565b7f000000000000000000000000d3b06cebf099ce7da4accf578aaebfdbd6e88a936101f3565b6101f36103de3660046131b1565b67ffffffffffffffff165f9081526004602052604090205473ffffffffffffffffffffffffffffffffffffffff1690565b6102d661041d366004613319565b6108d3565b6102d6610430366004613319565b6109c9565b61043d610a03565b6040519081526020016101c8565b60025461043d565b7f000000000000000000000000e4ab69c077896252fafbd49efd26b5d171a324106101f3565b60015473ffffffffffffffffffffffffffffffffffffffff166101f3565b6102d66104a5366004613330565b610a11565b7f0000000000000000000000009bf12e915461a48bc61ddca5f295a0e20bbba5d76101f3565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167f85572ffb00000000000000000000000000000000000000000000000000000000148061056257507fffffffff0000000000000000000000000000000000000000000000000000000082167f01ffc9a700000000000000000000000000000000000000000000000000000000145b92915050565b610570610ac0565b67ffffffffffffffff82165f9081526003602052604090205460ff166105d3576040517fc1b9269800000000000000000000000000000000000000000000000000000000815267ffffffffffffffff831660048201526024015b60405180910390fd5b67ffffffffffffffff82165f8181526004602052604080822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff861690811790915590519092917f14e51845b92c487641d948a073f73a08c932e03f3db5f1e1d0b4fd802dbe9d4f91a35050565b610661610ac0565b61066a5f610b12565b565b600154339073ffffffffffffffffffffffffffffffffffffffff1681146106d7576040517f118cdaa700000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff821660048201526024016105ca565b6106e081610b12565b50565b3373ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000d3b06cebf099ce7da4accf578aaebfdbd6e88a931614610754576040517fd7f733340000000000000000000000000000000000000000000000000000000081523360048201526024016105ca565b6106e06107608261357c565b610b43565b61076d610ac0565b67ffffffffffffffff82165f8181526003602052604080822080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001685151590811790915590519092917f42495b3125ef4e9597e7a2b5e95801bd4f99bd0303d24b38cbf449046b89281c91a35050565b6107e7610cbf565b6107f083610d2e565b6107fa8484610d67565b5f61080f858561080a8686610e49565b610eea565b905061085d7f000000000000000000000000000000000000000000000000de41ba4fc9d91ad96004836040516020016108489190613630565b6040516020818303038152906040525f610f4a565b7f0000000000000000000000000000000000000000000000008f90b8876dee653867ffffffffffffffff16848673ffffffffffffffffffffffffffffffffffffffff167f071730c3ee1a890531b67cec0adad1806a898c172618e7da6b2f77205b17ab0f60405160405180910390a45050505050565b6108dc8161114a565b5f6108fc60055473ffffffffffffffffffffffffffffffffffffffff1690565b90505f610908836111ed565b905073ffffffffffffffffffffffffffffffffffffffff82161561097e576109308284611265565b61093982611382565b8160400181815250506109797f000000000000000000000000000000000000000000000000de41ba4fc9d91ad96002836040516020016108489190613630565b505050565b6109797f000000000000000000000000000000000000000000000000de41ba4fc9d91ad95f836040516020016109b49190613630565b60405160208183030381529060405286610f4a565b6109d1610ac0565b600281905560405181907f3b4d93bc2f3cc141ff9b9f3e05fad12abe4166256b2c3ee960e3a5f3f79480e8905f90a250565b5f610a0c611459565b905090565b610a19610ac0565b6001805473ffffffffffffffffffffffffffffffffffffffff83167fffffffffffffffffffffffff00000000000000000000000000000000000000009091168117909155610a7b5f5473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a350565b5f5473ffffffffffffffffffffffffffffffffffffffff16331461066a576040517f118cdaa70000000000000000000000000000000000000000000000000000000081523360048201526024016105ca565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001690556106e0816114d9565b80602001518160400151806020019051810190610b609190613689565b67ffffffffffffffff82165f9081526003602052604090205460ff16610bbe576040517fc1b9269800000000000000000000000000000000000000000000000000000000815267ffffffffffffffff831660048201526024016105ca565b67ffffffffffffffff82165f9081526004602052604090205473ffffffffffffffffffffffffffffffffffffffff828116911614610c40576040517f922dd1a000000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff821660048201526024016105ca565b5f808460600151806020019051810190610c5a91906136a4565b91509150846020015167ffffffffffffffff16826008811115610c7f57610c7f613730565b86516040517fcde62365c77ee9372df921a4ee8f4bff64fc3b4cc39417c70fc4a6d358c12f6e905f90a4610cb88286608001518361154d565b5050505050565b3373ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000002df8c615858b479cbc3bfef3bbfe34842d7aaa90161461066a576040517fdbad9d1300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b805f036106e0576040517ff38741e600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b604051819073ffffffffffffffffffffffffffffffffffffffff8416907fdb79cc492679ef2624944d6ed3cdbad5b974b5550de330ae18922f2944eec78a905f90a36040517f42966c68000000000000000000000000000000000000000000000000000000008152600481018290527f0000000000000000000000002df8c615858b479cbc3bfef3bbfe34842d7aaa9073ffffffffffffffffffffffffffffffffffffffff16906342966c68906024015b5f604051808303815f87803b158015610e2f575f80fd5b505af1158015610e41573d5f803e3d5ffd5b505050505050565b5f8115610ec257610e5c828401846131b1565b67ffffffffffffffff81165f9081526003602052604090205490915060ff16610ebd576040517fc1b9269800000000000000000000000000000000000000000000000000000000815267ffffffffffffffff821660048201526024016105ca565b610562565b507f0000000000000000000000000000000000000000000000008f90b8876dee653892915050565b610f376040518060a001604052805f73ffffffffffffffffffffffffffffffffffffffff1681526020015f81526020015f81526020015f81526020015f67ffffffffffffffff1681525090565b610f4284848461161b565b949350505050565b5f610f967f000000000000000000000000036cbd53842c5426634e7929541ec2318f3dcf7e837f000000000000000000000000d3b06cebf099ce7da4accf578aaebfdbd6e88a936116b9565b67ffffffffffffffff86165f908152600460205260408120546002549293509091610ffe9173ffffffffffffffffffffffffffffffffffffffff16908790879086907f000000000000000000000000e4ab69c077896252fafbd49efd26b5d171a32410611826565b905061104c7f000000000000000000000000d3b06cebf099ce7da4accf578aaebfdbd6e88a937f000000000000000000000000e4ab69c077896252fafbd49efd26b5d171a324108884611996565b6040517f96f4e9f90000000000000000000000000000000000000000000000000000000081525f9073ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000d3b06cebf099ce7da4accf578aaebfdbd6e88a9316906396f4e9f9906110c2908a9086906004016137a9565b6020604051808303815f875af11580156110de573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061110291906138fe565b90508386600881111561111757611117613730565b60405183907ff58bb6f6ec82990ff728621d18279c43cae3bc9777d052ed0d2316669e58cee6905f90a450505050505050565b620f4240811015611187576040517ff38741e600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611192333083611ba1565b60405167ffffffffffffffff7f0000000000000000000000000000000000000000000000008f90b8876dee65381690829033907faa9f6c1bc844ba1793f5ed5d61d1dd6688efd3d0759386f21c10d07b2f8bdd27905f90a450565b61123a6040518060a001604052805f73ffffffffffffffffffffffffffffffffffffffff1681526020015f81526020015f81526020015f81526020015f67ffffffffffffffff1681525090565b61056233837f0000000000000000000000000000000000000000000000008f90b8876dee653861161b565b61133c8261133660408051606080820183525f808352602080840182905292840181905283518083018552818152808401829052840152825190810183527f000000000000000000000000036cbd53842c5426634e7929541ec2318f3dcf7e73ffffffffffffffffffffffffffffffffffffffff90811682527f0000000000000000000000009bf12e915461a48bc61ddca5f295a0e20bbba5d78116928201929092527f000000000000000000000000571621ce60cebb0c1d442b5afb38b1663c6bf0179091169181019190915290565b83611c95565b604051819073ffffffffffffffffffffffffffffffffffffffff8416907f8125d05f0839eec6c1f6b1674833e01f11ab362bd9c60eb2e3b274fa3b47e4f4905f90a35050565b5f6105628261145460408051606080820183525f808352602080840182905292840181905283518083018552818152808401829052840152825190810183527f000000000000000000000000036cbd53842c5426634e7929541ec2318f3dcf7e73ffffffffffffffffffffffffffffffffffffffff90811682527f0000000000000000000000009bf12e915461a48bc61ddca5f295a0e20bbba5d78116928201929092527f000000000000000000000000571621ce60cebb0c1d442b5afb38b1663c6bf0179091169181019190915290565b611d71565b5f8061147a60055473ffffffffffffffffffffffffffffffffffffffff1690565b905073ffffffffffffffffffffffffffffffffffffffff8116156114a7576114a181611382565b91505090565b6040517fa8436b2b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600183600881111561156157611561613730565b03611570576115708282611e05565b600383600881111561158457611584613730565b036115925761159281611e4d565b60058360088111156115a6576115a6613730565b036115b4576115b481611e6e565b60068360088111156115c8576115c8613730565b036115d7576115d78282611f53565b60078360088111156115eb576115eb613730565b036115f9576115f981611ff7565b600883600881111561160d5761160d613730565b036109795761097981612217565b6116686040518060a001604052805f73ffffffffffffffffffffffffffffffffffffffff1681526020015f81526020015f81526020015f81526020015f67ffffffffffffffff1681525090565b6040518060a001604052808573ffffffffffffffffffffffffffffffffffffffff1681526020018481526020015f81526020015f81526020018367ffffffffffffffff1681525090505b9392505050565b606082156117e25760408051600180825281830190925290816020015b604080518082019091525f80825260208201528152602001906001900390816116d657905050905060405180604001604052808573ffffffffffffffffffffffffffffffffffffffff16815260200184815250815f8151811061173b5761173b613915565b60209081029190910101526040517f095ea7b300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff83811660048301526024820185905285169063095ea7b3906044016020604051808303815f875af11580156117b8573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906117dc9190613942565b506116b2565b604080515f808252602082019092529061181d565b604080518082019091525f80825260208201528152602001906001900390816117f75790505b50949350505050565b61186d6040518060a001604052806060815260200160608152602001606081526020015f73ffffffffffffffffffffffffffffffffffffffff168152602001606081525090565b6040805160a0810190915273ffffffffffffffffffffffffffffffffffffffff881660c08201528060e08101604051602081830303815290604052815260200187876040516020016118c092919061395d565b60405160208183030381529060405281526020018581526020018373ffffffffffffffffffffffffffffffffffffffff1681526020016119896040518060400160405280878152602001600115158152506040805182516024820152602092830151151560448083019190915282518083039091018152606490910190915290810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f181dcf100000000000000000000000000000000000000000000000000000000017905290565b9052979650505050505050565b6040517f20487ded0000000000000000000000000000000000000000000000000000000081525f9073ffffffffffffffffffffffffffffffffffffffff8616906320487ded906119ec90869086906004016137a9565b602060405180830381865afa158015611a07573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611a2b91906138fe565b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529091505f9073ffffffffffffffffffffffffffffffffffffffff8616906370a0823190602401602060405180830381865afa158015611a98573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611abc91906138fe565b905080821115611b02576040517f2cf148f700000000000000000000000000000000000000000000000000000000815260048101829052602481018390526044016105ca565b6040517f095ea7b300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff87811660048301526024820184905286169063095ea7b3906044016020604051808303815f875af1158015611b74573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611b989190613942565b50505050505050565b6040517f23b872dd00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff84811660048301528381166024830152604482018390527f000000000000000000000000036cbd53842c5426634e7929541ec2318f3dcf7e16906323b872dd906064016020604051808303815f875af1158015611c3b573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611c5f9190613942565b610979576040517f49fbb83000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b816020015173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603611cde57610979825f0151836020015183612309565b816040015173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603611d2757610979825f01518360400151836124a7565b6040517ffd179e7900000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff841660048201526024016105ca565b5f816020015173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603611dc157611dba825f015183602001516125be565b9050610562565b816040015173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603611d2757611dba8260400151612761565b5f611e0f826127ef565b9050611e40837f000000000000000000000000036cbd53842c5426634e7929541ec2318f3dcf7e8360200151612850565b610939816020015161297f565b5f611e57826127ef565b9050611e6a815f01518260600151612a02565b5050565b5f611e78826127ef565b9050611e8381612abf565b6060820152608081015167ffffffffffffffff9081167f0000000000000000000000000000000000000000000000008f90b8876dee653890911603611f1f57611ed3815f01518260600151612b1a565b6060810151815160405173ffffffffffffffffffffffffffffffffffffffff909116907f60188009b974c2fa66ee3b916d93f64d6534ea2204e0c466f9784ace689e8e49905f90a35050565b611e6a8160800151600683604051602001611f3a9190613630565b6040516020818303038152906040528460600151610f4a565b5f611f5d826127ef565b905080606001515f14611faa57611f99837f000000000000000000000000036cbd53842c5426634e7929541ec2318f3dcf7e8360600151612850565b611faa815f01518260600151612b1a565b6060810151815160405173ffffffffffffffffffffffffffffffffffffffff909116907f60188009b974c2fa66ee3b916d93f64d6534ea2204e0c466f9784ace689e8e49905f90a3505050565b5f61201760055473ffffffffffffffffffffffffffffffffffffffff1690565b90505f61202382611382565b90508015612035576120358282612c06565b5f8380602001905181019061204a91906139aa565b90505f61205e825f01518360200151612d23565b90507f0000000000000000000000000000000000000000000000008f90b8876dee653867ffffffffffffffff16825f015167ffffffffffffffff160361215a576040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015261215590829073ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000036cbd53842c5426634e7929541ec2318f3dcf7e16906370a0823190602401602060405180830381865afa15801561212c573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061215091906138fe565b611265565b610cb8565b81516040517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152610cb89190600890889073ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000036cbd53842c5426634e7929541ec2318f3dcf7e16906370a0823190602401602060405180830381865afa1580156121ee573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061221291906138fe565b610f4a565b5f8180602001905181019061222c91906139aa565b90505f612240825f01518360200151612d23565b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529091505f9073ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000036cbd53842c5426634e7929541ec2318f3dcf7e16906370a0823190602401602060405180830381865afa1580156122cd573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906122f191906138fe565b90508015612303576123038282611265565b50505050565b5f8273ffffffffffffffffffffffffffffffffffffffff1663026b1d5f6040518163ffffffff1660e01b8152600401602060405180830381865afa158015612353573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906123779190613689565b6040517f095ea7b300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8083166004830152602482018590529192509085169063095ea7b3906044016020604051808303815f875af11580156123ed573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906124119190613942565b506040517f617ba03700000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8581166004830152602482018490523060448301525f606483015282169063617ba037906084015f604051808303815f87803b15801561248b575f80fd5b505af115801561249d573d5f803e3d5ffd5b5050505050505050565b6040517f095ea7b300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff83811660048301526024820183905284169063095ea7b3906044016020604051808303815f875af1158015612519573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061253d9190613942565b506040517ff2b9fdb800000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff84811660048301526024820183905283169063f2b9fdb8906044015b5f604051808303815f87803b1580156125ac575f80fd5b505af1158015611b98573d5f803e3d5ffd5b5f808273ffffffffffffffffffffffffffffffffffffffff1663026b1d5f6040518163ffffffff1660e01b8152600401602060405180830381865afa158015612609573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061262d9190613689565b6040517f35ea6a7500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff86811660048301529192505f918316906335ea6a75906024016101e060405180830381865afa15801561269d573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906126c19190613a7d565b6101008101516040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529192509073ffffffffffffffffffffffffffffffffffffffff8216906370a0823190602401602060405180830381865afa158015612733573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061275791906138fe565b9695505050505050565b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201525f9073ffffffffffffffffffffffffffffffffffffffff8316906370a0823190602401602060405180830381865afa1580156127cb573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061056291906138fe565b61283c6040518060a001604052805f73ffffffffffffffffffffffffffffffffffffffff1681526020015f81526020015f81526020015f81526020015f67ffffffffffffffff1681525090565b818060200190518101906105629190613c05565b8173ffffffffffffffffffffffffffffffffffffffff16835f8151811061287957612879613915565b60200260200101515f015173ffffffffffffffffffffffffffffffffffffffff161461290857825f815181106128b1576128b1613915565b6020908102919091010151516040517f411efc9d00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff90911660048201526024016105ca565b80835f8151811061291b5761291b613915565b6020026020010151602001511461097957825f8151811061293e5761293e613915565b6020026020010151602001516040517f104959a70000000000000000000000000000000000000000000000000000000081526004016105ca91815260200190565b5f806129a060055473ffffffffffffffffffffffffffffffffffffffff1690565b90506129ac8184611265565b6129b581611382565b915081838273ffffffffffffffffffffffffffffffffffffffff167f269bfb696b3465d8cfcab2af92c6e49cbbe72d60c28788178f8e88c5172d492460405160405180910390a450919050565b604051819073ffffffffffffffffffffffffffffffffffffffff8416907f6332ddaa8a69b5eb2524ec7ca317b7c2b01ecf678d584031415f81270977b8fc905f90a36040517f40c10f1900000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8381166004830152602482018390527f0000000000000000000000002df8c615858b479cbc3bfef3bbfe34842d7aaa9016906340c10f1990604401610e18565b5f80612ae060055473ffffffffffffffffffffffffffffffffffffffff1690565b90505f612aec82611382565b9050612b018185604001518660200151612e1e565b92508215612b1357612b138284612c06565b5050919050565b6040517fa9059cbb00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8381166004830152602482018390527f000000000000000000000000036cbd53842c5426634e7929541ec2318f3dcf7e169063a9059cbb906044016020604051808303815f875af1158015612bac573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190612bd09190613942565b611e6a576040517f49fbb83000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b612cdd82612cd760408051606080820183525f808352602080840182905292840181905283518083018552818152808401829052840152825190810183527f000000000000000000000000036cbd53842c5426634e7929541ec2318f3dcf7e73ffffffffffffffffffffffffffffffffffffffff90811682527f0000000000000000000000009bf12e915461a48bc61ddca5f295a0e20bbba5d78116928201929092527f000000000000000000000000571621ce60cebb0c1d442b5afb38b1663c6bf0179091169181019190915290565b83612e34565b604051819073ffffffffffffffffffffffffffffffffffffffff8416907fb28e99afed98b3607aeea074f84c346dc4135d86f35b1c28bc35ab6782e7ce30905f90a35050565b5f7f0000000000000000000000000000000000000000000000008f90b8876dee653867ffffffffffffffff168367ffffffffffffffff1603612daf57612d6882612ec6565b600580547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83161790559050612dd8565b600580547fffffffffffffffffffffffff00000000000000000000000000000000000000001690555b60405173ffffffffffffffffffffffffffffffffffffffff8216907fe93cbfefd912dc9a1b30a0c2333d11e2bffb32d29ae125c33bbdba59af9e387c905f90a292915050565b5f82612e2a8584613c1f565b610f429190613c5b565b816020015173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603612e7d57610979825f0151836020015183612f9d565b816040015173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603611d2757610979825f01518360400151836130ab565b5f61056282612f9860408051606080820183525f808352602080840182905292840181905283518083018552818152808401829052840152825190810183527f000000000000000000000000036cbd53842c5426634e7929541ec2318f3dcf7e73ffffffffffffffffffffffffffffffffffffffff90811682527f0000000000000000000000009bf12e915461a48bc61ddca5f295a0e20bbba5d78116928201929092527f000000000000000000000000571621ce60cebb0c1d442b5afb38b1663c6bf0179091169181019190915290565b613106565b5f8273ffffffffffffffffffffffffffffffffffffffff1663026b1d5f6040518163ffffffff1660e01b8152600401602060405180830381865afa158015612fe7573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061300b9190613689565b6040517f69328dec00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff868116600483015260248201859052306044830152919250908216906369328dec906064016020604051808303815f875af1158015613087573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610cb891906138fe565b6040517ff3fef3a300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff84811660048301526024820183905283169063f3fef3a390604401612595565b5f8083600181111561311a5761311a613730565b0361312a57506020810151610562565b600183600181111561313e5761313e613730565b03610562575060400151919050565b5f6020828403121561315d575f80fd5b81357fffffffff00000000000000000000000000000000000000000000000000000000811681146116b2575f80fd5b67ffffffffffffffff811681146106e0575f80fd5b80356131ac8161318c565b919050565b5f602082840312156131c1575f80fd5b81356116b28161318c565b73ffffffffffffffffffffffffffffffffffffffff811681146106e0575f80fd5b5f80604083850312156131fe575f80fd5b82356132098161318c565b91506020830135613219816131cc565b809150509250929050565b5f60208284031215613234575f80fd5b813567ffffffffffffffff81111561324a575f80fd5b820160a081850312156116b2575f80fd5b80151581146106e0575f80fd5b5f8060408385031215613279575f80fd5b82356132848161318c565b915060208301356132198161325b565b5f805f80606085870312156132a7575f80fd5b84356132b2816131cc565b935060208501359250604085013567ffffffffffffffff8111156132d4575f80fd5b8501601f810187136132e4575f80fd5b803567ffffffffffffffff8111156132fa575f80fd5b87602082840101111561330b575f80fd5b949793965060200194505050565b5f60208284031215613329575f80fd5b5035919050565b5f60208284031215613340575f80fd5b81356116b2816131cc565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b6040805190810167ffffffffffffffff8111828210171561339b5761339b61334b565b60405290565b60405160a0810167ffffffffffffffff8111828210171561339b5761339b61334b565b6040516101e0810167ffffffffffffffff8111828210171561339b5761339b61334b565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff8111828210171561342f5761342f61334b565b604052919050565b5f67ffffffffffffffff8211156134505761345061334b565b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01660200190565b5f82601f83011261348b575f80fd5b813561349e61349982613437565b6133e8565b8181528460208386010111156134b2575f80fd5b816020850160208301375f918101602001919091529392505050565b5f82601f8301126134dd575f80fd5b813567ffffffffffffffff8111156134f7576134f761334b565b61350660208260051b016133e8565b8082825260208201915060208360061b860101925085831115613527575f80fd5b602085015b838110156135725760408188031215613543575f80fd5b61354b613378565b8135613556816131cc565b815260208281013581830152908452929092019160400161352c565b5095945050505050565b5f60a0823603121561358c575f80fd5b6135946133a1565b823581526135a4602084016131a1565b6020820152604083013567ffffffffffffffff8111156135c2575f80fd5b6135ce3682860161347c565b604083015250606083013567ffffffffffffffff8111156135ed575f80fd5b6135f93682860161347c565b606083015250608083013567ffffffffffffffff811115613618575f80fd5b613624368286016134ce565b60808301525092915050565b60a08101610562828473ffffffffffffffffffffffffffffffffffffffff815116825260208101516020830152604081015160408301526060810151606083015267ffffffffffffffff60808201511660808301525050565b5f60208284031215613699575f80fd5b81516116b2816131cc565b5f80604083850312156136b5575f80fd5b8251600981106136c3575f80fd5b602084015190925067ffffffffffffffff8111156136df575f80fd5b8301601f810185136136ef575f80fd5b80516136fd61349982613437565b818152866020838501011115613711575f80fd5b8160208401602083015e5f602083830101528093505050509250929050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602160045260245ffd5b5f81518084528060208401602086015e5f6020828601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010191505092915050565b67ffffffffffffffff83168152604060208201525f825160a060408401526137d460e084018261375d565b905060208401517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc084830301606085015261380f828261375d565b60408601518582037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc00160808701528051808352602091820194505f93509101905b8083101561389757835173ffffffffffffffffffffffffffffffffffffffff81511683526020810151602084015250604082019150602084019350600183019250613851565b50606086015173ffffffffffffffffffffffffffffffffffffffff1660a086015260808601518582037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc00160c087015292506138f3818461375d565b979650505050505050565b5f6020828403121561390e575f80fd5b5051919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b5f60208284031215613952575f80fd5b81516116b28161325b565b5f60098410613993577f4e487b71000000000000000000000000000000000000000000000000000000005f52602160045260245ffd5b83825260406020830152610f42604083018461375d565b5f60408284031280156139bb575f80fd5b506139c4613378565b82516139cf8161318c565b81526020830151600281106139e2575f80fd5b60208201529392505050565b80516131ac816131cc565b5f60208284031215613a09575f80fd5b6040516020810167ffffffffffffffff81118282101715613a2c57613a2c61334b565b6040529151825250919050565b80516fffffffffffffffffffffffffffffffff811681146131ac575f80fd5b805164ffffffffff811681146131ac575f80fd5b805161ffff811681146131ac575f80fd5b5f6101e0828403128015613a8f575f80fd5b50613a986133c4565b613aa284846139f9565b8152613ab060208401613a39565b6020820152613ac160408401613a39565b6040820152613ad260608401613a39565b6060820152613ae360808401613a39565b6080820152613af460a08401613a39565b60a0820152613b0560c08401613a58565b60c0820152613b1660e08401613a6c565b60e0820152613b2861010084016139ee565b610100820152613b3b61012084016139ee565b610120820152613b4e61014084016139ee565b610140820152613b6161016084016139ee565b610160820152613b746101808401613a39565b610180820152613b876101a08401613a39565b6101a0820152613b9a6101c08401613a39565b6101c08201529392505050565b5f60a08284031215613bb7575f80fd5b613bbf6133a1565b90508151613bcc816131cc565b81526020828101519082015260408083015190820152606080830151908201526080820151613bfa8161318c565b608082015292915050565b5f60a08284031215613c15575f80fd5b6116b28383613ba7565b8082028115828204841417610562577f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f82613c8e577f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b50049056fea2646970667358221220e7df5efc1e9bd94017aaa14fdae4f4422d1097f6d88aac29391a5e792989e8eb64736f6c634300081a0033

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

000000000000000000000000d3b06cebf099ce7da4accf578aaebfdbd6e88a93000000000000000000000000e4ab69c077896252fafbd49efd26b5d171a324100000000000000000000000000000000000000000000000008f90b8876dee6538000000000000000000000000036cbd53842c5426634e7929541ec2318f3dcf7e0000000000000000000000009bf12e915461a48bc61ddca5f295a0e20bbba5d7000000000000000000000000571621ce60cebb0c1d442b5afb38b1663c6bf0170000000000000000000000002df8c615858b479cbc3bfef3bbfe34842d7aaa90000000000000000000000000000000000000000000000000de41ba4fc9d91ad9

-----Decoded View---------------
Arg [0] : ccipRouter (address): 0xD3b06cEbF099CE7DA4AcCf578aaebFDBd6e88a93
Arg [1] : link (address): 0xE4aB69C077896252FAFBD49EFD26B5D171A32410
Arg [2] : thisChainSelector (uint64): 10344971235874465080
Arg [3] : usdc (address): 0x036CbD53842c5426634e7929541eC2318f3dCF7e
Arg [4] : aavePoolAddressesProvider (address): 0x9bf12E915461A48bc61ddca5f295A0E20BBBa5D7
Arg [5] : comet (address): 0x571621Ce60Cebb0c1D442B5afb38B1663C6Bf017
Arg [6] : share (address): 0x2DF8c615858B479cBC3Bfef3bBfE34842d7AaA90
Arg [7] : parentChainSelector (uint64): 16015286601757825753

-----Encoded View---------------
8 Constructor Arguments found :
Arg [0] : 000000000000000000000000d3b06cebf099ce7da4accf578aaebfdbd6e88a93
Arg [1] : 000000000000000000000000e4ab69c077896252fafbd49efd26b5d171a32410
Arg [2] : 0000000000000000000000000000000000000000000000008f90b8876dee6538
Arg [3] : 000000000000000000000000036cbd53842c5426634e7929541ec2318f3dcf7e
Arg [4] : 0000000000000000000000009bf12e915461a48bc61ddca5f295a0e20bbba5d7
Arg [5] : 000000000000000000000000571621ce60cebb0c1d442b5afb38b1663c6bf017
Arg [6] : 0000000000000000000000002df8c615858b479cbc3bfef3bbfe34842d7aaa90
Arg [7] : 000000000000000000000000000000000000000000000000de41ba4fc9d91ad9


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
0x94563Bfe55D8Df522FE94e7D60D2D949ef21BF1c
Loading...
Loading
Loading...
Loading
[ Download: CSV Export  ]

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.