diff --git a/README.md b/README.md index 58263044..e59ce470 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ If no direct liquidity pair exists between two tokens, the spot price aggregator * SushiSwap - [0x2A45d538f460DDBEeA3a899b0674dA3DFE318faa](https://etherscan.io/address/0x2A45d538f460DDBEeA3a899b0674dA3DFE318faa) * UniswapV2 - [0xA21E47477DE9BbcDC962ee18a5E7D339c5a16D28](https://etherscan.io/address/0xA21E47477DE9BbcDC962ee18a5E7D339c5a16D28) * UniswapV3 - [0xE85B42805e046D1933EB8e1C543C4da4E5e8fFa3](https://etherscan.io/address/0xE85B42805e046D1933EB8e1C543C4da4E5e8fFa3) - * Curve - [0xAD9393D581f1F4F91EED5B1C165eac8740A41f6E](https://etherscan.io/address/0xAD9393D581f1F4F91EED5B1C165eac8740A41f6E) + * Curve - [0xC290f0b4b322BFD735ADe7E8e0d5edb4B7f88934](https://etherscan.io/address/0xC290f0b4b322BFD735ADe7E8e0d5edb4B7f88934) * Pancake 3 - [0xB4039b37d09772801a51764537c167445f52F48b](https://etherscan.io/address/0xB4039b37d09772801a51764537c167445f52F48b) * Dodo - [0x0A7c4d89e1629f189Eb12dd716B178d1b90D9f66](https://etherscan.io/address/0x0A7c4d89e1629f189Eb12dd716B178d1b90D9f66) * DodoV2 - [0x03aA019F3B78110e030c34e9fA98047A1f62859A](https://etherscan.io/address/0x03aA019F3B78110e030c34e9fA98047A1f62859A) diff --git a/deployments/mainnet/CurveOracle.json b/deployments/mainnet/CurveOracle.json index d97b3e46..46055ff7 100644 --- a/deployments/mainnet/CurveOracle.json +++ b/deployments/mainnet/CurveOracle.json @@ -1,5 +1,5 @@ { - "address": "0xAD9393D581f1F4F91EED5B1C165eac8740A41f6E", + "address": "0xC290f0b4b322BFD735ADe7E8e0d5edb4B7f88934", "abi": [ { "inputs": [ @@ -17,6 +17,11 @@ "internalType": "uint256[]", "name": "_registryIds", "type": "uint256[]" + }, + { + "internalType": "enum CurveOracle.CurveRegistryType[]", + "name": "_registryTypes", + "type": "uint8[]" } ], "stateMutability": "nonpayable", @@ -120,21 +125,40 @@ ], "stateMutability": "view", "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "registryTypes", + "outputs": [ + { + "internalType": "enum CurveOracle.CurveRegistryType", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" } ], - "transactionHash": "0xa2b53c3d106483f5c7c8ea09adb17cca44abffbc6d184206a645e381498dd14c", + "transactionHash": "0x7ddefc012d6d3fd1e836fec3b4e4d30f39d55e81c60f0faa3af577693c23c8e5", "receipt": { "to": null, "from": "0x56E44874F624EbDE6efCc783eFD685f0FBDC6dcF", - "contractAddress": "0xAD9393D581f1F4F91EED5B1C165eac8740A41f6E", - "transactionIndex": 83, - "gasUsed": "1120231", + "contractAddress": "0xC290f0b4b322BFD735ADe7E8e0d5edb4B7f88934", + "transactionIndex": 30, + "gasUsed": "1296021", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x86c7aaf100d9d0d6f1ce68a4578523b9436a3079a3840d785fe195c95c738edc", - "transactionHash": "0xa2b53c3d106483f5c7c8ea09adb17cca44abffbc6d184206a645e381498dd14c", + "blockHash": "0xfe137056f04043ece8ecd70bae2a838f368c6f7d7a5ac25aa1b9383524b1643b", + "transactionHash": "0x7ddefc012d6d3fd1e836fec3b4e4d30f39d55e81c60f0faa3af577693c23c8e5", "logs": [], - "blockNumber": 18036272, - "cumulativeGasUsed": "7391578", + "blockNumber": 18365333, + "cumulativeGasUsed": "8681549", "status": 1, "byzantium": true }, @@ -149,13 +173,22 @@ 7, 8, 11 + ], + [ + 0, + 1, + 2, + 3, + 4, + 5, + 6 ] ], - "numDeployments": 1, - "solcInputHash": "598ca5045c584d564a27157779c5ebab", - "metadata": "{\"compiler\":{\"version\":\"0.8.19+commit.7dd6d404\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"contract ICurveProvider\",\"name\":\"_addressProvider\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_maxPools\",\"type\":\"uint256\"},{\"internalType\":\"uint256[]\",\"name\":\"_registryIds\",\"type\":\"uint256[]\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"ConnectorShouldBeNone\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"PoolNotFound\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"PoolWithConnectorNotFound\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"MAX_POOLS\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"REGISTRIES_COUNT\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"srcToken\",\"type\":\"address\"},{\"internalType\":\"contract IERC20\",\"name\":\"dstToken\",\"type\":\"address\"},{\"internalType\":\"contract IERC20\",\"name\":\"connector\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"thresholdFilter\",\"type\":\"uint256\"}],\"name\":\"getRate\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"rate\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"weight\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"registries\",\"outputs\":[{\"internalType\":\"contract ICurveRegistry\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/oracles/CurveOracle.sol\":\"CurveOracle\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":1000000},\"remappings\":[],\"viaIR\":true},\"sources\":{\"@openzeppelin/contracts/token/ERC20/ERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/ERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IERC20.sol\\\";\\nimport \\\"./extensions/IERC20Metadata.sol\\\";\\nimport \\\"../../utils/Context.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.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How\\n * to implement supply mechanisms].\\n *\\n * The default value of {decimals} is 18. To change this, you should override\\n * this function so it returns a different value.\\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 ERC20 is Context, IERC20, IERC20Metadata {\\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 * All two of these values are immutable: they can only be set once during\\n * construction.\\n */\\n constructor(string memory name_, string memory symbol_) {\\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 default value returned by this function, unless\\n * it's 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(address from, address to, uint256 amount) 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(address from, address to, uint256 amount) 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 // Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by\\n // decrementing then incrementing.\\n _balances[to] += amount;\\n }\\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 unchecked {\\n // Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above.\\n _balances[account] += amount;\\n }\\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 // Overflow not possible: amount <= accountBalance <= totalSupply.\\n _totalSupply -= amount;\\n }\\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(address owner, address spender, uint256 amount) 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(address owner, address spender, uint256 amount) 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(address from, address to, uint256 amount) 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(address from, address to, uint256 amount) internal virtual {}\\n}\\n\",\"keccak256\":\"0xa56ca923f70c1748830700250b19c61b70db9a683516dc5e216694a50445d99c\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.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(address from, address to, uint256 amount) external returns (bool);\\n}\\n\",\"keccak256\":\"0x287b55befed2961a7eabd7d7b1b2839cbca8a5b80ef8dcbb25ed3d4c2002c305\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.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 \\\"../IERC20.sol\\\";\\n\\n/**\\n * @dev Interface for the optional metadata functions from the ERC20 standard.\\n *\\n * _Available since v4.1._\\n */\\ninterface IERC20Metadata is IERC20 {\\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\":\"0x8de418a5503946cabe331f35fe242d3201a73f67f77aaeb7110acb1f30423aca\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\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 Context {\\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\",\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/math/Math.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/math/Math.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Standard math utilities missing in the Solidity language.\\n */\\nlibrary Math {\\n enum Rounding {\\n Down, // Toward negative infinity\\n Up, // Toward infinity\\n Zero // Toward zero\\n }\\n\\n /**\\n * @dev Returns the largest of two numbers.\\n */\\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a > b ? a : b;\\n }\\n\\n /**\\n * @dev Returns the smallest of two numbers.\\n */\\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a < b ? a : b;\\n }\\n\\n /**\\n * @dev Returns the average of two numbers. The result is rounded towards\\n * zero.\\n */\\n function average(uint256 a, uint256 b) internal pure returns (uint256) {\\n // (a + b) / 2 can overflow.\\n return (a & b) + (a ^ b) / 2;\\n }\\n\\n /**\\n * @dev Returns the ceiling of the division of two numbers.\\n *\\n * This differs from standard division with `/` in that it rounds up instead\\n * of rounding down.\\n */\\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\\n // (a + b - 1) / b can overflow on addition, so we distribute.\\n return a == 0 ? 0 : (a - 1) / b + 1;\\n }\\n\\n /**\\n * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\\n * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)\\n * with further edits by Uniswap Labs also under MIT license.\\n */\\n function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {\\n unchecked {\\n // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use\\n // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\\n // variables such that product = prod1 * 2^256 + prod0.\\n uint256 prod0; // Least significant 256 bits of the product\\n uint256 prod1; // Most significant 256 bits of the product\\n assembly {\\n let mm := mulmod(x, y, not(0))\\n prod0 := mul(x, y)\\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\\n }\\n\\n // Handle non-overflow cases, 256 by 256 division.\\n if (prod1 == 0) {\\n // Solidity will revert if denominator == 0, unlike the div opcode on its own.\\n // The surrounding unchecked block does not change this fact.\\n // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.\\n return prod0 / denominator;\\n }\\n\\n // Make sure the result is less than 2^256. Also prevents denominator == 0.\\n require(denominator > prod1, \\\"Math: mulDiv overflow\\\");\\n\\n ///////////////////////////////////////////////\\n // 512 by 256 division.\\n ///////////////////////////////////////////////\\n\\n // Make division exact by subtracting the remainder from [prod1 prod0].\\n uint256 remainder;\\n assembly {\\n // Compute remainder using mulmod.\\n remainder := mulmod(x, y, denominator)\\n\\n // Subtract 256 bit number from 512 bit number.\\n prod1 := sub(prod1, gt(remainder, prod0))\\n prod0 := sub(prod0, remainder)\\n }\\n\\n // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.\\n // See https://cs.stackexchange.com/q/138556/92363.\\n\\n // Does not overflow because the denominator cannot be zero at this stage in the function.\\n uint256 twos = denominator & (~denominator + 1);\\n assembly {\\n // Divide denominator by twos.\\n denominator := div(denominator, twos)\\n\\n // Divide [prod1 prod0] by twos.\\n prod0 := div(prod0, twos)\\n\\n // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.\\n twos := add(div(sub(0, twos), twos), 1)\\n }\\n\\n // Shift in bits from prod1 into prod0.\\n prod0 |= prod1 * twos;\\n\\n // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such\\n // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for\\n // four bits. That is, denominator * inv = 1 mod 2^4.\\n uint256 inverse = (3 * denominator) ^ 2;\\n\\n // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works\\n // in modular arithmetic, doubling the correct bits in each step.\\n inverse *= 2 - denominator * inverse; // inverse mod 2^8\\n inverse *= 2 - denominator * inverse; // inverse mod 2^16\\n inverse *= 2 - denominator * inverse; // inverse mod 2^32\\n inverse *= 2 - denominator * inverse; // inverse mod 2^64\\n inverse *= 2 - denominator * inverse; // inverse mod 2^128\\n inverse *= 2 - denominator * inverse; // inverse mod 2^256\\n\\n // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.\\n // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is\\n // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1\\n // is no longer required.\\n result = prod0 * inverse;\\n return result;\\n }\\n }\\n\\n /**\\n * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.\\n */\\n function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) {\\n uint256 result = mulDiv(x, y, denominator);\\n if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {\\n result += 1;\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.\\n *\\n * Inspired by Henry S. Warren, Jr.'s \\\"Hacker's Delight\\\" (Chapter 11).\\n */\\n function sqrt(uint256 a) internal pure returns (uint256) {\\n if (a == 0) {\\n return 0;\\n }\\n\\n // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.\\n //\\n // We know that the \\\"msb\\\" (most significant bit) of our target number `a` is a power of 2 such that we have\\n // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.\\n //\\n // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`\\n // \\u2192 `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`\\n // \\u2192 `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`\\n //\\n // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.\\n uint256 result = 1 << (log2(a) >> 1);\\n\\n // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,\\n // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at\\n // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision\\n // into the expected uint128 result.\\n unchecked {\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n return min(result, a / result);\\n }\\n }\\n\\n /**\\n * @notice Calculates sqrt(a), following the selected rounding direction.\\n */\\n function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = sqrt(a);\\n return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 2, rounded down, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log2(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >> 128 > 0) {\\n value >>= 128;\\n result += 128;\\n }\\n if (value >> 64 > 0) {\\n value >>= 64;\\n result += 64;\\n }\\n if (value >> 32 > 0) {\\n value >>= 32;\\n result += 32;\\n }\\n if (value >> 16 > 0) {\\n value >>= 16;\\n result += 16;\\n }\\n if (value >> 8 > 0) {\\n value >>= 8;\\n result += 8;\\n }\\n if (value >> 4 > 0) {\\n value >>= 4;\\n result += 4;\\n }\\n if (value >> 2 > 0) {\\n value >>= 2;\\n result += 2;\\n }\\n if (value >> 1 > 0) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 2, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log2(value);\\n return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 10, rounded down, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log10(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >= 10 ** 64) {\\n value /= 10 ** 64;\\n result += 64;\\n }\\n if (value >= 10 ** 32) {\\n value /= 10 ** 32;\\n result += 32;\\n }\\n if (value >= 10 ** 16) {\\n value /= 10 ** 16;\\n result += 16;\\n }\\n if (value >= 10 ** 8) {\\n value /= 10 ** 8;\\n result += 8;\\n }\\n if (value >= 10 ** 4) {\\n value /= 10 ** 4;\\n result += 4;\\n }\\n if (value >= 10 ** 2) {\\n value /= 10 ** 2;\\n result += 2;\\n }\\n if (value >= 10 ** 1) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log10(value);\\n return result + (rounding == Rounding.Up && 10 ** result < value ? 1 : 0);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 256, rounded down, of a positive value.\\n * Returns 0 if given 0.\\n *\\n * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.\\n */\\n function log256(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >> 128 > 0) {\\n value >>= 128;\\n result += 16;\\n }\\n if (value >> 64 > 0) {\\n value >>= 64;\\n result += 8;\\n }\\n if (value >> 32 > 0) {\\n value >>= 32;\\n result += 4;\\n }\\n if (value >> 16 > 0) {\\n value >>= 16;\\n result += 2;\\n }\\n if (value >> 8 > 0) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 256, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log256(value);\\n return result + (rounding == Rounding.Up && 1 << (result << 3) < value ? 1 : 0);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xe4455ac1eb7fc497bb7402579e7b4d64d928b846fce7d2b6fde06d366f21c2b3\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/math/SafeMath.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/math/SafeMath.sol)\\n\\npragma solidity ^0.8.0;\\n\\n// CAUTION\\n// This version of SafeMath should only be used with Solidity 0.8 or later,\\n// because it relies on the compiler's built in overflow checks.\\n\\n/**\\n * @dev Wrappers over Solidity's arithmetic operations.\\n *\\n * NOTE: `SafeMath` is generally not needed starting with Solidity 0.8, since the compiler\\n * now has built in overflow checking.\\n */\\nlibrary SafeMath {\\n /**\\n * @dev Returns the addition of two unsigned integers, with an overflow flag.\\n *\\n * _Available since v3.4._\\n */\\n function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n unchecked {\\n uint256 c = a + b;\\n if (c < a) return (false, 0);\\n return (true, c);\\n }\\n }\\n\\n /**\\n * @dev Returns the subtraction of two unsigned integers, with an overflow flag.\\n *\\n * _Available since v3.4._\\n */\\n function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n unchecked {\\n if (b > a) return (false, 0);\\n return (true, a - b);\\n }\\n }\\n\\n /**\\n * @dev Returns the multiplication of two unsigned integers, with an overflow flag.\\n *\\n * _Available since v3.4._\\n */\\n function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n unchecked {\\n // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\\n // benefit is lost if 'b' is also tested.\\n // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522\\n if (a == 0) return (true, 0);\\n uint256 c = a * b;\\n if (c / a != b) return (false, 0);\\n return (true, c);\\n }\\n }\\n\\n /**\\n * @dev Returns the division of two unsigned integers, with a division by zero flag.\\n *\\n * _Available since v3.4._\\n */\\n function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n unchecked {\\n if (b == 0) return (false, 0);\\n return (true, a / b);\\n }\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.\\n *\\n * _Available since v3.4._\\n */\\n function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n unchecked {\\n if (b == 0) return (false, 0);\\n return (true, a % b);\\n }\\n }\\n\\n /**\\n * @dev Returns the addition of two unsigned integers, reverting on\\n * overflow.\\n *\\n * Counterpart to Solidity's `+` operator.\\n *\\n * Requirements:\\n *\\n * - Addition cannot overflow.\\n */\\n function add(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a + b;\\n }\\n\\n /**\\n * @dev Returns the subtraction of two unsigned integers, reverting on\\n * overflow (when the result is negative).\\n *\\n * Counterpart to Solidity's `-` operator.\\n *\\n * Requirements:\\n *\\n * - Subtraction cannot overflow.\\n */\\n function sub(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a - b;\\n }\\n\\n /**\\n * @dev Returns the multiplication of two unsigned integers, reverting on\\n * overflow.\\n *\\n * Counterpart to Solidity's `*` operator.\\n *\\n * Requirements:\\n *\\n * - Multiplication cannot overflow.\\n */\\n function mul(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a * b;\\n }\\n\\n /**\\n * @dev Returns the integer division of two unsigned integers, reverting on\\n * division by zero. The result is rounded towards zero.\\n *\\n * Counterpart to Solidity's `/` operator.\\n *\\n * Requirements:\\n *\\n * - The divisor cannot be zero.\\n */\\n function div(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a / b;\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\\n * reverting when dividing by zero.\\n *\\n * Counterpart to Solidity's `%` operator. This function uses a `revert`\\n * opcode (which leaves remaining gas untouched) while Solidity uses an\\n * invalid opcode to revert (consuming all remaining gas).\\n *\\n * Requirements:\\n *\\n * - The divisor cannot be zero.\\n */\\n function mod(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a % b;\\n }\\n\\n /**\\n * @dev Returns the subtraction of two unsigned integers, reverting with custom message on\\n * overflow (when the result is negative).\\n *\\n * CAUTION: This function is deprecated because it requires allocating memory for the error\\n * message unnecessarily. For custom revert reasons use {trySub}.\\n *\\n * Counterpart to Solidity's `-` operator.\\n *\\n * Requirements:\\n *\\n * - Subtraction cannot overflow.\\n */\\n function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\\n unchecked {\\n require(b <= a, errorMessage);\\n return a - b;\\n }\\n }\\n\\n /**\\n * @dev Returns the integer division of two unsigned integers, reverting with custom message on\\n * division by zero. The result is rounded towards zero.\\n *\\n * Counterpart to Solidity's `/` operator. Note: this function uses a\\n * `revert` opcode (which leaves remaining gas untouched) while Solidity\\n * uses an invalid opcode to revert (consuming all remaining gas).\\n *\\n * Requirements:\\n *\\n * - The divisor cannot be zero.\\n */\\n function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\\n unchecked {\\n require(b > 0, errorMessage);\\n return a / b;\\n }\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\\n * reverting with custom message when dividing by zero.\\n *\\n * CAUTION: This function is deprecated because it requires allocating memory for the error\\n * message unnecessarily. For custom revert reasons use {tryMod}.\\n *\\n * Counterpart to Solidity's `%` operator. This function uses a `revert`\\n * opcode (which leaves remaining gas untouched) while Solidity uses an\\n * invalid opcode to revert (consuming all remaining gas).\\n *\\n * Requirements:\\n *\\n * - The divisor cannot be zero.\\n */\\n function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\\n unchecked {\\n require(b > 0, errorMessage);\\n return a % b;\\n }\\n }\\n}\\n\",\"keccak256\":\"0x58b21219689909c4f8339af00813760337f7e2e7f169a97fe49e2896dcfb3b9a\",\"license\":\"MIT\"},\"contracts/interfaces/ICurveProvider.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.19;\\n\\n// solhint-disable func-name-mixedcase\\n\\ninterface ICurveProvider {\\n function get_address (uint256 _id) external view returns (address);\\n}\\n\",\"keccak256\":\"0x05828fcb7d6a651368802eb3018a9d94f270fcb76cf2137e2121e0010517de65\",\"license\":\"MIT\"},\"contracts/interfaces/ICurveRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.19;\\n\\n// solhint-disable func-name-mixedcase\\n\\ninterface ICurveRegistry {\\n function find_pool_for_coins(address _srcToken, address _dstToken, uint256 _index) external view returns (address);\\n function get_coin_indices(address _pool, address _srcToken, address _dstToken) external view returns (int128, int128, bool);\\n function get_balances(address _pool) external view returns (uint256[8] memory);\\n function get_underlying_balances(address _pool) external view returns (uint256[8] memory);\\n}\\n\",\"keccak256\":\"0x6a2ee1bd1feb177537e2c479879a13051fe771a76d1a92911c53c43fa43c026a\",\"license\":\"MIT\"},\"contracts/interfaces/ICurveSwap.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.19;\\n\\n// solhint-disable func-name-mixedcase\\n\\ninterface ICurveSwap {\\n function get_dy(int128 _from, int128 _to, uint256 _amount) external view returns (uint256);\\n function get_dy_underlying(int128 _from, int128 _to, uint256 _amount) external view returns (uint256);\\n}\\n\\ninterface ICurveSwapNew {\\n function get_dy(uint256 _from, uint256 _to, uint256 _amount) external view returns (uint256);\\n function get_dy_underlying(uint256 _from, uint256 _to, uint256 _amount) external view returns (uint256);\\n}\\n\",\"keccak256\":\"0xb0d8fe953afebc30b4a3ed1509eea45e0852ac12003c12c1937acecfae4d966f\",\"license\":\"MIT\"},\"contracts/interfaces/IOracle.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.19;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\ninterface IOracle {\\n error ConnectorShouldBeNone();\\n error PoolNotFound();\\n error PoolWithConnectorNotFound();\\n\\n function getRate(IERC20 srcToken, IERC20 dstToken, IERC20 connector, uint256 thresholdFilter) external view returns (uint256 rate, uint256 weight);\\n}\\n\",\"keccak256\":\"0xd194baa5fd0dd28b8a3c1882d510519b9b679d096efb0302e1e779ff2cb7faab\",\"license\":\"MIT\"},\"contracts/libraries/OraclePrices.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.19;\\n\\nimport \\\"@openzeppelin/contracts/utils/math/SafeMath.sol\\\";\\n\\n/**\\n * @title OraclePrices\\n * @notice A library that provides functionalities for processing and analyzing token rate and weight data provided by an oracle.\\n * The library is used when an oracle uses multiple pools to determine a token's price.\\n * It allows to filter out pools with low weight and significantly incorrect price, which could distort the weighted price.\\n * The level of low-weight pool filtering can be managed using the thresholdFilter parameter.\\n */\\nlibrary OraclePrices {\\n using SafeMath for uint256;\\n\\n /**\\n * @title Oracle Price Data Structure\\n * @notice This structure encapsulates the rate and weight information for tokens as provided by an oracle\\n * @dev An array of OraclePrice structures can be used to represent oracle data for multiple pools\\n * @param rate The oracle-provided rate for a token\\n * @param weight The oracle-provided derived weight for a token\\n */\\n struct OraclePrice {\\n uint256 rate;\\n uint256 weight;\\n }\\n\\n /**\\n * @title Oracle Prices Data Structure\\n * @notice This structure encapsulates information about a list of oracles prices and weights\\n * @dev The structure is initialized with a maximum possible length by the `init` function\\n * @param oraclePrices An array of OraclePrice structures, each containing a rate and weight\\n * @param maxOracleWeight The maximum weight among the OraclePrice elements in the oraclePrices array\\n * @param size The number of meaningful OraclePrice elements added to the oraclePrices array\\n */\\n struct Data {\\n uint256 maxOracleWeight;\\n uint256 size;\\n OraclePrice[] oraclePrices;\\n }\\n\\n /**\\n * @notice Initializes an array of OraclePrices with a given maximum length and returns it wrapped inside a Data struct\\n * @dev Uses inline assembly for memory allocation to avoid array zeroing and extra array copy to struct\\n * @param maxArrLength The maximum length of the oraclePrices array\\n * @return data Returns an instance of Data struct containing an OraclePrice array with a specified maximum length\\n */\\n function init(uint256 maxArrLength) internal pure returns (Data memory data) {\\n assembly (\\\"memory-safe\\\") { // solhint-disable-line no-inline-assembly\\n data := mload(0x40)\\n mstore(0x40, add(data, add(0x80, mul(maxArrLength, 0x40))))\\n mstore(add(data, 0x00), 0)\\n mstore(add(data, 0x20), 0)\\n mstore(add(data, 0x40), add(data, 0x60))\\n mstore(add(data, 0x60), maxArrLength)\\n }\\n }\\n\\n /**\\n * @notice Appends an OraclePrice to the oraclePrices array in the provided Data struct if the OraclePrice has a non-zero weight\\n * @dev If the weight of the OraclePrice is greater than the current maxOracleWeight, the maxOracleWeight is updated. The size (number of meaningful elements) of the array is incremented after appending the OraclePrice.\\n * @param data The Data struct that contains the oraclePrices array, maxOracleWeight, and the current size\\n * @param oraclePrice The OraclePrice to be appended to the oraclePrices array\\n * @return isAppended A flag indicating whether the oraclePrice was appended or not\\n */\\n function append(Data memory data, OraclePrice memory oraclePrice) internal pure returns (bool isAppended) {\\n if (oraclePrice.weight > 0) {\\n data.oraclePrices[data.size] = oraclePrice;\\n data.size++;\\n if (oraclePrice.weight > data.maxOracleWeight) {\\n data.maxOracleWeight = oraclePrice.weight;\\n }\\n return true;\\n }\\n return false;\\n }\\n\\n /**\\n * @notice Calculates the weighted rate from the oracle prices data using a threshold filter\\n * @dev Shrinks the `oraclePrices` array to remove any unused space, though it's unclear how this optimizes the code, but it is. Then calculates the weighted rate\\n * considering only the oracle prices whose weight is above the threshold which is percent from max weight\\n * @param data The data structure containing oracle prices, the maximum oracle weight and the size of the used oracle prices array\\n * @param thresholdFilter The threshold to filter oracle prices based on their weight\\n * @return weightedRate The calculated weighted rate\\n * @return totalWeight The total weight of the oracle prices that passed the threshold\\n */\\n function getRateAndWeight(Data memory data, uint256 thresholdFilter) internal pure returns (uint256 weightedRate, uint256 totalWeight) {\\n // shrink oraclePrices array\\n uint256 size = data.size;\\n assembly (\\\"memory-safe\\\") { // solhint-disable-line no-inline-assembly\\n let ptr := mload(add(data, 64))\\n mstore(ptr, size)\\n }\\n\\n // calculate weighted rate\\n for (uint256 i = 0; i < size; i++) {\\n OraclePrice memory p = data.oraclePrices[i];\\n if (p.weight * 100 < data.maxOracleWeight * thresholdFilter) {\\n continue;\\n }\\n weightedRate += p.rate * p.weight;\\n totalWeight += p.weight;\\n }\\n if (totalWeight > 0) {\\n unchecked { weightedRate /= totalWeight; }\\n }\\n }\\n\\n /**\\n * @notice See `getRateAndWeight`. It uses SafeMath to prevent overflows.\\n */\\n function getRateAndWeightWithSafeMath(Data memory data, uint256 thresholdFilter) internal pure returns (uint256 weightedRate, uint256 totalWeight) {\\n // shrink oraclePrices array\\n uint256 size = data.size;\\n assembly (\\\"memory-safe\\\") { // solhint-disable-line no-inline-assembly\\n let ptr := mload(add(data, 64))\\n mstore(ptr, size)\\n }\\n\\n // calculate weighted rate\\n for (uint256 i = 0; i < size; i++) {\\n OraclePrice memory p = data.oraclePrices[i];\\n if (p.weight * 100 < data.maxOracleWeight * thresholdFilter) {\\n continue;\\n }\\n (bool ok, uint256 weightedRateI) = p.rate.tryMul(p.weight);\\n if (ok) {\\n (ok, weightedRate) = _tryAdd(weightedRate, weightedRateI);\\n if (ok) totalWeight += p.weight;\\n }\\n }\\n if (totalWeight > 0) {\\n unchecked { weightedRate /= totalWeight; }\\n }\\n }\\n\\n function _tryAdd(uint256 value, uint256 addition) private pure returns (bool, uint256) {\\n unchecked {\\n uint256 result = value + addition;\\n if (result < value) return (false, value);\\n return (true, result);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x14a4ca1d806e8a279ed6d77d19c75e6504d070e9f065ae71a49ceb05ec077466\",\"license\":\"MIT\"},\"contracts/oracles/CurveOracle.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.19;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/ERC20.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/math/Math.sol\\\";\\nimport \\\"../interfaces/IOracle.sol\\\";\\nimport \\\"../interfaces/ICurveProvider.sol\\\";\\nimport \\\"../interfaces/ICurveRegistry.sol\\\";\\nimport \\\"../interfaces/ICurveSwap.sol\\\";\\nimport \\\"../libraries/OraclePrices.sol\\\";\\n\\ncontract CurveOracle is IOracle {\\n using OraclePrices for OraclePrices.Data;\\n using Math for uint256;\\n\\n struct FunctionInfo {\\n function (address) external view returns (uint256[8] memory) balanceFunc;\\n bytes4 dyFuncInt128Selector;\\n function (uint256, uint256, uint256) external view returns (uint256) dyFuncUint256;\\n }\\n\\n IERC20 private constant _NONE = IERC20(0xFFfFfFffFFfffFFfFFfFFFFFffFFFffffFfFFFfF);\\n\\n uint256 public immutable MAX_POOLS;\\n uint256 public immutable REGISTRIES_COUNT;\\n ICurveRegistry[11] public registries;\\n\\n constructor(ICurveProvider _addressProvider, uint256 _maxPools, uint256[] memory _registryIds) {\\n MAX_POOLS = _maxPools;\\n REGISTRIES_COUNT = _registryIds.length;\\n unchecked {\\n for (uint256 i = 0; i < REGISTRIES_COUNT; i++) {\\n registries[i] = ICurveRegistry(_addressProvider.get_address(_registryIds[i]));\\n }\\n }\\n }\\n\\n function getRate(IERC20 srcToken, IERC20 dstToken, IERC20 connector, uint256 thresholdFilter) external view override returns (uint256 rate, uint256 weight) {\\n if(connector != _NONE) revert ConnectorShouldBeNone();\\n\\n OraclePrices.Data memory ratesAndWeights = OraclePrices.init(MAX_POOLS);\\n FunctionInfo memory info;\\n uint256 index = 0;\\n for (uint256 i = 0; i < REGISTRIES_COUNT && index < MAX_POOLS; i++) {\\n address pool = registries[i].find_pool_for_coins(address(srcToken), address(dstToken), index);\\n while (pool != address(0) && index < MAX_POOLS) {\\n (int128 srcTokenIndex, int128 dstTokenIndex, bool isUnderlying) = registries[i].get_coin_indices(pool, address(srcToken), address(dstToken));\\n if (!isUnderlying) {\\n info = FunctionInfo({\\n balanceFunc: registries[i].get_balances,\\n dyFuncInt128Selector: ICurveSwap.get_dy.selector,\\n dyFuncUint256: ICurveSwapNew(pool).get_dy\\n });\\n } else {\\n info = FunctionInfo({\\n balanceFunc: registries[i].get_underlying_balances,\\n dyFuncInt128Selector: ICurveSwap.get_dy_underlying.selector,\\n dyFuncUint256: ICurveSwapNew(pool).get_dy_underlying\\n });\\n }\\n\\n uint256[8] memory balances = info.balanceFunc(pool);\\n uint256 w = (balances[uint128(srcTokenIndex)] * balances[uint128(dstTokenIndex)]).sqrt();\\n uint256 b0 = balances[uint128(srcTokenIndex)] / 10000;\\n\\n if (b0 != 0) {\\n uint256 b1;\\n (bool success, bytes memory data) = pool.staticcall(abi.encodeWithSelector(info.dyFuncInt128Selector, srcTokenIndex, dstTokenIndex, b0));\\n if (success && data.length == 32) {\\n b1 = abi.decode(data, (uint256));\\n } else {\\n b1 = info.dyFuncUint256(uint128(srcTokenIndex), uint128(dstTokenIndex), b0);\\n }\\n ratesAndWeights.append(OraclePrices.OraclePrice(Math.mulDiv(b1, 1e18, b0), w));\\n }\\n pool = registries[i].find_pool_for_coins(address(srcToken), address(dstToken), ++index);\\n }\\n }\\n (rate, weight) = ratesAndWeights.getRateAndWeight(thresholdFilter);\\n }\\n}\\n\",\"keccak256\":\"0xeaf0d0da9718a58e6ec8f2cbcaf0cdc7f32979031bf4290632292a3f6fff1c68\",\"license\":\"MIT\"}},\"version\":1}", - "bytecode": "0x60c060409080825234620002065762001245803803809162000022828562000221565b8339810191606082840312620002065781516001600160a01b0391828216918290036200020657602094858501518286015160018060401b03968782116200020657019180601f84011215620002065782519687116200020b5760059287841b855198620000938b83018b62000221565b895289808a0191830101928311620002065789809201905b838210620001f6575050505060805284519460a095865260005b8651811015620001b45781518110156200019e578781841b8301015184519063124fd3dd60e21b8252600490818301526024908a8383818b5afa92831562000193576000936200014b575b50600b8410156200013857505081546001600160a01b031916908716178155600101620000c5565b603290634e487b7160e01b600052526000fd5b8b81819593953d83116200018b575b62000166818362000221565b81010312620001875751908982168203620001845750913862000110565b80fd5b5080fd5b503d6200015a565b87513d6000823e3d90fd5b634e487b7160e01b600052603260045260246000fd5b868451610fff918262000246833960805182818160810152818161022f0152818161026e01528181610a530152610b8e01525181818161013c01526102b00152f35b81518152908201908201620000ab565b600080fd5b634e487b7160e01b600052604160045260246000fd5b601f909101601f19168101906001600160401b038211908210176200020b5760405256fe608080604052600436101561001357600080fd5b60003560e01c9081633d549b321461015f5750806347400449146101065780636347c900146100a95763813584981461004b57600080fd5b346100a45760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126100a45760206040517f00000000000000000000000000000000000000000000000000000000000000008152f35b600080fd5b346100a45760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126100a457600435600b8110156100a45773ffffffffffffffffffffffffffffffffffffffff6020915416604051908152f35b346100a45760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126100a45760206040517f00000000000000000000000000000000000000000000000000000000000000008152f35b346100a45760807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126100a4576004359073ffffffffffffffffffffffffffffffffffffffff821682036100a4576024359073ffffffffffffffffffffffffffffffffffffffff821682036100a45760443573ffffffffffffffffffffffffffffffffffffffff81168091036100a45773ffffffffffffffffffffffffffffffffffffffff03610bb4575060606040805161021b81610bdc565b6000815260006020820152015260405160807f000000000000000000000000000000000000000000000000000000000000000060061b8201016040526000815260006020820152606081018060408301527f0000000000000000000000000000000000000000000000000000000000000000905260006040805161029e81610bdc565b8281528260208201520152600080915b7f0000000000000000000000000000000000000000000000000000000000000000831080610b8b575b15610a9857600b83101590816106615783546040517f6982eb0b00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff888116600483015287166024820152604481018590529093906020818060648101038173ffffffffffffffffffffffffffffffffffffffff89165afa90811561065557600091610a79575b505b73ffffffffffffffffffffffffffffffffffffffff8116151580610a50575b15610a3a5783610661576040517feb85226d00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8216600482015273ffffffffffffffffffffffffffffffffffffffff8916602482015273ffffffffffffffffffffffffffffffffffffffff8816604482015260608160648173ffffffffffffffffffffffffffffffffffffffff8a165afa908115610655576000916000916000916109e1575b5061096457856106615760249260405161046181610bdc565b63556d6e9f77ffffffffffffffffffffffffffffffffffffffff000000006392e3cc2d818c60201b161760401b83527f5e0d443f0000000000000000000000000000000000000000000000000000000060208401528360201b161760401b6040820152915b61010083516040519687827fffffffff00000000000000000000000000000000000000000000000000000000829460a01b16825273ffffffffffffffffffffffffffffffffffffffff8716600483015260601c5afa9384156106555788956000956108bb575b506fffffffffffffffffffffffffffffffff9061271061057a61057061056b6105578686168b610ca0565b516105648789168c610ca0565b5190610cb1565b610e09565b9784841690610ca0565b51049384610690575b505050505050506106615761059790610c39565b6040517f6982eb0b00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff888116600483015287166024820152604481018290529094906020818060648101038173ffffffffffffffffffffffffffffffffffffffff89165afa90811561065557600091610626575b50909490610371565b610648915060203d60201161064e575b6106408183610bf8565b810190610c66565b8861061d565b503d610636565b6040513d6000823e3d90fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b90919293949596507fffffffff000000000000000000000000000000000000000000000000000000006020870151169060405191602083015284600f84810b60248501520b6044830152856064830152606482528160a081011067ffffffffffffffff60a0840111176107d857816000929160a0849301604052602082519201905afa943d156108b3573d9567ffffffffffffffff87116107d8576040519661076160207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8401160189610bf8565b87523d6000602089013e5b806108a8575b1561080757505050506020828051810103126100a4576020610795920151610cfd565b60405180604081011067ffffffffffffffff6040830111176107d85785926107cb92604083016040528252602082015284610f60565b5088808080808080610583565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b602093955090604060649201518360405197889586947fffffffff000000000000000000000000000000000000000000000000000000008560a01b16865216600485015216602483015285604483015260601c5afa801561065557600090610874575b6107959250610cfd565b506020823d6020116108a0575b8161088e60209383610bf8565b810103126100a457610795915161086a565b3d9150610881565b506020865114610772565b60609561076c565b91929394509450610100903d6101001161095c575b6108da8282610bf8565b6101008183810103126100a457818101601f820112156100a457604051918261010081011067ffffffffffffffff610100850111176107d8576101008301604052829082016101008301116100a457908996959493929181905b6101008301821061094957505050938d61052c565b815181528b985060209182019101610934565b3d91506108d0565b602492955060009560405161097881610bdc565b6385f11d1e77ffffffffffffffffffffffffffffffffffffffff000000006359f4f351818c60201b161760401b83527f07211ef70000000000000000000000000000000000000000000000000000000060208401528360201b161760401b6040820152916104c6565b925050506060813d606011610a32575b816109fe60609383610bf8565b810103126100a457610a0f81610c92565b6040610a1d60208401610c92565b9201519081151582036100a45791908b610448565b3d91506109f1565b5093909250610a499150610c39565b91906102ae565b507f00000000000000000000000000000000000000000000000000000000000000008210610390565b610a92915060203d60201161064e576106408183610bf8565b8861036f565b6000806020830151806040850151526000906064948535955b828410610adf576040868680610ace575b82519182526020820152f35b9081610ad991610cc4565b90610ac2565b90919293610af1856040850151610f4c565b51956020870196875184810290808204861490151715610b5c57610b168a8751610cb1565b11610b4f5791610b39610b4192610b33610b4795518b5190610cb1565b90610fbc565b975190610fbc565b94610c39565b929190610ab1565b50955093610b4790610c39565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b507f000000000000000000000000000000000000000000000000000000000000000082106102d7565b807fccf7e6f70000000000000000000000000000000000000000000000000000000060049252fd5b6060810190811067ffffffffffffffff8211176107d857604052565b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff8211176107d857604052565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8114610b5c5760010190565b908160209103126100a4575173ffffffffffffffffffffffffffffffffffffffff811681036100a45790565b519081600f0b82036100a457565b9060088110156106615760051b0190565b81810292918115918404141715610b5c57565b8115610cce570490565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b90670de0b6b3a7640000907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8284099282810292838086109503948086039514610df95784831115610d9b578291096001821901821680920460028082600302188083028203028083028203028083028203028083028203028083028203028092029003029360018380600003040190848311900302920304170290565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f4d6174683a206d756c446976206f766572666c6f7700000000000000000000006044820152fd5b505090610e069250610cc4565b90565b8015610f4657610ed4816000908360801c80610f3a575b508060401c80610f2d575b508060201c80610f20575b508060101c80610f13575b508060081c80610f06575b508060041c80610ef9575b508060021c80610eec575b50600191828092811c610ee5575b1c1b610e7c8185610cc4565b01811c610e898185610cc4565b01811c610e968185610cc4565b01811c610ea38185610cc4565b01811c610eb08185610cc4565b01811c610ebd8185610cc4565b01811c610eca8185610cc4565b01901c8092610cc4565b80821015610ee0575090565b905090565b0181610e70565b6002915091019038610e62565b6004915091019038610e57565b6008915091019038610e4c565b6010915091019038610e41565b6020915091019038610e36565b6040915091019038610e2b565b91505060809038610e20565b50600090565b80518210156106615760209160051b010190565b9060208101908151610f7457505050600090565b610f956040840151916020850192835191610f8f8383610f4c565b52610f4c565b50610fa08151610c39565b9052519080518211610fb4575b5050600190565b523880610fad565b91908201809211610b5c5756fea264697066735822122073d772ff8ed765e42f483643143320e6a99b5c1d0f59c400cb8f877926b7e80e64736f6c63430008130033", - "deployedBytecode": "0x608080604052600436101561001357600080fd5b60003560e01c9081633d549b321461015f5750806347400449146101065780636347c900146100a95763813584981461004b57600080fd5b346100a45760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126100a45760206040517f00000000000000000000000000000000000000000000000000000000000000008152f35b600080fd5b346100a45760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126100a457600435600b8110156100a45773ffffffffffffffffffffffffffffffffffffffff6020915416604051908152f35b346100a45760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126100a45760206040517f00000000000000000000000000000000000000000000000000000000000000008152f35b346100a45760807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126100a4576004359073ffffffffffffffffffffffffffffffffffffffff821682036100a4576024359073ffffffffffffffffffffffffffffffffffffffff821682036100a45760443573ffffffffffffffffffffffffffffffffffffffff81168091036100a45773ffffffffffffffffffffffffffffffffffffffff03610bb4575060606040805161021b81610bdc565b6000815260006020820152015260405160807f000000000000000000000000000000000000000000000000000000000000000060061b8201016040526000815260006020820152606081018060408301527f0000000000000000000000000000000000000000000000000000000000000000905260006040805161029e81610bdc565b8281528260208201520152600080915b7f0000000000000000000000000000000000000000000000000000000000000000831080610b8b575b15610a9857600b83101590816106615783546040517f6982eb0b00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff888116600483015287166024820152604481018590529093906020818060648101038173ffffffffffffffffffffffffffffffffffffffff89165afa90811561065557600091610a79575b505b73ffffffffffffffffffffffffffffffffffffffff8116151580610a50575b15610a3a5783610661576040517feb85226d00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8216600482015273ffffffffffffffffffffffffffffffffffffffff8916602482015273ffffffffffffffffffffffffffffffffffffffff8816604482015260608160648173ffffffffffffffffffffffffffffffffffffffff8a165afa908115610655576000916000916000916109e1575b5061096457856106615760249260405161046181610bdc565b63556d6e9f77ffffffffffffffffffffffffffffffffffffffff000000006392e3cc2d818c60201b161760401b83527f5e0d443f0000000000000000000000000000000000000000000000000000000060208401528360201b161760401b6040820152915b61010083516040519687827fffffffff00000000000000000000000000000000000000000000000000000000829460a01b16825273ffffffffffffffffffffffffffffffffffffffff8716600483015260601c5afa9384156106555788956000956108bb575b506fffffffffffffffffffffffffffffffff9061271061057a61057061056b6105578686168b610ca0565b516105648789168c610ca0565b5190610cb1565b610e09565b9784841690610ca0565b51049384610690575b505050505050506106615761059790610c39565b6040517f6982eb0b00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff888116600483015287166024820152604481018290529094906020818060648101038173ffffffffffffffffffffffffffffffffffffffff89165afa90811561065557600091610626575b50909490610371565b610648915060203d60201161064e575b6106408183610bf8565b810190610c66565b8861061d565b503d610636565b6040513d6000823e3d90fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b90919293949596507fffffffff000000000000000000000000000000000000000000000000000000006020870151169060405191602083015284600f84810b60248501520b6044830152856064830152606482528160a081011067ffffffffffffffff60a0840111176107d857816000929160a0849301604052602082519201905afa943d156108b3573d9567ffffffffffffffff87116107d8576040519661076160207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8401160189610bf8565b87523d6000602089013e5b806108a8575b1561080757505050506020828051810103126100a4576020610795920151610cfd565b60405180604081011067ffffffffffffffff6040830111176107d85785926107cb92604083016040528252602082015284610f60565b5088808080808080610583565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b602093955090604060649201518360405197889586947fffffffff000000000000000000000000000000000000000000000000000000008560a01b16865216600485015216602483015285604483015260601c5afa801561065557600090610874575b6107959250610cfd565b506020823d6020116108a0575b8161088e60209383610bf8565b810103126100a457610795915161086a565b3d9150610881565b506020865114610772565b60609561076c565b91929394509450610100903d6101001161095c575b6108da8282610bf8565b6101008183810103126100a457818101601f820112156100a457604051918261010081011067ffffffffffffffff610100850111176107d8576101008301604052829082016101008301116100a457908996959493929181905b6101008301821061094957505050938d61052c565b815181528b985060209182019101610934565b3d91506108d0565b602492955060009560405161097881610bdc565b6385f11d1e77ffffffffffffffffffffffffffffffffffffffff000000006359f4f351818c60201b161760401b83527f07211ef70000000000000000000000000000000000000000000000000000000060208401528360201b161760401b6040820152916104c6565b925050506060813d606011610a32575b816109fe60609383610bf8565b810103126100a457610a0f81610c92565b6040610a1d60208401610c92565b9201519081151582036100a45791908b610448565b3d91506109f1565b5093909250610a499150610c39565b91906102ae565b507f00000000000000000000000000000000000000000000000000000000000000008210610390565b610a92915060203d60201161064e576106408183610bf8565b8861036f565b6000806020830151806040850151526000906064948535955b828410610adf576040868680610ace575b82519182526020820152f35b9081610ad991610cc4565b90610ac2565b90919293610af1856040850151610f4c565b51956020870196875184810290808204861490151715610b5c57610b168a8751610cb1565b11610b4f5791610b39610b4192610b33610b4795518b5190610cb1565b90610fbc565b975190610fbc565b94610c39565b929190610ab1565b50955093610b4790610c39565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b507f000000000000000000000000000000000000000000000000000000000000000082106102d7565b807fccf7e6f70000000000000000000000000000000000000000000000000000000060049252fd5b6060810190811067ffffffffffffffff8211176107d857604052565b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff8211176107d857604052565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8114610b5c5760010190565b908160209103126100a4575173ffffffffffffffffffffffffffffffffffffffff811681036100a45790565b519081600f0b82036100a457565b9060088110156106615760051b0190565b81810292918115918404141715610b5c57565b8115610cce570490565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b90670de0b6b3a7640000907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8284099282810292838086109503948086039514610df95784831115610d9b578291096001821901821680920460028082600302188083028203028083028203028083028203028083028203028083028203028092029003029360018380600003040190848311900302920304170290565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f4d6174683a206d756c446976206f766572666c6f7700000000000000000000006044820152fd5b505090610e069250610cc4565b90565b8015610f4657610ed4816000908360801c80610f3a575b508060401c80610f2d575b508060201c80610f20575b508060101c80610f13575b508060081c80610f06575b508060041c80610ef9575b508060021c80610eec575b50600191828092811c610ee5575b1c1b610e7c8185610cc4565b01811c610e898185610cc4565b01811c610e968185610cc4565b01811c610ea38185610cc4565b01811c610eb08185610cc4565b01811c610ebd8185610cc4565b01811c610eca8185610cc4565b01901c8092610cc4565b80821015610ee0575090565b905090565b0181610e70565b6002915091019038610e62565b6004915091019038610e57565b6008915091019038610e4c565b6010915091019038610e41565b6020915091019038610e36565b6040915091019038610e2b565b91505060809038610e20565b50600090565b80518210156106615760209160051b010190565b9060208101908151610f7457505050600090565b610f956040840151916020850192835191610f8f8383610f4c565b52610f4c565b50610fa08151610c39565b9052519080518211610fb4575b5050600190565b523880610fad565b91908201809211610b5c5756fea264697066735822122073d772ff8ed765e42f483643143320e6a99b5c1d0f59c400cb8f877926b7e80e64736f6c63430008130033", + "numDeployments": 2, + "solcInputHash": "6301fa70edd1883e7cea0f72c7dacb49", + "metadata": "{\"compiler\":{\"version\":\"0.8.19+commit.7dd6d404\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"contract ICurveProvider\",\"name\":\"_addressProvider\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_maxPools\",\"type\":\"uint256\"},{\"internalType\":\"uint256[]\",\"name\":\"_registryIds\",\"type\":\"uint256[]\"},{\"internalType\":\"enum CurveOracle.CurveRegistryType[]\",\"name\":\"_registryTypes\",\"type\":\"uint8[]\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"ConnectorShouldBeNone\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"PoolNotFound\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"PoolWithConnectorNotFound\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"MAX_POOLS\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"REGISTRIES_COUNT\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"srcToken\",\"type\":\"address\"},{\"internalType\":\"contract IERC20\",\"name\":\"dstToken\",\"type\":\"address\"},{\"internalType\":\"contract IERC20\",\"name\":\"connector\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"thresholdFilter\",\"type\":\"uint256\"}],\"name\":\"getRate\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"rate\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"weight\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"registries\",\"outputs\":[{\"internalType\":\"contract ICurveRegistry\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"registryTypes\",\"outputs\":[{\"internalType\":\"enum CurveOracle.CurveRegistryType\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/oracles/CurveOracle.sol\":\"CurveOracle\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":1000000},\"remappings\":[],\"viaIR\":true},\"sources\":{\"@openzeppelin/contracts/token/ERC20/ERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/ERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IERC20.sol\\\";\\nimport \\\"./extensions/IERC20Metadata.sol\\\";\\nimport \\\"../../utils/Context.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.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How\\n * to implement supply mechanisms].\\n *\\n * The default value of {decimals} is 18. To change this, you should override\\n * this function so it returns a different value.\\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 ERC20 is Context, IERC20, IERC20Metadata {\\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 * All two of these values are immutable: they can only be set once during\\n * construction.\\n */\\n constructor(string memory name_, string memory symbol_) {\\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 default value returned by this function, unless\\n * it's 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(address from, address to, uint256 amount) 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(address from, address to, uint256 amount) 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 // Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by\\n // decrementing then incrementing.\\n _balances[to] += amount;\\n }\\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 unchecked {\\n // Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above.\\n _balances[account] += amount;\\n }\\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 // Overflow not possible: amount <= accountBalance <= totalSupply.\\n _totalSupply -= amount;\\n }\\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(address owner, address spender, uint256 amount) 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(address owner, address spender, uint256 amount) 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(address from, address to, uint256 amount) 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(address from, address to, uint256 amount) internal virtual {}\\n}\\n\",\"keccak256\":\"0xa56ca923f70c1748830700250b19c61b70db9a683516dc5e216694a50445d99c\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.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(address from, address to, uint256 amount) external returns (bool);\\n}\\n\",\"keccak256\":\"0x287b55befed2961a7eabd7d7b1b2839cbca8a5b80ef8dcbb25ed3d4c2002c305\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.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 \\\"../IERC20.sol\\\";\\n\\n/**\\n * @dev Interface for the optional metadata functions from the ERC20 standard.\\n *\\n * _Available since v4.1._\\n */\\ninterface IERC20Metadata is IERC20 {\\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\":\"0x8de418a5503946cabe331f35fe242d3201a73f67f77aaeb7110acb1f30423aca\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\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 Context {\\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\",\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/math/Math.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/math/Math.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Standard math utilities missing in the Solidity language.\\n */\\nlibrary Math {\\n enum Rounding {\\n Down, // Toward negative infinity\\n Up, // Toward infinity\\n Zero // Toward zero\\n }\\n\\n /**\\n * @dev Returns the largest of two numbers.\\n */\\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a > b ? a : b;\\n }\\n\\n /**\\n * @dev Returns the smallest of two numbers.\\n */\\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a < b ? a : b;\\n }\\n\\n /**\\n * @dev Returns the average of two numbers. The result is rounded towards\\n * zero.\\n */\\n function average(uint256 a, uint256 b) internal pure returns (uint256) {\\n // (a + b) / 2 can overflow.\\n return (a & b) + (a ^ b) / 2;\\n }\\n\\n /**\\n * @dev Returns the ceiling of the division of two numbers.\\n *\\n * This differs from standard division with `/` in that it rounds up instead\\n * of rounding down.\\n */\\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\\n // (a + b - 1) / b can overflow on addition, so we distribute.\\n return a == 0 ? 0 : (a - 1) / b + 1;\\n }\\n\\n /**\\n * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\\n * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)\\n * with further edits by Uniswap Labs also under MIT license.\\n */\\n function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {\\n unchecked {\\n // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use\\n // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\\n // variables such that product = prod1 * 2^256 + prod0.\\n uint256 prod0; // Least significant 256 bits of the product\\n uint256 prod1; // Most significant 256 bits of the product\\n assembly {\\n let mm := mulmod(x, y, not(0))\\n prod0 := mul(x, y)\\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\\n }\\n\\n // Handle non-overflow cases, 256 by 256 division.\\n if (prod1 == 0) {\\n // Solidity will revert if denominator == 0, unlike the div opcode on its own.\\n // The surrounding unchecked block does not change this fact.\\n // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.\\n return prod0 / denominator;\\n }\\n\\n // Make sure the result is less than 2^256. Also prevents denominator == 0.\\n require(denominator > prod1, \\\"Math: mulDiv overflow\\\");\\n\\n ///////////////////////////////////////////////\\n // 512 by 256 division.\\n ///////////////////////////////////////////////\\n\\n // Make division exact by subtracting the remainder from [prod1 prod0].\\n uint256 remainder;\\n assembly {\\n // Compute remainder using mulmod.\\n remainder := mulmod(x, y, denominator)\\n\\n // Subtract 256 bit number from 512 bit number.\\n prod1 := sub(prod1, gt(remainder, prod0))\\n prod0 := sub(prod0, remainder)\\n }\\n\\n // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.\\n // See https://cs.stackexchange.com/q/138556/92363.\\n\\n // Does not overflow because the denominator cannot be zero at this stage in the function.\\n uint256 twos = denominator & (~denominator + 1);\\n assembly {\\n // Divide denominator by twos.\\n denominator := div(denominator, twos)\\n\\n // Divide [prod1 prod0] by twos.\\n prod0 := div(prod0, twos)\\n\\n // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.\\n twos := add(div(sub(0, twos), twos), 1)\\n }\\n\\n // Shift in bits from prod1 into prod0.\\n prod0 |= prod1 * twos;\\n\\n // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such\\n // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for\\n // four bits. That is, denominator * inv = 1 mod 2^4.\\n uint256 inverse = (3 * denominator) ^ 2;\\n\\n // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works\\n // in modular arithmetic, doubling the correct bits in each step.\\n inverse *= 2 - denominator * inverse; // inverse mod 2^8\\n inverse *= 2 - denominator * inverse; // inverse mod 2^16\\n inverse *= 2 - denominator * inverse; // inverse mod 2^32\\n inverse *= 2 - denominator * inverse; // inverse mod 2^64\\n inverse *= 2 - denominator * inverse; // inverse mod 2^128\\n inverse *= 2 - denominator * inverse; // inverse mod 2^256\\n\\n // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.\\n // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is\\n // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1\\n // is no longer required.\\n result = prod0 * inverse;\\n return result;\\n }\\n }\\n\\n /**\\n * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.\\n */\\n function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) {\\n uint256 result = mulDiv(x, y, denominator);\\n if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {\\n result += 1;\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.\\n *\\n * Inspired by Henry S. Warren, Jr.'s \\\"Hacker's Delight\\\" (Chapter 11).\\n */\\n function sqrt(uint256 a) internal pure returns (uint256) {\\n if (a == 0) {\\n return 0;\\n }\\n\\n // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.\\n //\\n // We know that the \\\"msb\\\" (most significant bit) of our target number `a` is a power of 2 such that we have\\n // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.\\n //\\n // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`\\n // \\u2192 `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`\\n // \\u2192 `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`\\n //\\n // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.\\n uint256 result = 1 << (log2(a) >> 1);\\n\\n // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,\\n // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at\\n // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision\\n // into the expected uint128 result.\\n unchecked {\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n return min(result, a / result);\\n }\\n }\\n\\n /**\\n * @notice Calculates sqrt(a), following the selected rounding direction.\\n */\\n function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = sqrt(a);\\n return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 2, rounded down, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log2(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >> 128 > 0) {\\n value >>= 128;\\n result += 128;\\n }\\n if (value >> 64 > 0) {\\n value >>= 64;\\n result += 64;\\n }\\n if (value >> 32 > 0) {\\n value >>= 32;\\n result += 32;\\n }\\n if (value >> 16 > 0) {\\n value >>= 16;\\n result += 16;\\n }\\n if (value >> 8 > 0) {\\n value >>= 8;\\n result += 8;\\n }\\n if (value >> 4 > 0) {\\n value >>= 4;\\n result += 4;\\n }\\n if (value >> 2 > 0) {\\n value >>= 2;\\n result += 2;\\n }\\n if (value >> 1 > 0) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 2, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log2(value);\\n return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 10, rounded down, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log10(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >= 10 ** 64) {\\n value /= 10 ** 64;\\n result += 64;\\n }\\n if (value >= 10 ** 32) {\\n value /= 10 ** 32;\\n result += 32;\\n }\\n if (value >= 10 ** 16) {\\n value /= 10 ** 16;\\n result += 16;\\n }\\n if (value >= 10 ** 8) {\\n value /= 10 ** 8;\\n result += 8;\\n }\\n if (value >= 10 ** 4) {\\n value /= 10 ** 4;\\n result += 4;\\n }\\n if (value >= 10 ** 2) {\\n value /= 10 ** 2;\\n result += 2;\\n }\\n if (value >= 10 ** 1) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log10(value);\\n return result + (rounding == Rounding.Up && 10 ** result < value ? 1 : 0);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 256, rounded down, of a positive value.\\n * Returns 0 if given 0.\\n *\\n * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.\\n */\\n function log256(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >> 128 > 0) {\\n value >>= 128;\\n result += 16;\\n }\\n if (value >> 64 > 0) {\\n value >>= 64;\\n result += 8;\\n }\\n if (value >> 32 > 0) {\\n value >>= 32;\\n result += 4;\\n }\\n if (value >> 16 > 0) {\\n value >>= 16;\\n result += 2;\\n }\\n if (value >> 8 > 0) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 256, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log256(value);\\n return result + (rounding == Rounding.Up && 1 << (result << 3) < value ? 1 : 0);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xe4455ac1eb7fc497bb7402579e7b4d64d928b846fce7d2b6fde06d366f21c2b3\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/math/SafeMath.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/math/SafeMath.sol)\\n\\npragma solidity ^0.8.0;\\n\\n// CAUTION\\n// This version of SafeMath should only be used with Solidity 0.8 or later,\\n// because it relies on the compiler's built in overflow checks.\\n\\n/**\\n * @dev Wrappers over Solidity's arithmetic operations.\\n *\\n * NOTE: `SafeMath` is generally not needed starting with Solidity 0.8, since the compiler\\n * now has built in overflow checking.\\n */\\nlibrary SafeMath {\\n /**\\n * @dev Returns the addition of two unsigned integers, with an overflow flag.\\n *\\n * _Available since v3.4._\\n */\\n function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n unchecked {\\n uint256 c = a + b;\\n if (c < a) return (false, 0);\\n return (true, c);\\n }\\n }\\n\\n /**\\n * @dev Returns the subtraction of two unsigned integers, with an overflow flag.\\n *\\n * _Available since v3.4._\\n */\\n function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n unchecked {\\n if (b > a) return (false, 0);\\n return (true, a - b);\\n }\\n }\\n\\n /**\\n * @dev Returns the multiplication of two unsigned integers, with an overflow flag.\\n *\\n * _Available since v3.4._\\n */\\n function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n unchecked {\\n // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\\n // benefit is lost if 'b' is also tested.\\n // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522\\n if (a == 0) return (true, 0);\\n uint256 c = a * b;\\n if (c / a != b) return (false, 0);\\n return (true, c);\\n }\\n }\\n\\n /**\\n * @dev Returns the division of two unsigned integers, with a division by zero flag.\\n *\\n * _Available since v3.4._\\n */\\n function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n unchecked {\\n if (b == 0) return (false, 0);\\n return (true, a / b);\\n }\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.\\n *\\n * _Available since v3.4._\\n */\\n function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n unchecked {\\n if (b == 0) return (false, 0);\\n return (true, a % b);\\n }\\n }\\n\\n /**\\n * @dev Returns the addition of two unsigned integers, reverting on\\n * overflow.\\n *\\n * Counterpart to Solidity's `+` operator.\\n *\\n * Requirements:\\n *\\n * - Addition cannot overflow.\\n */\\n function add(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a + b;\\n }\\n\\n /**\\n * @dev Returns the subtraction of two unsigned integers, reverting on\\n * overflow (when the result is negative).\\n *\\n * Counterpart to Solidity's `-` operator.\\n *\\n * Requirements:\\n *\\n * - Subtraction cannot overflow.\\n */\\n function sub(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a - b;\\n }\\n\\n /**\\n * @dev Returns the multiplication of two unsigned integers, reverting on\\n * overflow.\\n *\\n * Counterpart to Solidity's `*` operator.\\n *\\n * Requirements:\\n *\\n * - Multiplication cannot overflow.\\n */\\n function mul(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a * b;\\n }\\n\\n /**\\n * @dev Returns the integer division of two unsigned integers, reverting on\\n * division by zero. The result is rounded towards zero.\\n *\\n * Counterpart to Solidity's `/` operator.\\n *\\n * Requirements:\\n *\\n * - The divisor cannot be zero.\\n */\\n function div(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a / b;\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\\n * reverting when dividing by zero.\\n *\\n * Counterpart to Solidity's `%` operator. This function uses a `revert`\\n * opcode (which leaves remaining gas untouched) while Solidity uses an\\n * invalid opcode to revert (consuming all remaining gas).\\n *\\n * Requirements:\\n *\\n * - The divisor cannot be zero.\\n */\\n function mod(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a % b;\\n }\\n\\n /**\\n * @dev Returns the subtraction of two unsigned integers, reverting with custom message on\\n * overflow (when the result is negative).\\n *\\n * CAUTION: This function is deprecated because it requires allocating memory for the error\\n * message unnecessarily. For custom revert reasons use {trySub}.\\n *\\n * Counterpart to Solidity's `-` operator.\\n *\\n * Requirements:\\n *\\n * - Subtraction cannot overflow.\\n */\\n function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\\n unchecked {\\n require(b <= a, errorMessage);\\n return a - b;\\n }\\n }\\n\\n /**\\n * @dev Returns the integer division of two unsigned integers, reverting with custom message on\\n * division by zero. The result is rounded towards zero.\\n *\\n * Counterpart to Solidity's `/` operator. Note: this function uses a\\n * `revert` opcode (which leaves remaining gas untouched) while Solidity\\n * uses an invalid opcode to revert (consuming all remaining gas).\\n *\\n * Requirements:\\n *\\n * - The divisor cannot be zero.\\n */\\n function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\\n unchecked {\\n require(b > 0, errorMessage);\\n return a / b;\\n }\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\\n * reverting with custom message when dividing by zero.\\n *\\n * CAUTION: This function is deprecated because it requires allocating memory for the error\\n * message unnecessarily. For custom revert reasons use {tryMod}.\\n *\\n * Counterpart to Solidity's `%` operator. This function uses a `revert`\\n * opcode (which leaves remaining gas untouched) while Solidity uses an\\n * invalid opcode to revert (consuming all remaining gas).\\n *\\n * Requirements:\\n *\\n * - The divisor cannot be zero.\\n */\\n function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\\n unchecked {\\n require(b > 0, errorMessage);\\n return a % b;\\n }\\n }\\n}\\n\",\"keccak256\":\"0x58b21219689909c4f8339af00813760337f7e2e7f169a97fe49e2896dcfb3b9a\",\"license\":\"MIT\"},\"contracts/interfaces/ICurveProvider.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.19;\\n\\n// solhint-disable func-name-mixedcase\\n\\ninterface ICurveProvider {\\n function get_address (uint256 _id) external view returns (address);\\n}\\n\",\"keccak256\":\"0x05828fcb7d6a651368802eb3018a9d94f270fcb76cf2137e2121e0010517de65\",\"license\":\"MIT\"},\"contracts/interfaces/ICurveRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.19;\\n\\n// solhint-disable func-name-mixedcase\\n\\ninterface ICurveRegistry {\\n function pool_count() external view returns (uint256);\\n function pool_list(uint256 index) external view returns (address);\\n\\n // MAIN_REGISTRY, METAPOOL_FACTORY, CRYPTOSWAP_REGISTRY, CRYPTOPOOL_FACTORY, METAREGISTRY, CRVUSD_PLAIN_POOLS, CURVE_TRICRYPTO_FACTORY\\n function find_pool_for_coins(address _srcToken, address _dstToken, uint256 _index) external view returns (address);\\n\\n // MAIN_REGISTRY, METAPOOL_FACTORY, METAREGISTRY, CRVUSD_PLAIN_POOLS\\n function get_coin_indices(address _pool, address _srcToken, address _dstToken) external view returns (int128, int128, bool);\\n // CRYPTOSWAP_REGISTRY, CRYPTOPOOL_FACTORY, CURVE_TRICRYPTO_FACTORY - returns (uint256,uint256);\\n\\n // MAIN_REGISTRY, CRYPTOSWAP_REGISTRY, METAREGISTRY\\n function get_balances(address _pool) external view returns (uint256[8] memory);\\n // METAPOOL_FACTORY, CRVUSD_PLAIN_POOLS - returns (uint256[4]);\\n // CURVE_TRICRYPTO_FACTORY - returns (uint256[3]);\\n // CRYPTOPOOL_FACTORY - returns (uint256[2]);\\n\\n // MAIN_REGISTRY, METAPOOL_FACTORY, METAREGISTRY, CRVUSD_PLAIN_POOLS\\n function get_underlying_balances(address _pool) external view returns (uint256[8] memory);\\n // CRYPTOSWAP_REGISTRY, CRYPTOPOOL_FACTORY - NO METHOD\\n}\\n\",\"keccak256\":\"0x669f9ecc9735cae1c091245d7425b40de00fb1fd2289d273fe8baea1deba445b\",\"license\":\"MIT\"},\"contracts/interfaces/ICurveSwap.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.19;\\n\\n// solhint-disable func-name-mixedcase\\n\\ninterface ICurveSwapInt128 {\\n function get_dy(int128 _from, int128 _to, uint256 _amount) external view returns (uint256);\\n function get_dy_underlying(int128 _from, int128 _to, uint256 _amount) external view returns (uint256);\\n}\\n\\ninterface ICurveSwapUint256 {\\n function get_dy(uint256 _from, uint256 _to, uint256 _amount) external view returns (uint256);\\n function get_dy_underlying(uint256 _from, uint256 _to, uint256 _amount) external view returns (uint256);\\n}\\n\",\"keccak256\":\"0xb464805c570bd2bc605edf714df486a981f03e326d88ef80162d280d509d35c3\",\"license\":\"MIT\"},\"contracts/interfaces/IOracle.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.19;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\ninterface IOracle {\\n error ConnectorShouldBeNone();\\n error PoolNotFound();\\n error PoolWithConnectorNotFound();\\n\\n function getRate(IERC20 srcToken, IERC20 dstToken, IERC20 connector, uint256 thresholdFilter) external view returns (uint256 rate, uint256 weight);\\n}\\n\",\"keccak256\":\"0xd194baa5fd0dd28b8a3c1882d510519b9b679d096efb0302e1e779ff2cb7faab\",\"license\":\"MIT\"},\"contracts/libraries/OraclePrices.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.19;\\n\\nimport \\\"@openzeppelin/contracts/utils/math/SafeMath.sol\\\";\\n\\n/**\\n * @title OraclePrices\\n * @notice A library that provides functionalities for processing and analyzing token rate and weight data provided by an oracle.\\n * The library is used when an oracle uses multiple pools to determine a token's price.\\n * It allows to filter out pools with low weight and significantly incorrect price, which could distort the weighted price.\\n * The level of low-weight pool filtering can be managed using the thresholdFilter parameter.\\n */\\nlibrary OraclePrices {\\n using SafeMath for uint256;\\n\\n /**\\n * @title Oracle Price Data Structure\\n * @notice This structure encapsulates the rate and weight information for tokens as provided by an oracle\\n * @dev An array of OraclePrice structures can be used to represent oracle data for multiple pools\\n * @param rate The oracle-provided rate for a token\\n * @param weight The oracle-provided derived weight for a token\\n */\\n struct OraclePrice {\\n uint256 rate;\\n uint256 weight;\\n }\\n\\n /**\\n * @title Oracle Prices Data Structure\\n * @notice This structure encapsulates information about a list of oracles prices and weights\\n * @dev The structure is initialized with a maximum possible length by the `init` function\\n * @param oraclePrices An array of OraclePrice structures, each containing a rate and weight\\n * @param maxOracleWeight The maximum weight among the OraclePrice elements in the oraclePrices array\\n * @param size The number of meaningful OraclePrice elements added to the oraclePrices array\\n */\\n struct Data {\\n uint256 maxOracleWeight;\\n uint256 size;\\n OraclePrice[] oraclePrices;\\n }\\n\\n /**\\n * @notice Initializes an array of OraclePrices with a given maximum length and returns it wrapped inside a Data struct\\n * @dev Uses inline assembly for memory allocation to avoid array zeroing and extra array copy to struct\\n * @param maxArrLength The maximum length of the oraclePrices array\\n * @return data Returns an instance of Data struct containing an OraclePrice array with a specified maximum length\\n */\\n function init(uint256 maxArrLength) internal pure returns (Data memory data) {\\n assembly (\\\"memory-safe\\\") { // solhint-disable-line no-inline-assembly\\n data := mload(0x40)\\n mstore(0x40, add(data, add(0x80, mul(maxArrLength, 0x40))))\\n mstore(add(data, 0x00), 0)\\n mstore(add(data, 0x20), 0)\\n mstore(add(data, 0x40), add(data, 0x60))\\n mstore(add(data, 0x60), maxArrLength)\\n }\\n }\\n\\n /**\\n * @notice Appends an OraclePrice to the oraclePrices array in the provided Data struct if the OraclePrice has a non-zero weight\\n * @dev If the weight of the OraclePrice is greater than the current maxOracleWeight, the maxOracleWeight is updated. The size (number of meaningful elements) of the array is incremented after appending the OraclePrice.\\n * @param data The Data struct that contains the oraclePrices array, maxOracleWeight, and the current size\\n * @param oraclePrice The OraclePrice to be appended to the oraclePrices array\\n * @return isAppended A flag indicating whether the oraclePrice was appended or not\\n */\\n function append(Data memory data, OraclePrice memory oraclePrice) internal pure returns (bool isAppended) {\\n if (oraclePrice.weight > 0) {\\n data.oraclePrices[data.size] = oraclePrice;\\n data.size++;\\n if (oraclePrice.weight > data.maxOracleWeight) {\\n data.maxOracleWeight = oraclePrice.weight;\\n }\\n return true;\\n }\\n return false;\\n }\\n\\n /**\\n * @notice Calculates the weighted rate from the oracle prices data using a threshold filter\\n * @dev Shrinks the `oraclePrices` array to remove any unused space, though it's unclear how this optimizes the code, but it is. Then calculates the weighted rate\\n * considering only the oracle prices whose weight is above the threshold which is percent from max weight\\n * @param data The data structure containing oracle prices, the maximum oracle weight and the size of the used oracle prices array\\n * @param thresholdFilter The threshold to filter oracle prices based on their weight\\n * @return weightedRate The calculated weighted rate\\n * @return totalWeight The total weight of the oracle prices that passed the threshold\\n */\\n function getRateAndWeight(Data memory data, uint256 thresholdFilter) internal pure returns (uint256 weightedRate, uint256 totalWeight) {\\n // shrink oraclePrices array\\n uint256 size = data.size;\\n assembly (\\\"memory-safe\\\") { // solhint-disable-line no-inline-assembly\\n let ptr := mload(add(data, 64))\\n mstore(ptr, size)\\n }\\n\\n // calculate weighted rate\\n for (uint256 i = 0; i < size; i++) {\\n OraclePrice memory p = data.oraclePrices[i];\\n if (p.weight * 100 < data.maxOracleWeight * thresholdFilter) {\\n continue;\\n }\\n weightedRate += p.rate * p.weight;\\n totalWeight += p.weight;\\n }\\n if (totalWeight > 0) {\\n unchecked { weightedRate /= totalWeight; }\\n }\\n }\\n\\n /**\\n * @notice See `getRateAndWeight`. It uses SafeMath to prevent overflows.\\n */\\n function getRateAndWeightWithSafeMath(Data memory data, uint256 thresholdFilter) internal pure returns (uint256 weightedRate, uint256 totalWeight) {\\n // shrink oraclePrices array\\n uint256 size = data.size;\\n assembly (\\\"memory-safe\\\") { // solhint-disable-line no-inline-assembly\\n let ptr := mload(add(data, 64))\\n mstore(ptr, size)\\n }\\n\\n // calculate weighted rate\\n for (uint256 i = 0; i < size; i++) {\\n OraclePrice memory p = data.oraclePrices[i];\\n if (p.weight * 100 < data.maxOracleWeight * thresholdFilter) {\\n continue;\\n }\\n (bool ok, uint256 weightedRateI) = p.rate.tryMul(p.weight);\\n if (ok) {\\n (ok, weightedRate) = _tryAdd(weightedRate, weightedRateI);\\n if (ok) totalWeight += p.weight;\\n }\\n }\\n if (totalWeight > 0) {\\n unchecked { weightedRate /= totalWeight; }\\n }\\n }\\n\\n function _tryAdd(uint256 value, uint256 addition) private pure returns (bool, uint256) {\\n unchecked {\\n uint256 result = value + addition;\\n if (result < value) return (false, value);\\n return (true, result);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x14a4ca1d806e8a279ed6d77d19c75e6504d070e9f065ae71a49ceb05ec077466\",\"license\":\"MIT\"},\"contracts/oracles/CurveOracle.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.19;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/ERC20.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/math/Math.sol\\\";\\nimport \\\"../interfaces/IOracle.sol\\\";\\nimport \\\"../interfaces/ICurveProvider.sol\\\";\\nimport \\\"../interfaces/ICurveRegistry.sol\\\";\\nimport \\\"../interfaces/ICurveSwap.sol\\\";\\nimport \\\"../libraries/OraclePrices.sol\\\";\\n\\ncontract CurveOracle is IOracle {\\n using OraclePrices for OraclePrices.Data;\\n using Math for uint256;\\n\\n enum CurveRegistryType {\\n MAIN_REGISTRY,\\n METAPOOL_FACTORY,\\n CRYPTOSWAP_REGISTRY,\\n CRYPTOPOOL_FACTORY,\\n METAREGISTRY,\\n CRVUSD_PLAIN_POOLS,\\n CURVE_TRICRYPTO_FACTORY\\n }\\n\\n struct FunctionInfo {\\n bytes4 balanceFuncSelector;\\n bytes4 dyFuncInt128Selector;\\n function (uint256, uint256, uint256) external view returns (uint256) dyFuncUint256;\\n }\\n\\n IERC20 private constant _NONE = IERC20(0xFFfFfFffFFfffFFfFFfFFFFFffFFFffffFfFFFfF);\\n\\n uint256 public immutable MAX_POOLS;\\n uint256 public immutable REGISTRIES_COUNT;\\n ICurveRegistry[11] public registries;\\n CurveRegistryType[11] public registryTypes;\\n\\n constructor(ICurveProvider _addressProvider, uint256 _maxPools, uint256[] memory _registryIds, CurveRegistryType[] memory _registryTypes) {\\n MAX_POOLS = _maxPools;\\n REGISTRIES_COUNT = _registryIds.length;\\n unchecked {\\n for (uint256 i = 0; i < REGISTRIES_COUNT; i++) {\\n registries[i] = ICurveRegistry(_addressProvider.get_address(_registryIds[i]));\\n registryTypes[i] = _registryTypes[i];\\n }\\n }\\n }\\n\\n function getRate(IERC20 srcToken, IERC20 dstToken, IERC20 connector, uint256 thresholdFilter) external view override returns (uint256 rate, uint256 weight) {\\n if(connector != _NONE) revert ConnectorShouldBeNone();\\n\\n OraclePrices.Data memory ratesAndWeights = OraclePrices.init(MAX_POOLS);\\n FunctionInfo memory info;\\n uint256 index = 0;\\n for (uint256 i = 0; i < REGISTRIES_COUNT && index < MAX_POOLS; i++) {\\n uint256 registryIndex = 0;\\n address pool = registries[i].find_pool_for_coins(address(srcToken), address(dstToken), registryIndex);\\n while (pool != address(0) && index < MAX_POOLS) {\\n index++;\\n // call `get_coin_indices` and set (srcTokenIndex, dstTokenIndex, isUnderlying) variables\\n bool isUnderlying;\\n int128 srcTokenIndex;\\n int128 dstTokenIndex;\\n (bool success, bytes memory data) = address(registries[i]).staticcall(abi.encodeWithSelector(ICurveRegistry.get_coin_indices.selector, pool, address(srcToken), address(dstToken)));\\n if (success && data.length >= 64) {\\n if (\\n registryTypes[i] == CurveRegistryType.CRYPTOSWAP_REGISTRY ||\\n registryTypes[i] == CurveRegistryType.CRYPTOPOOL_FACTORY ||\\n registryTypes[i] == CurveRegistryType.CURVE_TRICRYPTO_FACTORY\\n ) {\\n (srcTokenIndex, dstTokenIndex) = abi.decode(data, (int128, int128));\\n } else {\\n // registryTypes[i] == CurveRegistryType.MAIN_REGISTRY ||\\n // registryTypes[i] == CurveRegistryType.METAPOOL_FACTORY ||\\n // registryTypes[i] == CurveRegistryType.METAREGISTRY ||\\n // registryTypes[i] == CurveRegistryType.CRVUSD_PLAIN_POOLS\\n (srcTokenIndex, dstTokenIndex, isUnderlying) = abi.decode(data, (int128, int128, bool));\\n }\\n } else {\\n pool = registries[i].find_pool_for_coins(address(srcToken), address(dstToken), ++registryIndex);\\n continue;\\n }\\n\\n if (!isUnderlying) {\\n info = FunctionInfo({\\n balanceFuncSelector: ICurveRegistry.get_balances.selector,\\n dyFuncInt128Selector: ICurveSwapInt128.get_dy.selector,\\n dyFuncUint256: ICurveSwapUint256(pool).get_dy\\n });\\n } else {\\n info = FunctionInfo({\\n balanceFuncSelector: ICurveRegistry.get_underlying_balances.selector,\\n dyFuncInt128Selector: ICurveSwapInt128.get_dy_underlying.selector,\\n dyFuncUint256: ICurveSwapUint256(pool).get_dy_underlying\\n });\\n }\\n\\n // call `balanceFunc` (`get_balances` or `get_underlying_balances`) and decode results\\n uint256[] memory balances;\\n (success, data) = address(registries[i]).staticcall(abi.encodeWithSelector(info.balanceFuncSelector, pool));\\n if (success && data.length >= 64) {\\n // registryTypes[i] == CurveRegistryType.MAIN_REGISTRY ||\\n // registryTypes[i] == CurveRegistryType.CRYPTOSWAP_REGISTRY ||\\n // registryTypes[i] == CurveRegistryType.METAREGISTRY\\n uint256 length = 8;\\n if (registryTypes[i] == CurveRegistryType.METAPOOL_FACTORY ||\\n registryTypes[i] == CurveRegistryType.CRVUSD_PLAIN_POOLS) {\\n length = 4;\\n } else if (registryTypes[i] == CurveRegistryType.CURVE_TRICRYPTO_FACTORY) {\\n length = 3;\\n } else if (registryTypes[i] == CurveRegistryType.CRYPTOPOOL_FACTORY) {\\n length = 2;\\n }\\n\\n assembly (\\\"memory-safe\\\") { // solhint-disable-line no-inline-assembly\\n balances := data\\n mstore(balances, length)\\n }\\n } else {\\n pool = registries[i].find_pool_for_coins(address(srcToken), address(dstToken), ++registryIndex);\\n continue;\\n }\\n\\n uint256 w = (balances[uint128(srcTokenIndex)] * balances[uint128(dstTokenIndex)]).sqrt();\\n uint256 b0 = balances[uint128(srcTokenIndex)] / 10000;\\n uint256 b1 = balances[uint128(dstTokenIndex)] / 10000;\\n\\n if (b0 != 0 && b1 != 0) {\\n (success, data) = pool.staticcall(abi.encodeWithSelector(info.dyFuncInt128Selector, srcTokenIndex, dstTokenIndex, b0));\\n if (success && data.length >= 32) { // vyper could return redundant bytes\\n b1 = abi.decode(data, (uint256));\\n } else {\\n b1 = info.dyFuncUint256(uint128(srcTokenIndex), uint128(dstTokenIndex), b0);\\n }\\n ratesAndWeights.append(OraclePrices.OraclePrice(Math.mulDiv(b1, 1e18, b0), w));\\n }\\n pool = registries[i].find_pool_for_coins(address(srcToken), address(dstToken), ++registryIndex);\\n }\\n }\\n (rate, weight) = ratesAndWeights.getRateAndWeight(thresholdFilter);\\n }\\n}\\n\",\"keccak256\":\"0xa44da4ca0e63f534b8b771834b4b75e3740b2ece5deedae7b53d6f4650571d19\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x60c0604081815234620002a357620015db8038038091620000218286620002b9565b8439820190608083830312620002a35782516001600160a01b03928382169291839003620002a357602085810151838701516001600160401b03969293929190878111620002a35788019683601f89011215620002a357875198620000868a620002f3565b986200009588519a8b620002b9565b8a8a52868a018760059c8d1b83010191878311620002a35788809101915b838310620002a857505050506060810151918211620002a357019280601f85011215620002a3578351620000e781620002f3565b94620000f688519687620002b9565b81865286808701928c1b820101928311620002a3578601905b828210620002895750505060805285519560a096875260005b875181101562000246576200013e81836200030b565b51865163124fd3dd60e21b815260049182820152602490878183818d5afa9081156200023b57600091620001f7575b5090600b9182851015620001e35784546001600160a01b0319169087161784556200019984886200030b565b51926007841015620001d05750509082916001938c1c0190815460f88460031b169160ff809116831b921b19161790550162000128565b602190634e487b7160e01b600052526000fd5b50634e487b7160e01b600090815260328452fd5b8881813d831162000233575b6200020f8183620002b9565b810103126200022f57519086821682036200022c5750386200016d565b80fd5b5080fd5b503d62000203565b89513d6000823e3d90fd5b8786516112a49182620003378339608051828181610121015281816102cb0152818161030a01528181610c760152610db20152518181816101d7015261034e0152f35b81516007811015620002a35781529086019086016200010f565b600080fd5b8251815291810191899101620000b3565b601f909101601f19168101906001600160401b03821190821017620002dd57604052565b634e487b7160e01b600052604160045260246000fd5b6001600160401b038111620002dd5760051b60200190565b8051821015620003205760209160051b010190565b634e487b7160e01b600052603260045260246000fdfe608080604052600436101561001357600080fd5b60003560e01c9081633d549b32146101fa5750806347400449146101a15780636347c9001461014457806381358498146100eb5763b72529f21461005657600080fd5b346100e65760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126100e657600435600b8110156100e65761009c60ff91610e00565b90549060031b1c1660405160078210156100b7576020918152f35b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b600080fd5b346100e65760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126100e65760206040517f00000000000000000000000000000000000000000000000000000000000000008152f35b346100e65760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126100e657600435600b8110156100e65773ffffffffffffffffffffffffffffffffffffffff6020915416604051908152f35b346100e65760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126100e65760206040517f00000000000000000000000000000000000000000000000000000000000000008152f35b346100e65760807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126100e6576004359073ffffffffffffffffffffffffffffffffffffffff821682036100e6576024359073ffffffffffffffffffffffffffffffffffffffff821682036100e65760443573ffffffffffffffffffffffffffffffffffffffff81168091036100e65773ffffffffffffffffffffffffffffffffffffffff03610dd857506060604080516102b681610e18565b600081526000602082015201526040519060807f000000000000000000000000000000000000000000000000000000000000000060061b8301016040526000825260006020830152606082018060408401527f0000000000000000000000000000000000000000000000000000000000000000905260006040805161033a81610e18565b82815282602082015201526000916000925b7f0000000000000000000000000000000000000000000000000000000000000000841080610daf575b15610cbb57600091600b85101591826107f15773ffffffffffffffffffffffffffffffffffffffff865416936040517f6982eb0b00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8916600482015273ffffffffffffffffffffffffffffffffffffffff8716602482015260006044820152602081606481895afa9081156107e557600091610c9c575b50915b73ffffffffffffffffffffffffffffffffffffffff8316151580610c73575b15610c5d5761044e90610e91565b91600090856107f1576000808b60405173ffffffffffffffffffffffffffffffffffffffff60208201927feb85226d000000000000000000000000000000000000000000000000000000008452818716602484015216604482015273ffffffffffffffffffffffffffffffffffffffff8c166064820152606481526104d281610e34565b51908a5afa6104df610eea565b9080610c51575b15610c41576104f48a610e00565b905490600760ff838360031b1c1610156100b75760031b1c60ff166002148015610c1c575b8015610bf7575b15610bba576040818051810103126100e65761054a604061054360208401610f48565b9201610f48565b90925b610b335760405161055d81610e18565b7f92e3cc2d0000000000000000000000000000000000000000000000000000000081527f5e0d443f00000000000000000000000000000000000000000000000000000000602082015263556d6e9f77ffffffffffffffffffffffffffffffffffffffff000000008460201b161760401b6040820152905b876107f1576000807fffffffff000000000000000000000000000000000000000000000000000000008451166040516020810191825273ffffffffffffffffffffffffffffffffffffffff871660248201526024815261063381610e18565b51908c5afa90610641610eea565b9180610b27575b15610a83576008946106598d610e00565b96905496600760ff898360031b1c1610156100b7578b978f9160031b1c60ff166001148015610a57575b156109f057505060045b83526106da6106d56106b16fffffffffffffffffffffffffffffffff841686610f56565b516106ce6fffffffffffffffffffffffffffffffff861687610f56565b5190610f6a565b6110c2565b9461271061071a816106fe6fffffffffffffffffffffffffffffffff861688610f56565b5104956fffffffffffffffffffffffffffffffff861690610f56565b510484151590816109e6575b50610820575b5050505050506107f15761073f90610e91565b6040517f6982eb0b00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff89811660048301528716602482015260448101829052909690602081606481895afa9081156107e5576000916107b6575b50915b969096610421565b6107d8915060203d6020116107de575b6107d08183610e50565b810190610ebe565b896107ab565b503d6107c6565b6040513d6000823e3d90fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b84959650600091929394907fffffffff00000000000000000000000000000000000000000000000000000000602084930151166040516020810191825286600f87810b60248401520b60448201528760648201526064815261088181610e34565b51915afa9361088e610eea565b94806109da575b15610928575050506020828051810103126100e65760206108b7920151610fb6565b60405180604081011067ffffffffffffffff6040830111176108f95786926108ed92604083016040528252602082015285611205565b5089808080808061072c565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60209294506fffffffffffffffffffffffffffffffff91604060649201518360405197889586947fffffffff000000000000000000000000000000000000000000000000000000008560a01b16865216600485015216602483015285604483015260601c5afa80156107e5576000906109a6575b6108b79250610fb6565b506020823d6020116109d2575b816109c060209383610e50565b810103126100e6576108b7915161099c565b3d91506109b3565b50602085511015610895565b9050151538610726565b60ff9197506109fe90610e00565b90549060031b1c169560078710156100b7578d60068c9814600014610a26575050600361068d565b60ff919750610a3490610e00565b90549060031b1c169560078710156100b75760038b970361068d5750600261068d565b5060ff919750610a6690610e00565b90549060031b1c169560078710156100b7578d60058c9814610683565b50505050509250610a95600093610e91565b6040517f6982eb0b00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff89811660048301528716602482015260448101829052909690602081606481895afa9081156107e557600091610b08575b50916107ae565b610b21915060203d6020116107de576107d08183610e50565b89610b01565b50604082511015610648565b604051610b3f81610e18565b7f59f4f3510000000000000000000000000000000000000000000000000000000081527f07211ef70000000000000000000000000000000000000000000000000000000060208201526385f11d1e77ffffffffffffffffffffffffffffffffffffffff000000008460201b161760401b6040820152906105d4565b91506060828051810103126100e657610bd560208301610f48565b6060610be360408501610f48565b93015180151581036100e65792909261054d565b5060ff610c038b610e00565b90549060031b1c1660078110156100b757600614610520565b5060ff610c288b610e00565b90549060031b1c1660078110156100b757600314610519565b5050509250610a95600093610e91565b506040815110156104e6565b9450505093610c6c9150610e91565b929061034c565b507f00000000000000000000000000000000000000000000000000000000000000008110610440565b610cb5915060203d6020116107de576107d08183610e50565b8961041e565b506000806020830151806040850151526000906064948535955b828410610d03576040868680610cf2575b82519182526020820152f35b9081610cfd91610f7d565b90610ce6565b90919293610d15856040850151610f56565b51956020870196875184810290808204861490151715610d8057610d3a8a8751610f6a565b11610d735791610d5d610d6592610d57610d6b95518b5190610f6a565b90611261565b975190611261565b94610e91565b929190610cd5565b50955093610d6b90610e91565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b507f00000000000000000000000000000000000000000000000000000000000000008110610375565b807fccf7e6f70000000000000000000000000000000000000000000000000000000060049252fd5b90600b8210156107f157601f8260051c600b01921690565b6060810190811067ffffffffffffffff8211176108f957604052565b60a0810190811067ffffffffffffffff8211176108f957604052565b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff8211176108f957604052565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8114610d805760010190565b908160209103126100e6575173ffffffffffffffffffffffffffffffffffffffff811681036100e65790565b3d15610f43573d9067ffffffffffffffff82116108f95760405191610f3760207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8401160184610e50565b82523d6000602084013e565b606090565b519081600f0b82036100e657565b80518210156107f15760209160051b010190565b81810292918115918404141715610d8057565b8115610f87570490565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b90670de0b6b3a7640000907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82840992828102928380861095039480860395146110b25784831115611054578291096001821901821680920460028082600302188083028203028083028203028083028203028083028203028083028203028092029003029360018380600003040190848311900302920304170290565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f4d6174683a206d756c446976206f766572666c6f7700000000000000000000006044820152fd5b5050906110bf9250610f7d565b90565b80156111ff5761118d816000908360801c806111f3575b508060401c806111e6575b508060201c806111d9575b508060101c806111cc575b508060081c806111bf575b508060041c806111b2575b508060021c806111a5575b50600191828092811c61119e575b1c1b6111358185610f7d565b01811c6111428185610f7d565b01811c61114f8185610f7d565b01811c61115c8185610f7d565b01811c6111698185610f7d565b01811c6111768185610f7d565b01811c6111838185610f7d565b01901c8092610f7d565b80821015611199575090565b905090565b0181611129565b600291509101903861111b565b6004915091019038611110565b6008915091019038611105565b60109150910190386110fa565b60209150910190386110ef565b60409150910190386110e4565b915050608090386110d9565b50600090565b906020810190815161121957505050600090565b61123a60408401519160208501928351916112348383610f56565b52610f56565b506112458151610e91565b9052519080518211611259575b5050600190565b523880611252565b91908201809211610d805756fea2646970667358221220f5314540e525730bbeb88f6e6d98cb0d8e875d6d9484fba195bbef2a1711ab2e64736f6c63430008130033", + "deployedBytecode": "0x608080604052600436101561001357600080fd5b60003560e01c9081633d549b32146101fa5750806347400449146101a15780636347c9001461014457806381358498146100eb5763b72529f21461005657600080fd5b346100e65760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126100e657600435600b8110156100e65761009c60ff91610e00565b90549060031b1c1660405160078210156100b7576020918152f35b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b600080fd5b346100e65760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126100e65760206040517f00000000000000000000000000000000000000000000000000000000000000008152f35b346100e65760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126100e657600435600b8110156100e65773ffffffffffffffffffffffffffffffffffffffff6020915416604051908152f35b346100e65760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126100e65760206040517f00000000000000000000000000000000000000000000000000000000000000008152f35b346100e65760807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126100e6576004359073ffffffffffffffffffffffffffffffffffffffff821682036100e6576024359073ffffffffffffffffffffffffffffffffffffffff821682036100e65760443573ffffffffffffffffffffffffffffffffffffffff81168091036100e65773ffffffffffffffffffffffffffffffffffffffff03610dd857506060604080516102b681610e18565b600081526000602082015201526040519060807f000000000000000000000000000000000000000000000000000000000000000060061b8301016040526000825260006020830152606082018060408401527f0000000000000000000000000000000000000000000000000000000000000000905260006040805161033a81610e18565b82815282602082015201526000916000925b7f0000000000000000000000000000000000000000000000000000000000000000841080610daf575b15610cbb57600091600b85101591826107f15773ffffffffffffffffffffffffffffffffffffffff865416936040517f6982eb0b00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8916600482015273ffffffffffffffffffffffffffffffffffffffff8716602482015260006044820152602081606481895afa9081156107e557600091610c9c575b50915b73ffffffffffffffffffffffffffffffffffffffff8316151580610c73575b15610c5d5761044e90610e91565b91600090856107f1576000808b60405173ffffffffffffffffffffffffffffffffffffffff60208201927feb85226d000000000000000000000000000000000000000000000000000000008452818716602484015216604482015273ffffffffffffffffffffffffffffffffffffffff8c166064820152606481526104d281610e34565b51908a5afa6104df610eea565b9080610c51575b15610c41576104f48a610e00565b905490600760ff838360031b1c1610156100b75760031b1c60ff166002148015610c1c575b8015610bf7575b15610bba576040818051810103126100e65761054a604061054360208401610f48565b9201610f48565b90925b610b335760405161055d81610e18565b7f92e3cc2d0000000000000000000000000000000000000000000000000000000081527f5e0d443f00000000000000000000000000000000000000000000000000000000602082015263556d6e9f77ffffffffffffffffffffffffffffffffffffffff000000008460201b161760401b6040820152905b876107f1576000807fffffffff000000000000000000000000000000000000000000000000000000008451166040516020810191825273ffffffffffffffffffffffffffffffffffffffff871660248201526024815261063381610e18565b51908c5afa90610641610eea565b9180610b27575b15610a83576008946106598d610e00565b96905496600760ff898360031b1c1610156100b7578b978f9160031b1c60ff166001148015610a57575b156109f057505060045b83526106da6106d56106b16fffffffffffffffffffffffffffffffff841686610f56565b516106ce6fffffffffffffffffffffffffffffffff861687610f56565b5190610f6a565b6110c2565b9461271061071a816106fe6fffffffffffffffffffffffffffffffff861688610f56565b5104956fffffffffffffffffffffffffffffffff861690610f56565b510484151590816109e6575b50610820575b5050505050506107f15761073f90610e91565b6040517f6982eb0b00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff89811660048301528716602482015260448101829052909690602081606481895afa9081156107e5576000916107b6575b50915b969096610421565b6107d8915060203d6020116107de575b6107d08183610e50565b810190610ebe565b896107ab565b503d6107c6565b6040513d6000823e3d90fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b84959650600091929394907fffffffff00000000000000000000000000000000000000000000000000000000602084930151166040516020810191825286600f87810b60248401520b60448201528760648201526064815261088181610e34565b51915afa9361088e610eea565b94806109da575b15610928575050506020828051810103126100e65760206108b7920151610fb6565b60405180604081011067ffffffffffffffff6040830111176108f95786926108ed92604083016040528252602082015285611205565b5089808080808061072c565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60209294506fffffffffffffffffffffffffffffffff91604060649201518360405197889586947fffffffff000000000000000000000000000000000000000000000000000000008560a01b16865216600485015216602483015285604483015260601c5afa80156107e5576000906109a6575b6108b79250610fb6565b506020823d6020116109d2575b816109c060209383610e50565b810103126100e6576108b7915161099c565b3d91506109b3565b50602085511015610895565b9050151538610726565b60ff9197506109fe90610e00565b90549060031b1c169560078710156100b7578d60068c9814600014610a26575050600361068d565b60ff919750610a3490610e00565b90549060031b1c169560078710156100b75760038b970361068d5750600261068d565b5060ff919750610a6690610e00565b90549060031b1c169560078710156100b7578d60058c9814610683565b50505050509250610a95600093610e91565b6040517f6982eb0b00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff89811660048301528716602482015260448101829052909690602081606481895afa9081156107e557600091610b08575b50916107ae565b610b21915060203d6020116107de576107d08183610e50565b89610b01565b50604082511015610648565b604051610b3f81610e18565b7f59f4f3510000000000000000000000000000000000000000000000000000000081527f07211ef70000000000000000000000000000000000000000000000000000000060208201526385f11d1e77ffffffffffffffffffffffffffffffffffffffff000000008460201b161760401b6040820152906105d4565b91506060828051810103126100e657610bd560208301610f48565b6060610be360408501610f48565b93015180151581036100e65792909261054d565b5060ff610c038b610e00565b90549060031b1c1660078110156100b757600614610520565b5060ff610c288b610e00565b90549060031b1c1660078110156100b757600314610519565b5050509250610a95600093610e91565b506040815110156104e6565b9450505093610c6c9150610e91565b929061034c565b507f00000000000000000000000000000000000000000000000000000000000000008110610440565b610cb5915060203d6020116107de576107d08183610e50565b8961041e565b506000806020830151806040850151526000906064948535955b828410610d03576040868680610cf2575b82519182526020820152f35b9081610cfd91610f7d565b90610ce6565b90919293610d15856040850151610f56565b51956020870196875184810290808204861490151715610d8057610d3a8a8751610f6a565b11610d735791610d5d610d6592610d57610d6b95518b5190610f6a565b90611261565b975190611261565b94610e91565b929190610cd5565b50955093610d6b90610e91565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b507f00000000000000000000000000000000000000000000000000000000000000008110610375565b807fccf7e6f70000000000000000000000000000000000000000000000000000000060049252fd5b90600b8210156107f157601f8260051c600b01921690565b6060810190811067ffffffffffffffff8211176108f957604052565b60a0810190811067ffffffffffffffff8211176108f957604052565b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff8211176108f957604052565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8114610d805760010190565b908160209103126100e6575173ffffffffffffffffffffffffffffffffffffffff811681036100e65790565b3d15610f43573d9067ffffffffffffffff82116108f95760405191610f3760207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8401160184610e50565b82523d6000602084013e565b606090565b519081600f0b82036100e657565b80518210156107f15760209160051b010190565b81810292918115918404141715610d8057565b8115610f87570490565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b90670de0b6b3a7640000907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82840992828102928380861095039480860395146110b25784831115611054578291096001821901821680920460028082600302188083028203028083028203028083028203028083028203028083028203028092029003029360018380600003040190848311900302920304170290565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f4d6174683a206d756c446976206f766572666c6f7700000000000000000000006044820152fd5b5050906110bf9250610f7d565b90565b80156111ff5761118d816000908360801c806111f3575b508060401c806111e6575b508060201c806111d9575b508060101c806111cc575b508060081c806111bf575b508060041c806111b2575b508060021c806111a5575b50600191828092811c61119e575b1c1b6111358185610f7d565b01811c6111428185610f7d565b01811c61114f8185610f7d565b01811c61115c8185610f7d565b01811c6111698185610f7d565b01811c6111768185610f7d565b01811c6111838185610f7d565b01901c8092610f7d565b80821015611199575090565b905090565b0181611129565b600291509101903861111b565b6004915091019038611110565b6008915091019038611105565b60109150910190386110fa565b60209150910190386110ef565b60409150910190386110e4565b915050608090386110d9565b50600090565b906020810190815161121957505050600090565b61123a60408401519160208501928351916112348383610f56565b52610f56565b506112458151610e91565b9052519080518211611259575b5050600190565b523880611252565b91908201809211610d805756fea2646970667358221220f5314540e525730bbeb88f6e6d98cb0d8e875d6d9484fba195bbef2a1711ab2e64736f6c63430008130033", "devdoc": { "kind": "dev", "methods": {}, @@ -169,25 +202,44 @@ "storageLayout": { "storage": [ { - "astId": 2740, + "astId": 2374, "contract": "contracts/oracles/CurveOracle.sol:CurveOracle", "label": "registries", "offset": 0, "slot": "0", - "type": "t_array(t_contract(ICurveRegistry)2276)11_storage" + "type": "t_array(t_contract(ICurveRegistry)1958)11_storage" + }, + { + "astId": 2379, + "contract": "contracts/oracles/CurveOracle.sol:CurveOracle", + "label": "registryTypes", + "offset": 0, + "slot": "11", + "type": "t_array(t_enum(CurveRegistryType)2342)11_storage" } ], "types": { - "t_array(t_contract(ICurveRegistry)2276)11_storage": { - "base": "t_contract(ICurveRegistry)2276", + "t_array(t_contract(ICurveRegistry)1958)11_storage": { + "base": "t_contract(ICurveRegistry)1958", "encoding": "inplace", "label": "contract ICurveRegistry[11]", "numberOfBytes": "352" }, - "t_contract(ICurveRegistry)2276": { + "t_array(t_enum(CurveRegistryType)2342)11_storage": { + "base": "t_enum(CurveRegistryType)2342", + "encoding": "inplace", + "label": "enum CurveOracle.CurveRegistryType[11]", + "numberOfBytes": "32" + }, + "t_contract(ICurveRegistry)1958": { "encoding": "inplace", "label": "contract ICurveRegistry", "numberOfBytes": "20" + }, + "t_enum(CurveRegistryType)2342": { + "encoding": "inplace", + "label": "enum CurveOracle.CurveRegistryType", + "numberOfBytes": "1" } } }