diff --git a/deployments/optimism/ConnextReceiverAdapter.json b/deployments/optimism/ConnextReceiverAdapter.json deleted file mode 100644 index 5c589c3..0000000 --- a/deployments/optimism/ConnextReceiverAdapter.json +++ /dev/null @@ -1,263 +0,0 @@ -{ - "address": "0x4B11b6BEF9480d62b471a9a91a52C893143Bad19", - "abi": [ - { - "inputs": [ - { - "internalType": "contract IDataReceiver", - "name": "_dataReceiver", - "type": "address" - }, - { - "internalType": "contract IConnext", - "name": "_connext", - "type": "address" - }, - { - "internalType": "address", - "name": "_source", - "type": "address" - }, - { - "internalType": "uint32", - "name": "_originDomain", - "type": "uint32" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "inputs": [], - "name": "InvalidAddress", - "type": "error" - }, - { - "inputs": [], - "name": "InvalidAmount", - "type": "error" - }, - { - "inputs": [], - "name": "LengthMismatch", - "type": "error" - }, - { - "inputs": [], - "name": "UnauthorizedCaller", - "type": "error" - }, - { - "inputs": [], - "name": "ZeroAddress", - "type": "error" - }, - { - "inputs": [], - "name": "ZeroAmount", - "type": "error" - }, - { - "inputs": [], - "name": "connext", - "outputs": [ - { - "internalType": "contract IConnext", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "dataReceiver", - "outputs": [ - { - "internalType": "contract IDataReceiver", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "originDomain", - "outputs": [ - { - "internalType": "uint32", - "name": "", - "type": "uint32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "source", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - }, - { - "internalType": "address", - "name": "", - "type": "address" - }, - { - "internalType": "address", - "name": "_originSender", - "type": "address" - }, - { - "internalType": "uint32", - "name": "_origin", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "_callData", - "type": "bytes" - } - ], - "name": "xReceive", - "outputs": [ - { - "internalType": "bytes", - "name": "", - "type": "bytes" - } - ], - "stateMutability": "nonpayable", - "type": "function" - } - ], - "transactionHash": "0xb894f3990b3f81d5a08dcba415693d194294794fb3aa4a25681e86d3e0d9bc9d", - "receipt": { - "to": null, - "from": "0xa6DBFF53DD8F89f0bf4f6800BFDFfE099875bd9d", - "contractAddress": "0x4B11b6BEF9480d62b471a9a91a52C893143Bad19", - "transactionIndex": 12, - "gasUsed": "408279", - "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0xca87d6b6818471cf7458b85d88c327369add488b651c18edc92c21329d6b073e", - "transactionHash": "0xb894f3990b3f81d5a08dcba415693d194294794fb3aa4a25681e86d3e0d9bc9d", - "logs": [], - "blockNumber": 124283707, - "cumulativeGasUsed": "3568856", - "status": 1, - "byzantium": true - }, - "args": [ - "0xe5E3f42C4B86084F2EF05Ef84aD9C8D511D7131e", - "0x8f7492DE823025b4CfaAB1D34c58963F2af5DEDA", - "0x5b9315CE1304DF3B2A83B2074cbF849D160642Ab", - 6648936 - ], - "numDeployments": 5, - "solcInputHash": "03ccf1ed6e52a65018a7892885dc1624", - "metadata": "{\"compiler\":{\"version\":\"0.8.15+commit.e14f2714\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"contract IDataReceiver\",\"name\":\"_dataReceiver\",\"type\":\"address\"},{\"internalType\":\"contract IConnext\",\"name\":\"_connext\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_source\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"_originDomain\",\"type\":\"uint32\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"InvalidAddress\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidAmount\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"LengthMismatch\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UnauthorizedCaller\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ZeroAddress\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ZeroAmount\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"connext\",\"outputs\":[{\"internalType\":\"contract IConnext\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"dataReceiver\",\"outputs\":[{\"internalType\":\"contract IDataReceiver\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"originDomain\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"source\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_originSender\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"_origin\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"_callData\",\"type\":\"bytes\"}],\"name\":\"xReceive\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"stateVariables\":{\"connext\":{\"return\":\"Address of the ConnextHandler contract\",\"returns\":{\"_0\":\"Address of the ConnextHandler contract\"}},\"originDomain\":{\"return\":\"The origin domain id\",\"returns\":{\"_0\":\"The origin domain id\"}},\"source\":{\"return\":\"Address of the xcaller contract\",\"returns\":{\"_0\":\"Address of the xcaller contract\"}}},\"version\":1},\"userdoc\":{\"errors\":{\"InvalidAddress()\":[{\"notice\":\"Thrown if an address is invalid\"}],\"InvalidAmount()\":[{\"notice\":\"Thrown if an amount is invalid\"}],\"LengthMismatch()\":[{\"notice\":\"Thrown if the lengths of a set of lists mismatch\"}],\"UnauthorizedCaller()\":[{\"notice\":\"Thrown if a caller is not authorized\"}],\"ZeroAddress()\":[{\"notice\":\"Thrown if an address is the zero address\"}],\"ZeroAmount()\":[{\"notice\":\"Thrown if an amount is zero\"}]},\"kind\":\"user\",\"methods\":{\"connext()\":{\"notice\":\"Gets the ConnextHandler contract on this domain\"},\"dataReceiver()\":{\"notice\":\"Gets the address of the DataReceiver contract\"},\"originDomain()\":{\"notice\":\"Gets the origin domain id\"},\"source()\":{\"notice\":\"Gets the DAO that is expected as the xcaller\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"solidity/contracts/bridges/ConnextReceiverAdapter.sol\":\"ConnextReceiverAdapter\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@connext/nxtp-contracts/contracts/core/connext/helpers/LPToken.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSED\\npragma solidity 0.8.15;\\n\\nimport {ERC20Upgradeable} from \\\"@openzeppelin/contracts-upgradeable/token/ERC20/extensions/ERC20BurnableUpgradeable.sol\\\";\\nimport {OwnableUpgradeable} from \\\"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\\\";\\n\\n/**\\n * @title Liquidity Provider Token\\n * @notice This token is an ERC20 detailed token with added capability to be minted by the owner.\\n * It is used to represent user's shares when providing liquidity to swap contracts.\\n * @dev Only Swap contracts should initialize and own LPToken contracts.\\n */\\ncontract LPToken is ERC20Upgradeable, OwnableUpgradeable {\\n // ============ Upgrade Gap ============\\n\\n uint256[49] private __GAP; // gap for upgrade safety\\n\\n // ============ Storage ============\\n\\n /**\\n * @notice Used to enforce proper token dilution\\n * @dev If this is the first mint of the LP token, this amount of funds are burned.\\n * See audit recommendations here:\\n * - https://github.com/code-423n4/2022-03-prepo-findings/issues/27\\n * - https://github.com/code-423n4/2022-04-jpegd-findings/issues/12\\n * and uniswap v2 implementation here:\\n * https://github.com/Uniswap/v2-core/blob/8b82b04a0b9e696c0e83f8b2f00e5d7be6888c79/contracts/UniswapV2Pair.sol#L15\\n */\\n uint256 public constant MINIMUM_LIQUIDITY = 10**3;\\n\\n // ============ Initializer ============\\n\\n /**\\n * @notice Initializes this LPToken contract with the given name and symbol\\n * @dev The caller of this function will become the owner. A Swap contract should call this\\n * in its initializer function.\\n * @param name name of this token\\n * @param symbol symbol of this token\\n */\\n function initialize(string memory name, string memory symbol) external initializer returns (bool) {\\n __Context_init_unchained();\\n __ERC20_init_unchained(name, symbol);\\n __Ownable_init_unchained();\\n return true;\\n }\\n\\n // ============ External functions ============\\n\\n /**\\n * @notice Mints the given amount of LPToken to the recipient.\\n * @dev only owner can call this mint function\\n * @param recipient address of account to receive the tokens\\n * @param amount amount of tokens to mint\\n */\\n function mint(address recipient, uint256 amount) external onlyOwner {\\n require(amount != 0, \\\"LPToken: cannot mint 0\\\");\\n if (totalSupply() == 0) {\\n // NOTE: using the _mint function directly will error because it is going\\n // to the 0 address. fix by using the address(1) here instead\\n _mint(address(1), MINIMUM_LIQUIDITY);\\n }\\n _mint(recipient, amount);\\n }\\n\\n /**\\n * @notice Burns the given amount of LPToken from provided account\\n * @dev only owner can call this burn function\\n * @param account address of account from which to burn token\\n * @param amount amount of tokens to mint\\n */\\n function burnFrom(address account, uint256 amount) external onlyOwner {\\n require(amount != 0, \\\"LPToken: cannot burn 0\\\");\\n _burn(account, amount);\\n }\\n\\n // ============ Internal functions ============\\n\\n /**\\n * @dev Overrides ERC20._beforeTokenTransfer() which get called on every transfers including\\n * minting and burning. This ensures that Swap.updateUserWithdrawFees are called everytime.\\n * This assumes the owner is set to a Swap contract's address.\\n */\\n function _beforeTokenTransfer(\\n address from,\\n address to,\\n uint256 amount\\n ) internal virtual override(ERC20Upgradeable) {\\n super._beforeTokenTransfer(from, to, amount);\\n require(to != address(this), \\\"LPToken: cannot send to itself\\\");\\n }\\n}\\n\",\"keccak256\":\"0x1d3f871488111c70a6f9b09ad3baeb21ebc635c82aa2c6d627d07e09720e4126\",\"license\":\"UNLICENSED\"},\"@connext/nxtp-contracts/contracts/core/connext/interfaces/IConnext.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSED\\npragma solidity 0.8.15;\\n\\nimport {IERC20} from \\\"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\\\";\\n\\nimport {ExecuteArgs, TransferInfo, TokenId, DestinationTransferStatus} from \\\"../libraries/LibConnextStorage.sol\\\";\\nimport {LibDiamond} from \\\"../libraries/LibDiamond.sol\\\";\\nimport {SwapUtils} from \\\"../libraries/SwapUtils.sol\\\";\\n\\nimport {IStableSwap} from \\\"./IStableSwap.sol\\\";\\n\\nimport {IDiamondCut} from \\\"./IDiamondCut.sol\\\";\\nimport {IDiamondLoupe} from \\\"./IDiamondLoupe.sol\\\";\\n\\ninterface IConnext is IDiamondLoupe, IDiamondCut {\\n // TokenFacet\\n function canonicalToAdopted(bytes32 _key) external view returns (address);\\n\\n function canonicalToAdopted(TokenId calldata _canonical) external view returns (address);\\n\\n function adoptedToCanonical(address _adopted) external view returns (TokenId memory);\\n\\n function canonicalToRepresentation(bytes32 _key) external view returns (address);\\n\\n function canonicalToRepresentation(TokenId calldata _canonical) external view returns (address);\\n\\n function representationToCanonical(address _adopted) external view returns (TokenId memory);\\n\\n function getLocalAndAdoptedToken(bytes32 _id, uint32 _domain) external view returns (address, address);\\n\\n function approvedAssets(bytes32 _key) external view returns (bool);\\n\\n function approvedAssets(TokenId calldata _canonical) external view returns (bool);\\n\\n function adoptedToLocalPools(bytes32 _key) external view returns (IStableSwap);\\n\\n function adoptedToLocalPools(TokenId calldata _canonical) external view returns (IStableSwap);\\n\\n function getTokenId(address _candidate) external view returns (TokenId memory);\\n\\n function setupAsset(\\n TokenId calldata _canonical,\\n uint8 _canonicalDecimals,\\n string memory _representationName,\\n string memory _representationSymbol,\\n address _adoptedAssetId,\\n address _stableSwapPool,\\n uint256 _cap\\n ) external returns (address);\\n\\n function setupAssetWithDeployedRepresentation(\\n TokenId calldata _canonical,\\n address _representation,\\n address _adoptedAssetId,\\n address _stableSwapPool,\\n uint256 _cap\\n ) external returns (address);\\n\\n function addStableSwapPool(TokenId calldata _canonical, address _stableSwapPool) external;\\n\\n function updateLiquidityCap(TokenId calldata _canonical, uint256 _updated) external;\\n\\n function removeAssetId(\\n bytes32 _key,\\n address _adoptedAssetId,\\n address _representation\\n ) external;\\n\\n function removeAssetId(\\n TokenId calldata _canonical,\\n address _adoptedAssetId,\\n address _representation\\n ) external;\\n\\n function updateDetails(\\n TokenId calldata _canonical,\\n string memory _name,\\n string memory _symbol\\n ) external;\\n\\n // BaseConnextFacet\\n\\n // BridgeFacet\\n function routedTransfers(bytes32 _transferId) external view returns (address[] memory);\\n\\n function transferStatus(bytes32 _transferId) external view returns (DestinationTransferStatus);\\n\\n function remote(uint32 _domain) external view returns (address);\\n\\n function domain() external view returns (uint256);\\n\\n function nonce() external view returns (uint256);\\n\\n function approvedSequencers(address _sequencer) external view returns (bool);\\n\\n function xAppConnectionManager() external view returns (address);\\n\\n function addConnextion(uint32 _domain, address _connext) external;\\n\\n function addSequencer(address _sequencer) external;\\n\\n function removeSequencer(address _sequencer) external;\\n\\n function xcall(\\n uint32 _destination,\\n address _to,\\n address _asset,\\n address _delegate,\\n uint256 _amount,\\n uint256 _slippage,\\n bytes calldata _callData\\n ) external payable returns (bytes32);\\n\\n function xcallIntoLocal(\\n uint32 _destination,\\n address _to,\\n address _asset,\\n address _delegate,\\n uint256 _amount,\\n uint256 _slippage,\\n bytes calldata _callData\\n ) external payable returns (bytes32);\\n\\n function execute(ExecuteArgs calldata _args) external returns (bytes32 transferId);\\n\\n function forceUpdateSlippage(TransferInfo calldata _params, uint256 _slippage) external;\\n\\n function bumpTransfer(bytes32 _transferId) external payable;\\n\\n function setXAppConnectionManager(address _xAppConnectionManager) external;\\n\\n function enrollRemoteRouter(uint32 _domain, bytes32 _router) external;\\n\\n function enrollCustom(\\n uint32 _domain,\\n bytes32 _id,\\n address _custom\\n ) external;\\n\\n // InboxFacet\\n\\n function handle(\\n uint32 _origin,\\n uint32 _nonce,\\n bytes32 _sender,\\n bytes memory _message\\n ) external;\\n\\n // ProposedOwnableFacet\\n\\n function owner() external view returns (address);\\n\\n function routerWhitelistRemoved() external view returns (bool);\\n\\n function assetWhitelistRemoved() external view returns (bool);\\n\\n function proposed() external view returns (address);\\n\\n function proposedTimestamp() external view returns (uint256);\\n\\n function routerWhitelistTimestamp() external view returns (uint256);\\n\\n function assetWhitelistTimestamp() external view returns (uint256);\\n\\n function delay() external view returns (uint256);\\n\\n function proposeRouterWhitelistRemoval() external;\\n\\n function removeRouterWhitelist() external;\\n\\n function proposeAssetWhitelistRemoval() external;\\n\\n function removeAssetWhitelist() external;\\n\\n function renounced() external view returns (bool);\\n\\n function proposeNewOwner(address newlyProposed) external;\\n\\n function renounceOwnership() external;\\n\\n function acceptProposedOwner() external;\\n\\n function pause() external;\\n\\n function unpause() external;\\n\\n // RelayerFacet\\n function approvedRelayers(address _relayer) external view returns (bool);\\n\\n function relayerFeeVault() external view returns (address);\\n\\n function setRelayerFeeVault(address _relayerFeeVault) external;\\n\\n function addRelayer(address _relayer) external;\\n\\n function removeRelayer(address _relayer) external;\\n\\n // RoutersFacet\\n function LIQUIDITY_FEE_NUMERATOR() external view returns (uint256);\\n\\n function LIQUIDITY_FEE_DENOMINATOR() external view returns (uint256);\\n\\n function getRouterApproval(address _router) external view returns (bool);\\n\\n function getRouterRecipient(address _router) external view returns (address);\\n\\n function getRouterOwner(address _router) external view returns (address);\\n\\n function getProposedRouterOwner(address _router) external view returns (address);\\n\\n function getProposedRouterOwnerTimestamp(address _router) external view returns (uint256);\\n\\n function maxRoutersPerTransfer() external view returns (uint256);\\n\\n function routerBalances(address _router, address _asset) external view returns (uint256);\\n\\n function getRouterApprovalForPortal(address _router) external view returns (bool);\\n\\n function setupRouter(\\n address router,\\n address owner,\\n address recipient\\n ) external;\\n\\n function removeRouter(address router) external;\\n\\n function setMaxRoutersPerTransfer(uint256 _newMaxRouters) external;\\n\\n function setLiquidityFeeNumerator(uint256 _numerator) external;\\n\\n function approveRouterForPortal(address _router) external;\\n\\n function unapproveRouterForPortal(address _router) external;\\n\\n function setRouterRecipient(address router, address recipient) external;\\n\\n function proposeRouterOwner(address router, address proposed) external;\\n\\n function acceptProposedRouterOwner(address router) external;\\n\\n function addRouterLiquidityFor(\\n uint256 _amount,\\n address _local,\\n address _router\\n ) external payable;\\n\\n function addRouterLiquidity(uint256 _amount, address _local) external payable;\\n\\n function removeRouterLiquidityFor(\\n uint256 _amount,\\n address _local,\\n address payable _to,\\n address _router\\n ) external;\\n\\n function removeRouterLiquidity(\\n uint256 _amount,\\n address _local,\\n address payable _to\\n ) external;\\n\\n // PortalFacet\\n function getAavePortalDebt(bytes32 _transferId) external view returns (uint256);\\n\\n function getAavePortalFeeDebt(bytes32 _transferId) external view returns (uint256);\\n\\n function aavePool() external view returns (address);\\n\\n function aavePortalFee() external view returns (uint256);\\n\\n function setAavePool(address _aavePool) external;\\n\\n function setAavePortalFee(uint256 _aavePortalFeeNumerator) external;\\n\\n function repayAavePortal(\\n TransferInfo calldata _params,\\n uint256 _backingAmount,\\n uint256 _feeAmount,\\n uint256 _maxIn\\n ) external;\\n\\n function repayAavePortalFor(\\n TransferInfo calldata _params,\\n uint256 _backingAmount,\\n uint256 _feeAmount\\n ) external;\\n\\n // StableSwapFacet\\n function getSwapStorage(bytes32 canonicalId) external view returns (SwapUtils.Swap memory);\\n\\n function getSwapLPToken(bytes32 canonicalId) external view returns (address);\\n\\n function getSwapA(bytes32 canonicalId) external view returns (uint256);\\n\\n function getSwapAPrecise(bytes32 canonicalId) external view returns (uint256);\\n\\n function getSwapToken(bytes32 canonicalId, uint8 index) external view returns (IERC20);\\n\\n function getSwapTokenIndex(bytes32 canonicalId, address tokenAddress) external view returns (uint8);\\n\\n function getSwapTokenBalance(bytes32 canonicalId, uint8 index) external view returns (uint256);\\n\\n function getSwapVirtualPrice(bytes32 canonicalId) external view returns (uint256);\\n\\n function calculateSwap(\\n bytes32 canonicalId,\\n uint8 tokenIndexFrom,\\n uint8 tokenIndexTo,\\n uint256 dx\\n ) external view returns (uint256);\\n\\n function calculateSwapTokenAmount(\\n bytes32 canonicalId,\\n uint256[] calldata amounts,\\n bool deposit\\n ) external view returns (uint256);\\n\\n function calculateRemoveSwapLiquidity(bytes32 canonicalId, uint256 amount) external view returns (uint256[] memory);\\n\\n function calculateRemoveSwapLiquidityOneToken(\\n bytes32 canonicalId,\\n uint256 tokenAmount,\\n uint8 tokenIndex\\n ) external view returns (uint256);\\n\\n function getSwapAdminBalance(bytes32 canonicalId, uint256 index) external view returns (uint256);\\n\\n function swap(\\n bytes32 canonicalId,\\n uint8 tokenIndexFrom,\\n uint8 tokenIndexTo,\\n uint256 dx,\\n uint256 minDy,\\n uint256 deadline\\n ) external returns (uint256);\\n\\n function swapExact(\\n bytes32 canonicalId,\\n uint256 amountIn,\\n address assetIn,\\n address assetOut,\\n uint256 minAmountOut,\\n uint256 deadline\\n ) external payable returns (uint256);\\n\\n function swapExactOut(\\n bytes32 canonicalId,\\n uint256 amountOut,\\n address assetIn,\\n address assetOut,\\n uint256 maxAmountIn,\\n uint256 deadline\\n ) external payable returns (uint256);\\n\\n function addSwapLiquidity(\\n bytes32 canonicalId,\\n uint256[] calldata amounts,\\n uint256 minToMint,\\n uint256 deadline\\n ) external returns (uint256);\\n\\n function removeSwapLiquidity(\\n bytes32 canonicalId,\\n uint256 amount,\\n uint256[] calldata minAmounts,\\n uint256 deadline\\n ) external returns (uint256[] memory);\\n\\n function removeSwapLiquidityOneToken(\\n bytes32 canonicalId,\\n uint256 tokenAmount,\\n uint8 tokenIndex,\\n uint256 minAmount,\\n uint256 deadline\\n ) external returns (uint256);\\n\\n function removeSwapLiquidityImbalance(\\n bytes32 canonicalId,\\n uint256[] calldata amounts,\\n uint256 maxBurnAmount,\\n uint256 deadline\\n ) external returns (uint256);\\n\\n // SwapAdminFacet\\n\\n function initializeSwap(\\n bytes32 _canonicalId,\\n IERC20[] memory _pooledTokens,\\n uint8[] memory decimals,\\n string memory lpTokenName,\\n string memory lpTokenSymbol,\\n uint256 _a,\\n uint256 _fee,\\n uint256 _adminFee,\\n address lpTokenTargetAddress\\n ) external;\\n\\n function withdrawSwapAdminFees(bytes32 canonicalId) external;\\n\\n function setSwapAdminFee(bytes32 canonicalId, uint256 newAdminFee) external;\\n\\n function setSwapFee(bytes32 canonicalId, uint256 newSwapFee) external;\\n\\n function rampA(\\n bytes32 canonicalId,\\n uint256 futureA,\\n uint256 futureTime\\n ) external;\\n\\n function stopRampA(bytes32 canonicalId) external;\\n}\\n\",\"keccak256\":\"0xf4e97b6638cb0af7c41f69b151ec5c66e8d1532067674aecd71d8587a376be4a\",\"license\":\"UNLICENSED\"},\"@connext/nxtp-contracts/contracts/core/connext/interfaces/IDiamondCut.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.15;\\n\\n/******************************************************************************\\\\\\n* Author: Nick Mudge (https://twitter.com/mudgen)\\n* EIP-2535 Diamonds: https://eips.ethereum.org/EIPS/eip-2535\\n/******************************************************************************/\\n\\ninterface IDiamondCut {\\n enum FacetCutAction {\\n Add,\\n Replace,\\n Remove\\n }\\n // Add=0, Replace=1, Remove=2\\n\\n struct FacetCut {\\n address facetAddress;\\n FacetCutAction action;\\n bytes4[] functionSelectors;\\n }\\n\\n /// @notice Propose to add/replace/remove any number of functions and optionally execute\\n /// a function with delegatecall\\n /// @param _diamondCut Contains the facet addresses and function selectors\\n /// @param _init The address of the contract or facet to execute _calldata\\n /// @param _calldata A function call, including function selector and arguments\\n /// _calldata is executed with delegatecall on _init\\n function proposeDiamondCut(\\n FacetCut[] calldata _diamondCut,\\n address _init,\\n bytes calldata _calldata\\n ) external;\\n\\n event DiamondCutProposed(FacetCut[] _diamondCut, address _init, bytes _calldata, uint256 deadline);\\n\\n /// @notice Add/replace/remove any number of functions and optionally execute\\n /// a function with delegatecall\\n /// @param _diamondCut Contains the facet addresses and function selectors\\n /// @param _init The address of the contract or facet to execute _calldata\\n /// @param _calldata A function call, including function selector and arguments\\n /// _calldata is executed with delegatecall on _init\\n function diamondCut(\\n FacetCut[] calldata _diamondCut,\\n address _init,\\n bytes calldata _calldata\\n ) external;\\n\\n event DiamondCut(FacetCut[] _diamondCut, address _init, bytes _calldata);\\n\\n /// @notice Propose to add/replace/remove any number of functions and optionally execute\\n /// a function with delegatecall\\n /// @param _diamondCut Contains the facet addresses and function selectors\\n /// @param _init The address of the contract or facet to execute _calldata\\n /// @param _calldata A function call, including function selector and arguments\\n /// _calldata is executed with delegatecall on _init\\n function rescindDiamondCut(\\n FacetCut[] calldata _diamondCut,\\n address _init,\\n bytes calldata _calldata\\n ) external;\\n\\n event DiamondCutRescinded(FacetCut[] _diamondCut, address _init, bytes _calldata);\\n}\\n\",\"keccak256\":\"0xd75a7bfdb3aeac3acebf8cf999330a0fc7bec65e9a68711bbb58f4554ef087b2\",\"license\":\"MIT\"},\"@connext/nxtp-contracts/contracts/core/connext/interfaces/IDiamondLoupe.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.15;\\n\\n/******************************************************************************\\\\\\n* Author: Nick Mudge (https://twitter.com/mudgen)\\n* EIP-2535 Diamonds: https://eips.ethereum.org/EIPS/eip-2535\\n/******************************************************************************/\\n\\n// A loupe is a small magnifying glass used to look at diamonds.\\n// These functions look at diamonds\\ninterface IDiamondLoupe {\\n /// These functions are expected to be called frequently\\n /// by tools.\\n\\n struct Facet {\\n address facetAddress;\\n bytes4[] functionSelectors;\\n }\\n\\n /// @notice Gets all facet addresses and their four byte function selectors.\\n /// @return facets_ Facet\\n function facets() external view returns (Facet[] memory facets_);\\n\\n /// @notice Gets all the function selectors supported by a specific facet.\\n /// @param _facet The facet address.\\n /// @return facetFunctionSelectors_\\n function facetFunctionSelectors(address _facet) external view returns (bytes4[] memory facetFunctionSelectors_);\\n\\n /// @notice Get all the facet addresses used by a diamond.\\n /// @return facetAddresses_\\n function facetAddresses() external view returns (address[] memory facetAddresses_);\\n\\n /// @notice Gets the facet that supports the given selector.\\n /// @dev If facet is not found return address(0).\\n /// @param _functionSelector The function selector.\\n /// @return facetAddress_ The facet address.\\n function facetAddress(bytes4 _functionSelector) external view returns (address facetAddress_);\\n}\\n\",\"keccak256\":\"0xe6d71029d0a1846712477ccf17aa2124b82996c77b6e6486a208a68ea421f563\",\"license\":\"MIT\"},\"@connext/nxtp-contracts/contracts/core/connext/interfaces/IStableSwap.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSED\\npragma solidity 0.8.15;\\n\\nimport {IERC20} from \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\ninterface IStableSwap {\\n /*** EVENTS ***/\\n\\n // events replicated from SwapUtils to make the ABI easier for dumb\\n // clients\\n event TokenSwap(address indexed buyer, uint256 tokensSold, uint256 tokensBought, uint128 soldId, uint128 boughtId);\\n event AddLiquidity(\\n address indexed provider,\\n uint256[] tokenAmounts,\\n uint256[] fees,\\n uint256 invariant,\\n uint256 lpTokenSupply\\n );\\n event RemoveLiquidity(address indexed provider, uint256[] tokenAmounts, uint256 lpTokenSupply);\\n event RemoveLiquidityOne(\\n address indexed provider,\\n uint256 lpTokenAmount,\\n uint256 lpTokenSupply,\\n uint256 boughtId,\\n uint256 tokensBought\\n );\\n event RemoveLiquidityImbalance(\\n address indexed provider,\\n uint256[] tokenAmounts,\\n uint256[] fees,\\n uint256 invariant,\\n uint256 lpTokenSupply\\n );\\n event NewAdminFee(uint256 newAdminFee);\\n event NewSwapFee(uint256 newSwapFee);\\n event NewWithdrawFee(uint256 newWithdrawFee);\\n event RampA(uint256 oldA, uint256 newA, uint256 initialTime, uint256 futureTime);\\n event StopRampA(uint256 currentA, uint256 time);\\n\\n function swap(\\n uint8 tokenIndexFrom,\\n uint8 tokenIndexTo,\\n uint256 dx,\\n uint256 minDy,\\n uint256 deadline\\n ) external returns (uint256);\\n\\n function swapExact(\\n uint256 amountIn,\\n address assetIn,\\n address assetOut,\\n uint256 minAmountOut,\\n uint256 deadline\\n ) external payable returns (uint256);\\n\\n function swapExactOut(\\n uint256 amountOut,\\n address assetIn,\\n address assetOut,\\n uint256 maxAmountIn,\\n uint256 deadline\\n ) external payable returns (uint256);\\n\\n function getA() external view returns (uint256);\\n\\n function getToken(uint8 index) external view returns (IERC20);\\n\\n function getTokenIndex(address tokenAddress) external view returns (uint8);\\n\\n function getTokenBalance(uint8 index) external view returns (uint256);\\n\\n function getVirtualPrice() external view returns (uint256);\\n\\n // min return calculation functions\\n function calculateSwap(\\n uint8 tokenIndexFrom,\\n uint8 tokenIndexTo,\\n uint256 dx\\n ) external view returns (uint256);\\n\\n function calculateSwapOut(\\n uint8 tokenIndexFrom,\\n uint8 tokenIndexTo,\\n uint256 dy\\n ) external view returns (uint256);\\n\\n function calculateSwapFromAddress(\\n address assetIn,\\n address assetOut,\\n uint256 amountIn\\n ) external view returns (uint256);\\n\\n function calculateSwapOutFromAddress(\\n address assetIn,\\n address assetOut,\\n uint256 amountOut\\n ) external view returns (uint256);\\n\\n function calculateTokenAmount(uint256[] calldata amounts, bool deposit) external view returns (uint256);\\n\\n function calculateRemoveLiquidity(uint256 amount) external view returns (uint256[] memory);\\n\\n function calculateRemoveLiquidityOneToken(uint256 tokenAmount, uint8 tokenIndex)\\n external\\n view\\n returns (uint256 availableTokenAmount);\\n\\n // state modifying functions\\n function initialize(\\n IERC20[] memory pooledTokens,\\n uint8[] memory decimals,\\n string memory lpTokenName,\\n string memory lpTokenSymbol,\\n uint256 a,\\n uint256 fee,\\n uint256 adminFee,\\n address lpTokenTargetAddress\\n ) external;\\n\\n function addLiquidity(\\n uint256[] calldata amounts,\\n uint256 minToMint,\\n uint256 deadline\\n ) external returns (uint256);\\n\\n function removeLiquidity(\\n uint256 amount,\\n uint256[] calldata minAmounts,\\n uint256 deadline\\n ) external returns (uint256[] memory);\\n\\n function removeLiquidityOneToken(\\n uint256 tokenAmount,\\n uint8 tokenIndex,\\n uint256 minAmount,\\n uint256 deadline\\n ) external returns (uint256);\\n\\n function removeLiquidityImbalance(\\n uint256[] calldata amounts,\\n uint256 maxBurnAmount,\\n uint256 deadline\\n ) external returns (uint256);\\n}\\n\",\"keccak256\":\"0xfbbb2cad0639658aa781212c69df10718250a6926d94a1a7508fc9927216abe8\",\"license\":\"UNLICENSED\"},\"@connext/nxtp-contracts/contracts/core/connext/interfaces/IXReceiver.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSED\\npragma solidity 0.8.15;\\n\\ninterface IXReceiver {\\n function xReceive(\\n bytes32 _transferId,\\n uint256 _amount,\\n address _asset,\\n address _originSender,\\n uint32 _origin,\\n bytes memory _callData\\n ) external returns (bytes memory);\\n}\\n\",\"keccak256\":\"0x75286f6ac1b1d5d7f4e508a478c0dad3a26d92675dabbf180d0b46d892618a1a\",\"license\":\"UNLICENSED\"},\"@connext/nxtp-contracts/contracts/core/connext/libraries/AmplificationUtils.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSED\\npragma solidity 0.8.15;\\n\\nimport {SafeERC20} from \\\"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\\\";\\n\\nimport {SwapUtils} from \\\"./SwapUtils.sol\\\";\\n\\n/**\\n * @title AmplificationUtils library\\n * @notice A library to calculate and ramp the A parameter of a given `SwapUtils.Swap` struct.\\n * This library assumes the struct is fully validated.\\n */\\nlibrary AmplificationUtils {\\n event RampA(uint256 oldA, uint256 newA, uint256 initialTime, uint256 futureTime);\\n event StopRampA(uint256 currentA, uint256 time);\\n\\n // Constant values used in ramping A calculations\\n uint256 public constant A_PRECISION = 100;\\n uint256 public constant MAX_A = 10**6;\\n uint256 private constant MAX_A_CHANGE = 2;\\n uint256 private constant MIN_RAMP_TIME = 14 days;\\n\\n /**\\n * @notice Return A, the amplification coefficient * n * (n - 1)\\n * @dev See the StableSwap paper for details\\n * @param self Swap struct to read from\\n * @return A parameter\\n */\\n function getA(SwapUtils.Swap storage self) internal view returns (uint256) {\\n return _getAPrecise(self) / A_PRECISION;\\n }\\n\\n /**\\n * @notice Return A in its raw precision\\n * @dev See the StableSwap paper for details\\n * @param self Swap struct to read from\\n * @return A parameter in its raw precision form\\n */\\n function getAPrecise(SwapUtils.Swap storage self) internal view returns (uint256) {\\n return _getAPrecise(self);\\n }\\n\\n /**\\n * @notice Return A in its raw precision\\n * @dev See the StableSwap paper for details\\n * @param self Swap struct to read from\\n * @return A parameter in its raw precision form\\n */\\n function _getAPrecise(SwapUtils.Swap storage self) internal view returns (uint256) {\\n uint256 t1 = self.futureATime; // time when ramp is finished\\n uint256 a1 = self.futureA; // final A value when ramp is finished\\n\\n if (block.timestamp < t1) {\\n uint256 t0 = self.initialATime; // time when ramp is started\\n uint256 a0 = self.initialA; // initial A value when ramp is started\\n if (a1 > a0) {\\n // a0 + (a1 - a0) * (block.timestamp - t0) / (t1 - t0)\\n return a0 + ((a1 - a0) * (block.timestamp - t0)) / (t1 - t0);\\n } else {\\n // a0 - (a0 - a1) * (block.timestamp - t0) / (t1 - t0)\\n return a0 - ((a0 - a1) * (block.timestamp - t0)) / (t1 - t0);\\n }\\n } else {\\n return a1;\\n }\\n }\\n\\n /**\\n * @notice Start ramping up or down A parameter towards given futureA_ and futureTime_\\n * Checks if the change is too rapid, and commits the new A value only when it falls under\\n * the limit range.\\n * @param self Swap struct to update\\n * @param futureA_ the new A to ramp towards\\n * @param futureTime_ timestamp when the new A should be reached\\n */\\n function rampA(\\n SwapUtils.Swap storage self,\\n uint256 futureA_,\\n uint256 futureTime_\\n ) internal {\\n require(block.timestamp >= self.initialATime + 1 days, \\\"Wait 1 day before starting ramp\\\");\\n require(futureTime_ >= block.timestamp + MIN_RAMP_TIME, \\\"Insufficient ramp time\\\");\\n require(futureA_ != 0 && futureA_ < MAX_A, \\\"futureA_ must be > 0 and < MAX_A\\\");\\n\\n uint256 initialAPrecise = _getAPrecise(self);\\n uint256 futureAPrecise = futureA_ * A_PRECISION;\\n\\n if (futureAPrecise < initialAPrecise) {\\n require(futureAPrecise * MAX_A_CHANGE >= initialAPrecise, \\\"futureA_ is too small\\\");\\n } else {\\n require(futureAPrecise <= initialAPrecise * MAX_A_CHANGE, \\\"futureA_ is too large\\\");\\n }\\n\\n self.initialA = initialAPrecise;\\n self.futureA = futureAPrecise;\\n self.initialATime = block.timestamp;\\n self.futureATime = futureTime_;\\n\\n emit RampA(initialAPrecise, futureAPrecise, block.timestamp, futureTime_);\\n }\\n\\n /**\\n * @notice Stops ramping A immediately. Once this function is called, rampA()\\n * cannot be called for another 24 hours\\n * @param self Swap struct to update\\n */\\n function stopRampA(SwapUtils.Swap storage self) internal {\\n require(self.futureATime > block.timestamp, \\\"Ramp is already stopped\\\");\\n\\n uint256 currentA = _getAPrecise(self);\\n self.initialA = currentA;\\n self.futureA = currentA;\\n self.initialATime = block.timestamp;\\n self.futureATime = block.timestamp;\\n\\n emit StopRampA(currentA, block.timestamp);\\n }\\n}\\n\",\"keccak256\":\"0x7dca96b10fa307f469c142aaea0855d3c9ba45f79066eaeae1467ce113fc8d28\",\"license\":\"UNLICENSED\"},\"@connext/nxtp-contracts/contracts/core/connext/libraries/LibConnextStorage.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSED\\npragma solidity 0.8.15;\\n\\nimport {IStableSwap} from \\\"../interfaces/IStableSwap.sol\\\";\\nimport {IConnectorManager} from \\\"../../../messaging/interfaces/IConnectorManager.sol\\\";\\nimport {SwapUtils} from \\\"./SwapUtils.sol\\\";\\n\\n// ============= Enum =============\\n\\n/// @notice Enum representing address role\\n// Returns uint\\n// None - 0\\n// Router - 1\\n// Watcher - 2\\n// Admin - 3\\nenum Role {\\n None,\\n Router,\\n Watcher,\\n Admin\\n}\\n\\n/**\\n * @notice Enum representing status of destination transfer\\n * @dev Status is only assigned on the destination domain, will always be \\\"none\\\" for the\\n * origin domains\\n * @return uint - Index of value in enum\\n */\\nenum DestinationTransferStatus {\\n None, // 0\\n Reconciled, // 1\\n Executed, // 2\\n Completed // 3 - executed + reconciled\\n}\\n\\n// ============= Structs =============\\n\\nstruct TokenId {\\n uint32 domain;\\n bytes32 id;\\n}\\n\\n/**\\n * @notice These are the parameters that will remain constant between the\\n * two chains. They are supplied on `xcall` and should be asserted on `execute`\\n * @property to - The account that receives funds, in the event of a crosschain call,\\n * will receive funds if the call fails.\\n *\\n * @param originDomain - The originating domain (i.e. where `xcall` is called). Must match nomad domain schema\\n * @param destinationDomain - The final domain (i.e. where `execute` / `reconcile` are called). Must match nomad domain schema\\n * @param canonicalDomain - The canonical domain of the asset you are bridging\\n * @param to - The address you are sending funds (and potentially data) to\\n * @param delegate - An address who can execute txs on behalf of `to`, in addition to allowing relayers\\n * @param receiveLocal - If true, will use the local nomad asset on the destination instead of adopted.\\n * @param callData - The data to execute on the receiving chain. If no crosschain call is needed, then leave empty.\\n * @param slippage - Slippage user is willing to accept from original amount in expressed in BPS (i.e. if\\n * a user takes 1% slippage, this is expressed as 1_000)\\n * @param originSender - The msg.sender of the xcall\\n * @param bridgedAmt - The amount sent over the bridge (after potential AMM on xcall)\\n * @param normalizedIn - The amount sent to `xcall`, normalized to 18 decimals\\n * @param nonce - The nonce on the origin domain used to ensure the transferIds are unique\\n * @param canonicalId - The unique identifier of the canonical token corresponding to bridge assets\\n */\\nstruct TransferInfo {\\n uint32 originDomain;\\n uint32 destinationDomain;\\n uint32 canonicalDomain;\\n address to;\\n address delegate;\\n bool receiveLocal;\\n bytes callData;\\n uint256 slippage;\\n address originSender;\\n uint256 bridgedAmt;\\n uint256 normalizedIn;\\n uint256 nonce;\\n bytes32 canonicalId;\\n}\\n\\n/**\\n * @notice\\n * @param params - The TransferInfo. These are consistent across sending and receiving chains.\\n * @param routers - The routers who you are sending the funds on behalf of.\\n * @param routerSignatures - Signatures belonging to the routers indicating permission to use funds\\n * for the signed transfer ID.\\n * @param sequencer - The sequencer who assigned the router path to this transfer.\\n * @param sequencerSignature - Signature produced by the sequencer for path assignment accountability\\n * for the path that was signed.\\n */\\nstruct ExecuteArgs {\\n TransferInfo params;\\n address[] routers;\\n bytes[] routerSignatures;\\n address sequencer;\\n bytes sequencerSignature;\\n}\\n\\n/**\\n * @notice Contains RouterFacet related state\\n * @param approvedRouters - Mapping of whitelisted router addresses\\n * @param routerRecipients - Mapping of router withdraw recipient addresses.\\n * If set, all liquidity is withdrawn only to this address. Must be set by routerOwner\\n * (if configured) or the router itself\\n * @param routerOwners - Mapping of router owners\\n * If set, can update the routerRecipient\\n * @param proposedRouterOwners - Mapping of proposed router owners\\n * Must wait timeout to set the\\n * @param proposedRouterTimestamp - Mapping of proposed router owners timestamps\\n * When accepting a proposed owner, must wait for delay to elapse\\n */\\nstruct RouterPermissionsManagerInfo {\\n mapping(address => bool) approvedRouters;\\n mapping(address => bool) approvedForPortalRouters;\\n mapping(address => address) routerRecipients;\\n mapping(address => address) routerOwners;\\n mapping(address => address) proposedRouterOwners;\\n mapping(address => uint256) proposedRouterTimestamp;\\n}\\n\\nstruct AppStorage {\\n //\\n // 0\\n bool initialized;\\n //\\n // Connext\\n //\\n // 1\\n uint256 LIQUIDITY_FEE_NUMERATOR;\\n /**\\n * @notice The local address that is custodying relayer fees\\n */\\n // 2\\n address relayerFeeVault;\\n /**\\n * @notice Nonce for the contract, used to keep unique transfer ids.\\n * @dev Assigned at first interaction (xcall on origin domain).\\n */\\n // 3\\n uint256 nonce;\\n /**\\n * @notice The domain this contract exists on.\\n * @dev Must match the nomad domain, which is distinct from the \\\"chainId\\\".\\n */\\n // 4\\n uint32 domain;\\n /**\\n * @notice Mapping holding the AMMs for swapping in and out of local assets.\\n * @dev Swaps for an adopted asset <> nomad local asset (i.e. POS USDC <> madUSDC on polygon).\\n * This mapping is keyed on the hash of the canonical id + domain for local asset.\\n */\\n // 6\\n mapping(bytes32 => IStableSwap) adoptedToLocalPools;\\n /**\\n * @notice Mapping of whitelisted assets on same domain as contract.\\n * @dev Mapping is keyed on the hash of the canonical id and domain\\n */\\n // 7\\n mapping(bytes32 => bool) approvedAssets;\\n /**\\n * @notice Mapping of liquidity caps of whitelisted assets. If 0, no cap is enforced.\\n * @dev Mapping is keyed on the hash of the canonical id and domain\\n */\\n // 7\\n mapping(bytes32 => uint256) caps;\\n /**\\n * @notice Mapping of adopted to canonical asset information.\\n * @dev If the adopted asset is the native asset, the keyed address will\\n * be the wrapped asset address.\\n */\\n // 8\\n mapping(address => TokenId) adoptedToCanonical;\\n /**\\n * @notice Mapping of representation to canonical asset information.\\n */\\n // 9\\n mapping(address => TokenId) representationToCanonical;\\n /**\\n * @notice Mapping of hash(canonicalId, canonicalDomain) to adopted asset on this domain.\\n * @dev If the adopted asset is the native asset, the stored address will be the\\n * wrapped asset address.\\n */\\n // 10\\n mapping(bytes32 => address) canonicalToAdopted;\\n /**\\n * @notice Mapping of canonical to representation asset information.\\n * @dev If the token is of local origin (meaning it was originanlly deployed on this chain),\\n * this MUST map to address(0).\\n */\\n // 11\\n mapping(bytes32 => address) canonicalToRepresentation;\\n /**\\n * @notice Mapping to track transfer status on destination domain\\n */\\n // 12\\n mapping(bytes32 => DestinationTransferStatus) transferStatus;\\n /**\\n * @notice Mapping holding router address that provided fast liquidity.\\n */\\n // 13\\n mapping(bytes32 => address[]) routedTransfers;\\n /**\\n * @notice Mapping of router to available balance of an asset.\\n * @dev Routers should always store liquidity that they can expect to receive via the bridge on\\n * this domain (the nomad local asset).\\n */\\n // 14\\n mapping(address => mapping(address => uint256)) routerBalances;\\n /**\\n * @notice Mapping of approved relayers\\n * @dev Send relayer fee if msg.sender is approvedRelayer; otherwise revert.\\n */\\n // 15\\n mapping(address => bool) approvedRelayers;\\n /**\\n * @notice The max amount of routers a payment can be routed through.\\n */\\n // 18\\n uint256 maxRoutersPerTransfer;\\n /**\\n * @notice Stores a mapping of transfer id to slippage overrides.\\n */\\n // 20\\n mapping(bytes32 => uint256) slippage;\\n /**\\n * @notice Stores a mapping of remote routers keyed on domains.\\n * @dev Addresses are cast to bytes32.\\n * This mapping is required because the Connext now contains the BridgeRouter and must implement\\n * the remotes interface.\\n */\\n // 21\\n mapping(uint32 => bytes32) remotes;\\n //\\n // ProposedOwnable\\n //\\n // 22\\n address _proposed;\\n // 23\\n uint256 _proposedOwnershipTimestamp;\\n // 24\\n bool _routerWhitelistRemoved;\\n // 25\\n uint256 _routerWhitelistTimestamp;\\n // 26\\n bool _assetWhitelistRemoved;\\n // 27\\n uint256 _assetWhitelistTimestamp;\\n /**\\n * @notice Stores a mapping of address to Roles\\n * @dev returns uint representing the enum Role value\\n */\\n // 28\\n mapping(address => Role) roles;\\n //\\n // RouterFacet\\n //\\n // 29\\n RouterPermissionsManagerInfo routerPermissionInfo;\\n //\\n // ReentrancyGuard\\n //\\n // 30\\n uint256 _status;\\n //\\n // StableSwap\\n //\\n /**\\n * @notice Mapping holding the AMM storages for swapping in and out of local assets\\n * @dev Swaps for an adopted asset <> nomad local asset (i.e. POS USDC <> madUSDC on polygon)\\n * Struct storing data responsible for automatic market maker functionalities. In order to\\n * access this data, this contract uses SwapUtils library. For more details, see SwapUtils.sol.\\n */\\n // 31\\n mapping(bytes32 => SwapUtils.Swap) swapStorages;\\n /**\\n * @notice Maps token address to an index in the pool. Used to prevent duplicate tokens in the pool.\\n * @dev getTokenIndex function also relies on this mapping to retrieve token index.\\n */\\n // 32\\n mapping(bytes32 => mapping(address => uint8)) tokenIndexes;\\n /**\\n * @notice Stores whether or not bribing, AMMs, have been paused.\\n */\\n // 33\\n bool _paused;\\n //\\n // AavePortals\\n //\\n /**\\n * @notice Address of Aave Pool contract.\\n */\\n // 34\\n address aavePool;\\n /**\\n * @notice Fee percentage numerator for using Portal liquidity.\\n * @dev Assumes the same basis points as the liquidity fee.\\n */\\n // 35\\n uint256 aavePortalFeeNumerator;\\n /**\\n * @notice Mapping to store the transfer liquidity amount provided by Aave Portals.\\n */\\n // 36\\n mapping(bytes32 => uint256) portalDebt;\\n /**\\n * @notice Mapping to store the transfer liquidity amount provided by Aave Portals.\\n */\\n // 37\\n mapping(bytes32 => uint256) portalFeeDebt;\\n /**\\n * @notice Mapping of approved sequencers\\n * @dev Sequencer address provided must belong to an approved sequencer in order to call `execute`\\n * for the fast liquidity route.\\n */\\n // 38\\n mapping(address => bool) approvedSequencers;\\n /**\\n * @notice Remote connection manager for xapp.\\n */\\n // 39\\n IConnectorManager xAppConnectionManager;\\n}\\n\\nlibrary LibConnextStorage {\\n function connextStorage() internal pure returns (AppStorage storage ds) {\\n assembly {\\n ds.slot := 0\\n }\\n }\\n}\\n\",\"keccak256\":\"0x24f998cc9edbb1f3f00c7148d18b7ca0d40eaaac7e3f7fa990ffe89bdee8ec32\",\"license\":\"UNLICENSED\"},\"@connext/nxtp-contracts/contracts/core/connext/libraries/LibDiamond.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.15;\\n\\n/******************************************************************************\\\\\\n* Author: Nick Mudge (https://twitter.com/mudgen)\\n* EIP-2535 Diamonds: https://eips.ethereum.org/EIPS/eip-2535\\n/******************************************************************************/\\nimport {IDiamondCut} from \\\"../interfaces/IDiamondCut.sol\\\";\\n\\n// Remember to add the loupe functions from DiamondLoupeFacet to the diamond.\\n// The loupe functions are required by the EIP2535 Diamonds standard\\n\\nlibrary LibDiamond {\\n bytes32 constant DIAMOND_STORAGE_POSITION = keccak256(\\\"diamond.standard.diamond.storage\\\");\\n\\n struct FacetAddressAndPosition {\\n address facetAddress;\\n uint96 functionSelectorPosition; // position in facetFunctionSelectors.functionSelectors array\\n }\\n\\n struct FacetFunctionSelectors {\\n bytes4[] functionSelectors;\\n uint256 facetAddressPosition; // position of facetAddress in facetAddresses array\\n }\\n\\n struct DiamondStorage {\\n // maps function selector to the facet address and\\n // the position of the selector in the facetFunctionSelectors.selectors array\\n mapping(bytes4 => FacetAddressAndPosition) selectorToFacetAndPosition;\\n // maps facet addresses to function selectors\\n mapping(address => FacetFunctionSelectors) facetFunctionSelectors;\\n // facet addresses\\n address[] facetAddresses;\\n // Used to query if a contract implements an interface.\\n // Used to implement ERC-165.\\n mapping(bytes4 => bool) supportedInterfaces;\\n // owner of the contract\\n address contractOwner;\\n // hash of proposed facets => acceptance time\\n mapping(bytes32 => uint256) acceptanceTimes;\\n // acceptance delay for upgrading facets\\n uint256 acceptanceDelay;\\n }\\n\\n function diamondStorage() internal pure returns (DiamondStorage storage ds) {\\n bytes32 position = DIAMOND_STORAGE_POSITION;\\n assembly {\\n ds.slot := position\\n }\\n }\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n function setContractOwner(address _newOwner) internal {\\n DiamondStorage storage ds = diamondStorage();\\n address previousOwner = ds.contractOwner;\\n ds.contractOwner = _newOwner;\\n emit OwnershipTransferred(previousOwner, _newOwner);\\n }\\n\\n function contractOwner() internal view returns (address contractOwner_) {\\n contractOwner_ = diamondStorage().contractOwner;\\n }\\n\\n function acceptanceDelay() internal view returns (uint256) {\\n return diamondStorage().acceptanceDelay;\\n }\\n\\n function acceptanceTime(bytes32 _key) internal view returns (uint256) {\\n return diamondStorage().acceptanceTimes[_key];\\n }\\n\\n function enforceIsContractOwner() internal view {\\n require(msg.sender == diamondStorage().contractOwner, \\\"LibDiamond: !contract owner\\\");\\n }\\n\\n event DiamondCutProposed(IDiamondCut.FacetCut[] _diamondCut, address _init, bytes _calldata, uint256 deadline);\\n\\n function proposeDiamondCut(\\n IDiamondCut.FacetCut[] memory _diamondCut,\\n address _init,\\n bytes memory _calldata\\n ) internal {\\n DiamondStorage storage ds = diamondStorage();\\n uint256 acceptance = block.timestamp + ds.acceptanceDelay;\\n ds.acceptanceTimes[keccak256(abi.encode(_diamondCut, _init, _calldata))] = acceptance;\\n emit DiamondCutProposed(_diamondCut, _init, _calldata, acceptance);\\n }\\n\\n event DiamondCutRescinded(IDiamondCut.FacetCut[] _diamondCut, address _init, bytes _calldata);\\n\\n function rescindDiamondCut(\\n IDiamondCut.FacetCut[] memory _diamondCut,\\n address _init,\\n bytes memory _calldata\\n ) internal {\\n // NOTE: you can always rescind a proposed facet cut as the owner, even if outside of the validity\\n // period or befor the delay elpases\\n diamondStorage().acceptanceTimes[keccak256(abi.encode(_diamondCut, _init, _calldata))] = 0;\\n emit DiamondCutRescinded(_diamondCut, _init, _calldata);\\n }\\n\\n event DiamondCut(IDiamondCut.FacetCut[] _diamondCut, address _init, bytes _calldata);\\n\\n // Internal function version of diamondCut\\n function diamondCut(\\n IDiamondCut.FacetCut[] memory _diamondCut,\\n address _init,\\n bytes memory _calldata\\n ) internal {\\n DiamondStorage storage ds = diamondStorage();\\n if (ds.facetAddresses.length != 0) {\\n uint256 time = ds.acceptanceTimes[keccak256(abi.encode(_diamondCut, _init, _calldata))];\\n require(time != 0 && time <= block.timestamp, \\\"LibDiamond: delay not elapsed\\\");\\n } // Otherwise, this is the first instance of deployment and it can be set automatically\\n for (uint256 facetIndex; facetIndex < _diamondCut.length; facetIndex++) {\\n IDiamondCut.FacetCutAction action = _diamondCut[facetIndex].action;\\n if (action == IDiamondCut.FacetCutAction.Add) {\\n addFunctions(_diamondCut[facetIndex].facetAddress, _diamondCut[facetIndex].functionSelectors);\\n } else if (action == IDiamondCut.FacetCutAction.Replace) {\\n replaceFunctions(_diamondCut[facetIndex].facetAddress, _diamondCut[facetIndex].functionSelectors);\\n } else if (action == IDiamondCut.FacetCutAction.Remove) {\\n removeFunctions(_diamondCut[facetIndex].facetAddress, _diamondCut[facetIndex].functionSelectors);\\n } else {\\n revert(\\\"LibDiamondCut: Incorrect FacetCutAction\\\");\\n }\\n }\\n emit DiamondCut(_diamondCut, _init, _calldata);\\n initializeDiamondCut(_init, _calldata);\\n }\\n\\n function addFunctions(address _facetAddress, bytes4[] memory _functionSelectors) internal {\\n require(_functionSelectors.length != 0, \\\"LibDiamondCut: No selectors in facet to cut\\\");\\n DiamondStorage storage ds = diamondStorage();\\n require(_facetAddress != address(0), \\\"LibDiamondCut: Add facet can't be address(0)\\\");\\n uint96 selectorPosition = uint96(ds.facetFunctionSelectors[_facetAddress].functionSelectors.length);\\n // add new facet address if it does not exist\\n if (selectorPosition == 0) {\\n addFacet(ds, _facetAddress);\\n }\\n for (uint256 selectorIndex; selectorIndex < _functionSelectors.length; selectorIndex++) {\\n bytes4 selector = _functionSelectors[selectorIndex];\\n address oldFacetAddress = ds.selectorToFacetAndPosition[selector].facetAddress;\\n require(oldFacetAddress == address(0), \\\"LibDiamondCut: Can't add function that already exists\\\");\\n addFunction(ds, selector, selectorPosition, _facetAddress);\\n selectorPosition++;\\n }\\n }\\n\\n function replaceFunctions(address _facetAddress, bytes4[] memory _functionSelectors) internal {\\n require(_functionSelectors.length != 0, \\\"LibDiamondCut: No selectors in facet to cut\\\");\\n DiamondStorage storage ds = diamondStorage();\\n require(_facetAddress != address(0), \\\"LibDiamondCut: Add facet can't be address(0)\\\");\\n uint96 selectorPosition = uint96(ds.facetFunctionSelectors[_facetAddress].functionSelectors.length);\\n // add new facet address if it does not exist\\n if (selectorPosition == 0) {\\n addFacet(ds, _facetAddress);\\n }\\n for (uint256 selectorIndex; selectorIndex < _functionSelectors.length; selectorIndex++) {\\n bytes4 selector = _functionSelectors[selectorIndex];\\n address oldFacetAddress = ds.selectorToFacetAndPosition[selector].facetAddress;\\n require(oldFacetAddress != _facetAddress, \\\"LibDiamondCut: Can't replace function with same function\\\");\\n removeFunction(ds, oldFacetAddress, selector);\\n addFunction(ds, selector, selectorPosition, _facetAddress);\\n selectorPosition++;\\n }\\n }\\n\\n function removeFunctions(address _facetAddress, bytes4[] memory _functionSelectors) internal {\\n require(_functionSelectors.length != 0, \\\"LibDiamondCut: No selectors in facet to cut\\\");\\n DiamondStorage storage ds = diamondStorage();\\n // if function does not exist then do nothing and return\\n require(_facetAddress == address(0), \\\"LibDiamondCut: Remove facet address must be address(0)\\\");\\n for (uint256 selectorIndex; selectorIndex < _functionSelectors.length; selectorIndex++) {\\n bytes4 selector = _functionSelectors[selectorIndex];\\n address oldFacetAddress = ds.selectorToFacetAndPosition[selector].facetAddress;\\n removeFunction(ds, oldFacetAddress, selector);\\n }\\n }\\n\\n function addFacet(DiamondStorage storage ds, address _facetAddress) internal {\\n enforceHasContractCode(_facetAddress, \\\"LibDiamondCut: New facet has no code\\\");\\n ds.facetFunctionSelectors[_facetAddress].facetAddressPosition = ds.facetAddresses.length;\\n ds.facetAddresses.push(_facetAddress);\\n }\\n\\n function addFunction(\\n DiamondStorage storage ds,\\n bytes4 _selector,\\n uint96 _selectorPosition,\\n address _facetAddress\\n ) internal {\\n ds.selectorToFacetAndPosition[_selector].functionSelectorPosition = _selectorPosition;\\n ds.facetFunctionSelectors[_facetAddress].functionSelectors.push(_selector);\\n ds.selectorToFacetAndPosition[_selector].facetAddress = _facetAddress;\\n }\\n\\n function removeFunction(\\n DiamondStorage storage ds,\\n address _facetAddress,\\n bytes4 _selector\\n ) internal {\\n require(_facetAddress != address(0), \\\"LibDiamondCut: Can't remove function that doesn't exist\\\");\\n // an immutable function is a function defined directly in a diamond\\n require(_facetAddress != address(this), \\\"LibDiamondCut: Can't remove immutable function\\\");\\n // replace selector with last selector, then delete last selector\\n uint256 selectorPosition = ds.selectorToFacetAndPosition[_selector].functionSelectorPosition;\\n uint256 lastSelectorPosition = ds.facetFunctionSelectors[_facetAddress].functionSelectors.length - 1;\\n // if not the same then replace _selector with lastSelector\\n if (selectorPosition != lastSelectorPosition) {\\n bytes4 lastSelector = ds.facetFunctionSelectors[_facetAddress].functionSelectors[lastSelectorPosition];\\n ds.facetFunctionSelectors[_facetAddress].functionSelectors[selectorPosition] = lastSelector;\\n ds.selectorToFacetAndPosition[lastSelector].functionSelectorPosition = uint96(selectorPosition);\\n }\\n // delete the last selector\\n ds.facetFunctionSelectors[_facetAddress].functionSelectors.pop();\\n delete ds.selectorToFacetAndPosition[_selector];\\n\\n // if no more selectors for facet address then delete the facet address\\n if (lastSelectorPosition == 0) {\\n // replace facet address with last facet address and delete last facet address\\n uint256 lastFacetAddressPosition = ds.facetAddresses.length - 1;\\n uint256 facetAddressPosition = ds.facetFunctionSelectors[_facetAddress].facetAddressPosition;\\n if (facetAddressPosition != lastFacetAddressPosition) {\\n address lastFacetAddress = ds.facetAddresses[lastFacetAddressPosition];\\n ds.facetAddresses[facetAddressPosition] = lastFacetAddress;\\n ds.facetFunctionSelectors[lastFacetAddress].facetAddressPosition = facetAddressPosition;\\n }\\n ds.facetAddresses.pop();\\n delete ds.facetFunctionSelectors[_facetAddress].facetAddressPosition;\\n }\\n }\\n\\n function initializeDiamondCut(address _init, bytes memory _calldata) internal {\\n if (_init == address(0)) {\\n require(_calldata.length == 0, \\\"LibDiamondCut: _init is address(0) but_calldata is not empty\\\");\\n } else {\\n require(_calldata.length != 0, \\\"LibDiamondCut: _calldata is empty but _init is not address(0)\\\");\\n if (_init != address(this)) {\\n enforceHasContractCode(_init, \\\"LibDiamondCut: _init address has no code\\\");\\n }\\n (bool success, bytes memory error) = _init.delegatecall(_calldata);\\n if (!success) {\\n if (error.length != 0) {\\n // bubble up the error\\n revert(string(error));\\n } else {\\n revert(\\\"LibDiamondCut: _init function reverted\\\");\\n }\\n }\\n }\\n }\\n\\n function enforceHasContractCode(address _contract, string memory _errorMessage) internal view {\\n uint256 contractSize;\\n assembly {\\n contractSize := extcodesize(_contract)\\n }\\n require(contractSize != 0, _errorMessage);\\n }\\n}\\n\",\"keccak256\":\"0x0ca55de8a7f4e2256b8b7a5e9ae6cca6d6ff850bbd9fd79542dfc4236871c6d8\",\"license\":\"MIT\"},\"@connext/nxtp-contracts/contracts/core/connext/libraries/MathUtils.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSED\\npragma solidity 0.8.15;\\n\\n/**\\n * @title MathUtils library\\n * @notice A library to be used in conjunction with SafeMath. Contains functions for calculating\\n * differences between two uint256.\\n */\\nlibrary MathUtils {\\n /**\\n * @notice Compares a and b and returns true if the difference between a and b\\n * is less than 1 or equal to each other.\\n * @param a uint256 to compare with\\n * @param b uint256 to compare with\\n * @return True if the difference between a and b is less than 1 or equal,\\n * otherwise return false\\n */\\n function within1(uint256 a, uint256 b) internal pure returns (bool) {\\n return (difference(a, b) <= 1);\\n }\\n\\n /**\\n * @notice Calculates absolute difference between a and b\\n * @param a uint256 to compare with\\n * @param b uint256 to compare with\\n * @return Difference between a and b\\n */\\n function difference(uint256 a, uint256 b) internal pure returns (uint256) {\\n if (a > b) {\\n return a - b;\\n }\\n return b - a;\\n }\\n}\\n\",\"keccak256\":\"0xc0e55e78b6b5fec92fbf16f77f10103450f012394d995c8ace507f1abae29371\",\"license\":\"UNLICENSED\"},\"@connext/nxtp-contracts/contracts/core/connext/libraries/SwapUtils.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSED\\npragma solidity 0.8.15;\\n\\nimport {SafeERC20, IERC20} from \\\"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\\\";\\n\\nimport {LPToken} from \\\"../helpers/LPToken.sol\\\";\\n\\nimport {AmplificationUtils} from \\\"./AmplificationUtils.sol\\\";\\nimport {MathUtils} from \\\"./MathUtils.sol\\\";\\n\\n/**\\n * @title SwapUtils library\\n * @notice A library to be used within Swap.sol. Contains functions responsible for custody and AMM functionalities.\\n * @dev Contracts relying on this library must initialize SwapUtils.Swap struct then use this library\\n * for SwapUtils.Swap struct. Note that this library contains both functions called by users and admins.\\n * Admin functions should be protected within contracts using this library.\\n */\\nlibrary SwapUtils {\\n using SafeERC20 for IERC20;\\n using MathUtils for uint256;\\n\\n /*** EVENTS ***/\\n\\n event TokenSwap(\\n bytes32 indexed key,\\n address indexed buyer,\\n uint256 tokensSold,\\n uint256 tokensBought,\\n uint128 soldId,\\n uint128 boughtId\\n );\\n event AddLiquidity(\\n bytes32 indexed key,\\n address indexed provider,\\n uint256[] tokenAmounts,\\n uint256[] fees,\\n uint256 invariant,\\n uint256 lpTokenSupply\\n );\\n event RemoveLiquidity(bytes32 indexed key, address indexed provider, uint256[] tokenAmounts, uint256 lpTokenSupply);\\n event RemoveLiquidityOne(\\n bytes32 indexed key,\\n address indexed provider,\\n uint256 lpTokenAmount,\\n uint256 lpTokenSupply,\\n uint256 boughtId,\\n uint256 tokensBought\\n );\\n event RemoveLiquidityImbalance(\\n bytes32 indexed key,\\n address indexed provider,\\n uint256[] tokenAmounts,\\n uint256[] fees,\\n uint256 invariant,\\n uint256 lpTokenSupply\\n );\\n event NewAdminFee(bytes32 indexed key, uint256 newAdminFee);\\n event NewSwapFee(bytes32 indexed key, uint256 newSwapFee);\\n\\n struct Swap {\\n // variables around the ramp management of A,\\n // the amplification coefficient * n * (n - 1)\\n // see https://www.curve.fi/stableswap-paper.pdf for details\\n bytes32 key;\\n uint256 initialA;\\n uint256 futureA;\\n uint256 initialATime;\\n uint256 futureATime;\\n // fee calculation\\n uint256 swapFee;\\n uint256 adminFee;\\n LPToken lpToken;\\n // contract references for all tokens being pooled\\n IERC20[] pooledTokens;\\n // multipliers for each pooled token's precision to get to POOL_PRECISION_DECIMALS\\n // for example, TBTC has 18 decimals, so the multiplier should be 1. WBTC\\n // has 8, so the multiplier should be 10 ** 18 / 10 ** 8 => 10 ** 10\\n uint256[] tokenPrecisionMultipliers;\\n // the pool balance of each token, in the token's precision\\n // the contract's actual token balance might differ\\n uint256[] balances;\\n // the admin fee balance of each token, in the token's precision\\n uint256[] adminFees;\\n }\\n\\n // Struct storing variables used in calculations in the\\n // calculateWithdrawOneTokenDY function to avoid stack too deep errors\\n struct CalculateWithdrawOneTokenDYInfo {\\n uint256 d0;\\n uint256 d1;\\n uint256 newY;\\n uint256 feePerToken;\\n uint256 preciseA;\\n }\\n\\n // Struct storing variables used in calculations in the\\n // {add,remove}Liquidity functions to avoid stack too deep errors\\n struct ManageLiquidityInfo {\\n uint256 d0;\\n uint256 d1;\\n uint256 d2;\\n uint256 preciseA;\\n LPToken lpToken;\\n uint256 totalSupply;\\n uint256[] balances;\\n uint256[] multipliers;\\n }\\n\\n // the precision all pools tokens will be converted to\\n uint8 internal constant POOL_PRECISION_DECIMALS = 18;\\n\\n // the denominator used to calculate admin and LP fees. For example, an\\n // LP fee might be something like tradeAmount.mul(fee).div(FEE_DENOMINATOR)\\n uint256 internal constant FEE_DENOMINATOR = 1e10;\\n\\n // Max swap fee is 1% or 100bps of each swap\\n uint256 internal constant MAX_SWAP_FEE = 1e8;\\n\\n // Max adminFee is 100% of the swapFee\\n // adminFee does not add additional fee on top of swapFee\\n // Instead it takes a certain % of the swapFee. Therefore it has no impact on the\\n // users but only on the earnings of LPs\\n uint256 internal constant MAX_ADMIN_FEE = 1e10;\\n\\n // Constant value used as max loop limit\\n uint256 internal constant MAX_LOOP_LIMIT = 256;\\n\\n /*** VIEW & PURE FUNCTIONS ***/\\n\\n function _getAPrecise(Swap storage self) private view returns (uint256) {\\n return AmplificationUtils._getAPrecise(self);\\n }\\n\\n /**\\n * @notice Calculate the dy, the amount of selected token that user receives and\\n * the fee of withdrawing in one token\\n * @param tokenAmount the amount to withdraw in the pool's precision\\n * @param tokenIndex which token will be withdrawn\\n * @param self Swap struct to read from\\n * @return the amount of token user will receive\\n */\\n function calculateWithdrawOneToken(\\n Swap storage self,\\n uint256 tokenAmount,\\n uint8 tokenIndex\\n ) internal view returns (uint256) {\\n (uint256 availableTokenAmount, ) = _calculateWithdrawOneToken(\\n self,\\n tokenAmount,\\n tokenIndex,\\n self.lpToken.totalSupply()\\n );\\n return availableTokenAmount;\\n }\\n\\n function _calculateWithdrawOneToken(\\n Swap storage self,\\n uint256 tokenAmount,\\n uint8 tokenIndex,\\n uint256 totalSupply\\n ) private view returns (uint256, uint256) {\\n uint256 dy;\\n uint256 newY;\\n uint256 currentY;\\n\\n (dy, newY, currentY) = calculateWithdrawOneTokenDY(self, tokenIndex, tokenAmount, totalSupply);\\n\\n // dy_0 (without fees)\\n // dy, dy_0 - dy\\n\\n uint256 dySwapFee = (currentY - newY) / self.tokenPrecisionMultipliers[tokenIndex] - dy;\\n\\n return (dy, dySwapFee);\\n }\\n\\n /**\\n * @notice Calculate the dy of withdrawing in one token\\n * @param self Swap struct to read from\\n * @param tokenIndex which token will be withdrawn\\n * @param tokenAmount the amount to withdraw in the pools precision\\n * @return the d and the new y after withdrawing one token\\n */\\n function calculateWithdrawOneTokenDY(\\n Swap storage self,\\n uint8 tokenIndex,\\n uint256 tokenAmount,\\n uint256 totalSupply\\n )\\n internal\\n view\\n returns (\\n uint256,\\n uint256,\\n uint256\\n )\\n {\\n // Get the current D, then solve the stableswap invariant\\n // y_i for D - tokenAmount\\n uint256[] memory xp = _xp(self);\\n\\n require(tokenIndex < xp.length, \\\"index out of range\\\");\\n\\n CalculateWithdrawOneTokenDYInfo memory v = CalculateWithdrawOneTokenDYInfo(0, 0, 0, 0, 0);\\n v.preciseA = _getAPrecise(self);\\n v.d0 = getD(xp, v.preciseA);\\n v.d1 = v.d0 - ((tokenAmount * v.d0) / totalSupply);\\n\\n require(tokenAmount <= xp[tokenIndex], \\\"exceeds available\\\");\\n\\n v.newY = getYD(v.preciseA, tokenIndex, xp, v.d1);\\n\\n uint256[] memory xpReduced = new uint256[](xp.length);\\n\\n v.feePerToken = _feePerToken(self.swapFee, xp.length);\\n // TODO: Set a length variable (at top) instead of reading xp.length on each loop.\\n for (uint256 i; i < xp.length; ) {\\n uint256 xpi = xp[i];\\n // if i == tokenIndex, dxExpected = xp[i] * d1 / d0 - newY\\n // else dxExpected = xp[i] - (xp[i] * d1 / d0)\\n // xpReduced[i] -= dxExpected * fee / FEE_DENOMINATOR\\n xpReduced[i] =\\n xpi -\\n ((((i == tokenIndex) ? ((xpi * v.d1) / v.d0 - v.newY) : (xpi - (xpi * v.d1) / v.d0)) * v.feePerToken) /\\n FEE_DENOMINATOR);\\n\\n unchecked {\\n ++i;\\n }\\n }\\n\\n uint256 dy = xpReduced[tokenIndex] - getYD(v.preciseA, tokenIndex, xpReduced, v.d1);\\n dy = (dy - 1) / (self.tokenPrecisionMultipliers[tokenIndex]);\\n\\n return (dy, v.newY, xp[tokenIndex]);\\n }\\n\\n /**\\n * @notice Calculate the price of a token in the pool with given\\n * precision-adjusted balances and a particular D.\\n *\\n * @dev This is accomplished via solving the invariant iteratively.\\n * See the StableSwap paper and Curve.fi implementation for further details.\\n *\\n * x_1**2 + x1 * (sum' - (A*n**n - 1) * D / (A * n**n)) = D ** (n + 1) / (n ** (2 * n) * prod' * A)\\n * x_1**2 + b*x_1 = c\\n * x_1 = (x_1**2 + c) / (2*x_1 + b)\\n *\\n * @param a the amplification coefficient * n * (n - 1). See the StableSwap paper for details.\\n * @param tokenIndex Index of token we are calculating for.\\n * @param xp a precision-adjusted set of pool balances. Array should be\\n * the same cardinality as the pool.\\n * @param d the stableswap invariant\\n * @return the price of the token, in the same precision as in xp\\n */\\n function getYD(\\n uint256 a,\\n uint8 tokenIndex,\\n uint256[] memory xp,\\n uint256 d\\n ) internal pure returns (uint256) {\\n uint256 numTokens = xp.length;\\n require(tokenIndex < numTokens, \\\"Token not found\\\");\\n\\n uint256 c = d;\\n uint256 s;\\n uint256 nA = a * numTokens;\\n\\n for (uint256 i; i < numTokens; ) {\\n if (i != tokenIndex) {\\n s += xp[i];\\n c = (c * d) / (xp[i] * numTokens);\\n // If we were to protect the division loss we would have to keep the denominator separate\\n // and divide at the end. However this leads to overflow with large numTokens or/and D.\\n // c = c * D * D * D * ... overflow!\\n }\\n\\n unchecked {\\n ++i;\\n }\\n }\\n c = (c * d * AmplificationUtils.A_PRECISION) / (nA * numTokens);\\n\\n uint256 b = s + ((d * AmplificationUtils.A_PRECISION) / nA);\\n uint256 yPrev;\\n uint256 y = d;\\n for (uint256 i; i < MAX_LOOP_LIMIT; ) {\\n yPrev = y;\\n y = ((y * y) + c) / ((y * 2) + b - d);\\n if (y.within1(yPrev)) {\\n return y;\\n }\\n\\n unchecked {\\n ++i;\\n }\\n }\\n revert(\\\"Approximation did not converge\\\");\\n }\\n\\n /**\\n * @notice Get D, the StableSwap invariant, based on a set of balances and a particular A.\\n * @param xp a precision-adjusted set of pool balances. Array should be the same cardinality\\n * as the pool.\\n * @param a the amplification coefficient * n * (n - 1) in A_PRECISION.\\n * See the StableSwap paper for details\\n * @return the invariant, at the precision of the pool\\n */\\n function getD(uint256[] memory xp, uint256 a) internal pure returns (uint256) {\\n uint256 numTokens = xp.length;\\n uint256 s;\\n for (uint256 i; i < numTokens; ) {\\n s += xp[i];\\n\\n unchecked {\\n ++i;\\n }\\n }\\n if (s == 0) {\\n return 0;\\n }\\n\\n uint256 prevD;\\n uint256 d = s;\\n uint256 nA = a * numTokens;\\n\\n for (uint256 i; i < MAX_LOOP_LIMIT; ) {\\n uint256 dP = d;\\n for (uint256 j; j < numTokens; ) {\\n dP = (dP * d) / (xp[j] * numTokens);\\n // If we were to protect the division loss we would have to keep the denominator separate\\n // and divide at the end. However this leads to overflow with large numTokens or/and D.\\n // dP = dP * D * D * D * ... overflow!\\n\\n unchecked {\\n ++j;\\n }\\n }\\n prevD = d;\\n d =\\n (((nA * s) / AmplificationUtils.A_PRECISION + dP * numTokens) * d) /\\n ((((nA - AmplificationUtils.A_PRECISION) * d) / AmplificationUtils.A_PRECISION + (numTokens + 1) * dP));\\n if (d.within1(prevD)) {\\n return d;\\n }\\n\\n unchecked {\\n ++i;\\n }\\n }\\n\\n // Convergence should occur in 4 loops or less. If this is reached, there may be something wrong\\n // with the pool. If this were to occur repeatedly, LPs should withdraw via `removeLiquidity()`\\n // function which does not rely on D.\\n revert(\\\"D does not converge\\\");\\n }\\n\\n /**\\n * @notice Given a set of balances and precision multipliers, return the\\n * precision-adjusted balances.\\n *\\n * @param balances an array of token balances, in their native precisions.\\n * These should generally correspond with pooled tokens.\\n *\\n * @param precisionMultipliers an array of multipliers, corresponding to\\n * the amounts in the balances array. When multiplied together they\\n * should yield amounts at the pool's precision.\\n *\\n * @return an array of amounts \\\"scaled\\\" to the pool's precision\\n */\\n function _xp(uint256[] memory balances, uint256[] memory precisionMultipliers)\\n internal\\n pure\\n returns (uint256[] memory)\\n {\\n uint256 numTokens = balances.length;\\n require(numTokens == precisionMultipliers.length, \\\"mismatch multipliers\\\");\\n uint256[] memory xp = new uint256[](numTokens);\\n for (uint256 i; i < numTokens; ) {\\n xp[i] = balances[i] * precisionMultipliers[i];\\n\\n unchecked {\\n ++i;\\n }\\n }\\n return xp;\\n }\\n\\n /**\\n * @notice Return the precision-adjusted balances of all tokens in the pool\\n * @param self Swap struct to read from\\n * @return the pool balances \\\"scaled\\\" to the pool's precision, allowing\\n * them to be more easily compared.\\n */\\n function _xp(Swap storage self) internal view returns (uint256[] memory) {\\n return _xp(self.balances, self.tokenPrecisionMultipliers);\\n }\\n\\n /**\\n * @notice Get the virtual price, to help calculate profit\\n * @param self Swap struct to read from\\n * @return the virtual price, scaled to precision of POOL_PRECISION_DECIMALS\\n */\\n function getVirtualPrice(Swap storage self) internal view returns (uint256) {\\n uint256 d = getD(_xp(self), _getAPrecise(self));\\n LPToken lpToken = self.lpToken;\\n uint256 supply = lpToken.totalSupply();\\n if (supply != 0) {\\n return (d * (10**uint256(POOL_PRECISION_DECIMALS))) / supply;\\n }\\n return 0;\\n }\\n\\n /**\\n * @notice Calculate the new balances of the tokens given the indexes of the token\\n * that is swapped from (FROM) and the token that is swapped to (TO).\\n * This function is used as a helper function to calculate how much TO token\\n * the user should receive on swap.\\n *\\n * @param preciseA precise form of amplification coefficient\\n * @param tokenIndexFrom index of FROM token\\n * @param tokenIndexTo index of TO token\\n * @param x the new total amount of FROM token\\n * @param xp balances of the tokens in the pool\\n * @return the amount of TO token that should remain in the pool\\n */\\n function getY(\\n uint256 preciseA,\\n uint8 tokenIndexFrom,\\n uint8 tokenIndexTo,\\n uint256 x,\\n uint256[] memory xp\\n ) internal pure returns (uint256) {\\n uint256 numTokens = xp.length;\\n require(tokenIndexFrom != tokenIndexTo, \\\"compare token to itself\\\");\\n require(tokenIndexFrom < numTokens && tokenIndexTo < numTokens, \\\"token not found\\\");\\n\\n uint256 d = getD(xp, preciseA);\\n uint256 c = d;\\n uint256 s;\\n uint256 nA = numTokens * preciseA;\\n\\n uint256 _x;\\n for (uint256 i; i < numTokens; ) {\\n if (i == tokenIndexFrom) {\\n _x = x;\\n } else if (i != tokenIndexTo) {\\n _x = xp[i];\\n } else {\\n unchecked {\\n ++i;\\n }\\n continue;\\n }\\n s += _x;\\n c = (c * d) / (_x * numTokens);\\n // If we were to protect the division loss we would have to keep the denominator separate\\n // and divide at the end. However this leads to overflow with large numTokens or/and D.\\n // c = c * D * D * D * ... overflow!\\n\\n unchecked {\\n ++i;\\n }\\n }\\n c = (c * d * AmplificationUtils.A_PRECISION) / (nA * numTokens);\\n uint256 b = s + ((d * AmplificationUtils.A_PRECISION) / nA);\\n uint256 yPrev;\\n uint256 y = d;\\n\\n // iterative approximation\\n for (uint256 i; i < MAX_LOOP_LIMIT; ) {\\n yPrev = y;\\n y = ((y * y) + c) / ((y * 2) + b - d);\\n if (y.within1(yPrev)) {\\n return y;\\n }\\n\\n unchecked {\\n ++i;\\n }\\n }\\n revert(\\\"Approximation did not converge\\\");\\n }\\n\\n /**\\n * @notice Externally calculates a swap between two tokens.\\n * @param self Swap struct to read from\\n * @param tokenIndexFrom the token to sell\\n * @param tokenIndexTo the token to buy\\n * @param dx the number of tokens to sell. If the token charges a fee on transfers,\\n * use the amount that gets transferred after the fee.\\n * @return dy the number of tokens the user will get\\n */\\n function calculateSwap(\\n Swap storage self,\\n uint8 tokenIndexFrom,\\n uint8 tokenIndexTo,\\n uint256 dx\\n ) internal view returns (uint256 dy) {\\n (dy, ) = _calculateSwap(self, tokenIndexFrom, tokenIndexTo, dx, self.balances);\\n }\\n\\n /**\\n * @notice Externally calculates a swap between two tokens.\\n * @param self Swap struct to read from\\n * @param tokenIndexFrom the token to sell\\n * @param tokenIndexTo the token to buy\\n * @param dy the number of tokens to buy.\\n * @return dx the number of tokens the user have to transfer + fee\\n */\\n function calculateSwapInv(\\n Swap storage self,\\n uint8 tokenIndexFrom,\\n uint8 tokenIndexTo,\\n uint256 dy\\n ) internal view returns (uint256 dx) {\\n (dx, ) = _calculateSwapInv(self, tokenIndexFrom, tokenIndexTo, dy, self.balances);\\n }\\n\\n /**\\n * @notice Internally calculates a swap between two tokens.\\n *\\n * @dev The caller is expected to transfer the actual amounts (dx and dy)\\n * using the token contracts.\\n *\\n * @param self Swap struct to read from\\n * @param tokenIndexFrom the token to sell\\n * @param tokenIndexTo the token to buy\\n * @param dx the number of tokens to sell. If the token charges a fee on transfers,\\n * use the amount that gets transferred after the fee.\\n * @return dy the number of tokens the user will get in the token's precision. ex WBTC -> 8\\n * @return dyFee the associated fee in multiplied precision (POOL_PRECISION_DECIMALS)\\n */\\n function _calculateSwap(\\n Swap storage self,\\n uint8 tokenIndexFrom,\\n uint8 tokenIndexTo,\\n uint256 dx,\\n uint256[] memory balances\\n ) internal view returns (uint256 dy, uint256 dyFee) {\\n uint256[] memory multipliers = self.tokenPrecisionMultipliers;\\n uint256[] memory xp = _xp(balances, multipliers);\\n require(tokenIndexFrom < xp.length && tokenIndexTo < xp.length, \\\"index out of range\\\");\\n uint256 x = dx * multipliers[tokenIndexFrom] + xp[tokenIndexFrom];\\n uint256 y = getY(_getAPrecise(self), tokenIndexFrom, tokenIndexTo, x, xp);\\n dy = xp[tokenIndexTo] - y - 1;\\n dyFee = (dy * self.swapFee) / FEE_DENOMINATOR;\\n dy = (dy - dyFee) / multipliers[tokenIndexTo];\\n }\\n\\n /**\\n * @notice Internally calculates a swap between two tokens.\\n *\\n * @dev The caller is expected to transfer the actual amounts (dx and dy)\\n * using the token contracts.\\n *\\n * @param self Swap struct to read from\\n * @param tokenIndexFrom the token to sell\\n * @param tokenIndexTo the token to buy\\n * @param dy the number of tokens to buy. If the token charges a fee on transfers,\\n * use the amount that gets transferred after the fee.\\n * @return dx the number of tokens the user have to deposit in the token's precision. ex WBTC -> 8\\n * @return dxFee the associated fee in multiplied precision (POOL_PRECISION_DECIMALS)\\n */\\n function _calculateSwapInv(\\n Swap storage self,\\n uint8 tokenIndexFrom,\\n uint8 tokenIndexTo,\\n uint256 dy,\\n uint256[] memory balances\\n ) internal view returns (uint256 dx, uint256 dxFee) {\\n require(tokenIndexFrom != tokenIndexTo, \\\"compare token to itself\\\");\\n uint256[] memory multipliers = self.tokenPrecisionMultipliers;\\n uint256[] memory xp = _xp(balances, multipliers);\\n require(tokenIndexFrom < xp.length && tokenIndexTo < xp.length, \\\"index out of range\\\");\\n\\n uint256 a = _getAPrecise(self);\\n uint256 d0 = getD(xp, a);\\n\\n xp[tokenIndexTo] = xp[tokenIndexTo] - (dy * multipliers[tokenIndexTo]);\\n uint256 x = getYD(a, tokenIndexFrom, xp, d0);\\n dx = x - xp[tokenIndexFrom] + 1;\\n dxFee = (dx * self.swapFee) / FEE_DENOMINATOR;\\n dx = (dx + dxFee) / multipliers[tokenIndexFrom];\\n }\\n\\n /**\\n * @notice A simple method to calculate amount of each underlying\\n * tokens that is returned upon burning given amount of\\n * LP tokens\\n *\\n * @param amount the amount of LP tokens that would to be burned on\\n * withdrawal\\n * @return array of amounts of tokens user will receive\\n */\\n function calculateRemoveLiquidity(Swap storage self, uint256 amount) internal view returns (uint256[] memory) {\\n return _calculateRemoveLiquidity(self.balances, amount, self.lpToken.totalSupply());\\n }\\n\\n function _calculateRemoveLiquidity(\\n uint256[] memory balances,\\n uint256 amount,\\n uint256 totalSupply\\n ) internal pure returns (uint256[] memory) {\\n require(amount <= totalSupply, \\\"exceed total supply\\\");\\n\\n uint256 numBalances = balances.length;\\n uint256[] memory amounts = new uint256[](numBalances);\\n\\n for (uint256 i; i < numBalances; ) {\\n amounts[i] = (balances[i] * amount) / totalSupply;\\n\\n unchecked {\\n ++i;\\n }\\n }\\n return amounts;\\n }\\n\\n /**\\n * @notice A simple method to calculate prices from deposits or\\n * withdrawals, excluding fees but including slippage. This is\\n * helpful as an input into the various \\\"min\\\" parameters on calls\\n * to fight front-running\\n *\\n * @dev This shouldn't be used outside frontends for user estimates.\\n *\\n * @param self Swap struct to read from\\n * @param amounts an array of token amounts to deposit or withdrawal,\\n * corresponding to pooledTokens. The amount should be in each\\n * pooled token's native precision. If a token charges a fee on transfers,\\n * use the amount that gets transferred after the fee.\\n * @param deposit whether this is a deposit or a withdrawal\\n * @return if deposit was true, total amount of lp token that will be minted and if\\n * deposit was false, total amount of lp token that will be burned\\n */\\n function calculateTokenAmount(\\n Swap storage self,\\n uint256[] calldata amounts,\\n bool deposit\\n ) internal view returns (uint256) {\\n uint256 a = _getAPrecise(self);\\n uint256[] memory balances = self.balances;\\n uint256[] memory multipliers = self.tokenPrecisionMultipliers;\\n\\n uint256 numBalances = balances.length;\\n uint256 d0 = getD(_xp(balances, multipliers), a);\\n for (uint256 i; i < numBalances; ) {\\n if (deposit) {\\n balances[i] = balances[i] + amounts[i];\\n } else {\\n balances[i] = balances[i] - amounts[i];\\n }\\n\\n unchecked {\\n ++i;\\n }\\n }\\n uint256 d1 = getD(_xp(balances, multipliers), a);\\n uint256 totalSupply = self.lpToken.totalSupply();\\n\\n if (deposit) {\\n return ((d1 - d0) * totalSupply) / d0;\\n } else {\\n return ((d0 - d1) * totalSupply) / d0;\\n }\\n }\\n\\n /**\\n * @notice return accumulated amount of admin fees of the token with given index\\n * @param self Swap struct to read from\\n * @param index Index of the pooled token\\n * @return admin balance in the token's precision\\n */\\n function getAdminBalance(Swap storage self, uint256 index) internal view returns (uint256) {\\n require(index < self.pooledTokens.length, \\\"index out of range\\\");\\n return self.adminFees[index];\\n }\\n\\n /**\\n * @notice internal helper function to calculate fee per token multiplier used in\\n * swap fee calculations\\n * @param swapFee swap fee for the tokens\\n * @param numTokens number of tokens pooled\\n */\\n function _feePerToken(uint256 swapFee, uint256 numTokens) internal pure returns (uint256) {\\n return (swapFee * numTokens) / ((numTokens - 1) * 4);\\n }\\n\\n /*** STATE MODIFYING FUNCTIONS ***/\\n\\n /**\\n * @notice swap two tokens in the pool\\n * @param self Swap struct to read from and write to\\n * @param tokenIndexFrom the token the user wants to sell\\n * @param tokenIndexTo the token the user wants to buy\\n * @param dx the amount of tokens the user wants to sell\\n * @param minDy the min amount the user would like to receive, or revert.\\n * @return amount of token user received on swap\\n */\\n function swap(\\n Swap storage self,\\n uint8 tokenIndexFrom,\\n uint8 tokenIndexTo,\\n uint256 dx,\\n uint256 minDy\\n ) internal returns (uint256) {\\n {\\n IERC20 tokenFrom = self.pooledTokens[tokenIndexFrom];\\n require(dx <= tokenFrom.balanceOf(msg.sender), \\\"swap more than you own\\\");\\n // Transfer tokens first to see if a fee was charged on transfer\\n uint256 beforeBalance = tokenFrom.balanceOf(address(this));\\n tokenFrom.safeTransferFrom(msg.sender, address(this), dx);\\n\\n // Use the actual transferred amount for AMM math\\n require(dx == tokenFrom.balanceOf(address(this)) - beforeBalance, \\\"no fee token support\\\");\\n }\\n\\n uint256 dy;\\n uint256 dyFee;\\n uint256[] memory balances = self.balances;\\n (dy, dyFee) = _calculateSwap(self, tokenIndexFrom, tokenIndexTo, dx, balances);\\n require(dy >= minDy, \\\"dy < minDy\\\");\\n\\n uint256 dyAdminFee = (dyFee * self.adminFee) / FEE_DENOMINATOR / self.tokenPrecisionMultipliers[tokenIndexTo];\\n\\n self.balances[tokenIndexFrom] = balances[tokenIndexFrom] + dx;\\n self.balances[tokenIndexTo] = balances[tokenIndexTo] - dy - dyAdminFee;\\n if (dyAdminFee != 0) {\\n self.adminFees[tokenIndexTo] = self.adminFees[tokenIndexTo] + dyAdminFee;\\n }\\n\\n self.pooledTokens[tokenIndexTo].safeTransfer(msg.sender, dy);\\n\\n emit TokenSwap(self.key, msg.sender, dx, dy, tokenIndexFrom, tokenIndexTo);\\n\\n return dy;\\n }\\n\\n /**\\n * @notice swap two tokens in the pool\\n * @param self Swap struct to read from and write to\\n * @param tokenIndexFrom the token the user wants to sell\\n * @param tokenIndexTo the token the user wants to buy\\n * @param dy the amount of tokens the user wants to buy\\n * @param maxDx the max amount the user would like to send.\\n * @return amount of token user have to transfer on swap\\n */\\n function swapOut(\\n Swap storage self,\\n uint8 tokenIndexFrom,\\n uint8 tokenIndexTo,\\n uint256 dy,\\n uint256 maxDx\\n ) internal returns (uint256) {\\n require(dy <= self.balances[tokenIndexTo], \\\">pool balance\\\");\\n\\n uint256 dx;\\n uint256 dxFee;\\n uint256[] memory balances = self.balances;\\n (dx, dxFee) = _calculateSwapInv(self, tokenIndexFrom, tokenIndexTo, dy, balances);\\n require(dx <= maxDx, \\\"dx > maxDx\\\");\\n\\n uint256 dxAdminFee = (dxFee * self.adminFee) / FEE_DENOMINATOR / self.tokenPrecisionMultipliers[tokenIndexFrom];\\n\\n self.balances[tokenIndexFrom] = balances[tokenIndexFrom] + dx - dxAdminFee;\\n self.balances[tokenIndexTo] = balances[tokenIndexTo] - dy;\\n if (dxAdminFee != 0) {\\n self.adminFees[tokenIndexFrom] = self.adminFees[tokenIndexFrom] + dxAdminFee;\\n }\\n\\n {\\n IERC20 tokenFrom = self.pooledTokens[tokenIndexFrom];\\n require(dx <= tokenFrom.balanceOf(msg.sender), \\\"more than you own\\\");\\n // Transfer tokens first to see if a fee was charged on transfer\\n uint256 beforeBalance = tokenFrom.balanceOf(address(this));\\n tokenFrom.safeTransferFrom(msg.sender, address(this), dx);\\n\\n // Use the actual transferred amount for AMM math\\n require(dx == tokenFrom.balanceOf(address(this)) - beforeBalance, \\\"not support fee token\\\");\\n }\\n\\n self.pooledTokens[tokenIndexTo].safeTransfer(msg.sender, dy);\\n\\n emit TokenSwap(self.key, msg.sender, dx, dy, tokenIndexFrom, tokenIndexTo);\\n\\n return dx;\\n }\\n\\n /**\\n * @notice swap two tokens in the pool internally\\n * @param self Swap struct to read from and write to\\n * @param tokenIndexFrom the token the user wants to sell\\n * @param tokenIndexTo the token the user wants to buy\\n * @param dx the amount of tokens the user wants to sell\\n * @param minDy the min amount the user would like to receive, or revert.\\n * @return amount of token user received on swap\\n */\\n function swapInternal(\\n Swap storage self,\\n uint8 tokenIndexFrom,\\n uint8 tokenIndexTo,\\n uint256 dx,\\n uint256 minDy\\n ) internal returns (uint256) {\\n require(dx <= self.balances[tokenIndexFrom], \\\"more than pool balance\\\");\\n\\n uint256 dy;\\n uint256 dyFee;\\n uint256[] memory balances = self.balances;\\n (dy, dyFee) = _calculateSwap(self, tokenIndexFrom, tokenIndexTo, dx, balances);\\n require(dy >= minDy, \\\"dy < minDy\\\");\\n\\n uint256 dyAdminFee = (dyFee * self.adminFee) / FEE_DENOMINATOR / self.tokenPrecisionMultipliers[tokenIndexTo];\\n\\n self.balances[tokenIndexFrom] = balances[tokenIndexFrom] + dx;\\n self.balances[tokenIndexTo] = balances[tokenIndexTo] - dy - dyAdminFee;\\n\\n if (dyAdminFee != 0) {\\n self.adminFees[tokenIndexTo] = self.adminFees[tokenIndexTo] + dyAdminFee;\\n }\\n\\n emit TokenSwap(self.key, msg.sender, dx, dy, tokenIndexFrom, tokenIndexTo);\\n\\n return dy;\\n }\\n\\n /**\\n * @notice Should get exact amount out of AMM for asset put in\\n */\\n function swapInternalOut(\\n Swap storage self,\\n uint8 tokenIndexFrom,\\n uint8 tokenIndexTo,\\n uint256 dy,\\n uint256 maxDx\\n ) internal returns (uint256) {\\n require(dy <= self.balances[tokenIndexTo], \\\"more than pool balance\\\");\\n\\n uint256 dx;\\n uint256 dxFee;\\n uint256[] memory balances = self.balances;\\n (dx, dxFee) = _calculateSwapInv(self, tokenIndexFrom, tokenIndexTo, dy, balances);\\n require(dx <= maxDx, \\\"dx > maxDx\\\");\\n\\n uint256 dxAdminFee = (dxFee * self.adminFee) / FEE_DENOMINATOR / self.tokenPrecisionMultipliers[tokenIndexFrom];\\n\\n self.balances[tokenIndexFrom] = balances[tokenIndexFrom] + dx - dxAdminFee;\\n self.balances[tokenIndexTo] = balances[tokenIndexTo] - dy;\\n\\n if (dxAdminFee != 0) {\\n self.adminFees[tokenIndexFrom] = self.adminFees[tokenIndexFrom] + dxAdminFee;\\n }\\n\\n emit TokenSwap(self.key, msg.sender, dx, dy, tokenIndexFrom, tokenIndexTo);\\n\\n return dx;\\n }\\n\\n /**\\n * @notice Add liquidity to the pool\\n * @param self Swap struct to read from and write to\\n * @param amounts the amounts of each token to add, in their native precision\\n * @param minToMint the minimum LP tokens adding this amount of liquidity\\n * should mint, otherwise revert. Handy for front-running mitigation\\n * allowed addresses. If the pool is not in the guarded launch phase, this parameter will be ignored.\\n * @return amount of LP token user received\\n */\\n function addLiquidity(\\n Swap storage self,\\n uint256[] memory amounts,\\n uint256 minToMint\\n ) internal returns (uint256) {\\n uint256 numTokens = self.pooledTokens.length;\\n require(amounts.length == numTokens, \\\"mismatch pooled tokens\\\");\\n\\n // current state\\n ManageLiquidityInfo memory v = ManageLiquidityInfo(\\n 0,\\n 0,\\n 0,\\n _getAPrecise(self),\\n self.lpToken,\\n 0,\\n self.balances,\\n self.tokenPrecisionMultipliers\\n );\\n v.totalSupply = v.lpToken.totalSupply();\\n if (v.totalSupply != 0) {\\n v.d0 = getD(_xp(v.balances, v.multipliers), v.preciseA);\\n }\\n\\n uint256[] memory newBalances = new uint256[](numTokens);\\n\\n for (uint256 i; i < numTokens; ) {\\n require(v.totalSupply != 0 || amounts[i] != 0, \\\"!supply all tokens\\\");\\n\\n // Transfer tokens first to see if a fee was charged on transfer\\n if (amounts[i] != 0) {\\n IERC20 token = self.pooledTokens[i];\\n uint256 beforeBalance = token.balanceOf(address(this));\\n token.safeTransferFrom(msg.sender, address(this), amounts[i]);\\n\\n // Update the amounts[] with actual transfer amount\\n amounts[i] = token.balanceOf(address(this)) - beforeBalance;\\n }\\n\\n newBalances[i] = v.balances[i] + amounts[i];\\n\\n unchecked {\\n ++i;\\n }\\n }\\n\\n // invariant after change\\n v.d1 = getD(_xp(newBalances, v.multipliers), v.preciseA);\\n require(v.d1 > v.d0, \\\"D should increase\\\");\\n\\n // updated to reflect fees and calculate the user's LP tokens\\n v.d2 = v.d1;\\n uint256[] memory fees = new uint256[](numTokens);\\n\\n if (v.totalSupply != 0) {\\n uint256 feePerToken = _feePerToken(self.swapFee, numTokens);\\n for (uint256 i; i < numTokens; ) {\\n uint256 idealBalance = (v.d1 * v.balances[i]) / v.d0;\\n fees[i] = (feePerToken * (idealBalance.difference(newBalances[i]))) / FEE_DENOMINATOR;\\n uint256 adminFee = (fees[i] * self.adminFee) / FEE_DENOMINATOR;\\n self.balances[i] = newBalances[i] - adminFee;\\n self.adminFees[i] = self.adminFees[i] + adminFee;\\n newBalances[i] = newBalances[i] - fees[i];\\n\\n unchecked {\\n ++i;\\n }\\n }\\n v.d2 = getD(_xp(newBalances, v.multipliers), v.preciseA);\\n } else {\\n // the initial depositor doesn't pay fees\\n self.balances = newBalances;\\n }\\n\\n uint256 toMint;\\n if (v.totalSupply == 0) {\\n toMint = v.d1;\\n } else {\\n toMint = ((v.d2 - v.d0) * v.totalSupply) / v.d0;\\n }\\n\\n require(toMint >= minToMint, \\\"mint < min\\\");\\n\\n // mint the user's LP tokens\\n v.lpToken.mint(msg.sender, toMint);\\n\\n emit AddLiquidity(self.key, msg.sender, amounts, fees, v.d1, v.totalSupply + toMint);\\n\\n return toMint;\\n }\\n\\n /**\\n * @notice Burn LP tokens to remove liquidity from the pool.\\n * @dev Liquidity can always be removed, even when the pool is paused.\\n * @param self Swap struct to read from and write to\\n * @param amount the amount of LP tokens to burn\\n * @param minAmounts the minimum amounts of each token in the pool\\n * acceptable for this burn. Useful as a front-running mitigation\\n * @return amounts of tokens the user received\\n */\\n function removeLiquidity(\\n Swap storage self,\\n uint256 amount,\\n uint256[] calldata minAmounts\\n ) internal returns (uint256[] memory) {\\n LPToken lpToken = self.lpToken;\\n require(amount <= lpToken.balanceOf(msg.sender), \\\">LP.balanceOf\\\");\\n uint256 numTokens = self.pooledTokens.length;\\n require(minAmounts.length == numTokens, \\\"mismatch poolTokens\\\");\\n\\n uint256[] memory balances = self.balances;\\n uint256 totalSupply = lpToken.totalSupply();\\n\\n uint256[] memory amounts = _calculateRemoveLiquidity(balances, amount, totalSupply);\\n\\n uint256 numAmounts = amounts.length;\\n for (uint256 i; i < numAmounts; ) {\\n require(amounts[i] >= minAmounts[i], \\\"amounts[i] < minAmounts[i]\\\");\\n self.balances[i] = balances[i] - amounts[i];\\n self.pooledTokens[i].safeTransfer(msg.sender, amounts[i]);\\n\\n unchecked {\\n ++i;\\n }\\n }\\n\\n lpToken.burnFrom(msg.sender, amount);\\n\\n emit RemoveLiquidity(self.key, msg.sender, amounts, totalSupply - amount);\\n\\n return amounts;\\n }\\n\\n /**\\n * @notice Remove liquidity from the pool all in one token.\\n * @param self Swap struct to read from and write to\\n * @param tokenAmount the amount of the lp tokens to burn\\n * @param tokenIndex the index of the token you want to receive\\n * @param minAmount the minimum amount to withdraw, otherwise revert\\n * @return amount chosen token that user received\\n */\\n function removeLiquidityOneToken(\\n Swap storage self,\\n uint256 tokenAmount,\\n uint8 tokenIndex,\\n uint256 minAmount\\n ) internal returns (uint256) {\\n LPToken lpToken = self.lpToken;\\n\\n require(tokenAmount <= lpToken.balanceOf(msg.sender), \\\">LP.balanceOf\\\");\\n uint256 numTokens = self.pooledTokens.length;\\n require(tokenIndex < numTokens, \\\"not found\\\");\\n\\n uint256 totalSupply = lpToken.totalSupply();\\n\\n (uint256 dy, uint256 dyFee) = _calculateWithdrawOneToken(self, tokenAmount, tokenIndex, totalSupply);\\n\\n require(dy >= minAmount, \\\"dy < minAmount\\\");\\n\\n uint256 adminFee = (dyFee * self.adminFee) / FEE_DENOMINATOR;\\n self.balances[tokenIndex] = self.balances[tokenIndex] - (dy + adminFee);\\n if (adminFee != 0) {\\n self.adminFees[tokenIndex] = self.adminFees[tokenIndex] + adminFee;\\n }\\n lpToken.burnFrom(msg.sender, tokenAmount);\\n self.pooledTokens[tokenIndex].safeTransfer(msg.sender, dy);\\n\\n emit RemoveLiquidityOne(self.key, msg.sender, tokenAmount, totalSupply, tokenIndex, dy);\\n\\n return dy;\\n }\\n\\n /**\\n * @notice Remove liquidity from the pool, weighted differently than the\\n * pool's current balances.\\n *\\n * @param self Swap struct to read from and write to\\n * @param amounts how much of each token to withdraw\\n * @param maxBurnAmount the max LP token provider is willing to pay to\\n * remove liquidity. Useful as a front-running mitigation.\\n * @return actual amount of LP tokens burned in the withdrawal\\n */\\n function removeLiquidityImbalance(\\n Swap storage self,\\n uint256[] memory amounts,\\n uint256 maxBurnAmount\\n ) internal returns (uint256) {\\n ManageLiquidityInfo memory v = ManageLiquidityInfo(\\n 0,\\n 0,\\n 0,\\n _getAPrecise(self),\\n self.lpToken,\\n 0,\\n self.balances,\\n self.tokenPrecisionMultipliers\\n );\\n v.totalSupply = v.lpToken.totalSupply();\\n\\n uint256 numTokens = self.pooledTokens.length;\\n uint256 numAmounts = amounts.length;\\n require(numAmounts == numTokens, \\\"mismatch pool tokens\\\");\\n\\n require(maxBurnAmount <= v.lpToken.balanceOf(msg.sender) && maxBurnAmount != 0, \\\">LP.balanceOf\\\");\\n\\n uint256 feePerToken = _feePerToken(self.swapFee, numTokens);\\n uint256[] memory fees = new uint256[](numTokens);\\n {\\n uint256[] memory balances1 = new uint256[](numTokens);\\n v.d0 = getD(_xp(v.balances, v.multipliers), v.preciseA);\\n for (uint256 i; i < numTokens; ) {\\n require(v.balances[i] >= amounts[i], \\\"withdraw more than available\\\");\\n\\n unchecked {\\n balances1[i] = v.balances[i] - amounts[i];\\n ++i;\\n }\\n }\\n v.d1 = getD(_xp(balances1, v.multipliers), v.preciseA);\\n\\n for (uint256 i; i < numTokens; ) {\\n {\\n uint256 idealBalance = (v.d1 * v.balances[i]) / v.d0;\\n uint256 difference = idealBalance.difference(balances1[i]);\\n fees[i] = (feePerToken * difference) / FEE_DENOMINATOR;\\n }\\n uint256 adminFee = (fees[i] * self.adminFee) / FEE_DENOMINATOR;\\n self.balances[i] = balances1[i] - adminFee;\\n self.adminFees[i] = self.adminFees[i] + adminFee;\\n balances1[i] = balances1[i] - fees[i];\\n\\n unchecked {\\n ++i;\\n }\\n }\\n\\n v.d2 = getD(_xp(balances1, v.multipliers), v.preciseA);\\n }\\n uint256 tokenAmount = ((v.d0 - v.d2) * v.totalSupply) / v.d0;\\n require(tokenAmount != 0, \\\"!zero amount\\\");\\n tokenAmount = tokenAmount + 1;\\n\\n require(tokenAmount <= maxBurnAmount, \\\"tokenAmount > maxBurnAmount\\\");\\n\\n v.lpToken.burnFrom(msg.sender, tokenAmount);\\n\\n for (uint256 i; i < numTokens; ) {\\n self.pooledTokens[i].safeTransfer(msg.sender, amounts[i]);\\n\\n unchecked {\\n ++i;\\n }\\n }\\n\\n emit RemoveLiquidityImbalance(self.key, msg.sender, amounts, fees, v.d1, v.totalSupply - tokenAmount);\\n\\n return tokenAmount;\\n }\\n\\n /**\\n * @notice withdraw all admin fees to a given address\\n * @param self Swap struct to withdraw fees from\\n * @param to Address to send the fees to\\n */\\n function withdrawAdminFees(Swap storage self, address to) internal {\\n uint256 numTokens = self.pooledTokens.length;\\n for (uint256 i; i < numTokens; ) {\\n IERC20 token = self.pooledTokens[i];\\n uint256 balance = self.adminFees[i];\\n if (balance != 0) {\\n self.adminFees[i] = 0;\\n token.safeTransfer(to, balance);\\n }\\n\\n unchecked {\\n ++i;\\n }\\n }\\n }\\n\\n /**\\n * @notice Sets the admin fee\\n * @dev adminFee cannot be higher than 100% of the swap fee\\n * @param self Swap struct to update\\n * @param newAdminFee new admin fee to be applied on future transactions\\n */\\n function setAdminFee(Swap storage self, uint256 newAdminFee) internal {\\n require(newAdminFee <= MAX_ADMIN_FEE, \\\"too high\\\");\\n self.adminFee = newAdminFee;\\n\\n emit NewAdminFee(self.key, newAdminFee);\\n }\\n\\n /**\\n * @notice update the swap fee\\n * @dev fee cannot be higher than 1% of each swap\\n * @param self Swap struct to update\\n * @param newSwapFee new swap fee to be applied on future transactions\\n */\\n function setSwapFee(Swap storage self, uint256 newSwapFee) internal {\\n require(newSwapFee <= MAX_SWAP_FEE, \\\"too high\\\");\\n self.swapFee = newSwapFee;\\n\\n emit NewSwapFee(self.key, newSwapFee);\\n }\\n\\n /**\\n * @notice Check if this stableswap pool exists and is valid (i.e. has been\\n * initialized and tokens have been added).\\n * @return bool true if this stableswap pool is valid, false if not.\\n */\\n function exists(Swap storage self) internal view returns (bool) {\\n return self.pooledTokens.length != 0;\\n }\\n}\\n\",\"keccak256\":\"0x3da6aa3cd7cf97886db9958cbb174b8edaf7771aebce5da2a8d87e993a8301fa\",\"license\":\"UNLICENSED\"},\"@connext/nxtp-contracts/contracts/messaging/interfaces/IConnectorManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT OR Apache-2.0\\npragma solidity 0.8.15;\\n\\nimport {IOutbox} from \\\"./IOutbox.sol\\\";\\n\\n/**\\n * @notice Each router extends the `XAppConnectionClient` contract. This contract\\n * allows an admin to call `setXAppConnectionManager` to update the underlying\\n * pointers to the messaging inboxes (Replicas) and outboxes (Homes).\\n *\\n * @dev This interface only contains the functions needed for the `XAppConnectionClient`\\n * will interface with.\\n */\\ninterface IConnectorManager {\\n /**\\n * @notice Get the local inbox contract from the xAppConnectionManager\\n * @return The local inbox contract\\n * @dev The local inbox contract is a SpokeConnector with AMBs, and a\\n * Home contract with nomad\\n */\\n function home() external view returns (IOutbox);\\n\\n /**\\n * @notice Determine whether _potentialReplica is an enrolled Replica from the xAppConnectionManager\\n * @return True if _potentialReplica is an enrolled Replica\\n */\\n function isReplica(address _potentialReplica) external view returns (bool);\\n\\n /**\\n * @notice Get the local domain from the xAppConnectionManager\\n * @return The local domain\\n */\\n function localDomain() external view returns (uint32);\\n}\\n\",\"keccak256\":\"0xa2c9a88a7b76a89615fe199d8a78878e5deb8dd13b036a86b575d31966beab1a\",\"license\":\"MIT OR Apache-2.0\"},\"@connext/nxtp-contracts/contracts/messaging/interfaces/IOutbox.sol\":{\"content\":\"// SPDX-License-Identifier: MIT OR Apache-2.0\\npragma solidity 0.8.15;\\n\\n/**\\n * @notice Interface for all contracts sending messages originating on their\\n * current domain.\\n *\\n * @dev These are the Home.sol interface methods used by the `Router`\\n * and exposed via `home()` on the `XAppConnectionClient`\\n */\\ninterface IOutbox {\\n /**\\n * @notice Emitted when a new message is added to an outbound message merkle root\\n * @param leafIndex Index of message's leaf in merkle tree\\n * @param destinationAndNonce Destination and destination-specific\\n * nonce combined in single field ((destination << 32) & nonce)\\n * @param messageHash Hash of message; the leaf inserted to the Merkle tree for the message\\n * @param committedRoot the latest notarized root submitted in the last signed Update\\n * @param message Raw bytes of message\\n */\\n event Dispatch(\\n bytes32 indexed messageHash,\\n uint256 indexed leafIndex,\\n uint64 indexed destinationAndNonce,\\n bytes32 committedRoot,\\n bytes message\\n );\\n\\n /**\\n * @notice Dispatch the message it to the destination domain & recipient\\n * @dev Format the message, insert its hash into Merkle tree,\\n * enqueue the new Merkle root, and emit `Dispatch` event with message information.\\n * @param _destinationDomain Domain of destination chain\\n * @param _recipientAddress Address of recipient on destination chain as bytes32\\n * @param _messageBody Raw bytes content of message\\n * @return bytes32 The leaf added to the tree\\n */\\n function dispatch(\\n uint32 _destinationDomain,\\n bytes32 _recipientAddress,\\n bytes memory _messageBody\\n ) external returns (bytes32);\\n}\\n\",\"keccak256\":\"0xe6a213bd3c9e0c4dcf0e982cdef2a6a613a49b7bca3d6ad662c179e509de6c2b\",\"license\":\"MIT OR Apache-2.0\"},\"@defi-wonderland/solidity-utils/solidity/interfaces/IBaseErrors.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >=0.8.8 <0.9.0;\\n\\ninterface IBaseErrors {\\n /// @notice Thrown if an address is invalid\\n error InvalidAddress();\\n\\n /// @notice Thrown if an amount is invalid\\n error InvalidAmount();\\n\\n /// @notice Thrown if the lengths of a set of lists mismatch\\n error LengthMismatch();\\n\\n /// @notice Thrown if an address is the zero address\\n error ZeroAddress();\\n\\n /// @notice Thrown if an amount is zero\\n error ZeroAmount();\\n}\\n\",\"keccak256\":\"0xec09b9d248b6fbf6343dee41d6978abdc15d4c8df5ed7721e8df79e8b1a558cf\",\"license\":\"MIT\"},\"@defi-wonderland/solidity-utils/solidity/interfaces/IGovernable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >=0.8.8 <0.9.0;\\n\\nimport {IBaseErrors} from './IBaseErrors.sol';\\n\\n/// @title Governable interface\\ninterface IGovernable is IBaseErrors {\\n // STATE VARIABLES\\n\\n /// @return _governor Address of the current governor\\n function governor() external view returns (address _governor);\\n\\n /// @return _pendingGovernor Address of the current pending governor\\n function pendingGovernor() external view returns (address _pendingGovernor);\\n\\n // EVENTS\\n\\n /// @notice Emitted when a new pending governor is set\\n /// @param _governor Address of the current governor\\n /// @param _pendingGovernor Address of the proposed next governor\\n event PendingGovernorSet(address _governor, address _pendingGovernor);\\n\\n /// @notice Emitted when a new governor is set\\n /// @param _newGovernor Address of the new governor\\n event PendingGovernorAccepted(address _newGovernor);\\n\\n // ERRORS\\n\\n /// @notice Thrown if a non-governor user tries to call a OnlyGovernor function\\n error OnlyGovernor();\\n\\n /// @notice Thrown if a non-pending-governor user tries to call a OnlyPendingGovernor function\\n error OnlyPendingGovernor();\\n\\n // FUNCTIONS\\n\\n /// @notice Allows a governor to propose a new governor\\n /// @param _pendingGovernor Address of the proposed new governor\\n function setPendingGovernor(address _pendingGovernor) external;\\n\\n /// @notice Allows a proposed governor to accept the governance\\n function acceptPendingGovernor() external;\\n}\\n\",\"keccak256\":\"0x40b94706a00d2c092f620807ba84bdd0c5ed8cfa60140c924edc850427e0af13\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/ContextUpgradeable.sol\\\";\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract OwnableUpgradeable is Initializable, ContextUpgradeable {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n function __Ownable_init() internal onlyInitializing {\\n __Ownable_init_unchained();\\n }\\n\\n function __Ownable_init_unchained() internal onlyInitializing {\\n _transferOwnership(_msgSender());\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n _checkOwner();\\n _;\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if the sender is not the owner.\\n */\\n function _checkOwner() internal view virtual {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n _transferOwnership(address(0));\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n _transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual {\\n address oldOwner = _owner;\\n _owner = newOwner;\\n emit OwnershipTransferred(oldOwner, newOwner);\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[49] private __gap;\\n}\\n\",\"keccak256\":\"0x247c62047745915c0af6b955470a72d1696ebad4352d7d3011aef1a2463cd888\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (proxy/utils/Initializable.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../../utils/AddressUpgradeable.sol\\\";\\n\\n/**\\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\\n *\\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\\n * reused. This mechanism prevents re-execution of each \\\"step\\\" but allows the creation of new initialization steps in\\n * case an upgrade adds a module that needs to be initialized.\\n *\\n * For example:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * contract MyToken is ERC20Upgradeable {\\n * function initialize() initializer public {\\n * __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\n * }\\n * }\\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\\n * function initializeV2() reinitializer(2) public {\\n * __ERC20Permit_init(\\\"MyToken\\\");\\n * }\\n * }\\n * ```\\n *\\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() {\\n * _disableInitializers();\\n * }\\n * ```\\n * ====\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n * @custom:oz-retyped-from bool\\n */\\n uint8 private _initialized;\\n\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool private _initializing;\\n\\n /**\\n * @dev Triggered when the contract has been initialized or reinitialized.\\n */\\n event Initialized(uint8 version);\\n\\n /**\\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\\n * `onlyInitializing` functions can be used to initialize parent contracts. Equivalent to `reinitializer(1)`.\\n */\\n modifier initializer() {\\n bool isTopLevelCall = !_initializing;\\n require(\\n (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1),\\n \\\"Initializable: contract is already initialized\\\"\\n );\\n _initialized = 1;\\n if (isTopLevelCall) {\\n _initializing = true;\\n }\\n _;\\n if (isTopLevelCall) {\\n _initializing = false;\\n emit Initialized(1);\\n }\\n }\\n\\n /**\\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\\n * used to initialize parent contracts.\\n *\\n * `initializer` is equivalent to `reinitializer(1)`, so a reinitializer may be used after the original\\n * initialization step. This is essential to configure modules that are added through upgrades and that require\\n * initialization.\\n *\\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\\n * a contract, executing them in the right order is up to the developer or operator.\\n */\\n modifier reinitializer(uint8 version) {\\n require(!_initializing && _initialized < version, \\\"Initializable: contract is already initialized\\\");\\n _initialized = version;\\n _initializing = true;\\n _;\\n _initializing = false;\\n emit Initialized(version);\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n require(_initializing, \\\"Initializable: contract is not initializing\\\");\\n _;\\n }\\n\\n /**\\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\\n * through proxies.\\n */\\n function _disableInitializers() internal virtual {\\n require(!_initializing, \\\"Initializable: contract is initializing\\\");\\n if (_initialized < type(uint8).max) {\\n _initialized = type(uint8).max;\\n emit Initialized(type(uint8).max);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x0203dcadc5737d9ef2c211d6fa15d18ebc3b30dfa51903b64870b01a062b0b4e\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC20/ERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IERC20Upgradeable.sol\\\";\\nimport \\\"./extensions/IERC20MetadataUpgradeable.sol\\\";\\nimport \\\"../../utils/ContextUpgradeable.sol\\\";\\nimport \\\"../../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Implementation of the {IERC20} interface.\\n *\\n * This implementation is agnostic to the way tokens are created. This means\\n * that a supply mechanism has to be added in a derived contract using {_mint}.\\n * For a generic mechanism see {ERC20PresetMinterPauser}.\\n *\\n * TIP: For a detailed writeup see our guide\\n * https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How\\n * to implement supply mechanisms].\\n *\\n * We have followed general OpenZeppelin Contracts guidelines: functions revert\\n * instead returning `false` on failure. This behavior is nonetheless\\n * conventional and does not conflict with the expectations of ERC20\\n * applications.\\n *\\n * Additionally, an {Approval} event is emitted on calls to {transferFrom}.\\n * This allows applications to reconstruct the allowance for all accounts just\\n * by listening to said events. Other implementations of the EIP may not emit\\n * these events, as it isn't required by the specification.\\n *\\n * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}\\n * functions have been added to mitigate the well-known issues around setting\\n * allowances. See {IERC20-approve}.\\n */\\ncontract ERC20Upgradeable is Initializable, ContextUpgradeable, IERC20Upgradeable, IERC20MetadataUpgradeable {\\n mapping(address => uint256) private _balances;\\n\\n mapping(address => mapping(address => uint256)) private _allowances;\\n\\n uint256 private _totalSupply;\\n\\n string private _name;\\n string private _symbol;\\n\\n /**\\n * @dev Sets the values for {name} and {symbol}.\\n *\\n * The default value of {decimals} is 18. To select a different value for\\n * {decimals} you should overload it.\\n *\\n * All two of these values are immutable: they can only be set once during\\n * construction.\\n */\\n function __ERC20_init(string memory name_, string memory symbol_) internal onlyInitializing {\\n __ERC20_init_unchained(name_, symbol_);\\n }\\n\\n function __ERC20_init_unchained(string memory name_, string memory symbol_) internal onlyInitializing {\\n _name = name_;\\n _symbol = symbol_;\\n }\\n\\n /**\\n * @dev Returns the name of the token.\\n */\\n function name() public view virtual override returns (string memory) {\\n return _name;\\n }\\n\\n /**\\n * @dev Returns the symbol of the token, usually a shorter version of the\\n * name.\\n */\\n function symbol() public view virtual override returns (string memory) {\\n return _symbol;\\n }\\n\\n /**\\n * @dev Returns the number of decimals used to get its user representation.\\n * For example, if `decimals` equals `2`, a balance of `505` tokens should\\n * be displayed to a user as `5.05` (`505 / 10 ** 2`).\\n *\\n * Tokens usually opt for a value of 18, imitating the relationship between\\n * Ether and Wei. This is the value {ERC20} uses, unless this function is\\n * overridden;\\n *\\n * NOTE: This information is only used for _display_ purposes: it in\\n * no way affects any of the arithmetic of the contract, including\\n * {IERC20-balanceOf} and {IERC20-transfer}.\\n */\\n function decimals() public view virtual override returns (uint8) {\\n return 18;\\n }\\n\\n /**\\n * @dev See {IERC20-totalSupply}.\\n */\\n function totalSupply() public view virtual override returns (uint256) {\\n return _totalSupply;\\n }\\n\\n /**\\n * @dev See {IERC20-balanceOf}.\\n */\\n function balanceOf(address account) public view virtual override returns (uint256) {\\n return _balances[account];\\n }\\n\\n /**\\n * @dev See {IERC20-transfer}.\\n *\\n * Requirements:\\n *\\n * - `to` cannot be the zero address.\\n * - the caller must have a balance of at least `amount`.\\n */\\n function transfer(address to, uint256 amount) public virtual override returns (bool) {\\n address owner = _msgSender();\\n _transfer(owner, to, amount);\\n return true;\\n }\\n\\n /**\\n * @dev See {IERC20-allowance}.\\n */\\n function allowance(address owner, address spender) public view virtual override returns (uint256) {\\n return _allowances[owner][spender];\\n }\\n\\n /**\\n * @dev See {IERC20-approve}.\\n *\\n * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on\\n * `transferFrom`. This is semantically equivalent to an infinite approval.\\n *\\n * Requirements:\\n *\\n * - `spender` cannot be the zero address.\\n */\\n function approve(address spender, uint256 amount) public virtual override returns (bool) {\\n address owner = _msgSender();\\n _approve(owner, spender, amount);\\n return true;\\n }\\n\\n /**\\n * @dev See {IERC20-transferFrom}.\\n *\\n * Emits an {Approval} event indicating the updated allowance. This is not\\n * required by the EIP. See the note at the beginning of {ERC20}.\\n *\\n * NOTE: Does not update the allowance if the current allowance\\n * is the maximum `uint256`.\\n *\\n * Requirements:\\n *\\n * - `from` and `to` cannot be the zero address.\\n * - `from` must have a balance of at least `amount`.\\n * - the caller must have allowance for ``from``'s tokens of at least\\n * `amount`.\\n */\\n function transferFrom(\\n address from,\\n address to,\\n uint256 amount\\n ) public virtual override returns (bool) {\\n address spender = _msgSender();\\n _spendAllowance(from, spender, amount);\\n _transfer(from, to, amount);\\n return true;\\n }\\n\\n /**\\n * @dev Atomically increases the allowance granted to `spender` by the caller.\\n *\\n * This is an alternative to {approve} that can be used as a mitigation for\\n * problems described in {IERC20-approve}.\\n *\\n * Emits an {Approval} event indicating the updated allowance.\\n *\\n * Requirements:\\n *\\n * - `spender` cannot be the zero address.\\n */\\n function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {\\n address owner = _msgSender();\\n _approve(owner, spender, allowance(owner, spender) + addedValue);\\n return true;\\n }\\n\\n /**\\n * @dev Atomically decreases the allowance granted to `spender` by the caller.\\n *\\n * This is an alternative to {approve} that can be used as a mitigation for\\n * problems described in {IERC20-approve}.\\n *\\n * Emits an {Approval} event indicating the updated allowance.\\n *\\n * Requirements:\\n *\\n * - `spender` cannot be the zero address.\\n * - `spender` must have allowance for the caller of at least\\n * `subtractedValue`.\\n */\\n function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {\\n address owner = _msgSender();\\n uint256 currentAllowance = allowance(owner, spender);\\n require(currentAllowance >= subtractedValue, \\\"ERC20: decreased allowance below zero\\\");\\n unchecked {\\n _approve(owner, spender, currentAllowance - subtractedValue);\\n }\\n\\n return true;\\n }\\n\\n /**\\n * @dev Moves `amount` of tokens from `from` to `to`.\\n *\\n * This internal function is equivalent to {transfer}, and can be used to\\n * e.g. implement automatic token fees, slashing mechanisms, etc.\\n *\\n * Emits a {Transfer} event.\\n *\\n * Requirements:\\n *\\n * - `from` cannot be the zero address.\\n * - `to` cannot be the zero address.\\n * - `from` must have a balance of at least `amount`.\\n */\\n function _transfer(\\n address from,\\n address to,\\n uint256 amount\\n ) internal virtual {\\n require(from != address(0), \\\"ERC20: transfer from the zero address\\\");\\n require(to != address(0), \\\"ERC20: transfer to the zero address\\\");\\n\\n _beforeTokenTransfer(from, to, amount);\\n\\n uint256 fromBalance = _balances[from];\\n require(fromBalance >= amount, \\\"ERC20: transfer amount exceeds balance\\\");\\n unchecked {\\n _balances[from] = fromBalance - amount;\\n }\\n _balances[to] += amount;\\n\\n emit Transfer(from, to, amount);\\n\\n _afterTokenTransfer(from, to, amount);\\n }\\n\\n /** @dev Creates `amount` tokens and assigns them to `account`, increasing\\n * the total supply.\\n *\\n * Emits a {Transfer} event with `from` set to the zero address.\\n *\\n * Requirements:\\n *\\n * - `account` cannot be the zero address.\\n */\\n function _mint(address account, uint256 amount) internal virtual {\\n require(account != address(0), \\\"ERC20: mint to the zero address\\\");\\n\\n _beforeTokenTransfer(address(0), account, amount);\\n\\n _totalSupply += amount;\\n _balances[account] += amount;\\n emit Transfer(address(0), account, amount);\\n\\n _afterTokenTransfer(address(0), account, amount);\\n }\\n\\n /**\\n * @dev Destroys `amount` tokens from `account`, reducing the\\n * total supply.\\n *\\n * Emits a {Transfer} event with `to` set to the zero address.\\n *\\n * Requirements:\\n *\\n * - `account` cannot be the zero address.\\n * - `account` must have at least `amount` tokens.\\n */\\n function _burn(address account, uint256 amount) internal virtual {\\n require(account != address(0), \\\"ERC20: burn from the zero address\\\");\\n\\n _beforeTokenTransfer(account, address(0), amount);\\n\\n uint256 accountBalance = _balances[account];\\n require(accountBalance >= amount, \\\"ERC20: burn amount exceeds balance\\\");\\n unchecked {\\n _balances[account] = accountBalance - amount;\\n }\\n _totalSupply -= amount;\\n\\n emit Transfer(account, address(0), amount);\\n\\n _afterTokenTransfer(account, address(0), amount);\\n }\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.\\n *\\n * This internal function is equivalent to `approve`, and can be used to\\n * e.g. set automatic allowances for certain subsystems, etc.\\n *\\n * Emits an {Approval} event.\\n *\\n * Requirements:\\n *\\n * - `owner` cannot be the zero address.\\n * - `spender` cannot be the zero address.\\n */\\n function _approve(\\n address owner,\\n address spender,\\n uint256 amount\\n ) internal virtual {\\n require(owner != address(0), \\\"ERC20: approve from the zero address\\\");\\n require(spender != address(0), \\\"ERC20: approve to the zero address\\\");\\n\\n _allowances[owner][spender] = amount;\\n emit Approval(owner, spender, amount);\\n }\\n\\n /**\\n * @dev Updates `owner` s allowance for `spender` based on spent `amount`.\\n *\\n * Does not update the allowance amount in case of infinite allowance.\\n * Revert if not enough allowance is available.\\n *\\n * Might emit an {Approval} event.\\n */\\n function _spendAllowance(\\n address owner,\\n address spender,\\n uint256 amount\\n ) internal virtual {\\n uint256 currentAllowance = allowance(owner, spender);\\n if (currentAllowance != type(uint256).max) {\\n require(currentAllowance >= amount, \\\"ERC20: insufficient allowance\\\");\\n unchecked {\\n _approve(owner, spender, currentAllowance - amount);\\n }\\n }\\n }\\n\\n /**\\n * @dev Hook that is called before any transfer of tokens. This includes\\n * minting and burning.\\n *\\n * Calling conditions:\\n *\\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\\n * will be transferred to `to`.\\n * - when `from` is zero, `amount` tokens will be minted for `to`.\\n * - when `to` is zero, `amount` of ``from``'s tokens will be burned.\\n * - `from` and `to` are never both zero.\\n *\\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\\n */\\n function _beforeTokenTransfer(\\n address from,\\n address to,\\n uint256 amount\\n ) internal virtual {}\\n\\n /**\\n * @dev Hook that is called after any transfer of tokens. This includes\\n * minting and burning.\\n *\\n * Calling conditions:\\n *\\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\\n * has been transferred to `to`.\\n * - when `from` is zero, `amount` tokens have been minted for `to`.\\n * - when `to` is zero, `amount` of ``from``'s tokens have been burned.\\n * - `from` and `to` are never both zero.\\n *\\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\\n */\\n function _afterTokenTransfer(\\n address from,\\n address to,\\n uint256 amount\\n ) internal virtual {}\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[45] private __gap;\\n}\\n\",\"keccak256\":\"0x7c7ac0bc6c340a7f320524b9a4b4b079ee9da3c51258080d4bab237f329a427c\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20Upgradeable {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `from` to `to` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(\\n address from,\\n address to,\\n uint256 amount\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x4e733d3164f73f461eaf9d8087a7ad1ea180bdc8ba0d3d61b0e1ae16d8e63dff\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/token/ERC20/extensions/ERC20BurnableUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC20/extensions/ERC20Burnable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../ERC20Upgradeable.sol\\\";\\nimport \\\"../../../utils/ContextUpgradeable.sol\\\";\\nimport \\\"../../../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Extension of {ERC20} that allows token holders to destroy both their own\\n * tokens and those that they have an allowance for, in a way that can be\\n * recognized off-chain (via event analysis).\\n */\\nabstract contract ERC20BurnableUpgradeable is Initializable, ContextUpgradeable, ERC20Upgradeable {\\n function __ERC20Burnable_init() internal onlyInitializing {\\n }\\n\\n function __ERC20Burnable_init_unchained() internal onlyInitializing {\\n }\\n /**\\n * @dev Destroys `amount` tokens from the caller.\\n *\\n * See {ERC20-_burn}.\\n */\\n function burn(uint256 amount) public virtual {\\n _burn(_msgSender(), amount);\\n }\\n\\n /**\\n * @dev Destroys `amount` tokens from `account`, deducting from the caller's\\n * allowance.\\n *\\n * See {ERC20-_burn} and {ERC20-allowance}.\\n *\\n * Requirements:\\n *\\n * - the caller must have allowance for ``accounts``'s tokens of at least\\n * `amount`.\\n */\\n function burnFrom(address account, uint256 amount) public virtual {\\n _spendAllowance(account, _msgSender(), amount);\\n _burn(account, amount);\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[50] private __gap;\\n}\\n\",\"keccak256\":\"0xea2c6f9d434127bf36b1e3e5ebaaf6d28a64dbaeea560508e570014e905a5ad2\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/token/ERC20/extensions/IERC20MetadataUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../IERC20Upgradeable.sol\\\";\\n\\n/**\\n * @dev Interface for the optional metadata functions from the ERC20 standard.\\n *\\n * _Available since v4.1._\\n */\\ninterface IERC20MetadataUpgradeable is IERC20Upgradeable {\\n /**\\n * @dev Returns the name of the token.\\n */\\n function name() external view returns (string memory);\\n\\n /**\\n * @dev Returns the symbol of the token.\\n */\\n function symbol() external view returns (string memory);\\n\\n /**\\n * @dev Returns the decimals places of the token.\\n */\\n function decimals() external view returns (uint8);\\n}\\n\",\"keccak256\":\"0x605434219ebbe4653f703640f06969faa5a1d78f0bfef878e5ddbb1ca369ceeb\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary AddressUpgradeable {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCall(target, data, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n require(isContract(target), \\\"Address: static call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x611aa3f23e59cfdd1863c536776407b3e33d695152a266fa7cfb34440a29a8a3\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract ContextUpgradeable is Initializable {\\n function __Context_init() internal onlyInitializing {\\n }\\n\\n function __Context_init_unchained() internal onlyInitializing {\\n }\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[50] private __gap;\\n}\\n\",\"keccak256\":\"0x963ea7f0b48b032eef72fe3a7582edf78408d6f834115b9feadd673a4d5bd149\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `from` to `to` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(\\n address from,\\n address to,\\n uint256 amount\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x9750c6b834f7b43000631af5cc30001c5f547b3ceb3635488f140f60e897ea6b\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\\n *\\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\\n * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't\\n * need to send a transaction, and thus is not required to hold Ether at all.\\n */\\ninterface IERC20Permit {\\n /**\\n * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,\\n * given ``owner``'s signed approval.\\n *\\n * IMPORTANT: The same issues {IERC20-approve} has related to transaction\\n * ordering also apply here.\\n *\\n * Emits an {Approval} event.\\n *\\n * Requirements:\\n *\\n * - `spender` cannot be the zero address.\\n * - `deadline` must be a timestamp in the future.\\n * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`\\n * over the EIP712-formatted function arguments.\\n * - the signature must use ``owner``'s current nonce (see {nonces}).\\n *\\n * For more information on the signature format, see the\\n * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP\\n * section].\\n */\\n function permit(\\n address owner,\\n address spender,\\n uint256 value,\\n uint256 deadline,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) external;\\n\\n /**\\n * @dev Returns the current nonce for `owner`. This value must be\\n * included whenever a signature is generated for {permit}.\\n *\\n * Every successful call to {permit} increases ``owner``'s nonce by one. This\\n * prevents a signature from being used multiple times.\\n */\\n function nonces(address owner) external view returns (uint256);\\n\\n /**\\n * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.\\n */\\n // solhint-disable-next-line func-name-mixedcase\\n function DOMAIN_SEPARATOR() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0xf41ca991f30855bf80ffd11e9347856a517b977f0a6c2d52e6421a99b7840329\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC20/utils/SafeERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../IERC20.sol\\\";\\nimport \\\"../extensions/draft-IERC20Permit.sol\\\";\\nimport \\\"../../../utils/Address.sol\\\";\\n\\n/**\\n * @title SafeERC20\\n * @dev Wrappers around ERC20 operations that throw on failure (when the token\\n * contract returns false). Tokens that return no value (and instead revert or\\n * throw on failure) are also supported, non-reverting calls are assumed to be\\n * successful.\\n * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\\n */\\nlibrary SafeERC20 {\\n using Address for address;\\n\\n function safeTransfer(\\n IERC20 token,\\n address to,\\n uint256 value\\n ) internal {\\n _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));\\n }\\n\\n function safeTransferFrom(\\n IERC20 token,\\n address from,\\n address to,\\n uint256 value\\n ) internal {\\n _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));\\n }\\n\\n /**\\n * @dev Deprecated. This function has issues similar to the ones found in\\n * {IERC20-approve}, and its usage is discouraged.\\n *\\n * Whenever possible, use {safeIncreaseAllowance} and\\n * {safeDecreaseAllowance} instead.\\n */\\n function safeApprove(\\n IERC20 token,\\n address spender,\\n uint256 value\\n ) internal {\\n // safeApprove should only be called when setting an initial allowance,\\n // or when resetting it to zero. To increase and decrease it, use\\n // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'\\n require(\\n (value == 0) || (token.allowance(address(this), spender) == 0),\\n \\\"SafeERC20: approve from non-zero to non-zero allowance\\\"\\n );\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));\\n }\\n\\n function safeIncreaseAllowance(\\n IERC20 token,\\n address spender,\\n uint256 value\\n ) internal {\\n uint256 newAllowance = token.allowance(address(this), spender) + value;\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\\n }\\n\\n function safeDecreaseAllowance(\\n IERC20 token,\\n address spender,\\n uint256 value\\n ) internal {\\n unchecked {\\n uint256 oldAllowance = token.allowance(address(this), spender);\\n require(oldAllowance >= value, \\\"SafeERC20: decreased allowance below zero\\\");\\n uint256 newAllowance = oldAllowance - value;\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\\n }\\n }\\n\\n function safePermit(\\n IERC20Permit token,\\n address owner,\\n address spender,\\n uint256 value,\\n uint256 deadline,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) internal {\\n uint256 nonceBefore = token.nonces(owner);\\n token.permit(owner, spender, value, deadline, v, r, s);\\n uint256 nonceAfter = token.nonces(owner);\\n require(nonceAfter == nonceBefore + 1, \\\"SafeERC20: permit did not succeed\\\");\\n }\\n\\n /**\\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\\n * on the return value: the return value is optional (but if data is returned, it must not be false).\\n * @param token The token targeted by the call.\\n * @param data The call data (encoded using abi.encode or one of its variants).\\n */\\n function _callOptionalReturn(IERC20 token, bytes memory data) private {\\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\\n // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that\\n // the target address contains contract code and also asserts for success in the low-level call.\\n\\n bytes memory returndata = address(token).functionCall(data, \\\"SafeERC20: low-level call failed\\\");\\n if (returndata.length > 0) {\\n // Return data is optional\\n require(abi.decode(returndata, (bool)), \\\"SafeERC20: ERC20 operation did not succeed\\\");\\n }\\n }\\n}\\n\",\"keccak256\":\"0x032807210d1d7d218963d7355d62e021a84bf1b3339f4f50be2f63b53cccaf29\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCall(target, data, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n require(isContract(target), \\\"Address: static call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0xd6153ce99bcdcce22b124f755e72553295be6abcd63804cfdffceb188b8bef10\",\"license\":\"MIT\"},\"solidity/contracts/bridges/BridgeReceiverAdapter.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\npragma solidity >=0.8.8 <0.9.0;\\n\\nimport {IBridgeReceiverAdapter, IDataReceiver, IOracleSidechain} from '../../interfaces/bridges/IBridgeReceiverAdapter.sol';\\n\\nabstract contract BridgeReceiverAdapter is IBridgeReceiverAdapter {\\n /// @inheritdoc IBridgeReceiverAdapter\\n IDataReceiver public immutable dataReceiver;\\n\\n constructor(IDataReceiver _dataReceiver) {\\n if (address(_dataReceiver) == address(0)) revert ZeroAddress();\\n dataReceiver = _dataReceiver;\\n }\\n\\n function _addObservations(\\n IOracleSidechain.ObservationData[] memory _observationsData,\\n bytes32 _poolSalt,\\n uint24 _poolNonce\\n ) internal {\\n dataReceiver.addObservations(_observationsData, _poolSalt, _poolNonce);\\n }\\n}\\n\",\"keccak256\":\"0x9242c7b33b40003d937f4facdc0aeb0e121ad4574c1191fe0d543eec0c3552b0\",\"license\":\"MIT\"},\"solidity/contracts/bridges/ConnextReceiverAdapter.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\npragma solidity >=0.8.8 <0.9.0;\\n\\nimport {BridgeReceiverAdapter} from './BridgeReceiverAdapter.sol';\\nimport {IConnext, IXReceiver, IConnextReceiverAdapter, IDataReceiver, IOracleSidechain} from '../../interfaces/bridges/IConnextReceiverAdapter.sol';\\n\\ncontract ConnextReceiverAdapter is IConnextReceiverAdapter, BridgeReceiverAdapter {\\n /// @inheritdoc IConnextReceiverAdapter\\n IConnext public immutable connext;\\n\\n /// @inheritdoc IConnextReceiverAdapter\\n address public immutable source;\\n\\n /// @inheritdoc IConnextReceiverAdapter\\n uint32 public immutable originDomain;\\n\\n constructor(\\n IDataReceiver _dataReceiver,\\n IConnext _connext,\\n address _source,\\n uint32 _originDomain\\n ) BridgeReceiverAdapter(_dataReceiver) {\\n if (address(_connext) == address(0) || _source == address(0)) revert ZeroAddress();\\n connext = _connext;\\n source = _source;\\n originDomain = _originDomain;\\n }\\n\\n /// @inheritdoc IXReceiver\\n function xReceive(\\n bytes32, // _transferId\\n uint256, // _amount\\n address, // _asset\\n address _originSender,\\n uint32 _origin,\\n bytes memory _callData\\n ) external onlyExecutor(_originSender, _origin) returns (bytes memory) {\\n (IOracleSidechain.ObservationData[] memory _observationsData, bytes32 _poolSalt, uint24 _poolNonce) = abi.decode(\\n _callData,\\n (IOracleSidechain.ObservationData[], bytes32, uint24)\\n );\\n\\n _addObservations(_observationsData, _poolSalt, _poolNonce);\\n }\\n\\n modifier onlyExecutor(address _originSender, uint32 _originDomain) {\\n if (msg.sender != address(connext) || _originSender != source || _originDomain != originDomain) revert UnauthorizedCaller();\\n _;\\n }\\n}\\n\",\"keccak256\":\"0x7895c6ee2da8eca15d2960a39bec9a7c0093bd33d094f0e0c751e96231951968\",\"license\":\"MIT\"},\"solidity/interfaces/IDataReceiver.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\npragma solidity >=0.8.8 <0.9.0;\\n\\nimport {IGovernable} from '@defi-wonderland/solidity-utils/solidity/interfaces/IGovernable.sol';\\nimport {IOracleFactory} from './IOracleFactory.sol';\\nimport {IOracleSidechain} from './IOracleSidechain.sol';\\nimport {IBridgeReceiverAdapter} from './bridges/IBridgeReceiverAdapter.sol';\\n\\ninterface IDataReceiver is IGovernable {\\n // STATE VARIABLES\\n\\n /// @return _oracleFactory The address of the OracleFactory\\n function oracleFactory() external view returns (IOracleFactory _oracleFactory);\\n\\n /// @notice Tracks already deployed oracles\\n /// @param _poolSalt The identifier of the oracle\\n /// @return _deployedOracle The address of the correspondant Oracle\\n function deployedOracles(bytes32 _poolSalt) external view returns (IOracleSidechain _deployedOracle);\\n\\n /// @notice Tracks the whitelisting of bridge adapters\\n /// @param _adapter Address of the bridge adapter to consult\\n /// @return _isAllowed Whether a bridge adapter is whitelisted\\n function whitelistedAdapters(IBridgeReceiverAdapter _adapter) external view returns (bool _isAllowed);\\n\\n // EVENTS\\n\\n /// @notice Emitted when a broadcast observation is succesfully processed\\n /// @param _poolSalt Identifier of the pool to fetch\\n /// @return _poolNonce Nonce of the observation broadcast\\n /// @return _receiverAdapter Handler of the broadcast\\n event ObservationsAdded(bytes32 indexed _poolSalt, uint24 _poolNonce, address _receiverAdapter);\\n\\n /// @notice Emitted when a broadcast observation is cached for later processing\\n /// @param _poolSalt Identifier of the pool to fetch\\n /// @return _poolNonce Nonce of the observation broadcast\\n /// @return _receiverAdapter Handler of the broadcast\\n event ObservationsCached(bytes32 indexed _poolSalt, uint24 _poolNonce, address _receiverAdapter);\\n\\n /// @notice Emitted when a new adapter whitelisting rule is set\\n /// @param _adapter Address of the adapter\\n /// @param _isAllowed New whitelisting status\\n event AdapterWhitelisted(IBridgeReceiverAdapter _adapter, bool _isAllowed);\\n\\n // ERRORS\\n\\n /// @notice Thrown when the broadcast nonce is incorrect\\n error ObservationsNotWritable();\\n\\n /// @notice Thrown when a not-whitelisted adapter triggers an update\\n error UnallowedAdapter();\\n\\n // FUNCTIONS\\n\\n /// @notice Allows whitelisted bridge adapters to push a broadcast\\n /// @param _observationsData Array of tuples containing the dataset\\n /// @param _poolSalt Identifier of the pool to fetch\\n /// @param _poolNonce Nonce of the observation broadcast\\n function addObservations(\\n IOracleSidechain.ObservationData[] memory _observationsData,\\n bytes32 _poolSalt,\\n uint24 _poolNonce\\n ) external;\\n\\n /// @notice Allows governance to set an adapter whitelisted state\\n /// @param _receiverAdapter Address of the adapter\\n /// @param _isWhitelisted New whitelisting status\\n function whitelistAdapter(IBridgeReceiverAdapter _receiverAdapter, bool _isWhitelisted) external;\\n\\n /// @notice Allows governance to batch set adapters whitelisted state\\n /// @param _receiverAdapters Array of addresses of the adapter\\n /// @param _isWhitelisted Array of whitelisting status for each address\\n function whitelistAdapters(IBridgeReceiverAdapter[] calldata _receiverAdapters, bool[] calldata _isWhitelisted) external;\\n}\\n\",\"keccak256\":\"0x0d0e8404bc039a5fe8574b2ffd53489946fca020f72929caeced68e66f86e768\",\"license\":\"MIT\"},\"solidity/interfaces/IOracleFactory.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\npragma solidity >=0.8.8 <0.9.0;\\n\\nimport {IGovernable} from '@defi-wonderland/solidity-utils/solidity/interfaces/IGovernable.sol';\\nimport {IOracleSidechain} from './IOracleSidechain.sol';\\nimport {IDataReceiver} from './IDataReceiver.sol';\\n\\ninterface IOracleFactory is IGovernable {\\n // STRUCTS\\n\\n struct OracleParameters {\\n bytes32 poolSalt; // Identifier of the pool and oracle\\n uint24 poolNonce; // Initial nonce of the deployed pool\\n uint16 cardinality; // Initial cardinality of the deployed pool\\n }\\n\\n // STATE VARIABLES\\n\\n /// @return _oracleInitCodeHash The oracle creation code hash used to calculate their address\\n //solhint-disable-next-line func-name-mixedcase\\n function ORACLE_INIT_CODE_HASH() external view returns (bytes32 _oracleInitCodeHash);\\n\\n /// @return _dataReceiver The address of the DataReceiver for the oracles to consult\\n function dataReceiver() external view returns (IDataReceiver _dataReceiver);\\n\\n /// @return _poolSalt The id of both the oracle and the pool\\n /// @return _poolNonce The initial nonce of the pool data\\n /// @return _cardinality The size of the observations memory storage\\n function oracleParameters()\\n external\\n view\\n returns (\\n bytes32 _poolSalt,\\n uint24 _poolNonce,\\n uint16 _cardinality\\n );\\n\\n /// @return _initialCardinality The initial size of the observations memory storage for newly deployed pools\\n function initialCardinality() external view returns (uint16 _initialCardinality);\\n\\n // EVENTS\\n\\n /// @notice Emitted when a new oracle is deployed\\n /// @param _poolSalt The id of both the oracle and the pool\\n /// @param _oracle The address of the deployed oracle\\n /// @param _initialNonce The initial nonce of the pool data\\n event OracleDeployed(bytes32 indexed _poolSalt, address indexed _oracle, uint24 _initialNonce);\\n\\n /// @notice Emitted when a new DataReceiver is set\\n /// @param _dataReceiver The address of the new DataReceiver\\n event DataReceiverSet(IDataReceiver _dataReceiver);\\n\\n /// @notice Emitted when a new initial oracle cardinality is set\\n /// @param _initialCardinality The initial length of the observationCardinality array\\n event InitialCardinalitySet(uint16 _initialCardinality);\\n\\n // ERRORS\\n\\n /// @notice Thrown when a contract other than the DataReceiver tries to deploy an oracle\\n error OnlyDataReceiver();\\n\\n // FUNCTIONS\\n\\n /// @notice Deploys a new oracle given an inputted salt\\n /// @dev Requires that the salt has not been deployed before\\n /// @param _poolSalt Pool salt that deterministically binds an oracle with a pool\\n /// @return _oracle The address of the newly deployed oracle\\n function deployOracle(bytes32 _poolSalt, uint24 _poolNonce) external returns (IOracleSidechain _oracle);\\n\\n /// @notice Allows governor to set a new allowed dataReceiver\\n /// @dev Will disallow the previous dataReceiver\\n /// @param _dataReceiver The address of the new allowed dataReceiver\\n function setDataReceiver(IDataReceiver _dataReceiver) external;\\n\\n /// @notice Allows governor to set a new initial cardinality for new oracles\\n /// @param _initialCardinality The initial size of the observations memory storage for newly deployed pools\\n function setInitialCardinality(uint16 _initialCardinality) external;\\n\\n /// @notice Overrides UniV3Factory getPool mapping\\n /// @param _tokenA The contract address of either token0 or token1\\n /// @param _tokenB The contract address of the other token\\n /// @param _fee The fee denominated in hundredths of a bip\\n /// @return _oracle The oracle address\\n function getPool(\\n address _tokenA,\\n address _tokenB,\\n uint24 _fee\\n ) external view returns (IOracleSidechain _oracle);\\n\\n /// @notice Tracks the addresses of the oracle by poolSalt\\n /// @param _poolSalt Identifier of both the pool and the oracle\\n /// @return _oracle The address (if deployed) of the correspondant oracle\\n function getPool(bytes32 _poolSalt) external view returns (IOracleSidechain _oracle);\\n\\n /// @param _tokenA The contract address of either token0 or token1\\n /// @param _tokenB The contract address of the other token\\n /// @param _fee The fee denominated in hundredths of a bip\\n /// @return _poolSalt Pool salt for inquired parameters\\n function getPoolSalt(\\n address _tokenA,\\n address _tokenB,\\n uint24 _fee\\n ) external view returns (bytes32 _poolSalt);\\n}\\n\",\"keccak256\":\"0xc32bfc32a274923ce1a089acc024396e702ae354773f0ac0a683e43ded904954\",\"license\":\"MIT\"},\"solidity/interfaces/IOracleSidechain.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\npragma solidity >=0.8.8 <0.9.0;\\n\\nimport {IOracleFactory} from './IOracleFactory.sol';\\n\\ninterface IOracleSidechain {\\n // STRUCTS\\n\\n struct ObservationData {\\n uint32 blockTimestamp;\\n int24 tick;\\n }\\n\\n // STATE VARIABLES\\n\\n /// @return _oracleFactory The address of the OracleFactory\\n function factory() external view returns (IOracleFactory _oracleFactory);\\n\\n /// @return _token0 The mainnet address of the Token0 of the oracle\\n function token0() external view returns (address _token0);\\n\\n /// @return _token1 The mainnet address of the Token1 of the oracle\\n function token1() external view returns (address _token1);\\n\\n /// @return _fee The fee identifier of the pool\\n function fee() external view returns (uint24 _fee);\\n\\n /// @return _poolSalt The identifier of both the pool and the oracle\\n function poolSalt() external view returns (bytes32 _poolSalt);\\n\\n /// @return _poolNonce Last recorded nonce of the pool history\\n function poolNonce() external view returns (uint24 _poolNonce);\\n\\n /// @notice Replicates the UniV3Pool slot0 behaviour (semi-compatible)\\n /// @return _sqrtPriceX96 Used to maintain compatibility with Uniswap V3\\n /// @return _tick Used to maintain compatibility with Uniswap V3\\n /// @return _observationIndex The index of the last oracle observation that was written,\\n /// @return _observationCardinality The current maximum number of observations stored in the pool,\\n /// @return _observationCardinalityNext The next maximum number of observations, to be updated when the observation.\\n /// @return _feeProtocol Used to maintain compatibility with Uniswap V3\\n /// @return _unlocked Used to track if a pool information was already verified\\n function slot0()\\n external\\n view\\n returns (\\n uint160 _sqrtPriceX96,\\n int24 _tick,\\n uint16 _observationIndex,\\n uint16 _observationCardinality,\\n uint16 _observationCardinalityNext,\\n uint8 _feeProtocol,\\n bool _unlocked\\n );\\n\\n /// @notice Returns data about a specific observation index\\n /// @param _index The element of the observations array to fetch\\n /// @return _blockTimestamp The timestamp of the observation,\\n /// @return _tickCumulative the tick multiplied by seconds elapsed for the life of the pool as of the observation timestamp,\\n /// @return _secondsPerLiquidityCumulativeX128 the seconds per in range liquidity for the life of the pool as of the observation timestamp,\\n /// @return _initialized whether the observation has been initialized and the values are safe to use\\n function observations(uint256 _index)\\n external\\n view\\n returns (\\n uint32 _blockTimestamp,\\n int56 _tickCumulative,\\n uint160 _secondsPerLiquidityCumulativeX128,\\n bool _initialized\\n );\\n\\n // EVENTS\\n\\n /// @notice Emitted when the pool information is verified\\n /// @param _poolSalt Identifier of the pool and the oracle\\n /// @param _token0 The contract address of either token0 or token1\\n /// @param _token1 The contract address of the other token\\n /// @param _fee The fee denominated in hundredths of a bip\\n event PoolInfoInitialized(bytes32 indexed _poolSalt, address _token0, address _token1, uint24 _fee);\\n\\n /// @notice Emitted by the oracle to hint indexers that the pool state has changed\\n /// @dev Imported from IUniswapV3PoolEvents (semi-compatible)\\n /// @param _sqrtPriceX96 The sqrt(price) of the pool after the swap, as a Q64.96\\n /// @param _tick The log base 1.0001 of price of the pool after the swap\\n event Swap(address indexed, address indexed, int256, int256, uint160 _sqrtPriceX96, uint128, int24 _tick);\\n\\n /// @notice Emitted by the oracle for increases to the number of observations that can be stored\\n /// @dev Imported from IUniswapV3PoolEvents (fully-compatible)\\n /// @param _observationCardinalityNextOld The previous value of the next observation cardinality\\n /// @param _observationCardinalityNextNew The updated value of the next observation cardinality\\n event IncreaseObservationCardinalityNext(uint16 _observationCardinalityNextOld, uint16 _observationCardinalityNextNew);\\n\\n // ERRORS\\n\\n /// @notice Thrown if the pool info is already initialized or if the observationCardinalityNext is already increased\\n error AI();\\n\\n /// @notice Thrown if the pool info does not correspond to the pool salt\\n error InvalidPool();\\n\\n /// @notice Thrown if the DataReceiver contract is not the one calling for writing observations\\n error OnlyDataReceiver();\\n\\n /// @notice Thrown if the OracleFactory contract is not the one calling for increasing observationCardinalityNext\\n error OnlyFactory();\\n\\n // FUNCTIONS\\n\\n /// @notice Permisionless method to verify token0, token1 and fee\\n /// @dev Before verified, token0 and token1 views will return address(0)\\n /// @param _tokenA The contract address of either token0 or token1\\n /// @param _tokenB The contract address of the other token\\n /// @param _fee The fee denominated in hundredths of a bip\\n function initializePoolInfo(\\n address _tokenA,\\n address _tokenB,\\n uint24 _fee\\n ) external;\\n\\n /// @notice Returns the cumulative tick and liquidity as of each timestamp `secondsAgo` from the current block timestamp\\n /// @dev Imported from UniV3Pool (semi compatible, optimistically extrapolates)\\n /// @param _secondsAgos From how long ago each cumulative tick and liquidity value should be returned\\n /// @return _tickCumulatives Cumulative tick values as of each `secondsAgos` from the current block timestamp\\n /// @return _secondsCumulativeX128s Cumulative seconds as of each `secondsAgos` from the current block timestamp\\n function observe(uint32[] calldata _secondsAgos)\\n external\\n view\\n returns (int56[] memory _tickCumulatives, uint160[] memory _secondsCumulativeX128s);\\n\\n /// @notice Permisioned method to push a dataset to update\\n /// @param _observationsData Array of tuples containing the dataset\\n /// @param _poolNonce Nonce of the observation broadcast\\n function write(ObservationData[] memory _observationsData, uint24 _poolNonce) external returns (bool _written);\\n\\n /// @notice Permisioned method to increase the cardinalityNext value\\n /// @param _observationCardinalityNext The new next length of the observations array\\n function increaseObservationCardinalityNext(uint16 _observationCardinalityNext) external;\\n}\\n\",\"keccak256\":\"0xa90206e3de00ad866b7f4792ce29220ee0ca561d59629ba638a31c4d6fd3941b\",\"license\":\"MIT\"},\"solidity/interfaces/bridges/IBridgeReceiverAdapter.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\npragma solidity >=0.8.8 <0.9.0;\\n\\nimport {IBaseErrors} from '@defi-wonderland/solidity-utils/solidity/interfaces/IBaseErrors.sol';\\nimport {IDataReceiver} from '../IDataReceiver.sol';\\nimport {IOracleSidechain} from '../IOracleSidechain.sol';\\n\\ninterface IBridgeReceiverAdapter is IBaseErrors {\\n // STATE VARIABLES\\n\\n /// @notice Gets the address of the DataReceiver contract\\n /// @return _dataReceiver Address of the DataReceiver contract\\n function dataReceiver() external view returns (IDataReceiver _dataReceiver);\\n\\n /* NOTE: callback methods should be here declared */\\n}\\n\",\"keccak256\":\"0x49e5c9c6a28521933a3f2b01a529fbae9aac1edd71dbe904586a2f06148b1974\",\"license\":\"MIT\"},\"solidity/interfaces/bridges/IConnextReceiverAdapter.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\npragma solidity >=0.8.8 <0.9.0;\\n\\nimport {IConnext} from '@connext/nxtp-contracts/contracts/core/connext/interfaces/IConnext.sol';\\nimport {IXReceiver} from '@connext/nxtp-contracts/contracts/core/connext/interfaces/IXReceiver.sol';\\nimport {IBridgeReceiverAdapter, IDataReceiver, IOracleSidechain} from './IBridgeReceiverAdapter.sol';\\n\\ninterface IConnextReceiverAdapter is IXReceiver, IBridgeReceiverAdapter {\\n // STATE VARIABLES\\n\\n /// @notice Gets the ConnextHandler contract on this domain\\n /// @return _connext Address of the ConnextHandler contract\\n function connext() external view returns (IConnext _connext);\\n\\n /// @notice Gets the DAO that is expected as the xcaller\\n /// @return _originContract Address of the xcaller contract\\n function source() external view returns (address _originContract);\\n\\n /// @notice Gets the origin domain id\\n /// @return _originDomain The origin domain id\\n function originDomain() external view returns (uint32 _originDomain);\\n\\n // ERRORS\\n\\n /// @notice Thrown if a caller is not authorized\\n error UnauthorizedCaller();\\n}\\n\",\"keccak256\":\"0x382097cdc88bb383c1aec1ec6ebddf9e6ba5b87b405650432e85616acd03e218\",\"license\":\"MIT\"}},\"version\":1}", - "bytecode": "0x61010060405234801561001157600080fd5b506040516107e33803806107e3833981016040819052610030916100d3565b836001600160a01b0381166100585760405163d92e233d60e01b815260040160405180910390fd5b6001600160a01b039081166080528316158061007b57506001600160a01b038216155b156100995760405163d92e233d60e01b815260040160405180910390fd5b6001600160a01b0392831660a052911660c05263ffffffff1660e0525061013b565b6001600160a01b03811681146100d057600080fd5b50565b600080600080608085870312156100e957600080fd5b84516100f4816100bb565b6020860151909450610105816100bb565b6040860151909350610116816100bb565b606086015190925063ffffffff8116811461013057600080fd5b939692955090935050565b60805160a05160c05160e05161065661018d6000396000818160a501526101c00152600081816061015261018301526000818160e10152610159015260008181610108015261025d01526106566000f3fe608060405234801561001057600080fd5b50600436106100575760003560e01c806367e828bf1461005c578063cee85d7e146100a0578063de4b0548146100dc578063e804778814610103578063fd614f411461012a575b600080fd5b6100837f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020015b60405180910390f35b6100c77f000000000000000000000000000000000000000000000000000000000000000081565b60405163ffffffff9091168152602001610097565b6100837f000000000000000000000000000000000000000000000000000000000000000081565b6100837f000000000000000000000000000000000000000000000000000000000000000081565b61013d61013836600461036e565b61014a565b6040516100979190610449565b60608383336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161415806101b857507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b031614155b806101ef57507f000000000000000000000000000000000000000000000000000000000000000063ffffffff168163ffffffff1614155b1561020d57604051635c427cd960e01b815260040160405180910390fd5b60008060008680602001905181019061022691906104b1565b925092509250610237838383610246565b50505050509695505050505050565b60405163d34ad40960e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063d34ad40990610296908690869086906004016105b5565b600060405180830381600087803b1580156102b057600080fd5b505af11580156102c4573d6000803e3d6000fd5b50505050505050565b80356001600160a01b03811681146102e457600080fd5b919050565b63ffffffff811681146102fb57600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b6040805190810167ffffffffffffffff81118282101715610337576103376102fe565b60405290565b604051601f8201601f1916810167ffffffffffffffff81118282101715610366576103666102fe565b604052919050565b60008060008060008060c0878903121561038757600080fd5b86359550602080880135955061039f604089016102cd565b94506103ad606089016102cd565b935060808801356103bd816102e9565b925060a088013567ffffffffffffffff808211156103da57600080fd5b818a0191508a601f8301126103ee57600080fd5b813581811115610400576104006102fe565b610412601f8201601f1916850161033d565b91508082528b8482850101111561042857600080fd5b80848401858401376000848284010152508093505050509295509295509295565b600060208083528351808285015260005b818110156104765785810183015185820160400152820161045a565b81811115610488576000604083870101525b50601f01601f1916929092016040019392505050565b805162ffffff811681146102e457600080fd5b6000806000606084860312156104c657600080fd5b835167ffffffffffffffff808211156104de57600080fd5b818601915086601f8301126104f257600080fd5b8151602082821115610506576105066102fe565b610514818360051b0161033d565b828152818101935060069290921b84018101918983111561053457600080fd5b938101935b82851015610592576040858b0312156105525760008081fd5b61055a610314565b8551610565816102e9565b815285830151600281900b811461057c5760008081fd5b8184015284526040949094019392810192610539565b80975050808801519550505050506105ac6040850161049e565b90509250925092565b606080825284519082018190526000906020906080840190828801845b82811015610602578151805163ffffffff16855285015160020b85850152604090930192908401906001016105d2565b505050908301949094525062ffffff9190911660409091015291905056fea2646970667358221220894d4d420ce1cf475a96263e3b06063419a6217c8a2fc45b22490e6592ea600064736f6c634300080f0033", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100575760003560e01c806367e828bf1461005c578063cee85d7e146100a0578063de4b0548146100dc578063e804778814610103578063fd614f411461012a575b600080fd5b6100837f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020015b60405180910390f35b6100c77f000000000000000000000000000000000000000000000000000000000000000081565b60405163ffffffff9091168152602001610097565b6100837f000000000000000000000000000000000000000000000000000000000000000081565b6100837f000000000000000000000000000000000000000000000000000000000000000081565b61013d61013836600461036e565b61014a565b6040516100979190610449565b60608383336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161415806101b857507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b031614155b806101ef57507f000000000000000000000000000000000000000000000000000000000000000063ffffffff168163ffffffff1614155b1561020d57604051635c427cd960e01b815260040160405180910390fd5b60008060008680602001905181019061022691906104b1565b925092509250610237838383610246565b50505050509695505050505050565b60405163d34ad40960e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063d34ad40990610296908690869086906004016105b5565b600060405180830381600087803b1580156102b057600080fd5b505af11580156102c4573d6000803e3d6000fd5b50505050505050565b80356001600160a01b03811681146102e457600080fd5b919050565b63ffffffff811681146102fb57600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b6040805190810167ffffffffffffffff81118282101715610337576103376102fe565b60405290565b604051601f8201601f1916810167ffffffffffffffff81118282101715610366576103666102fe565b604052919050565b60008060008060008060c0878903121561038757600080fd5b86359550602080880135955061039f604089016102cd565b94506103ad606089016102cd565b935060808801356103bd816102e9565b925060a088013567ffffffffffffffff808211156103da57600080fd5b818a0191508a601f8301126103ee57600080fd5b813581811115610400576104006102fe565b610412601f8201601f1916850161033d565b91508082528b8482850101111561042857600080fd5b80848401858401376000848284010152508093505050509295509295509295565b600060208083528351808285015260005b818110156104765785810183015185820160400152820161045a565b81811115610488576000604083870101525b50601f01601f1916929092016040019392505050565b805162ffffff811681146102e457600080fd5b6000806000606084860312156104c657600080fd5b835167ffffffffffffffff808211156104de57600080fd5b818601915086601f8301126104f257600080fd5b8151602082821115610506576105066102fe565b610514818360051b0161033d565b828152818101935060069290921b84018101918983111561053457600080fd5b938101935b82851015610592576040858b0312156105525760008081fd5b61055a610314565b8551610565816102e9565b815285830151600281900b811461057c5760008081fd5b8184015284526040949094019392810192610539565b80975050808801519550505050506105ac6040850161049e565b90509250925092565b606080825284519082018190526000906020906080840190828801845b82811015610602578151805163ffffffff16855285015160020b85850152604090930192908401906001016105d2565b505050908301949094525062ffffff9190911660409091015291905056fea2646970667358221220894d4d420ce1cf475a96263e3b06063419a6217c8a2fc45b22490e6592ea600064736f6c634300080f0033", - "devdoc": { - "kind": "dev", - "methods": {}, - "stateVariables": { - "connext": { - "return": "Address of the ConnextHandler contract", - "returns": { - "_0": "Address of the ConnextHandler contract" - } - }, - "originDomain": { - "return": "The origin domain id", - "returns": { - "_0": "The origin domain id" - } - }, - "source": { - "return": "Address of the xcaller contract", - "returns": { - "_0": "Address of the xcaller contract" - } - } - }, - "version": 1 - }, - "userdoc": { - "errors": { - "InvalidAddress()": [ - { - "notice": "Thrown if an address is invalid" - } - ], - "InvalidAmount()": [ - { - "notice": "Thrown if an amount is invalid" - } - ], - "LengthMismatch()": [ - { - "notice": "Thrown if the lengths of a set of lists mismatch" - } - ], - "UnauthorizedCaller()": [ - { - "notice": "Thrown if a caller is not authorized" - } - ], - "ZeroAddress()": [ - { - "notice": "Thrown if an address is the zero address" - } - ], - "ZeroAmount()": [ - { - "notice": "Thrown if an amount is zero" - } - ] - }, - "kind": "user", - "methods": { - "connext()": { - "notice": "Gets the ConnextHandler contract on this domain" - }, - "dataReceiver()": { - "notice": "Gets the address of the DataReceiver contract" - }, - "originDomain()": { - "notice": "Gets the origin domain id" - }, - "source()": { - "notice": "Gets the DAO that is expected as the xcaller" - } - }, - "version": 1 - }, - "storageLayout": { - "storage": [], - "types": null - } -} \ No newline at end of file diff --git a/deployments/optimism/DataReceiver.json b/deployments/optimism/DataReceiver.json deleted file mode 100644 index 8177ab8..0000000 --- a/deployments/optimism/DataReceiver.json +++ /dev/null @@ -1,652 +0,0 @@ -{ - "address": "0xe5E3f42C4B86084F2EF05Ef84aD9C8D511D7131e", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "_governor", - "type": "address" - }, - { - "internalType": "contract IOracleFactory", - "name": "_oracleFactory", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "inputs": [], - "name": "InvalidAddress", - "type": "error" - }, - { - "inputs": [], - "name": "InvalidAmount", - "type": "error" - }, - { - "inputs": [], - "name": "LengthMismatch", - "type": "error" - }, - { - "inputs": [], - "name": "ObservationsNotWritable", - "type": "error" - }, - { - "inputs": [], - "name": "OnlyGovernor", - "type": "error" - }, - { - "inputs": [], - "name": "OnlyPendingGovernor", - "type": "error" - }, - { - "inputs": [], - "name": "UnallowedAdapter", - "type": "error" - }, - { - "inputs": [], - "name": "ZeroAddress", - "type": "error" - }, - { - "inputs": [], - "name": "ZeroAmount", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "contract IBridgeReceiverAdapter", - "name": "_adapter", - "type": "address" - }, - { - "indexed": false, - "internalType": "bool", - "name": "_isAllowed", - "type": "bool" - } - ], - "name": "AdapterWhitelisted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "_poolSalt", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "uint24", - "name": "_poolNonce", - "type": "uint24" - }, - { - "indexed": false, - "internalType": "address", - "name": "_receiverAdapter", - "type": "address" - } - ], - "name": "ObservationsAdded", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "_poolSalt", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "uint24", - "name": "_poolNonce", - "type": "uint24" - }, - { - "indexed": false, - "internalType": "address", - "name": "_receiverAdapter", - "type": "address" - } - ], - "name": "ObservationsCached", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "_newGovernor", - "type": "address" - } - ], - "name": "PendingGovernorAccepted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "_governor", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "_pendingGovernor", - "type": "address" - } - ], - "name": "PendingGovernorSet", - "type": "event" - }, - { - "inputs": [], - "name": "acceptPendingGovernor", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "uint32", - "name": "blockTimestamp", - "type": "uint32" - }, - { - "internalType": "int24", - "name": "tick", - "type": "int24" - } - ], - "internalType": "struct IOracleSidechain.ObservationData[]", - "name": "_observationsData", - "type": "tuple[]" - }, - { - "internalType": "bytes32", - "name": "_poolSalt", - "type": "bytes32" - }, - { - "internalType": "uint24", - "name": "_poolNonce", - "type": "uint24" - } - ], - "name": "addObservations", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "name": "deployedOracles", - "outputs": [ - { - "internalType": "contract IOracleSidechain", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "governor", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "oracleFactory", - "outputs": [ - { - "internalType": "contract IOracleFactory", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "pendingGovernor", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_pendingGovernor", - "type": "address" - } - ], - "name": "setPendingGovernor", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract IBridgeReceiverAdapter", - "name": "_receiverAdapter", - "type": "address" - }, - { - "internalType": "bool", - "name": "_isWhitelisted", - "type": "bool" - } - ], - "name": "whitelistAdapter", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract IBridgeReceiverAdapter[]", - "name": "_receiverAdapters", - "type": "address[]" - }, - { - "internalType": "bool[]", - "name": "_isWhitelisted", - "type": "bool[]" - } - ], - "name": "whitelistAdapters", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract IBridgeReceiverAdapter", - "name": "", - "type": "address" - } - ], - "name": "whitelistedAdapters", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - } - ], - "transactionHash": "0x5f21dcfba9a95ee952cd00956047ef22f9bed73b5ecc407095586fafd3abeb58", - "receipt": { - "to": null, - "from": "0xa6DBFF53DD8F89f0bf4f6800BFDFfE099875bd9d", - "contractAddress": "0xe5E3f42C4B86084F2EF05Ef84aD9C8D511D7131e", - "transactionIndex": 25, - "gasUsed": "881190", - "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x1c38e8b56f07ea6c36db2dc8b438cba1041cd43a4e3a691d226709d7271730d2", - "transactionHash": "0x5f21dcfba9a95ee952cd00956047ef22f9bed73b5ecc407095586fafd3abeb58", - "logs": [], - "blockNumber": 124283620, - "cumulativeGasUsed": "5277431", - "status": 1, - "byzantium": true - }, - "args": [ - "0xa6DBFF53DD8F89f0bf4f6800BFDFfE099875bd9d", - "0x45526d765a4f24B0D873F2fdb7f10280e7C278bC" - ], - "numDeployments": 3, - "solcInputHash": "5afb27a716565ad6b9fe481fabed79d8", - "metadata": "{\"compiler\":{\"version\":\"0.8.15+commit.e14f2714\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_governor\",\"type\":\"address\"},{\"internalType\":\"contract IOracleFactory\",\"name\":\"_oracleFactory\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"InvalidAddress\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidAmount\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"LengthMismatch\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ObservationsNotWritable\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyGovernor\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyPendingGovernor\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UnallowedAdapter\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ZeroAddress\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ZeroAmount\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"contract IBridgeReceiverAdapter\",\"name\":\"_adapter\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"_isAllowed\",\"type\":\"bool\"}],\"name\":\"AdapterWhitelisted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"_poolSalt\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint24\",\"name\":\"_poolNonce\",\"type\":\"uint24\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"_receiverAdapter\",\"type\":\"address\"}],\"name\":\"ObservationsAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"_poolSalt\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint24\",\"name\":\"_poolNonce\",\"type\":\"uint24\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"_receiverAdapter\",\"type\":\"address\"}],\"name\":\"ObservationsCached\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"_newGovernor\",\"type\":\"address\"}],\"name\":\"PendingGovernorAccepted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"_governor\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"_pendingGovernor\",\"type\":\"address\"}],\"name\":\"PendingGovernorSet\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"acceptPendingGovernor\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint32\",\"name\":\"blockTimestamp\",\"type\":\"uint32\"},{\"internalType\":\"int24\",\"name\":\"tick\",\"type\":\"int24\"}],\"internalType\":\"struct IOracleSidechain.ObservationData[]\",\"name\":\"_observationsData\",\"type\":\"tuple[]\"},{\"internalType\":\"bytes32\",\"name\":\"_poolSalt\",\"type\":\"bytes32\"},{\"internalType\":\"uint24\",\"name\":\"_poolNonce\",\"type\":\"uint24\"}],\"name\":\"addObservations\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"deployedOracles\",\"outputs\":[{\"internalType\":\"contract IOracleSidechain\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"governor\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"oracleFactory\",\"outputs\":[{\"internalType\":\"contract IOracleFactory\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"pendingGovernor\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_pendingGovernor\",\"type\":\"address\"}],\"name\":\"setPendingGovernor\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IBridgeReceiverAdapter\",\"name\":\"_receiverAdapter\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"_isWhitelisted\",\"type\":\"bool\"}],\"name\":\"whitelistAdapter\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IBridgeReceiverAdapter[]\",\"name\":\"_receiverAdapters\",\"type\":\"address[]\"},{\"internalType\":\"bool[]\",\"name\":\"_isWhitelisted\",\"type\":\"bool[]\"}],\"name\":\"whitelistAdapters\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IBridgeReceiverAdapter\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"whitelistedAdapters\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"addObservations((uint32,int24)[],bytes32,uint24)\":{\"params\":{\"_observationsData\":\"Array of tuples containing the dataset\",\"_poolNonce\":\"Nonce of the observation broadcast\",\"_poolSalt\":\"Identifier of the pool to fetch\"}},\"setPendingGovernor(address)\":{\"params\":{\"_pendingGovernor\":\"Address of the proposed new governor\"}},\"whitelistAdapter(address,bool)\":{\"params\":{\"_isWhitelisted\":\"New whitelisting status\",\"_receiverAdapter\":\"Address of the adapter\"}},\"whitelistAdapters(address[],bool[])\":{\"params\":{\"_isWhitelisted\":\"Array of whitelisting status for each address\",\"_receiverAdapters\":\"Array of addresses of the adapter\"}}},\"stateVariables\":{\"deployedOracles\":{\"params\":{\"_poolSalt\":\"The identifier of the oracle\"},\"return\":\"The address of the correspondant Oracle\",\"returns\":{\"_0\":\"The address of the correspondant Oracle\"}},\"oracleFactory\":{\"return\":\"The address of the OracleFactory\",\"returns\":{\"_0\":\"The address of the OracleFactory\"}},\"whitelistedAdapters\":{\"params\":{\"_adapter\":\"Address of the bridge adapter to consult\"},\"return\":\"Whether a bridge adapter is whitelisted\",\"returns\":{\"_0\":\"Whether a bridge adapter is whitelisted\"}}},\"title\":\"The DataReceiver contract\",\"version\":1},\"userdoc\":{\"errors\":{\"InvalidAddress()\":[{\"notice\":\"Thrown if an address is invalid\"}],\"InvalidAmount()\":[{\"notice\":\"Thrown if an amount is invalid\"}],\"LengthMismatch()\":[{\"notice\":\"Thrown if the lengths of a set of lists mismatch\"}],\"ObservationsNotWritable()\":[{\"notice\":\"Thrown when the broadcast nonce is incorrect\"}],\"OnlyGovernor()\":[{\"notice\":\"Thrown if a non-governor user tries to call a OnlyGovernor function\"}],\"OnlyPendingGovernor()\":[{\"notice\":\"Thrown if a non-pending-governor user tries to call a OnlyPendingGovernor function\"}],\"UnallowedAdapter()\":[{\"notice\":\"Thrown when a not-whitelisted adapter triggers an update\"}],\"ZeroAddress()\":[{\"notice\":\"Thrown if an address is the zero address\"}],\"ZeroAmount()\":[{\"notice\":\"Thrown if an amount is zero\"}]},\"events\":{\"AdapterWhitelisted(address,bool)\":{\"notice\":\"Emitted when a new adapter whitelisting rule is set\"},\"ObservationsAdded(bytes32,uint24,address)\":{\"notice\":\"Emitted when a broadcast observation is succesfully processed\"},\"ObservationsCached(bytes32,uint24,address)\":{\"notice\":\"Emitted when a broadcast observation is cached for later processing\"},\"PendingGovernorAccepted(address)\":{\"notice\":\"Emitted when a new governor is set\"},\"PendingGovernorSet(address,address)\":{\"notice\":\"Emitted when a new pending governor is set\"}},\"kind\":\"user\",\"methods\":{\"acceptPendingGovernor()\":{\"notice\":\"Allows a proposed governor to accept the governance\"},\"addObservations((uint32,int24)[],bytes32,uint24)\":{\"notice\":\"Allows whitelisted bridge adapters to push a broadcast\"},\"deployedOracles(bytes32)\":{\"notice\":\"Tracks already deployed oracles\"},\"setPendingGovernor(address)\":{\"notice\":\"Allows a governor to propose a new governor\"},\"whitelistAdapter(address,bool)\":{\"notice\":\"Allows governance to set an adapter whitelisted state\"},\"whitelistAdapters(address[],bool[])\":{\"notice\":\"Allows governance to batch set adapters whitelisted state\"},\"whitelistedAdapters(address)\":{\"notice\":\"Tracks the whitelisting of bridge adapters\"}},\"notice\":\"Handles reception of broadcast data and delivers it to correspondant oracle\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"solidity/contracts/DataReceiver.sol\":\"DataReceiver\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@defi-wonderland/solidity-utils/solidity/contracts/Governable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >=0.8.8 <0.9.0;\\n\\nimport {IGovernable} from '../interfaces/IGovernable.sol';\\n\\n/// @title Governable contract\\n/// @notice Manages the governor role\\nabstract contract Governable is IGovernable {\\n /// @inheritdoc IGovernable\\n address public governor;\\n\\n /// @inheritdoc IGovernable\\n address public pendingGovernor;\\n\\n constructor(address _governor) {\\n if (_governor == address(0)) revert ZeroAddress();\\n governor = _governor;\\n }\\n\\n /// @inheritdoc IGovernable\\n function setPendingGovernor(address _pendingGovernor) external onlyGovernor {\\n _setPendingGovernor(_pendingGovernor);\\n }\\n\\n /// @inheritdoc IGovernable\\n function acceptPendingGovernor() external onlyPendingGovernor {\\n _acceptPendingGovernor();\\n }\\n\\n function _setPendingGovernor(address _pendingGovernor) internal {\\n if (_pendingGovernor == address(0)) revert ZeroAddress();\\n pendingGovernor = _pendingGovernor;\\n emit PendingGovernorSet(governor, _pendingGovernor);\\n }\\n\\n function _acceptPendingGovernor() internal {\\n governor = pendingGovernor;\\n delete pendingGovernor;\\n emit PendingGovernorAccepted(governor);\\n }\\n\\n /// @notice Functions with this modifier can only be called by governor\\n modifier onlyGovernor() {\\n if (msg.sender != governor) revert OnlyGovernor();\\n _;\\n }\\n\\n /// @notice Functions with this modifier can only be called by pendingGovernor\\n modifier onlyPendingGovernor() {\\n if (msg.sender != pendingGovernor) revert OnlyPendingGovernor();\\n _;\\n }\\n}\\n\",\"keccak256\":\"0x3f11408cfcb015a99dc417e075c8ebc39b796fc2adc3e81b036487e4486881b3\",\"license\":\"MIT\"},\"@defi-wonderland/solidity-utils/solidity/interfaces/IBaseErrors.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >=0.8.8 <0.9.0;\\n\\ninterface IBaseErrors {\\n /// @notice Thrown if an address is invalid\\n error InvalidAddress();\\n\\n /// @notice Thrown if an amount is invalid\\n error InvalidAmount();\\n\\n /// @notice Thrown if the lengths of a set of lists mismatch\\n error LengthMismatch();\\n\\n /// @notice Thrown if an address is the zero address\\n error ZeroAddress();\\n\\n /// @notice Thrown if an amount is zero\\n error ZeroAmount();\\n}\\n\",\"keccak256\":\"0xec09b9d248b6fbf6343dee41d6978abdc15d4c8df5ed7721e8df79e8b1a558cf\",\"license\":\"MIT\"},\"@defi-wonderland/solidity-utils/solidity/interfaces/IGovernable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >=0.8.8 <0.9.0;\\n\\nimport {IBaseErrors} from './IBaseErrors.sol';\\n\\n/// @title Governable interface\\ninterface IGovernable is IBaseErrors {\\n // STATE VARIABLES\\n\\n /// @return _governor Address of the current governor\\n function governor() external view returns (address _governor);\\n\\n /// @return _pendingGovernor Address of the current pending governor\\n function pendingGovernor() external view returns (address _pendingGovernor);\\n\\n // EVENTS\\n\\n /// @notice Emitted when a new pending governor is set\\n /// @param _governor Address of the current governor\\n /// @param _pendingGovernor Address of the proposed next governor\\n event PendingGovernorSet(address _governor, address _pendingGovernor);\\n\\n /// @notice Emitted when a new governor is set\\n /// @param _newGovernor Address of the new governor\\n event PendingGovernorAccepted(address _newGovernor);\\n\\n // ERRORS\\n\\n /// @notice Thrown if a non-governor user tries to call a OnlyGovernor function\\n error OnlyGovernor();\\n\\n /// @notice Thrown if a non-pending-governor user tries to call a OnlyPendingGovernor function\\n error OnlyPendingGovernor();\\n\\n // FUNCTIONS\\n\\n /// @notice Allows a governor to propose a new governor\\n /// @param _pendingGovernor Address of the proposed new governor\\n function setPendingGovernor(address _pendingGovernor) external;\\n\\n /// @notice Allows a proposed governor to accept the governance\\n function acceptPendingGovernor() external;\\n}\\n\",\"keccak256\":\"0x40b94706a00d2c092f620807ba84bdd0c5ed8cfa60140c924edc850427e0af13\",\"license\":\"MIT\"},\"@uniswap/v3-core/contracts/libraries/Oracle.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\npragma solidity ^0.8.0;\\n\\n/// @title Oracle\\n/// @notice Provides price and liquidity data useful for a wide variety of system designs\\n/// @dev Instances of stored oracle data, \\\"observations\\\", are collected in the oracle array\\n/// Every pool is initialized with an oracle array length of 1. Anyone can pay the SSTOREs to increase the\\n/// maximum length of the oracle array. New slots will be added when the array is fully populated.\\n/// Observations are overwritten when the full length of the oracle array is populated.\\n/// The most recent observation is available, independent of the length of the oracle array, by passing 0 to observe()\\nlibrary Oracle {\\n error I();\\n error OLD();\\n\\n struct Observation {\\n // the block timestamp of the observation\\n uint32 blockTimestamp;\\n // the tick accumulator, i.e. tick * time elapsed since the pool was first initialized\\n int56 tickCumulative;\\n // the seconds per liquidity, i.e. seconds elapsed / max(1, liquidity) since the pool was first initialized\\n uint160 secondsPerLiquidityCumulativeX128;\\n // whether or not the observation is initialized\\n bool initialized;\\n }\\n\\n /// @notice Transforms a previous observation into a new observation, given the passage of time and the current tick and liquidity values\\n /// @dev blockTimestamp _must_ be chronologically equal to or greater than last.blockTimestamp, safe for 0 or 1 overflows\\n /// @param last The specified observation to be transformed\\n /// @param blockTimestamp The timestamp of the new observation\\n /// @param tick The active tick at the time of the new observation\\n /// @param liquidity The total in-range liquidity at the time of the new observation\\n /// @return Observation The newly populated observation\\n function transform(\\n Observation memory last,\\n uint32 blockTimestamp,\\n int24 tick,\\n uint128 liquidity\\n ) private pure returns (Observation memory) {\\n unchecked {\\n uint32 delta = blockTimestamp - last.blockTimestamp;\\n return\\n Observation({\\n blockTimestamp: blockTimestamp,\\n tickCumulative: last.tickCumulative + int56(tick) * int56(uint56(delta)),\\n secondsPerLiquidityCumulativeX128: last.secondsPerLiquidityCumulativeX128 +\\n ((uint160(delta) << 128) / (liquidity > 0 ? liquidity : 1)),\\n initialized: true\\n });\\n }\\n }\\n\\n /// @notice Initialize the oracle array by writing the first slot. Called once for the lifecycle of the observations array\\n /// @param self The stored oracle array\\n /// @param time The time of the oracle initialization, via block.timestamp truncated to uint32\\n /// @return cardinality The number of populated elements in the oracle array\\n /// @return cardinalityNext The new length of the oracle array, independent of population\\n function initialize(Observation[65535] storage self, uint32 time)\\n internal\\n returns (uint16 cardinality, uint16 cardinalityNext)\\n {\\n self[0] = Observation({\\n blockTimestamp: time,\\n tickCumulative: 0,\\n secondsPerLiquidityCumulativeX128: 0,\\n initialized: true\\n });\\n return (1, 1);\\n }\\n\\n /// @notice Writes an oracle observation to the array\\n /// @dev Writable at most once per block. Index represents the most recently written element. cardinality and index must be tracked externally.\\n /// If the index is at the end of the allowable array length (according to cardinality), and the next cardinality\\n /// is greater than the current one, cardinality may be increased. This restriction is created to preserve ordering.\\n /// @param self The stored oracle array\\n /// @param index The index of the observation that was most recently written to the observations array\\n /// @param blockTimestamp The timestamp of the new observation\\n /// @param tick The active tick at the time of the new observation\\n /// @param liquidity The total in-range liquidity at the time of the new observation\\n /// @param cardinality The number of populated elements in the oracle array\\n /// @param cardinalityNext The new length of the oracle array, independent of population\\n /// @return indexUpdated The new index of the most recently written element in the oracle array\\n /// @return cardinalityUpdated The new cardinality of the oracle array\\n function write(\\n Observation[65535] storage self,\\n uint16 index,\\n uint32 blockTimestamp,\\n int24 tick,\\n uint128 liquidity,\\n uint16 cardinality,\\n uint16 cardinalityNext\\n ) internal returns (uint16 indexUpdated, uint16 cardinalityUpdated) {\\n unchecked {\\n Observation memory last = self[index];\\n\\n // early return if we've already written an observation this block\\n if (last.blockTimestamp == blockTimestamp) return (index, cardinality);\\n\\n // if the conditions are right, we can bump the cardinality\\n if (cardinalityNext > cardinality && index == (cardinality - 1)) {\\n cardinalityUpdated = cardinalityNext;\\n } else {\\n cardinalityUpdated = cardinality;\\n }\\n\\n indexUpdated = (index + 1) % cardinalityUpdated;\\n self[indexUpdated] = transform(last, blockTimestamp, tick, liquidity);\\n }\\n }\\n\\n /// @notice Prepares the oracle array to store up to `next` observations\\n /// @param self The stored oracle array\\n /// @param current The current next cardinality of the oracle array\\n /// @param next The proposed next cardinality which will be populated in the oracle array\\n /// @return next The next cardinality which will be populated in the oracle array\\n function grow(\\n Observation[65535] storage self,\\n uint16 current,\\n uint16 next\\n ) internal returns (uint16) {\\n unchecked {\\n if (current <= 0) revert I();\\n // no-op if the passed next value isn't greater than the current next value\\n if (next <= current) return current;\\n // store in each slot to prevent fresh SSTOREs in swaps\\n // this data will not be used because the initialized boolean is still false\\n for (uint16 i = current; i < next; i++) self[i].blockTimestamp = 1;\\n return next;\\n }\\n }\\n\\n /// @notice comparator for 32-bit timestamps\\n /// @dev safe for 0 or 1 overflows, a and b _must_ be chronologically before or equal to time\\n /// @param time A timestamp truncated to 32 bits\\n /// @param a A comparison timestamp from which to determine the relative position of `time`\\n /// @param b From which to determine the relative position of `time`\\n /// @return Whether `a` is chronologically <= `b`\\n function lte(\\n uint32 time,\\n uint32 a,\\n uint32 b\\n ) private pure returns (bool) {\\n unchecked {\\n // if there hasn't been overflow, no need to adjust\\n if (a <= time && b <= time) return a <= b;\\n\\n uint256 aAdjusted = a > time ? a : a + 2**32;\\n uint256 bAdjusted = b > time ? b : b + 2**32;\\n\\n return aAdjusted <= bAdjusted;\\n }\\n }\\n\\n /// @notice Fetches the observations beforeOrAt and atOrAfter a target, i.e. where [beforeOrAt, atOrAfter] is satisfied.\\n /// The result may be the same observation, or adjacent observations.\\n /// @dev The answer must be contained in the array, used when the target is located within the stored observation\\n /// boundaries: older than the most recent observation and younger, or the same age as, the oldest observation\\n /// @param self The stored oracle array\\n /// @param time The current block.timestamp\\n /// @param target The timestamp at which the reserved observation should be for\\n /// @param index The index of the observation that was most recently written to the observations array\\n /// @param cardinality The number of populated elements in the oracle array\\n /// @return beforeOrAt The observation recorded before, or at, the target\\n /// @return atOrAfter The observation recorded at, or after, the target\\n function binarySearch(\\n Observation[65535] storage self,\\n uint32 time,\\n uint32 target,\\n uint16 index,\\n uint16 cardinality\\n ) private view returns (Observation memory beforeOrAt, Observation memory atOrAfter) {\\n unchecked {\\n uint256 l = (index + 1) % cardinality; // oldest observation\\n uint256 r = l + cardinality - 1; // newest observation\\n uint256 i;\\n while (true) {\\n i = (l + r) / 2;\\n\\n beforeOrAt = self[i % cardinality];\\n\\n // we've landed on an uninitialized tick, keep searching higher (more recently)\\n if (!beforeOrAt.initialized) {\\n l = i + 1;\\n continue;\\n }\\n\\n atOrAfter = self[(i + 1) % cardinality];\\n\\n bool targetAtOrAfter = lte(time, beforeOrAt.blockTimestamp, target);\\n\\n // check if we've found the answer!\\n if (targetAtOrAfter && lte(time, target, atOrAfter.blockTimestamp)) break;\\n\\n if (!targetAtOrAfter) r = i - 1;\\n else l = i + 1;\\n }\\n }\\n }\\n\\n /// @notice Fetches the observations beforeOrAt and atOrAfter a given target, i.e. where [beforeOrAt, atOrAfter] is satisfied\\n /// @dev Assumes there is at least 1 initialized observation.\\n /// Used by observeSingle() to compute the counterfactual accumulator values as of a given block timestamp.\\n /// @param self The stored oracle array\\n /// @param time The current block.timestamp\\n /// @param target The timestamp at which the reserved observation should be for\\n /// @param tick The active tick at the time of the returned or simulated observation\\n /// @param index The index of the observation that was most recently written to the observations array\\n /// @param liquidity The total pool liquidity at the time of the call\\n /// @param cardinality The number of populated elements in the oracle array\\n /// @return beforeOrAt The observation which occurred at, or before, the given timestamp\\n /// @return atOrAfter The observation which occurred at, or after, the given timestamp\\n function getSurroundingObservations(\\n Observation[65535] storage self,\\n uint32 time,\\n uint32 target,\\n int24 tick,\\n uint16 index,\\n uint128 liquidity,\\n uint16 cardinality\\n ) private view returns (Observation memory beforeOrAt, Observation memory atOrAfter) {\\n unchecked {\\n // optimistically set before to the newest observation\\n beforeOrAt = self[index];\\n\\n // if the target is chronologically at or after the newest observation, we can early return\\n if (lte(time, beforeOrAt.blockTimestamp, target)) {\\n if (beforeOrAt.blockTimestamp == target) {\\n // if newest observation equals target, we're in the same block, so we can ignore atOrAfter\\n return (beforeOrAt, atOrAfter);\\n } else {\\n // otherwise, we need to transform\\n return (beforeOrAt, transform(beforeOrAt, target, tick, liquidity));\\n }\\n }\\n\\n // now, set before to the oldest observation\\n beforeOrAt = self[(index + 1) % cardinality];\\n if (!beforeOrAt.initialized) beforeOrAt = self[0];\\n\\n // ensure that the target is chronologically at or after the oldest observation\\n if (!lte(time, beforeOrAt.blockTimestamp, target)) revert OLD();\\n\\n // if we've reached this point, we have to binary search\\n return binarySearch(self, time, target, index, cardinality);\\n }\\n }\\n\\n /// @dev Reverts if an observation at or before the desired observation timestamp does not exist.\\n /// 0 may be passed as `secondsAgo' to return the current cumulative values.\\n /// If called with a timestamp falling between two observations, returns the counterfactual accumulator values\\n /// at exactly the timestamp between the two observations.\\n /// @param self The stored oracle array\\n /// @param time The current block timestamp\\n /// @param secondsAgo The amount of time to look back, in seconds, at which point to return an observation\\n /// @param tick The current tick\\n /// @param index The index of the observation that was most recently written to the observations array\\n /// @param liquidity The current in-range pool liquidity\\n /// @param cardinality The number of populated elements in the oracle array\\n /// @return tickCumulative The tick * time elapsed since the pool was first initialized, as of `secondsAgo`\\n /// @return secondsPerLiquidityCumulativeX128 The time elapsed / max(1, liquidity) since the pool was first initialized, as of `secondsAgo`\\n function observeSingle(\\n Observation[65535] storage self,\\n uint32 time,\\n uint32 secondsAgo,\\n int24 tick,\\n uint16 index,\\n uint128 liquidity,\\n uint16 cardinality\\n ) internal view returns (int56 tickCumulative, uint160 secondsPerLiquidityCumulativeX128) {\\n unchecked {\\n if (secondsAgo == 0) {\\n Observation memory last = self[index];\\n if (last.blockTimestamp != time) last = transform(last, time, tick, liquidity);\\n return (last.tickCumulative, last.secondsPerLiquidityCumulativeX128);\\n }\\n\\n uint32 target = time - secondsAgo;\\n\\n (Observation memory beforeOrAt, Observation memory atOrAfter) = getSurroundingObservations(\\n self,\\n time,\\n target,\\n tick,\\n index,\\n liquidity,\\n cardinality\\n );\\n\\n if (target == beforeOrAt.blockTimestamp) {\\n // we're at the left boundary\\n return (beforeOrAt.tickCumulative, beforeOrAt.secondsPerLiquidityCumulativeX128);\\n } else if (target == atOrAfter.blockTimestamp) {\\n // we're at the right boundary\\n return (atOrAfter.tickCumulative, atOrAfter.secondsPerLiquidityCumulativeX128);\\n } else {\\n // we're in the middle\\n uint32 observationTimeDelta = atOrAfter.blockTimestamp - beforeOrAt.blockTimestamp;\\n uint32 targetDelta = target - beforeOrAt.blockTimestamp;\\n return (\\n beforeOrAt.tickCumulative +\\n ((atOrAfter.tickCumulative - beforeOrAt.tickCumulative) / int56(uint56(observationTimeDelta))) *\\n int56(uint56(targetDelta)),\\n beforeOrAt.secondsPerLiquidityCumulativeX128 +\\n uint160(\\n (uint256(\\n atOrAfter.secondsPerLiquidityCumulativeX128 -\\n beforeOrAt.secondsPerLiquidityCumulativeX128\\n ) * targetDelta) / observationTimeDelta\\n )\\n );\\n }\\n }\\n }\\n\\n /// @notice Returns the accumulator values as of each time seconds ago from the given time in the array of `secondsAgos`\\n /// @dev Reverts if `secondsAgos` > oldest observation\\n /// @param self The stored oracle array\\n /// @param time The current block.timestamp\\n /// @param secondsAgos Each amount of time to look back, in seconds, at which point to return an observation\\n /// @param tick The current tick\\n /// @param index The index of the observation that was most recently written to the observations array\\n /// @param liquidity The current in-range pool liquidity\\n /// @param cardinality The number of populated elements in the oracle array\\n /// @return tickCumulatives The tick * time elapsed since the pool was first initialized, as of each `secondsAgo`\\n /// @return secondsPerLiquidityCumulativeX128s The cumulative seconds / max(1, liquidity) since the pool was first initialized, as of each `secondsAgo`\\n function observe(\\n Observation[65535] storage self,\\n uint32 time,\\n uint32[] memory secondsAgos,\\n int24 tick,\\n uint16 index,\\n uint128 liquidity,\\n uint16 cardinality\\n ) internal view returns (int56[] memory tickCumulatives, uint160[] memory secondsPerLiquidityCumulativeX128s) {\\n unchecked {\\n if (cardinality <= 0) revert I();\\n\\n tickCumulatives = new int56[](secondsAgos.length);\\n secondsPerLiquidityCumulativeX128s = new uint160[](secondsAgos.length);\\n for (uint256 i = 0; i < secondsAgos.length; i++) {\\n (tickCumulatives[i], secondsPerLiquidityCumulativeX128s[i]) = observeSingle(\\n self,\\n time,\\n secondsAgos[i],\\n tick,\\n index,\\n liquidity,\\n cardinality\\n );\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0xa25b18af947c36b9add9e229c361beb6aba176fb435d7a24e6dc723cbc187442\",\"license\":\"BUSL-1.1\"},\"@uniswap/v3-core/contracts/libraries/TickMath.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-2.0-or-later\\npragma solidity ^0.8.0;\\n\\n/// @title Math library for computing sqrt prices from ticks and vice versa\\n/// @notice Computes sqrt price for ticks of size 1.0001, i.e. sqrt(1.0001^tick) as fixed point Q64.96 numbers. Supports\\n/// prices between 2**-128 and 2**128\\nlibrary TickMath {\\n error T();\\n error R();\\n\\n /// @dev The minimum tick that may be passed to #getSqrtRatioAtTick computed from log base 1.0001 of 2**-128\\n int24 internal constant MIN_TICK = -887272;\\n /// @dev The maximum tick that may be passed to #getSqrtRatioAtTick computed from log base 1.0001 of 2**128\\n int24 internal constant MAX_TICK = -MIN_TICK;\\n\\n /// @dev The minimum value that can be returned from #getSqrtRatioAtTick. Equivalent to getSqrtRatioAtTick(MIN_TICK)\\n uint160 internal constant MIN_SQRT_RATIO = 4295128739;\\n /// @dev The maximum value that can be returned from #getSqrtRatioAtTick. Equivalent to getSqrtRatioAtTick(MAX_TICK)\\n uint160 internal constant MAX_SQRT_RATIO = 1461446703485210103287273052203988822378723970342;\\n\\n /// @notice Calculates sqrt(1.0001^tick) * 2^96\\n /// @dev Throws if |tick| > max tick\\n /// @param tick The input tick for the above formula\\n /// @return sqrtPriceX96 A Fixed point Q64.96 number representing the sqrt of the ratio of the two assets (token1/token0)\\n /// at the given tick\\n function getSqrtRatioAtTick(int24 tick) internal pure returns (uint160 sqrtPriceX96) {\\n unchecked {\\n uint256 absTick = tick < 0 ? uint256(-int256(tick)) : uint256(int256(tick));\\n if (absTick > uint256(int256(MAX_TICK))) revert T();\\n\\n uint256 ratio = absTick & 0x1 != 0\\n ? 0xfffcb933bd6fad37aa2d162d1a594001\\n : 0x100000000000000000000000000000000;\\n if (absTick & 0x2 != 0) ratio = (ratio * 0xfff97272373d413259a46990580e213a) >> 128;\\n if (absTick & 0x4 != 0) ratio = (ratio * 0xfff2e50f5f656932ef12357cf3c7fdcc) >> 128;\\n if (absTick & 0x8 != 0) ratio = (ratio * 0xffe5caca7e10e4e61c3624eaa0941cd0) >> 128;\\n if (absTick & 0x10 != 0) ratio = (ratio * 0xffcb9843d60f6159c9db58835c926644) >> 128;\\n if (absTick & 0x20 != 0) ratio = (ratio * 0xff973b41fa98c081472e6896dfb254c0) >> 128;\\n if (absTick & 0x40 != 0) ratio = (ratio * 0xff2ea16466c96a3843ec78b326b52861) >> 128;\\n if (absTick & 0x80 != 0) ratio = (ratio * 0xfe5dee046a99a2a811c461f1969c3053) >> 128;\\n if (absTick & 0x100 != 0) ratio = (ratio * 0xfcbe86c7900a88aedcffc83b479aa3a4) >> 128;\\n if (absTick & 0x200 != 0) ratio = (ratio * 0xf987a7253ac413176f2b074cf7815e54) >> 128;\\n if (absTick & 0x400 != 0) ratio = (ratio * 0xf3392b0822b70005940c7a398e4b70f3) >> 128;\\n if (absTick & 0x800 != 0) ratio = (ratio * 0xe7159475a2c29b7443b29c7fa6e889d9) >> 128;\\n if (absTick & 0x1000 != 0) ratio = (ratio * 0xd097f3bdfd2022b8845ad8f792aa5825) >> 128;\\n if (absTick & 0x2000 != 0) ratio = (ratio * 0xa9f746462d870fdf8a65dc1f90e061e5) >> 128;\\n if (absTick & 0x4000 != 0) ratio = (ratio * 0x70d869a156d2a1b890bb3df62baf32f7) >> 128;\\n if (absTick & 0x8000 != 0) ratio = (ratio * 0x31be135f97d08fd981231505542fcfa6) >> 128;\\n if (absTick & 0x10000 != 0) ratio = (ratio * 0x9aa508b5b7a84e1c677de54f3e99bc9) >> 128;\\n if (absTick & 0x20000 != 0) ratio = (ratio * 0x5d6af8dedb81196699c329225ee604) >> 128;\\n if (absTick & 0x40000 != 0) ratio = (ratio * 0x2216e584f5fa1ea926041bedfe98) >> 128;\\n if (absTick & 0x80000 != 0) ratio = (ratio * 0x48a170391f7dc42444e8fa2) >> 128;\\n\\n if (tick > 0) ratio = type(uint256).max / ratio;\\n\\n // this divides by 1<<32 rounding up to go from a Q128.128 to a Q128.96.\\n // we then downcast because we know the result always fits within 160 bits due to our tick input constraint\\n // we round up in the division so getTickAtSqrtRatio of the output price is always consistent\\n sqrtPriceX96 = uint160((ratio >> 32) + (ratio % (1 << 32) == 0 ? 0 : 1));\\n }\\n }\\n\\n /// @notice Calculates the greatest tick value such that getRatioAtTick(tick) <= ratio\\n /// @dev Throws in case sqrtPriceX96 < MIN_SQRT_RATIO, as MIN_SQRT_RATIO is the lowest value getRatioAtTick may\\n /// ever return.\\n /// @param sqrtPriceX96 The sqrt ratio for which to compute the tick as a Q64.96\\n /// @return tick The greatest tick for which the ratio is less than or equal to the input ratio\\n function getTickAtSqrtRatio(uint160 sqrtPriceX96) internal pure returns (int24 tick) {\\n unchecked {\\n // second inequality must be < because the price can never reach the price at the max tick\\n if (!(sqrtPriceX96 >= MIN_SQRT_RATIO && sqrtPriceX96 < MAX_SQRT_RATIO)) revert R();\\n uint256 ratio = uint256(sqrtPriceX96) << 32;\\n\\n uint256 r = ratio;\\n uint256 msb = 0;\\n\\n assembly {\\n let f := shl(7, gt(r, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF))\\n msb := or(msb, f)\\n r := shr(f, r)\\n }\\n assembly {\\n let f := shl(6, gt(r, 0xFFFFFFFFFFFFFFFF))\\n msb := or(msb, f)\\n r := shr(f, r)\\n }\\n assembly {\\n let f := shl(5, gt(r, 0xFFFFFFFF))\\n msb := or(msb, f)\\n r := shr(f, r)\\n }\\n assembly {\\n let f := shl(4, gt(r, 0xFFFF))\\n msb := or(msb, f)\\n r := shr(f, r)\\n }\\n assembly {\\n let f := shl(3, gt(r, 0xFF))\\n msb := or(msb, f)\\n r := shr(f, r)\\n }\\n assembly {\\n let f := shl(2, gt(r, 0xF))\\n msb := or(msb, f)\\n r := shr(f, r)\\n }\\n assembly {\\n let f := shl(1, gt(r, 0x3))\\n msb := or(msb, f)\\n r := shr(f, r)\\n }\\n assembly {\\n let f := gt(r, 0x1)\\n msb := or(msb, f)\\n }\\n\\n if (msb >= 128) r = ratio >> (msb - 127);\\n else r = ratio << (127 - msb);\\n\\n int256 log_2 = (int256(msb) - 128) << 64;\\n\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(63, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(62, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(61, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(60, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(59, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(58, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(57, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(56, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(55, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(54, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(53, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(52, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(51, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(50, f))\\n }\\n\\n int256 log_sqrt10001 = log_2 * 255738958999603826347141; // 128.128 number\\n\\n int24 tickLow = int24((log_sqrt10001 - 3402992956809132418596140100660247210) >> 128);\\n int24 tickHi = int24((log_sqrt10001 + 291339464771989622907027621153398088495) >> 128);\\n\\n tick = tickLow == tickHi ? tickLow : getSqrtRatioAtTick(tickHi) <= sqrtPriceX96 ? tickHi : tickLow;\\n }\\n }\\n}\\n\",\"keccak256\":\"0x5c57de03a91cc2ec8939865dbbcb0197bb6c353b711075eefd8e0fca5e102129\",\"license\":\"GPL-2.0-or-later\"},\"solidity/contracts/DataReceiver.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\npragma solidity >=0.8.8 <0.9.0;\\n\\nimport {Governable} from '@defi-wonderland/solidity-utils/solidity/contracts/Governable.sol';\\nimport {OracleSidechain} from './OracleSidechain.sol';\\nimport {IDataReceiver, IOracleFactory, IOracleSidechain, IBridgeReceiverAdapter} from '../interfaces/IDataReceiver.sol';\\n\\n/// @title The DataReceiver contract\\n/// @notice Handles reception of broadcast data and delivers it to correspondant oracle\\ncontract DataReceiver is IDataReceiver, Governable {\\n /// @inheritdoc IDataReceiver\\n IOracleFactory public immutable oracleFactory;\\n\\n /// @inheritdoc IDataReceiver\\n mapping(bytes32 => IOracleSidechain) public deployedOracles;\\n\\n /// @inheritdoc IDataReceiver\\n mapping(IBridgeReceiverAdapter => bool) public whitelistedAdapters;\\n\\n mapping(bytes32 => mapping(uint24 => IOracleSidechain.ObservationData[])) internal _cachedObservations;\\n\\n constructor(address _governor, IOracleFactory _oracleFactory) Governable(_governor) {\\n if (address(_oracleFactory) == address(0)) revert ZeroAddress();\\n oracleFactory = _oracleFactory;\\n }\\n\\n function addObservations(\\n IOracleSidechain.ObservationData[] memory _observationsData,\\n bytes32 _poolSalt,\\n uint24 _poolNonce\\n ) external onlyWhitelistedAdapters {\\n _addObservations(_observationsData, _poolSalt, _poolNonce);\\n }\\n\\n function _addObservations(\\n IOracleSidechain.ObservationData[] memory _observationsData,\\n bytes32 _poolSalt,\\n uint24 _poolNonce\\n ) internal {\\n // Read, store or deploy oracle given poolSalt\\n IOracleSidechain _oracle = deployedOracles[_poolSalt];\\n if (address(_oracle) == address(0)) {\\n _oracle = oracleFactory.getPool(_poolSalt);\\n if (address(_oracle) == address(0)) {\\n _oracle = oracleFactory.deployOracle(_poolSalt, _poolNonce);\\n }\\n deployedOracles[_poolSalt] = _oracle;\\n }\\n // Try to write observations data into oracle\\n if (_oracle.write(_observationsData, _poolNonce)) {\\n emit ObservationsAdded(_poolSalt, _poolNonce, msg.sender);\\n } else {\\n // Query pool's current nonce\\n uint24 _currentNonce = _oracle.poolNonce();\\n // Discard old observations (already written in the oracle)\\n // NOTE: if _currentNonce == _poolNonce it shouldn't reach this else block\\n if (_currentNonce > _poolNonce) revert ObservationsNotWritable();\\n // Store not-added observations to cachedObservations mapping\\n // NOTE: memory to storage is not supported\\n // cachedObservations[_poolSalt][_poolNonce] = _observationsData;\\n for (uint256 _i; _i < _observationsData.length; ++_i) {\\n _cachedObservations[_poolSalt][_poolNonce].push(_observationsData[_i]);\\n }\\n emit ObservationsCached(_poolSalt, _poolNonce, msg.sender);\\n while (_currentNonce <= _poolNonce) {\\n // Try backfilling pending observations (from current to {sent|first empty} nonce)\\n _observationsData = _cachedObservations[_poolSalt][_currentNonce];\\n // If the struct is not empty, write it into the oracle\\n if (_observationsData.length > 0) {\\n // Since observation nonce == oracle nonce, we can safely write the observations\\n _oracle.write(_observationsData, _currentNonce);\\n emit ObservationsAdded(_poolSalt, _currentNonce, msg.sender);\\n // Clear out the written observations\\n delete _cachedObservations[_poolSalt][_currentNonce];\\n _currentNonce++;\\n } else {\\n // When an empty nonce is found, break the loop\\n break;\\n }\\n }\\n }\\n }\\n\\n function whitelistAdapter(IBridgeReceiverAdapter _receiverAdapter, bool _isWhitelisted) external onlyGovernor {\\n _whitelistAdapter(_receiverAdapter, _isWhitelisted);\\n }\\n\\n /// @inheritdoc IDataReceiver\\n function whitelistAdapters(IBridgeReceiverAdapter[] calldata _receiverAdapters, bool[] calldata _isWhitelisted) external onlyGovernor {\\n uint256 _receiverAdapterLength = _receiverAdapters.length;\\n if (_receiverAdapterLength != _isWhitelisted.length) revert LengthMismatch();\\n unchecked {\\n for (uint256 _i; _i < _receiverAdapterLength; ++_i) {\\n _whitelistAdapter(_receiverAdapters[_i], _isWhitelisted[_i]);\\n }\\n }\\n }\\n\\n function _whitelistAdapter(IBridgeReceiverAdapter _receiverAdapter, bool _isWhitelisted) internal {\\n whitelistedAdapters[_receiverAdapter] = _isWhitelisted;\\n emit AdapterWhitelisted(_receiverAdapter, _isWhitelisted);\\n }\\n\\n modifier onlyWhitelistedAdapters() {\\n if (!whitelistedAdapters[IBridgeReceiverAdapter(msg.sender)]) revert UnallowedAdapter();\\n _;\\n }\\n}\\n\",\"keccak256\":\"0x7deb2aab640dc0ace6fdc7bb54a27f1a31c04a17754bb725d830b06075418d68\",\"license\":\"MIT\"},\"solidity/contracts/OracleSidechain.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\n/*\\n\\nCoded for The Keep3r Network with \\u2665 by\\n\\n\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2557\\u2591\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2557\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2557\\u2588\\u2588\\u2557\\u2591\\u2591\\u2591\\u2588\\u2588\\u2557\\u2591\\u2591\\u2591\\u2591\\u2591\\u2591\\u2591\\u2588\\u2588\\u2557\\u2591\\u2588\\u2588\\u2588\\u2588\\u2588\\u2557\\u2591\\u2588\\u2588\\u2588\\u2557\\u2591\\u2591\\u2588\\u2588\\u2557\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2557\\u2591\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2557\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2557\\u2591\\u2588\\u2588\\u2557\\u2591\\u2591\\u2591\\u2591\\u2591\\u2591\\u2588\\u2588\\u2588\\u2588\\u2588\\u2557\\u2591\\u2588\\u2588\\u2588\\u2557\\u2591\\u2591\\u2588\\u2588\\u2557\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2557\\u2591\\n\\u2588\\u2588\\u2554\\u2550\\u2550\\u2588\\u2588\\u2557\\u2588\\u2588\\u2554\\u2550\\u2550\\u2550\\u2550\\u255d\\u2588\\u2588\\u2554\\u2550\\u2550\\u2550\\u2550\\u255d\\u2588\\u2588\\u2551\\u2591\\u2591\\u2591\\u2588\\u2588\\u2551\\u2591\\u2591\\u2588\\u2588\\u2557\\u2591\\u2591\\u2588\\u2588\\u2551\\u2588\\u2588\\u2554\\u2550\\u2550\\u2588\\u2588\\u2557\\u2588\\u2588\\u2588\\u2588\\u2557\\u2591\\u2588\\u2588\\u2551\\u2588\\u2588\\u2554\\u2550\\u2550\\u2588\\u2588\\u2557\\u2588\\u2588\\u2554\\u2550\\u2550\\u2550\\u2550\\u255d\\u2588\\u2588\\u2554\\u2550\\u2550\\u2588\\u2588\\u2557\\u2588\\u2588\\u2551\\u2591\\u2591\\u2591\\u2591\\u2591\\u2588\\u2588\\u2554\\u2550\\u2550\\u2588\\u2588\\u2557\\u2588\\u2588\\u2588\\u2588\\u2557\\u2591\\u2588\\u2588\\u2551\\u2588\\u2588\\u2554\\u2550\\u2550\\u2588\\u2588\\u2557\\n\\u2588\\u2588\\u2551\\u2591\\u2591\\u2588\\u2588\\u2551\\u2588\\u2588\\u2588\\u2588\\u2588\\u2557\\u2591\\u2591\\u2588\\u2588\\u2588\\u2588\\u2588\\u2557\\u2591\\u2591\\u2588\\u2588\\u2551\\u2591\\u2591\\u2591\\u255a\\u2588\\u2588\\u2557\\u2588\\u2588\\u2588\\u2588\\u2557\\u2588\\u2588\\u2554\\u255d\\u2588\\u2588\\u2551\\u2591\\u2591\\u2588\\u2588\\u2551\\u2588\\u2588\\u2554\\u2588\\u2588\\u2557\\u2588\\u2588\\u2551\\u2588\\u2588\\u2551\\u2591\\u2591\\u2588\\u2588\\u2551\\u2588\\u2588\\u2588\\u2588\\u2588\\u2557\\u2591\\u2591\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2554\\u255d\\u2588\\u2588\\u2551\\u2591\\u2591\\u2591\\u2591\\u2591\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2551\\u2588\\u2588\\u2554\\u2588\\u2588\\u2557\\u2588\\u2588\\u2551\\u2588\\u2588\\u2551\\u2591\\u2591\\u2588\\u2588\\u2551\\n\\u2588\\u2588\\u2551\\u2591\\u2591\\u2588\\u2588\\u2551\\u2588\\u2588\\u2554\\u2550\\u2550\\u255d\\u2591\\u2591\\u2588\\u2588\\u2554\\u2550\\u2550\\u255d\\u2591\\u2591\\u2588\\u2588\\u2551\\u2591\\u2591\\u2591\\u2591\\u2588\\u2588\\u2588\\u2588\\u2554\\u2550\\u2588\\u2588\\u2588\\u2588\\u2551\\u2591\\u2588\\u2588\\u2551\\u2591\\u2591\\u2588\\u2588\\u2551\\u2588\\u2588\\u2551\\u255a\\u2588\\u2588\\u2588\\u2588\\u2551\\u2588\\u2588\\u2551\\u2591\\u2591\\u2588\\u2588\\u2551\\u2588\\u2588\\u2554\\u2550\\u2550\\u255d\\u2591\\u2591\\u2588\\u2588\\u2554\\u2550\\u2550\\u2588\\u2588\\u2557\\u2588\\u2588\\u2551\\u2591\\u2591\\u2591\\u2591\\u2591\\u2588\\u2588\\u2554\\u2550\\u2550\\u2588\\u2588\\u2551\\u2588\\u2588\\u2551\\u255a\\u2588\\u2588\\u2588\\u2588\\u2551\\u2588\\u2588\\u2551\\u2591\\u2591\\u2588\\u2588\\u2551\\n\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2554\\u255d\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2557\\u2588\\u2588\\u2551\\u2591\\u2591\\u2591\\u2591\\u2591\\u2588\\u2588\\u2551\\u2591\\u2591\\u2591\\u2591\\u255a\\u2588\\u2588\\u2554\\u255d\\u2591\\u255a\\u2588\\u2588\\u2554\\u255d\\u2591\\u255a\\u2588\\u2588\\u2588\\u2588\\u2588\\u2554\\u255d\\u2588\\u2588\\u2551\\u2591\\u255a\\u2588\\u2588\\u2588\\u2551\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2554\\u255d\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2557\\u2588\\u2588\\u2551\\u2591\\u2591\\u2588\\u2588\\u2551\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2557\\u2588\\u2588\\u2551\\u2591\\u2591\\u2588\\u2588\\u2551\\u2588\\u2588\\u2551\\u2591\\u255a\\u2588\\u2588\\u2588\\u2551\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2554\\u255d\\n\\u255a\\u2550\\u2550\\u2550\\u2550\\u2550\\u255d\\u2591\\u255a\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u255d\\u255a\\u2550\\u255d\\u2591\\u2591\\u2591\\u2591\\u2591\\u255a\\u2550\\u255d\\u2591\\u2591\\u2591\\u2591\\u2591\\u255a\\u2550\\u255d\\u2591\\u2591\\u2591\\u255a\\u2550\\u255d\\u2591\\u2591\\u2591\\u255a\\u2550\\u2550\\u2550\\u2550\\u255d\\u2591\\u255a\\u2550\\u255d\\u2591\\u2591\\u255a\\u2550\\u2550\\u255d\\u255a\\u2550\\u2550\\u2550\\u2550\\u2550\\u255d\\u2591\\u255a\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u255d\\u255a\\u2550\\u255d\\u2591\\u2591\\u255a\\u2550\\u255d\\u255a\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u255d\\u255a\\u2550\\u255d\\u2591\\u2591\\u255a\\u2550\\u255d\\u255a\\u2550\\u255d\\u2591\\u2591\\u255a\\u2550\\u2550\\u255d\\u255a\\u2550\\u2550\\u2550\\u2550\\u2550\\u255d\\u2591\\n\\nhttps://defi.sucks\\n\\n*/\\n\\npragma solidity >=0.8.8 <0.9.0;\\n\\nimport {IOracleSidechain, IOracleFactory} from '../interfaces/IOracleSidechain.sol';\\nimport {Oracle} from '@uniswap/v3-core/contracts/libraries/Oracle.sol';\\nimport {TickMath} from '@uniswap/v3-core/contracts/libraries/TickMath.sol';\\n\\n/// @title The SidechainOracle contract\\n/// @notice Computes and stores on-chain price data from Mainnet\\ncontract OracleSidechain is IOracleSidechain {\\n using Oracle for Oracle.Observation[65535];\\n\\n /// @inheritdoc IOracleSidechain\\n IOracleFactory public immutable factory;\\n\\n struct Slot0 {\\n // the current price\\n uint160 sqrtPriceX96;\\n // the current tick\\n int24 tick;\\n // the most-recently updated index of the observations array\\n uint16 observationIndex;\\n // the current maximum number of observations that are being stored\\n uint16 observationCardinality;\\n // the next maximum number of observations to store, triggered in observations.write\\n uint16 observationCardinalityNext;\\n // the current protocol fee as a percentage of the swap fee taken on withdrawal\\n // represented as an integer denominator (1/x)%\\n uint8 feeProtocol;\\n // whether the pool is locked\\n bool unlocked;\\n }\\n /// @inheritdoc IOracleSidechain\\n Slot0 public slot0;\\n\\n /// @inheritdoc IOracleSidechain\\n Oracle.Observation[65535] public observations;\\n\\n /// @inheritdoc IOracleSidechain\\n bytes32 public immutable poolSalt;\\n\\n uint24 public poolNonce;\\n /// @inheritdoc IOracleSidechain\\n address public token0;\\n /// @inheritdoc IOracleSidechain\\n address public token1;\\n /// @inheritdoc IOracleSidechain\\n uint24 public fee;\\n\\n /// @dev Returns the block timestamp truncated to 32 bits, i.e. mod 2**32. This method is overridden in tests.\\n function _getBlockTimestamp() internal view virtual returns (uint32) {\\n return uint32(block.timestamp); // truncation is desired\\n }\\n\\n constructor() {\\n factory = IOracleFactory(msg.sender);\\n uint16 _cardinality;\\n (poolSalt, poolNonce, _cardinality) = factory.oracleParameters();\\n\\n slot0 = Slot0({\\n sqrtPriceX96: 0,\\n tick: 0,\\n observationIndex: _cardinality - 1,\\n observationCardinality: _cardinality,\\n observationCardinalityNext: _cardinality,\\n feeProtocol: 0,\\n unlocked: true\\n });\\n }\\n\\n /// @inheritdoc IOracleSidechain\\n function initializePoolInfo(\\n address _tokenA,\\n address _tokenB,\\n uint24 _fee\\n ) external {\\n if (!slot0.unlocked) revert AI();\\n\\n (address _token0, address _token1) = _tokenA < _tokenB ? (_tokenA, _tokenB) : (_tokenB, _tokenA);\\n if (poolSalt != keccak256(abi.encode(_token0, _token1, _fee))) revert InvalidPool();\\n\\n token0 = _token0;\\n token1 = _token1;\\n fee = _fee;\\n slot0.unlocked = false;\\n\\n emit PoolInfoInitialized(poolSalt, _token0, _token1, _fee);\\n }\\n\\n /// @inheritdoc IOracleSidechain\\n function observe(uint32[] calldata _secondsAgos)\\n external\\n view\\n returns (int56[] memory _tickCumulatives, uint160[] memory _secondsPerLiquidityCumulativeX128s)\\n {\\n return observations.observe(_getBlockTimestamp(), _secondsAgos, slot0.tick, slot0.observationIndex, 0, slot0.observationCardinality);\\n }\\n\\n /// @inheritdoc IOracleSidechain\\n function write(ObservationData[] memory _observationsData, uint24 _poolNonce) external onlyDataReceiver returns (bool _written) {\\n if (_poolNonce != poolNonce) return false;\\n poolNonce++;\\n\\n uint256 _observationsDataLength = _observationsData.length;\\n for (uint256 _i; _i < _observationsDataLength; ) {\\n _write(_observationsData[_i]);\\n unchecked {\\n ++_i;\\n }\\n }\\n slot0.sqrtPriceX96 = TickMath.getSqrtRatioAtTick(slot0.tick);\\n\\n // emits UniV3 Swap event topic with minimal data\\n emit Swap(address(0), address(0), 0, 0, slot0.sqrtPriceX96, 0, slot0.tick);\\n return true;\\n }\\n\\n function increaseObservationCardinalityNext(uint16 _observationCardinalityNext) external onlyFactory {\\n uint16 _observationCardinalityNextOld = slot0.observationCardinalityNext;\\n if (_observationCardinalityNext <= _observationCardinalityNextOld) revert AI();\\n slot0.observationCardinalityNext = _observationCardinalityNext;\\n emit IncreaseObservationCardinalityNext(_observationCardinalityNextOld, _observationCardinalityNext);\\n }\\n\\n function _write(ObservationData memory _observationData) private {\\n (uint16 _indexUpdated, uint16 _cardinalityUpdated) = observations.write(\\n slot0.observationIndex,\\n _observationData.blockTimestamp,\\n slot0.tick,\\n 0,\\n slot0.observationCardinality,\\n slot0.observationCardinalityNext\\n );\\n (slot0.observationIndex, slot0.observationCardinality) = (_indexUpdated, _cardinalityUpdated);\\n slot0.tick = _observationData.tick;\\n }\\n\\n modifier onlyDataReceiver() {\\n if (msg.sender != address(factory.dataReceiver())) revert OnlyDataReceiver();\\n _;\\n }\\n\\n modifier onlyFactory() {\\n if (msg.sender != address(factory)) revert OnlyFactory();\\n _;\\n }\\n}\\n\",\"keccak256\":\"0x1b830dc6ad7405f2d533e1aa8eb079853edcdf301b396ac6b1d3c41573b62787\",\"license\":\"MIT\"},\"solidity/interfaces/IDataReceiver.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\npragma solidity >=0.8.8 <0.9.0;\\n\\nimport {IGovernable} from '@defi-wonderland/solidity-utils/solidity/interfaces/IGovernable.sol';\\nimport {IOracleFactory} from './IOracleFactory.sol';\\nimport {IOracleSidechain} from './IOracleSidechain.sol';\\nimport {IBridgeReceiverAdapter} from './bridges/IBridgeReceiverAdapter.sol';\\n\\ninterface IDataReceiver is IGovernable {\\n // STATE VARIABLES\\n\\n /// @return _oracleFactory The address of the OracleFactory\\n function oracleFactory() external view returns (IOracleFactory _oracleFactory);\\n\\n /// @notice Tracks already deployed oracles\\n /// @param _poolSalt The identifier of the oracle\\n /// @return _deployedOracle The address of the correspondant Oracle\\n function deployedOracles(bytes32 _poolSalt) external view returns (IOracleSidechain _deployedOracle);\\n\\n /// @notice Tracks the whitelisting of bridge adapters\\n /// @param _adapter Address of the bridge adapter to consult\\n /// @return _isAllowed Whether a bridge adapter is whitelisted\\n function whitelistedAdapters(IBridgeReceiverAdapter _adapter) external view returns (bool _isAllowed);\\n\\n // EVENTS\\n\\n /// @notice Emitted when a broadcast observation is succesfully processed\\n /// @param _poolSalt Identifier of the pool to fetch\\n /// @return _poolNonce Nonce of the observation broadcast\\n /// @return _receiverAdapter Handler of the broadcast\\n event ObservationsAdded(bytes32 indexed _poolSalt, uint24 _poolNonce, address _receiverAdapter);\\n\\n /// @notice Emitted when a broadcast observation is cached for later processing\\n /// @param _poolSalt Identifier of the pool to fetch\\n /// @return _poolNonce Nonce of the observation broadcast\\n /// @return _receiverAdapter Handler of the broadcast\\n event ObservationsCached(bytes32 indexed _poolSalt, uint24 _poolNonce, address _receiverAdapter);\\n\\n /// @notice Emitted when a new adapter whitelisting rule is set\\n /// @param _adapter Address of the adapter\\n /// @param _isAllowed New whitelisting status\\n event AdapterWhitelisted(IBridgeReceiverAdapter _adapter, bool _isAllowed);\\n\\n // ERRORS\\n\\n /// @notice Thrown when the broadcast nonce is incorrect\\n error ObservationsNotWritable();\\n\\n /// @notice Thrown when a not-whitelisted adapter triggers an update\\n error UnallowedAdapter();\\n\\n // FUNCTIONS\\n\\n /// @notice Allows whitelisted bridge adapters to push a broadcast\\n /// @param _observationsData Array of tuples containing the dataset\\n /// @param _poolSalt Identifier of the pool to fetch\\n /// @param _poolNonce Nonce of the observation broadcast\\n function addObservations(\\n IOracleSidechain.ObservationData[] memory _observationsData,\\n bytes32 _poolSalt,\\n uint24 _poolNonce\\n ) external;\\n\\n /// @notice Allows governance to set an adapter whitelisted state\\n /// @param _receiverAdapter Address of the adapter\\n /// @param _isWhitelisted New whitelisting status\\n function whitelistAdapter(IBridgeReceiverAdapter _receiverAdapter, bool _isWhitelisted) external;\\n\\n /// @notice Allows governance to batch set adapters whitelisted state\\n /// @param _receiverAdapters Array of addresses of the adapter\\n /// @param _isWhitelisted Array of whitelisting status for each address\\n function whitelistAdapters(IBridgeReceiverAdapter[] calldata _receiverAdapters, bool[] calldata _isWhitelisted) external;\\n}\\n\",\"keccak256\":\"0x0d0e8404bc039a5fe8574b2ffd53489946fca020f72929caeced68e66f86e768\",\"license\":\"MIT\"},\"solidity/interfaces/IOracleFactory.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\npragma solidity >=0.8.8 <0.9.0;\\n\\nimport {IGovernable} from '@defi-wonderland/solidity-utils/solidity/interfaces/IGovernable.sol';\\nimport {IOracleSidechain} from './IOracleSidechain.sol';\\nimport {IDataReceiver} from './IDataReceiver.sol';\\n\\ninterface IOracleFactory is IGovernable {\\n // STRUCTS\\n\\n struct OracleParameters {\\n bytes32 poolSalt; // Identifier of the pool and oracle\\n uint24 poolNonce; // Initial nonce of the deployed pool\\n uint16 cardinality; // Initial cardinality of the deployed pool\\n }\\n\\n // STATE VARIABLES\\n\\n /// @return _oracleInitCodeHash The oracle creation code hash used to calculate their address\\n //solhint-disable-next-line func-name-mixedcase\\n function ORACLE_INIT_CODE_HASH() external view returns (bytes32 _oracleInitCodeHash);\\n\\n /// @return _dataReceiver The address of the DataReceiver for the oracles to consult\\n function dataReceiver() external view returns (IDataReceiver _dataReceiver);\\n\\n /// @return _poolSalt The id of both the oracle and the pool\\n /// @return _poolNonce The initial nonce of the pool data\\n /// @return _cardinality The size of the observations memory storage\\n function oracleParameters()\\n external\\n view\\n returns (\\n bytes32 _poolSalt,\\n uint24 _poolNonce,\\n uint16 _cardinality\\n );\\n\\n /// @return _initialCardinality The initial size of the observations memory storage for newly deployed pools\\n function initialCardinality() external view returns (uint16 _initialCardinality);\\n\\n // EVENTS\\n\\n /// @notice Emitted when a new oracle is deployed\\n /// @param _poolSalt The id of both the oracle and the pool\\n /// @param _oracle The address of the deployed oracle\\n /// @param _initialNonce The initial nonce of the pool data\\n event OracleDeployed(bytes32 indexed _poolSalt, address indexed _oracle, uint24 _initialNonce);\\n\\n /// @notice Emitted when a new DataReceiver is set\\n /// @param _dataReceiver The address of the new DataReceiver\\n event DataReceiverSet(IDataReceiver _dataReceiver);\\n\\n /// @notice Emitted when a new initial oracle cardinality is set\\n /// @param _initialCardinality The initial length of the observationCardinality array\\n event InitialCardinalitySet(uint16 _initialCardinality);\\n\\n // ERRORS\\n\\n /// @notice Thrown when a contract other than the DataReceiver tries to deploy an oracle\\n error OnlyDataReceiver();\\n\\n // FUNCTIONS\\n\\n /// @notice Deploys a new oracle given an inputted salt\\n /// @dev Requires that the salt has not been deployed before\\n /// @param _poolSalt Pool salt that deterministically binds an oracle with a pool\\n /// @return _oracle The address of the newly deployed oracle\\n function deployOracle(bytes32 _poolSalt, uint24 _poolNonce) external returns (IOracleSidechain _oracle);\\n\\n /// @notice Allows governor to set a new allowed dataReceiver\\n /// @dev Will disallow the previous dataReceiver\\n /// @param _dataReceiver The address of the new allowed dataReceiver\\n function setDataReceiver(IDataReceiver _dataReceiver) external;\\n\\n /// @notice Allows governor to set a new initial cardinality for new oracles\\n /// @param _initialCardinality The initial size of the observations memory storage for newly deployed pools\\n function setInitialCardinality(uint16 _initialCardinality) external;\\n\\n /// @notice Overrides UniV3Factory getPool mapping\\n /// @param _tokenA The contract address of either token0 or token1\\n /// @param _tokenB The contract address of the other token\\n /// @param _fee The fee denominated in hundredths of a bip\\n /// @return _oracle The oracle address\\n function getPool(\\n address _tokenA,\\n address _tokenB,\\n uint24 _fee\\n ) external view returns (IOracleSidechain _oracle);\\n\\n /// @notice Tracks the addresses of the oracle by poolSalt\\n /// @param _poolSalt Identifier of both the pool and the oracle\\n /// @return _oracle The address (if deployed) of the correspondant oracle\\n function getPool(bytes32 _poolSalt) external view returns (IOracleSidechain _oracle);\\n\\n /// @param _tokenA The contract address of either token0 or token1\\n /// @param _tokenB The contract address of the other token\\n /// @param _fee The fee denominated in hundredths of a bip\\n /// @return _poolSalt Pool salt for inquired parameters\\n function getPoolSalt(\\n address _tokenA,\\n address _tokenB,\\n uint24 _fee\\n ) external view returns (bytes32 _poolSalt);\\n}\\n\",\"keccak256\":\"0xc32bfc32a274923ce1a089acc024396e702ae354773f0ac0a683e43ded904954\",\"license\":\"MIT\"},\"solidity/interfaces/IOracleSidechain.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\npragma solidity >=0.8.8 <0.9.0;\\n\\nimport {IOracleFactory} from './IOracleFactory.sol';\\n\\ninterface IOracleSidechain {\\n // STRUCTS\\n\\n struct ObservationData {\\n uint32 blockTimestamp;\\n int24 tick;\\n }\\n\\n // STATE VARIABLES\\n\\n /// @return _oracleFactory The address of the OracleFactory\\n function factory() external view returns (IOracleFactory _oracleFactory);\\n\\n /// @return _token0 The mainnet address of the Token0 of the oracle\\n function token0() external view returns (address _token0);\\n\\n /// @return _token1 The mainnet address of the Token1 of the oracle\\n function token1() external view returns (address _token1);\\n\\n /// @return _fee The fee identifier of the pool\\n function fee() external view returns (uint24 _fee);\\n\\n /// @return _poolSalt The identifier of both the pool and the oracle\\n function poolSalt() external view returns (bytes32 _poolSalt);\\n\\n /// @return _poolNonce Last recorded nonce of the pool history\\n function poolNonce() external view returns (uint24 _poolNonce);\\n\\n /// @notice Replicates the UniV3Pool slot0 behaviour (semi-compatible)\\n /// @return _sqrtPriceX96 Used to maintain compatibility with Uniswap V3\\n /// @return _tick Used to maintain compatibility with Uniswap V3\\n /// @return _observationIndex The index of the last oracle observation that was written,\\n /// @return _observationCardinality The current maximum number of observations stored in the pool,\\n /// @return _observationCardinalityNext The next maximum number of observations, to be updated when the observation.\\n /// @return _feeProtocol Used to maintain compatibility with Uniswap V3\\n /// @return _unlocked Used to track if a pool information was already verified\\n function slot0()\\n external\\n view\\n returns (\\n uint160 _sqrtPriceX96,\\n int24 _tick,\\n uint16 _observationIndex,\\n uint16 _observationCardinality,\\n uint16 _observationCardinalityNext,\\n uint8 _feeProtocol,\\n bool _unlocked\\n );\\n\\n /// @notice Returns data about a specific observation index\\n /// @param _index The element of the observations array to fetch\\n /// @return _blockTimestamp The timestamp of the observation,\\n /// @return _tickCumulative the tick multiplied by seconds elapsed for the life of the pool as of the observation timestamp,\\n /// @return _secondsPerLiquidityCumulativeX128 the seconds per in range liquidity for the life of the pool as of the observation timestamp,\\n /// @return _initialized whether the observation has been initialized and the values are safe to use\\n function observations(uint256 _index)\\n external\\n view\\n returns (\\n uint32 _blockTimestamp,\\n int56 _tickCumulative,\\n uint160 _secondsPerLiquidityCumulativeX128,\\n bool _initialized\\n );\\n\\n // EVENTS\\n\\n /// @notice Emitted when the pool information is verified\\n /// @param _poolSalt Identifier of the pool and the oracle\\n /// @param _token0 The contract address of either token0 or token1\\n /// @param _token1 The contract address of the other token\\n /// @param _fee The fee denominated in hundredths of a bip\\n event PoolInfoInitialized(bytes32 indexed _poolSalt, address _token0, address _token1, uint24 _fee);\\n\\n /// @notice Emitted by the oracle to hint indexers that the pool state has changed\\n /// @dev Imported from IUniswapV3PoolEvents (semi-compatible)\\n /// @param _sqrtPriceX96 The sqrt(price) of the pool after the swap, as a Q64.96\\n /// @param _tick The log base 1.0001 of price of the pool after the swap\\n event Swap(address indexed, address indexed, int256, int256, uint160 _sqrtPriceX96, uint128, int24 _tick);\\n\\n /// @notice Emitted by the oracle for increases to the number of observations that can be stored\\n /// @dev Imported from IUniswapV3PoolEvents (fully-compatible)\\n /// @param _observationCardinalityNextOld The previous value of the next observation cardinality\\n /// @param _observationCardinalityNextNew The updated value of the next observation cardinality\\n event IncreaseObservationCardinalityNext(uint16 _observationCardinalityNextOld, uint16 _observationCardinalityNextNew);\\n\\n // ERRORS\\n\\n /// @notice Thrown if the pool info is already initialized or if the observationCardinalityNext is already increased\\n error AI();\\n\\n /// @notice Thrown if the pool info does not correspond to the pool salt\\n error InvalidPool();\\n\\n /// @notice Thrown if the DataReceiver contract is not the one calling for writing observations\\n error OnlyDataReceiver();\\n\\n /// @notice Thrown if the OracleFactory contract is not the one calling for increasing observationCardinalityNext\\n error OnlyFactory();\\n\\n // FUNCTIONS\\n\\n /// @notice Permisionless method to verify token0, token1 and fee\\n /// @dev Before verified, token0 and token1 views will return address(0)\\n /// @param _tokenA The contract address of either token0 or token1\\n /// @param _tokenB The contract address of the other token\\n /// @param _fee The fee denominated in hundredths of a bip\\n function initializePoolInfo(\\n address _tokenA,\\n address _tokenB,\\n uint24 _fee\\n ) external;\\n\\n /// @notice Returns the cumulative tick and liquidity as of each timestamp `secondsAgo` from the current block timestamp\\n /// @dev Imported from UniV3Pool (semi compatible, optimistically extrapolates)\\n /// @param _secondsAgos From how long ago each cumulative tick and liquidity value should be returned\\n /// @return _tickCumulatives Cumulative tick values as of each `secondsAgos` from the current block timestamp\\n /// @return _secondsCumulativeX128s Cumulative seconds as of each `secondsAgos` from the current block timestamp\\n function observe(uint32[] calldata _secondsAgos)\\n external\\n view\\n returns (int56[] memory _tickCumulatives, uint160[] memory _secondsCumulativeX128s);\\n\\n /// @notice Permisioned method to push a dataset to update\\n /// @param _observationsData Array of tuples containing the dataset\\n /// @param _poolNonce Nonce of the observation broadcast\\n function write(ObservationData[] memory _observationsData, uint24 _poolNonce) external returns (bool _written);\\n\\n /// @notice Permisioned method to increase the cardinalityNext value\\n /// @param _observationCardinalityNext The new next length of the observations array\\n function increaseObservationCardinalityNext(uint16 _observationCardinalityNext) external;\\n}\\n\",\"keccak256\":\"0xa90206e3de00ad866b7f4792ce29220ee0ca561d59629ba638a31c4d6fd3941b\",\"license\":\"MIT\"},\"solidity/interfaces/bridges/IBridgeReceiverAdapter.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\npragma solidity >=0.8.8 <0.9.0;\\n\\nimport {IBaseErrors} from '@defi-wonderland/solidity-utils/solidity/interfaces/IBaseErrors.sol';\\nimport {IDataReceiver} from '../IDataReceiver.sol';\\nimport {IOracleSidechain} from '../IOracleSidechain.sol';\\n\\ninterface IBridgeReceiverAdapter is IBaseErrors {\\n // STATE VARIABLES\\n\\n /// @notice Gets the address of the DataReceiver contract\\n /// @return _dataReceiver Address of the DataReceiver contract\\n function dataReceiver() external view returns (IDataReceiver _dataReceiver);\\n\\n /* NOTE: callback methods should be here declared */\\n}\\n\",\"keccak256\":\"0x49e5c9c6a28521933a3f2b01a529fbae9aac1edd71dbe904586a2f06148b1974\",\"license\":\"MIT\"}},\"version\":1}", - "bytecode": "0x60a060405234801561001057600080fd5b50604051610fa0380380610fa083398101604081905261002f916100bc565b816001600160a01b0381166100575760405163d92e233d60e01b815260040160405180910390fd5b600080546001600160a01b0319166001600160a01b0392831617905581166100925760405163d92e233d60e01b815260040160405180910390fd5b6001600160a01b0316608052506100f6565b6001600160a01b03811681146100b957600080fd5b50565b600080604083850312156100cf57600080fd5b82516100da816100a4565b60208401519092506100eb816100a4565b809150509250929050565b608051610e8161011f600039600081816101640152818161045801526104fc0152610e816000f3fe608060405234801561001057600080fd5b506004361061009e5760003560e01c8063b893cce211610066578063b893cce21461012c578063c7f7fb901461015f578063d34ad40914610186578063e3056a3414610199578063f235757f146101ac57600080fd5b80630c340a24146100a35780630ddb5dd2146100d357806313f6986d146100e85780636607baca146100f0578063954e863e14610119575b600080fd5b6000546100b6906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b6100e66100e1366004610a69565b6101bf565b005b6100e661027f565b6100b66100fe366004610ad5565b6002602052600090815260409020546001600160a01b031681565b6100e6610127366004610b11565b6102b4565b61014f61013a366004610b4a565b60036020526000908152604090205460ff1681565b60405190151581526020016100ca565b6100b67f000000000000000000000000000000000000000000000000000000000000000081565b6100e6610194366004610bff565b6102ed565b6001546100b6906001600160a01b031681565b6100e66101ba366004610b4a565b61032d565b6000546001600160a01b031633146101ea5760405163070545c960e51b815260040160405180910390fd5b8281811461020e576040516001621398b960e31b0319815260040160405180910390fd5b60005b818110156102775761026f86868381811061022e5761022e610d0b565b90506020020160208101906102439190610b4a565b85858481811061025557610255610d0b565b905060200201602081019061026a9190610d21565b610364565b600101610211565b505050505050565b6001546001600160a01b031633146102aa57604051639ba0305d60e01b815260040160405180910390fd5b6102b26103c7565b565b6000546001600160a01b031633146102df5760405163070545c960e51b815260040160405180910390fd5b6102e98282610364565b5050565b3360009081526003602052604090205460ff1661031d576040516360ece74160e01b815260040160405180910390fd5b610328838383610425565b505050565b6000546001600160a01b031633146103585760405163070545c960e51b815260040160405180910390fd5b61036181610958565b50565b6001600160a01b038216600081815260036020908152604091829020805460ff19168515159081179091558251938452908301527f3cece36ac6216147f57b10bb30975f82b18b8b290a7925c322277e684afcce4a910160405180910390a15050565b60018054600080546001600160a01b0383166001600160a01b031991821681179092559091169091556040519081527f5d5d6e01b731c3e68060f7fe13156f6197d4aeffc2d6f498e34c717ae616b7349060200160405180910390a1565b6000828152600260205260409020546001600160a01b03168061059c5760405163f6c0092760e01b8152600481018490527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063f6c0092790602401602060405180830381865afa1580156104a7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104cb9190610d3e565b90506001600160a01b03811661057457604051632e60fe9b60e11b81526004810184905262ffffff831660248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690635cc1fd36906044016020604051808303816000875af115801561054d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105719190610d3e565b90505b600083815260026020526040902080546001600160a01b0319166001600160a01b0383161790555b6040516308f944b560e21b81526001600160a01b038216906323e512d4906105ca9087908690600401610d5b565b6020604051808303816000875af11580156105e9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061060d9190610dc0565b15610656576040805162ffffff8416815233602082015284917f9a777601844e27c439fe9f23f4ada7ea2b67551ea35b07439e3dad53e0e369cd910160405180910390a2610952565b6000816001600160a01b0316639fdbd4d76040518163ffffffff1660e01b8152600401602060405180830381865afa158015610696573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106ba9190610ddd565b90508262ffffff168162ffffff1611156106e757604051630a96dcbd60e11b815260040160405180910390fd5b60005b855181101561078757600085815260046020908152604080832062ffffff881684529091529020865187908390811061072557610725610d0b565b6020908102919091018101518254600181018455600093845292829020815193018054919092015162ffffff166401000000000266ffffffffffffff1990911663ffffffff9093169290921791909117905561078081610e10565b90506106ea565b506040805162ffffff8516815233602082015285917fca8a146eac241d31b0d3d0650d8747b21a7d1f1a21c55abdbb7209740d742dd1910160405180910390a25b8262ffffff168162ffffff161161095057600084815260046020908152604080832062ffffff85168452825280832080548251818502810185019093528083529193909284015b82821015610856576000848152602090819020604080518082019091529084015463ffffffff81168252640100000000900460020b8183015282526001909201910161080f565b505050509450600085511115610950576040516308f944b560e21b81526001600160a01b038316906323e512d4906108949088908590600401610d5b565b6020604051808303816000875af11580156108b3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108d79190610dc0565b506040805162ffffff8316815233602082015285917f9a777601844e27c439fe9f23f4ada7ea2b67551ea35b07439e3dad53e0e369cd910160405180910390a2600084815260046020908152604080832062ffffff85168452909152812061093e916109e1565b8061094881610e29565b9150506107c8565b505b50505050565b6001600160a01b03811661097f5760405163d92e233d60e01b815260040160405180910390fd5b600180546001600160a01b0319166001600160a01b038381169182179092556000546040805191909316815260208101919091527f6353ec38ac394f8be94bfafcdd3580d356470599059eaeebedc3207e1cc03dec910160405180910390a150565b508054600082559060005260206000209081019061036191905b80821115610a1957805466ffffffffffffff191681556001016109fb565b5090565b60008083601f840112610a2f57600080fd5b50813567ffffffffffffffff811115610a4757600080fd5b6020830191508360208260051b8501011115610a6257600080fd5b9250929050565b60008060008060408587031215610a7f57600080fd5b843567ffffffffffffffff80821115610a9757600080fd5b610aa388838901610a1d565b90965094506020870135915080821115610abc57600080fd5b50610ac987828801610a1d565b95989497509550505050565b600060208284031215610ae757600080fd5b5035919050565b6001600160a01b038116811461036157600080fd5b801515811461036157600080fd5b60008060408385031215610b2457600080fd5b8235610b2f81610aee565b91506020830135610b3f81610b03565b809150509250929050565b600060208284031215610b5c57600080fd5b8135610b6781610aee565b9392505050565b634e487b7160e01b600052604160045260246000fd5b6040805190810167ffffffffffffffff81118282101715610ba757610ba7610b6e565b60405290565b604051601f8201601f1916810167ffffffffffffffff81118282101715610bd657610bd6610b6e565b604052919050565b62ffffff8116811461036157600080fd5b8035610bfa81610bde565b919050565b600080600060608486031215610c1457600080fd5b833567ffffffffffffffff80821115610c2c57600080fd5b818601915086601f830112610c4057600080fd5b8135602082821115610c5457610c54610b6e565b610c62818360051b01610bad565b828152818101935060069290921b840181019189831115610c8257600080fd5b938101935b82851015610cea576040858b031215610ca05760008081fd5b610ca8610b84565b853563ffffffff81168114610cbd5760008081fd5b815285830135600281900b8114610cd45760008081fd5b8184015284526040949094019392810192610c87565b96508701359450610d02925050604086019050610bef565b90509250925092565b634e487b7160e01b600052603260045260246000fd5b600060208284031215610d3357600080fd5b8135610b6781610b03565b600060208284031215610d5057600080fd5b8151610b6781610aee565b60408082528351828201819052600091906020906060850190828801855b82811015610da7578151805163ffffffff16855285015160020b858501529285019290840190600101610d79565b50505062ffffff95909516930192909252509092915050565b600060208284031215610dd257600080fd5b8151610b6781610b03565b600060208284031215610def57600080fd5b8151610b6781610bde565b634e487b7160e01b600052601160045260246000fd5b600060018201610e2257610e22610dfa565b5060010190565b600062ffffff808316818103610e4157610e41610dfa565b600101939250505056fea264697066735822122034fd09118d3d0be727d85a098f8ee3713b14cb27c0ce5bd2232a496b84d3abcf64736f6c634300080f0033", - "deployedBytecode": "0x608060405234801561001057600080fd5b506004361061009e5760003560e01c8063b893cce211610066578063b893cce21461012c578063c7f7fb901461015f578063d34ad40914610186578063e3056a3414610199578063f235757f146101ac57600080fd5b80630c340a24146100a35780630ddb5dd2146100d357806313f6986d146100e85780636607baca146100f0578063954e863e14610119575b600080fd5b6000546100b6906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b6100e66100e1366004610a69565b6101bf565b005b6100e661027f565b6100b66100fe366004610ad5565b6002602052600090815260409020546001600160a01b031681565b6100e6610127366004610b11565b6102b4565b61014f61013a366004610b4a565b60036020526000908152604090205460ff1681565b60405190151581526020016100ca565b6100b67f000000000000000000000000000000000000000000000000000000000000000081565b6100e6610194366004610bff565b6102ed565b6001546100b6906001600160a01b031681565b6100e66101ba366004610b4a565b61032d565b6000546001600160a01b031633146101ea5760405163070545c960e51b815260040160405180910390fd5b8281811461020e576040516001621398b960e31b0319815260040160405180910390fd5b60005b818110156102775761026f86868381811061022e5761022e610d0b565b90506020020160208101906102439190610b4a565b85858481811061025557610255610d0b565b905060200201602081019061026a9190610d21565b610364565b600101610211565b505050505050565b6001546001600160a01b031633146102aa57604051639ba0305d60e01b815260040160405180910390fd5b6102b26103c7565b565b6000546001600160a01b031633146102df5760405163070545c960e51b815260040160405180910390fd5b6102e98282610364565b5050565b3360009081526003602052604090205460ff1661031d576040516360ece74160e01b815260040160405180910390fd5b610328838383610425565b505050565b6000546001600160a01b031633146103585760405163070545c960e51b815260040160405180910390fd5b61036181610958565b50565b6001600160a01b038216600081815260036020908152604091829020805460ff19168515159081179091558251938452908301527f3cece36ac6216147f57b10bb30975f82b18b8b290a7925c322277e684afcce4a910160405180910390a15050565b60018054600080546001600160a01b0383166001600160a01b031991821681179092559091169091556040519081527f5d5d6e01b731c3e68060f7fe13156f6197d4aeffc2d6f498e34c717ae616b7349060200160405180910390a1565b6000828152600260205260409020546001600160a01b03168061059c5760405163f6c0092760e01b8152600481018490527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063f6c0092790602401602060405180830381865afa1580156104a7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104cb9190610d3e565b90506001600160a01b03811661057457604051632e60fe9b60e11b81526004810184905262ffffff831660248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690635cc1fd36906044016020604051808303816000875af115801561054d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105719190610d3e565b90505b600083815260026020526040902080546001600160a01b0319166001600160a01b0383161790555b6040516308f944b560e21b81526001600160a01b038216906323e512d4906105ca9087908690600401610d5b565b6020604051808303816000875af11580156105e9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061060d9190610dc0565b15610656576040805162ffffff8416815233602082015284917f9a777601844e27c439fe9f23f4ada7ea2b67551ea35b07439e3dad53e0e369cd910160405180910390a2610952565b6000816001600160a01b0316639fdbd4d76040518163ffffffff1660e01b8152600401602060405180830381865afa158015610696573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106ba9190610ddd565b90508262ffffff168162ffffff1611156106e757604051630a96dcbd60e11b815260040160405180910390fd5b60005b855181101561078757600085815260046020908152604080832062ffffff881684529091529020865187908390811061072557610725610d0b565b6020908102919091018101518254600181018455600093845292829020815193018054919092015162ffffff166401000000000266ffffffffffffff1990911663ffffffff9093169290921791909117905561078081610e10565b90506106ea565b506040805162ffffff8516815233602082015285917fca8a146eac241d31b0d3d0650d8747b21a7d1f1a21c55abdbb7209740d742dd1910160405180910390a25b8262ffffff168162ffffff161161095057600084815260046020908152604080832062ffffff85168452825280832080548251818502810185019093528083529193909284015b82821015610856576000848152602090819020604080518082019091529084015463ffffffff81168252640100000000900460020b8183015282526001909201910161080f565b505050509450600085511115610950576040516308f944b560e21b81526001600160a01b038316906323e512d4906108949088908590600401610d5b565b6020604051808303816000875af11580156108b3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108d79190610dc0565b506040805162ffffff8316815233602082015285917f9a777601844e27c439fe9f23f4ada7ea2b67551ea35b07439e3dad53e0e369cd910160405180910390a2600084815260046020908152604080832062ffffff85168452909152812061093e916109e1565b8061094881610e29565b9150506107c8565b505b50505050565b6001600160a01b03811661097f5760405163d92e233d60e01b815260040160405180910390fd5b600180546001600160a01b0319166001600160a01b038381169182179092556000546040805191909316815260208101919091527f6353ec38ac394f8be94bfafcdd3580d356470599059eaeebedc3207e1cc03dec910160405180910390a150565b508054600082559060005260206000209081019061036191905b80821115610a1957805466ffffffffffffff191681556001016109fb565b5090565b60008083601f840112610a2f57600080fd5b50813567ffffffffffffffff811115610a4757600080fd5b6020830191508360208260051b8501011115610a6257600080fd5b9250929050565b60008060008060408587031215610a7f57600080fd5b843567ffffffffffffffff80821115610a9757600080fd5b610aa388838901610a1d565b90965094506020870135915080821115610abc57600080fd5b50610ac987828801610a1d565b95989497509550505050565b600060208284031215610ae757600080fd5b5035919050565b6001600160a01b038116811461036157600080fd5b801515811461036157600080fd5b60008060408385031215610b2457600080fd5b8235610b2f81610aee565b91506020830135610b3f81610b03565b809150509250929050565b600060208284031215610b5c57600080fd5b8135610b6781610aee565b9392505050565b634e487b7160e01b600052604160045260246000fd5b6040805190810167ffffffffffffffff81118282101715610ba757610ba7610b6e565b60405290565b604051601f8201601f1916810167ffffffffffffffff81118282101715610bd657610bd6610b6e565b604052919050565b62ffffff8116811461036157600080fd5b8035610bfa81610bde565b919050565b600080600060608486031215610c1457600080fd5b833567ffffffffffffffff80821115610c2c57600080fd5b818601915086601f830112610c4057600080fd5b8135602082821115610c5457610c54610b6e565b610c62818360051b01610bad565b828152818101935060069290921b840181019189831115610c8257600080fd5b938101935b82851015610cea576040858b031215610ca05760008081fd5b610ca8610b84565b853563ffffffff81168114610cbd5760008081fd5b815285830135600281900b8114610cd45760008081fd5b8184015284526040949094019392810192610c87565b96508701359450610d02925050604086019050610bef565b90509250925092565b634e487b7160e01b600052603260045260246000fd5b600060208284031215610d3357600080fd5b8135610b6781610b03565b600060208284031215610d5057600080fd5b8151610b6781610aee565b60408082528351828201819052600091906020906060850190828801855b82811015610da7578151805163ffffffff16855285015160020b858501529285019290840190600101610d79565b50505062ffffff95909516930192909252509092915050565b600060208284031215610dd257600080fd5b8151610b6781610b03565b600060208284031215610def57600080fd5b8151610b6781610bde565b634e487b7160e01b600052601160045260246000fd5b600060018201610e2257610e22610dfa565b5060010190565b600062ffffff808316818103610e4157610e41610dfa565b600101939250505056fea264697066735822122034fd09118d3d0be727d85a098f8ee3713b14cb27c0ce5bd2232a496b84d3abcf64736f6c634300080f0033", - "devdoc": { - "kind": "dev", - "methods": { - "addObservations((uint32,int24)[],bytes32,uint24)": { - "params": { - "_observationsData": "Array of tuples containing the dataset", - "_poolNonce": "Nonce of the observation broadcast", - "_poolSalt": "Identifier of the pool to fetch" - } - }, - "setPendingGovernor(address)": { - "params": { - "_pendingGovernor": "Address of the proposed new governor" - } - }, - "whitelistAdapter(address,bool)": { - "params": { - "_isWhitelisted": "New whitelisting status", - "_receiverAdapter": "Address of the adapter" - } - }, - "whitelistAdapters(address[],bool[])": { - "params": { - "_isWhitelisted": "Array of whitelisting status for each address", - "_receiverAdapters": "Array of addresses of the adapter" - } - } - }, - "stateVariables": { - "deployedOracles": { - "params": { - "_poolSalt": "The identifier of the oracle" - }, - "return": "The address of the correspondant Oracle", - "returns": { - "_0": "The address of the correspondant Oracle" - } - }, - "oracleFactory": { - "return": "The address of the OracleFactory", - "returns": { - "_0": "The address of the OracleFactory" - } - }, - "whitelistedAdapters": { - "params": { - "_adapter": "Address of the bridge adapter to consult" - }, - "return": "Whether a bridge adapter is whitelisted", - "returns": { - "_0": "Whether a bridge adapter is whitelisted" - } - } - }, - "title": "The DataReceiver contract", - "version": 1 - }, - "userdoc": { - "errors": { - "InvalidAddress()": [ - { - "notice": "Thrown if an address is invalid" - } - ], - "InvalidAmount()": [ - { - "notice": "Thrown if an amount is invalid" - } - ], - "LengthMismatch()": [ - { - "notice": "Thrown if the lengths of a set of lists mismatch" - } - ], - "ObservationsNotWritable()": [ - { - "notice": "Thrown when the broadcast nonce is incorrect" - } - ], - "OnlyGovernor()": [ - { - "notice": "Thrown if a non-governor user tries to call a OnlyGovernor function" - } - ], - "OnlyPendingGovernor()": [ - { - "notice": "Thrown if a non-pending-governor user tries to call a OnlyPendingGovernor function" - } - ], - "UnallowedAdapter()": [ - { - "notice": "Thrown when a not-whitelisted adapter triggers an update" - } - ], - "ZeroAddress()": [ - { - "notice": "Thrown if an address is the zero address" - } - ], - "ZeroAmount()": [ - { - "notice": "Thrown if an amount is zero" - } - ] - }, - "events": { - "AdapterWhitelisted(address,bool)": { - "notice": "Emitted when a new adapter whitelisting rule is set" - }, - "ObservationsAdded(bytes32,uint24,address)": { - "notice": "Emitted when a broadcast observation is succesfully processed" - }, - "ObservationsCached(bytes32,uint24,address)": { - "notice": "Emitted when a broadcast observation is cached for later processing" - }, - "PendingGovernorAccepted(address)": { - "notice": "Emitted when a new governor is set" - }, - "PendingGovernorSet(address,address)": { - "notice": "Emitted when a new pending governor is set" - } - }, - "kind": "user", - "methods": { - "acceptPendingGovernor()": { - "notice": "Allows a proposed governor to accept the governance" - }, - "addObservations((uint32,int24)[],bytes32,uint24)": { - "notice": "Allows whitelisted bridge adapters to push a broadcast" - }, - "deployedOracles(bytes32)": { - "notice": "Tracks already deployed oracles" - }, - "setPendingGovernor(address)": { - "notice": "Allows a governor to propose a new governor" - }, - "whitelistAdapter(address,bool)": { - "notice": "Allows governance to set an adapter whitelisted state" - }, - "whitelistAdapters(address[],bool[])": { - "notice": "Allows governance to batch set adapters whitelisted state" - }, - "whitelistedAdapters(address)": { - "notice": "Tracks the whitelisting of bridge adapters" - } - }, - "notice": "Handles reception of broadcast data and delivers it to correspondant oracle", - "version": 1 - }, - "storageLayout": { - "storage": [ - { - "astId": 8014, - "contract": "solidity/contracts/DataReceiver.sol:DataReceiver", - "label": "governor", - "offset": 0, - "slot": "0", - "type": "t_address" - }, - { - "astId": 8017, - "contract": "solidity/contracts/DataReceiver.sol:DataReceiver", - "label": "pendingGovernor", - "offset": 0, - "slot": "1", - "type": "t_address" - }, - { - "astId": 14967, - "contract": "solidity/contracts/DataReceiver.sol:DataReceiver", - "label": "deployedOracles", - "offset": 0, - "slot": "2", - "type": "t_mapping(t_bytes32,t_contract(IOracleSidechain)18205)" - }, - { - "astId": 14973, - "contract": "solidity/contracts/DataReceiver.sol:DataReceiver", - "label": "whitelistedAdapters", - "offset": 0, - "slot": "3", - "type": "t_mapping(t_contract(IBridgeReceiverAdapter)18340,t_bool)" - }, - { - "astId": 14981, - "contract": "solidity/contracts/DataReceiver.sol:DataReceiver", - "label": "_cachedObservations", - "offset": 0, - "slot": "4", - "type": "t_mapping(t_bytes32,t_mapping(t_uint24,t_array(t_struct(ObservationData)18047_storage)dyn_storage))" - } - ], - "types": { - "t_address": { - "encoding": "inplace", - "label": "address", - "numberOfBytes": "20" - }, - "t_array(t_struct(ObservationData)18047_storage)dyn_storage": { - "base": "t_struct(ObservationData)18047_storage", - "encoding": "dynamic_array", - "label": "struct IOracleSidechain.ObservationData[]", - "numberOfBytes": "32" - }, - "t_bool": { - "encoding": "inplace", - "label": "bool", - "numberOfBytes": "1" - }, - "t_bytes32": { - "encoding": "inplace", - "label": "bytes32", - "numberOfBytes": "32" - }, - "t_contract(IBridgeReceiverAdapter)18340": { - "encoding": "inplace", - "label": "contract IBridgeReceiverAdapter", - "numberOfBytes": "20" - }, - "t_contract(IOracleSidechain)18205": { - "encoding": "inplace", - "label": "contract IOracleSidechain", - "numberOfBytes": "20" - }, - "t_int24": { - "encoding": "inplace", - "label": "int24", - "numberOfBytes": "3" - }, - "t_mapping(t_bytes32,t_contract(IOracleSidechain)18205)": { - "encoding": "mapping", - "key": "t_bytes32", - "label": "mapping(bytes32 => contract IOracleSidechain)", - "numberOfBytes": "32", - "value": "t_contract(IOracleSidechain)18205" - }, - "t_mapping(t_bytes32,t_mapping(t_uint24,t_array(t_struct(ObservationData)18047_storage)dyn_storage))": { - "encoding": "mapping", - "key": "t_bytes32", - "label": "mapping(bytes32 => mapping(uint24 => struct IOracleSidechain.ObservationData[]))", - "numberOfBytes": "32", - "value": "t_mapping(t_uint24,t_array(t_struct(ObservationData)18047_storage)dyn_storage)" - }, - "t_mapping(t_contract(IBridgeReceiverAdapter)18340,t_bool)": { - "encoding": "mapping", - "key": "t_contract(IBridgeReceiverAdapter)18340", - "label": "mapping(contract IBridgeReceiverAdapter => bool)", - "numberOfBytes": "32", - "value": "t_bool" - }, - "t_mapping(t_uint24,t_array(t_struct(ObservationData)18047_storage)dyn_storage)": { - "encoding": "mapping", - "key": "t_uint24", - "label": "mapping(uint24 => struct IOracleSidechain.ObservationData[])", - "numberOfBytes": "32", - "value": "t_array(t_struct(ObservationData)18047_storage)dyn_storage" - }, - "t_struct(ObservationData)18047_storage": { - "encoding": "inplace", - "label": "struct IOracleSidechain.ObservationData", - "members": [ - { - "astId": 18044, - "contract": "solidity/contracts/DataReceiver.sol:DataReceiver", - "label": "blockTimestamp", - "offset": 0, - "slot": "0", - "type": "t_uint32" - }, - { - "astId": 18046, - "contract": "solidity/contracts/DataReceiver.sol:DataReceiver", - "label": "tick", - "offset": 4, - "slot": "0", - "type": "t_int24" - } - ], - "numberOfBytes": "32" - }, - "t_uint24": { - "encoding": "inplace", - "label": "uint24", - "numberOfBytes": "3" - }, - "t_uint32": { - "encoding": "inplace", - "label": "uint32", - "numberOfBytes": "4" - } - } - } -} \ No newline at end of file diff --git a/deployments/optimism/OracleSidechain.json b/deployments/optimism/OracleSidechain.json deleted file mode 100644 index 59f5093..0000000 --- a/deployments/optimism/OracleSidechain.json +++ /dev/null @@ -1,396 +0,0 @@ -{ - "address": "0x6A060BF6579318c15138160Ee1f1d225fcC9D409", - "abi": [ - { - "inputs": [], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "inputs": [], - "name": "AI", - "type": "error" - }, - { - "inputs": [], - "name": "I", - "type": "error" - }, - { - "inputs": [], - "name": "InvalidPool", - "type": "error" - }, - { - "inputs": [], - "name": "OLD", - "type": "error" - }, - { - "inputs": [], - "name": "OnlyDataReceiver", - "type": "error" - }, - { - "inputs": [], - "name": "OnlyFactory", - "type": "error" - }, - { - "inputs": [], - "name": "T", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint16", - "name": "_observationCardinalityNextOld", - "type": "uint16" - }, - { - "indexed": false, - "internalType": "uint16", - "name": "_observationCardinalityNextNew", - "type": "uint16" - } - ], - "name": "IncreaseObservationCardinalityNext", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "_poolSalt", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "address", - "name": "_token0", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "_token1", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint24", - "name": "_fee", - "type": "uint24" - } - ], - "name": "PoolInfoInitialized", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "", - "type": "address" - }, - { - "indexed": false, - "internalType": "int256", - "name": "", - "type": "int256" - }, - { - "indexed": false, - "internalType": "int256", - "name": "", - "type": "int256" - }, - { - "indexed": false, - "internalType": "uint160", - "name": "_sqrtPriceX96", - "type": "uint160" - }, - { - "indexed": false, - "internalType": "uint128", - "name": "", - "type": "uint128" - }, - { - "indexed": false, - "internalType": "int24", - "name": "_tick", - "type": "int24" - } - ], - "name": "Swap", - "type": "event" - }, - { - "inputs": [], - "name": "factory", - "outputs": [ - { - "internalType": "contract IOracleFactory", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "fee", - "outputs": [ - { - "internalType": "uint24", - "name": "", - "type": "uint24" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint16", - "name": "_observationCardinalityNext", - "type": "uint16" - } - ], - "name": "increaseObservationCardinalityNext", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_tokenA", - "type": "address" - }, - { - "internalType": "address", - "name": "_tokenB", - "type": "address" - }, - { - "internalType": "uint24", - "name": "_fee", - "type": "uint24" - } - ], - "name": "initializePoolInfo", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "name": "observations", - "outputs": [ - { - "internalType": "uint32", - "name": "blockTimestamp", - "type": "uint32" - }, - { - "internalType": "int56", - "name": "tickCumulative", - "type": "int56" - }, - { - "internalType": "uint160", - "name": "secondsPerLiquidityCumulativeX128", - "type": "uint160" - }, - { - "internalType": "bool", - "name": "initialized", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint32[]", - "name": "_secondsAgos", - "type": "uint32[]" - } - ], - "name": "observe", - "outputs": [ - { - "internalType": "int56[]", - "name": "_tickCumulatives", - "type": "int56[]" - }, - { - "internalType": "uint160[]", - "name": "_secondsPerLiquidityCumulativeX128s", - "type": "uint160[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "poolNonce", - "outputs": [ - { - "internalType": "uint24", - "name": "", - "type": "uint24" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "poolSalt", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "slot0", - "outputs": [ - { - "internalType": "uint160", - "name": "sqrtPriceX96", - "type": "uint160" - }, - { - "internalType": "int24", - "name": "tick", - "type": "int24" - }, - { - "internalType": "uint16", - "name": "observationIndex", - "type": "uint16" - }, - { - "internalType": "uint16", - "name": "observationCardinality", - "type": "uint16" - }, - { - "internalType": "uint16", - "name": "observationCardinalityNext", - "type": "uint16" - }, - { - "internalType": "uint8", - "name": "feeProtocol", - "type": "uint8" - }, - { - "internalType": "bool", - "name": "unlocked", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "token0", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "token1", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "uint32", - "name": "blockTimestamp", - "type": "uint32" - }, - { - "internalType": "int24", - "name": "tick", - "type": "int24" - } - ], - "internalType": "struct IOracleSidechain.ObservationData[]", - "name": "_observationsData", - "type": "tuple[]" - }, - { - "internalType": "uint24", - "name": "_poolNonce", - "type": "uint24" - } - ], - "name": "write", - "outputs": [ - { - "internalType": "bool", - "name": "_written", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - } - ], - "numDeployments": 11 -} \ No newline at end of file diff --git a/deployments/polygon/ConnextReceiverAdapter.json b/deployments/polygon/ConnextReceiverAdapter.json deleted file mode 100644 index 6ca4c6c..0000000 --- a/deployments/polygon/ConnextReceiverAdapter.json +++ /dev/null @@ -1,279 +0,0 @@ -{ - "address": "0x03A4371f4D531c80741cda05bf39aea5b29dd1eb", - "abi": [ - { - "inputs": [ - { - "internalType": "contract IDataReceiver", - "name": "_dataReceiver", - "type": "address" - }, - { - "internalType": "contract IConnext", - "name": "_connext", - "type": "address" - }, - { - "internalType": "address", - "name": "_source", - "type": "address" - }, - { - "internalType": "uint32", - "name": "_originDomain", - "type": "uint32" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "inputs": [], - "name": "InvalidAddress", - "type": "error" - }, - { - "inputs": [], - "name": "InvalidAmount", - "type": "error" - }, - { - "inputs": [], - "name": "LengthMismatch", - "type": "error" - }, - { - "inputs": [], - "name": "UnauthorizedCaller", - "type": "error" - }, - { - "inputs": [], - "name": "ZeroAddress", - "type": "error" - }, - { - "inputs": [], - "name": "ZeroAmount", - "type": "error" - }, - { - "inputs": [], - "name": "connext", - "outputs": [ - { - "internalType": "contract IConnext", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "dataReceiver", - "outputs": [ - { - "internalType": "contract IDataReceiver", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "originDomain", - "outputs": [ - { - "internalType": "uint32", - "name": "", - "type": "uint32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "source", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - }, - { - "internalType": "address", - "name": "", - "type": "address" - }, - { - "internalType": "address", - "name": "_originSender", - "type": "address" - }, - { - "internalType": "uint32", - "name": "_origin", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "_callData", - "type": "bytes" - } - ], - "name": "xReceive", - "outputs": [ - { - "internalType": "bytes", - "name": "", - "type": "bytes" - } - ], - "stateMutability": "nonpayable", - "type": "function" - } - ], - "transactionHash": "0x1cc70510dff465f03e889d1ab25071c24d3803e53d828cd6514b2c1bb21fddd2", - "receipt": { - "to": null, - "from": "0xa6DBFF53DD8F89f0bf4f6800BFDFfE099875bd9d", - "contractAddress": "0x03A4371f4D531c80741cda05bf39aea5b29dd1eb", - "transactionIndex": 66, - "gasUsed": "408279", - "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000008000000000000000000000000000000000000000000000000000000000800000000000000004000100000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000004000800000000000000001000000008000000000000000000000140000000000000000020000000000000000000000000000000000000000000000000000100000", - "blockHash": "0x41304b0f3397d7d6867e6b0efaae9973afdb147b24c9e255ffac3beae3befb71", - "transactionHash": "0x1cc70510dff465f03e889d1ab25071c24d3803e53d828cd6514b2c1bb21fddd2", - "logs": [ - { - "transactionIndex": 66, - "blockNumber": 60829161, - "transactionHash": "0x1cc70510dff465f03e889d1ab25071c24d3803e53d828cd6514b2c1bb21fddd2", - "address": "0x0000000000000000000000000000000000001010", - "topics": [ - "0x4dfe1bbbcf077ddc3e01291eea2d5c70c2b422b415d95645b9adcfd678cb1d63", - "0x0000000000000000000000000000000000000000000000000000000000001010", - "0x000000000000000000000000a6dbff53dd8f89f0bf4f6800bfdffe099875bd9d", - "0x00000000000000000000000067b94473d81d0cd00849d563c94d0432ac988b49" - ], - "data": "0x000000000000000000000000000000000000000000000000002b83d3dee739290000000000000000000000000000000000000000000000004d4d1765a3305d75000000000000000000000000000000000000000000001522ae5fffc713898b9b0000000000000000000000000000000000000000000000004d219391c449244c000000000000000000000000000000000000000000001522ae8b839af270c4c4", - "logIndex": 673, - "blockHash": "0x41304b0f3397d7d6867e6b0efaae9973afdb147b24c9e255ffac3beae3befb71" - } - ], - "blockNumber": 60829161, - "cumulativeGasUsed": "20827151", - "status": 1, - "byzantium": true - }, - "args": [ - "0x4B11b6BEF9480d62b471a9a91a52C893143Bad19", - "0x11984dc4465481512eb5b777E44061C158CF2259", - "0x5b9315CE1304DF3B2A83B2074cbF849D160642Ab", - 6648936 - ], - "numDeployments": 1, - "solcInputHash": "92b61157bb7b7ae620a9f78d2e6fe053", - "metadata": "{\"compiler\":{\"version\":\"0.8.15+commit.e14f2714\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"contract IDataReceiver\",\"name\":\"_dataReceiver\",\"type\":\"address\"},{\"internalType\":\"contract IConnext\",\"name\":\"_connext\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_source\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"_originDomain\",\"type\":\"uint32\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"InvalidAddress\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidAmount\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"LengthMismatch\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UnauthorizedCaller\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ZeroAddress\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ZeroAmount\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"connext\",\"outputs\":[{\"internalType\":\"contract IConnext\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"dataReceiver\",\"outputs\":[{\"internalType\":\"contract IDataReceiver\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"originDomain\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"source\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_originSender\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"_origin\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"_callData\",\"type\":\"bytes\"}],\"name\":\"xReceive\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"stateVariables\":{\"connext\":{\"return\":\"Address of the ConnextHandler contract\",\"returns\":{\"_0\":\"Address of the ConnextHandler contract\"}},\"originDomain\":{\"return\":\"The origin domain id\",\"returns\":{\"_0\":\"The origin domain id\"}},\"source\":{\"return\":\"Address of the xcaller contract\",\"returns\":{\"_0\":\"Address of the xcaller contract\"}}},\"version\":1},\"userdoc\":{\"errors\":{\"InvalidAddress()\":[{\"notice\":\"Thrown if an address is invalid\"}],\"InvalidAmount()\":[{\"notice\":\"Thrown if an amount is invalid\"}],\"LengthMismatch()\":[{\"notice\":\"Thrown if the lengths of a set of lists mismatch\"}],\"UnauthorizedCaller()\":[{\"notice\":\"Thrown if a caller is not authorized\"}],\"ZeroAddress()\":[{\"notice\":\"Thrown if an address is the zero address\"}],\"ZeroAmount()\":[{\"notice\":\"Thrown if an amount is zero\"}]},\"kind\":\"user\",\"methods\":{\"connext()\":{\"notice\":\"Gets the ConnextHandler contract on this domain\"},\"dataReceiver()\":{\"notice\":\"Gets the address of the DataReceiver contract\"},\"originDomain()\":{\"notice\":\"Gets the origin domain id\"},\"source()\":{\"notice\":\"Gets the DAO that is expected as the xcaller\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"solidity/contracts/bridges/ConnextReceiverAdapter.sol\":\"ConnextReceiverAdapter\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@connext/nxtp-contracts/contracts/core/connext/helpers/LPToken.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSED\\npragma solidity 0.8.15;\\n\\nimport {ERC20Upgradeable} from \\\"@openzeppelin/contracts-upgradeable/token/ERC20/extensions/ERC20BurnableUpgradeable.sol\\\";\\nimport {OwnableUpgradeable} from \\\"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\\\";\\n\\n/**\\n * @title Liquidity Provider Token\\n * @notice This token is an ERC20 detailed token with added capability to be minted by the owner.\\n * It is used to represent user's shares when providing liquidity to swap contracts.\\n * @dev Only Swap contracts should initialize and own LPToken contracts.\\n */\\ncontract LPToken is ERC20Upgradeable, OwnableUpgradeable {\\n // ============ Upgrade Gap ============\\n\\n uint256[49] private __GAP; // gap for upgrade safety\\n\\n // ============ Storage ============\\n\\n /**\\n * @notice Used to enforce proper token dilution\\n * @dev If this is the first mint of the LP token, this amount of funds are burned.\\n * See audit recommendations here:\\n * - https://github.com/code-423n4/2022-03-prepo-findings/issues/27\\n * - https://github.com/code-423n4/2022-04-jpegd-findings/issues/12\\n * and uniswap v2 implementation here:\\n * https://github.com/Uniswap/v2-core/blob/8b82b04a0b9e696c0e83f8b2f00e5d7be6888c79/contracts/UniswapV2Pair.sol#L15\\n */\\n uint256 public constant MINIMUM_LIQUIDITY = 10**3;\\n\\n // ============ Initializer ============\\n\\n /**\\n * @notice Initializes this LPToken contract with the given name and symbol\\n * @dev The caller of this function will become the owner. A Swap contract should call this\\n * in its initializer function.\\n * @param name name of this token\\n * @param symbol symbol of this token\\n */\\n function initialize(string memory name, string memory symbol) external initializer returns (bool) {\\n __Context_init_unchained();\\n __ERC20_init_unchained(name, symbol);\\n __Ownable_init_unchained();\\n return true;\\n }\\n\\n // ============ External functions ============\\n\\n /**\\n * @notice Mints the given amount of LPToken to the recipient.\\n * @dev only owner can call this mint function\\n * @param recipient address of account to receive the tokens\\n * @param amount amount of tokens to mint\\n */\\n function mint(address recipient, uint256 amount) external onlyOwner {\\n require(amount != 0, \\\"LPToken: cannot mint 0\\\");\\n if (totalSupply() == 0) {\\n // NOTE: using the _mint function directly will error because it is going\\n // to the 0 address. fix by using the address(1) here instead\\n _mint(address(1), MINIMUM_LIQUIDITY);\\n }\\n _mint(recipient, amount);\\n }\\n\\n /**\\n * @notice Burns the given amount of LPToken from provided account\\n * @dev only owner can call this burn function\\n * @param account address of account from which to burn token\\n * @param amount amount of tokens to mint\\n */\\n function burnFrom(address account, uint256 amount) external onlyOwner {\\n require(amount != 0, \\\"LPToken: cannot burn 0\\\");\\n _burn(account, amount);\\n }\\n\\n // ============ Internal functions ============\\n\\n /**\\n * @dev Overrides ERC20._beforeTokenTransfer() which get called on every transfers including\\n * minting and burning. This ensures that Swap.updateUserWithdrawFees are called everytime.\\n * This assumes the owner is set to a Swap contract's address.\\n */\\n function _beforeTokenTransfer(\\n address from,\\n address to,\\n uint256 amount\\n ) internal virtual override(ERC20Upgradeable) {\\n super._beforeTokenTransfer(from, to, amount);\\n require(to != address(this), \\\"LPToken: cannot send to itself\\\");\\n }\\n}\\n\",\"keccak256\":\"0x1d3f871488111c70a6f9b09ad3baeb21ebc635c82aa2c6d627d07e09720e4126\",\"license\":\"UNLICENSED\"},\"@connext/nxtp-contracts/contracts/core/connext/interfaces/IConnext.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSED\\npragma solidity 0.8.15;\\n\\nimport {IERC20} from \\\"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\\\";\\n\\nimport {ExecuteArgs, TransferInfo, TokenId, DestinationTransferStatus} from \\\"../libraries/LibConnextStorage.sol\\\";\\nimport {LibDiamond} from \\\"../libraries/LibDiamond.sol\\\";\\nimport {SwapUtils} from \\\"../libraries/SwapUtils.sol\\\";\\n\\nimport {IStableSwap} from \\\"./IStableSwap.sol\\\";\\n\\nimport {IDiamondCut} from \\\"./IDiamondCut.sol\\\";\\nimport {IDiamondLoupe} from \\\"./IDiamondLoupe.sol\\\";\\n\\ninterface IConnext is IDiamondLoupe, IDiamondCut {\\n // TokenFacet\\n function canonicalToAdopted(bytes32 _key) external view returns (address);\\n\\n function canonicalToAdopted(TokenId calldata _canonical) external view returns (address);\\n\\n function adoptedToCanonical(address _adopted) external view returns (TokenId memory);\\n\\n function canonicalToRepresentation(bytes32 _key) external view returns (address);\\n\\n function canonicalToRepresentation(TokenId calldata _canonical) external view returns (address);\\n\\n function representationToCanonical(address _adopted) external view returns (TokenId memory);\\n\\n function getLocalAndAdoptedToken(bytes32 _id, uint32 _domain) external view returns (address, address);\\n\\n function approvedAssets(bytes32 _key) external view returns (bool);\\n\\n function approvedAssets(TokenId calldata _canonical) external view returns (bool);\\n\\n function adoptedToLocalPools(bytes32 _key) external view returns (IStableSwap);\\n\\n function adoptedToLocalPools(TokenId calldata _canonical) external view returns (IStableSwap);\\n\\n function getTokenId(address _candidate) external view returns (TokenId memory);\\n\\n function setupAsset(\\n TokenId calldata _canonical,\\n uint8 _canonicalDecimals,\\n string memory _representationName,\\n string memory _representationSymbol,\\n address _adoptedAssetId,\\n address _stableSwapPool,\\n uint256 _cap\\n ) external returns (address);\\n\\n function setupAssetWithDeployedRepresentation(\\n TokenId calldata _canonical,\\n address _representation,\\n address _adoptedAssetId,\\n address _stableSwapPool,\\n uint256 _cap\\n ) external returns (address);\\n\\n function addStableSwapPool(TokenId calldata _canonical, address _stableSwapPool) external;\\n\\n function updateLiquidityCap(TokenId calldata _canonical, uint256 _updated) external;\\n\\n function removeAssetId(\\n bytes32 _key,\\n address _adoptedAssetId,\\n address _representation\\n ) external;\\n\\n function removeAssetId(\\n TokenId calldata _canonical,\\n address _adoptedAssetId,\\n address _representation\\n ) external;\\n\\n function updateDetails(\\n TokenId calldata _canonical,\\n string memory _name,\\n string memory _symbol\\n ) external;\\n\\n // BaseConnextFacet\\n\\n // BridgeFacet\\n function routedTransfers(bytes32 _transferId) external view returns (address[] memory);\\n\\n function transferStatus(bytes32 _transferId) external view returns (DestinationTransferStatus);\\n\\n function remote(uint32 _domain) external view returns (address);\\n\\n function domain() external view returns (uint256);\\n\\n function nonce() external view returns (uint256);\\n\\n function approvedSequencers(address _sequencer) external view returns (bool);\\n\\n function xAppConnectionManager() external view returns (address);\\n\\n function addConnextion(uint32 _domain, address _connext) external;\\n\\n function addSequencer(address _sequencer) external;\\n\\n function removeSequencer(address _sequencer) external;\\n\\n function xcall(\\n uint32 _destination,\\n address _to,\\n address _asset,\\n address _delegate,\\n uint256 _amount,\\n uint256 _slippage,\\n bytes calldata _callData\\n ) external payable returns (bytes32);\\n\\n function xcallIntoLocal(\\n uint32 _destination,\\n address _to,\\n address _asset,\\n address _delegate,\\n uint256 _amount,\\n uint256 _slippage,\\n bytes calldata _callData\\n ) external payable returns (bytes32);\\n\\n function execute(ExecuteArgs calldata _args) external returns (bytes32 transferId);\\n\\n function forceUpdateSlippage(TransferInfo calldata _params, uint256 _slippage) external;\\n\\n function bumpTransfer(bytes32 _transferId) external payable;\\n\\n function setXAppConnectionManager(address _xAppConnectionManager) external;\\n\\n function enrollRemoteRouter(uint32 _domain, bytes32 _router) external;\\n\\n function enrollCustom(\\n uint32 _domain,\\n bytes32 _id,\\n address _custom\\n ) external;\\n\\n // InboxFacet\\n\\n function handle(\\n uint32 _origin,\\n uint32 _nonce,\\n bytes32 _sender,\\n bytes memory _message\\n ) external;\\n\\n // ProposedOwnableFacet\\n\\n function owner() external view returns (address);\\n\\n function routerWhitelistRemoved() external view returns (bool);\\n\\n function assetWhitelistRemoved() external view returns (bool);\\n\\n function proposed() external view returns (address);\\n\\n function proposedTimestamp() external view returns (uint256);\\n\\n function routerWhitelistTimestamp() external view returns (uint256);\\n\\n function assetWhitelistTimestamp() external view returns (uint256);\\n\\n function delay() external view returns (uint256);\\n\\n function proposeRouterWhitelistRemoval() external;\\n\\n function removeRouterWhitelist() external;\\n\\n function proposeAssetWhitelistRemoval() external;\\n\\n function removeAssetWhitelist() external;\\n\\n function renounced() external view returns (bool);\\n\\n function proposeNewOwner(address newlyProposed) external;\\n\\n function renounceOwnership() external;\\n\\n function acceptProposedOwner() external;\\n\\n function pause() external;\\n\\n function unpause() external;\\n\\n // RelayerFacet\\n function approvedRelayers(address _relayer) external view returns (bool);\\n\\n function relayerFeeVault() external view returns (address);\\n\\n function setRelayerFeeVault(address _relayerFeeVault) external;\\n\\n function addRelayer(address _relayer) external;\\n\\n function removeRelayer(address _relayer) external;\\n\\n // RoutersFacet\\n function LIQUIDITY_FEE_NUMERATOR() external view returns (uint256);\\n\\n function LIQUIDITY_FEE_DENOMINATOR() external view returns (uint256);\\n\\n function getRouterApproval(address _router) external view returns (bool);\\n\\n function getRouterRecipient(address _router) external view returns (address);\\n\\n function getRouterOwner(address _router) external view returns (address);\\n\\n function getProposedRouterOwner(address _router) external view returns (address);\\n\\n function getProposedRouterOwnerTimestamp(address _router) external view returns (uint256);\\n\\n function maxRoutersPerTransfer() external view returns (uint256);\\n\\n function routerBalances(address _router, address _asset) external view returns (uint256);\\n\\n function getRouterApprovalForPortal(address _router) external view returns (bool);\\n\\n function setupRouter(\\n address router,\\n address owner,\\n address recipient\\n ) external;\\n\\n function removeRouter(address router) external;\\n\\n function setMaxRoutersPerTransfer(uint256 _newMaxRouters) external;\\n\\n function setLiquidityFeeNumerator(uint256 _numerator) external;\\n\\n function approveRouterForPortal(address _router) external;\\n\\n function unapproveRouterForPortal(address _router) external;\\n\\n function setRouterRecipient(address router, address recipient) external;\\n\\n function proposeRouterOwner(address router, address proposed) external;\\n\\n function acceptProposedRouterOwner(address router) external;\\n\\n function addRouterLiquidityFor(\\n uint256 _amount,\\n address _local,\\n address _router\\n ) external payable;\\n\\n function addRouterLiquidity(uint256 _amount, address _local) external payable;\\n\\n function removeRouterLiquidityFor(\\n uint256 _amount,\\n address _local,\\n address payable _to,\\n address _router\\n ) external;\\n\\n function removeRouterLiquidity(\\n uint256 _amount,\\n address _local,\\n address payable _to\\n ) external;\\n\\n // PortalFacet\\n function getAavePortalDebt(bytes32 _transferId) external view returns (uint256);\\n\\n function getAavePortalFeeDebt(bytes32 _transferId) external view returns (uint256);\\n\\n function aavePool() external view returns (address);\\n\\n function aavePortalFee() external view returns (uint256);\\n\\n function setAavePool(address _aavePool) external;\\n\\n function setAavePortalFee(uint256 _aavePortalFeeNumerator) external;\\n\\n function repayAavePortal(\\n TransferInfo calldata _params,\\n uint256 _backingAmount,\\n uint256 _feeAmount,\\n uint256 _maxIn\\n ) external;\\n\\n function repayAavePortalFor(\\n TransferInfo calldata _params,\\n uint256 _backingAmount,\\n uint256 _feeAmount\\n ) external;\\n\\n // StableSwapFacet\\n function getSwapStorage(bytes32 canonicalId) external view returns (SwapUtils.Swap memory);\\n\\n function getSwapLPToken(bytes32 canonicalId) external view returns (address);\\n\\n function getSwapA(bytes32 canonicalId) external view returns (uint256);\\n\\n function getSwapAPrecise(bytes32 canonicalId) external view returns (uint256);\\n\\n function getSwapToken(bytes32 canonicalId, uint8 index) external view returns (IERC20);\\n\\n function getSwapTokenIndex(bytes32 canonicalId, address tokenAddress) external view returns (uint8);\\n\\n function getSwapTokenBalance(bytes32 canonicalId, uint8 index) external view returns (uint256);\\n\\n function getSwapVirtualPrice(bytes32 canonicalId) external view returns (uint256);\\n\\n function calculateSwap(\\n bytes32 canonicalId,\\n uint8 tokenIndexFrom,\\n uint8 tokenIndexTo,\\n uint256 dx\\n ) external view returns (uint256);\\n\\n function calculateSwapTokenAmount(\\n bytes32 canonicalId,\\n uint256[] calldata amounts,\\n bool deposit\\n ) external view returns (uint256);\\n\\n function calculateRemoveSwapLiquidity(bytes32 canonicalId, uint256 amount) external view returns (uint256[] memory);\\n\\n function calculateRemoveSwapLiquidityOneToken(\\n bytes32 canonicalId,\\n uint256 tokenAmount,\\n uint8 tokenIndex\\n ) external view returns (uint256);\\n\\n function getSwapAdminBalance(bytes32 canonicalId, uint256 index) external view returns (uint256);\\n\\n function swap(\\n bytes32 canonicalId,\\n uint8 tokenIndexFrom,\\n uint8 tokenIndexTo,\\n uint256 dx,\\n uint256 minDy,\\n uint256 deadline\\n ) external returns (uint256);\\n\\n function swapExact(\\n bytes32 canonicalId,\\n uint256 amountIn,\\n address assetIn,\\n address assetOut,\\n uint256 minAmountOut,\\n uint256 deadline\\n ) external payable returns (uint256);\\n\\n function swapExactOut(\\n bytes32 canonicalId,\\n uint256 amountOut,\\n address assetIn,\\n address assetOut,\\n uint256 maxAmountIn,\\n uint256 deadline\\n ) external payable returns (uint256);\\n\\n function addSwapLiquidity(\\n bytes32 canonicalId,\\n uint256[] calldata amounts,\\n uint256 minToMint,\\n uint256 deadline\\n ) external returns (uint256);\\n\\n function removeSwapLiquidity(\\n bytes32 canonicalId,\\n uint256 amount,\\n uint256[] calldata minAmounts,\\n uint256 deadline\\n ) external returns (uint256[] memory);\\n\\n function removeSwapLiquidityOneToken(\\n bytes32 canonicalId,\\n uint256 tokenAmount,\\n uint8 tokenIndex,\\n uint256 minAmount,\\n uint256 deadline\\n ) external returns (uint256);\\n\\n function removeSwapLiquidityImbalance(\\n bytes32 canonicalId,\\n uint256[] calldata amounts,\\n uint256 maxBurnAmount,\\n uint256 deadline\\n ) external returns (uint256);\\n\\n // SwapAdminFacet\\n\\n function initializeSwap(\\n bytes32 _canonicalId,\\n IERC20[] memory _pooledTokens,\\n uint8[] memory decimals,\\n string memory lpTokenName,\\n string memory lpTokenSymbol,\\n uint256 _a,\\n uint256 _fee,\\n uint256 _adminFee,\\n address lpTokenTargetAddress\\n ) external;\\n\\n function withdrawSwapAdminFees(bytes32 canonicalId) external;\\n\\n function setSwapAdminFee(bytes32 canonicalId, uint256 newAdminFee) external;\\n\\n function setSwapFee(bytes32 canonicalId, uint256 newSwapFee) external;\\n\\n function rampA(\\n bytes32 canonicalId,\\n uint256 futureA,\\n uint256 futureTime\\n ) external;\\n\\n function stopRampA(bytes32 canonicalId) external;\\n}\\n\",\"keccak256\":\"0xf4e97b6638cb0af7c41f69b151ec5c66e8d1532067674aecd71d8587a376be4a\",\"license\":\"UNLICENSED\"},\"@connext/nxtp-contracts/contracts/core/connext/interfaces/IDiamondCut.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.15;\\n\\n/******************************************************************************\\\\\\n* Author: Nick Mudge (https://twitter.com/mudgen)\\n* EIP-2535 Diamonds: https://eips.ethereum.org/EIPS/eip-2535\\n/******************************************************************************/\\n\\ninterface IDiamondCut {\\n enum FacetCutAction {\\n Add,\\n Replace,\\n Remove\\n }\\n // Add=0, Replace=1, Remove=2\\n\\n struct FacetCut {\\n address facetAddress;\\n FacetCutAction action;\\n bytes4[] functionSelectors;\\n }\\n\\n /// @notice Propose to add/replace/remove any number of functions and optionally execute\\n /// a function with delegatecall\\n /// @param _diamondCut Contains the facet addresses and function selectors\\n /// @param _init The address of the contract or facet to execute _calldata\\n /// @param _calldata A function call, including function selector and arguments\\n /// _calldata is executed with delegatecall on _init\\n function proposeDiamondCut(\\n FacetCut[] calldata _diamondCut,\\n address _init,\\n bytes calldata _calldata\\n ) external;\\n\\n event DiamondCutProposed(FacetCut[] _diamondCut, address _init, bytes _calldata, uint256 deadline);\\n\\n /// @notice Add/replace/remove any number of functions and optionally execute\\n /// a function with delegatecall\\n /// @param _diamondCut Contains the facet addresses and function selectors\\n /// @param _init The address of the contract or facet to execute _calldata\\n /// @param _calldata A function call, including function selector and arguments\\n /// _calldata is executed with delegatecall on _init\\n function diamondCut(\\n FacetCut[] calldata _diamondCut,\\n address _init,\\n bytes calldata _calldata\\n ) external;\\n\\n event DiamondCut(FacetCut[] _diamondCut, address _init, bytes _calldata);\\n\\n /// @notice Propose to add/replace/remove any number of functions and optionally execute\\n /// a function with delegatecall\\n /// @param _diamondCut Contains the facet addresses and function selectors\\n /// @param _init The address of the contract or facet to execute _calldata\\n /// @param _calldata A function call, including function selector and arguments\\n /// _calldata is executed with delegatecall on _init\\n function rescindDiamondCut(\\n FacetCut[] calldata _diamondCut,\\n address _init,\\n bytes calldata _calldata\\n ) external;\\n\\n event DiamondCutRescinded(FacetCut[] _diamondCut, address _init, bytes _calldata);\\n}\\n\",\"keccak256\":\"0xd75a7bfdb3aeac3acebf8cf999330a0fc7bec65e9a68711bbb58f4554ef087b2\",\"license\":\"MIT\"},\"@connext/nxtp-contracts/contracts/core/connext/interfaces/IDiamondLoupe.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.15;\\n\\n/******************************************************************************\\\\\\n* Author: Nick Mudge (https://twitter.com/mudgen)\\n* EIP-2535 Diamonds: https://eips.ethereum.org/EIPS/eip-2535\\n/******************************************************************************/\\n\\n// A loupe is a small magnifying glass used to look at diamonds.\\n// These functions look at diamonds\\ninterface IDiamondLoupe {\\n /// These functions are expected to be called frequently\\n /// by tools.\\n\\n struct Facet {\\n address facetAddress;\\n bytes4[] functionSelectors;\\n }\\n\\n /// @notice Gets all facet addresses and their four byte function selectors.\\n /// @return facets_ Facet\\n function facets() external view returns (Facet[] memory facets_);\\n\\n /// @notice Gets all the function selectors supported by a specific facet.\\n /// @param _facet The facet address.\\n /// @return facetFunctionSelectors_\\n function facetFunctionSelectors(address _facet) external view returns (bytes4[] memory facetFunctionSelectors_);\\n\\n /// @notice Get all the facet addresses used by a diamond.\\n /// @return facetAddresses_\\n function facetAddresses() external view returns (address[] memory facetAddresses_);\\n\\n /// @notice Gets the facet that supports the given selector.\\n /// @dev If facet is not found return address(0).\\n /// @param _functionSelector The function selector.\\n /// @return facetAddress_ The facet address.\\n function facetAddress(bytes4 _functionSelector) external view returns (address facetAddress_);\\n}\\n\",\"keccak256\":\"0xe6d71029d0a1846712477ccf17aa2124b82996c77b6e6486a208a68ea421f563\",\"license\":\"MIT\"},\"@connext/nxtp-contracts/contracts/core/connext/interfaces/IStableSwap.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSED\\npragma solidity 0.8.15;\\n\\nimport {IERC20} from \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\ninterface IStableSwap {\\n /*** EVENTS ***/\\n\\n // events replicated from SwapUtils to make the ABI easier for dumb\\n // clients\\n event TokenSwap(address indexed buyer, uint256 tokensSold, uint256 tokensBought, uint128 soldId, uint128 boughtId);\\n event AddLiquidity(\\n address indexed provider,\\n uint256[] tokenAmounts,\\n uint256[] fees,\\n uint256 invariant,\\n uint256 lpTokenSupply\\n );\\n event RemoveLiquidity(address indexed provider, uint256[] tokenAmounts, uint256 lpTokenSupply);\\n event RemoveLiquidityOne(\\n address indexed provider,\\n uint256 lpTokenAmount,\\n uint256 lpTokenSupply,\\n uint256 boughtId,\\n uint256 tokensBought\\n );\\n event RemoveLiquidityImbalance(\\n address indexed provider,\\n uint256[] tokenAmounts,\\n uint256[] fees,\\n uint256 invariant,\\n uint256 lpTokenSupply\\n );\\n event NewAdminFee(uint256 newAdminFee);\\n event NewSwapFee(uint256 newSwapFee);\\n event NewWithdrawFee(uint256 newWithdrawFee);\\n event RampA(uint256 oldA, uint256 newA, uint256 initialTime, uint256 futureTime);\\n event StopRampA(uint256 currentA, uint256 time);\\n\\n function swap(\\n uint8 tokenIndexFrom,\\n uint8 tokenIndexTo,\\n uint256 dx,\\n uint256 minDy,\\n uint256 deadline\\n ) external returns (uint256);\\n\\n function swapExact(\\n uint256 amountIn,\\n address assetIn,\\n address assetOut,\\n uint256 minAmountOut,\\n uint256 deadline\\n ) external payable returns (uint256);\\n\\n function swapExactOut(\\n uint256 amountOut,\\n address assetIn,\\n address assetOut,\\n uint256 maxAmountIn,\\n uint256 deadline\\n ) external payable returns (uint256);\\n\\n function getA() external view returns (uint256);\\n\\n function getToken(uint8 index) external view returns (IERC20);\\n\\n function getTokenIndex(address tokenAddress) external view returns (uint8);\\n\\n function getTokenBalance(uint8 index) external view returns (uint256);\\n\\n function getVirtualPrice() external view returns (uint256);\\n\\n // min return calculation functions\\n function calculateSwap(\\n uint8 tokenIndexFrom,\\n uint8 tokenIndexTo,\\n uint256 dx\\n ) external view returns (uint256);\\n\\n function calculateSwapOut(\\n uint8 tokenIndexFrom,\\n uint8 tokenIndexTo,\\n uint256 dy\\n ) external view returns (uint256);\\n\\n function calculateSwapFromAddress(\\n address assetIn,\\n address assetOut,\\n uint256 amountIn\\n ) external view returns (uint256);\\n\\n function calculateSwapOutFromAddress(\\n address assetIn,\\n address assetOut,\\n uint256 amountOut\\n ) external view returns (uint256);\\n\\n function calculateTokenAmount(uint256[] calldata amounts, bool deposit) external view returns (uint256);\\n\\n function calculateRemoveLiquidity(uint256 amount) external view returns (uint256[] memory);\\n\\n function calculateRemoveLiquidityOneToken(uint256 tokenAmount, uint8 tokenIndex)\\n external\\n view\\n returns (uint256 availableTokenAmount);\\n\\n // state modifying functions\\n function initialize(\\n IERC20[] memory pooledTokens,\\n uint8[] memory decimals,\\n string memory lpTokenName,\\n string memory lpTokenSymbol,\\n uint256 a,\\n uint256 fee,\\n uint256 adminFee,\\n address lpTokenTargetAddress\\n ) external;\\n\\n function addLiquidity(\\n uint256[] calldata amounts,\\n uint256 minToMint,\\n uint256 deadline\\n ) external returns (uint256);\\n\\n function removeLiquidity(\\n uint256 amount,\\n uint256[] calldata minAmounts,\\n uint256 deadline\\n ) external returns (uint256[] memory);\\n\\n function removeLiquidityOneToken(\\n uint256 tokenAmount,\\n uint8 tokenIndex,\\n uint256 minAmount,\\n uint256 deadline\\n ) external returns (uint256);\\n\\n function removeLiquidityImbalance(\\n uint256[] calldata amounts,\\n uint256 maxBurnAmount,\\n uint256 deadline\\n ) external returns (uint256);\\n}\\n\",\"keccak256\":\"0xfbbb2cad0639658aa781212c69df10718250a6926d94a1a7508fc9927216abe8\",\"license\":\"UNLICENSED\"},\"@connext/nxtp-contracts/contracts/core/connext/interfaces/IXReceiver.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSED\\npragma solidity 0.8.15;\\n\\ninterface IXReceiver {\\n function xReceive(\\n bytes32 _transferId,\\n uint256 _amount,\\n address _asset,\\n address _originSender,\\n uint32 _origin,\\n bytes memory _callData\\n ) external returns (bytes memory);\\n}\\n\",\"keccak256\":\"0x75286f6ac1b1d5d7f4e508a478c0dad3a26d92675dabbf180d0b46d892618a1a\",\"license\":\"UNLICENSED\"},\"@connext/nxtp-contracts/contracts/core/connext/libraries/AmplificationUtils.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSED\\npragma solidity 0.8.15;\\n\\nimport {SafeERC20} from \\\"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\\\";\\n\\nimport {SwapUtils} from \\\"./SwapUtils.sol\\\";\\n\\n/**\\n * @title AmplificationUtils library\\n * @notice A library to calculate and ramp the A parameter of a given `SwapUtils.Swap` struct.\\n * This library assumes the struct is fully validated.\\n */\\nlibrary AmplificationUtils {\\n event RampA(uint256 oldA, uint256 newA, uint256 initialTime, uint256 futureTime);\\n event StopRampA(uint256 currentA, uint256 time);\\n\\n // Constant values used in ramping A calculations\\n uint256 public constant A_PRECISION = 100;\\n uint256 public constant MAX_A = 10**6;\\n uint256 private constant MAX_A_CHANGE = 2;\\n uint256 private constant MIN_RAMP_TIME = 14 days;\\n\\n /**\\n * @notice Return A, the amplification coefficient * n * (n - 1)\\n * @dev See the StableSwap paper for details\\n * @param self Swap struct to read from\\n * @return A parameter\\n */\\n function getA(SwapUtils.Swap storage self) internal view returns (uint256) {\\n return _getAPrecise(self) / A_PRECISION;\\n }\\n\\n /**\\n * @notice Return A in its raw precision\\n * @dev See the StableSwap paper for details\\n * @param self Swap struct to read from\\n * @return A parameter in its raw precision form\\n */\\n function getAPrecise(SwapUtils.Swap storage self) internal view returns (uint256) {\\n return _getAPrecise(self);\\n }\\n\\n /**\\n * @notice Return A in its raw precision\\n * @dev See the StableSwap paper for details\\n * @param self Swap struct to read from\\n * @return A parameter in its raw precision form\\n */\\n function _getAPrecise(SwapUtils.Swap storage self) internal view returns (uint256) {\\n uint256 t1 = self.futureATime; // time when ramp is finished\\n uint256 a1 = self.futureA; // final A value when ramp is finished\\n\\n if (block.timestamp < t1) {\\n uint256 t0 = self.initialATime; // time when ramp is started\\n uint256 a0 = self.initialA; // initial A value when ramp is started\\n if (a1 > a0) {\\n // a0 + (a1 - a0) * (block.timestamp - t0) / (t1 - t0)\\n return a0 + ((a1 - a0) * (block.timestamp - t0)) / (t1 - t0);\\n } else {\\n // a0 - (a0 - a1) * (block.timestamp - t0) / (t1 - t0)\\n return a0 - ((a0 - a1) * (block.timestamp - t0)) / (t1 - t0);\\n }\\n } else {\\n return a1;\\n }\\n }\\n\\n /**\\n * @notice Start ramping up or down A parameter towards given futureA_ and futureTime_\\n * Checks if the change is too rapid, and commits the new A value only when it falls under\\n * the limit range.\\n * @param self Swap struct to update\\n * @param futureA_ the new A to ramp towards\\n * @param futureTime_ timestamp when the new A should be reached\\n */\\n function rampA(\\n SwapUtils.Swap storage self,\\n uint256 futureA_,\\n uint256 futureTime_\\n ) internal {\\n require(block.timestamp >= self.initialATime + 1 days, \\\"Wait 1 day before starting ramp\\\");\\n require(futureTime_ >= block.timestamp + MIN_RAMP_TIME, \\\"Insufficient ramp time\\\");\\n require(futureA_ != 0 && futureA_ < MAX_A, \\\"futureA_ must be > 0 and < MAX_A\\\");\\n\\n uint256 initialAPrecise = _getAPrecise(self);\\n uint256 futureAPrecise = futureA_ * A_PRECISION;\\n\\n if (futureAPrecise < initialAPrecise) {\\n require(futureAPrecise * MAX_A_CHANGE >= initialAPrecise, \\\"futureA_ is too small\\\");\\n } else {\\n require(futureAPrecise <= initialAPrecise * MAX_A_CHANGE, \\\"futureA_ is too large\\\");\\n }\\n\\n self.initialA = initialAPrecise;\\n self.futureA = futureAPrecise;\\n self.initialATime = block.timestamp;\\n self.futureATime = futureTime_;\\n\\n emit RampA(initialAPrecise, futureAPrecise, block.timestamp, futureTime_);\\n }\\n\\n /**\\n * @notice Stops ramping A immediately. Once this function is called, rampA()\\n * cannot be called for another 24 hours\\n * @param self Swap struct to update\\n */\\n function stopRampA(SwapUtils.Swap storage self) internal {\\n require(self.futureATime > block.timestamp, \\\"Ramp is already stopped\\\");\\n\\n uint256 currentA = _getAPrecise(self);\\n self.initialA = currentA;\\n self.futureA = currentA;\\n self.initialATime = block.timestamp;\\n self.futureATime = block.timestamp;\\n\\n emit StopRampA(currentA, block.timestamp);\\n }\\n}\\n\",\"keccak256\":\"0x7dca96b10fa307f469c142aaea0855d3c9ba45f79066eaeae1467ce113fc8d28\",\"license\":\"UNLICENSED\"},\"@connext/nxtp-contracts/contracts/core/connext/libraries/LibConnextStorage.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSED\\npragma solidity 0.8.15;\\n\\nimport {IStableSwap} from \\\"../interfaces/IStableSwap.sol\\\";\\nimport {IConnectorManager} from \\\"../../../messaging/interfaces/IConnectorManager.sol\\\";\\nimport {SwapUtils} from \\\"./SwapUtils.sol\\\";\\n\\n// ============= Enum =============\\n\\n/// @notice Enum representing address role\\n// Returns uint\\n// None - 0\\n// Router - 1\\n// Watcher - 2\\n// Admin - 3\\nenum Role {\\n None,\\n Router,\\n Watcher,\\n Admin\\n}\\n\\n/**\\n * @notice Enum representing status of destination transfer\\n * @dev Status is only assigned on the destination domain, will always be \\\"none\\\" for the\\n * origin domains\\n * @return uint - Index of value in enum\\n */\\nenum DestinationTransferStatus {\\n None, // 0\\n Reconciled, // 1\\n Executed, // 2\\n Completed // 3 - executed + reconciled\\n}\\n\\n// ============= Structs =============\\n\\nstruct TokenId {\\n uint32 domain;\\n bytes32 id;\\n}\\n\\n/**\\n * @notice These are the parameters that will remain constant between the\\n * two chains. They are supplied on `xcall` and should be asserted on `execute`\\n * @property to - The account that receives funds, in the event of a crosschain call,\\n * will receive funds if the call fails.\\n *\\n * @param originDomain - The originating domain (i.e. where `xcall` is called). Must match nomad domain schema\\n * @param destinationDomain - The final domain (i.e. where `execute` / `reconcile` are called). Must match nomad domain schema\\n * @param canonicalDomain - The canonical domain of the asset you are bridging\\n * @param to - The address you are sending funds (and potentially data) to\\n * @param delegate - An address who can execute txs on behalf of `to`, in addition to allowing relayers\\n * @param receiveLocal - If true, will use the local nomad asset on the destination instead of adopted.\\n * @param callData - The data to execute on the receiving chain. If no crosschain call is needed, then leave empty.\\n * @param slippage - Slippage user is willing to accept from original amount in expressed in BPS (i.e. if\\n * a user takes 1% slippage, this is expressed as 1_000)\\n * @param originSender - The msg.sender of the xcall\\n * @param bridgedAmt - The amount sent over the bridge (after potential AMM on xcall)\\n * @param normalizedIn - The amount sent to `xcall`, normalized to 18 decimals\\n * @param nonce - The nonce on the origin domain used to ensure the transferIds are unique\\n * @param canonicalId - The unique identifier of the canonical token corresponding to bridge assets\\n */\\nstruct TransferInfo {\\n uint32 originDomain;\\n uint32 destinationDomain;\\n uint32 canonicalDomain;\\n address to;\\n address delegate;\\n bool receiveLocal;\\n bytes callData;\\n uint256 slippage;\\n address originSender;\\n uint256 bridgedAmt;\\n uint256 normalizedIn;\\n uint256 nonce;\\n bytes32 canonicalId;\\n}\\n\\n/**\\n * @notice\\n * @param params - The TransferInfo. These are consistent across sending and receiving chains.\\n * @param routers - The routers who you are sending the funds on behalf of.\\n * @param routerSignatures - Signatures belonging to the routers indicating permission to use funds\\n * for the signed transfer ID.\\n * @param sequencer - The sequencer who assigned the router path to this transfer.\\n * @param sequencerSignature - Signature produced by the sequencer for path assignment accountability\\n * for the path that was signed.\\n */\\nstruct ExecuteArgs {\\n TransferInfo params;\\n address[] routers;\\n bytes[] routerSignatures;\\n address sequencer;\\n bytes sequencerSignature;\\n}\\n\\n/**\\n * @notice Contains RouterFacet related state\\n * @param approvedRouters - Mapping of whitelisted router addresses\\n * @param routerRecipients - Mapping of router withdraw recipient addresses.\\n * If set, all liquidity is withdrawn only to this address. Must be set by routerOwner\\n * (if configured) or the router itself\\n * @param routerOwners - Mapping of router owners\\n * If set, can update the routerRecipient\\n * @param proposedRouterOwners - Mapping of proposed router owners\\n * Must wait timeout to set the\\n * @param proposedRouterTimestamp - Mapping of proposed router owners timestamps\\n * When accepting a proposed owner, must wait for delay to elapse\\n */\\nstruct RouterPermissionsManagerInfo {\\n mapping(address => bool) approvedRouters;\\n mapping(address => bool) approvedForPortalRouters;\\n mapping(address => address) routerRecipients;\\n mapping(address => address) routerOwners;\\n mapping(address => address) proposedRouterOwners;\\n mapping(address => uint256) proposedRouterTimestamp;\\n}\\n\\nstruct AppStorage {\\n //\\n // 0\\n bool initialized;\\n //\\n // Connext\\n //\\n // 1\\n uint256 LIQUIDITY_FEE_NUMERATOR;\\n /**\\n * @notice The local address that is custodying relayer fees\\n */\\n // 2\\n address relayerFeeVault;\\n /**\\n * @notice Nonce for the contract, used to keep unique transfer ids.\\n * @dev Assigned at first interaction (xcall on origin domain).\\n */\\n // 3\\n uint256 nonce;\\n /**\\n * @notice The domain this contract exists on.\\n * @dev Must match the nomad domain, which is distinct from the \\\"chainId\\\".\\n */\\n // 4\\n uint32 domain;\\n /**\\n * @notice Mapping holding the AMMs for swapping in and out of local assets.\\n * @dev Swaps for an adopted asset <> nomad local asset (i.e. POS USDC <> madUSDC on polygon).\\n * This mapping is keyed on the hash of the canonical id + domain for local asset.\\n */\\n // 6\\n mapping(bytes32 => IStableSwap) adoptedToLocalPools;\\n /**\\n * @notice Mapping of whitelisted assets on same domain as contract.\\n * @dev Mapping is keyed on the hash of the canonical id and domain\\n */\\n // 7\\n mapping(bytes32 => bool) approvedAssets;\\n /**\\n * @notice Mapping of liquidity caps of whitelisted assets. If 0, no cap is enforced.\\n * @dev Mapping is keyed on the hash of the canonical id and domain\\n */\\n // 7\\n mapping(bytes32 => uint256) caps;\\n /**\\n * @notice Mapping of adopted to canonical asset information.\\n * @dev If the adopted asset is the native asset, the keyed address will\\n * be the wrapped asset address.\\n */\\n // 8\\n mapping(address => TokenId) adoptedToCanonical;\\n /**\\n * @notice Mapping of representation to canonical asset information.\\n */\\n // 9\\n mapping(address => TokenId) representationToCanonical;\\n /**\\n * @notice Mapping of hash(canonicalId, canonicalDomain) to adopted asset on this domain.\\n * @dev If the adopted asset is the native asset, the stored address will be the\\n * wrapped asset address.\\n */\\n // 10\\n mapping(bytes32 => address) canonicalToAdopted;\\n /**\\n * @notice Mapping of canonical to representation asset information.\\n * @dev If the token is of local origin (meaning it was originanlly deployed on this chain),\\n * this MUST map to address(0).\\n */\\n // 11\\n mapping(bytes32 => address) canonicalToRepresentation;\\n /**\\n * @notice Mapping to track transfer status on destination domain\\n */\\n // 12\\n mapping(bytes32 => DestinationTransferStatus) transferStatus;\\n /**\\n * @notice Mapping holding router address that provided fast liquidity.\\n */\\n // 13\\n mapping(bytes32 => address[]) routedTransfers;\\n /**\\n * @notice Mapping of router to available balance of an asset.\\n * @dev Routers should always store liquidity that they can expect to receive via the bridge on\\n * this domain (the nomad local asset).\\n */\\n // 14\\n mapping(address => mapping(address => uint256)) routerBalances;\\n /**\\n * @notice Mapping of approved relayers\\n * @dev Send relayer fee if msg.sender is approvedRelayer; otherwise revert.\\n */\\n // 15\\n mapping(address => bool) approvedRelayers;\\n /**\\n * @notice The max amount of routers a payment can be routed through.\\n */\\n // 18\\n uint256 maxRoutersPerTransfer;\\n /**\\n * @notice Stores a mapping of transfer id to slippage overrides.\\n */\\n // 20\\n mapping(bytes32 => uint256) slippage;\\n /**\\n * @notice Stores a mapping of remote routers keyed on domains.\\n * @dev Addresses are cast to bytes32.\\n * This mapping is required because the Connext now contains the BridgeRouter and must implement\\n * the remotes interface.\\n */\\n // 21\\n mapping(uint32 => bytes32) remotes;\\n //\\n // ProposedOwnable\\n //\\n // 22\\n address _proposed;\\n // 23\\n uint256 _proposedOwnershipTimestamp;\\n // 24\\n bool _routerWhitelistRemoved;\\n // 25\\n uint256 _routerWhitelistTimestamp;\\n // 26\\n bool _assetWhitelistRemoved;\\n // 27\\n uint256 _assetWhitelistTimestamp;\\n /**\\n * @notice Stores a mapping of address to Roles\\n * @dev returns uint representing the enum Role value\\n */\\n // 28\\n mapping(address => Role) roles;\\n //\\n // RouterFacet\\n //\\n // 29\\n RouterPermissionsManagerInfo routerPermissionInfo;\\n //\\n // ReentrancyGuard\\n //\\n // 30\\n uint256 _status;\\n //\\n // StableSwap\\n //\\n /**\\n * @notice Mapping holding the AMM storages for swapping in and out of local assets\\n * @dev Swaps for an adopted asset <> nomad local asset (i.e. POS USDC <> madUSDC on polygon)\\n * Struct storing data responsible for automatic market maker functionalities. In order to\\n * access this data, this contract uses SwapUtils library. For more details, see SwapUtils.sol.\\n */\\n // 31\\n mapping(bytes32 => SwapUtils.Swap) swapStorages;\\n /**\\n * @notice Maps token address to an index in the pool. Used to prevent duplicate tokens in the pool.\\n * @dev getTokenIndex function also relies on this mapping to retrieve token index.\\n */\\n // 32\\n mapping(bytes32 => mapping(address => uint8)) tokenIndexes;\\n /**\\n * @notice Stores whether or not bribing, AMMs, have been paused.\\n */\\n // 33\\n bool _paused;\\n //\\n // AavePortals\\n //\\n /**\\n * @notice Address of Aave Pool contract.\\n */\\n // 34\\n address aavePool;\\n /**\\n * @notice Fee percentage numerator for using Portal liquidity.\\n * @dev Assumes the same basis points as the liquidity fee.\\n */\\n // 35\\n uint256 aavePortalFeeNumerator;\\n /**\\n * @notice Mapping to store the transfer liquidity amount provided by Aave Portals.\\n */\\n // 36\\n mapping(bytes32 => uint256) portalDebt;\\n /**\\n * @notice Mapping to store the transfer liquidity amount provided by Aave Portals.\\n */\\n // 37\\n mapping(bytes32 => uint256) portalFeeDebt;\\n /**\\n * @notice Mapping of approved sequencers\\n * @dev Sequencer address provided must belong to an approved sequencer in order to call `execute`\\n * for the fast liquidity route.\\n */\\n // 38\\n mapping(address => bool) approvedSequencers;\\n /**\\n * @notice Remote connection manager for xapp.\\n */\\n // 39\\n IConnectorManager xAppConnectionManager;\\n}\\n\\nlibrary LibConnextStorage {\\n function connextStorage() internal pure returns (AppStorage storage ds) {\\n assembly {\\n ds.slot := 0\\n }\\n }\\n}\\n\",\"keccak256\":\"0x24f998cc9edbb1f3f00c7148d18b7ca0d40eaaac7e3f7fa990ffe89bdee8ec32\",\"license\":\"UNLICENSED\"},\"@connext/nxtp-contracts/contracts/core/connext/libraries/LibDiamond.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.15;\\n\\n/******************************************************************************\\\\\\n* Author: Nick Mudge (https://twitter.com/mudgen)\\n* EIP-2535 Diamonds: https://eips.ethereum.org/EIPS/eip-2535\\n/******************************************************************************/\\nimport {IDiamondCut} from \\\"../interfaces/IDiamondCut.sol\\\";\\n\\n// Remember to add the loupe functions from DiamondLoupeFacet to the diamond.\\n// The loupe functions are required by the EIP2535 Diamonds standard\\n\\nlibrary LibDiamond {\\n bytes32 constant DIAMOND_STORAGE_POSITION = keccak256(\\\"diamond.standard.diamond.storage\\\");\\n\\n struct FacetAddressAndPosition {\\n address facetAddress;\\n uint96 functionSelectorPosition; // position in facetFunctionSelectors.functionSelectors array\\n }\\n\\n struct FacetFunctionSelectors {\\n bytes4[] functionSelectors;\\n uint256 facetAddressPosition; // position of facetAddress in facetAddresses array\\n }\\n\\n struct DiamondStorage {\\n // maps function selector to the facet address and\\n // the position of the selector in the facetFunctionSelectors.selectors array\\n mapping(bytes4 => FacetAddressAndPosition) selectorToFacetAndPosition;\\n // maps facet addresses to function selectors\\n mapping(address => FacetFunctionSelectors) facetFunctionSelectors;\\n // facet addresses\\n address[] facetAddresses;\\n // Used to query if a contract implements an interface.\\n // Used to implement ERC-165.\\n mapping(bytes4 => bool) supportedInterfaces;\\n // owner of the contract\\n address contractOwner;\\n // hash of proposed facets => acceptance time\\n mapping(bytes32 => uint256) acceptanceTimes;\\n // acceptance delay for upgrading facets\\n uint256 acceptanceDelay;\\n }\\n\\n function diamondStorage() internal pure returns (DiamondStorage storage ds) {\\n bytes32 position = DIAMOND_STORAGE_POSITION;\\n assembly {\\n ds.slot := position\\n }\\n }\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n function setContractOwner(address _newOwner) internal {\\n DiamondStorage storage ds = diamondStorage();\\n address previousOwner = ds.contractOwner;\\n ds.contractOwner = _newOwner;\\n emit OwnershipTransferred(previousOwner, _newOwner);\\n }\\n\\n function contractOwner() internal view returns (address contractOwner_) {\\n contractOwner_ = diamondStorage().contractOwner;\\n }\\n\\n function acceptanceDelay() internal view returns (uint256) {\\n return diamondStorage().acceptanceDelay;\\n }\\n\\n function acceptanceTime(bytes32 _key) internal view returns (uint256) {\\n return diamondStorage().acceptanceTimes[_key];\\n }\\n\\n function enforceIsContractOwner() internal view {\\n require(msg.sender == diamondStorage().contractOwner, \\\"LibDiamond: !contract owner\\\");\\n }\\n\\n event DiamondCutProposed(IDiamondCut.FacetCut[] _diamondCut, address _init, bytes _calldata, uint256 deadline);\\n\\n function proposeDiamondCut(\\n IDiamondCut.FacetCut[] memory _diamondCut,\\n address _init,\\n bytes memory _calldata\\n ) internal {\\n DiamondStorage storage ds = diamondStorage();\\n uint256 acceptance = block.timestamp + ds.acceptanceDelay;\\n ds.acceptanceTimes[keccak256(abi.encode(_diamondCut, _init, _calldata))] = acceptance;\\n emit DiamondCutProposed(_diamondCut, _init, _calldata, acceptance);\\n }\\n\\n event DiamondCutRescinded(IDiamondCut.FacetCut[] _diamondCut, address _init, bytes _calldata);\\n\\n function rescindDiamondCut(\\n IDiamondCut.FacetCut[] memory _diamondCut,\\n address _init,\\n bytes memory _calldata\\n ) internal {\\n // NOTE: you can always rescind a proposed facet cut as the owner, even if outside of the validity\\n // period or befor the delay elpases\\n diamondStorage().acceptanceTimes[keccak256(abi.encode(_diamondCut, _init, _calldata))] = 0;\\n emit DiamondCutRescinded(_diamondCut, _init, _calldata);\\n }\\n\\n event DiamondCut(IDiamondCut.FacetCut[] _diamondCut, address _init, bytes _calldata);\\n\\n // Internal function version of diamondCut\\n function diamondCut(\\n IDiamondCut.FacetCut[] memory _diamondCut,\\n address _init,\\n bytes memory _calldata\\n ) internal {\\n DiamondStorage storage ds = diamondStorage();\\n if (ds.facetAddresses.length != 0) {\\n uint256 time = ds.acceptanceTimes[keccak256(abi.encode(_diamondCut, _init, _calldata))];\\n require(time != 0 && time <= block.timestamp, \\\"LibDiamond: delay not elapsed\\\");\\n } // Otherwise, this is the first instance of deployment and it can be set automatically\\n for (uint256 facetIndex; facetIndex < _diamondCut.length; facetIndex++) {\\n IDiamondCut.FacetCutAction action = _diamondCut[facetIndex].action;\\n if (action == IDiamondCut.FacetCutAction.Add) {\\n addFunctions(_diamondCut[facetIndex].facetAddress, _diamondCut[facetIndex].functionSelectors);\\n } else if (action == IDiamondCut.FacetCutAction.Replace) {\\n replaceFunctions(_diamondCut[facetIndex].facetAddress, _diamondCut[facetIndex].functionSelectors);\\n } else if (action == IDiamondCut.FacetCutAction.Remove) {\\n removeFunctions(_diamondCut[facetIndex].facetAddress, _diamondCut[facetIndex].functionSelectors);\\n } else {\\n revert(\\\"LibDiamondCut: Incorrect FacetCutAction\\\");\\n }\\n }\\n emit DiamondCut(_diamondCut, _init, _calldata);\\n initializeDiamondCut(_init, _calldata);\\n }\\n\\n function addFunctions(address _facetAddress, bytes4[] memory _functionSelectors) internal {\\n require(_functionSelectors.length != 0, \\\"LibDiamondCut: No selectors in facet to cut\\\");\\n DiamondStorage storage ds = diamondStorage();\\n require(_facetAddress != address(0), \\\"LibDiamondCut: Add facet can't be address(0)\\\");\\n uint96 selectorPosition = uint96(ds.facetFunctionSelectors[_facetAddress].functionSelectors.length);\\n // add new facet address if it does not exist\\n if (selectorPosition == 0) {\\n addFacet(ds, _facetAddress);\\n }\\n for (uint256 selectorIndex; selectorIndex < _functionSelectors.length; selectorIndex++) {\\n bytes4 selector = _functionSelectors[selectorIndex];\\n address oldFacetAddress = ds.selectorToFacetAndPosition[selector].facetAddress;\\n require(oldFacetAddress == address(0), \\\"LibDiamondCut: Can't add function that already exists\\\");\\n addFunction(ds, selector, selectorPosition, _facetAddress);\\n selectorPosition++;\\n }\\n }\\n\\n function replaceFunctions(address _facetAddress, bytes4[] memory _functionSelectors) internal {\\n require(_functionSelectors.length != 0, \\\"LibDiamondCut: No selectors in facet to cut\\\");\\n DiamondStorage storage ds = diamondStorage();\\n require(_facetAddress != address(0), \\\"LibDiamondCut: Add facet can't be address(0)\\\");\\n uint96 selectorPosition = uint96(ds.facetFunctionSelectors[_facetAddress].functionSelectors.length);\\n // add new facet address if it does not exist\\n if (selectorPosition == 0) {\\n addFacet(ds, _facetAddress);\\n }\\n for (uint256 selectorIndex; selectorIndex < _functionSelectors.length; selectorIndex++) {\\n bytes4 selector = _functionSelectors[selectorIndex];\\n address oldFacetAddress = ds.selectorToFacetAndPosition[selector].facetAddress;\\n require(oldFacetAddress != _facetAddress, \\\"LibDiamondCut: Can't replace function with same function\\\");\\n removeFunction(ds, oldFacetAddress, selector);\\n addFunction(ds, selector, selectorPosition, _facetAddress);\\n selectorPosition++;\\n }\\n }\\n\\n function removeFunctions(address _facetAddress, bytes4[] memory _functionSelectors) internal {\\n require(_functionSelectors.length != 0, \\\"LibDiamondCut: No selectors in facet to cut\\\");\\n DiamondStorage storage ds = diamondStorage();\\n // if function does not exist then do nothing and return\\n require(_facetAddress == address(0), \\\"LibDiamondCut: Remove facet address must be address(0)\\\");\\n for (uint256 selectorIndex; selectorIndex < _functionSelectors.length; selectorIndex++) {\\n bytes4 selector = _functionSelectors[selectorIndex];\\n address oldFacetAddress = ds.selectorToFacetAndPosition[selector].facetAddress;\\n removeFunction(ds, oldFacetAddress, selector);\\n }\\n }\\n\\n function addFacet(DiamondStorage storage ds, address _facetAddress) internal {\\n enforceHasContractCode(_facetAddress, \\\"LibDiamondCut: New facet has no code\\\");\\n ds.facetFunctionSelectors[_facetAddress].facetAddressPosition = ds.facetAddresses.length;\\n ds.facetAddresses.push(_facetAddress);\\n }\\n\\n function addFunction(\\n DiamondStorage storage ds,\\n bytes4 _selector,\\n uint96 _selectorPosition,\\n address _facetAddress\\n ) internal {\\n ds.selectorToFacetAndPosition[_selector].functionSelectorPosition = _selectorPosition;\\n ds.facetFunctionSelectors[_facetAddress].functionSelectors.push(_selector);\\n ds.selectorToFacetAndPosition[_selector].facetAddress = _facetAddress;\\n }\\n\\n function removeFunction(\\n DiamondStorage storage ds,\\n address _facetAddress,\\n bytes4 _selector\\n ) internal {\\n require(_facetAddress != address(0), \\\"LibDiamondCut: Can't remove function that doesn't exist\\\");\\n // an immutable function is a function defined directly in a diamond\\n require(_facetAddress != address(this), \\\"LibDiamondCut: Can't remove immutable function\\\");\\n // replace selector with last selector, then delete last selector\\n uint256 selectorPosition = ds.selectorToFacetAndPosition[_selector].functionSelectorPosition;\\n uint256 lastSelectorPosition = ds.facetFunctionSelectors[_facetAddress].functionSelectors.length - 1;\\n // if not the same then replace _selector with lastSelector\\n if (selectorPosition != lastSelectorPosition) {\\n bytes4 lastSelector = ds.facetFunctionSelectors[_facetAddress].functionSelectors[lastSelectorPosition];\\n ds.facetFunctionSelectors[_facetAddress].functionSelectors[selectorPosition] = lastSelector;\\n ds.selectorToFacetAndPosition[lastSelector].functionSelectorPosition = uint96(selectorPosition);\\n }\\n // delete the last selector\\n ds.facetFunctionSelectors[_facetAddress].functionSelectors.pop();\\n delete ds.selectorToFacetAndPosition[_selector];\\n\\n // if no more selectors for facet address then delete the facet address\\n if (lastSelectorPosition == 0) {\\n // replace facet address with last facet address and delete last facet address\\n uint256 lastFacetAddressPosition = ds.facetAddresses.length - 1;\\n uint256 facetAddressPosition = ds.facetFunctionSelectors[_facetAddress].facetAddressPosition;\\n if (facetAddressPosition != lastFacetAddressPosition) {\\n address lastFacetAddress = ds.facetAddresses[lastFacetAddressPosition];\\n ds.facetAddresses[facetAddressPosition] = lastFacetAddress;\\n ds.facetFunctionSelectors[lastFacetAddress].facetAddressPosition = facetAddressPosition;\\n }\\n ds.facetAddresses.pop();\\n delete ds.facetFunctionSelectors[_facetAddress].facetAddressPosition;\\n }\\n }\\n\\n function initializeDiamondCut(address _init, bytes memory _calldata) internal {\\n if (_init == address(0)) {\\n require(_calldata.length == 0, \\\"LibDiamondCut: _init is address(0) but_calldata is not empty\\\");\\n } else {\\n require(_calldata.length != 0, \\\"LibDiamondCut: _calldata is empty but _init is not address(0)\\\");\\n if (_init != address(this)) {\\n enforceHasContractCode(_init, \\\"LibDiamondCut: _init address has no code\\\");\\n }\\n (bool success, bytes memory error) = _init.delegatecall(_calldata);\\n if (!success) {\\n if (error.length != 0) {\\n // bubble up the error\\n revert(string(error));\\n } else {\\n revert(\\\"LibDiamondCut: _init function reverted\\\");\\n }\\n }\\n }\\n }\\n\\n function enforceHasContractCode(address _contract, string memory _errorMessage) internal view {\\n uint256 contractSize;\\n assembly {\\n contractSize := extcodesize(_contract)\\n }\\n require(contractSize != 0, _errorMessage);\\n }\\n}\\n\",\"keccak256\":\"0x0ca55de8a7f4e2256b8b7a5e9ae6cca6d6ff850bbd9fd79542dfc4236871c6d8\",\"license\":\"MIT\"},\"@connext/nxtp-contracts/contracts/core/connext/libraries/MathUtils.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSED\\npragma solidity 0.8.15;\\n\\n/**\\n * @title MathUtils library\\n * @notice A library to be used in conjunction with SafeMath. Contains functions for calculating\\n * differences between two uint256.\\n */\\nlibrary MathUtils {\\n /**\\n * @notice Compares a and b and returns true if the difference between a and b\\n * is less than 1 or equal to each other.\\n * @param a uint256 to compare with\\n * @param b uint256 to compare with\\n * @return True if the difference between a and b is less than 1 or equal,\\n * otherwise return false\\n */\\n function within1(uint256 a, uint256 b) internal pure returns (bool) {\\n return (difference(a, b) <= 1);\\n }\\n\\n /**\\n * @notice Calculates absolute difference between a and b\\n * @param a uint256 to compare with\\n * @param b uint256 to compare with\\n * @return Difference between a and b\\n */\\n function difference(uint256 a, uint256 b) internal pure returns (uint256) {\\n if (a > b) {\\n return a - b;\\n }\\n return b - a;\\n }\\n}\\n\",\"keccak256\":\"0xc0e55e78b6b5fec92fbf16f77f10103450f012394d995c8ace507f1abae29371\",\"license\":\"UNLICENSED\"},\"@connext/nxtp-contracts/contracts/core/connext/libraries/SwapUtils.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSED\\npragma solidity 0.8.15;\\n\\nimport {SafeERC20, IERC20} from \\\"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\\\";\\n\\nimport {LPToken} from \\\"../helpers/LPToken.sol\\\";\\n\\nimport {AmplificationUtils} from \\\"./AmplificationUtils.sol\\\";\\nimport {MathUtils} from \\\"./MathUtils.sol\\\";\\n\\n/**\\n * @title SwapUtils library\\n * @notice A library to be used within Swap.sol. Contains functions responsible for custody and AMM functionalities.\\n * @dev Contracts relying on this library must initialize SwapUtils.Swap struct then use this library\\n * for SwapUtils.Swap struct. Note that this library contains both functions called by users and admins.\\n * Admin functions should be protected within contracts using this library.\\n */\\nlibrary SwapUtils {\\n using SafeERC20 for IERC20;\\n using MathUtils for uint256;\\n\\n /*** EVENTS ***/\\n\\n event TokenSwap(\\n bytes32 indexed key,\\n address indexed buyer,\\n uint256 tokensSold,\\n uint256 tokensBought,\\n uint128 soldId,\\n uint128 boughtId\\n );\\n event AddLiquidity(\\n bytes32 indexed key,\\n address indexed provider,\\n uint256[] tokenAmounts,\\n uint256[] fees,\\n uint256 invariant,\\n uint256 lpTokenSupply\\n );\\n event RemoveLiquidity(bytes32 indexed key, address indexed provider, uint256[] tokenAmounts, uint256 lpTokenSupply);\\n event RemoveLiquidityOne(\\n bytes32 indexed key,\\n address indexed provider,\\n uint256 lpTokenAmount,\\n uint256 lpTokenSupply,\\n uint256 boughtId,\\n uint256 tokensBought\\n );\\n event RemoveLiquidityImbalance(\\n bytes32 indexed key,\\n address indexed provider,\\n uint256[] tokenAmounts,\\n uint256[] fees,\\n uint256 invariant,\\n uint256 lpTokenSupply\\n );\\n event NewAdminFee(bytes32 indexed key, uint256 newAdminFee);\\n event NewSwapFee(bytes32 indexed key, uint256 newSwapFee);\\n\\n struct Swap {\\n // variables around the ramp management of A,\\n // the amplification coefficient * n * (n - 1)\\n // see https://www.curve.fi/stableswap-paper.pdf for details\\n bytes32 key;\\n uint256 initialA;\\n uint256 futureA;\\n uint256 initialATime;\\n uint256 futureATime;\\n // fee calculation\\n uint256 swapFee;\\n uint256 adminFee;\\n LPToken lpToken;\\n // contract references for all tokens being pooled\\n IERC20[] pooledTokens;\\n // multipliers for each pooled token's precision to get to POOL_PRECISION_DECIMALS\\n // for example, TBTC has 18 decimals, so the multiplier should be 1. WBTC\\n // has 8, so the multiplier should be 10 ** 18 / 10 ** 8 => 10 ** 10\\n uint256[] tokenPrecisionMultipliers;\\n // the pool balance of each token, in the token's precision\\n // the contract's actual token balance might differ\\n uint256[] balances;\\n // the admin fee balance of each token, in the token's precision\\n uint256[] adminFees;\\n }\\n\\n // Struct storing variables used in calculations in the\\n // calculateWithdrawOneTokenDY function to avoid stack too deep errors\\n struct CalculateWithdrawOneTokenDYInfo {\\n uint256 d0;\\n uint256 d1;\\n uint256 newY;\\n uint256 feePerToken;\\n uint256 preciseA;\\n }\\n\\n // Struct storing variables used in calculations in the\\n // {add,remove}Liquidity functions to avoid stack too deep errors\\n struct ManageLiquidityInfo {\\n uint256 d0;\\n uint256 d1;\\n uint256 d2;\\n uint256 preciseA;\\n LPToken lpToken;\\n uint256 totalSupply;\\n uint256[] balances;\\n uint256[] multipliers;\\n }\\n\\n // the precision all pools tokens will be converted to\\n uint8 internal constant POOL_PRECISION_DECIMALS = 18;\\n\\n // the denominator used to calculate admin and LP fees. For example, an\\n // LP fee might be something like tradeAmount.mul(fee).div(FEE_DENOMINATOR)\\n uint256 internal constant FEE_DENOMINATOR = 1e10;\\n\\n // Max swap fee is 1% or 100bps of each swap\\n uint256 internal constant MAX_SWAP_FEE = 1e8;\\n\\n // Max adminFee is 100% of the swapFee\\n // adminFee does not add additional fee on top of swapFee\\n // Instead it takes a certain % of the swapFee. Therefore it has no impact on the\\n // users but only on the earnings of LPs\\n uint256 internal constant MAX_ADMIN_FEE = 1e10;\\n\\n // Constant value used as max loop limit\\n uint256 internal constant MAX_LOOP_LIMIT = 256;\\n\\n /*** VIEW & PURE FUNCTIONS ***/\\n\\n function _getAPrecise(Swap storage self) private view returns (uint256) {\\n return AmplificationUtils._getAPrecise(self);\\n }\\n\\n /**\\n * @notice Calculate the dy, the amount of selected token that user receives and\\n * the fee of withdrawing in one token\\n * @param tokenAmount the amount to withdraw in the pool's precision\\n * @param tokenIndex which token will be withdrawn\\n * @param self Swap struct to read from\\n * @return the amount of token user will receive\\n */\\n function calculateWithdrawOneToken(\\n Swap storage self,\\n uint256 tokenAmount,\\n uint8 tokenIndex\\n ) internal view returns (uint256) {\\n (uint256 availableTokenAmount, ) = _calculateWithdrawOneToken(\\n self,\\n tokenAmount,\\n tokenIndex,\\n self.lpToken.totalSupply()\\n );\\n return availableTokenAmount;\\n }\\n\\n function _calculateWithdrawOneToken(\\n Swap storage self,\\n uint256 tokenAmount,\\n uint8 tokenIndex,\\n uint256 totalSupply\\n ) private view returns (uint256, uint256) {\\n uint256 dy;\\n uint256 newY;\\n uint256 currentY;\\n\\n (dy, newY, currentY) = calculateWithdrawOneTokenDY(self, tokenIndex, tokenAmount, totalSupply);\\n\\n // dy_0 (without fees)\\n // dy, dy_0 - dy\\n\\n uint256 dySwapFee = (currentY - newY) / self.tokenPrecisionMultipliers[tokenIndex] - dy;\\n\\n return (dy, dySwapFee);\\n }\\n\\n /**\\n * @notice Calculate the dy of withdrawing in one token\\n * @param self Swap struct to read from\\n * @param tokenIndex which token will be withdrawn\\n * @param tokenAmount the amount to withdraw in the pools precision\\n * @return the d and the new y after withdrawing one token\\n */\\n function calculateWithdrawOneTokenDY(\\n Swap storage self,\\n uint8 tokenIndex,\\n uint256 tokenAmount,\\n uint256 totalSupply\\n )\\n internal\\n view\\n returns (\\n uint256,\\n uint256,\\n uint256\\n )\\n {\\n // Get the current D, then solve the stableswap invariant\\n // y_i for D - tokenAmount\\n uint256[] memory xp = _xp(self);\\n\\n require(tokenIndex < xp.length, \\\"index out of range\\\");\\n\\n CalculateWithdrawOneTokenDYInfo memory v = CalculateWithdrawOneTokenDYInfo(0, 0, 0, 0, 0);\\n v.preciseA = _getAPrecise(self);\\n v.d0 = getD(xp, v.preciseA);\\n v.d1 = v.d0 - ((tokenAmount * v.d0) / totalSupply);\\n\\n require(tokenAmount <= xp[tokenIndex], \\\"exceeds available\\\");\\n\\n v.newY = getYD(v.preciseA, tokenIndex, xp, v.d1);\\n\\n uint256[] memory xpReduced = new uint256[](xp.length);\\n\\n v.feePerToken = _feePerToken(self.swapFee, xp.length);\\n // TODO: Set a length variable (at top) instead of reading xp.length on each loop.\\n for (uint256 i; i < xp.length; ) {\\n uint256 xpi = xp[i];\\n // if i == tokenIndex, dxExpected = xp[i] * d1 / d0 - newY\\n // else dxExpected = xp[i] - (xp[i] * d1 / d0)\\n // xpReduced[i] -= dxExpected * fee / FEE_DENOMINATOR\\n xpReduced[i] =\\n xpi -\\n ((((i == tokenIndex) ? ((xpi * v.d1) / v.d0 - v.newY) : (xpi - (xpi * v.d1) / v.d0)) * v.feePerToken) /\\n FEE_DENOMINATOR);\\n\\n unchecked {\\n ++i;\\n }\\n }\\n\\n uint256 dy = xpReduced[tokenIndex] - getYD(v.preciseA, tokenIndex, xpReduced, v.d1);\\n dy = (dy - 1) / (self.tokenPrecisionMultipliers[tokenIndex]);\\n\\n return (dy, v.newY, xp[tokenIndex]);\\n }\\n\\n /**\\n * @notice Calculate the price of a token in the pool with given\\n * precision-adjusted balances and a particular D.\\n *\\n * @dev This is accomplished via solving the invariant iteratively.\\n * See the StableSwap paper and Curve.fi implementation for further details.\\n *\\n * x_1**2 + x1 * (sum' - (A*n**n - 1) * D / (A * n**n)) = D ** (n + 1) / (n ** (2 * n) * prod' * A)\\n * x_1**2 + b*x_1 = c\\n * x_1 = (x_1**2 + c) / (2*x_1 + b)\\n *\\n * @param a the amplification coefficient * n * (n - 1). See the StableSwap paper for details.\\n * @param tokenIndex Index of token we are calculating for.\\n * @param xp a precision-adjusted set of pool balances. Array should be\\n * the same cardinality as the pool.\\n * @param d the stableswap invariant\\n * @return the price of the token, in the same precision as in xp\\n */\\n function getYD(\\n uint256 a,\\n uint8 tokenIndex,\\n uint256[] memory xp,\\n uint256 d\\n ) internal pure returns (uint256) {\\n uint256 numTokens = xp.length;\\n require(tokenIndex < numTokens, \\\"Token not found\\\");\\n\\n uint256 c = d;\\n uint256 s;\\n uint256 nA = a * numTokens;\\n\\n for (uint256 i; i < numTokens; ) {\\n if (i != tokenIndex) {\\n s += xp[i];\\n c = (c * d) / (xp[i] * numTokens);\\n // If we were to protect the division loss we would have to keep the denominator separate\\n // and divide at the end. However this leads to overflow with large numTokens or/and D.\\n // c = c * D * D * D * ... overflow!\\n }\\n\\n unchecked {\\n ++i;\\n }\\n }\\n c = (c * d * AmplificationUtils.A_PRECISION) / (nA * numTokens);\\n\\n uint256 b = s + ((d * AmplificationUtils.A_PRECISION) / nA);\\n uint256 yPrev;\\n uint256 y = d;\\n for (uint256 i; i < MAX_LOOP_LIMIT; ) {\\n yPrev = y;\\n y = ((y * y) + c) / ((y * 2) + b - d);\\n if (y.within1(yPrev)) {\\n return y;\\n }\\n\\n unchecked {\\n ++i;\\n }\\n }\\n revert(\\\"Approximation did not converge\\\");\\n }\\n\\n /**\\n * @notice Get D, the StableSwap invariant, based on a set of balances and a particular A.\\n * @param xp a precision-adjusted set of pool balances. Array should be the same cardinality\\n * as the pool.\\n * @param a the amplification coefficient * n * (n - 1) in A_PRECISION.\\n * See the StableSwap paper for details\\n * @return the invariant, at the precision of the pool\\n */\\n function getD(uint256[] memory xp, uint256 a) internal pure returns (uint256) {\\n uint256 numTokens = xp.length;\\n uint256 s;\\n for (uint256 i; i < numTokens; ) {\\n s += xp[i];\\n\\n unchecked {\\n ++i;\\n }\\n }\\n if (s == 0) {\\n return 0;\\n }\\n\\n uint256 prevD;\\n uint256 d = s;\\n uint256 nA = a * numTokens;\\n\\n for (uint256 i; i < MAX_LOOP_LIMIT; ) {\\n uint256 dP = d;\\n for (uint256 j; j < numTokens; ) {\\n dP = (dP * d) / (xp[j] * numTokens);\\n // If we were to protect the division loss we would have to keep the denominator separate\\n // and divide at the end. However this leads to overflow with large numTokens or/and D.\\n // dP = dP * D * D * D * ... overflow!\\n\\n unchecked {\\n ++j;\\n }\\n }\\n prevD = d;\\n d =\\n (((nA * s) / AmplificationUtils.A_PRECISION + dP * numTokens) * d) /\\n ((((nA - AmplificationUtils.A_PRECISION) * d) / AmplificationUtils.A_PRECISION + (numTokens + 1) * dP));\\n if (d.within1(prevD)) {\\n return d;\\n }\\n\\n unchecked {\\n ++i;\\n }\\n }\\n\\n // Convergence should occur in 4 loops or less. If this is reached, there may be something wrong\\n // with the pool. If this were to occur repeatedly, LPs should withdraw via `removeLiquidity()`\\n // function which does not rely on D.\\n revert(\\\"D does not converge\\\");\\n }\\n\\n /**\\n * @notice Given a set of balances and precision multipliers, return the\\n * precision-adjusted balances.\\n *\\n * @param balances an array of token balances, in their native precisions.\\n * These should generally correspond with pooled tokens.\\n *\\n * @param precisionMultipliers an array of multipliers, corresponding to\\n * the amounts in the balances array. When multiplied together they\\n * should yield amounts at the pool's precision.\\n *\\n * @return an array of amounts \\\"scaled\\\" to the pool's precision\\n */\\n function _xp(uint256[] memory balances, uint256[] memory precisionMultipliers)\\n internal\\n pure\\n returns (uint256[] memory)\\n {\\n uint256 numTokens = balances.length;\\n require(numTokens == precisionMultipliers.length, \\\"mismatch multipliers\\\");\\n uint256[] memory xp = new uint256[](numTokens);\\n for (uint256 i; i < numTokens; ) {\\n xp[i] = balances[i] * precisionMultipliers[i];\\n\\n unchecked {\\n ++i;\\n }\\n }\\n return xp;\\n }\\n\\n /**\\n * @notice Return the precision-adjusted balances of all tokens in the pool\\n * @param self Swap struct to read from\\n * @return the pool balances \\\"scaled\\\" to the pool's precision, allowing\\n * them to be more easily compared.\\n */\\n function _xp(Swap storage self) internal view returns (uint256[] memory) {\\n return _xp(self.balances, self.tokenPrecisionMultipliers);\\n }\\n\\n /**\\n * @notice Get the virtual price, to help calculate profit\\n * @param self Swap struct to read from\\n * @return the virtual price, scaled to precision of POOL_PRECISION_DECIMALS\\n */\\n function getVirtualPrice(Swap storage self) internal view returns (uint256) {\\n uint256 d = getD(_xp(self), _getAPrecise(self));\\n LPToken lpToken = self.lpToken;\\n uint256 supply = lpToken.totalSupply();\\n if (supply != 0) {\\n return (d * (10**uint256(POOL_PRECISION_DECIMALS))) / supply;\\n }\\n return 0;\\n }\\n\\n /**\\n * @notice Calculate the new balances of the tokens given the indexes of the token\\n * that is swapped from (FROM) and the token that is swapped to (TO).\\n * This function is used as a helper function to calculate how much TO token\\n * the user should receive on swap.\\n *\\n * @param preciseA precise form of amplification coefficient\\n * @param tokenIndexFrom index of FROM token\\n * @param tokenIndexTo index of TO token\\n * @param x the new total amount of FROM token\\n * @param xp balances of the tokens in the pool\\n * @return the amount of TO token that should remain in the pool\\n */\\n function getY(\\n uint256 preciseA,\\n uint8 tokenIndexFrom,\\n uint8 tokenIndexTo,\\n uint256 x,\\n uint256[] memory xp\\n ) internal pure returns (uint256) {\\n uint256 numTokens = xp.length;\\n require(tokenIndexFrom != tokenIndexTo, \\\"compare token to itself\\\");\\n require(tokenIndexFrom < numTokens && tokenIndexTo < numTokens, \\\"token not found\\\");\\n\\n uint256 d = getD(xp, preciseA);\\n uint256 c = d;\\n uint256 s;\\n uint256 nA = numTokens * preciseA;\\n\\n uint256 _x;\\n for (uint256 i; i < numTokens; ) {\\n if (i == tokenIndexFrom) {\\n _x = x;\\n } else if (i != tokenIndexTo) {\\n _x = xp[i];\\n } else {\\n unchecked {\\n ++i;\\n }\\n continue;\\n }\\n s += _x;\\n c = (c * d) / (_x * numTokens);\\n // If we were to protect the division loss we would have to keep the denominator separate\\n // and divide at the end. However this leads to overflow with large numTokens or/and D.\\n // c = c * D * D * D * ... overflow!\\n\\n unchecked {\\n ++i;\\n }\\n }\\n c = (c * d * AmplificationUtils.A_PRECISION) / (nA * numTokens);\\n uint256 b = s + ((d * AmplificationUtils.A_PRECISION) / nA);\\n uint256 yPrev;\\n uint256 y = d;\\n\\n // iterative approximation\\n for (uint256 i; i < MAX_LOOP_LIMIT; ) {\\n yPrev = y;\\n y = ((y * y) + c) / ((y * 2) + b - d);\\n if (y.within1(yPrev)) {\\n return y;\\n }\\n\\n unchecked {\\n ++i;\\n }\\n }\\n revert(\\\"Approximation did not converge\\\");\\n }\\n\\n /**\\n * @notice Externally calculates a swap between two tokens.\\n * @param self Swap struct to read from\\n * @param tokenIndexFrom the token to sell\\n * @param tokenIndexTo the token to buy\\n * @param dx the number of tokens to sell. If the token charges a fee on transfers,\\n * use the amount that gets transferred after the fee.\\n * @return dy the number of tokens the user will get\\n */\\n function calculateSwap(\\n Swap storage self,\\n uint8 tokenIndexFrom,\\n uint8 tokenIndexTo,\\n uint256 dx\\n ) internal view returns (uint256 dy) {\\n (dy, ) = _calculateSwap(self, tokenIndexFrom, tokenIndexTo, dx, self.balances);\\n }\\n\\n /**\\n * @notice Externally calculates a swap between two tokens.\\n * @param self Swap struct to read from\\n * @param tokenIndexFrom the token to sell\\n * @param tokenIndexTo the token to buy\\n * @param dy the number of tokens to buy.\\n * @return dx the number of tokens the user have to transfer + fee\\n */\\n function calculateSwapInv(\\n Swap storage self,\\n uint8 tokenIndexFrom,\\n uint8 tokenIndexTo,\\n uint256 dy\\n ) internal view returns (uint256 dx) {\\n (dx, ) = _calculateSwapInv(self, tokenIndexFrom, tokenIndexTo, dy, self.balances);\\n }\\n\\n /**\\n * @notice Internally calculates a swap between two tokens.\\n *\\n * @dev The caller is expected to transfer the actual amounts (dx and dy)\\n * using the token contracts.\\n *\\n * @param self Swap struct to read from\\n * @param tokenIndexFrom the token to sell\\n * @param tokenIndexTo the token to buy\\n * @param dx the number of tokens to sell. If the token charges a fee on transfers,\\n * use the amount that gets transferred after the fee.\\n * @return dy the number of tokens the user will get in the token's precision. ex WBTC -> 8\\n * @return dyFee the associated fee in multiplied precision (POOL_PRECISION_DECIMALS)\\n */\\n function _calculateSwap(\\n Swap storage self,\\n uint8 tokenIndexFrom,\\n uint8 tokenIndexTo,\\n uint256 dx,\\n uint256[] memory balances\\n ) internal view returns (uint256 dy, uint256 dyFee) {\\n uint256[] memory multipliers = self.tokenPrecisionMultipliers;\\n uint256[] memory xp = _xp(balances, multipliers);\\n require(tokenIndexFrom < xp.length && tokenIndexTo < xp.length, \\\"index out of range\\\");\\n uint256 x = dx * multipliers[tokenIndexFrom] + xp[tokenIndexFrom];\\n uint256 y = getY(_getAPrecise(self), tokenIndexFrom, tokenIndexTo, x, xp);\\n dy = xp[tokenIndexTo] - y - 1;\\n dyFee = (dy * self.swapFee) / FEE_DENOMINATOR;\\n dy = (dy - dyFee) / multipliers[tokenIndexTo];\\n }\\n\\n /**\\n * @notice Internally calculates a swap between two tokens.\\n *\\n * @dev The caller is expected to transfer the actual amounts (dx and dy)\\n * using the token contracts.\\n *\\n * @param self Swap struct to read from\\n * @param tokenIndexFrom the token to sell\\n * @param tokenIndexTo the token to buy\\n * @param dy the number of tokens to buy. If the token charges a fee on transfers,\\n * use the amount that gets transferred after the fee.\\n * @return dx the number of tokens the user have to deposit in the token's precision. ex WBTC -> 8\\n * @return dxFee the associated fee in multiplied precision (POOL_PRECISION_DECIMALS)\\n */\\n function _calculateSwapInv(\\n Swap storage self,\\n uint8 tokenIndexFrom,\\n uint8 tokenIndexTo,\\n uint256 dy,\\n uint256[] memory balances\\n ) internal view returns (uint256 dx, uint256 dxFee) {\\n require(tokenIndexFrom != tokenIndexTo, \\\"compare token to itself\\\");\\n uint256[] memory multipliers = self.tokenPrecisionMultipliers;\\n uint256[] memory xp = _xp(balances, multipliers);\\n require(tokenIndexFrom < xp.length && tokenIndexTo < xp.length, \\\"index out of range\\\");\\n\\n uint256 a = _getAPrecise(self);\\n uint256 d0 = getD(xp, a);\\n\\n xp[tokenIndexTo] = xp[tokenIndexTo] - (dy * multipliers[tokenIndexTo]);\\n uint256 x = getYD(a, tokenIndexFrom, xp, d0);\\n dx = x - xp[tokenIndexFrom] + 1;\\n dxFee = (dx * self.swapFee) / FEE_DENOMINATOR;\\n dx = (dx + dxFee) / multipliers[tokenIndexFrom];\\n }\\n\\n /**\\n * @notice A simple method to calculate amount of each underlying\\n * tokens that is returned upon burning given amount of\\n * LP tokens\\n *\\n * @param amount the amount of LP tokens that would to be burned on\\n * withdrawal\\n * @return array of amounts of tokens user will receive\\n */\\n function calculateRemoveLiquidity(Swap storage self, uint256 amount) internal view returns (uint256[] memory) {\\n return _calculateRemoveLiquidity(self.balances, amount, self.lpToken.totalSupply());\\n }\\n\\n function _calculateRemoveLiquidity(\\n uint256[] memory balances,\\n uint256 amount,\\n uint256 totalSupply\\n ) internal pure returns (uint256[] memory) {\\n require(amount <= totalSupply, \\\"exceed total supply\\\");\\n\\n uint256 numBalances = balances.length;\\n uint256[] memory amounts = new uint256[](numBalances);\\n\\n for (uint256 i; i < numBalances; ) {\\n amounts[i] = (balances[i] * amount) / totalSupply;\\n\\n unchecked {\\n ++i;\\n }\\n }\\n return amounts;\\n }\\n\\n /**\\n * @notice A simple method to calculate prices from deposits or\\n * withdrawals, excluding fees but including slippage. This is\\n * helpful as an input into the various \\\"min\\\" parameters on calls\\n * to fight front-running\\n *\\n * @dev This shouldn't be used outside frontends for user estimates.\\n *\\n * @param self Swap struct to read from\\n * @param amounts an array of token amounts to deposit or withdrawal,\\n * corresponding to pooledTokens. The amount should be in each\\n * pooled token's native precision. If a token charges a fee on transfers,\\n * use the amount that gets transferred after the fee.\\n * @param deposit whether this is a deposit or a withdrawal\\n * @return if deposit was true, total amount of lp token that will be minted and if\\n * deposit was false, total amount of lp token that will be burned\\n */\\n function calculateTokenAmount(\\n Swap storage self,\\n uint256[] calldata amounts,\\n bool deposit\\n ) internal view returns (uint256) {\\n uint256 a = _getAPrecise(self);\\n uint256[] memory balances = self.balances;\\n uint256[] memory multipliers = self.tokenPrecisionMultipliers;\\n\\n uint256 numBalances = balances.length;\\n uint256 d0 = getD(_xp(balances, multipliers), a);\\n for (uint256 i; i < numBalances; ) {\\n if (deposit) {\\n balances[i] = balances[i] + amounts[i];\\n } else {\\n balances[i] = balances[i] - amounts[i];\\n }\\n\\n unchecked {\\n ++i;\\n }\\n }\\n uint256 d1 = getD(_xp(balances, multipliers), a);\\n uint256 totalSupply = self.lpToken.totalSupply();\\n\\n if (deposit) {\\n return ((d1 - d0) * totalSupply) / d0;\\n } else {\\n return ((d0 - d1) * totalSupply) / d0;\\n }\\n }\\n\\n /**\\n * @notice return accumulated amount of admin fees of the token with given index\\n * @param self Swap struct to read from\\n * @param index Index of the pooled token\\n * @return admin balance in the token's precision\\n */\\n function getAdminBalance(Swap storage self, uint256 index) internal view returns (uint256) {\\n require(index < self.pooledTokens.length, \\\"index out of range\\\");\\n return self.adminFees[index];\\n }\\n\\n /**\\n * @notice internal helper function to calculate fee per token multiplier used in\\n * swap fee calculations\\n * @param swapFee swap fee for the tokens\\n * @param numTokens number of tokens pooled\\n */\\n function _feePerToken(uint256 swapFee, uint256 numTokens) internal pure returns (uint256) {\\n return (swapFee * numTokens) / ((numTokens - 1) * 4);\\n }\\n\\n /*** STATE MODIFYING FUNCTIONS ***/\\n\\n /**\\n * @notice swap two tokens in the pool\\n * @param self Swap struct to read from and write to\\n * @param tokenIndexFrom the token the user wants to sell\\n * @param tokenIndexTo the token the user wants to buy\\n * @param dx the amount of tokens the user wants to sell\\n * @param minDy the min amount the user would like to receive, or revert.\\n * @return amount of token user received on swap\\n */\\n function swap(\\n Swap storage self,\\n uint8 tokenIndexFrom,\\n uint8 tokenIndexTo,\\n uint256 dx,\\n uint256 minDy\\n ) internal returns (uint256) {\\n {\\n IERC20 tokenFrom = self.pooledTokens[tokenIndexFrom];\\n require(dx <= tokenFrom.balanceOf(msg.sender), \\\"swap more than you own\\\");\\n // Transfer tokens first to see if a fee was charged on transfer\\n uint256 beforeBalance = tokenFrom.balanceOf(address(this));\\n tokenFrom.safeTransferFrom(msg.sender, address(this), dx);\\n\\n // Use the actual transferred amount for AMM math\\n require(dx == tokenFrom.balanceOf(address(this)) - beforeBalance, \\\"no fee token support\\\");\\n }\\n\\n uint256 dy;\\n uint256 dyFee;\\n uint256[] memory balances = self.balances;\\n (dy, dyFee) = _calculateSwap(self, tokenIndexFrom, tokenIndexTo, dx, balances);\\n require(dy >= minDy, \\\"dy < minDy\\\");\\n\\n uint256 dyAdminFee = (dyFee * self.adminFee) / FEE_DENOMINATOR / self.tokenPrecisionMultipliers[tokenIndexTo];\\n\\n self.balances[tokenIndexFrom] = balances[tokenIndexFrom] + dx;\\n self.balances[tokenIndexTo] = balances[tokenIndexTo] - dy - dyAdminFee;\\n if (dyAdminFee != 0) {\\n self.adminFees[tokenIndexTo] = self.adminFees[tokenIndexTo] + dyAdminFee;\\n }\\n\\n self.pooledTokens[tokenIndexTo].safeTransfer(msg.sender, dy);\\n\\n emit TokenSwap(self.key, msg.sender, dx, dy, tokenIndexFrom, tokenIndexTo);\\n\\n return dy;\\n }\\n\\n /**\\n * @notice swap two tokens in the pool\\n * @param self Swap struct to read from and write to\\n * @param tokenIndexFrom the token the user wants to sell\\n * @param tokenIndexTo the token the user wants to buy\\n * @param dy the amount of tokens the user wants to buy\\n * @param maxDx the max amount the user would like to send.\\n * @return amount of token user have to transfer on swap\\n */\\n function swapOut(\\n Swap storage self,\\n uint8 tokenIndexFrom,\\n uint8 tokenIndexTo,\\n uint256 dy,\\n uint256 maxDx\\n ) internal returns (uint256) {\\n require(dy <= self.balances[tokenIndexTo], \\\">pool balance\\\");\\n\\n uint256 dx;\\n uint256 dxFee;\\n uint256[] memory balances = self.balances;\\n (dx, dxFee) = _calculateSwapInv(self, tokenIndexFrom, tokenIndexTo, dy, balances);\\n require(dx <= maxDx, \\\"dx > maxDx\\\");\\n\\n uint256 dxAdminFee = (dxFee * self.adminFee) / FEE_DENOMINATOR / self.tokenPrecisionMultipliers[tokenIndexFrom];\\n\\n self.balances[tokenIndexFrom] = balances[tokenIndexFrom] + dx - dxAdminFee;\\n self.balances[tokenIndexTo] = balances[tokenIndexTo] - dy;\\n if (dxAdminFee != 0) {\\n self.adminFees[tokenIndexFrom] = self.adminFees[tokenIndexFrom] + dxAdminFee;\\n }\\n\\n {\\n IERC20 tokenFrom = self.pooledTokens[tokenIndexFrom];\\n require(dx <= tokenFrom.balanceOf(msg.sender), \\\"more than you own\\\");\\n // Transfer tokens first to see if a fee was charged on transfer\\n uint256 beforeBalance = tokenFrom.balanceOf(address(this));\\n tokenFrom.safeTransferFrom(msg.sender, address(this), dx);\\n\\n // Use the actual transferred amount for AMM math\\n require(dx == tokenFrom.balanceOf(address(this)) - beforeBalance, \\\"not support fee token\\\");\\n }\\n\\n self.pooledTokens[tokenIndexTo].safeTransfer(msg.sender, dy);\\n\\n emit TokenSwap(self.key, msg.sender, dx, dy, tokenIndexFrom, tokenIndexTo);\\n\\n return dx;\\n }\\n\\n /**\\n * @notice swap two tokens in the pool internally\\n * @param self Swap struct to read from and write to\\n * @param tokenIndexFrom the token the user wants to sell\\n * @param tokenIndexTo the token the user wants to buy\\n * @param dx the amount of tokens the user wants to sell\\n * @param minDy the min amount the user would like to receive, or revert.\\n * @return amount of token user received on swap\\n */\\n function swapInternal(\\n Swap storage self,\\n uint8 tokenIndexFrom,\\n uint8 tokenIndexTo,\\n uint256 dx,\\n uint256 minDy\\n ) internal returns (uint256) {\\n require(dx <= self.balances[tokenIndexFrom], \\\"more than pool balance\\\");\\n\\n uint256 dy;\\n uint256 dyFee;\\n uint256[] memory balances = self.balances;\\n (dy, dyFee) = _calculateSwap(self, tokenIndexFrom, tokenIndexTo, dx, balances);\\n require(dy >= minDy, \\\"dy < minDy\\\");\\n\\n uint256 dyAdminFee = (dyFee * self.adminFee) / FEE_DENOMINATOR / self.tokenPrecisionMultipliers[tokenIndexTo];\\n\\n self.balances[tokenIndexFrom] = balances[tokenIndexFrom] + dx;\\n self.balances[tokenIndexTo] = balances[tokenIndexTo] - dy - dyAdminFee;\\n\\n if (dyAdminFee != 0) {\\n self.adminFees[tokenIndexTo] = self.adminFees[tokenIndexTo] + dyAdminFee;\\n }\\n\\n emit TokenSwap(self.key, msg.sender, dx, dy, tokenIndexFrom, tokenIndexTo);\\n\\n return dy;\\n }\\n\\n /**\\n * @notice Should get exact amount out of AMM for asset put in\\n */\\n function swapInternalOut(\\n Swap storage self,\\n uint8 tokenIndexFrom,\\n uint8 tokenIndexTo,\\n uint256 dy,\\n uint256 maxDx\\n ) internal returns (uint256) {\\n require(dy <= self.balances[tokenIndexTo], \\\"more than pool balance\\\");\\n\\n uint256 dx;\\n uint256 dxFee;\\n uint256[] memory balances = self.balances;\\n (dx, dxFee) = _calculateSwapInv(self, tokenIndexFrom, tokenIndexTo, dy, balances);\\n require(dx <= maxDx, \\\"dx > maxDx\\\");\\n\\n uint256 dxAdminFee = (dxFee * self.adminFee) / FEE_DENOMINATOR / self.tokenPrecisionMultipliers[tokenIndexFrom];\\n\\n self.balances[tokenIndexFrom] = balances[tokenIndexFrom] + dx - dxAdminFee;\\n self.balances[tokenIndexTo] = balances[tokenIndexTo] - dy;\\n\\n if (dxAdminFee != 0) {\\n self.adminFees[tokenIndexFrom] = self.adminFees[tokenIndexFrom] + dxAdminFee;\\n }\\n\\n emit TokenSwap(self.key, msg.sender, dx, dy, tokenIndexFrom, tokenIndexTo);\\n\\n return dx;\\n }\\n\\n /**\\n * @notice Add liquidity to the pool\\n * @param self Swap struct to read from and write to\\n * @param amounts the amounts of each token to add, in their native precision\\n * @param minToMint the minimum LP tokens adding this amount of liquidity\\n * should mint, otherwise revert. Handy for front-running mitigation\\n * allowed addresses. If the pool is not in the guarded launch phase, this parameter will be ignored.\\n * @return amount of LP token user received\\n */\\n function addLiquidity(\\n Swap storage self,\\n uint256[] memory amounts,\\n uint256 minToMint\\n ) internal returns (uint256) {\\n uint256 numTokens = self.pooledTokens.length;\\n require(amounts.length == numTokens, \\\"mismatch pooled tokens\\\");\\n\\n // current state\\n ManageLiquidityInfo memory v = ManageLiquidityInfo(\\n 0,\\n 0,\\n 0,\\n _getAPrecise(self),\\n self.lpToken,\\n 0,\\n self.balances,\\n self.tokenPrecisionMultipliers\\n );\\n v.totalSupply = v.lpToken.totalSupply();\\n if (v.totalSupply != 0) {\\n v.d0 = getD(_xp(v.balances, v.multipliers), v.preciseA);\\n }\\n\\n uint256[] memory newBalances = new uint256[](numTokens);\\n\\n for (uint256 i; i < numTokens; ) {\\n require(v.totalSupply != 0 || amounts[i] != 0, \\\"!supply all tokens\\\");\\n\\n // Transfer tokens first to see if a fee was charged on transfer\\n if (amounts[i] != 0) {\\n IERC20 token = self.pooledTokens[i];\\n uint256 beforeBalance = token.balanceOf(address(this));\\n token.safeTransferFrom(msg.sender, address(this), amounts[i]);\\n\\n // Update the amounts[] with actual transfer amount\\n amounts[i] = token.balanceOf(address(this)) - beforeBalance;\\n }\\n\\n newBalances[i] = v.balances[i] + amounts[i];\\n\\n unchecked {\\n ++i;\\n }\\n }\\n\\n // invariant after change\\n v.d1 = getD(_xp(newBalances, v.multipliers), v.preciseA);\\n require(v.d1 > v.d0, \\\"D should increase\\\");\\n\\n // updated to reflect fees and calculate the user's LP tokens\\n v.d2 = v.d1;\\n uint256[] memory fees = new uint256[](numTokens);\\n\\n if (v.totalSupply != 0) {\\n uint256 feePerToken = _feePerToken(self.swapFee, numTokens);\\n for (uint256 i; i < numTokens; ) {\\n uint256 idealBalance = (v.d1 * v.balances[i]) / v.d0;\\n fees[i] = (feePerToken * (idealBalance.difference(newBalances[i]))) / FEE_DENOMINATOR;\\n uint256 adminFee = (fees[i] * self.adminFee) / FEE_DENOMINATOR;\\n self.balances[i] = newBalances[i] - adminFee;\\n self.adminFees[i] = self.adminFees[i] + adminFee;\\n newBalances[i] = newBalances[i] - fees[i];\\n\\n unchecked {\\n ++i;\\n }\\n }\\n v.d2 = getD(_xp(newBalances, v.multipliers), v.preciseA);\\n } else {\\n // the initial depositor doesn't pay fees\\n self.balances = newBalances;\\n }\\n\\n uint256 toMint;\\n if (v.totalSupply == 0) {\\n toMint = v.d1;\\n } else {\\n toMint = ((v.d2 - v.d0) * v.totalSupply) / v.d0;\\n }\\n\\n require(toMint >= minToMint, \\\"mint < min\\\");\\n\\n // mint the user's LP tokens\\n v.lpToken.mint(msg.sender, toMint);\\n\\n emit AddLiquidity(self.key, msg.sender, amounts, fees, v.d1, v.totalSupply + toMint);\\n\\n return toMint;\\n }\\n\\n /**\\n * @notice Burn LP tokens to remove liquidity from the pool.\\n * @dev Liquidity can always be removed, even when the pool is paused.\\n * @param self Swap struct to read from and write to\\n * @param amount the amount of LP tokens to burn\\n * @param minAmounts the minimum amounts of each token in the pool\\n * acceptable for this burn. Useful as a front-running mitigation\\n * @return amounts of tokens the user received\\n */\\n function removeLiquidity(\\n Swap storage self,\\n uint256 amount,\\n uint256[] calldata minAmounts\\n ) internal returns (uint256[] memory) {\\n LPToken lpToken = self.lpToken;\\n require(amount <= lpToken.balanceOf(msg.sender), \\\">LP.balanceOf\\\");\\n uint256 numTokens = self.pooledTokens.length;\\n require(minAmounts.length == numTokens, \\\"mismatch poolTokens\\\");\\n\\n uint256[] memory balances = self.balances;\\n uint256 totalSupply = lpToken.totalSupply();\\n\\n uint256[] memory amounts = _calculateRemoveLiquidity(balances, amount, totalSupply);\\n\\n uint256 numAmounts = amounts.length;\\n for (uint256 i; i < numAmounts; ) {\\n require(amounts[i] >= minAmounts[i], \\\"amounts[i] < minAmounts[i]\\\");\\n self.balances[i] = balances[i] - amounts[i];\\n self.pooledTokens[i].safeTransfer(msg.sender, amounts[i]);\\n\\n unchecked {\\n ++i;\\n }\\n }\\n\\n lpToken.burnFrom(msg.sender, amount);\\n\\n emit RemoveLiquidity(self.key, msg.sender, amounts, totalSupply - amount);\\n\\n return amounts;\\n }\\n\\n /**\\n * @notice Remove liquidity from the pool all in one token.\\n * @param self Swap struct to read from and write to\\n * @param tokenAmount the amount of the lp tokens to burn\\n * @param tokenIndex the index of the token you want to receive\\n * @param minAmount the minimum amount to withdraw, otherwise revert\\n * @return amount chosen token that user received\\n */\\n function removeLiquidityOneToken(\\n Swap storage self,\\n uint256 tokenAmount,\\n uint8 tokenIndex,\\n uint256 minAmount\\n ) internal returns (uint256) {\\n LPToken lpToken = self.lpToken;\\n\\n require(tokenAmount <= lpToken.balanceOf(msg.sender), \\\">LP.balanceOf\\\");\\n uint256 numTokens = self.pooledTokens.length;\\n require(tokenIndex < numTokens, \\\"not found\\\");\\n\\n uint256 totalSupply = lpToken.totalSupply();\\n\\n (uint256 dy, uint256 dyFee) = _calculateWithdrawOneToken(self, tokenAmount, tokenIndex, totalSupply);\\n\\n require(dy >= minAmount, \\\"dy < minAmount\\\");\\n\\n uint256 adminFee = (dyFee * self.adminFee) / FEE_DENOMINATOR;\\n self.balances[tokenIndex] = self.balances[tokenIndex] - (dy + adminFee);\\n if (adminFee != 0) {\\n self.adminFees[tokenIndex] = self.adminFees[tokenIndex] + adminFee;\\n }\\n lpToken.burnFrom(msg.sender, tokenAmount);\\n self.pooledTokens[tokenIndex].safeTransfer(msg.sender, dy);\\n\\n emit RemoveLiquidityOne(self.key, msg.sender, tokenAmount, totalSupply, tokenIndex, dy);\\n\\n return dy;\\n }\\n\\n /**\\n * @notice Remove liquidity from the pool, weighted differently than the\\n * pool's current balances.\\n *\\n * @param self Swap struct to read from and write to\\n * @param amounts how much of each token to withdraw\\n * @param maxBurnAmount the max LP token provider is willing to pay to\\n * remove liquidity. Useful as a front-running mitigation.\\n * @return actual amount of LP tokens burned in the withdrawal\\n */\\n function removeLiquidityImbalance(\\n Swap storage self,\\n uint256[] memory amounts,\\n uint256 maxBurnAmount\\n ) internal returns (uint256) {\\n ManageLiquidityInfo memory v = ManageLiquidityInfo(\\n 0,\\n 0,\\n 0,\\n _getAPrecise(self),\\n self.lpToken,\\n 0,\\n self.balances,\\n self.tokenPrecisionMultipliers\\n );\\n v.totalSupply = v.lpToken.totalSupply();\\n\\n uint256 numTokens = self.pooledTokens.length;\\n uint256 numAmounts = amounts.length;\\n require(numAmounts == numTokens, \\\"mismatch pool tokens\\\");\\n\\n require(maxBurnAmount <= v.lpToken.balanceOf(msg.sender) && maxBurnAmount != 0, \\\">LP.balanceOf\\\");\\n\\n uint256 feePerToken = _feePerToken(self.swapFee, numTokens);\\n uint256[] memory fees = new uint256[](numTokens);\\n {\\n uint256[] memory balances1 = new uint256[](numTokens);\\n v.d0 = getD(_xp(v.balances, v.multipliers), v.preciseA);\\n for (uint256 i; i < numTokens; ) {\\n require(v.balances[i] >= amounts[i], \\\"withdraw more than available\\\");\\n\\n unchecked {\\n balances1[i] = v.balances[i] - amounts[i];\\n ++i;\\n }\\n }\\n v.d1 = getD(_xp(balances1, v.multipliers), v.preciseA);\\n\\n for (uint256 i; i < numTokens; ) {\\n {\\n uint256 idealBalance = (v.d1 * v.balances[i]) / v.d0;\\n uint256 difference = idealBalance.difference(balances1[i]);\\n fees[i] = (feePerToken * difference) / FEE_DENOMINATOR;\\n }\\n uint256 adminFee = (fees[i] * self.adminFee) / FEE_DENOMINATOR;\\n self.balances[i] = balances1[i] - adminFee;\\n self.adminFees[i] = self.adminFees[i] + adminFee;\\n balances1[i] = balances1[i] - fees[i];\\n\\n unchecked {\\n ++i;\\n }\\n }\\n\\n v.d2 = getD(_xp(balances1, v.multipliers), v.preciseA);\\n }\\n uint256 tokenAmount = ((v.d0 - v.d2) * v.totalSupply) / v.d0;\\n require(tokenAmount != 0, \\\"!zero amount\\\");\\n tokenAmount = tokenAmount + 1;\\n\\n require(tokenAmount <= maxBurnAmount, \\\"tokenAmount > maxBurnAmount\\\");\\n\\n v.lpToken.burnFrom(msg.sender, tokenAmount);\\n\\n for (uint256 i; i < numTokens; ) {\\n self.pooledTokens[i].safeTransfer(msg.sender, amounts[i]);\\n\\n unchecked {\\n ++i;\\n }\\n }\\n\\n emit RemoveLiquidityImbalance(self.key, msg.sender, amounts, fees, v.d1, v.totalSupply - tokenAmount);\\n\\n return tokenAmount;\\n }\\n\\n /**\\n * @notice withdraw all admin fees to a given address\\n * @param self Swap struct to withdraw fees from\\n * @param to Address to send the fees to\\n */\\n function withdrawAdminFees(Swap storage self, address to) internal {\\n uint256 numTokens = self.pooledTokens.length;\\n for (uint256 i; i < numTokens; ) {\\n IERC20 token = self.pooledTokens[i];\\n uint256 balance = self.adminFees[i];\\n if (balance != 0) {\\n self.adminFees[i] = 0;\\n token.safeTransfer(to, balance);\\n }\\n\\n unchecked {\\n ++i;\\n }\\n }\\n }\\n\\n /**\\n * @notice Sets the admin fee\\n * @dev adminFee cannot be higher than 100% of the swap fee\\n * @param self Swap struct to update\\n * @param newAdminFee new admin fee to be applied on future transactions\\n */\\n function setAdminFee(Swap storage self, uint256 newAdminFee) internal {\\n require(newAdminFee <= MAX_ADMIN_FEE, \\\"too high\\\");\\n self.adminFee = newAdminFee;\\n\\n emit NewAdminFee(self.key, newAdminFee);\\n }\\n\\n /**\\n * @notice update the swap fee\\n * @dev fee cannot be higher than 1% of each swap\\n * @param self Swap struct to update\\n * @param newSwapFee new swap fee to be applied on future transactions\\n */\\n function setSwapFee(Swap storage self, uint256 newSwapFee) internal {\\n require(newSwapFee <= MAX_SWAP_FEE, \\\"too high\\\");\\n self.swapFee = newSwapFee;\\n\\n emit NewSwapFee(self.key, newSwapFee);\\n }\\n\\n /**\\n * @notice Check if this stableswap pool exists and is valid (i.e. has been\\n * initialized and tokens have been added).\\n * @return bool true if this stableswap pool is valid, false if not.\\n */\\n function exists(Swap storage self) internal view returns (bool) {\\n return self.pooledTokens.length != 0;\\n }\\n}\\n\",\"keccak256\":\"0x3da6aa3cd7cf97886db9958cbb174b8edaf7771aebce5da2a8d87e993a8301fa\",\"license\":\"UNLICENSED\"},\"@connext/nxtp-contracts/contracts/messaging/interfaces/IConnectorManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT OR Apache-2.0\\npragma solidity 0.8.15;\\n\\nimport {IOutbox} from \\\"./IOutbox.sol\\\";\\n\\n/**\\n * @notice Each router extends the `XAppConnectionClient` contract. This contract\\n * allows an admin to call `setXAppConnectionManager` to update the underlying\\n * pointers to the messaging inboxes (Replicas) and outboxes (Homes).\\n *\\n * @dev This interface only contains the functions needed for the `XAppConnectionClient`\\n * will interface with.\\n */\\ninterface IConnectorManager {\\n /**\\n * @notice Get the local inbox contract from the xAppConnectionManager\\n * @return The local inbox contract\\n * @dev The local inbox contract is a SpokeConnector with AMBs, and a\\n * Home contract with nomad\\n */\\n function home() external view returns (IOutbox);\\n\\n /**\\n * @notice Determine whether _potentialReplica is an enrolled Replica from the xAppConnectionManager\\n * @return True if _potentialReplica is an enrolled Replica\\n */\\n function isReplica(address _potentialReplica) external view returns (bool);\\n\\n /**\\n * @notice Get the local domain from the xAppConnectionManager\\n * @return The local domain\\n */\\n function localDomain() external view returns (uint32);\\n}\\n\",\"keccak256\":\"0xa2c9a88a7b76a89615fe199d8a78878e5deb8dd13b036a86b575d31966beab1a\",\"license\":\"MIT OR Apache-2.0\"},\"@connext/nxtp-contracts/contracts/messaging/interfaces/IOutbox.sol\":{\"content\":\"// SPDX-License-Identifier: MIT OR Apache-2.0\\npragma solidity 0.8.15;\\n\\n/**\\n * @notice Interface for all contracts sending messages originating on their\\n * current domain.\\n *\\n * @dev These are the Home.sol interface methods used by the `Router`\\n * and exposed via `home()` on the `XAppConnectionClient`\\n */\\ninterface IOutbox {\\n /**\\n * @notice Emitted when a new message is added to an outbound message merkle root\\n * @param leafIndex Index of message's leaf in merkle tree\\n * @param destinationAndNonce Destination and destination-specific\\n * nonce combined in single field ((destination << 32) & nonce)\\n * @param messageHash Hash of message; the leaf inserted to the Merkle tree for the message\\n * @param committedRoot the latest notarized root submitted in the last signed Update\\n * @param message Raw bytes of message\\n */\\n event Dispatch(\\n bytes32 indexed messageHash,\\n uint256 indexed leafIndex,\\n uint64 indexed destinationAndNonce,\\n bytes32 committedRoot,\\n bytes message\\n );\\n\\n /**\\n * @notice Dispatch the message it to the destination domain & recipient\\n * @dev Format the message, insert its hash into Merkle tree,\\n * enqueue the new Merkle root, and emit `Dispatch` event with message information.\\n * @param _destinationDomain Domain of destination chain\\n * @param _recipientAddress Address of recipient on destination chain as bytes32\\n * @param _messageBody Raw bytes content of message\\n * @return bytes32 The leaf added to the tree\\n */\\n function dispatch(\\n uint32 _destinationDomain,\\n bytes32 _recipientAddress,\\n bytes memory _messageBody\\n ) external returns (bytes32);\\n}\\n\",\"keccak256\":\"0xe6a213bd3c9e0c4dcf0e982cdef2a6a613a49b7bca3d6ad662c179e509de6c2b\",\"license\":\"MIT OR Apache-2.0\"},\"@defi-wonderland/solidity-utils/solidity/interfaces/IBaseErrors.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >=0.8.8 <0.9.0;\\n\\ninterface IBaseErrors {\\n /// @notice Thrown if an address is invalid\\n error InvalidAddress();\\n\\n /// @notice Thrown if an amount is invalid\\n error InvalidAmount();\\n\\n /// @notice Thrown if the lengths of a set of lists mismatch\\n error LengthMismatch();\\n\\n /// @notice Thrown if an address is the zero address\\n error ZeroAddress();\\n\\n /// @notice Thrown if an amount is zero\\n error ZeroAmount();\\n}\\n\",\"keccak256\":\"0xec09b9d248b6fbf6343dee41d6978abdc15d4c8df5ed7721e8df79e8b1a558cf\",\"license\":\"MIT\"},\"@defi-wonderland/solidity-utils/solidity/interfaces/IGovernable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >=0.8.8 <0.9.0;\\n\\nimport {IBaseErrors} from './IBaseErrors.sol';\\n\\n/// @title Governable interface\\ninterface IGovernable is IBaseErrors {\\n // STATE VARIABLES\\n\\n /// @return _governor Address of the current governor\\n function governor() external view returns (address _governor);\\n\\n /// @return _pendingGovernor Address of the current pending governor\\n function pendingGovernor() external view returns (address _pendingGovernor);\\n\\n // EVENTS\\n\\n /// @notice Emitted when a new pending governor is set\\n /// @param _governor Address of the current governor\\n /// @param _pendingGovernor Address of the proposed next governor\\n event PendingGovernorSet(address _governor, address _pendingGovernor);\\n\\n /// @notice Emitted when a new governor is set\\n /// @param _newGovernor Address of the new governor\\n event PendingGovernorAccepted(address _newGovernor);\\n\\n // ERRORS\\n\\n /// @notice Thrown if a non-governor user tries to call a OnlyGovernor function\\n error OnlyGovernor();\\n\\n /// @notice Thrown if a non-pending-governor user tries to call a OnlyPendingGovernor function\\n error OnlyPendingGovernor();\\n\\n // FUNCTIONS\\n\\n /// @notice Allows a governor to propose a new governor\\n /// @param _pendingGovernor Address of the proposed new governor\\n function setPendingGovernor(address _pendingGovernor) external;\\n\\n /// @notice Allows a proposed governor to accept the governance\\n function acceptPendingGovernor() external;\\n}\\n\",\"keccak256\":\"0x40b94706a00d2c092f620807ba84bdd0c5ed8cfa60140c924edc850427e0af13\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/ContextUpgradeable.sol\\\";\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract OwnableUpgradeable is Initializable, ContextUpgradeable {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n function __Ownable_init() internal onlyInitializing {\\n __Ownable_init_unchained();\\n }\\n\\n function __Ownable_init_unchained() internal onlyInitializing {\\n _transferOwnership(_msgSender());\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n _checkOwner();\\n _;\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if the sender is not the owner.\\n */\\n function _checkOwner() internal view virtual {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n _transferOwnership(address(0));\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n _transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual {\\n address oldOwner = _owner;\\n _owner = newOwner;\\n emit OwnershipTransferred(oldOwner, newOwner);\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[49] private __gap;\\n}\\n\",\"keccak256\":\"0x247c62047745915c0af6b955470a72d1696ebad4352d7d3011aef1a2463cd888\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (proxy/utils/Initializable.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../../utils/AddressUpgradeable.sol\\\";\\n\\n/**\\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\\n *\\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\\n * reused. This mechanism prevents re-execution of each \\\"step\\\" but allows the creation of new initialization steps in\\n * case an upgrade adds a module that needs to be initialized.\\n *\\n * For example:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * contract MyToken is ERC20Upgradeable {\\n * function initialize() initializer public {\\n * __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\n * }\\n * }\\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\\n * function initializeV2() reinitializer(2) public {\\n * __ERC20Permit_init(\\\"MyToken\\\");\\n * }\\n * }\\n * ```\\n *\\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() {\\n * _disableInitializers();\\n * }\\n * ```\\n * ====\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n * @custom:oz-retyped-from bool\\n */\\n uint8 private _initialized;\\n\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool private _initializing;\\n\\n /**\\n * @dev Triggered when the contract has been initialized or reinitialized.\\n */\\n event Initialized(uint8 version);\\n\\n /**\\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\\n * `onlyInitializing` functions can be used to initialize parent contracts. Equivalent to `reinitializer(1)`.\\n */\\n modifier initializer() {\\n bool isTopLevelCall = !_initializing;\\n require(\\n (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1),\\n \\\"Initializable: contract is already initialized\\\"\\n );\\n _initialized = 1;\\n if (isTopLevelCall) {\\n _initializing = true;\\n }\\n _;\\n if (isTopLevelCall) {\\n _initializing = false;\\n emit Initialized(1);\\n }\\n }\\n\\n /**\\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\\n * used to initialize parent contracts.\\n *\\n * `initializer` is equivalent to `reinitializer(1)`, so a reinitializer may be used after the original\\n * initialization step. This is essential to configure modules that are added through upgrades and that require\\n * initialization.\\n *\\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\\n * a contract, executing them in the right order is up to the developer or operator.\\n */\\n modifier reinitializer(uint8 version) {\\n require(!_initializing && _initialized < version, \\\"Initializable: contract is already initialized\\\");\\n _initialized = version;\\n _initializing = true;\\n _;\\n _initializing = false;\\n emit Initialized(version);\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n require(_initializing, \\\"Initializable: contract is not initializing\\\");\\n _;\\n }\\n\\n /**\\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\\n * through proxies.\\n */\\n function _disableInitializers() internal virtual {\\n require(!_initializing, \\\"Initializable: contract is initializing\\\");\\n if (_initialized < type(uint8).max) {\\n _initialized = type(uint8).max;\\n emit Initialized(type(uint8).max);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x0203dcadc5737d9ef2c211d6fa15d18ebc3b30dfa51903b64870b01a062b0b4e\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC20/ERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IERC20Upgradeable.sol\\\";\\nimport \\\"./extensions/IERC20MetadataUpgradeable.sol\\\";\\nimport \\\"../../utils/ContextUpgradeable.sol\\\";\\nimport \\\"../../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Implementation of the {IERC20} interface.\\n *\\n * This implementation is agnostic to the way tokens are created. This means\\n * that a supply mechanism has to be added in a derived contract using {_mint}.\\n * For a generic mechanism see {ERC20PresetMinterPauser}.\\n *\\n * TIP: For a detailed writeup see our guide\\n * https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How\\n * to implement supply mechanisms].\\n *\\n * We have followed general OpenZeppelin Contracts guidelines: functions revert\\n * instead returning `false` on failure. This behavior is nonetheless\\n * conventional and does not conflict with the expectations of ERC20\\n * applications.\\n *\\n * Additionally, an {Approval} event is emitted on calls to {transferFrom}.\\n * This allows applications to reconstruct the allowance for all accounts just\\n * by listening to said events. Other implementations of the EIP may not emit\\n * these events, as it isn't required by the specification.\\n *\\n * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}\\n * functions have been added to mitigate the well-known issues around setting\\n * allowances. See {IERC20-approve}.\\n */\\ncontract ERC20Upgradeable is Initializable, ContextUpgradeable, IERC20Upgradeable, IERC20MetadataUpgradeable {\\n mapping(address => uint256) private _balances;\\n\\n mapping(address => mapping(address => uint256)) private _allowances;\\n\\n uint256 private _totalSupply;\\n\\n string private _name;\\n string private _symbol;\\n\\n /**\\n * @dev Sets the values for {name} and {symbol}.\\n *\\n * The default value of {decimals} is 18. To select a different value for\\n * {decimals} you should overload it.\\n *\\n * All two of these values are immutable: they can only be set once during\\n * construction.\\n */\\n function __ERC20_init(string memory name_, string memory symbol_) internal onlyInitializing {\\n __ERC20_init_unchained(name_, symbol_);\\n }\\n\\n function __ERC20_init_unchained(string memory name_, string memory symbol_) internal onlyInitializing {\\n _name = name_;\\n _symbol = symbol_;\\n }\\n\\n /**\\n * @dev Returns the name of the token.\\n */\\n function name() public view virtual override returns (string memory) {\\n return _name;\\n }\\n\\n /**\\n * @dev Returns the symbol of the token, usually a shorter version of the\\n * name.\\n */\\n function symbol() public view virtual override returns (string memory) {\\n return _symbol;\\n }\\n\\n /**\\n * @dev Returns the number of decimals used to get its user representation.\\n * For example, if `decimals` equals `2`, a balance of `505` tokens should\\n * be displayed to a user as `5.05` (`505 / 10 ** 2`).\\n *\\n * Tokens usually opt for a value of 18, imitating the relationship between\\n * Ether and Wei. This is the value {ERC20} uses, unless this function is\\n * overridden;\\n *\\n * NOTE: This information is only used for _display_ purposes: it in\\n * no way affects any of the arithmetic of the contract, including\\n * {IERC20-balanceOf} and {IERC20-transfer}.\\n */\\n function decimals() public view virtual override returns (uint8) {\\n return 18;\\n }\\n\\n /**\\n * @dev See {IERC20-totalSupply}.\\n */\\n function totalSupply() public view virtual override returns (uint256) {\\n return _totalSupply;\\n }\\n\\n /**\\n * @dev See {IERC20-balanceOf}.\\n */\\n function balanceOf(address account) public view virtual override returns (uint256) {\\n return _balances[account];\\n }\\n\\n /**\\n * @dev See {IERC20-transfer}.\\n *\\n * Requirements:\\n *\\n * - `to` cannot be the zero address.\\n * - the caller must have a balance of at least `amount`.\\n */\\n function transfer(address to, uint256 amount) public virtual override returns (bool) {\\n address owner = _msgSender();\\n _transfer(owner, to, amount);\\n return true;\\n }\\n\\n /**\\n * @dev See {IERC20-allowance}.\\n */\\n function allowance(address owner, address spender) public view virtual override returns (uint256) {\\n return _allowances[owner][spender];\\n }\\n\\n /**\\n * @dev See {IERC20-approve}.\\n *\\n * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on\\n * `transferFrom`. This is semantically equivalent to an infinite approval.\\n *\\n * Requirements:\\n *\\n * - `spender` cannot be the zero address.\\n */\\n function approve(address spender, uint256 amount) public virtual override returns (bool) {\\n address owner = _msgSender();\\n _approve(owner, spender, amount);\\n return true;\\n }\\n\\n /**\\n * @dev See {IERC20-transferFrom}.\\n *\\n * Emits an {Approval} event indicating the updated allowance. This is not\\n * required by the EIP. See the note at the beginning of {ERC20}.\\n *\\n * NOTE: Does not update the allowance if the current allowance\\n * is the maximum `uint256`.\\n *\\n * Requirements:\\n *\\n * - `from` and `to` cannot be the zero address.\\n * - `from` must have a balance of at least `amount`.\\n * - the caller must have allowance for ``from``'s tokens of at least\\n * `amount`.\\n */\\n function transferFrom(\\n address from,\\n address to,\\n uint256 amount\\n ) public virtual override returns (bool) {\\n address spender = _msgSender();\\n _spendAllowance(from, spender, amount);\\n _transfer(from, to, amount);\\n return true;\\n }\\n\\n /**\\n * @dev Atomically increases the allowance granted to `spender` by the caller.\\n *\\n * This is an alternative to {approve} that can be used as a mitigation for\\n * problems described in {IERC20-approve}.\\n *\\n * Emits an {Approval} event indicating the updated allowance.\\n *\\n * Requirements:\\n *\\n * - `spender` cannot be the zero address.\\n */\\n function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {\\n address owner = _msgSender();\\n _approve(owner, spender, allowance(owner, spender) + addedValue);\\n return true;\\n }\\n\\n /**\\n * @dev Atomically decreases the allowance granted to `spender` by the caller.\\n *\\n * This is an alternative to {approve} that can be used as a mitigation for\\n * problems described in {IERC20-approve}.\\n *\\n * Emits an {Approval} event indicating the updated allowance.\\n *\\n * Requirements:\\n *\\n * - `spender` cannot be the zero address.\\n * - `spender` must have allowance for the caller of at least\\n * `subtractedValue`.\\n */\\n function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {\\n address owner = _msgSender();\\n uint256 currentAllowance = allowance(owner, spender);\\n require(currentAllowance >= subtractedValue, \\\"ERC20: decreased allowance below zero\\\");\\n unchecked {\\n _approve(owner, spender, currentAllowance - subtractedValue);\\n }\\n\\n return true;\\n }\\n\\n /**\\n * @dev Moves `amount` of tokens from `from` to `to`.\\n *\\n * This internal function is equivalent to {transfer}, and can be used to\\n * e.g. implement automatic token fees, slashing mechanisms, etc.\\n *\\n * Emits a {Transfer} event.\\n *\\n * Requirements:\\n *\\n * - `from` cannot be the zero address.\\n * - `to` cannot be the zero address.\\n * - `from` must have a balance of at least `amount`.\\n */\\n function _transfer(\\n address from,\\n address to,\\n uint256 amount\\n ) internal virtual {\\n require(from != address(0), \\\"ERC20: transfer from the zero address\\\");\\n require(to != address(0), \\\"ERC20: transfer to the zero address\\\");\\n\\n _beforeTokenTransfer(from, to, amount);\\n\\n uint256 fromBalance = _balances[from];\\n require(fromBalance >= amount, \\\"ERC20: transfer amount exceeds balance\\\");\\n unchecked {\\n _balances[from] = fromBalance - amount;\\n }\\n _balances[to] += amount;\\n\\n emit Transfer(from, to, amount);\\n\\n _afterTokenTransfer(from, to, amount);\\n }\\n\\n /** @dev Creates `amount` tokens and assigns them to `account`, increasing\\n * the total supply.\\n *\\n * Emits a {Transfer} event with `from` set to the zero address.\\n *\\n * Requirements:\\n *\\n * - `account` cannot be the zero address.\\n */\\n function _mint(address account, uint256 amount) internal virtual {\\n require(account != address(0), \\\"ERC20: mint to the zero address\\\");\\n\\n _beforeTokenTransfer(address(0), account, amount);\\n\\n _totalSupply += amount;\\n _balances[account] += amount;\\n emit Transfer(address(0), account, amount);\\n\\n _afterTokenTransfer(address(0), account, amount);\\n }\\n\\n /**\\n * @dev Destroys `amount` tokens from `account`, reducing the\\n * total supply.\\n *\\n * Emits a {Transfer} event with `to` set to the zero address.\\n *\\n * Requirements:\\n *\\n * - `account` cannot be the zero address.\\n * - `account` must have at least `amount` tokens.\\n */\\n function _burn(address account, uint256 amount) internal virtual {\\n require(account != address(0), \\\"ERC20: burn from the zero address\\\");\\n\\n _beforeTokenTransfer(account, address(0), amount);\\n\\n uint256 accountBalance = _balances[account];\\n require(accountBalance >= amount, \\\"ERC20: burn amount exceeds balance\\\");\\n unchecked {\\n _balances[account] = accountBalance - amount;\\n }\\n _totalSupply -= amount;\\n\\n emit Transfer(account, address(0), amount);\\n\\n _afterTokenTransfer(account, address(0), amount);\\n }\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.\\n *\\n * This internal function is equivalent to `approve`, and can be used to\\n * e.g. set automatic allowances for certain subsystems, etc.\\n *\\n * Emits an {Approval} event.\\n *\\n * Requirements:\\n *\\n * - `owner` cannot be the zero address.\\n * - `spender` cannot be the zero address.\\n */\\n function _approve(\\n address owner,\\n address spender,\\n uint256 amount\\n ) internal virtual {\\n require(owner != address(0), \\\"ERC20: approve from the zero address\\\");\\n require(spender != address(0), \\\"ERC20: approve to the zero address\\\");\\n\\n _allowances[owner][spender] = amount;\\n emit Approval(owner, spender, amount);\\n }\\n\\n /**\\n * @dev Updates `owner` s allowance for `spender` based on spent `amount`.\\n *\\n * Does not update the allowance amount in case of infinite allowance.\\n * Revert if not enough allowance is available.\\n *\\n * Might emit an {Approval} event.\\n */\\n function _spendAllowance(\\n address owner,\\n address spender,\\n uint256 amount\\n ) internal virtual {\\n uint256 currentAllowance = allowance(owner, spender);\\n if (currentAllowance != type(uint256).max) {\\n require(currentAllowance >= amount, \\\"ERC20: insufficient allowance\\\");\\n unchecked {\\n _approve(owner, spender, currentAllowance - amount);\\n }\\n }\\n }\\n\\n /**\\n * @dev Hook that is called before any transfer of tokens. This includes\\n * minting and burning.\\n *\\n * Calling conditions:\\n *\\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\\n * will be transferred to `to`.\\n * - when `from` is zero, `amount` tokens will be minted for `to`.\\n * - when `to` is zero, `amount` of ``from``'s tokens will be burned.\\n * - `from` and `to` are never both zero.\\n *\\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\\n */\\n function _beforeTokenTransfer(\\n address from,\\n address to,\\n uint256 amount\\n ) internal virtual {}\\n\\n /**\\n * @dev Hook that is called after any transfer of tokens. This includes\\n * minting and burning.\\n *\\n * Calling conditions:\\n *\\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\\n * has been transferred to `to`.\\n * - when `from` is zero, `amount` tokens have been minted for `to`.\\n * - when `to` is zero, `amount` of ``from``'s tokens have been burned.\\n * - `from` and `to` are never both zero.\\n *\\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\\n */\\n function _afterTokenTransfer(\\n address from,\\n address to,\\n uint256 amount\\n ) internal virtual {}\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[45] private __gap;\\n}\\n\",\"keccak256\":\"0x7c7ac0bc6c340a7f320524b9a4b4b079ee9da3c51258080d4bab237f329a427c\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20Upgradeable {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `from` to `to` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(\\n address from,\\n address to,\\n uint256 amount\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x4e733d3164f73f461eaf9d8087a7ad1ea180bdc8ba0d3d61b0e1ae16d8e63dff\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/token/ERC20/extensions/ERC20BurnableUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC20/extensions/ERC20Burnable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../ERC20Upgradeable.sol\\\";\\nimport \\\"../../../utils/ContextUpgradeable.sol\\\";\\nimport \\\"../../../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Extension of {ERC20} that allows token holders to destroy both their own\\n * tokens and those that they have an allowance for, in a way that can be\\n * recognized off-chain (via event analysis).\\n */\\nabstract contract ERC20BurnableUpgradeable is Initializable, ContextUpgradeable, ERC20Upgradeable {\\n function __ERC20Burnable_init() internal onlyInitializing {\\n }\\n\\n function __ERC20Burnable_init_unchained() internal onlyInitializing {\\n }\\n /**\\n * @dev Destroys `amount` tokens from the caller.\\n *\\n * See {ERC20-_burn}.\\n */\\n function burn(uint256 amount) public virtual {\\n _burn(_msgSender(), amount);\\n }\\n\\n /**\\n * @dev Destroys `amount` tokens from `account`, deducting from the caller's\\n * allowance.\\n *\\n * See {ERC20-_burn} and {ERC20-allowance}.\\n *\\n * Requirements:\\n *\\n * - the caller must have allowance for ``accounts``'s tokens of at least\\n * `amount`.\\n */\\n function burnFrom(address account, uint256 amount) public virtual {\\n _spendAllowance(account, _msgSender(), amount);\\n _burn(account, amount);\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[50] private __gap;\\n}\\n\",\"keccak256\":\"0xea2c6f9d434127bf36b1e3e5ebaaf6d28a64dbaeea560508e570014e905a5ad2\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/token/ERC20/extensions/IERC20MetadataUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../IERC20Upgradeable.sol\\\";\\n\\n/**\\n * @dev Interface for the optional metadata functions from the ERC20 standard.\\n *\\n * _Available since v4.1._\\n */\\ninterface IERC20MetadataUpgradeable is IERC20Upgradeable {\\n /**\\n * @dev Returns the name of the token.\\n */\\n function name() external view returns (string memory);\\n\\n /**\\n * @dev Returns the symbol of the token.\\n */\\n function symbol() external view returns (string memory);\\n\\n /**\\n * @dev Returns the decimals places of the token.\\n */\\n function decimals() external view returns (uint8);\\n}\\n\",\"keccak256\":\"0x605434219ebbe4653f703640f06969faa5a1d78f0bfef878e5ddbb1ca369ceeb\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary AddressUpgradeable {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCall(target, data, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n require(isContract(target), \\\"Address: static call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x611aa3f23e59cfdd1863c536776407b3e33d695152a266fa7cfb34440a29a8a3\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract ContextUpgradeable is Initializable {\\n function __Context_init() internal onlyInitializing {\\n }\\n\\n function __Context_init_unchained() internal onlyInitializing {\\n }\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[50] private __gap;\\n}\\n\",\"keccak256\":\"0x963ea7f0b48b032eef72fe3a7582edf78408d6f834115b9feadd673a4d5bd149\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `from` to `to` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(\\n address from,\\n address to,\\n uint256 amount\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x9750c6b834f7b43000631af5cc30001c5f547b3ceb3635488f140f60e897ea6b\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\\n *\\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\\n * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't\\n * need to send a transaction, and thus is not required to hold Ether at all.\\n */\\ninterface IERC20Permit {\\n /**\\n * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,\\n * given ``owner``'s signed approval.\\n *\\n * IMPORTANT: The same issues {IERC20-approve} has related to transaction\\n * ordering also apply here.\\n *\\n * Emits an {Approval} event.\\n *\\n * Requirements:\\n *\\n * - `spender` cannot be the zero address.\\n * - `deadline` must be a timestamp in the future.\\n * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`\\n * over the EIP712-formatted function arguments.\\n * - the signature must use ``owner``'s current nonce (see {nonces}).\\n *\\n * For more information on the signature format, see the\\n * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP\\n * section].\\n */\\n function permit(\\n address owner,\\n address spender,\\n uint256 value,\\n uint256 deadline,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) external;\\n\\n /**\\n * @dev Returns the current nonce for `owner`. This value must be\\n * included whenever a signature is generated for {permit}.\\n *\\n * Every successful call to {permit} increases ``owner``'s nonce by one. This\\n * prevents a signature from being used multiple times.\\n */\\n function nonces(address owner) external view returns (uint256);\\n\\n /**\\n * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.\\n */\\n // solhint-disable-next-line func-name-mixedcase\\n function DOMAIN_SEPARATOR() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0xf41ca991f30855bf80ffd11e9347856a517b977f0a6c2d52e6421a99b7840329\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC20/utils/SafeERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../IERC20.sol\\\";\\nimport \\\"../extensions/draft-IERC20Permit.sol\\\";\\nimport \\\"../../../utils/Address.sol\\\";\\n\\n/**\\n * @title SafeERC20\\n * @dev Wrappers around ERC20 operations that throw on failure (when the token\\n * contract returns false). Tokens that return no value (and instead revert or\\n * throw on failure) are also supported, non-reverting calls are assumed to be\\n * successful.\\n * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\\n */\\nlibrary SafeERC20 {\\n using Address for address;\\n\\n function safeTransfer(\\n IERC20 token,\\n address to,\\n uint256 value\\n ) internal {\\n _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));\\n }\\n\\n function safeTransferFrom(\\n IERC20 token,\\n address from,\\n address to,\\n uint256 value\\n ) internal {\\n _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));\\n }\\n\\n /**\\n * @dev Deprecated. This function has issues similar to the ones found in\\n * {IERC20-approve}, and its usage is discouraged.\\n *\\n * Whenever possible, use {safeIncreaseAllowance} and\\n * {safeDecreaseAllowance} instead.\\n */\\n function safeApprove(\\n IERC20 token,\\n address spender,\\n uint256 value\\n ) internal {\\n // safeApprove should only be called when setting an initial allowance,\\n // or when resetting it to zero. To increase and decrease it, use\\n // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'\\n require(\\n (value == 0) || (token.allowance(address(this), spender) == 0),\\n \\\"SafeERC20: approve from non-zero to non-zero allowance\\\"\\n );\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));\\n }\\n\\n function safeIncreaseAllowance(\\n IERC20 token,\\n address spender,\\n uint256 value\\n ) internal {\\n uint256 newAllowance = token.allowance(address(this), spender) + value;\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\\n }\\n\\n function safeDecreaseAllowance(\\n IERC20 token,\\n address spender,\\n uint256 value\\n ) internal {\\n unchecked {\\n uint256 oldAllowance = token.allowance(address(this), spender);\\n require(oldAllowance >= value, \\\"SafeERC20: decreased allowance below zero\\\");\\n uint256 newAllowance = oldAllowance - value;\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\\n }\\n }\\n\\n function safePermit(\\n IERC20Permit token,\\n address owner,\\n address spender,\\n uint256 value,\\n uint256 deadline,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) internal {\\n uint256 nonceBefore = token.nonces(owner);\\n token.permit(owner, spender, value, deadline, v, r, s);\\n uint256 nonceAfter = token.nonces(owner);\\n require(nonceAfter == nonceBefore + 1, \\\"SafeERC20: permit did not succeed\\\");\\n }\\n\\n /**\\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\\n * on the return value: the return value is optional (but if data is returned, it must not be false).\\n * @param token The token targeted by the call.\\n * @param data The call data (encoded using abi.encode or one of its variants).\\n */\\n function _callOptionalReturn(IERC20 token, bytes memory data) private {\\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\\n // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that\\n // the target address contains contract code and also asserts for success in the low-level call.\\n\\n bytes memory returndata = address(token).functionCall(data, \\\"SafeERC20: low-level call failed\\\");\\n if (returndata.length > 0) {\\n // Return data is optional\\n require(abi.decode(returndata, (bool)), \\\"SafeERC20: ERC20 operation did not succeed\\\");\\n }\\n }\\n}\\n\",\"keccak256\":\"0x032807210d1d7d218963d7355d62e021a84bf1b3339f4f50be2f63b53cccaf29\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCall(target, data, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n require(isContract(target), \\\"Address: static call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0xd6153ce99bcdcce22b124f755e72553295be6abcd63804cfdffceb188b8bef10\",\"license\":\"MIT\"},\"solidity/contracts/bridges/BridgeReceiverAdapter.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\npragma solidity >=0.8.8 <0.9.0;\\n\\nimport {IBridgeReceiverAdapter, IDataReceiver, IOracleSidechain} from '../../interfaces/bridges/IBridgeReceiverAdapter.sol';\\n\\nabstract contract BridgeReceiverAdapter is IBridgeReceiverAdapter {\\n /// @inheritdoc IBridgeReceiverAdapter\\n IDataReceiver public immutable dataReceiver;\\n\\n constructor(IDataReceiver _dataReceiver) {\\n if (address(_dataReceiver) == address(0)) revert ZeroAddress();\\n dataReceiver = _dataReceiver;\\n }\\n\\n function _addObservations(\\n IOracleSidechain.ObservationData[] memory _observationsData,\\n bytes32 _poolSalt,\\n uint24 _poolNonce\\n ) internal {\\n dataReceiver.addObservations(_observationsData, _poolSalt, _poolNonce);\\n }\\n}\\n\",\"keccak256\":\"0x9242c7b33b40003d937f4facdc0aeb0e121ad4574c1191fe0d543eec0c3552b0\",\"license\":\"MIT\"},\"solidity/contracts/bridges/ConnextReceiverAdapter.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\npragma solidity >=0.8.8 <0.9.0;\\n\\nimport {BridgeReceiverAdapter} from './BridgeReceiverAdapter.sol';\\nimport {IConnext, IXReceiver, IConnextReceiverAdapter, IDataReceiver, IOracleSidechain} from '../../interfaces/bridges/IConnextReceiverAdapter.sol';\\n\\ncontract ConnextReceiverAdapter is IConnextReceiverAdapter, BridgeReceiverAdapter {\\n /// @inheritdoc IConnextReceiverAdapter\\n IConnext public immutable connext;\\n\\n /// @inheritdoc IConnextReceiverAdapter\\n address public immutable source;\\n\\n /// @inheritdoc IConnextReceiverAdapter\\n uint32 public immutable originDomain;\\n\\n constructor(\\n IDataReceiver _dataReceiver,\\n IConnext _connext,\\n address _source,\\n uint32 _originDomain\\n ) BridgeReceiverAdapter(_dataReceiver) {\\n if (address(_connext) == address(0) || _source == address(0)) revert ZeroAddress();\\n connext = _connext;\\n source = _source;\\n originDomain = _originDomain;\\n }\\n\\n /// @inheritdoc IXReceiver\\n function xReceive(\\n bytes32, // _transferId\\n uint256, // _amount\\n address, // _asset\\n address _originSender,\\n uint32 _origin,\\n bytes memory _callData\\n ) external onlyExecutor(_originSender, _origin) returns (bytes memory) {\\n (IOracleSidechain.ObservationData[] memory _observationsData, bytes32 _poolSalt, uint24 _poolNonce) = abi.decode(\\n _callData,\\n (IOracleSidechain.ObservationData[], bytes32, uint24)\\n );\\n\\n _addObservations(_observationsData, _poolSalt, _poolNonce);\\n }\\n\\n modifier onlyExecutor(address _originSender, uint32 _originDomain) {\\n if (msg.sender != address(connext) || _originSender != source || _originDomain != originDomain) revert UnauthorizedCaller();\\n _;\\n }\\n}\\n\",\"keccak256\":\"0x7895c6ee2da8eca15d2960a39bec9a7c0093bd33d094f0e0c751e96231951968\",\"license\":\"MIT\"},\"solidity/interfaces/IDataReceiver.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\npragma solidity >=0.8.8 <0.9.0;\\n\\nimport {IGovernable} from '@defi-wonderland/solidity-utils/solidity/interfaces/IGovernable.sol';\\nimport {IOracleFactory} from './IOracleFactory.sol';\\nimport {IOracleSidechain} from './IOracleSidechain.sol';\\nimport {IBridgeReceiverAdapter} from './bridges/IBridgeReceiverAdapter.sol';\\n\\ninterface IDataReceiver is IGovernable {\\n // STATE VARIABLES\\n\\n /// @return _oracleFactory The address of the OracleFactory\\n function oracleFactory() external view returns (IOracleFactory _oracleFactory);\\n\\n /// @notice Tracks already deployed oracles\\n /// @param _poolSalt The identifier of the oracle\\n /// @return _deployedOracle The address of the correspondant Oracle\\n function deployedOracles(bytes32 _poolSalt) external view returns (IOracleSidechain _deployedOracle);\\n\\n /// @notice Tracks the whitelisting of bridge adapters\\n /// @param _adapter Address of the bridge adapter to consult\\n /// @return _isAllowed Whether a bridge adapter is whitelisted\\n function whitelistedAdapters(IBridgeReceiverAdapter _adapter) external view returns (bool _isAllowed);\\n\\n // EVENTS\\n\\n /// @notice Emitted when a broadcast observation is succesfully processed\\n /// @param _poolSalt Identifier of the pool to fetch\\n /// @return _poolNonce Nonce of the observation broadcast\\n /// @return _receiverAdapter Handler of the broadcast\\n event ObservationsAdded(bytes32 indexed _poolSalt, uint24 _poolNonce, address _receiverAdapter);\\n\\n /// @notice Emitted when a broadcast observation is cached for later processing\\n /// @param _poolSalt Identifier of the pool to fetch\\n /// @return _poolNonce Nonce of the observation broadcast\\n /// @return _receiverAdapter Handler of the broadcast\\n event ObservationsCached(bytes32 indexed _poolSalt, uint24 _poolNonce, address _receiverAdapter);\\n\\n /// @notice Emitted when a new adapter whitelisting rule is set\\n /// @param _adapter Address of the adapter\\n /// @param _isAllowed New whitelisting status\\n event AdapterWhitelisted(IBridgeReceiverAdapter _adapter, bool _isAllowed);\\n\\n // ERRORS\\n\\n /// @notice Thrown when the broadcast nonce is incorrect\\n error ObservationsNotWritable();\\n\\n /// @notice Thrown when a not-whitelisted adapter triggers an update\\n error UnallowedAdapter();\\n\\n // FUNCTIONS\\n\\n /// @notice Allows whitelisted bridge adapters to push a broadcast\\n /// @param _observationsData Array of tuples containing the dataset\\n /// @param _poolSalt Identifier of the pool to fetch\\n /// @param _poolNonce Nonce of the observation broadcast\\n function addObservations(\\n IOracleSidechain.ObservationData[] memory _observationsData,\\n bytes32 _poolSalt,\\n uint24 _poolNonce\\n ) external;\\n\\n /// @notice Allows governance to set an adapter whitelisted state\\n /// @param _receiverAdapter Address of the adapter\\n /// @param _isWhitelisted New whitelisting status\\n function whitelistAdapter(IBridgeReceiverAdapter _receiverAdapter, bool _isWhitelisted) external;\\n\\n /// @notice Allows governance to batch set adapters whitelisted state\\n /// @param _receiverAdapters Array of addresses of the adapter\\n /// @param _isWhitelisted Array of whitelisting status for each address\\n function whitelistAdapters(IBridgeReceiverAdapter[] calldata _receiverAdapters, bool[] calldata _isWhitelisted) external;\\n}\\n\",\"keccak256\":\"0x0d0e8404bc039a5fe8574b2ffd53489946fca020f72929caeced68e66f86e768\",\"license\":\"MIT\"},\"solidity/interfaces/IOracleFactory.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\npragma solidity >=0.8.8 <0.9.0;\\n\\nimport {IGovernable} from '@defi-wonderland/solidity-utils/solidity/interfaces/IGovernable.sol';\\nimport {IOracleSidechain} from './IOracleSidechain.sol';\\nimport {IDataReceiver} from './IDataReceiver.sol';\\n\\ninterface IOracleFactory is IGovernable {\\n // STRUCTS\\n\\n struct OracleParameters {\\n bytes32 poolSalt; // Identifier of the pool and oracle\\n uint24 poolNonce; // Initial nonce of the deployed pool\\n uint16 cardinality; // Initial cardinality of the deployed pool\\n }\\n\\n // STATE VARIABLES\\n\\n /// @return _oracleInitCodeHash The oracle creation code hash used to calculate their address\\n //solhint-disable-next-line func-name-mixedcase\\n function ORACLE_INIT_CODE_HASH() external view returns (bytes32 _oracleInitCodeHash);\\n\\n /// @return _dataReceiver The address of the DataReceiver for the oracles to consult\\n function dataReceiver() external view returns (IDataReceiver _dataReceiver);\\n\\n /// @return _poolSalt The id of both the oracle and the pool\\n /// @return _poolNonce The initial nonce of the pool data\\n /// @return _cardinality The size of the observations memory storage\\n function oracleParameters()\\n external\\n view\\n returns (\\n bytes32 _poolSalt,\\n uint24 _poolNonce,\\n uint16 _cardinality\\n );\\n\\n /// @return _initialCardinality The initial size of the observations memory storage for newly deployed pools\\n function initialCardinality() external view returns (uint16 _initialCardinality);\\n\\n // EVENTS\\n\\n /// @notice Emitted when a new oracle is deployed\\n /// @param _poolSalt The id of both the oracle and the pool\\n /// @param _oracle The address of the deployed oracle\\n /// @param _initialNonce The initial nonce of the pool data\\n event OracleDeployed(bytes32 indexed _poolSalt, address indexed _oracle, uint24 _initialNonce);\\n\\n /// @notice Emitted when a new DataReceiver is set\\n /// @param _dataReceiver The address of the new DataReceiver\\n event DataReceiverSet(IDataReceiver _dataReceiver);\\n\\n /// @notice Emitted when a new initial oracle cardinality is set\\n /// @param _initialCardinality The initial length of the observationCardinality array\\n event InitialCardinalitySet(uint16 _initialCardinality);\\n\\n // ERRORS\\n\\n /// @notice Thrown when a contract other than the DataReceiver tries to deploy an oracle\\n error OnlyDataReceiver();\\n\\n // FUNCTIONS\\n\\n /// @notice Deploys a new oracle given an inputted salt\\n /// @dev Requires that the salt has not been deployed before\\n /// @param _poolSalt Pool salt that deterministically binds an oracle with a pool\\n /// @return _oracle The address of the newly deployed oracle\\n function deployOracle(bytes32 _poolSalt, uint24 _poolNonce) external returns (IOracleSidechain _oracle);\\n\\n /// @notice Allows governor to set a new allowed dataReceiver\\n /// @dev Will disallow the previous dataReceiver\\n /// @param _dataReceiver The address of the new allowed dataReceiver\\n function setDataReceiver(IDataReceiver _dataReceiver) external;\\n\\n /// @notice Allows governor to set a new initial cardinality for new oracles\\n /// @param _initialCardinality The initial size of the observations memory storage for newly deployed pools\\n function setInitialCardinality(uint16 _initialCardinality) external;\\n\\n /// @notice Overrides UniV3Factory getPool mapping\\n /// @param _tokenA The contract address of either token0 or token1\\n /// @param _tokenB The contract address of the other token\\n /// @param _fee The fee denominated in hundredths of a bip\\n /// @return _oracle The oracle address\\n function getPool(\\n address _tokenA,\\n address _tokenB,\\n uint24 _fee\\n ) external view returns (IOracleSidechain _oracle);\\n\\n /// @notice Tracks the addresses of the oracle by poolSalt\\n /// @param _poolSalt Identifier of both the pool and the oracle\\n /// @return _oracle The address (if deployed) of the correspondant oracle\\n function getPool(bytes32 _poolSalt) external view returns (IOracleSidechain _oracle);\\n\\n /// @param _tokenA The contract address of either token0 or token1\\n /// @param _tokenB The contract address of the other token\\n /// @param _fee The fee denominated in hundredths of a bip\\n /// @return _poolSalt Pool salt for inquired parameters\\n function getPoolSalt(\\n address _tokenA,\\n address _tokenB,\\n uint24 _fee\\n ) external view returns (bytes32 _poolSalt);\\n}\\n\",\"keccak256\":\"0xc32bfc32a274923ce1a089acc024396e702ae354773f0ac0a683e43ded904954\",\"license\":\"MIT\"},\"solidity/interfaces/IOracleSidechain.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\npragma solidity >=0.8.8 <0.9.0;\\n\\nimport {IOracleFactory} from './IOracleFactory.sol';\\n\\ninterface IOracleSidechain {\\n // STRUCTS\\n\\n struct ObservationData {\\n uint32 blockTimestamp;\\n int24 tick;\\n }\\n\\n // STATE VARIABLES\\n\\n /// @return _oracleFactory The address of the OracleFactory\\n function factory() external view returns (IOracleFactory _oracleFactory);\\n\\n /// @return _token0 The mainnet address of the Token0 of the oracle\\n function token0() external view returns (address _token0);\\n\\n /// @return _token1 The mainnet address of the Token1 of the oracle\\n function token1() external view returns (address _token1);\\n\\n /// @return _fee The fee identifier of the pool\\n function fee() external view returns (uint24 _fee);\\n\\n /// @return _poolSalt The identifier of both the pool and the oracle\\n function poolSalt() external view returns (bytes32 _poolSalt);\\n\\n /// @return _poolNonce Last recorded nonce of the pool history\\n function poolNonce() external view returns (uint24 _poolNonce);\\n\\n /// @notice Replicates the UniV3Pool slot0 behaviour (semi-compatible)\\n /// @return _sqrtPriceX96 Used to maintain compatibility with Uniswap V3\\n /// @return _tick Used to maintain compatibility with Uniswap V3\\n /// @return _observationIndex The index of the last oracle observation that was written,\\n /// @return _observationCardinality The current maximum number of observations stored in the pool,\\n /// @return _observationCardinalityNext The next maximum number of observations, to be updated when the observation.\\n /// @return _feeProtocol Used to maintain compatibility with Uniswap V3\\n /// @return _unlocked Used to track if a pool information was already verified\\n function slot0()\\n external\\n view\\n returns (\\n uint160 _sqrtPriceX96,\\n int24 _tick,\\n uint16 _observationIndex,\\n uint16 _observationCardinality,\\n uint16 _observationCardinalityNext,\\n uint8 _feeProtocol,\\n bool _unlocked\\n );\\n\\n /// @notice Returns data about a specific observation index\\n /// @param _index The element of the observations array to fetch\\n /// @return _blockTimestamp The timestamp of the observation,\\n /// @return _tickCumulative the tick multiplied by seconds elapsed for the life of the pool as of the observation timestamp,\\n /// @return _secondsPerLiquidityCumulativeX128 the seconds per in range liquidity for the life of the pool as of the observation timestamp,\\n /// @return _initialized whether the observation has been initialized and the values are safe to use\\n function observations(uint256 _index)\\n external\\n view\\n returns (\\n uint32 _blockTimestamp,\\n int56 _tickCumulative,\\n uint160 _secondsPerLiquidityCumulativeX128,\\n bool _initialized\\n );\\n\\n // EVENTS\\n\\n /// @notice Emitted when the pool information is verified\\n /// @param _poolSalt Identifier of the pool and the oracle\\n /// @param _token0 The contract address of either token0 or token1\\n /// @param _token1 The contract address of the other token\\n /// @param _fee The fee denominated in hundredths of a bip\\n event PoolInfoInitialized(bytes32 indexed _poolSalt, address _token0, address _token1, uint24 _fee);\\n\\n /// @notice Emitted by the oracle to hint indexers that the pool state has changed\\n /// @dev Imported from IUniswapV3PoolEvents (semi-compatible)\\n /// @param _sqrtPriceX96 The sqrt(price) of the pool after the swap, as a Q64.96\\n /// @param _tick The log base 1.0001 of price of the pool after the swap\\n event Swap(address indexed, address indexed, int256, int256, uint160 _sqrtPriceX96, uint128, int24 _tick);\\n\\n /// @notice Emitted by the oracle for increases to the number of observations that can be stored\\n /// @dev Imported from IUniswapV3PoolEvents (fully-compatible)\\n /// @param _observationCardinalityNextOld The previous value of the next observation cardinality\\n /// @param _observationCardinalityNextNew The updated value of the next observation cardinality\\n event IncreaseObservationCardinalityNext(uint16 _observationCardinalityNextOld, uint16 _observationCardinalityNextNew);\\n\\n // ERRORS\\n\\n /// @notice Thrown if the pool info is already initialized or if the observationCardinalityNext is already increased\\n error AI();\\n\\n /// @notice Thrown if the pool info does not correspond to the pool salt\\n error InvalidPool();\\n\\n /// @notice Thrown if the DataReceiver contract is not the one calling for writing observations\\n error OnlyDataReceiver();\\n\\n /// @notice Thrown if the OracleFactory contract is not the one calling for increasing observationCardinalityNext\\n error OnlyFactory();\\n\\n // FUNCTIONS\\n\\n /// @notice Permisionless method to verify token0, token1 and fee\\n /// @dev Before verified, token0 and token1 views will return address(0)\\n /// @param _tokenA The contract address of either token0 or token1\\n /// @param _tokenB The contract address of the other token\\n /// @param _fee The fee denominated in hundredths of a bip\\n function initializePoolInfo(\\n address _tokenA,\\n address _tokenB,\\n uint24 _fee\\n ) external;\\n\\n /// @notice Returns the cumulative tick and liquidity as of each timestamp `secondsAgo` from the current block timestamp\\n /// @dev Imported from UniV3Pool (semi compatible, optimistically extrapolates)\\n /// @param _secondsAgos From how long ago each cumulative tick and liquidity value should be returned\\n /// @return _tickCumulatives Cumulative tick values as of each `secondsAgos` from the current block timestamp\\n /// @return _secondsCumulativeX128s Cumulative seconds as of each `secondsAgos` from the current block timestamp\\n function observe(uint32[] calldata _secondsAgos)\\n external\\n view\\n returns (int56[] memory _tickCumulatives, uint160[] memory _secondsCumulativeX128s);\\n\\n /// @notice Permisioned method to push a dataset to update\\n /// @param _observationsData Array of tuples containing the dataset\\n /// @param _poolNonce Nonce of the observation broadcast\\n function write(ObservationData[] memory _observationsData, uint24 _poolNonce) external returns (bool _written);\\n\\n /// @notice Permisioned method to increase the cardinalityNext value\\n /// @param _observationCardinalityNext The new next length of the observations array\\n function increaseObservationCardinalityNext(uint16 _observationCardinalityNext) external;\\n}\\n\",\"keccak256\":\"0xa90206e3de00ad866b7f4792ce29220ee0ca561d59629ba638a31c4d6fd3941b\",\"license\":\"MIT\"},\"solidity/interfaces/bridges/IBridgeReceiverAdapter.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\npragma solidity >=0.8.8 <0.9.0;\\n\\nimport {IBaseErrors} from '@defi-wonderland/solidity-utils/solidity/interfaces/IBaseErrors.sol';\\nimport {IDataReceiver} from '../IDataReceiver.sol';\\nimport {IOracleSidechain} from '../IOracleSidechain.sol';\\n\\ninterface IBridgeReceiverAdapter is IBaseErrors {\\n // STATE VARIABLES\\n\\n /// @notice Gets the address of the DataReceiver contract\\n /// @return _dataReceiver Address of the DataReceiver contract\\n function dataReceiver() external view returns (IDataReceiver _dataReceiver);\\n\\n /* NOTE: callback methods should be here declared */\\n}\\n\",\"keccak256\":\"0x49e5c9c6a28521933a3f2b01a529fbae9aac1edd71dbe904586a2f06148b1974\",\"license\":\"MIT\"},\"solidity/interfaces/bridges/IConnextReceiverAdapter.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\npragma solidity >=0.8.8 <0.9.0;\\n\\nimport {IConnext} from '@connext/nxtp-contracts/contracts/core/connext/interfaces/IConnext.sol';\\nimport {IXReceiver} from '@connext/nxtp-contracts/contracts/core/connext/interfaces/IXReceiver.sol';\\nimport {IBridgeReceiverAdapter, IDataReceiver, IOracleSidechain} from './IBridgeReceiverAdapter.sol';\\n\\ninterface IConnextReceiverAdapter is IXReceiver, IBridgeReceiverAdapter {\\n // STATE VARIABLES\\n\\n /// @notice Gets the ConnextHandler contract on this domain\\n /// @return _connext Address of the ConnextHandler contract\\n function connext() external view returns (IConnext _connext);\\n\\n /// @notice Gets the DAO that is expected as the xcaller\\n /// @return _originContract Address of the xcaller contract\\n function source() external view returns (address _originContract);\\n\\n /// @notice Gets the origin domain id\\n /// @return _originDomain The origin domain id\\n function originDomain() external view returns (uint32 _originDomain);\\n\\n // ERRORS\\n\\n /// @notice Thrown if a caller is not authorized\\n error UnauthorizedCaller();\\n}\\n\",\"keccak256\":\"0x382097cdc88bb383c1aec1ec6ebddf9e6ba5b87b405650432e85616acd03e218\",\"license\":\"MIT\"}},\"version\":1}", - "bytecode": "0x61010060405234801561001157600080fd5b506040516107e33803806107e3833981016040819052610030916100d3565b836001600160a01b0381166100585760405163d92e233d60e01b815260040160405180910390fd5b6001600160a01b039081166080528316158061007b57506001600160a01b038216155b156100995760405163d92e233d60e01b815260040160405180910390fd5b6001600160a01b0392831660a052911660c05263ffffffff1660e0525061013b565b6001600160a01b03811681146100d057600080fd5b50565b600080600080608085870312156100e957600080fd5b84516100f4816100bb565b6020860151909450610105816100bb565b6040860151909350610116816100bb565b606086015190925063ffffffff8116811461013057600080fd5b939692955090935050565b60805160a05160c05160e05161065661018d6000396000818160a501526101c00152600081816061015261018301526000818160e10152610159015260008181610108015261025d01526106566000f3fe608060405234801561001057600080fd5b50600436106100575760003560e01c806367e828bf1461005c578063cee85d7e146100a0578063de4b0548146100dc578063e804778814610103578063fd614f411461012a575b600080fd5b6100837f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020015b60405180910390f35b6100c77f000000000000000000000000000000000000000000000000000000000000000081565b60405163ffffffff9091168152602001610097565b6100837f000000000000000000000000000000000000000000000000000000000000000081565b6100837f000000000000000000000000000000000000000000000000000000000000000081565b61013d61013836600461036e565b61014a565b6040516100979190610449565b60608383336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161415806101b857507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b031614155b806101ef57507f000000000000000000000000000000000000000000000000000000000000000063ffffffff168163ffffffff1614155b1561020d57604051635c427cd960e01b815260040160405180910390fd5b60008060008680602001905181019061022691906104b1565b925092509250610237838383610246565b50505050509695505050505050565b60405163d34ad40960e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063d34ad40990610296908690869086906004016105b5565b600060405180830381600087803b1580156102b057600080fd5b505af11580156102c4573d6000803e3d6000fd5b50505050505050565b80356001600160a01b03811681146102e457600080fd5b919050565b63ffffffff811681146102fb57600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b6040805190810167ffffffffffffffff81118282101715610337576103376102fe565b60405290565b604051601f8201601f1916810167ffffffffffffffff81118282101715610366576103666102fe565b604052919050565b60008060008060008060c0878903121561038757600080fd5b86359550602080880135955061039f604089016102cd565b94506103ad606089016102cd565b935060808801356103bd816102e9565b925060a088013567ffffffffffffffff808211156103da57600080fd5b818a0191508a601f8301126103ee57600080fd5b813581811115610400576104006102fe565b610412601f8201601f1916850161033d565b91508082528b8482850101111561042857600080fd5b80848401858401376000848284010152508093505050509295509295509295565b600060208083528351808285015260005b818110156104765785810183015185820160400152820161045a565b81811115610488576000604083870101525b50601f01601f1916929092016040019392505050565b805162ffffff811681146102e457600080fd5b6000806000606084860312156104c657600080fd5b835167ffffffffffffffff808211156104de57600080fd5b818601915086601f8301126104f257600080fd5b8151602082821115610506576105066102fe565b610514818360051b0161033d565b828152818101935060069290921b84018101918983111561053457600080fd5b938101935b82851015610592576040858b0312156105525760008081fd5b61055a610314565b8551610565816102e9565b815285830151600281900b811461057c5760008081fd5b8184015284526040949094019392810192610539565b80975050808801519550505050506105ac6040850161049e565b90509250925092565b606080825284519082018190526000906020906080840190828801845b82811015610602578151805163ffffffff16855285015160020b85850152604090930192908401906001016105d2565b505050908301949094525062ffffff9190911660409091015291905056fea2646970667358221220894d4d420ce1cf475a96263e3b06063419a6217c8a2fc45b22490e6592ea600064736f6c634300080f0033", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100575760003560e01c806367e828bf1461005c578063cee85d7e146100a0578063de4b0548146100dc578063e804778814610103578063fd614f411461012a575b600080fd5b6100837f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020015b60405180910390f35b6100c77f000000000000000000000000000000000000000000000000000000000000000081565b60405163ffffffff9091168152602001610097565b6100837f000000000000000000000000000000000000000000000000000000000000000081565b6100837f000000000000000000000000000000000000000000000000000000000000000081565b61013d61013836600461036e565b61014a565b6040516100979190610449565b60608383336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161415806101b857507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b031614155b806101ef57507f000000000000000000000000000000000000000000000000000000000000000063ffffffff168163ffffffff1614155b1561020d57604051635c427cd960e01b815260040160405180910390fd5b60008060008680602001905181019061022691906104b1565b925092509250610237838383610246565b50505050509695505050505050565b60405163d34ad40960e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063d34ad40990610296908690869086906004016105b5565b600060405180830381600087803b1580156102b057600080fd5b505af11580156102c4573d6000803e3d6000fd5b50505050505050565b80356001600160a01b03811681146102e457600080fd5b919050565b63ffffffff811681146102fb57600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b6040805190810167ffffffffffffffff81118282101715610337576103376102fe565b60405290565b604051601f8201601f1916810167ffffffffffffffff81118282101715610366576103666102fe565b604052919050565b60008060008060008060c0878903121561038757600080fd5b86359550602080880135955061039f604089016102cd565b94506103ad606089016102cd565b935060808801356103bd816102e9565b925060a088013567ffffffffffffffff808211156103da57600080fd5b818a0191508a601f8301126103ee57600080fd5b813581811115610400576104006102fe565b610412601f8201601f1916850161033d565b91508082528b8482850101111561042857600080fd5b80848401858401376000848284010152508093505050509295509295509295565b600060208083528351808285015260005b818110156104765785810183015185820160400152820161045a565b81811115610488576000604083870101525b50601f01601f1916929092016040019392505050565b805162ffffff811681146102e457600080fd5b6000806000606084860312156104c657600080fd5b835167ffffffffffffffff808211156104de57600080fd5b818601915086601f8301126104f257600080fd5b8151602082821115610506576105066102fe565b610514818360051b0161033d565b828152818101935060069290921b84018101918983111561053457600080fd5b938101935b82851015610592576040858b0312156105525760008081fd5b61055a610314565b8551610565816102e9565b815285830151600281900b811461057c5760008081fd5b8184015284526040949094019392810192610539565b80975050808801519550505050506105ac6040850161049e565b90509250925092565b606080825284519082018190526000906020906080840190828801845b82811015610602578151805163ffffffff16855285015160020b85850152604090930192908401906001016105d2565b505050908301949094525062ffffff9190911660409091015291905056fea2646970667358221220894d4d420ce1cf475a96263e3b06063419a6217c8a2fc45b22490e6592ea600064736f6c634300080f0033", - "devdoc": { - "kind": "dev", - "methods": {}, - "stateVariables": { - "connext": { - "return": "Address of the ConnextHandler contract", - "returns": { - "_0": "Address of the ConnextHandler contract" - } - }, - "originDomain": { - "return": "The origin domain id", - "returns": { - "_0": "The origin domain id" - } - }, - "source": { - "return": "Address of the xcaller contract", - "returns": { - "_0": "Address of the xcaller contract" - } - } - }, - "version": 1 - }, - "userdoc": { - "errors": { - "InvalidAddress()": [ - { - "notice": "Thrown if an address is invalid" - } - ], - "InvalidAmount()": [ - { - "notice": "Thrown if an amount is invalid" - } - ], - "LengthMismatch()": [ - { - "notice": "Thrown if the lengths of a set of lists mismatch" - } - ], - "UnauthorizedCaller()": [ - { - "notice": "Thrown if a caller is not authorized" - } - ], - "ZeroAddress()": [ - { - "notice": "Thrown if an address is the zero address" - } - ], - "ZeroAmount()": [ - { - "notice": "Thrown if an amount is zero" - } - ] - }, - "kind": "user", - "methods": { - "connext()": { - "notice": "Gets the ConnextHandler contract on this domain" - }, - "dataReceiver()": { - "notice": "Gets the address of the DataReceiver contract" - }, - "originDomain()": { - "notice": "Gets the origin domain id" - }, - "source()": { - "notice": "Gets the DAO that is expected as the xcaller" - } - }, - "version": 1 - }, - "storageLayout": { - "storage": [], - "types": null - } -} \ No newline at end of file diff --git a/deployments/polygon/DataReceiver.json b/deployments/polygon/DataReceiver.json deleted file mode 100644 index 87bd1e0..0000000 --- a/deployments/polygon/DataReceiver.json +++ /dev/null @@ -1,668 +0,0 @@ -{ - "address": "0x4B11b6BEF9480d62b471a9a91a52C893143Bad19", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "_governor", - "type": "address" - }, - { - "internalType": "contract IOracleFactory", - "name": "_oracleFactory", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "inputs": [], - "name": "InvalidAddress", - "type": "error" - }, - { - "inputs": [], - "name": "InvalidAmount", - "type": "error" - }, - { - "inputs": [], - "name": "LengthMismatch", - "type": "error" - }, - { - "inputs": [], - "name": "ObservationsNotWritable", - "type": "error" - }, - { - "inputs": [], - "name": "OnlyGovernor", - "type": "error" - }, - { - "inputs": [], - "name": "OnlyPendingGovernor", - "type": "error" - }, - { - "inputs": [], - "name": "UnallowedAdapter", - "type": "error" - }, - { - "inputs": [], - "name": "ZeroAddress", - "type": "error" - }, - { - "inputs": [], - "name": "ZeroAmount", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "contract IBridgeReceiverAdapter", - "name": "_adapter", - "type": "address" - }, - { - "indexed": false, - "internalType": "bool", - "name": "_isAllowed", - "type": "bool" - } - ], - "name": "AdapterWhitelisted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "_poolSalt", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "uint24", - "name": "_poolNonce", - "type": "uint24" - }, - { - "indexed": false, - "internalType": "address", - "name": "_receiverAdapter", - "type": "address" - } - ], - "name": "ObservationsAdded", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "_poolSalt", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "uint24", - "name": "_poolNonce", - "type": "uint24" - }, - { - "indexed": false, - "internalType": "address", - "name": "_receiverAdapter", - "type": "address" - } - ], - "name": "ObservationsCached", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "_newGovernor", - "type": "address" - } - ], - "name": "PendingGovernorAccepted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "_governor", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "_pendingGovernor", - "type": "address" - } - ], - "name": "PendingGovernorSet", - "type": "event" - }, - { - "inputs": [], - "name": "acceptPendingGovernor", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "uint32", - "name": "blockTimestamp", - "type": "uint32" - }, - { - "internalType": "int24", - "name": "tick", - "type": "int24" - } - ], - "internalType": "struct IOracleSidechain.ObservationData[]", - "name": "_observationsData", - "type": "tuple[]" - }, - { - "internalType": "bytes32", - "name": "_poolSalt", - "type": "bytes32" - }, - { - "internalType": "uint24", - "name": "_poolNonce", - "type": "uint24" - } - ], - "name": "addObservations", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "name": "deployedOracles", - "outputs": [ - { - "internalType": "contract IOracleSidechain", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "governor", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "oracleFactory", - "outputs": [ - { - "internalType": "contract IOracleFactory", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "pendingGovernor", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_pendingGovernor", - "type": "address" - } - ], - "name": "setPendingGovernor", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract IBridgeReceiverAdapter", - "name": "_receiverAdapter", - "type": "address" - }, - { - "internalType": "bool", - "name": "_isWhitelisted", - "type": "bool" - } - ], - "name": "whitelistAdapter", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract IBridgeReceiverAdapter[]", - "name": "_receiverAdapters", - "type": "address[]" - }, - { - "internalType": "bool[]", - "name": "_isWhitelisted", - "type": "bool[]" - } - ], - "name": "whitelistAdapters", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract IBridgeReceiverAdapter", - "name": "", - "type": "address" - } - ], - "name": "whitelistedAdapters", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - } - ], - "transactionHash": "0xd56881b273081e5b436289093e54bd3f1acfc96aaf90fc739077e33d0a68ac8d", - "receipt": { - "to": null, - "from": "0xa6DBFF53DD8F89f0bf4f6800BFDFfE099875bd9d", - "contractAddress": "0x4B11b6BEF9480d62b471a9a91a52C893143Bad19", - "transactionIndex": 32, - "gasUsed": "881190", - "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000008000000000000000000000000000000000000000000000000000000000800000000000000004000100000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000004000800000000000000001000000008000000000000000000000140000000000000000020000000000000000000000000000000000000000000000000000100000", - "blockHash": "0x88a71fa92bc096640c20eb4eb85274e5aa6442317c62ba75c4352549b9dd9155", - "transactionHash": "0xd56881b273081e5b436289093e54bd3f1acfc96aaf90fc739077e33d0a68ac8d", - "logs": [ - { - "transactionIndex": 32, - "blockNumber": 60829155, - "transactionHash": "0xd56881b273081e5b436289093e54bd3f1acfc96aaf90fc739077e33d0a68ac8d", - "address": "0x0000000000000000000000000000000000001010", - "topics": [ - "0x4dfe1bbbcf077ddc3e01291eea2d5c70c2b422b415d95645b9adcfd678cb1d63", - "0x0000000000000000000000000000000000000000000000000000000000001010", - "0x000000000000000000000000a6dbff53dd8f89f0bf4f6800bfdffe099875bd9d", - "0x00000000000000000000000067b94473d81d0cd00849d563c94d0432ac988b49" - ], - "data": "0x000000000000000000000000000000000000000000000000005deb210bd615da0000000000000000000000000000000000000000000000004dae3786e9fbeca9000000000000000000000000000000000000000000001522667c5a277ec975e20000000000000000000000000000000000000000000000004d504c65de25d6cf00000000000000000000000000000000000000000000152266da45488a9f8bbc", - "logIndex": 456, - "blockHash": "0x88a71fa92bc096640c20eb4eb85274e5aa6442317c62ba75c4352549b9dd9155" - } - ], - "blockNumber": 60829155, - "cumulativeGasUsed": "15483227", - "status": 1, - "byzantium": true - }, - "args": [ - "0xa6DBFF53DD8F89f0bf4f6800BFDFfE099875bd9d", - "0xa32f6603F9466eF0190CAc36759E41B40653471A" - ], - "numDeployments": 1, - "solcInputHash": "92b61157bb7b7ae620a9f78d2e6fe053", - "metadata": "{\"compiler\":{\"version\":\"0.8.15+commit.e14f2714\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_governor\",\"type\":\"address\"},{\"internalType\":\"contract IOracleFactory\",\"name\":\"_oracleFactory\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"InvalidAddress\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidAmount\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"LengthMismatch\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ObservationsNotWritable\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyGovernor\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyPendingGovernor\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UnallowedAdapter\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ZeroAddress\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ZeroAmount\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"contract IBridgeReceiverAdapter\",\"name\":\"_adapter\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"_isAllowed\",\"type\":\"bool\"}],\"name\":\"AdapterWhitelisted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"_poolSalt\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint24\",\"name\":\"_poolNonce\",\"type\":\"uint24\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"_receiverAdapter\",\"type\":\"address\"}],\"name\":\"ObservationsAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"_poolSalt\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint24\",\"name\":\"_poolNonce\",\"type\":\"uint24\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"_receiverAdapter\",\"type\":\"address\"}],\"name\":\"ObservationsCached\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"_newGovernor\",\"type\":\"address\"}],\"name\":\"PendingGovernorAccepted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"_governor\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"_pendingGovernor\",\"type\":\"address\"}],\"name\":\"PendingGovernorSet\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"acceptPendingGovernor\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint32\",\"name\":\"blockTimestamp\",\"type\":\"uint32\"},{\"internalType\":\"int24\",\"name\":\"tick\",\"type\":\"int24\"}],\"internalType\":\"struct IOracleSidechain.ObservationData[]\",\"name\":\"_observationsData\",\"type\":\"tuple[]\"},{\"internalType\":\"bytes32\",\"name\":\"_poolSalt\",\"type\":\"bytes32\"},{\"internalType\":\"uint24\",\"name\":\"_poolNonce\",\"type\":\"uint24\"}],\"name\":\"addObservations\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"deployedOracles\",\"outputs\":[{\"internalType\":\"contract IOracleSidechain\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"governor\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"oracleFactory\",\"outputs\":[{\"internalType\":\"contract IOracleFactory\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"pendingGovernor\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_pendingGovernor\",\"type\":\"address\"}],\"name\":\"setPendingGovernor\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IBridgeReceiverAdapter\",\"name\":\"_receiverAdapter\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"_isWhitelisted\",\"type\":\"bool\"}],\"name\":\"whitelistAdapter\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IBridgeReceiverAdapter[]\",\"name\":\"_receiverAdapters\",\"type\":\"address[]\"},{\"internalType\":\"bool[]\",\"name\":\"_isWhitelisted\",\"type\":\"bool[]\"}],\"name\":\"whitelistAdapters\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IBridgeReceiverAdapter\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"whitelistedAdapters\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"addObservations((uint32,int24)[],bytes32,uint24)\":{\"params\":{\"_observationsData\":\"Array of tuples containing the dataset\",\"_poolNonce\":\"Nonce of the observation broadcast\",\"_poolSalt\":\"Identifier of the pool to fetch\"}},\"setPendingGovernor(address)\":{\"params\":{\"_pendingGovernor\":\"Address of the proposed new governor\"}},\"whitelistAdapter(address,bool)\":{\"params\":{\"_isWhitelisted\":\"New whitelisting status\",\"_receiverAdapter\":\"Address of the adapter\"}},\"whitelistAdapters(address[],bool[])\":{\"params\":{\"_isWhitelisted\":\"Array of whitelisting status for each address\",\"_receiverAdapters\":\"Array of addresses of the adapter\"}}},\"stateVariables\":{\"deployedOracles\":{\"params\":{\"_poolSalt\":\"The identifier of the oracle\"},\"return\":\"The address of the correspondant Oracle\",\"returns\":{\"_0\":\"The address of the correspondant Oracle\"}},\"oracleFactory\":{\"return\":\"The address of the OracleFactory\",\"returns\":{\"_0\":\"The address of the OracleFactory\"}},\"whitelistedAdapters\":{\"params\":{\"_adapter\":\"Address of the bridge adapter to consult\"},\"return\":\"Whether a bridge adapter is whitelisted\",\"returns\":{\"_0\":\"Whether a bridge adapter is whitelisted\"}}},\"title\":\"The DataReceiver contract\",\"version\":1},\"userdoc\":{\"errors\":{\"InvalidAddress()\":[{\"notice\":\"Thrown if an address is invalid\"}],\"InvalidAmount()\":[{\"notice\":\"Thrown if an amount is invalid\"}],\"LengthMismatch()\":[{\"notice\":\"Thrown if the lengths of a set of lists mismatch\"}],\"ObservationsNotWritable()\":[{\"notice\":\"Thrown when the broadcast nonce is incorrect\"}],\"OnlyGovernor()\":[{\"notice\":\"Thrown if a non-governor user tries to call a OnlyGovernor function\"}],\"OnlyPendingGovernor()\":[{\"notice\":\"Thrown if a non-pending-governor user tries to call a OnlyPendingGovernor function\"}],\"UnallowedAdapter()\":[{\"notice\":\"Thrown when a not-whitelisted adapter triggers an update\"}],\"ZeroAddress()\":[{\"notice\":\"Thrown if an address is the zero address\"}],\"ZeroAmount()\":[{\"notice\":\"Thrown if an amount is zero\"}]},\"events\":{\"AdapterWhitelisted(address,bool)\":{\"notice\":\"Emitted when a new adapter whitelisting rule is set\"},\"ObservationsAdded(bytes32,uint24,address)\":{\"notice\":\"Emitted when a broadcast observation is succesfully processed\"},\"ObservationsCached(bytes32,uint24,address)\":{\"notice\":\"Emitted when a broadcast observation is cached for later processing\"},\"PendingGovernorAccepted(address)\":{\"notice\":\"Emitted when a new governor is set\"},\"PendingGovernorSet(address,address)\":{\"notice\":\"Emitted when a new pending governor is set\"}},\"kind\":\"user\",\"methods\":{\"acceptPendingGovernor()\":{\"notice\":\"Allows a proposed governor to accept the governance\"},\"addObservations((uint32,int24)[],bytes32,uint24)\":{\"notice\":\"Allows whitelisted bridge adapters to push a broadcast\"},\"deployedOracles(bytes32)\":{\"notice\":\"Tracks already deployed oracles\"},\"setPendingGovernor(address)\":{\"notice\":\"Allows a governor to propose a new governor\"},\"whitelistAdapter(address,bool)\":{\"notice\":\"Allows governance to set an adapter whitelisted state\"},\"whitelistAdapters(address[],bool[])\":{\"notice\":\"Allows governance to batch set adapters whitelisted state\"},\"whitelistedAdapters(address)\":{\"notice\":\"Tracks the whitelisting of bridge adapters\"}},\"notice\":\"Handles reception of broadcast data and delivers it to correspondant oracle\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"solidity/contracts/DataReceiver.sol\":\"DataReceiver\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@defi-wonderland/solidity-utils/solidity/contracts/Governable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >=0.8.8 <0.9.0;\\n\\nimport {IGovernable} from '../interfaces/IGovernable.sol';\\n\\n/// @title Governable contract\\n/// @notice Manages the governor role\\nabstract contract Governable is IGovernable {\\n /// @inheritdoc IGovernable\\n address public governor;\\n\\n /// @inheritdoc IGovernable\\n address public pendingGovernor;\\n\\n constructor(address _governor) {\\n if (_governor == address(0)) revert ZeroAddress();\\n governor = _governor;\\n }\\n\\n /// @inheritdoc IGovernable\\n function setPendingGovernor(address _pendingGovernor) external onlyGovernor {\\n _setPendingGovernor(_pendingGovernor);\\n }\\n\\n /// @inheritdoc IGovernable\\n function acceptPendingGovernor() external onlyPendingGovernor {\\n _acceptPendingGovernor();\\n }\\n\\n function _setPendingGovernor(address _pendingGovernor) internal {\\n if (_pendingGovernor == address(0)) revert ZeroAddress();\\n pendingGovernor = _pendingGovernor;\\n emit PendingGovernorSet(governor, _pendingGovernor);\\n }\\n\\n function _acceptPendingGovernor() internal {\\n governor = pendingGovernor;\\n delete pendingGovernor;\\n emit PendingGovernorAccepted(governor);\\n }\\n\\n /// @notice Functions with this modifier can only be called by governor\\n modifier onlyGovernor() {\\n if (msg.sender != governor) revert OnlyGovernor();\\n _;\\n }\\n\\n /// @notice Functions with this modifier can only be called by pendingGovernor\\n modifier onlyPendingGovernor() {\\n if (msg.sender != pendingGovernor) revert OnlyPendingGovernor();\\n _;\\n }\\n}\\n\",\"keccak256\":\"0x3f11408cfcb015a99dc417e075c8ebc39b796fc2adc3e81b036487e4486881b3\",\"license\":\"MIT\"},\"@defi-wonderland/solidity-utils/solidity/interfaces/IBaseErrors.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >=0.8.8 <0.9.0;\\n\\ninterface IBaseErrors {\\n /// @notice Thrown if an address is invalid\\n error InvalidAddress();\\n\\n /// @notice Thrown if an amount is invalid\\n error InvalidAmount();\\n\\n /// @notice Thrown if the lengths of a set of lists mismatch\\n error LengthMismatch();\\n\\n /// @notice Thrown if an address is the zero address\\n error ZeroAddress();\\n\\n /// @notice Thrown if an amount is zero\\n error ZeroAmount();\\n}\\n\",\"keccak256\":\"0xec09b9d248b6fbf6343dee41d6978abdc15d4c8df5ed7721e8df79e8b1a558cf\",\"license\":\"MIT\"},\"@defi-wonderland/solidity-utils/solidity/interfaces/IGovernable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >=0.8.8 <0.9.0;\\n\\nimport {IBaseErrors} from './IBaseErrors.sol';\\n\\n/// @title Governable interface\\ninterface IGovernable is IBaseErrors {\\n // STATE VARIABLES\\n\\n /// @return _governor Address of the current governor\\n function governor() external view returns (address _governor);\\n\\n /// @return _pendingGovernor Address of the current pending governor\\n function pendingGovernor() external view returns (address _pendingGovernor);\\n\\n // EVENTS\\n\\n /// @notice Emitted when a new pending governor is set\\n /// @param _governor Address of the current governor\\n /// @param _pendingGovernor Address of the proposed next governor\\n event PendingGovernorSet(address _governor, address _pendingGovernor);\\n\\n /// @notice Emitted when a new governor is set\\n /// @param _newGovernor Address of the new governor\\n event PendingGovernorAccepted(address _newGovernor);\\n\\n // ERRORS\\n\\n /// @notice Thrown if a non-governor user tries to call a OnlyGovernor function\\n error OnlyGovernor();\\n\\n /// @notice Thrown if a non-pending-governor user tries to call a OnlyPendingGovernor function\\n error OnlyPendingGovernor();\\n\\n // FUNCTIONS\\n\\n /// @notice Allows a governor to propose a new governor\\n /// @param _pendingGovernor Address of the proposed new governor\\n function setPendingGovernor(address _pendingGovernor) external;\\n\\n /// @notice Allows a proposed governor to accept the governance\\n function acceptPendingGovernor() external;\\n}\\n\",\"keccak256\":\"0x40b94706a00d2c092f620807ba84bdd0c5ed8cfa60140c924edc850427e0af13\",\"license\":\"MIT\"},\"@uniswap/v3-core/contracts/libraries/Oracle.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\npragma solidity ^0.8.0;\\n\\n/// @title Oracle\\n/// @notice Provides price and liquidity data useful for a wide variety of system designs\\n/// @dev Instances of stored oracle data, \\\"observations\\\", are collected in the oracle array\\n/// Every pool is initialized with an oracle array length of 1. Anyone can pay the SSTOREs to increase the\\n/// maximum length of the oracle array. New slots will be added when the array is fully populated.\\n/// Observations are overwritten when the full length of the oracle array is populated.\\n/// The most recent observation is available, independent of the length of the oracle array, by passing 0 to observe()\\nlibrary Oracle {\\n error I();\\n error OLD();\\n\\n struct Observation {\\n // the block timestamp of the observation\\n uint32 blockTimestamp;\\n // the tick accumulator, i.e. tick * time elapsed since the pool was first initialized\\n int56 tickCumulative;\\n // the seconds per liquidity, i.e. seconds elapsed / max(1, liquidity) since the pool was first initialized\\n uint160 secondsPerLiquidityCumulativeX128;\\n // whether or not the observation is initialized\\n bool initialized;\\n }\\n\\n /// @notice Transforms a previous observation into a new observation, given the passage of time and the current tick and liquidity values\\n /// @dev blockTimestamp _must_ be chronologically equal to or greater than last.blockTimestamp, safe for 0 or 1 overflows\\n /// @param last The specified observation to be transformed\\n /// @param blockTimestamp The timestamp of the new observation\\n /// @param tick The active tick at the time of the new observation\\n /// @param liquidity The total in-range liquidity at the time of the new observation\\n /// @return Observation The newly populated observation\\n function transform(\\n Observation memory last,\\n uint32 blockTimestamp,\\n int24 tick,\\n uint128 liquidity\\n ) private pure returns (Observation memory) {\\n unchecked {\\n uint32 delta = blockTimestamp - last.blockTimestamp;\\n return\\n Observation({\\n blockTimestamp: blockTimestamp,\\n tickCumulative: last.tickCumulative + int56(tick) * int56(uint56(delta)),\\n secondsPerLiquidityCumulativeX128: last.secondsPerLiquidityCumulativeX128 +\\n ((uint160(delta) << 128) / (liquidity > 0 ? liquidity : 1)),\\n initialized: true\\n });\\n }\\n }\\n\\n /// @notice Initialize the oracle array by writing the first slot. Called once for the lifecycle of the observations array\\n /// @param self The stored oracle array\\n /// @param time The time of the oracle initialization, via block.timestamp truncated to uint32\\n /// @return cardinality The number of populated elements in the oracle array\\n /// @return cardinalityNext The new length of the oracle array, independent of population\\n function initialize(Observation[65535] storage self, uint32 time)\\n internal\\n returns (uint16 cardinality, uint16 cardinalityNext)\\n {\\n self[0] = Observation({\\n blockTimestamp: time,\\n tickCumulative: 0,\\n secondsPerLiquidityCumulativeX128: 0,\\n initialized: true\\n });\\n return (1, 1);\\n }\\n\\n /// @notice Writes an oracle observation to the array\\n /// @dev Writable at most once per block. Index represents the most recently written element. cardinality and index must be tracked externally.\\n /// If the index is at the end of the allowable array length (according to cardinality), and the next cardinality\\n /// is greater than the current one, cardinality may be increased. This restriction is created to preserve ordering.\\n /// @param self The stored oracle array\\n /// @param index The index of the observation that was most recently written to the observations array\\n /// @param blockTimestamp The timestamp of the new observation\\n /// @param tick The active tick at the time of the new observation\\n /// @param liquidity The total in-range liquidity at the time of the new observation\\n /// @param cardinality The number of populated elements in the oracle array\\n /// @param cardinalityNext The new length of the oracle array, independent of population\\n /// @return indexUpdated The new index of the most recently written element in the oracle array\\n /// @return cardinalityUpdated The new cardinality of the oracle array\\n function write(\\n Observation[65535] storage self,\\n uint16 index,\\n uint32 blockTimestamp,\\n int24 tick,\\n uint128 liquidity,\\n uint16 cardinality,\\n uint16 cardinalityNext\\n ) internal returns (uint16 indexUpdated, uint16 cardinalityUpdated) {\\n unchecked {\\n Observation memory last = self[index];\\n\\n // early return if we've already written an observation this block\\n if (last.blockTimestamp == blockTimestamp) return (index, cardinality);\\n\\n // if the conditions are right, we can bump the cardinality\\n if (cardinalityNext > cardinality && index == (cardinality - 1)) {\\n cardinalityUpdated = cardinalityNext;\\n } else {\\n cardinalityUpdated = cardinality;\\n }\\n\\n indexUpdated = (index + 1) % cardinalityUpdated;\\n self[indexUpdated] = transform(last, blockTimestamp, tick, liquidity);\\n }\\n }\\n\\n /// @notice Prepares the oracle array to store up to `next` observations\\n /// @param self The stored oracle array\\n /// @param current The current next cardinality of the oracle array\\n /// @param next The proposed next cardinality which will be populated in the oracle array\\n /// @return next The next cardinality which will be populated in the oracle array\\n function grow(\\n Observation[65535] storage self,\\n uint16 current,\\n uint16 next\\n ) internal returns (uint16) {\\n unchecked {\\n if (current <= 0) revert I();\\n // no-op if the passed next value isn't greater than the current next value\\n if (next <= current) return current;\\n // store in each slot to prevent fresh SSTOREs in swaps\\n // this data will not be used because the initialized boolean is still false\\n for (uint16 i = current; i < next; i++) self[i].blockTimestamp = 1;\\n return next;\\n }\\n }\\n\\n /// @notice comparator for 32-bit timestamps\\n /// @dev safe for 0 or 1 overflows, a and b _must_ be chronologically before or equal to time\\n /// @param time A timestamp truncated to 32 bits\\n /// @param a A comparison timestamp from which to determine the relative position of `time`\\n /// @param b From which to determine the relative position of `time`\\n /// @return Whether `a` is chronologically <= `b`\\n function lte(\\n uint32 time,\\n uint32 a,\\n uint32 b\\n ) private pure returns (bool) {\\n unchecked {\\n // if there hasn't been overflow, no need to adjust\\n if (a <= time && b <= time) return a <= b;\\n\\n uint256 aAdjusted = a > time ? a : a + 2**32;\\n uint256 bAdjusted = b > time ? b : b + 2**32;\\n\\n return aAdjusted <= bAdjusted;\\n }\\n }\\n\\n /// @notice Fetches the observations beforeOrAt and atOrAfter a target, i.e. where [beforeOrAt, atOrAfter] is satisfied.\\n /// The result may be the same observation, or adjacent observations.\\n /// @dev The answer must be contained in the array, used when the target is located within the stored observation\\n /// boundaries: older than the most recent observation and younger, or the same age as, the oldest observation\\n /// @param self The stored oracle array\\n /// @param time The current block.timestamp\\n /// @param target The timestamp at which the reserved observation should be for\\n /// @param index The index of the observation that was most recently written to the observations array\\n /// @param cardinality The number of populated elements in the oracle array\\n /// @return beforeOrAt The observation recorded before, or at, the target\\n /// @return atOrAfter The observation recorded at, or after, the target\\n function binarySearch(\\n Observation[65535] storage self,\\n uint32 time,\\n uint32 target,\\n uint16 index,\\n uint16 cardinality\\n ) private view returns (Observation memory beforeOrAt, Observation memory atOrAfter) {\\n unchecked {\\n uint256 l = (index + 1) % cardinality; // oldest observation\\n uint256 r = l + cardinality - 1; // newest observation\\n uint256 i;\\n while (true) {\\n i = (l + r) / 2;\\n\\n beforeOrAt = self[i % cardinality];\\n\\n // we've landed on an uninitialized tick, keep searching higher (more recently)\\n if (!beforeOrAt.initialized) {\\n l = i + 1;\\n continue;\\n }\\n\\n atOrAfter = self[(i + 1) % cardinality];\\n\\n bool targetAtOrAfter = lte(time, beforeOrAt.blockTimestamp, target);\\n\\n // check if we've found the answer!\\n if (targetAtOrAfter && lte(time, target, atOrAfter.blockTimestamp)) break;\\n\\n if (!targetAtOrAfter) r = i - 1;\\n else l = i + 1;\\n }\\n }\\n }\\n\\n /// @notice Fetches the observations beforeOrAt and atOrAfter a given target, i.e. where [beforeOrAt, atOrAfter] is satisfied\\n /// @dev Assumes there is at least 1 initialized observation.\\n /// Used by observeSingle() to compute the counterfactual accumulator values as of a given block timestamp.\\n /// @param self The stored oracle array\\n /// @param time The current block.timestamp\\n /// @param target The timestamp at which the reserved observation should be for\\n /// @param tick The active tick at the time of the returned or simulated observation\\n /// @param index The index of the observation that was most recently written to the observations array\\n /// @param liquidity The total pool liquidity at the time of the call\\n /// @param cardinality The number of populated elements in the oracle array\\n /// @return beforeOrAt The observation which occurred at, or before, the given timestamp\\n /// @return atOrAfter The observation which occurred at, or after, the given timestamp\\n function getSurroundingObservations(\\n Observation[65535] storage self,\\n uint32 time,\\n uint32 target,\\n int24 tick,\\n uint16 index,\\n uint128 liquidity,\\n uint16 cardinality\\n ) private view returns (Observation memory beforeOrAt, Observation memory atOrAfter) {\\n unchecked {\\n // optimistically set before to the newest observation\\n beforeOrAt = self[index];\\n\\n // if the target is chronologically at or after the newest observation, we can early return\\n if (lte(time, beforeOrAt.blockTimestamp, target)) {\\n if (beforeOrAt.blockTimestamp == target) {\\n // if newest observation equals target, we're in the same block, so we can ignore atOrAfter\\n return (beforeOrAt, atOrAfter);\\n } else {\\n // otherwise, we need to transform\\n return (beforeOrAt, transform(beforeOrAt, target, tick, liquidity));\\n }\\n }\\n\\n // now, set before to the oldest observation\\n beforeOrAt = self[(index + 1) % cardinality];\\n if (!beforeOrAt.initialized) beforeOrAt = self[0];\\n\\n // ensure that the target is chronologically at or after the oldest observation\\n if (!lte(time, beforeOrAt.blockTimestamp, target)) revert OLD();\\n\\n // if we've reached this point, we have to binary search\\n return binarySearch(self, time, target, index, cardinality);\\n }\\n }\\n\\n /// @dev Reverts if an observation at or before the desired observation timestamp does not exist.\\n /// 0 may be passed as `secondsAgo' to return the current cumulative values.\\n /// If called with a timestamp falling between two observations, returns the counterfactual accumulator values\\n /// at exactly the timestamp between the two observations.\\n /// @param self The stored oracle array\\n /// @param time The current block timestamp\\n /// @param secondsAgo The amount of time to look back, in seconds, at which point to return an observation\\n /// @param tick The current tick\\n /// @param index The index of the observation that was most recently written to the observations array\\n /// @param liquidity The current in-range pool liquidity\\n /// @param cardinality The number of populated elements in the oracle array\\n /// @return tickCumulative The tick * time elapsed since the pool was first initialized, as of `secondsAgo`\\n /// @return secondsPerLiquidityCumulativeX128 The time elapsed / max(1, liquidity) since the pool was first initialized, as of `secondsAgo`\\n function observeSingle(\\n Observation[65535] storage self,\\n uint32 time,\\n uint32 secondsAgo,\\n int24 tick,\\n uint16 index,\\n uint128 liquidity,\\n uint16 cardinality\\n ) internal view returns (int56 tickCumulative, uint160 secondsPerLiquidityCumulativeX128) {\\n unchecked {\\n if (secondsAgo == 0) {\\n Observation memory last = self[index];\\n if (last.blockTimestamp != time) last = transform(last, time, tick, liquidity);\\n return (last.tickCumulative, last.secondsPerLiquidityCumulativeX128);\\n }\\n\\n uint32 target = time - secondsAgo;\\n\\n (Observation memory beforeOrAt, Observation memory atOrAfter) = getSurroundingObservations(\\n self,\\n time,\\n target,\\n tick,\\n index,\\n liquidity,\\n cardinality\\n );\\n\\n if (target == beforeOrAt.blockTimestamp) {\\n // we're at the left boundary\\n return (beforeOrAt.tickCumulative, beforeOrAt.secondsPerLiquidityCumulativeX128);\\n } else if (target == atOrAfter.blockTimestamp) {\\n // we're at the right boundary\\n return (atOrAfter.tickCumulative, atOrAfter.secondsPerLiquidityCumulativeX128);\\n } else {\\n // we're in the middle\\n uint32 observationTimeDelta = atOrAfter.blockTimestamp - beforeOrAt.blockTimestamp;\\n uint32 targetDelta = target - beforeOrAt.blockTimestamp;\\n return (\\n beforeOrAt.tickCumulative +\\n ((atOrAfter.tickCumulative - beforeOrAt.tickCumulative) / int56(uint56(observationTimeDelta))) *\\n int56(uint56(targetDelta)),\\n beforeOrAt.secondsPerLiquidityCumulativeX128 +\\n uint160(\\n (uint256(\\n atOrAfter.secondsPerLiquidityCumulativeX128 -\\n beforeOrAt.secondsPerLiquidityCumulativeX128\\n ) * targetDelta) / observationTimeDelta\\n )\\n );\\n }\\n }\\n }\\n\\n /// @notice Returns the accumulator values as of each time seconds ago from the given time in the array of `secondsAgos`\\n /// @dev Reverts if `secondsAgos` > oldest observation\\n /// @param self The stored oracle array\\n /// @param time The current block.timestamp\\n /// @param secondsAgos Each amount of time to look back, in seconds, at which point to return an observation\\n /// @param tick The current tick\\n /// @param index The index of the observation that was most recently written to the observations array\\n /// @param liquidity The current in-range pool liquidity\\n /// @param cardinality The number of populated elements in the oracle array\\n /// @return tickCumulatives The tick * time elapsed since the pool was first initialized, as of each `secondsAgo`\\n /// @return secondsPerLiquidityCumulativeX128s The cumulative seconds / max(1, liquidity) since the pool was first initialized, as of each `secondsAgo`\\n function observe(\\n Observation[65535] storage self,\\n uint32 time,\\n uint32[] memory secondsAgos,\\n int24 tick,\\n uint16 index,\\n uint128 liquidity,\\n uint16 cardinality\\n ) internal view returns (int56[] memory tickCumulatives, uint160[] memory secondsPerLiquidityCumulativeX128s) {\\n unchecked {\\n if (cardinality <= 0) revert I();\\n\\n tickCumulatives = new int56[](secondsAgos.length);\\n secondsPerLiquidityCumulativeX128s = new uint160[](secondsAgos.length);\\n for (uint256 i = 0; i < secondsAgos.length; i++) {\\n (tickCumulatives[i], secondsPerLiquidityCumulativeX128s[i]) = observeSingle(\\n self,\\n time,\\n secondsAgos[i],\\n tick,\\n index,\\n liquidity,\\n cardinality\\n );\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0xa25b18af947c36b9add9e229c361beb6aba176fb435d7a24e6dc723cbc187442\",\"license\":\"BUSL-1.1\"},\"@uniswap/v3-core/contracts/libraries/TickMath.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-2.0-or-later\\npragma solidity ^0.8.0;\\n\\n/// @title Math library for computing sqrt prices from ticks and vice versa\\n/// @notice Computes sqrt price for ticks of size 1.0001, i.e. sqrt(1.0001^tick) as fixed point Q64.96 numbers. Supports\\n/// prices between 2**-128 and 2**128\\nlibrary TickMath {\\n error T();\\n error R();\\n\\n /// @dev The minimum tick that may be passed to #getSqrtRatioAtTick computed from log base 1.0001 of 2**-128\\n int24 internal constant MIN_TICK = -887272;\\n /// @dev The maximum tick that may be passed to #getSqrtRatioAtTick computed from log base 1.0001 of 2**128\\n int24 internal constant MAX_TICK = -MIN_TICK;\\n\\n /// @dev The minimum value that can be returned from #getSqrtRatioAtTick. Equivalent to getSqrtRatioAtTick(MIN_TICK)\\n uint160 internal constant MIN_SQRT_RATIO = 4295128739;\\n /// @dev The maximum value that can be returned from #getSqrtRatioAtTick. Equivalent to getSqrtRatioAtTick(MAX_TICK)\\n uint160 internal constant MAX_SQRT_RATIO = 1461446703485210103287273052203988822378723970342;\\n\\n /// @notice Calculates sqrt(1.0001^tick) * 2^96\\n /// @dev Throws if |tick| > max tick\\n /// @param tick The input tick for the above formula\\n /// @return sqrtPriceX96 A Fixed point Q64.96 number representing the sqrt of the ratio of the two assets (token1/token0)\\n /// at the given tick\\n function getSqrtRatioAtTick(int24 tick) internal pure returns (uint160 sqrtPriceX96) {\\n unchecked {\\n uint256 absTick = tick < 0 ? uint256(-int256(tick)) : uint256(int256(tick));\\n if (absTick > uint256(int256(MAX_TICK))) revert T();\\n\\n uint256 ratio = absTick & 0x1 != 0\\n ? 0xfffcb933bd6fad37aa2d162d1a594001\\n : 0x100000000000000000000000000000000;\\n if (absTick & 0x2 != 0) ratio = (ratio * 0xfff97272373d413259a46990580e213a) >> 128;\\n if (absTick & 0x4 != 0) ratio = (ratio * 0xfff2e50f5f656932ef12357cf3c7fdcc) >> 128;\\n if (absTick & 0x8 != 0) ratio = (ratio * 0xffe5caca7e10e4e61c3624eaa0941cd0) >> 128;\\n if (absTick & 0x10 != 0) ratio = (ratio * 0xffcb9843d60f6159c9db58835c926644) >> 128;\\n if (absTick & 0x20 != 0) ratio = (ratio * 0xff973b41fa98c081472e6896dfb254c0) >> 128;\\n if (absTick & 0x40 != 0) ratio = (ratio * 0xff2ea16466c96a3843ec78b326b52861) >> 128;\\n if (absTick & 0x80 != 0) ratio = (ratio * 0xfe5dee046a99a2a811c461f1969c3053) >> 128;\\n if (absTick & 0x100 != 0) ratio = (ratio * 0xfcbe86c7900a88aedcffc83b479aa3a4) >> 128;\\n if (absTick & 0x200 != 0) ratio = (ratio * 0xf987a7253ac413176f2b074cf7815e54) >> 128;\\n if (absTick & 0x400 != 0) ratio = (ratio * 0xf3392b0822b70005940c7a398e4b70f3) >> 128;\\n if (absTick & 0x800 != 0) ratio = (ratio * 0xe7159475a2c29b7443b29c7fa6e889d9) >> 128;\\n if (absTick & 0x1000 != 0) ratio = (ratio * 0xd097f3bdfd2022b8845ad8f792aa5825) >> 128;\\n if (absTick & 0x2000 != 0) ratio = (ratio * 0xa9f746462d870fdf8a65dc1f90e061e5) >> 128;\\n if (absTick & 0x4000 != 0) ratio = (ratio * 0x70d869a156d2a1b890bb3df62baf32f7) >> 128;\\n if (absTick & 0x8000 != 0) ratio = (ratio * 0x31be135f97d08fd981231505542fcfa6) >> 128;\\n if (absTick & 0x10000 != 0) ratio = (ratio * 0x9aa508b5b7a84e1c677de54f3e99bc9) >> 128;\\n if (absTick & 0x20000 != 0) ratio = (ratio * 0x5d6af8dedb81196699c329225ee604) >> 128;\\n if (absTick & 0x40000 != 0) ratio = (ratio * 0x2216e584f5fa1ea926041bedfe98) >> 128;\\n if (absTick & 0x80000 != 0) ratio = (ratio * 0x48a170391f7dc42444e8fa2) >> 128;\\n\\n if (tick > 0) ratio = type(uint256).max / ratio;\\n\\n // this divides by 1<<32 rounding up to go from a Q128.128 to a Q128.96.\\n // we then downcast because we know the result always fits within 160 bits due to our tick input constraint\\n // we round up in the division so getTickAtSqrtRatio of the output price is always consistent\\n sqrtPriceX96 = uint160((ratio >> 32) + (ratio % (1 << 32) == 0 ? 0 : 1));\\n }\\n }\\n\\n /// @notice Calculates the greatest tick value such that getRatioAtTick(tick) <= ratio\\n /// @dev Throws in case sqrtPriceX96 < MIN_SQRT_RATIO, as MIN_SQRT_RATIO is the lowest value getRatioAtTick may\\n /// ever return.\\n /// @param sqrtPriceX96 The sqrt ratio for which to compute the tick as a Q64.96\\n /// @return tick The greatest tick for which the ratio is less than or equal to the input ratio\\n function getTickAtSqrtRatio(uint160 sqrtPriceX96) internal pure returns (int24 tick) {\\n unchecked {\\n // second inequality must be < because the price can never reach the price at the max tick\\n if (!(sqrtPriceX96 >= MIN_SQRT_RATIO && sqrtPriceX96 < MAX_SQRT_RATIO)) revert R();\\n uint256 ratio = uint256(sqrtPriceX96) << 32;\\n\\n uint256 r = ratio;\\n uint256 msb = 0;\\n\\n assembly {\\n let f := shl(7, gt(r, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF))\\n msb := or(msb, f)\\n r := shr(f, r)\\n }\\n assembly {\\n let f := shl(6, gt(r, 0xFFFFFFFFFFFFFFFF))\\n msb := or(msb, f)\\n r := shr(f, r)\\n }\\n assembly {\\n let f := shl(5, gt(r, 0xFFFFFFFF))\\n msb := or(msb, f)\\n r := shr(f, r)\\n }\\n assembly {\\n let f := shl(4, gt(r, 0xFFFF))\\n msb := or(msb, f)\\n r := shr(f, r)\\n }\\n assembly {\\n let f := shl(3, gt(r, 0xFF))\\n msb := or(msb, f)\\n r := shr(f, r)\\n }\\n assembly {\\n let f := shl(2, gt(r, 0xF))\\n msb := or(msb, f)\\n r := shr(f, r)\\n }\\n assembly {\\n let f := shl(1, gt(r, 0x3))\\n msb := or(msb, f)\\n r := shr(f, r)\\n }\\n assembly {\\n let f := gt(r, 0x1)\\n msb := or(msb, f)\\n }\\n\\n if (msb >= 128) r = ratio >> (msb - 127);\\n else r = ratio << (127 - msb);\\n\\n int256 log_2 = (int256(msb) - 128) << 64;\\n\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(63, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(62, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(61, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(60, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(59, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(58, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(57, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(56, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(55, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(54, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(53, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(52, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(51, f))\\n r := shr(f, r)\\n }\\n assembly {\\n r := shr(127, mul(r, r))\\n let f := shr(128, r)\\n log_2 := or(log_2, shl(50, f))\\n }\\n\\n int256 log_sqrt10001 = log_2 * 255738958999603826347141; // 128.128 number\\n\\n int24 tickLow = int24((log_sqrt10001 - 3402992956809132418596140100660247210) >> 128);\\n int24 tickHi = int24((log_sqrt10001 + 291339464771989622907027621153398088495) >> 128);\\n\\n tick = tickLow == tickHi ? tickLow : getSqrtRatioAtTick(tickHi) <= sqrtPriceX96 ? tickHi : tickLow;\\n }\\n }\\n}\\n\",\"keccak256\":\"0x5c57de03a91cc2ec8939865dbbcb0197bb6c353b711075eefd8e0fca5e102129\",\"license\":\"GPL-2.0-or-later\"},\"solidity/contracts/DataReceiver.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\npragma solidity >=0.8.8 <0.9.0;\\n\\nimport {Governable} from '@defi-wonderland/solidity-utils/solidity/contracts/Governable.sol';\\nimport {OracleSidechain} from './OracleSidechain.sol';\\nimport {IDataReceiver, IOracleFactory, IOracleSidechain, IBridgeReceiverAdapter} from '../interfaces/IDataReceiver.sol';\\n\\n/// @title The DataReceiver contract\\n/// @notice Handles reception of broadcast data and delivers it to correspondant oracle\\ncontract DataReceiver is IDataReceiver, Governable {\\n /// @inheritdoc IDataReceiver\\n IOracleFactory public immutable oracleFactory;\\n\\n /// @inheritdoc IDataReceiver\\n mapping(bytes32 => IOracleSidechain) public deployedOracles;\\n\\n /// @inheritdoc IDataReceiver\\n mapping(IBridgeReceiverAdapter => bool) public whitelistedAdapters;\\n\\n mapping(bytes32 => mapping(uint24 => IOracleSidechain.ObservationData[])) internal _cachedObservations;\\n\\n constructor(address _governor, IOracleFactory _oracleFactory) Governable(_governor) {\\n if (address(_oracleFactory) == address(0)) revert ZeroAddress();\\n oracleFactory = _oracleFactory;\\n }\\n\\n function addObservations(\\n IOracleSidechain.ObservationData[] memory _observationsData,\\n bytes32 _poolSalt,\\n uint24 _poolNonce\\n ) external onlyWhitelistedAdapters {\\n _addObservations(_observationsData, _poolSalt, _poolNonce);\\n }\\n\\n function _addObservations(\\n IOracleSidechain.ObservationData[] memory _observationsData,\\n bytes32 _poolSalt,\\n uint24 _poolNonce\\n ) internal {\\n // Read, store or deploy oracle given poolSalt\\n IOracleSidechain _oracle = deployedOracles[_poolSalt];\\n if (address(_oracle) == address(0)) {\\n _oracle = oracleFactory.getPool(_poolSalt);\\n if (address(_oracle) == address(0)) {\\n _oracle = oracleFactory.deployOracle(_poolSalt, _poolNonce);\\n }\\n deployedOracles[_poolSalt] = _oracle;\\n }\\n // Try to write observations data into oracle\\n if (_oracle.write(_observationsData, _poolNonce)) {\\n emit ObservationsAdded(_poolSalt, _poolNonce, msg.sender);\\n } else {\\n // Query pool's current nonce\\n uint24 _currentNonce = _oracle.poolNonce();\\n // Discard old observations (already written in the oracle)\\n // NOTE: if _currentNonce == _poolNonce it shouldn't reach this else block\\n if (_currentNonce > _poolNonce) revert ObservationsNotWritable();\\n // Store not-added observations to cachedObservations mapping\\n // NOTE: memory to storage is not supported\\n // cachedObservations[_poolSalt][_poolNonce] = _observationsData;\\n for (uint256 _i; _i < _observationsData.length; ++_i) {\\n _cachedObservations[_poolSalt][_poolNonce].push(_observationsData[_i]);\\n }\\n emit ObservationsCached(_poolSalt, _poolNonce, msg.sender);\\n while (_currentNonce <= _poolNonce) {\\n // Try backfilling pending observations (from current to {sent|first empty} nonce)\\n _observationsData = _cachedObservations[_poolSalt][_currentNonce];\\n // If the struct is not empty, write it into the oracle\\n if (_observationsData.length > 0) {\\n // Since observation nonce == oracle nonce, we can safely write the observations\\n _oracle.write(_observationsData, _currentNonce);\\n emit ObservationsAdded(_poolSalt, _currentNonce, msg.sender);\\n // Clear out the written observations\\n delete _cachedObservations[_poolSalt][_currentNonce];\\n _currentNonce++;\\n } else {\\n // When an empty nonce is found, break the loop\\n break;\\n }\\n }\\n }\\n }\\n\\n function whitelistAdapter(IBridgeReceiverAdapter _receiverAdapter, bool _isWhitelisted) external onlyGovernor {\\n _whitelistAdapter(_receiverAdapter, _isWhitelisted);\\n }\\n\\n /// @inheritdoc IDataReceiver\\n function whitelistAdapters(IBridgeReceiverAdapter[] calldata _receiverAdapters, bool[] calldata _isWhitelisted) external onlyGovernor {\\n uint256 _receiverAdapterLength = _receiverAdapters.length;\\n if (_receiverAdapterLength != _isWhitelisted.length) revert LengthMismatch();\\n unchecked {\\n for (uint256 _i; _i < _receiverAdapterLength; ++_i) {\\n _whitelistAdapter(_receiverAdapters[_i], _isWhitelisted[_i]);\\n }\\n }\\n }\\n\\n function _whitelistAdapter(IBridgeReceiverAdapter _receiverAdapter, bool _isWhitelisted) internal {\\n whitelistedAdapters[_receiverAdapter] = _isWhitelisted;\\n emit AdapterWhitelisted(_receiverAdapter, _isWhitelisted);\\n }\\n\\n modifier onlyWhitelistedAdapters() {\\n if (!whitelistedAdapters[IBridgeReceiverAdapter(msg.sender)]) revert UnallowedAdapter();\\n _;\\n }\\n}\\n\",\"keccak256\":\"0x7deb2aab640dc0ace6fdc7bb54a27f1a31c04a17754bb725d830b06075418d68\",\"license\":\"MIT\"},\"solidity/contracts/OracleSidechain.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\n/*\\n\\nCoded for The Keep3r Network with \\u2665 by\\n\\n\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2557\\u2591\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2557\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2557\\u2588\\u2588\\u2557\\u2591\\u2591\\u2591\\u2588\\u2588\\u2557\\u2591\\u2591\\u2591\\u2591\\u2591\\u2591\\u2591\\u2588\\u2588\\u2557\\u2591\\u2588\\u2588\\u2588\\u2588\\u2588\\u2557\\u2591\\u2588\\u2588\\u2588\\u2557\\u2591\\u2591\\u2588\\u2588\\u2557\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2557\\u2591\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2557\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2557\\u2591\\u2588\\u2588\\u2557\\u2591\\u2591\\u2591\\u2591\\u2591\\u2591\\u2588\\u2588\\u2588\\u2588\\u2588\\u2557\\u2591\\u2588\\u2588\\u2588\\u2557\\u2591\\u2591\\u2588\\u2588\\u2557\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2557\\u2591\\n\\u2588\\u2588\\u2554\\u2550\\u2550\\u2588\\u2588\\u2557\\u2588\\u2588\\u2554\\u2550\\u2550\\u2550\\u2550\\u255d\\u2588\\u2588\\u2554\\u2550\\u2550\\u2550\\u2550\\u255d\\u2588\\u2588\\u2551\\u2591\\u2591\\u2591\\u2588\\u2588\\u2551\\u2591\\u2591\\u2588\\u2588\\u2557\\u2591\\u2591\\u2588\\u2588\\u2551\\u2588\\u2588\\u2554\\u2550\\u2550\\u2588\\u2588\\u2557\\u2588\\u2588\\u2588\\u2588\\u2557\\u2591\\u2588\\u2588\\u2551\\u2588\\u2588\\u2554\\u2550\\u2550\\u2588\\u2588\\u2557\\u2588\\u2588\\u2554\\u2550\\u2550\\u2550\\u2550\\u255d\\u2588\\u2588\\u2554\\u2550\\u2550\\u2588\\u2588\\u2557\\u2588\\u2588\\u2551\\u2591\\u2591\\u2591\\u2591\\u2591\\u2588\\u2588\\u2554\\u2550\\u2550\\u2588\\u2588\\u2557\\u2588\\u2588\\u2588\\u2588\\u2557\\u2591\\u2588\\u2588\\u2551\\u2588\\u2588\\u2554\\u2550\\u2550\\u2588\\u2588\\u2557\\n\\u2588\\u2588\\u2551\\u2591\\u2591\\u2588\\u2588\\u2551\\u2588\\u2588\\u2588\\u2588\\u2588\\u2557\\u2591\\u2591\\u2588\\u2588\\u2588\\u2588\\u2588\\u2557\\u2591\\u2591\\u2588\\u2588\\u2551\\u2591\\u2591\\u2591\\u255a\\u2588\\u2588\\u2557\\u2588\\u2588\\u2588\\u2588\\u2557\\u2588\\u2588\\u2554\\u255d\\u2588\\u2588\\u2551\\u2591\\u2591\\u2588\\u2588\\u2551\\u2588\\u2588\\u2554\\u2588\\u2588\\u2557\\u2588\\u2588\\u2551\\u2588\\u2588\\u2551\\u2591\\u2591\\u2588\\u2588\\u2551\\u2588\\u2588\\u2588\\u2588\\u2588\\u2557\\u2591\\u2591\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2554\\u255d\\u2588\\u2588\\u2551\\u2591\\u2591\\u2591\\u2591\\u2591\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2551\\u2588\\u2588\\u2554\\u2588\\u2588\\u2557\\u2588\\u2588\\u2551\\u2588\\u2588\\u2551\\u2591\\u2591\\u2588\\u2588\\u2551\\n\\u2588\\u2588\\u2551\\u2591\\u2591\\u2588\\u2588\\u2551\\u2588\\u2588\\u2554\\u2550\\u2550\\u255d\\u2591\\u2591\\u2588\\u2588\\u2554\\u2550\\u2550\\u255d\\u2591\\u2591\\u2588\\u2588\\u2551\\u2591\\u2591\\u2591\\u2591\\u2588\\u2588\\u2588\\u2588\\u2554\\u2550\\u2588\\u2588\\u2588\\u2588\\u2551\\u2591\\u2588\\u2588\\u2551\\u2591\\u2591\\u2588\\u2588\\u2551\\u2588\\u2588\\u2551\\u255a\\u2588\\u2588\\u2588\\u2588\\u2551\\u2588\\u2588\\u2551\\u2591\\u2591\\u2588\\u2588\\u2551\\u2588\\u2588\\u2554\\u2550\\u2550\\u255d\\u2591\\u2591\\u2588\\u2588\\u2554\\u2550\\u2550\\u2588\\u2588\\u2557\\u2588\\u2588\\u2551\\u2591\\u2591\\u2591\\u2591\\u2591\\u2588\\u2588\\u2554\\u2550\\u2550\\u2588\\u2588\\u2551\\u2588\\u2588\\u2551\\u255a\\u2588\\u2588\\u2588\\u2588\\u2551\\u2588\\u2588\\u2551\\u2591\\u2591\\u2588\\u2588\\u2551\\n\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2554\\u255d\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2557\\u2588\\u2588\\u2551\\u2591\\u2591\\u2591\\u2591\\u2591\\u2588\\u2588\\u2551\\u2591\\u2591\\u2591\\u2591\\u255a\\u2588\\u2588\\u2554\\u255d\\u2591\\u255a\\u2588\\u2588\\u2554\\u255d\\u2591\\u255a\\u2588\\u2588\\u2588\\u2588\\u2588\\u2554\\u255d\\u2588\\u2588\\u2551\\u2591\\u255a\\u2588\\u2588\\u2588\\u2551\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2554\\u255d\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2557\\u2588\\u2588\\u2551\\u2591\\u2591\\u2588\\u2588\\u2551\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2557\\u2588\\u2588\\u2551\\u2591\\u2591\\u2588\\u2588\\u2551\\u2588\\u2588\\u2551\\u2591\\u255a\\u2588\\u2588\\u2588\\u2551\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2554\\u255d\\n\\u255a\\u2550\\u2550\\u2550\\u2550\\u2550\\u255d\\u2591\\u255a\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u255d\\u255a\\u2550\\u255d\\u2591\\u2591\\u2591\\u2591\\u2591\\u255a\\u2550\\u255d\\u2591\\u2591\\u2591\\u2591\\u2591\\u255a\\u2550\\u255d\\u2591\\u2591\\u2591\\u255a\\u2550\\u255d\\u2591\\u2591\\u2591\\u255a\\u2550\\u2550\\u2550\\u2550\\u255d\\u2591\\u255a\\u2550\\u255d\\u2591\\u2591\\u255a\\u2550\\u2550\\u255d\\u255a\\u2550\\u2550\\u2550\\u2550\\u2550\\u255d\\u2591\\u255a\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u255d\\u255a\\u2550\\u255d\\u2591\\u2591\\u255a\\u2550\\u255d\\u255a\\u2550\\u2550\\u2550\\u2550\\u2550\\u2550\\u255d\\u255a\\u2550\\u255d\\u2591\\u2591\\u255a\\u2550\\u255d\\u255a\\u2550\\u255d\\u2591\\u2591\\u255a\\u2550\\u2550\\u255d\\u255a\\u2550\\u2550\\u2550\\u2550\\u2550\\u255d\\u2591\\n\\nhttps://defi.sucks\\n\\n*/\\n\\npragma solidity >=0.8.8 <0.9.0;\\n\\nimport {IOracleSidechain, IOracleFactory} from '../interfaces/IOracleSidechain.sol';\\nimport {Oracle} from '@uniswap/v3-core/contracts/libraries/Oracle.sol';\\nimport {TickMath} from '@uniswap/v3-core/contracts/libraries/TickMath.sol';\\n\\n/// @title The SidechainOracle contract\\n/// @notice Computes and stores on-chain price data from Mainnet\\ncontract OracleSidechain is IOracleSidechain {\\n using Oracle for Oracle.Observation[65535];\\n\\n /// @inheritdoc IOracleSidechain\\n IOracleFactory public immutable factory;\\n\\n struct Slot0 {\\n // the current price\\n uint160 sqrtPriceX96;\\n // the current tick\\n int24 tick;\\n // the most-recently updated index of the observations array\\n uint16 observationIndex;\\n // the current maximum number of observations that are being stored\\n uint16 observationCardinality;\\n // the next maximum number of observations to store, triggered in observations.write\\n uint16 observationCardinalityNext;\\n // the current protocol fee as a percentage of the swap fee taken on withdrawal\\n // represented as an integer denominator (1/x)%\\n uint8 feeProtocol;\\n // whether the pool is locked\\n bool unlocked;\\n }\\n /// @inheritdoc IOracleSidechain\\n Slot0 public slot0;\\n\\n /// @inheritdoc IOracleSidechain\\n Oracle.Observation[65535] public observations;\\n\\n /// @inheritdoc IOracleSidechain\\n bytes32 public immutable poolSalt;\\n\\n uint24 public poolNonce;\\n /// @inheritdoc IOracleSidechain\\n address public token0;\\n /// @inheritdoc IOracleSidechain\\n address public token1;\\n /// @inheritdoc IOracleSidechain\\n uint24 public fee;\\n\\n /// @dev Returns the block timestamp truncated to 32 bits, i.e. mod 2**32. This method is overridden in tests.\\n function _getBlockTimestamp() internal view virtual returns (uint32) {\\n return uint32(block.timestamp); // truncation is desired\\n }\\n\\n constructor() {\\n factory = IOracleFactory(msg.sender);\\n uint16 _cardinality;\\n (poolSalt, poolNonce, _cardinality) = factory.oracleParameters();\\n\\n slot0 = Slot0({\\n sqrtPriceX96: 0,\\n tick: 0,\\n observationIndex: _cardinality - 1,\\n observationCardinality: _cardinality,\\n observationCardinalityNext: _cardinality,\\n feeProtocol: 0,\\n unlocked: true\\n });\\n }\\n\\n /// @inheritdoc IOracleSidechain\\n function initializePoolInfo(\\n address _tokenA,\\n address _tokenB,\\n uint24 _fee\\n ) external {\\n if (!slot0.unlocked) revert AI();\\n\\n (address _token0, address _token1) = _tokenA < _tokenB ? (_tokenA, _tokenB) : (_tokenB, _tokenA);\\n if (poolSalt != keccak256(abi.encode(_token0, _token1, _fee))) revert InvalidPool();\\n\\n token0 = _token0;\\n token1 = _token1;\\n fee = _fee;\\n slot0.unlocked = false;\\n\\n emit PoolInfoInitialized(poolSalt, _token0, _token1, _fee);\\n }\\n\\n /// @inheritdoc IOracleSidechain\\n function observe(uint32[] calldata _secondsAgos)\\n external\\n view\\n returns (int56[] memory _tickCumulatives, uint160[] memory _secondsPerLiquidityCumulativeX128s)\\n {\\n return observations.observe(_getBlockTimestamp(), _secondsAgos, slot0.tick, slot0.observationIndex, 0, slot0.observationCardinality);\\n }\\n\\n /// @inheritdoc IOracleSidechain\\n function write(ObservationData[] memory _observationsData, uint24 _poolNonce) external onlyDataReceiver returns (bool _written) {\\n if (_poolNonce != poolNonce) return false;\\n poolNonce++;\\n\\n uint256 _observationsDataLength = _observationsData.length;\\n for (uint256 _i; _i < _observationsDataLength; ) {\\n _write(_observationsData[_i]);\\n unchecked {\\n ++_i;\\n }\\n }\\n slot0.sqrtPriceX96 = TickMath.getSqrtRatioAtTick(slot0.tick);\\n\\n // emits UniV3 Swap event topic with minimal data\\n emit Swap(address(0), address(0), 0, 0, slot0.sqrtPriceX96, 0, slot0.tick);\\n return true;\\n }\\n\\n function increaseObservationCardinalityNext(uint16 _observationCardinalityNext) external onlyFactory {\\n uint16 _observationCardinalityNextOld = slot0.observationCardinalityNext;\\n if (_observationCardinalityNext <= _observationCardinalityNextOld) revert AI();\\n slot0.observationCardinalityNext = _observationCardinalityNext;\\n emit IncreaseObservationCardinalityNext(_observationCardinalityNextOld, _observationCardinalityNext);\\n }\\n\\n function _write(ObservationData memory _observationData) private {\\n (uint16 _indexUpdated, uint16 _cardinalityUpdated) = observations.write(\\n slot0.observationIndex,\\n _observationData.blockTimestamp,\\n slot0.tick,\\n 0,\\n slot0.observationCardinality,\\n slot0.observationCardinalityNext\\n );\\n (slot0.observationIndex, slot0.observationCardinality) = (_indexUpdated, _cardinalityUpdated);\\n slot0.tick = _observationData.tick;\\n }\\n\\n modifier onlyDataReceiver() {\\n if (msg.sender != address(factory.dataReceiver())) revert OnlyDataReceiver();\\n _;\\n }\\n\\n modifier onlyFactory() {\\n if (msg.sender != address(factory)) revert OnlyFactory();\\n _;\\n }\\n}\\n\",\"keccak256\":\"0x1b830dc6ad7405f2d533e1aa8eb079853edcdf301b396ac6b1d3c41573b62787\",\"license\":\"MIT\"},\"solidity/interfaces/IDataReceiver.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\npragma solidity >=0.8.8 <0.9.0;\\n\\nimport {IGovernable} from '@defi-wonderland/solidity-utils/solidity/interfaces/IGovernable.sol';\\nimport {IOracleFactory} from './IOracleFactory.sol';\\nimport {IOracleSidechain} from './IOracleSidechain.sol';\\nimport {IBridgeReceiverAdapter} from './bridges/IBridgeReceiverAdapter.sol';\\n\\ninterface IDataReceiver is IGovernable {\\n // STATE VARIABLES\\n\\n /// @return _oracleFactory The address of the OracleFactory\\n function oracleFactory() external view returns (IOracleFactory _oracleFactory);\\n\\n /// @notice Tracks already deployed oracles\\n /// @param _poolSalt The identifier of the oracle\\n /// @return _deployedOracle The address of the correspondant Oracle\\n function deployedOracles(bytes32 _poolSalt) external view returns (IOracleSidechain _deployedOracle);\\n\\n /// @notice Tracks the whitelisting of bridge adapters\\n /// @param _adapter Address of the bridge adapter to consult\\n /// @return _isAllowed Whether a bridge adapter is whitelisted\\n function whitelistedAdapters(IBridgeReceiverAdapter _adapter) external view returns (bool _isAllowed);\\n\\n // EVENTS\\n\\n /// @notice Emitted when a broadcast observation is succesfully processed\\n /// @param _poolSalt Identifier of the pool to fetch\\n /// @return _poolNonce Nonce of the observation broadcast\\n /// @return _receiverAdapter Handler of the broadcast\\n event ObservationsAdded(bytes32 indexed _poolSalt, uint24 _poolNonce, address _receiverAdapter);\\n\\n /// @notice Emitted when a broadcast observation is cached for later processing\\n /// @param _poolSalt Identifier of the pool to fetch\\n /// @return _poolNonce Nonce of the observation broadcast\\n /// @return _receiverAdapter Handler of the broadcast\\n event ObservationsCached(bytes32 indexed _poolSalt, uint24 _poolNonce, address _receiverAdapter);\\n\\n /// @notice Emitted when a new adapter whitelisting rule is set\\n /// @param _adapter Address of the adapter\\n /// @param _isAllowed New whitelisting status\\n event AdapterWhitelisted(IBridgeReceiverAdapter _adapter, bool _isAllowed);\\n\\n // ERRORS\\n\\n /// @notice Thrown when the broadcast nonce is incorrect\\n error ObservationsNotWritable();\\n\\n /// @notice Thrown when a not-whitelisted adapter triggers an update\\n error UnallowedAdapter();\\n\\n // FUNCTIONS\\n\\n /// @notice Allows whitelisted bridge adapters to push a broadcast\\n /// @param _observationsData Array of tuples containing the dataset\\n /// @param _poolSalt Identifier of the pool to fetch\\n /// @param _poolNonce Nonce of the observation broadcast\\n function addObservations(\\n IOracleSidechain.ObservationData[] memory _observationsData,\\n bytes32 _poolSalt,\\n uint24 _poolNonce\\n ) external;\\n\\n /// @notice Allows governance to set an adapter whitelisted state\\n /// @param _receiverAdapter Address of the adapter\\n /// @param _isWhitelisted New whitelisting status\\n function whitelistAdapter(IBridgeReceiverAdapter _receiverAdapter, bool _isWhitelisted) external;\\n\\n /// @notice Allows governance to batch set adapters whitelisted state\\n /// @param _receiverAdapters Array of addresses of the adapter\\n /// @param _isWhitelisted Array of whitelisting status for each address\\n function whitelistAdapters(IBridgeReceiverAdapter[] calldata _receiverAdapters, bool[] calldata _isWhitelisted) external;\\n}\\n\",\"keccak256\":\"0x0d0e8404bc039a5fe8574b2ffd53489946fca020f72929caeced68e66f86e768\",\"license\":\"MIT\"},\"solidity/interfaces/IOracleFactory.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\npragma solidity >=0.8.8 <0.9.0;\\n\\nimport {IGovernable} from '@defi-wonderland/solidity-utils/solidity/interfaces/IGovernable.sol';\\nimport {IOracleSidechain} from './IOracleSidechain.sol';\\nimport {IDataReceiver} from './IDataReceiver.sol';\\n\\ninterface IOracleFactory is IGovernable {\\n // STRUCTS\\n\\n struct OracleParameters {\\n bytes32 poolSalt; // Identifier of the pool and oracle\\n uint24 poolNonce; // Initial nonce of the deployed pool\\n uint16 cardinality; // Initial cardinality of the deployed pool\\n }\\n\\n // STATE VARIABLES\\n\\n /// @return _oracleInitCodeHash The oracle creation code hash used to calculate their address\\n //solhint-disable-next-line func-name-mixedcase\\n function ORACLE_INIT_CODE_HASH() external view returns (bytes32 _oracleInitCodeHash);\\n\\n /// @return _dataReceiver The address of the DataReceiver for the oracles to consult\\n function dataReceiver() external view returns (IDataReceiver _dataReceiver);\\n\\n /// @return _poolSalt The id of both the oracle and the pool\\n /// @return _poolNonce The initial nonce of the pool data\\n /// @return _cardinality The size of the observations memory storage\\n function oracleParameters()\\n external\\n view\\n returns (\\n bytes32 _poolSalt,\\n uint24 _poolNonce,\\n uint16 _cardinality\\n );\\n\\n /// @return _initialCardinality The initial size of the observations memory storage for newly deployed pools\\n function initialCardinality() external view returns (uint16 _initialCardinality);\\n\\n // EVENTS\\n\\n /// @notice Emitted when a new oracle is deployed\\n /// @param _poolSalt The id of both the oracle and the pool\\n /// @param _oracle The address of the deployed oracle\\n /// @param _initialNonce The initial nonce of the pool data\\n event OracleDeployed(bytes32 indexed _poolSalt, address indexed _oracle, uint24 _initialNonce);\\n\\n /// @notice Emitted when a new DataReceiver is set\\n /// @param _dataReceiver The address of the new DataReceiver\\n event DataReceiverSet(IDataReceiver _dataReceiver);\\n\\n /// @notice Emitted when a new initial oracle cardinality is set\\n /// @param _initialCardinality The initial length of the observationCardinality array\\n event InitialCardinalitySet(uint16 _initialCardinality);\\n\\n // ERRORS\\n\\n /// @notice Thrown when a contract other than the DataReceiver tries to deploy an oracle\\n error OnlyDataReceiver();\\n\\n // FUNCTIONS\\n\\n /// @notice Deploys a new oracle given an inputted salt\\n /// @dev Requires that the salt has not been deployed before\\n /// @param _poolSalt Pool salt that deterministically binds an oracle with a pool\\n /// @return _oracle The address of the newly deployed oracle\\n function deployOracle(bytes32 _poolSalt, uint24 _poolNonce) external returns (IOracleSidechain _oracle);\\n\\n /// @notice Allows governor to set a new allowed dataReceiver\\n /// @dev Will disallow the previous dataReceiver\\n /// @param _dataReceiver The address of the new allowed dataReceiver\\n function setDataReceiver(IDataReceiver _dataReceiver) external;\\n\\n /// @notice Allows governor to set a new initial cardinality for new oracles\\n /// @param _initialCardinality The initial size of the observations memory storage for newly deployed pools\\n function setInitialCardinality(uint16 _initialCardinality) external;\\n\\n /// @notice Overrides UniV3Factory getPool mapping\\n /// @param _tokenA The contract address of either token0 or token1\\n /// @param _tokenB The contract address of the other token\\n /// @param _fee The fee denominated in hundredths of a bip\\n /// @return _oracle The oracle address\\n function getPool(\\n address _tokenA,\\n address _tokenB,\\n uint24 _fee\\n ) external view returns (IOracleSidechain _oracle);\\n\\n /// @notice Tracks the addresses of the oracle by poolSalt\\n /// @param _poolSalt Identifier of both the pool and the oracle\\n /// @return _oracle The address (if deployed) of the correspondant oracle\\n function getPool(bytes32 _poolSalt) external view returns (IOracleSidechain _oracle);\\n\\n /// @param _tokenA The contract address of either token0 or token1\\n /// @param _tokenB The contract address of the other token\\n /// @param _fee The fee denominated in hundredths of a bip\\n /// @return _poolSalt Pool salt for inquired parameters\\n function getPoolSalt(\\n address _tokenA,\\n address _tokenB,\\n uint24 _fee\\n ) external view returns (bytes32 _poolSalt);\\n}\\n\",\"keccak256\":\"0xc32bfc32a274923ce1a089acc024396e702ae354773f0ac0a683e43ded904954\",\"license\":\"MIT\"},\"solidity/interfaces/IOracleSidechain.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\npragma solidity >=0.8.8 <0.9.0;\\n\\nimport {IOracleFactory} from './IOracleFactory.sol';\\n\\ninterface IOracleSidechain {\\n // STRUCTS\\n\\n struct ObservationData {\\n uint32 blockTimestamp;\\n int24 tick;\\n }\\n\\n // STATE VARIABLES\\n\\n /// @return _oracleFactory The address of the OracleFactory\\n function factory() external view returns (IOracleFactory _oracleFactory);\\n\\n /// @return _token0 The mainnet address of the Token0 of the oracle\\n function token0() external view returns (address _token0);\\n\\n /// @return _token1 The mainnet address of the Token1 of the oracle\\n function token1() external view returns (address _token1);\\n\\n /// @return _fee The fee identifier of the pool\\n function fee() external view returns (uint24 _fee);\\n\\n /// @return _poolSalt The identifier of both the pool and the oracle\\n function poolSalt() external view returns (bytes32 _poolSalt);\\n\\n /// @return _poolNonce Last recorded nonce of the pool history\\n function poolNonce() external view returns (uint24 _poolNonce);\\n\\n /// @notice Replicates the UniV3Pool slot0 behaviour (semi-compatible)\\n /// @return _sqrtPriceX96 Used to maintain compatibility with Uniswap V3\\n /// @return _tick Used to maintain compatibility with Uniswap V3\\n /// @return _observationIndex The index of the last oracle observation that was written,\\n /// @return _observationCardinality The current maximum number of observations stored in the pool,\\n /// @return _observationCardinalityNext The next maximum number of observations, to be updated when the observation.\\n /// @return _feeProtocol Used to maintain compatibility with Uniswap V3\\n /// @return _unlocked Used to track if a pool information was already verified\\n function slot0()\\n external\\n view\\n returns (\\n uint160 _sqrtPriceX96,\\n int24 _tick,\\n uint16 _observationIndex,\\n uint16 _observationCardinality,\\n uint16 _observationCardinalityNext,\\n uint8 _feeProtocol,\\n bool _unlocked\\n );\\n\\n /// @notice Returns data about a specific observation index\\n /// @param _index The element of the observations array to fetch\\n /// @return _blockTimestamp The timestamp of the observation,\\n /// @return _tickCumulative the tick multiplied by seconds elapsed for the life of the pool as of the observation timestamp,\\n /// @return _secondsPerLiquidityCumulativeX128 the seconds per in range liquidity for the life of the pool as of the observation timestamp,\\n /// @return _initialized whether the observation has been initialized and the values are safe to use\\n function observations(uint256 _index)\\n external\\n view\\n returns (\\n uint32 _blockTimestamp,\\n int56 _tickCumulative,\\n uint160 _secondsPerLiquidityCumulativeX128,\\n bool _initialized\\n );\\n\\n // EVENTS\\n\\n /// @notice Emitted when the pool information is verified\\n /// @param _poolSalt Identifier of the pool and the oracle\\n /// @param _token0 The contract address of either token0 or token1\\n /// @param _token1 The contract address of the other token\\n /// @param _fee The fee denominated in hundredths of a bip\\n event PoolInfoInitialized(bytes32 indexed _poolSalt, address _token0, address _token1, uint24 _fee);\\n\\n /// @notice Emitted by the oracle to hint indexers that the pool state has changed\\n /// @dev Imported from IUniswapV3PoolEvents (semi-compatible)\\n /// @param _sqrtPriceX96 The sqrt(price) of the pool after the swap, as a Q64.96\\n /// @param _tick The log base 1.0001 of price of the pool after the swap\\n event Swap(address indexed, address indexed, int256, int256, uint160 _sqrtPriceX96, uint128, int24 _tick);\\n\\n /// @notice Emitted by the oracle for increases to the number of observations that can be stored\\n /// @dev Imported from IUniswapV3PoolEvents (fully-compatible)\\n /// @param _observationCardinalityNextOld The previous value of the next observation cardinality\\n /// @param _observationCardinalityNextNew The updated value of the next observation cardinality\\n event IncreaseObservationCardinalityNext(uint16 _observationCardinalityNextOld, uint16 _observationCardinalityNextNew);\\n\\n // ERRORS\\n\\n /// @notice Thrown if the pool info is already initialized or if the observationCardinalityNext is already increased\\n error AI();\\n\\n /// @notice Thrown if the pool info does not correspond to the pool salt\\n error InvalidPool();\\n\\n /// @notice Thrown if the DataReceiver contract is not the one calling for writing observations\\n error OnlyDataReceiver();\\n\\n /// @notice Thrown if the OracleFactory contract is not the one calling for increasing observationCardinalityNext\\n error OnlyFactory();\\n\\n // FUNCTIONS\\n\\n /// @notice Permisionless method to verify token0, token1 and fee\\n /// @dev Before verified, token0 and token1 views will return address(0)\\n /// @param _tokenA The contract address of either token0 or token1\\n /// @param _tokenB The contract address of the other token\\n /// @param _fee The fee denominated in hundredths of a bip\\n function initializePoolInfo(\\n address _tokenA,\\n address _tokenB,\\n uint24 _fee\\n ) external;\\n\\n /// @notice Returns the cumulative tick and liquidity as of each timestamp `secondsAgo` from the current block timestamp\\n /// @dev Imported from UniV3Pool (semi compatible, optimistically extrapolates)\\n /// @param _secondsAgos From how long ago each cumulative tick and liquidity value should be returned\\n /// @return _tickCumulatives Cumulative tick values as of each `secondsAgos` from the current block timestamp\\n /// @return _secondsCumulativeX128s Cumulative seconds as of each `secondsAgos` from the current block timestamp\\n function observe(uint32[] calldata _secondsAgos)\\n external\\n view\\n returns (int56[] memory _tickCumulatives, uint160[] memory _secondsCumulativeX128s);\\n\\n /// @notice Permisioned method to push a dataset to update\\n /// @param _observationsData Array of tuples containing the dataset\\n /// @param _poolNonce Nonce of the observation broadcast\\n function write(ObservationData[] memory _observationsData, uint24 _poolNonce) external returns (bool _written);\\n\\n /// @notice Permisioned method to increase the cardinalityNext value\\n /// @param _observationCardinalityNext The new next length of the observations array\\n function increaseObservationCardinalityNext(uint16 _observationCardinalityNext) external;\\n}\\n\",\"keccak256\":\"0xa90206e3de00ad866b7f4792ce29220ee0ca561d59629ba638a31c4d6fd3941b\",\"license\":\"MIT\"},\"solidity/interfaces/bridges/IBridgeReceiverAdapter.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\npragma solidity >=0.8.8 <0.9.0;\\n\\nimport {IBaseErrors} from '@defi-wonderland/solidity-utils/solidity/interfaces/IBaseErrors.sol';\\nimport {IDataReceiver} from '../IDataReceiver.sol';\\nimport {IOracleSidechain} from '../IOracleSidechain.sol';\\n\\ninterface IBridgeReceiverAdapter is IBaseErrors {\\n // STATE VARIABLES\\n\\n /// @notice Gets the address of the DataReceiver contract\\n /// @return _dataReceiver Address of the DataReceiver contract\\n function dataReceiver() external view returns (IDataReceiver _dataReceiver);\\n\\n /* NOTE: callback methods should be here declared */\\n}\\n\",\"keccak256\":\"0x49e5c9c6a28521933a3f2b01a529fbae9aac1edd71dbe904586a2f06148b1974\",\"license\":\"MIT\"}},\"version\":1}", - "bytecode": "0x60a060405234801561001057600080fd5b50604051610fa0380380610fa083398101604081905261002f916100bc565b816001600160a01b0381166100575760405163d92e233d60e01b815260040160405180910390fd5b600080546001600160a01b0319166001600160a01b0392831617905581166100925760405163d92e233d60e01b815260040160405180910390fd5b6001600160a01b0316608052506100f6565b6001600160a01b03811681146100b957600080fd5b50565b600080604083850312156100cf57600080fd5b82516100da816100a4565b60208401519092506100eb816100a4565b809150509250929050565b608051610e8161011f600039600081816101640152818161045801526104fc0152610e816000f3fe608060405234801561001057600080fd5b506004361061009e5760003560e01c8063b893cce211610066578063b893cce21461012c578063c7f7fb901461015f578063d34ad40914610186578063e3056a3414610199578063f235757f146101ac57600080fd5b80630c340a24146100a35780630ddb5dd2146100d357806313f6986d146100e85780636607baca146100f0578063954e863e14610119575b600080fd5b6000546100b6906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b6100e66100e1366004610a69565b6101bf565b005b6100e661027f565b6100b66100fe366004610ad5565b6002602052600090815260409020546001600160a01b031681565b6100e6610127366004610b11565b6102b4565b61014f61013a366004610b4a565b60036020526000908152604090205460ff1681565b60405190151581526020016100ca565b6100b67f000000000000000000000000000000000000000000000000000000000000000081565b6100e6610194366004610bff565b6102ed565b6001546100b6906001600160a01b031681565b6100e66101ba366004610b4a565b61032d565b6000546001600160a01b031633146101ea5760405163070545c960e51b815260040160405180910390fd5b8281811461020e576040516001621398b960e31b0319815260040160405180910390fd5b60005b818110156102775761026f86868381811061022e5761022e610d0b565b90506020020160208101906102439190610b4a565b85858481811061025557610255610d0b565b905060200201602081019061026a9190610d21565b610364565b600101610211565b505050505050565b6001546001600160a01b031633146102aa57604051639ba0305d60e01b815260040160405180910390fd5b6102b26103c7565b565b6000546001600160a01b031633146102df5760405163070545c960e51b815260040160405180910390fd5b6102e98282610364565b5050565b3360009081526003602052604090205460ff1661031d576040516360ece74160e01b815260040160405180910390fd5b610328838383610425565b505050565b6000546001600160a01b031633146103585760405163070545c960e51b815260040160405180910390fd5b61036181610958565b50565b6001600160a01b038216600081815260036020908152604091829020805460ff19168515159081179091558251938452908301527f3cece36ac6216147f57b10bb30975f82b18b8b290a7925c322277e684afcce4a910160405180910390a15050565b60018054600080546001600160a01b0383166001600160a01b031991821681179092559091169091556040519081527f5d5d6e01b731c3e68060f7fe13156f6197d4aeffc2d6f498e34c717ae616b7349060200160405180910390a1565b6000828152600260205260409020546001600160a01b03168061059c5760405163f6c0092760e01b8152600481018490527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063f6c0092790602401602060405180830381865afa1580156104a7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104cb9190610d3e565b90506001600160a01b03811661057457604051632e60fe9b60e11b81526004810184905262ffffff831660248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690635cc1fd36906044016020604051808303816000875af115801561054d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105719190610d3e565b90505b600083815260026020526040902080546001600160a01b0319166001600160a01b0383161790555b6040516308f944b560e21b81526001600160a01b038216906323e512d4906105ca9087908690600401610d5b565b6020604051808303816000875af11580156105e9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061060d9190610dc0565b15610656576040805162ffffff8416815233602082015284917f9a777601844e27c439fe9f23f4ada7ea2b67551ea35b07439e3dad53e0e369cd910160405180910390a2610952565b6000816001600160a01b0316639fdbd4d76040518163ffffffff1660e01b8152600401602060405180830381865afa158015610696573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106ba9190610ddd565b90508262ffffff168162ffffff1611156106e757604051630a96dcbd60e11b815260040160405180910390fd5b60005b855181101561078757600085815260046020908152604080832062ffffff881684529091529020865187908390811061072557610725610d0b565b6020908102919091018101518254600181018455600093845292829020815193018054919092015162ffffff166401000000000266ffffffffffffff1990911663ffffffff9093169290921791909117905561078081610e10565b90506106ea565b506040805162ffffff8516815233602082015285917fca8a146eac241d31b0d3d0650d8747b21a7d1f1a21c55abdbb7209740d742dd1910160405180910390a25b8262ffffff168162ffffff161161095057600084815260046020908152604080832062ffffff85168452825280832080548251818502810185019093528083529193909284015b82821015610856576000848152602090819020604080518082019091529084015463ffffffff81168252640100000000900460020b8183015282526001909201910161080f565b505050509450600085511115610950576040516308f944b560e21b81526001600160a01b038316906323e512d4906108949088908590600401610d5b565b6020604051808303816000875af11580156108b3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108d79190610dc0565b506040805162ffffff8316815233602082015285917f9a777601844e27c439fe9f23f4ada7ea2b67551ea35b07439e3dad53e0e369cd910160405180910390a2600084815260046020908152604080832062ffffff85168452909152812061093e916109e1565b8061094881610e29565b9150506107c8565b505b50505050565b6001600160a01b03811661097f5760405163d92e233d60e01b815260040160405180910390fd5b600180546001600160a01b0319166001600160a01b038381169182179092556000546040805191909316815260208101919091527f6353ec38ac394f8be94bfafcdd3580d356470599059eaeebedc3207e1cc03dec910160405180910390a150565b508054600082559060005260206000209081019061036191905b80821115610a1957805466ffffffffffffff191681556001016109fb565b5090565b60008083601f840112610a2f57600080fd5b50813567ffffffffffffffff811115610a4757600080fd5b6020830191508360208260051b8501011115610a6257600080fd5b9250929050565b60008060008060408587031215610a7f57600080fd5b843567ffffffffffffffff80821115610a9757600080fd5b610aa388838901610a1d565b90965094506020870135915080821115610abc57600080fd5b50610ac987828801610a1d565b95989497509550505050565b600060208284031215610ae757600080fd5b5035919050565b6001600160a01b038116811461036157600080fd5b801515811461036157600080fd5b60008060408385031215610b2457600080fd5b8235610b2f81610aee565b91506020830135610b3f81610b03565b809150509250929050565b600060208284031215610b5c57600080fd5b8135610b6781610aee565b9392505050565b634e487b7160e01b600052604160045260246000fd5b6040805190810167ffffffffffffffff81118282101715610ba757610ba7610b6e565b60405290565b604051601f8201601f1916810167ffffffffffffffff81118282101715610bd657610bd6610b6e565b604052919050565b62ffffff8116811461036157600080fd5b8035610bfa81610bde565b919050565b600080600060608486031215610c1457600080fd5b833567ffffffffffffffff80821115610c2c57600080fd5b818601915086601f830112610c4057600080fd5b8135602082821115610c5457610c54610b6e565b610c62818360051b01610bad565b828152818101935060069290921b840181019189831115610c8257600080fd5b938101935b82851015610cea576040858b031215610ca05760008081fd5b610ca8610b84565b853563ffffffff81168114610cbd5760008081fd5b815285830135600281900b8114610cd45760008081fd5b8184015284526040949094019392810192610c87565b96508701359450610d02925050604086019050610bef565b90509250925092565b634e487b7160e01b600052603260045260246000fd5b600060208284031215610d3357600080fd5b8135610b6781610b03565b600060208284031215610d5057600080fd5b8151610b6781610aee565b60408082528351828201819052600091906020906060850190828801855b82811015610da7578151805163ffffffff16855285015160020b858501529285019290840190600101610d79565b50505062ffffff95909516930192909252509092915050565b600060208284031215610dd257600080fd5b8151610b6781610b03565b600060208284031215610def57600080fd5b8151610b6781610bde565b634e487b7160e01b600052601160045260246000fd5b600060018201610e2257610e22610dfa565b5060010190565b600062ffffff808316818103610e4157610e41610dfa565b600101939250505056fea264697066735822122034fd09118d3d0be727d85a098f8ee3713b14cb27c0ce5bd2232a496b84d3abcf64736f6c634300080f0033", - "deployedBytecode": "0x608060405234801561001057600080fd5b506004361061009e5760003560e01c8063b893cce211610066578063b893cce21461012c578063c7f7fb901461015f578063d34ad40914610186578063e3056a3414610199578063f235757f146101ac57600080fd5b80630c340a24146100a35780630ddb5dd2146100d357806313f6986d146100e85780636607baca146100f0578063954e863e14610119575b600080fd5b6000546100b6906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b6100e66100e1366004610a69565b6101bf565b005b6100e661027f565b6100b66100fe366004610ad5565b6002602052600090815260409020546001600160a01b031681565b6100e6610127366004610b11565b6102b4565b61014f61013a366004610b4a565b60036020526000908152604090205460ff1681565b60405190151581526020016100ca565b6100b67f000000000000000000000000000000000000000000000000000000000000000081565b6100e6610194366004610bff565b6102ed565b6001546100b6906001600160a01b031681565b6100e66101ba366004610b4a565b61032d565b6000546001600160a01b031633146101ea5760405163070545c960e51b815260040160405180910390fd5b8281811461020e576040516001621398b960e31b0319815260040160405180910390fd5b60005b818110156102775761026f86868381811061022e5761022e610d0b565b90506020020160208101906102439190610b4a565b85858481811061025557610255610d0b565b905060200201602081019061026a9190610d21565b610364565b600101610211565b505050505050565b6001546001600160a01b031633146102aa57604051639ba0305d60e01b815260040160405180910390fd5b6102b26103c7565b565b6000546001600160a01b031633146102df5760405163070545c960e51b815260040160405180910390fd5b6102e98282610364565b5050565b3360009081526003602052604090205460ff1661031d576040516360ece74160e01b815260040160405180910390fd5b610328838383610425565b505050565b6000546001600160a01b031633146103585760405163070545c960e51b815260040160405180910390fd5b61036181610958565b50565b6001600160a01b038216600081815260036020908152604091829020805460ff19168515159081179091558251938452908301527f3cece36ac6216147f57b10bb30975f82b18b8b290a7925c322277e684afcce4a910160405180910390a15050565b60018054600080546001600160a01b0383166001600160a01b031991821681179092559091169091556040519081527f5d5d6e01b731c3e68060f7fe13156f6197d4aeffc2d6f498e34c717ae616b7349060200160405180910390a1565b6000828152600260205260409020546001600160a01b03168061059c5760405163f6c0092760e01b8152600481018490527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063f6c0092790602401602060405180830381865afa1580156104a7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104cb9190610d3e565b90506001600160a01b03811661057457604051632e60fe9b60e11b81526004810184905262ffffff831660248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690635cc1fd36906044016020604051808303816000875af115801561054d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105719190610d3e565b90505b600083815260026020526040902080546001600160a01b0319166001600160a01b0383161790555b6040516308f944b560e21b81526001600160a01b038216906323e512d4906105ca9087908690600401610d5b565b6020604051808303816000875af11580156105e9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061060d9190610dc0565b15610656576040805162ffffff8416815233602082015284917f9a777601844e27c439fe9f23f4ada7ea2b67551ea35b07439e3dad53e0e369cd910160405180910390a2610952565b6000816001600160a01b0316639fdbd4d76040518163ffffffff1660e01b8152600401602060405180830381865afa158015610696573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106ba9190610ddd565b90508262ffffff168162ffffff1611156106e757604051630a96dcbd60e11b815260040160405180910390fd5b60005b855181101561078757600085815260046020908152604080832062ffffff881684529091529020865187908390811061072557610725610d0b565b6020908102919091018101518254600181018455600093845292829020815193018054919092015162ffffff166401000000000266ffffffffffffff1990911663ffffffff9093169290921791909117905561078081610e10565b90506106ea565b506040805162ffffff8516815233602082015285917fca8a146eac241d31b0d3d0650d8747b21a7d1f1a21c55abdbb7209740d742dd1910160405180910390a25b8262ffffff168162ffffff161161095057600084815260046020908152604080832062ffffff85168452825280832080548251818502810185019093528083529193909284015b82821015610856576000848152602090819020604080518082019091529084015463ffffffff81168252640100000000900460020b8183015282526001909201910161080f565b505050509450600085511115610950576040516308f944b560e21b81526001600160a01b038316906323e512d4906108949088908590600401610d5b565b6020604051808303816000875af11580156108b3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108d79190610dc0565b506040805162ffffff8316815233602082015285917f9a777601844e27c439fe9f23f4ada7ea2b67551ea35b07439e3dad53e0e369cd910160405180910390a2600084815260046020908152604080832062ffffff85168452909152812061093e916109e1565b8061094881610e29565b9150506107c8565b505b50505050565b6001600160a01b03811661097f5760405163d92e233d60e01b815260040160405180910390fd5b600180546001600160a01b0319166001600160a01b038381169182179092556000546040805191909316815260208101919091527f6353ec38ac394f8be94bfafcdd3580d356470599059eaeebedc3207e1cc03dec910160405180910390a150565b508054600082559060005260206000209081019061036191905b80821115610a1957805466ffffffffffffff191681556001016109fb565b5090565b60008083601f840112610a2f57600080fd5b50813567ffffffffffffffff811115610a4757600080fd5b6020830191508360208260051b8501011115610a6257600080fd5b9250929050565b60008060008060408587031215610a7f57600080fd5b843567ffffffffffffffff80821115610a9757600080fd5b610aa388838901610a1d565b90965094506020870135915080821115610abc57600080fd5b50610ac987828801610a1d565b95989497509550505050565b600060208284031215610ae757600080fd5b5035919050565b6001600160a01b038116811461036157600080fd5b801515811461036157600080fd5b60008060408385031215610b2457600080fd5b8235610b2f81610aee565b91506020830135610b3f81610b03565b809150509250929050565b600060208284031215610b5c57600080fd5b8135610b6781610aee565b9392505050565b634e487b7160e01b600052604160045260246000fd5b6040805190810167ffffffffffffffff81118282101715610ba757610ba7610b6e565b60405290565b604051601f8201601f1916810167ffffffffffffffff81118282101715610bd657610bd6610b6e565b604052919050565b62ffffff8116811461036157600080fd5b8035610bfa81610bde565b919050565b600080600060608486031215610c1457600080fd5b833567ffffffffffffffff80821115610c2c57600080fd5b818601915086601f830112610c4057600080fd5b8135602082821115610c5457610c54610b6e565b610c62818360051b01610bad565b828152818101935060069290921b840181019189831115610c8257600080fd5b938101935b82851015610cea576040858b031215610ca05760008081fd5b610ca8610b84565b853563ffffffff81168114610cbd5760008081fd5b815285830135600281900b8114610cd45760008081fd5b8184015284526040949094019392810192610c87565b96508701359450610d02925050604086019050610bef565b90509250925092565b634e487b7160e01b600052603260045260246000fd5b600060208284031215610d3357600080fd5b8135610b6781610b03565b600060208284031215610d5057600080fd5b8151610b6781610aee565b60408082528351828201819052600091906020906060850190828801855b82811015610da7578151805163ffffffff16855285015160020b858501529285019290840190600101610d79565b50505062ffffff95909516930192909252509092915050565b600060208284031215610dd257600080fd5b8151610b6781610b03565b600060208284031215610def57600080fd5b8151610b6781610bde565b634e487b7160e01b600052601160045260246000fd5b600060018201610e2257610e22610dfa565b5060010190565b600062ffffff808316818103610e4157610e41610dfa565b600101939250505056fea264697066735822122034fd09118d3d0be727d85a098f8ee3713b14cb27c0ce5bd2232a496b84d3abcf64736f6c634300080f0033", - "devdoc": { - "kind": "dev", - "methods": { - "addObservations((uint32,int24)[],bytes32,uint24)": { - "params": { - "_observationsData": "Array of tuples containing the dataset", - "_poolNonce": "Nonce of the observation broadcast", - "_poolSalt": "Identifier of the pool to fetch" - } - }, - "setPendingGovernor(address)": { - "params": { - "_pendingGovernor": "Address of the proposed new governor" - } - }, - "whitelistAdapter(address,bool)": { - "params": { - "_isWhitelisted": "New whitelisting status", - "_receiverAdapter": "Address of the adapter" - } - }, - "whitelistAdapters(address[],bool[])": { - "params": { - "_isWhitelisted": "Array of whitelisting status for each address", - "_receiverAdapters": "Array of addresses of the adapter" - } - } - }, - "stateVariables": { - "deployedOracles": { - "params": { - "_poolSalt": "The identifier of the oracle" - }, - "return": "The address of the correspondant Oracle", - "returns": { - "_0": "The address of the correspondant Oracle" - } - }, - "oracleFactory": { - "return": "The address of the OracleFactory", - "returns": { - "_0": "The address of the OracleFactory" - } - }, - "whitelistedAdapters": { - "params": { - "_adapter": "Address of the bridge adapter to consult" - }, - "return": "Whether a bridge adapter is whitelisted", - "returns": { - "_0": "Whether a bridge adapter is whitelisted" - } - } - }, - "title": "The DataReceiver contract", - "version": 1 - }, - "userdoc": { - "errors": { - "InvalidAddress()": [ - { - "notice": "Thrown if an address is invalid" - } - ], - "InvalidAmount()": [ - { - "notice": "Thrown if an amount is invalid" - } - ], - "LengthMismatch()": [ - { - "notice": "Thrown if the lengths of a set of lists mismatch" - } - ], - "ObservationsNotWritable()": [ - { - "notice": "Thrown when the broadcast nonce is incorrect" - } - ], - "OnlyGovernor()": [ - { - "notice": "Thrown if a non-governor user tries to call a OnlyGovernor function" - } - ], - "OnlyPendingGovernor()": [ - { - "notice": "Thrown if a non-pending-governor user tries to call a OnlyPendingGovernor function" - } - ], - "UnallowedAdapter()": [ - { - "notice": "Thrown when a not-whitelisted adapter triggers an update" - } - ], - "ZeroAddress()": [ - { - "notice": "Thrown if an address is the zero address" - } - ], - "ZeroAmount()": [ - { - "notice": "Thrown if an amount is zero" - } - ] - }, - "events": { - "AdapterWhitelisted(address,bool)": { - "notice": "Emitted when a new adapter whitelisting rule is set" - }, - "ObservationsAdded(bytes32,uint24,address)": { - "notice": "Emitted when a broadcast observation is succesfully processed" - }, - "ObservationsCached(bytes32,uint24,address)": { - "notice": "Emitted when a broadcast observation is cached for later processing" - }, - "PendingGovernorAccepted(address)": { - "notice": "Emitted when a new governor is set" - }, - "PendingGovernorSet(address,address)": { - "notice": "Emitted when a new pending governor is set" - } - }, - "kind": "user", - "methods": { - "acceptPendingGovernor()": { - "notice": "Allows a proposed governor to accept the governance" - }, - "addObservations((uint32,int24)[],bytes32,uint24)": { - "notice": "Allows whitelisted bridge adapters to push a broadcast" - }, - "deployedOracles(bytes32)": { - "notice": "Tracks already deployed oracles" - }, - "setPendingGovernor(address)": { - "notice": "Allows a governor to propose a new governor" - }, - "whitelistAdapter(address,bool)": { - "notice": "Allows governance to set an adapter whitelisted state" - }, - "whitelistAdapters(address[],bool[])": { - "notice": "Allows governance to batch set adapters whitelisted state" - }, - "whitelistedAdapters(address)": { - "notice": "Tracks the whitelisting of bridge adapters" - } - }, - "notice": "Handles reception of broadcast data and delivers it to correspondant oracle", - "version": 1 - }, - "storageLayout": { - "storage": [ - { - "astId": 8014, - "contract": "solidity/contracts/DataReceiver.sol:DataReceiver", - "label": "governor", - "offset": 0, - "slot": "0", - "type": "t_address" - }, - { - "astId": 8017, - "contract": "solidity/contracts/DataReceiver.sol:DataReceiver", - "label": "pendingGovernor", - "offset": 0, - "slot": "1", - "type": "t_address" - }, - { - "astId": 15164, - "contract": "solidity/contracts/DataReceiver.sol:DataReceiver", - "label": "deployedOracles", - "offset": 0, - "slot": "2", - "type": "t_mapping(t_bytes32,t_contract(IOracleSidechain)18533)" - }, - { - "astId": 15170, - "contract": "solidity/contracts/DataReceiver.sol:DataReceiver", - "label": "whitelistedAdapters", - "offset": 0, - "slot": "3", - "type": "t_mapping(t_contract(IBridgeReceiverAdapter)18668,t_bool)" - }, - { - "astId": 15178, - "contract": "solidity/contracts/DataReceiver.sol:DataReceiver", - "label": "_cachedObservations", - "offset": 0, - "slot": "4", - "type": "t_mapping(t_bytes32,t_mapping(t_uint24,t_array(t_struct(ObservationData)18375_storage)dyn_storage))" - } - ], - "types": { - "t_address": { - "encoding": "inplace", - "label": "address", - "numberOfBytes": "20" - }, - "t_array(t_struct(ObservationData)18375_storage)dyn_storage": { - "base": "t_struct(ObservationData)18375_storage", - "encoding": "dynamic_array", - "label": "struct IOracleSidechain.ObservationData[]", - "numberOfBytes": "32" - }, - "t_bool": { - "encoding": "inplace", - "label": "bool", - "numberOfBytes": "1" - }, - "t_bytes32": { - "encoding": "inplace", - "label": "bytes32", - "numberOfBytes": "32" - }, - "t_contract(IBridgeReceiverAdapter)18668": { - "encoding": "inplace", - "label": "contract IBridgeReceiverAdapter", - "numberOfBytes": "20" - }, - "t_contract(IOracleSidechain)18533": { - "encoding": "inplace", - "label": "contract IOracleSidechain", - "numberOfBytes": "20" - }, - "t_int24": { - "encoding": "inplace", - "label": "int24", - "numberOfBytes": "3" - }, - "t_mapping(t_bytes32,t_contract(IOracleSidechain)18533)": { - "encoding": "mapping", - "key": "t_bytes32", - "label": "mapping(bytes32 => contract IOracleSidechain)", - "numberOfBytes": "32", - "value": "t_contract(IOracleSidechain)18533" - }, - "t_mapping(t_bytes32,t_mapping(t_uint24,t_array(t_struct(ObservationData)18375_storage)dyn_storage))": { - "encoding": "mapping", - "key": "t_bytes32", - "label": "mapping(bytes32 => mapping(uint24 => struct IOracleSidechain.ObservationData[]))", - "numberOfBytes": "32", - "value": "t_mapping(t_uint24,t_array(t_struct(ObservationData)18375_storage)dyn_storage)" - }, - "t_mapping(t_contract(IBridgeReceiverAdapter)18668,t_bool)": { - "encoding": "mapping", - "key": "t_contract(IBridgeReceiverAdapter)18668", - "label": "mapping(contract IBridgeReceiverAdapter => bool)", - "numberOfBytes": "32", - "value": "t_bool" - }, - "t_mapping(t_uint24,t_array(t_struct(ObservationData)18375_storage)dyn_storage)": { - "encoding": "mapping", - "key": "t_uint24", - "label": "mapping(uint24 => struct IOracleSidechain.ObservationData[])", - "numberOfBytes": "32", - "value": "t_array(t_struct(ObservationData)18375_storage)dyn_storage" - }, - "t_struct(ObservationData)18375_storage": { - "encoding": "inplace", - "label": "struct IOracleSidechain.ObservationData", - "members": [ - { - "astId": 18372, - "contract": "solidity/contracts/DataReceiver.sol:DataReceiver", - "label": "blockTimestamp", - "offset": 0, - "slot": "0", - "type": "t_uint32" - }, - { - "astId": 18374, - "contract": "solidity/contracts/DataReceiver.sol:DataReceiver", - "label": "tick", - "offset": 4, - "slot": "0", - "type": "t_int24" - } - ], - "numberOfBytes": "32" - }, - "t_uint24": { - "encoding": "inplace", - "label": "uint24", - "numberOfBytes": "3" - }, - "t_uint32": { - "encoding": "inplace", - "label": "uint32", - "numberOfBytes": "4" - } - } - } -} \ No newline at end of file