diff --git a/README.md b/README.md index 776a18e1..58263044 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,8 @@ If no direct liquidity pair exists between two tokens, the spot price aggregator * UniswapV3 - [0xE85B42805e046D1933EB8e1C543C4da4E5e8fFa3](https://etherscan.io/address/0xE85B42805e046D1933EB8e1C543C4da4E5e8fFa3) * Curve - [0xAD9393D581f1F4F91EED5B1C165eac8740A41f6E](https://etherscan.io/address/0xAD9393D581f1F4F91EED5B1C165eac8740A41f6E) * Pancake 3 - [0xB4039b37d09772801a51764537c167445f52F48b](https://etherscan.io/address/0xB4039b37d09772801a51764537c167445f52F48b) + * Dodo - [0x0A7c4d89e1629f189Eb12dd716B178d1b90D9f66](https://etherscan.io/address/0x0A7c4d89e1629f189Eb12dd716B178d1b90D9f66) + * DodoV2 - [0x03aA019F3B78110e030c34e9fA98047A1f62859A](https://etherscan.io/address/0x03aA019F3B78110e030c34e9fA98047A1f62859A) @@ -358,8 +360,8 @@ If no direct liquidity pair exists between two tokens, the spot price aggregator * WannaSwap - [0x7bdc6954e1c7869B4147A320d589689F628E9921](https://aurorascan.dev/address/0x7bdc6954e1c7869B4147A320d589689F628E9921) * NearPAD - [0x3E1Fe1Bd5a5560972bFa2D393b9aC18aF279fF56](https://aurorascan.dev/address/0x3E1Fe1Bd5a5560972bFa2D393b9aC18aF279fF56) * AuroraSwap - [0xd8C7661C2bA6E9732613C15780f9fBBD55d8bf9c](https://aurorascan.dev/address/0xd8C7661C2bA6E9732613C15780f9fBBD55d8bf9c) - * Dodo - [0x7dd73CADbDb285b30Cdb92A5572eff6331EED857](https://aurorascan.dev/address/0x7dd73CADbDb285b30Cdb92A5572eff6331EED857) - * DodoV2 - [0x1b947aF8b3dd6aa96F8726cd92c894D0Ba6367a3](https://aurorascan.dev/address/0x1b947aF8b3dd6aa96F8726cd92c894D0Ba6367a3) + * Dodo - [0x0A7c4d89e1629f189Eb12dd716B178d1b90D9f66](https://aurorascan.dev/address/0x0A7c4d89e1629f189Eb12dd716B178d1b90D9f66) + * DodoV2 - [0x03aA019F3B78110e030c34e9fA98047A1f62859A](https://aurorascan.dev/address/0x03aA019F3B78110e030c34e9fA98047A1f62859A) diff --git a/deployments/aurora/DodoOracle.json b/deployments/aurora/DodoOracle.json index 28a39213..0e617c3b 100644 --- a/deployments/aurora/DodoOracle.json +++ b/deployments/aurora/DodoOracle.json @@ -1,5 +1,5 @@ { - "address": "0x7dd73CADbDb285b30Cdb92A5572eff6331EED857", + "address": "0x0A7c4d89e1629f189Eb12dd716B178d1b90D9f66", "abi": [ { "inputs": [ @@ -80,18 +80,19 @@ "type": "function" } ], - "transactionHash": "0x8bd1e38be2d2447e5481742906f51e35f2a4db3d11d3bffc4e239b663bb4e214", + "transactionHash": "0xe0281db42a2f64f790314062734b3cb162fa2e43d51bbb5a85e1a91e480e703d", "receipt": { - "to": null, + "to": "0xD935a2bb926019E0ed6fb31fbD5b1Bbb7c05bf65", "from": "0x56E44874F624EbDE6efCc783eFD685f0FBDC6dcF", - "contractAddress": "0x7dd73CADbDb285b30Cdb92A5572eff6331EED857", + "contractAddress": null, "transactionIndex": 0, - "gasUsed": "521621", + "gasUsed": "568946", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0xf08874eca3f5b4cf606a3c9b12348921e367bae15b3597823830cf566c82be07", - "transactionHash": "0x8bd1e38be2d2447e5481742906f51e35f2a4db3d11d3bffc4e239b663bb4e214", + "blockHash": "0x86f5552d8f3cacda142d07ab6be000ea38a3a319415f3d7acb511b97889e26f3", + "transactionHash": "0xe0281db42a2f64f790314062734b3cb162fa2e43d51bbb5a85e1a91e480e703d", "logs": [], - "blockNumber": 100248166, + "events": [], + "blockNumber": 101319876, "cumulativeGasUsed": "0", "status": 1, "byzantium": true @@ -99,23 +100,7 @@ "args": [ "0xf50BDc9E90B7a1c138cb7935071b85c417C4cb8e" ], - "numDeployments": 1, - "solcInputHash": "fd1dd62bbe05f2095434872ea0a42332", - "metadata": "{\"compiler\":{\"version\":\"0.8.19+commit.7dd6d404\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"contract IDodoZoo\",\"name\":\"_dodoZoo\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"ConnectorShouldBeNone\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"PoolNotFound\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"PoolWithConnectorNotFound\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"FACTORY\",\"outputs\":[{\"internalType\":\"contract IDodoZoo\",\"name\":\"\",\"type\":\"address\"}],\"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\":\"\",\"type\":\"uint256\"}],\"name\":\"getRate\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"rate\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"weight\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/oracles/DodoOracle.sol\":\"DodoOracle\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":1000000},\"remappings\":[],\"viaIR\":true},\"sources\":{\"@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/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\"},\"contracts/interfaces/IDodo.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.19;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\n// solhint-disable private-vars-leading-underscore\\n// solhint-disable func-name-mixedcase\\n\\ninterface IDodo {\\n function _BASE_BALANCE_() external view returns (uint256);\\n function _QUOTE_BALANCE_() external view returns (uint256);\\n function getMidPrice() external view returns (uint256 midPrice);\\n}\\n\\ninterface IDVM {\\n function _BASE_RESERVE_() external view returns (uint256);\\n function _QUOTE_RESERVE_() external view returns (uint256);\\n function getMidPrice() external view returns (uint256 midPrice);\\n}\\n\",\"keccak256\":\"0x286c0a0b949560b7b8a05fa9b01d6a1389244f6bc39b817ba7c5c3e2a548e570\",\"license\":\"MIT\"},\"contracts/interfaces/IDodoFactories.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.19;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\ninterface IDodoZoo {\\n function getDODO(address baseToken, address quoteToken) external view returns (address);\\n}\\n\\ninterface IDVMFactory {\\n function getDODOPool(address baseToken, address quoteToken) external view returns (address[] memory machines);\\n}\\n\",\"keccak256\":\"0xf91de0b9373b48536733cfe098668bf2ad5ec3b3b6c9be5d52af13b1c05ecfed\",\"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/oracles/DodoOracle.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.19;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/math/Math.sol\\\";\\nimport \\\"../interfaces/IOracle.sol\\\";\\nimport \\\"../interfaces/IDodo.sol\\\";\\nimport \\\"../interfaces/IDodoFactories.sol\\\";\\n\\ncontract DodoOracle is IOracle {\\n using Math for uint256;\\n\\n IDodoZoo public immutable FACTORY; // dodoZoo\\n IERC20 private constant _NONE = IERC20(0xFFfFfFffFFfffFFfFFfFFFFFffFFFffffFfFFFfF);\\n IDodo private constant _ZERO_DODO = IDodo(0x0000000000000000000000000000000000000000);\\n\\n constructor(IDodoZoo _dodoZoo) {\\n FACTORY = _dodoZoo;\\n }\\n\\n function getRate(IERC20 srcToken, IERC20 dstToken, IERC20 connector, uint256 /*thresholdFilter*/) external view override returns (uint256 rate, uint256 weight) {\\n uint256 balanceSrc;\\n uint256 balanceDst;\\n if (connector == _NONE) {\\n (rate, balanceSrc, balanceDst) = _getDodoInfo(address(srcToken), address(dstToken));\\n weight = (balanceSrc * balanceDst).sqrt();\\n } else {\\n uint256 balanceConnector0;\\n uint256 balanceConnector1;\\n uint256 rateSrcConnector;\\n uint256 rateConnectorDst;\\n (rateSrcConnector, balanceSrc, balanceConnector0) = _getDodoInfo(address(srcToken), address(connector));\\n (rateConnectorDst, balanceConnector1, balanceDst) = _getDodoInfo(address(connector), address(dstToken));\\n weight = Math.min(balanceSrc * balanceConnector0, balanceDst * balanceConnector1).sqrt();\\n rate = Math.mulDiv(rateSrcConnector, rateConnectorDst, 1e18);\\n }\\n }\\n\\n function _getDodoInfo(address srcToken, address dstToken) internal view returns (uint256 rate, uint256 balanceSrc, uint256 balanceDst) {\\n IDodo dodo = IDodo(FACTORY.getDODO(srcToken, dstToken));\\n bool isSrcBase = (dodo != _ZERO_DODO);\\n if (!isSrcBase) dodo = IDodo(FACTORY.getDODO(dstToken, srcToken));\\n if(dodo == _ZERO_DODO) revert PoolNotFound();\\n\\n uint256 price = dodo.getMidPrice();\\n rate = isSrcBase ? price : 1e36 / price;\\n uint256 b0 = dodo._BASE_BALANCE_();\\n uint256 b1 = dodo._QUOTE_BALANCE_();\\n (balanceSrc, balanceDst) = isSrcBase ? (b0, b1) : (b1, b0);\\n }\\n}\\n\",\"keccak256\":\"0x4759601e68c6fc9d4f8e2d23dd390deca2287ccb14d25dc9287a8fdaac5f2b7b\",\"license\":\"MIT\"}},\"version\":1}", + "numDeployments": 2, "bytecode": "0x60a03461007157601f61090d38819003918201601f19168301916001600160401b038311848410176100765780849260209460405283398101031261007157516001600160a01b038116810361007157608052604051610880908161008d823960805181818161018301526105560152f35b600080fd5b634e487b7160e01b600052604160045260246000fdfe608080604052600436101561001357600080fd5b600090813560e01c9081632dd31000146101395750633d549b321461003757600080fd5b346101365760807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610136576004359073ffffffffffffffffffffffffffffffffffffffff918281168091036101325760243591838316809303610136576044358481168091036101325760409481036100da5750506100c06100c9926100ce926104f6565b909391936101a7565b610312565b82519182526020820152f35b6101096100ff9261010f836100f561011f95610125986104f6565b97919990926104f6565b95919790926101a7565b936101a7565b90508082101561012b5750610312565b92610222565b906100ce565b9050610312565b5080fd5b80fd5b90503461013257817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101325760209073ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000168152f35b818102929181159184041417156101ba57565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b81156101f3570490565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8183098183029182808310920391808303921461030157670de0b6b3a764000090828211156102a3577faccb18165bd6fe31ae1cf318dc5b51eee0e1ba569b88cd74c1773b91fac10669940990828211900360ee1b910360121c170290565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f4d6174683a206d756c446976206f766572666c6f7700000000000000000000006044820152fd5b5050670de0b6b3a764000091500490565b801561044f576103dd816000908360801c80610443575b508060401c80610436575b508060201c80610429575b508060101c8061041c575b508060081c8061040f575b508060041c80610402575b508060021c806103f5575b50600191828092811c6103ee575b1c1b61038581856101e9565b01811c61039281856101e9565b01811c61039f81856101e9565b01811c6103ac81856101e9565b01811c6103b981856101e9565b01811c6103c681856101e9565b01811c6103d381856101e9565b01901c80926101e9565b808210156103e9575090565b905090565b0181610379565b600291509101903861036b565b6004915091019038610360565b6008915091019038610355565b601091509101903861034a565b602091509101903861033f565b6040915091019038610334565b91505060809038610329565b50600090565b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff82111761049657604052565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b908160209103126104f1575173ffffffffffffffffffffffffffffffffffffffff811681036104f15790565b600080fd5b604080517f1273b0c60000000000000000000000000000000000000000000000000000000080825273ffffffffffffffffffffffffffffffffffffffff8481166004808501919091528682166024850152602097969495909492939192917f00000000000000000000000000000000000000000000000000000000000000008416908981604481855afa90811561083f578a9392918691600091610822575b50169384159687159761079c575b5050505050169182156107755783517fee27c68900000000000000000000000000000000000000000000000000000000815286818381875afa90811561076a5760009161073d575b50600083156106f457505b958451937feab5d20e00000000000000000000000000000000000000000000000000000000855281858481845afa9485156106e9576000956106ba575b5081908651938480927f7c9b8e890000000000000000000000000000000000000000000000000000000082525afa9485156106b0575060009461067f575b50501561067b5791565b9091565b8181959293953d83116106a9575b6106978183610455565b81010312610136575051913880610671565b503d61068d565b513d6000823e3d90fd5b90948282813d83116106e2575b6106d18183610455565b810103126101365750519381610633565b503d6106c7565b86513d6000823e3d90fd5b811561071157506ec097ce7bc90715b34b9f1000000000046105f6565b806012847f4e487b71000000000000000000000000000000000000000000000000000000006024945252fd5b908782813d8311610763575b6107538183610455565b81010312610136575051386105eb565b503d610749565b85513d6000823e3d90fd5b83517f76ecffc0000000000000000000000000000000000000000000000000000000008152fd5b895190815273ffffffffffffffffffffffffffffffffffffffff918216898201908152939091166020840152935083918290819060400103915afa90811561076a579082916000916107f5575b501686388080806105a3565b6108159150883d8a1161081b575b61080d8183610455565b8101906104c5565b386107e9565b503d610803565b6108399150853d871161081b5761080d8183610455565b38610595565b88513d6000823e3d90fdfea26469706673582212209dcb64c52f608d0534f7592400e99fa230eb8c3da0bb7d58055611d5f60493f264736f6c63430008130033", - "deployedBytecode": "0x608080604052600436101561001357600080fd5b600090813560e01c9081632dd31000146101395750633d549b321461003757600080fd5b346101365760807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610136576004359073ffffffffffffffffffffffffffffffffffffffff918281168091036101325760243591838316809303610136576044358481168091036101325760409481036100da5750506100c06100c9926100ce926104f6565b909391936101a7565b610312565b82519182526020820152f35b6101096100ff9261010f836100f561011f95610125986104f6565b97919990926104f6565b95919790926101a7565b936101a7565b90508082101561012b5750610312565b92610222565b906100ce565b9050610312565b5080fd5b80fd5b90503461013257817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101325760209073ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000168152f35b818102929181159184041417156101ba57565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b81156101f3570490565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8183098183029182808310920391808303921461030157670de0b6b3a764000090828211156102a3577faccb18165bd6fe31ae1cf318dc5b51eee0e1ba569b88cd74c1773b91fac10669940990828211900360ee1b910360121c170290565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f4d6174683a206d756c446976206f766572666c6f7700000000000000000000006044820152fd5b5050670de0b6b3a764000091500490565b801561044f576103dd816000908360801c80610443575b508060401c80610436575b508060201c80610429575b508060101c8061041c575b508060081c8061040f575b508060041c80610402575b508060021c806103f5575b50600191828092811c6103ee575b1c1b61038581856101e9565b01811c61039281856101e9565b01811c61039f81856101e9565b01811c6103ac81856101e9565b01811c6103b981856101e9565b01811c6103c681856101e9565b01811c6103d381856101e9565b01901c80926101e9565b808210156103e9575090565b905090565b0181610379565b600291509101903861036b565b6004915091019038610360565b6008915091019038610355565b601091509101903861034a565b602091509101903861033f565b6040915091019038610334565b91505060809038610329565b50600090565b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff82111761049657604052565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b908160209103126104f1575173ffffffffffffffffffffffffffffffffffffffff811681036104f15790565b600080fd5b604080517f1273b0c60000000000000000000000000000000000000000000000000000000080825273ffffffffffffffffffffffffffffffffffffffff8481166004808501919091528682166024850152602097969495909492939192917f00000000000000000000000000000000000000000000000000000000000000008416908981604481855afa90811561083f578a9392918691600091610822575b50169384159687159761079c575b5050505050169182156107755783517fee27c68900000000000000000000000000000000000000000000000000000000815286818381875afa90811561076a5760009161073d575b50600083156106f457505b958451937feab5d20e00000000000000000000000000000000000000000000000000000000855281858481845afa9485156106e9576000956106ba575b5081908651938480927f7c9b8e890000000000000000000000000000000000000000000000000000000082525afa9485156106b0575060009461067f575b50501561067b5791565b9091565b8181959293953d83116106a9575b6106978183610455565b81010312610136575051913880610671565b503d61068d565b513d6000823e3d90fd5b90948282813d83116106e2575b6106d18183610455565b810103126101365750519381610633565b503d6106c7565b86513d6000823e3d90fd5b811561071157506ec097ce7bc90715b34b9f1000000000046105f6565b806012847f4e487b71000000000000000000000000000000000000000000000000000000006024945252fd5b908782813d8311610763575b6107538183610455565b81010312610136575051386105eb565b503d610749565b85513d6000823e3d90fd5b83517f76ecffc0000000000000000000000000000000000000000000000000000000008152fd5b895190815273ffffffffffffffffffffffffffffffffffffffff918216898201908152939091166020840152935083918290819060400103915afa90811561076a579082916000916107f5575b501686388080806105a3565b6108159150883d8a1161081b575b61080d8183610455565b8101906104c5565b386107e9565b503d610803565b6108399150853d871161081b5761080d8183610455565b38610595565b88513d6000823e3d90fdfea26469706673582212209dcb64c52f608d0534f7592400e99fa230eb8c3da0bb7d58055611d5f60493f264736f6c63430008130033", - "devdoc": { - "kind": "dev", - "methods": {}, - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": {}, - "version": 1 - }, - "storageLayout": { - "storage": [], - "types": null - } + "deployedBytecode": "0x608080604052600436101561001357600080fd5b600090813560e01c9081632dd31000146101395750633d549b321461003757600080fd5b346101365760807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610136576004359073ffffffffffffffffffffffffffffffffffffffff918281168091036101325760243591838316809303610136576044358481168091036101325760409481036100da5750506100c06100c9926100ce926104f6565b909391936101a7565b610312565b82519182526020820152f35b6101096100ff9261010f836100f561011f95610125986104f6565b97919990926104f6565b95919790926101a7565b936101a7565b90508082101561012b5750610312565b92610222565b906100ce565b9050610312565b5080fd5b80fd5b90503461013257817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101325760209073ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000168152f35b818102929181159184041417156101ba57565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b81156101f3570490565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8183098183029182808310920391808303921461030157670de0b6b3a764000090828211156102a3577faccb18165bd6fe31ae1cf318dc5b51eee0e1ba569b88cd74c1773b91fac10669940990828211900360ee1b910360121c170290565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f4d6174683a206d756c446976206f766572666c6f7700000000000000000000006044820152fd5b5050670de0b6b3a764000091500490565b801561044f576103dd816000908360801c80610443575b508060401c80610436575b508060201c80610429575b508060101c8061041c575b508060081c8061040f575b508060041c80610402575b508060021c806103f5575b50600191828092811c6103ee575b1c1b61038581856101e9565b01811c61039281856101e9565b01811c61039f81856101e9565b01811c6103ac81856101e9565b01811c6103b981856101e9565b01811c6103c681856101e9565b01811c6103d381856101e9565b01901c80926101e9565b808210156103e9575090565b905090565b0181610379565b600291509101903861036b565b6004915091019038610360565b6008915091019038610355565b601091509101903861034a565b602091509101903861033f565b6040915091019038610334565b91505060809038610329565b50600090565b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff82111761049657604052565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b908160209103126104f1575173ffffffffffffffffffffffffffffffffffffffff811681036104f15790565b600080fd5b604080517f1273b0c60000000000000000000000000000000000000000000000000000000080825273ffffffffffffffffffffffffffffffffffffffff8481166004808501919091528682166024850152602097969495909492939192917f00000000000000000000000000000000000000000000000000000000000000008416908981604481855afa90811561083f578a9392918691600091610822575b50169384159687159761079c575b5050505050169182156107755783517fee27c68900000000000000000000000000000000000000000000000000000000815286818381875afa90811561076a5760009161073d575b50600083156106f457505b958451937feab5d20e00000000000000000000000000000000000000000000000000000000855281858481845afa9485156106e9576000956106ba575b5081908651938480927f7c9b8e890000000000000000000000000000000000000000000000000000000082525afa9485156106b0575060009461067f575b50501561067b5791565b9091565b8181959293953d83116106a9575b6106978183610455565b81010312610136575051913880610671565b503d61068d565b513d6000823e3d90fd5b90948282813d83116106e2575b6106d18183610455565b810103126101365750519381610633565b503d6106c7565b86513d6000823e3d90fd5b811561071157506ec097ce7bc90715b34b9f1000000000046105f6565b806012847f4e487b71000000000000000000000000000000000000000000000000000000006024945252fd5b908782813d8311610763575b6107538183610455565b81010312610136575051386105eb565b503d610749565b85513d6000823e3d90fd5b83517f76ecffc0000000000000000000000000000000000000000000000000000000008152fd5b895190815273ffffffffffffffffffffffffffffffffffffffff918216898201908152939091166020840152935083918290819060400103915afa90811561076a579082916000916107f5575b501686388080806105a3565b6108159150883d8a1161081b575b61080d8183610455565b8101906104c5565b386107e9565b503d610803565b6108399150853d871161081b5761080d8183610455565b38610595565b88513d6000823e3d90fdfea26469706673582212209dcb64c52f608d0534f7592400e99fa230eb8c3da0bb7d58055611d5f60493f264736f6c63430008130033" } \ No newline at end of file diff --git a/deployments/aurora/DodoV2Oracle.json b/deployments/aurora/DodoV2Oracle.json index d723c3f2..edb9da09 100644 --- a/deployments/aurora/DodoV2Oracle.json +++ b/deployments/aurora/DodoV2Oracle.json @@ -1,5 +1,5 @@ { - "address": "0x1b947aF8b3dd6aa96F8726cd92c894D0Ba6367a3", + "address": "0x03aA019F3B78110e030c34e9fA98047A1f62859A", "abi": [ { "inputs": [ @@ -80,18 +80,19 @@ "type": "function" } ], - "transactionHash": "0xdd3c3807a64b6858da120998908fe173abdf3e93c6377a78b09bbddd2759a72c", + "transactionHash": "0x55b0da8590dc4ce7698c504a7572b1722643dfd0a493a66976320994d74f2124", "receipt": { - "to": null, + "to": "0xD935a2bb926019E0ed6fb31fbD5b1Bbb7c05bf65", "from": "0x56E44874F624EbDE6efCc783eFD685f0FBDC6dcF", - "contractAddress": "0x1b947aF8b3dd6aa96F8726cd92c894D0Ba6367a3", + "contractAddress": null, "transactionIndex": 0, - "gasUsed": "776187", + "gasUsed": "824002", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x6af7094f5f2bfda44afe08f53e1405164d5324d2e4f17b86826a59bbffac50cd", - "transactionHash": "0xdd3c3807a64b6858da120998908fe173abdf3e93c6377a78b09bbddd2759a72c", + "blockHash": "0xd077811d4bda41c6c5f2d667a6fb939ead3ce7ca0f87c60b7ea75744be134b72", + "transactionHash": "0x55b0da8590dc4ce7698c504a7572b1722643dfd0a493a66976320994d74f2124", "logs": [], - "blockNumber": 100248255, + "events": [], + "blockNumber": 101320170, "cumulativeGasUsed": "0", "status": 1, "byzantium": true @@ -99,23 +100,7 @@ "args": [ "0x5515363c0412AdD5c72d3E302fE1bD7dCBCF93Fe" ], - "numDeployments": 1, - "solcInputHash": "fd1dd62bbe05f2095434872ea0a42332", - "metadata": "{\"compiler\":{\"version\":\"0.8.19+commit.7dd6d404\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"contract IDVMFactory\",\"name\":\"_DVMFactory\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"ConnectorShouldBeNone\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"PoolNotFound\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"PoolWithConnectorNotFound\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"FACTORY\",\"outputs\":[{\"internalType\":\"contract IDVMFactory\",\"name\":\"\",\"type\":\"address\"}],\"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\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/oracles/DodoV2Oracle.sol\":\"DodoV2Oracle\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":1000000},\"remappings\":[],\"viaIR\":true},\"sources\":{\"@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/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/IDodo.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.19;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\n// solhint-disable private-vars-leading-underscore\\n// solhint-disable func-name-mixedcase\\n\\ninterface IDodo {\\n function _BASE_BALANCE_() external view returns (uint256);\\n function _QUOTE_BALANCE_() external view returns (uint256);\\n function getMidPrice() external view returns (uint256 midPrice);\\n}\\n\\ninterface IDVM {\\n function _BASE_RESERVE_() external view returns (uint256);\\n function _QUOTE_RESERVE_() external view returns (uint256);\\n function getMidPrice() external view returns (uint256 midPrice);\\n}\\n\",\"keccak256\":\"0x286c0a0b949560b7b8a05fa9b01d6a1389244f6bc39b817ba7c5c3e2a548e570\",\"license\":\"MIT\"},\"contracts/interfaces/IDodoFactories.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.19;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\ninterface IDodoZoo {\\n function getDODO(address baseToken, address quoteToken) external view returns (address);\\n}\\n\\ninterface IDVMFactory {\\n function getDODOPool(address baseToken, address quoteToken) external view returns (address[] memory machines);\\n}\\n\",\"keccak256\":\"0xf91de0b9373b48536733cfe098668bf2ad5ec3b3b6c9be5d52af13b1c05ecfed\",\"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/DodoV2Oracle.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.19;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/math/Math.sol\\\";\\nimport \\\"../interfaces/IDodo.sol\\\";\\nimport \\\"../interfaces/IDodoFactories.sol\\\";\\nimport \\\"../interfaces/IOracle.sol\\\";\\nimport \\\"../libraries/OraclePrices.sol\\\";\\n\\n// solhint-disable var-name-mixedcase\\n\\ncontract DodoV2Oracle is IOracle {\\n using OraclePrices for OraclePrices.Data;\\n using Math for uint256;\\n\\n IDVMFactory public immutable FACTORY; // DVMFactory\\n IERC20 private constant _NONE = IERC20(0xFFfFfFffFFfffFFfFFfFFFFFffFFFffffFfFFFfF);\\n\\n constructor(IDVMFactory _DVMFactory) {\\n FACTORY = _DVMFactory;\\n }\\n\\n function getRate(IERC20 srcToken, IERC20 dstToken, IERC20 connector, uint256 thresholdFilter) external view override returns (uint256 rate, uint256 weight) {\\n OraclePrices.Data memory ratesAndWeights;\\n if (connector == _NONE) {\\n (address[] memory machines, bool isSrcBase) = _getMachines(address(srcToken), address(dstToken));\\n ratesAndWeights = OraclePrices.init(machines.length);\\n for (uint256 i = 0; i < machines.length; i++) {\\n IDVM dvm = IDVM(machines[i]);\\n (uint256 r, uint256 b0, uint256 b1) = _getDodoInfo(dvm, isSrcBase);\\n ratesAndWeights.append(OraclePrices.OraclePrice(r, (b0 * b1).sqrt()));\\n }\\n } else {\\n (address[] memory machines0, bool isSrcBase0) = _getMachines(address(srcToken), address(connector));\\n (address[] memory machines1, bool isSrcBase1) = _getMachines(address(connector), address(dstToken));\\n ratesAndWeights = OraclePrices.init(machines0.length * machines1.length);\\n for (uint256 i = 0; i < machines0.length; i++) {\\n (uint256 r0, uint256 b0, uint256 bc0) = _getDodoInfo(IDVM(machines0[i]), isSrcBase0);\\n if (b0 == 0 || bc0 == 0) {\\n continue;\\n }\\n for (uint256 j = 0; j < machines1.length; j++) {\\n (uint256 r1, uint256 bc1, uint256 b1) = _getDodoInfo(IDVM(machines1[j]), isSrcBase1);\\n if (b1 == 0 || bc1 == 0) {\\n continue;\\n }\\n uint256 w = Math.min(b0 * bc0, b1 * bc1).sqrt();\\n ratesAndWeights.append(OraclePrices.OraclePrice(Math.mulDiv(r0, r1, 1e18), w));\\n }\\n }\\n }\\n return ratesAndWeights.getRateAndWeight(thresholdFilter);\\n }\\n\\n function _getMachines(address srcToken, address dstToken) internal view returns (address[] memory machines, bool isSrcBase) {\\n machines = FACTORY.getDODOPool(srcToken, dstToken);\\n isSrcBase = (machines.length != 0);\\n if (!isSrcBase) machines = FACTORY.getDODOPool(dstToken, srcToken);\\n if(machines.length == 0) revert PoolNotFound();\\n }\\n\\n function _getDodoInfo(IDVM dvm, bool isSrcBase) internal view returns (uint256 rate, uint256 balanceSrc, uint256 balanceDst) {\\n uint256 b0 = dvm._BASE_RESERVE_();\\n uint256 b1 = dvm._QUOTE_RESERVE_();\\n if (b0 != 0 && b1 != 0) {\\n uint256 price = dvm.getMidPrice();\\n rate += isSrcBase ? price : 1e36 / price;\\n (balanceSrc, balanceDst) = isSrcBase ? (b0, b1) : (b1, b0);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xcd223bad12b2e835b789a1b01f6e709e5418fe89b1793323d14d6ae88f2e90df\",\"license\":\"MIT\"}},\"version\":1}", + "numDeployments": 2, "bytecode": "0x60a03461007157601f610da938819003918201601f19168301916001600160401b038311848410176100765780849260209460405283398101031261007157516001600160a01b038116810361007157608052604051610d1c908161008d823960805181818161040301526109990152f35b600080fd5b634e487b7160e01b600052604160045260246000fdfe60806040908082526004908136101561001757600080fd5b600090813560e01c9081632dd31000146103b95750633d549b321461003b57600080fd5b346103b65760807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126103b657813573ffffffffffffffffffffffffffffffffffffffff8082168092036103b2576024918235908282168092036103ae57604435918383168093036103aa576064918235936100b76104b7565b508086036102395750906100ca91610940565b9490926100d78451610807565b96805b8a865182101561013a579061012f610111610135936101166101088d8d610101888f610558565b5116610ac2565b909491946104e9565b6106c4565b9051916101228361042b565b825260208201528b610839565b5061052b565b6100da565b50939796509450925090505b8295839560209586810151938a8201968588515280975b868910610189578c8c8c8c81610178575b8351928352820152f35b91816101839161059b565b9161016e565b90919293949596979961019d8b8351610558565b519b8a8d019c8d51888102908082048a149015171561020e576101c18c89516104e9565b1161020157916101e66101ee928f6101e0906101f496519051906104e9565b90610895565b9d5190610895565b9a61052b565b979695949392919061015d565b509b50996101f49061052b565b868660118c7f4e487b7100000000000000000000000000000000000000000000000000000000835252fd5b939895969197949061024e8561025692610940565b999095610940565b9961026c61026787518451906104e9565b610807565b96849a5b87518c101561039257908161028c8e93878f610101908d610558565b9d8e829b929c939c15908115610389575b5061037357895b885181101561034c578f908f918f928f938f948f958f968f8e61032a996101018a6102ce94610558565b9093919281158015610344575b610336576102fc610312956102f661012f9b61030c966104e9565b936104e9565b90508082101561032f57506106c4565b926105d4565b92519261031e8461042b565b83526020830152610839565b6102a4565b90506106c4565b50505050505050505061052b565b5084156102db565b50959450959850959850959a509a6103639061052b565b9a90919994969396959295610270565b959450959850959850959a509a6103639061052b565b9050158f61029d565b50949950959796995050509150949392919091610146565b8580fd5b8480fd5b8280fd5b80fd5b90503461042757817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126104275760209073ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000168152f35b5080fd5b6040810190811067ffffffffffffffff82111761044757604052565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff82111761044757604052565b604051906060820182811067ffffffffffffffff82111761044757604052606060408360008152600060208201520152565b818102929181159184041417156104fc57565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81146104fc5760010190565b805182101561056c5760209160051b010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b81156105a5570490565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff818309818302918280831092039180830392146106b357670de0b6b3a76400009082821115610655577faccb18165bd6fe31ae1cf318dc5b51eee0e1ba569b88cd74c1773b91fac10669940990828211900360ee1b910360121c170290565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f4d6174683a206d756c446976206f766572666c6f7700000000000000000000006044820152fd5b5050670de0b6b3a764000091500490565b80156108015761078f816000908360801c806107f5575b508060401c806107e8575b508060201c806107db575b508060101c806107ce575b508060081c806107c1575b508060041c806107b4575b508060021c806107a7575b50600191828092811c6107a0575b1c1b610737818561059b565b01811c610744818561059b565b01811c610751818561059b565b01811c61075e818561059b565b01811c61076b818561059b565b01811c610778818561059b565b01811c610785818561059b565b01901c809261059b565b8082101561079b575090565b905090565b018161072b565b600291509101903861071d565b6004915091019038610712565b6008915091019038610707565b60109150910190386106fc565b60209150910190386106f1565b60409150910190386106e6565b915050608090386106db565b50600090565b906108106104b7565b506040519160808160061b84010160405260008352600060208401526060830180604085015252565b906020810190815161084d57505050600090565b61086e60408401519160208501928351916108688383610558565b52610558565b50610879815161052b565b905251908051821161088d575b5050600190565b523880610886565b919082018092116104fc57565b90602090818382031261093b57825167ffffffffffffffff9384821161093b570181601f8201121561093b578051938411610447578360051b90604051946108ec85840187610476565b8552838086019282010192831161093b578301905b82821061090f575050505090565b815173ffffffffffffffffffffffffffffffffffffffff8116810361093b578152908301908301610901565b600080fd5b6040517f57a281dc0000000000000000000000000000000000000000000000000000000080825273ffffffffffffffffffffffffffffffffffffffff8381166004840152848116602484015291949093909260009290917f0000000000000000000000000000000000000000000000000000000000000000909116908387604481855afa968715610ab7578497610a9b575b5086511595861596610a17575b50505050508251156109ed57565b60046040517f76ecffc0000000000000000000000000000000000000000000000000000000008152fd5b60405190815273ffffffffffffffffffffffffffffffffffffffff91821660048201529216602483015292945090918290829060449082905afa918215610a8f578092610a6c575b50509138808080806109df565b610a8892503d8091833e610a808183610476565b8101906108a2565b3880610a5f565b604051903d90823e3d90fd5b610ab09197503d8086833e610a808183610476565b95386109d2565b6040513d86823e3d90fd5b6000926000809373ffffffffffffffffffffffffffffffffffffffff829416906040908151917f7d72150400000000000000000000000000000000000000000000000000000000835260208084600481885afa938415610cdc578694610cad575b508151947fbbf5ce780000000000000000000000000000000000000000000000000000000086528186600481845afa958615610ca3578796610c70575b5084151580610c67575b610b78575b50505050505050565b909295995060049396985081839295985051938480927fee27c6890000000000000000000000000000000000000000000000000000000082525afa928315610c5e57508792610c30575b50508115610be7575b945015610be257905b909138808080808080610b6f565b610bd4565b8015610c03576ec097ce7bc90715b34b9f100000000004610bcb565b6024867f4e487b710000000000000000000000000000000000000000000000000000000081526012600452fd5b90809250813d8311610c57575b610c478183610476565b810103126103aa57513880610bc2565b503d610c3d565b513d89823e3d90fd5b50851515610b6a565b9095508181813d8311610c9c575b610c888183610476565b81010312610c9857519438610b60565b8680fd5b503d610c7e565b83513d89823e3d90fd5b9080945081813d8311610cd5575b610cc58183610476565b810103126103aa57519238610b23565b503d610cbb565b82513d88823e3d90fdfea26469706673582212200b538e770906f153cf3b5bb782d51e6433ee8e1b8f6cd316ebe6194f5928e04f64736f6c63430008130033", - "deployedBytecode": "0x60806040908082526004908136101561001757600080fd5b600090813560e01c9081632dd31000146103b95750633d549b321461003b57600080fd5b346103b65760807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126103b657813573ffffffffffffffffffffffffffffffffffffffff8082168092036103b2576024918235908282168092036103ae57604435918383168093036103aa576064918235936100b76104b7565b508086036102395750906100ca91610940565b9490926100d78451610807565b96805b8a865182101561013a579061012f610111610135936101166101088d8d610101888f610558565b5116610ac2565b909491946104e9565b6106c4565b9051916101228361042b565b825260208201528b610839565b5061052b565b6100da565b50939796509450925090505b8295839560209586810151938a8201968588515280975b868910610189578c8c8c8c81610178575b8351928352820152f35b91816101839161059b565b9161016e565b90919293949596979961019d8b8351610558565b519b8a8d019c8d51888102908082048a149015171561020e576101c18c89516104e9565b1161020157916101e66101ee928f6101e0906101f496519051906104e9565b90610895565b9d5190610895565b9a61052b565b979695949392919061015d565b509b50996101f49061052b565b868660118c7f4e487b7100000000000000000000000000000000000000000000000000000000835252fd5b939895969197949061024e8561025692610940565b999095610940565b9961026c61026787518451906104e9565b610807565b96849a5b87518c101561039257908161028c8e93878f610101908d610558565b9d8e829b929c939c15908115610389575b5061037357895b885181101561034c578f908f918f928f938f948f958f968f8e61032a996101018a6102ce94610558565b9093919281158015610344575b610336576102fc610312956102f661012f9b61030c966104e9565b936104e9565b90508082101561032f57506106c4565b926105d4565b92519261031e8461042b565b83526020830152610839565b6102a4565b90506106c4565b50505050505050505061052b565b5084156102db565b50959450959850959850959a509a6103639061052b565b9a90919994969396959295610270565b959450959850959850959a509a6103639061052b565b9050158f61029d565b50949950959796995050509150949392919091610146565b8580fd5b8480fd5b8280fd5b80fd5b90503461042757817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126104275760209073ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000168152f35b5080fd5b6040810190811067ffffffffffffffff82111761044757604052565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff82111761044757604052565b604051906060820182811067ffffffffffffffff82111761044757604052606060408360008152600060208201520152565b818102929181159184041417156104fc57565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81146104fc5760010190565b805182101561056c5760209160051b010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b81156105a5570490565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff818309818302918280831092039180830392146106b357670de0b6b3a76400009082821115610655577faccb18165bd6fe31ae1cf318dc5b51eee0e1ba569b88cd74c1773b91fac10669940990828211900360ee1b910360121c170290565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f4d6174683a206d756c446976206f766572666c6f7700000000000000000000006044820152fd5b5050670de0b6b3a764000091500490565b80156108015761078f816000908360801c806107f5575b508060401c806107e8575b508060201c806107db575b508060101c806107ce575b508060081c806107c1575b508060041c806107b4575b508060021c806107a7575b50600191828092811c6107a0575b1c1b610737818561059b565b01811c610744818561059b565b01811c610751818561059b565b01811c61075e818561059b565b01811c61076b818561059b565b01811c610778818561059b565b01811c610785818561059b565b01901c809261059b565b8082101561079b575090565b905090565b018161072b565b600291509101903861071d565b6004915091019038610712565b6008915091019038610707565b60109150910190386106fc565b60209150910190386106f1565b60409150910190386106e6565b915050608090386106db565b50600090565b906108106104b7565b506040519160808160061b84010160405260008352600060208401526060830180604085015252565b906020810190815161084d57505050600090565b61086e60408401519160208501928351916108688383610558565b52610558565b50610879815161052b565b905251908051821161088d575b5050600190565b523880610886565b919082018092116104fc57565b90602090818382031261093b57825167ffffffffffffffff9384821161093b570181601f8201121561093b578051938411610447578360051b90604051946108ec85840187610476565b8552838086019282010192831161093b578301905b82821061090f575050505090565b815173ffffffffffffffffffffffffffffffffffffffff8116810361093b578152908301908301610901565b600080fd5b6040517f57a281dc0000000000000000000000000000000000000000000000000000000080825273ffffffffffffffffffffffffffffffffffffffff8381166004840152848116602484015291949093909260009290917f0000000000000000000000000000000000000000000000000000000000000000909116908387604481855afa968715610ab7578497610a9b575b5086511595861596610a17575b50505050508251156109ed57565b60046040517f76ecffc0000000000000000000000000000000000000000000000000000000008152fd5b60405190815273ffffffffffffffffffffffffffffffffffffffff91821660048201529216602483015292945090918290829060449082905afa918215610a8f578092610a6c575b50509138808080806109df565b610a8892503d8091833e610a808183610476565b8101906108a2565b3880610a5f565b604051903d90823e3d90fd5b610ab09197503d8086833e610a808183610476565b95386109d2565b6040513d86823e3d90fd5b6000926000809373ffffffffffffffffffffffffffffffffffffffff829416906040908151917f7d72150400000000000000000000000000000000000000000000000000000000835260208084600481885afa938415610cdc578694610cad575b508151947fbbf5ce780000000000000000000000000000000000000000000000000000000086528186600481845afa958615610ca3578796610c70575b5084151580610c67575b610b78575b50505050505050565b909295995060049396985081839295985051938480927fee27c6890000000000000000000000000000000000000000000000000000000082525afa928315610c5e57508792610c30575b50508115610be7575b945015610be257905b909138808080808080610b6f565b610bd4565b8015610c03576ec097ce7bc90715b34b9f100000000004610bcb565b6024867f4e487b710000000000000000000000000000000000000000000000000000000081526012600452fd5b90809250813d8311610c57575b610c478183610476565b810103126103aa57513880610bc2565b503d610c3d565b513d89823e3d90fd5b50851515610b6a565b9095508181813d8311610c9c575b610c888183610476565b81010312610c9857519438610b60565b8680fd5b503d610c7e565b83513d89823e3d90fd5b9080945081813d8311610cd5575b610cc58183610476565b810103126103aa57519238610b23565b503d610cbb565b82513d88823e3d90fdfea26469706673582212200b538e770906f153cf3b5bb782d51e6433ee8e1b8f6cd316ebe6194f5928e04f64736f6c63430008130033", - "devdoc": { - "kind": "dev", - "methods": {}, - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": {}, - "version": 1 - }, - "storageLayout": { - "storage": [], - "types": null - } + "deployedBytecode": "0x60806040908082526004908136101561001757600080fd5b600090813560e01c9081632dd31000146103b95750633d549b321461003b57600080fd5b346103b65760807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126103b657813573ffffffffffffffffffffffffffffffffffffffff8082168092036103b2576024918235908282168092036103ae57604435918383168093036103aa576064918235936100b76104b7565b508086036102395750906100ca91610940565b9490926100d78451610807565b96805b8a865182101561013a579061012f610111610135936101166101088d8d610101888f610558565b5116610ac2565b909491946104e9565b6106c4565b9051916101228361042b565b825260208201528b610839565b5061052b565b6100da565b50939796509450925090505b8295839560209586810151938a8201968588515280975b868910610189578c8c8c8c81610178575b8351928352820152f35b91816101839161059b565b9161016e565b90919293949596979961019d8b8351610558565b519b8a8d019c8d51888102908082048a149015171561020e576101c18c89516104e9565b1161020157916101e66101ee928f6101e0906101f496519051906104e9565b90610895565b9d5190610895565b9a61052b565b979695949392919061015d565b509b50996101f49061052b565b868660118c7f4e487b7100000000000000000000000000000000000000000000000000000000835252fd5b939895969197949061024e8561025692610940565b999095610940565b9961026c61026787518451906104e9565b610807565b96849a5b87518c101561039257908161028c8e93878f610101908d610558565b9d8e829b929c939c15908115610389575b5061037357895b885181101561034c578f908f918f928f938f948f958f968f8e61032a996101018a6102ce94610558565b9093919281158015610344575b610336576102fc610312956102f661012f9b61030c966104e9565b936104e9565b90508082101561032f57506106c4565b926105d4565b92519261031e8461042b565b83526020830152610839565b6102a4565b90506106c4565b50505050505050505061052b565b5084156102db565b50959450959850959850959a509a6103639061052b565b9a90919994969396959295610270565b959450959850959850959a509a6103639061052b565b9050158f61029d565b50949950959796995050509150949392919091610146565b8580fd5b8480fd5b8280fd5b80fd5b90503461042757817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126104275760209073ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000168152f35b5080fd5b6040810190811067ffffffffffffffff82111761044757604052565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff82111761044757604052565b604051906060820182811067ffffffffffffffff82111761044757604052606060408360008152600060208201520152565b818102929181159184041417156104fc57565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81146104fc5760010190565b805182101561056c5760209160051b010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b81156105a5570490565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff818309818302918280831092039180830392146106b357670de0b6b3a76400009082821115610655577faccb18165bd6fe31ae1cf318dc5b51eee0e1ba569b88cd74c1773b91fac10669940990828211900360ee1b910360121c170290565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f4d6174683a206d756c446976206f766572666c6f7700000000000000000000006044820152fd5b5050670de0b6b3a764000091500490565b80156108015761078f816000908360801c806107f5575b508060401c806107e8575b508060201c806107db575b508060101c806107ce575b508060081c806107c1575b508060041c806107b4575b508060021c806107a7575b50600191828092811c6107a0575b1c1b610737818561059b565b01811c610744818561059b565b01811c610751818561059b565b01811c61075e818561059b565b01811c61076b818561059b565b01811c610778818561059b565b01811c610785818561059b565b01901c809261059b565b8082101561079b575090565b905090565b018161072b565b600291509101903861071d565b6004915091019038610712565b6008915091019038610707565b60109150910190386106fc565b60209150910190386106f1565b60409150910190386106e6565b915050608090386106db565b50600090565b906108106104b7565b506040519160808160061b84010160405260008352600060208401526060830180604085015252565b906020810190815161084d57505050600090565b61086e60408401519160208501928351916108688383610558565b52610558565b50610879815161052b565b905251908051821161088d575b5050600190565b523880610886565b919082018092116104fc57565b90602090818382031261093b57825167ffffffffffffffff9384821161093b570181601f8201121561093b578051938411610447578360051b90604051946108ec85840187610476565b8552838086019282010192831161093b578301905b82821061090f575050505090565b815173ffffffffffffffffffffffffffffffffffffffff8116810361093b578152908301908301610901565b600080fd5b6040517f57a281dc0000000000000000000000000000000000000000000000000000000080825273ffffffffffffffffffffffffffffffffffffffff8381166004840152848116602484015291949093909260009290917f0000000000000000000000000000000000000000000000000000000000000000909116908387604481855afa968715610ab7578497610a9b575b5086511595861596610a17575b50505050508251156109ed57565b60046040517f76ecffc0000000000000000000000000000000000000000000000000000000008152fd5b60405190815273ffffffffffffffffffffffffffffffffffffffff91821660048201529216602483015292945090918290829060449082905afa918215610a8f578092610a6c575b50509138808080806109df565b610a8892503d8091833e610a808183610476565b8101906108a2565b3880610a5f565b604051903d90823e3d90fd5b610ab09197503d8086833e610a808183610476565b95386109d2565b6040513d86823e3d90fd5b6000926000809373ffffffffffffffffffffffffffffffffffffffff829416906040908151917f7d72150400000000000000000000000000000000000000000000000000000000835260208084600481885afa938415610cdc578694610cad575b508151947fbbf5ce780000000000000000000000000000000000000000000000000000000086528186600481845afa958615610ca3578796610c70575b5084151580610c67575b610b78575b50505050505050565b909295995060049396985081839295985051938480927fee27c6890000000000000000000000000000000000000000000000000000000082525afa928315610c5e57508792610c30575b50508115610be7575b945015610be257905b909138808080808080610b6f565b610bd4565b8015610c03576ec097ce7bc90715b34b9f100000000004610bcb565b6024867f4e487b710000000000000000000000000000000000000000000000000000000081526012600452fd5b90809250813d8311610c57575b610c478183610476565b810103126103aa57513880610bc2565b503d610c3d565b513d89823e3d90fd5b50851515610b6a565b9095508181813d8311610c9c575b610c888183610476565b81010312610c9857519438610b60565b8680fd5b503d610c7e565b83513d89823e3d90fd5b9080945081813d8311610cd5575b610cc58183610476565b810103126103aa57519238610b23565b503d610cbb565b82513d88823e3d90fdfea26469706673582212200b538e770906f153cf3b5bb782d51e6433ee8e1b8f6cd316ebe6194f5928e04f64736f6c63430008130033" } \ No newline at end of file diff --git a/deployments/mainnet/DodoOracle.json b/deployments/mainnet/DodoOracle.json new file mode 100644 index 00000000..7d3b3937 --- /dev/null +++ b/deployments/mainnet/DodoOracle.json @@ -0,0 +1,106 @@ +{ + "address": "0x0A7c4d89e1629f189Eb12dd716B178d1b90D9f66", + "abi": [ + { + "inputs": [ + { + "internalType": "contract IDodoZoo", + "name": "_dodoZoo", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "name": "ConnectorShouldBeNone", + "type": "error" + }, + { + "inputs": [], + "name": "PoolNotFound", + "type": "error" + }, + { + "inputs": [], + "name": "PoolWithConnectorNotFound", + "type": "error" + }, + { + "inputs": [], + "name": "FACTORY", + "outputs": [ + { + "internalType": "contract IDodoZoo", + "name": "", + "type": "address" + } + ], + "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": "", + "type": "uint256" + } + ], + "name": "getRate", + "outputs": [ + { + "internalType": "uint256", + "name": "rate", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "weight", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + } + ], + "transactionHash": "0x96824b2165372d29d8576416e1ce5953396c05336218a11c17e282b4a9cfd938", + "receipt": { + "to": "0xD935a2bb926019E0ed6fb31fbD5b1Bbb7c05bf65", + "from": "0x56E44874F624EbDE6efCc783eFD685f0FBDC6dcF", + "contractAddress": null, + "transactionIndex": 69, + "gasUsed": "568946", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x2b624d5a736d6044122085ff6f43f43f97e0e1b9160c4d0e1214a612d53fbe99", + "transactionHash": "0x96824b2165372d29d8576416e1ce5953396c05336218a11c17e282b4a9cfd938", + "logs": [], + "events": [], + "blockNumber": 18155022, + "cumulativeGasUsed": "16605543", + "status": 1, + "byzantium": true + }, + "args": [ + "0x3a97247df274a17c59a3bd12735ea3fcdfb49950" + ], + "numDeployments": 1, + "bytecode": "0x60a03461007157601f61090d38819003918201601f19168301916001600160401b038311848410176100765780849260209460405283398101031261007157516001600160a01b038116810361007157608052604051610880908161008d823960805181818161018301526105560152f35b600080fd5b634e487b7160e01b600052604160045260246000fdfe608080604052600436101561001357600080fd5b600090813560e01c9081632dd31000146101395750633d549b321461003757600080fd5b346101365760807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610136576004359073ffffffffffffffffffffffffffffffffffffffff918281168091036101325760243591838316809303610136576044358481168091036101325760409481036100da5750506100c06100c9926100ce926104f6565b909391936101a7565b610312565b82519182526020820152f35b6101096100ff9261010f836100f561011f95610125986104f6565b97919990926104f6565b95919790926101a7565b936101a7565b90508082101561012b5750610312565b92610222565b906100ce565b9050610312565b5080fd5b80fd5b90503461013257817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101325760209073ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000168152f35b818102929181159184041417156101ba57565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b81156101f3570490565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8183098183029182808310920391808303921461030157670de0b6b3a764000090828211156102a3577faccb18165bd6fe31ae1cf318dc5b51eee0e1ba569b88cd74c1773b91fac10669940990828211900360ee1b910360121c170290565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f4d6174683a206d756c446976206f766572666c6f7700000000000000000000006044820152fd5b5050670de0b6b3a764000091500490565b801561044f576103dd816000908360801c80610443575b508060401c80610436575b508060201c80610429575b508060101c8061041c575b508060081c8061040f575b508060041c80610402575b508060021c806103f5575b50600191828092811c6103ee575b1c1b61038581856101e9565b01811c61039281856101e9565b01811c61039f81856101e9565b01811c6103ac81856101e9565b01811c6103b981856101e9565b01811c6103c681856101e9565b01811c6103d381856101e9565b01901c80926101e9565b808210156103e9575090565b905090565b0181610379565b600291509101903861036b565b6004915091019038610360565b6008915091019038610355565b601091509101903861034a565b602091509101903861033f565b6040915091019038610334565b91505060809038610329565b50600090565b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff82111761049657604052565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b908160209103126104f1575173ffffffffffffffffffffffffffffffffffffffff811681036104f15790565b600080fd5b604080517f1273b0c60000000000000000000000000000000000000000000000000000000080825273ffffffffffffffffffffffffffffffffffffffff8481166004808501919091528682166024850152602097969495909492939192917f00000000000000000000000000000000000000000000000000000000000000008416908981604481855afa90811561083f578a9392918691600091610822575b50169384159687159761079c575b5050505050169182156107755783517fee27c68900000000000000000000000000000000000000000000000000000000815286818381875afa90811561076a5760009161073d575b50600083156106f457505b958451937feab5d20e00000000000000000000000000000000000000000000000000000000855281858481845afa9485156106e9576000956106ba575b5081908651938480927f7c9b8e890000000000000000000000000000000000000000000000000000000082525afa9485156106b0575060009461067f575b50501561067b5791565b9091565b8181959293953d83116106a9575b6106978183610455565b81010312610136575051913880610671565b503d61068d565b513d6000823e3d90fd5b90948282813d83116106e2575b6106d18183610455565b810103126101365750519381610633565b503d6106c7565b86513d6000823e3d90fd5b811561071157506ec097ce7bc90715b34b9f1000000000046105f6565b806012847f4e487b71000000000000000000000000000000000000000000000000000000006024945252fd5b908782813d8311610763575b6107538183610455565b81010312610136575051386105eb565b503d610749565b85513d6000823e3d90fd5b83517f76ecffc0000000000000000000000000000000000000000000000000000000008152fd5b895190815273ffffffffffffffffffffffffffffffffffffffff918216898201908152939091166020840152935083918290819060400103915afa90811561076a579082916000916107f5575b501686388080806105a3565b6108159150883d8a1161081b575b61080d8183610455565b8101906104c5565b386107e9565b503d610803565b6108399150853d871161081b5761080d8183610455565b38610595565b88513d6000823e3d90fdfea26469706673582212209dcb64c52f608d0534f7592400e99fa230eb8c3da0bb7d58055611d5f60493f264736f6c63430008130033", + "deployedBytecode": "0x608080604052600436101561001357600080fd5b600090813560e01c9081632dd31000146101395750633d549b321461003757600080fd5b346101365760807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610136576004359073ffffffffffffffffffffffffffffffffffffffff918281168091036101325760243591838316809303610136576044358481168091036101325760409481036100da5750506100c06100c9926100ce926104f6565b909391936101a7565b610312565b82519182526020820152f35b6101096100ff9261010f836100f561011f95610125986104f6565b97919990926104f6565b95919790926101a7565b936101a7565b90508082101561012b5750610312565b92610222565b906100ce565b9050610312565b5080fd5b80fd5b90503461013257817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101325760209073ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000168152f35b818102929181159184041417156101ba57565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b81156101f3570490565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8183098183029182808310920391808303921461030157670de0b6b3a764000090828211156102a3577faccb18165bd6fe31ae1cf318dc5b51eee0e1ba569b88cd74c1773b91fac10669940990828211900360ee1b910360121c170290565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f4d6174683a206d756c446976206f766572666c6f7700000000000000000000006044820152fd5b5050670de0b6b3a764000091500490565b801561044f576103dd816000908360801c80610443575b508060401c80610436575b508060201c80610429575b508060101c8061041c575b508060081c8061040f575b508060041c80610402575b508060021c806103f5575b50600191828092811c6103ee575b1c1b61038581856101e9565b01811c61039281856101e9565b01811c61039f81856101e9565b01811c6103ac81856101e9565b01811c6103b981856101e9565b01811c6103c681856101e9565b01811c6103d381856101e9565b01901c80926101e9565b808210156103e9575090565b905090565b0181610379565b600291509101903861036b565b6004915091019038610360565b6008915091019038610355565b601091509101903861034a565b602091509101903861033f565b6040915091019038610334565b91505060809038610329565b50600090565b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff82111761049657604052565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b908160209103126104f1575173ffffffffffffffffffffffffffffffffffffffff811681036104f15790565b600080fd5b604080517f1273b0c60000000000000000000000000000000000000000000000000000000080825273ffffffffffffffffffffffffffffffffffffffff8481166004808501919091528682166024850152602097969495909492939192917f00000000000000000000000000000000000000000000000000000000000000008416908981604481855afa90811561083f578a9392918691600091610822575b50169384159687159761079c575b5050505050169182156107755783517fee27c68900000000000000000000000000000000000000000000000000000000815286818381875afa90811561076a5760009161073d575b50600083156106f457505b958451937feab5d20e00000000000000000000000000000000000000000000000000000000855281858481845afa9485156106e9576000956106ba575b5081908651938480927f7c9b8e890000000000000000000000000000000000000000000000000000000082525afa9485156106b0575060009461067f575b50501561067b5791565b9091565b8181959293953d83116106a9575b6106978183610455565b81010312610136575051913880610671565b503d61068d565b513d6000823e3d90fd5b90948282813d83116106e2575b6106d18183610455565b810103126101365750519381610633565b503d6106c7565b86513d6000823e3d90fd5b811561071157506ec097ce7bc90715b34b9f1000000000046105f6565b806012847f4e487b71000000000000000000000000000000000000000000000000000000006024945252fd5b908782813d8311610763575b6107538183610455565b81010312610136575051386105eb565b503d610749565b85513d6000823e3d90fd5b83517f76ecffc0000000000000000000000000000000000000000000000000000000008152fd5b895190815273ffffffffffffffffffffffffffffffffffffffff918216898201908152939091166020840152935083918290819060400103915afa90811561076a579082916000916107f5575b501686388080806105a3565b6108159150883d8a1161081b575b61080d8183610455565b8101906104c5565b386107e9565b503d610803565b6108399150853d871161081b5761080d8183610455565b38610595565b88513d6000823e3d90fdfea26469706673582212209dcb64c52f608d0534f7592400e99fa230eb8c3da0bb7d58055611d5f60493f264736f6c63430008130033" +} \ No newline at end of file diff --git a/deployments/mainnet/DodoV2Oracle.json b/deployments/mainnet/DodoV2Oracle.json new file mode 100644 index 00000000..3fb3fa1e --- /dev/null +++ b/deployments/mainnet/DodoV2Oracle.json @@ -0,0 +1,90 @@ +{ + "address": "0x03aA019F3B78110e030c34e9fA98047A1f62859A", + "abi": [ + { + "inputs": [ + { + "internalType": "contract IDVMFactory", + "name": "_DVMFactory", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "name": "ConnectorShouldBeNone", + "type": "error" + }, + { + "inputs": [], + "name": "PoolNotFound", + "type": "error" + }, + { + "inputs": [], + "name": "PoolWithConnectorNotFound", + "type": "error" + }, + { + "inputs": [], + "name": "FACTORY", + "outputs": [ + { + "internalType": "contract IDVMFactory", + "name": "", + "type": "address" + } + ], + "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" + } + ], + "receipt": {}, + "args": [ + "0x72d220cE168C4f361dD4deE5D826a01AD8598f6C" + ], + "numDeployments": 1, + "bytecode": "0x60a03461007157601f610da938819003918201601f19168301916001600160401b038311848410176100765780849260209460405283398101031261007157516001600160a01b038116810361007157608052604051610d1c908161008d823960805181818161040301526109990152f35b600080fd5b634e487b7160e01b600052604160045260246000fdfe60806040908082526004908136101561001757600080fd5b600090813560e01c9081632dd31000146103b95750633d549b321461003b57600080fd5b346103b65760807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126103b657813573ffffffffffffffffffffffffffffffffffffffff8082168092036103b2576024918235908282168092036103ae57604435918383168093036103aa576064918235936100b76104b7565b508086036102395750906100ca91610940565b9490926100d78451610807565b96805b8a865182101561013a579061012f610111610135936101166101088d8d610101888f610558565b5116610ac2565b909491946104e9565b6106c4565b9051916101228361042b565b825260208201528b610839565b5061052b565b6100da565b50939796509450925090505b8295839560209586810151938a8201968588515280975b868910610189578c8c8c8c81610178575b8351928352820152f35b91816101839161059b565b9161016e565b90919293949596979961019d8b8351610558565b519b8a8d019c8d51888102908082048a149015171561020e576101c18c89516104e9565b1161020157916101e66101ee928f6101e0906101f496519051906104e9565b90610895565b9d5190610895565b9a61052b565b979695949392919061015d565b509b50996101f49061052b565b868660118c7f4e487b7100000000000000000000000000000000000000000000000000000000835252fd5b939895969197949061024e8561025692610940565b999095610940565b9961026c61026787518451906104e9565b610807565b96849a5b87518c101561039257908161028c8e93878f610101908d610558565b9d8e829b929c939c15908115610389575b5061037357895b885181101561034c578f908f918f928f938f948f958f968f8e61032a996101018a6102ce94610558565b9093919281158015610344575b610336576102fc610312956102f661012f9b61030c966104e9565b936104e9565b90508082101561032f57506106c4565b926105d4565b92519261031e8461042b565b83526020830152610839565b6102a4565b90506106c4565b50505050505050505061052b565b5084156102db565b50959450959850959850959a509a6103639061052b565b9a90919994969396959295610270565b959450959850959850959a509a6103639061052b565b9050158f61029d565b50949950959796995050509150949392919091610146565b8580fd5b8480fd5b8280fd5b80fd5b90503461042757817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126104275760209073ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000168152f35b5080fd5b6040810190811067ffffffffffffffff82111761044757604052565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff82111761044757604052565b604051906060820182811067ffffffffffffffff82111761044757604052606060408360008152600060208201520152565b818102929181159184041417156104fc57565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81146104fc5760010190565b805182101561056c5760209160051b010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b81156105a5570490565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff818309818302918280831092039180830392146106b357670de0b6b3a76400009082821115610655577faccb18165bd6fe31ae1cf318dc5b51eee0e1ba569b88cd74c1773b91fac10669940990828211900360ee1b910360121c170290565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f4d6174683a206d756c446976206f766572666c6f7700000000000000000000006044820152fd5b5050670de0b6b3a764000091500490565b80156108015761078f816000908360801c806107f5575b508060401c806107e8575b508060201c806107db575b508060101c806107ce575b508060081c806107c1575b508060041c806107b4575b508060021c806107a7575b50600191828092811c6107a0575b1c1b610737818561059b565b01811c610744818561059b565b01811c610751818561059b565b01811c61075e818561059b565b01811c61076b818561059b565b01811c610778818561059b565b01811c610785818561059b565b01901c809261059b565b8082101561079b575090565b905090565b018161072b565b600291509101903861071d565b6004915091019038610712565b6008915091019038610707565b60109150910190386106fc565b60209150910190386106f1565b60409150910190386106e6565b915050608090386106db565b50600090565b906108106104b7565b506040519160808160061b84010160405260008352600060208401526060830180604085015252565b906020810190815161084d57505050600090565b61086e60408401519160208501928351916108688383610558565b52610558565b50610879815161052b565b905251908051821161088d575b5050600190565b523880610886565b919082018092116104fc57565b90602090818382031261093b57825167ffffffffffffffff9384821161093b570181601f8201121561093b578051938411610447578360051b90604051946108ec85840187610476565b8552838086019282010192831161093b578301905b82821061090f575050505090565b815173ffffffffffffffffffffffffffffffffffffffff8116810361093b578152908301908301610901565b600080fd5b6040517f57a281dc0000000000000000000000000000000000000000000000000000000080825273ffffffffffffffffffffffffffffffffffffffff8381166004840152848116602484015291949093909260009290917f0000000000000000000000000000000000000000000000000000000000000000909116908387604481855afa968715610ab7578497610a9b575b5086511595861596610a17575b50505050508251156109ed57565b60046040517f76ecffc0000000000000000000000000000000000000000000000000000000008152fd5b60405190815273ffffffffffffffffffffffffffffffffffffffff91821660048201529216602483015292945090918290829060449082905afa918215610a8f578092610a6c575b50509138808080806109df565b610a8892503d8091833e610a808183610476565b8101906108a2565b3880610a5f565b604051903d90823e3d90fd5b610ab09197503d8086833e610a808183610476565b95386109d2565b6040513d86823e3d90fd5b6000926000809373ffffffffffffffffffffffffffffffffffffffff829416906040908151917f7d72150400000000000000000000000000000000000000000000000000000000835260208084600481885afa938415610cdc578694610cad575b508151947fbbf5ce780000000000000000000000000000000000000000000000000000000086528186600481845afa958615610ca3578796610c70575b5084151580610c67575b610b78575b50505050505050565b909295995060049396985081839295985051938480927fee27c6890000000000000000000000000000000000000000000000000000000082525afa928315610c5e57508792610c30575b50508115610be7575b945015610be257905b909138808080808080610b6f565b610bd4565b8015610c03576ec097ce7bc90715b34b9f100000000004610bcb565b6024867f4e487b710000000000000000000000000000000000000000000000000000000081526012600452fd5b90809250813d8311610c57575b610c478183610476565b810103126103aa57513880610bc2565b503d610c3d565b513d89823e3d90fd5b50851515610b6a565b9095508181813d8311610c9c575b610c888183610476565b81010312610c9857519438610b60565b8680fd5b503d610c7e565b83513d89823e3d90fd5b9080945081813d8311610cd5575b610cc58183610476565b810103126103aa57519238610b23565b503d610cbb565b82513d88823e3d90fdfea26469706673582212200b538e770906f153cf3b5bb782d51e6433ee8e1b8f6cd316ebe6194f5928e04f64736f6c63430008130033", + "deployedBytecode": "0x60806040908082526004908136101561001757600080fd5b600090813560e01c9081632dd31000146103b95750633d549b321461003b57600080fd5b346103b65760807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126103b657813573ffffffffffffffffffffffffffffffffffffffff8082168092036103b2576024918235908282168092036103ae57604435918383168093036103aa576064918235936100b76104b7565b508086036102395750906100ca91610940565b9490926100d78451610807565b96805b8a865182101561013a579061012f610111610135936101166101088d8d610101888f610558565b5116610ac2565b909491946104e9565b6106c4565b9051916101228361042b565b825260208201528b610839565b5061052b565b6100da565b50939796509450925090505b8295839560209586810151938a8201968588515280975b868910610189578c8c8c8c81610178575b8351928352820152f35b91816101839161059b565b9161016e565b90919293949596979961019d8b8351610558565b519b8a8d019c8d51888102908082048a149015171561020e576101c18c89516104e9565b1161020157916101e66101ee928f6101e0906101f496519051906104e9565b90610895565b9d5190610895565b9a61052b565b979695949392919061015d565b509b50996101f49061052b565b868660118c7f4e487b7100000000000000000000000000000000000000000000000000000000835252fd5b939895969197949061024e8561025692610940565b999095610940565b9961026c61026787518451906104e9565b610807565b96849a5b87518c101561039257908161028c8e93878f610101908d610558565b9d8e829b929c939c15908115610389575b5061037357895b885181101561034c578f908f918f928f938f948f958f968f8e61032a996101018a6102ce94610558565b9093919281158015610344575b610336576102fc610312956102f661012f9b61030c966104e9565b936104e9565b90508082101561032f57506106c4565b926105d4565b92519261031e8461042b565b83526020830152610839565b6102a4565b90506106c4565b50505050505050505061052b565b5084156102db565b50959450959850959850959a509a6103639061052b565b9a90919994969396959295610270565b959450959850959850959a509a6103639061052b565b9050158f61029d565b50949950959796995050509150949392919091610146565b8580fd5b8480fd5b8280fd5b80fd5b90503461042757817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126104275760209073ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000168152f35b5080fd5b6040810190811067ffffffffffffffff82111761044757604052565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff82111761044757604052565b604051906060820182811067ffffffffffffffff82111761044757604052606060408360008152600060208201520152565b818102929181159184041417156104fc57565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81146104fc5760010190565b805182101561056c5760209160051b010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b81156105a5570490565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff818309818302918280831092039180830392146106b357670de0b6b3a76400009082821115610655577faccb18165bd6fe31ae1cf318dc5b51eee0e1ba569b88cd74c1773b91fac10669940990828211900360ee1b910360121c170290565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f4d6174683a206d756c446976206f766572666c6f7700000000000000000000006044820152fd5b5050670de0b6b3a764000091500490565b80156108015761078f816000908360801c806107f5575b508060401c806107e8575b508060201c806107db575b508060101c806107ce575b508060081c806107c1575b508060041c806107b4575b508060021c806107a7575b50600191828092811c6107a0575b1c1b610737818561059b565b01811c610744818561059b565b01811c610751818561059b565b01811c61075e818561059b565b01811c61076b818561059b565b01811c610778818561059b565b01811c610785818561059b565b01901c809261059b565b8082101561079b575090565b905090565b018161072b565b600291509101903861071d565b6004915091019038610712565b6008915091019038610707565b60109150910190386106fc565b60209150910190386106f1565b60409150910190386106e6565b915050608090386106db565b50600090565b906108106104b7565b506040519160808160061b84010160405260008352600060208401526060830180604085015252565b906020810190815161084d57505050600090565b61086e60408401519160208501928351916108688383610558565b52610558565b50610879815161052b565b905251908051821161088d575b5050600190565b523880610886565b919082018092116104fc57565b90602090818382031261093b57825167ffffffffffffffff9384821161093b570181601f8201121561093b578051938411610447578360051b90604051946108ec85840187610476565b8552838086019282010192831161093b578301905b82821061090f575050505090565b815173ffffffffffffffffffffffffffffffffffffffff8116810361093b578152908301908301610901565b600080fd5b6040517f57a281dc0000000000000000000000000000000000000000000000000000000080825273ffffffffffffffffffffffffffffffffffffffff8381166004840152848116602484015291949093909260009290917f0000000000000000000000000000000000000000000000000000000000000000909116908387604481855afa968715610ab7578497610a9b575b5086511595861596610a17575b50505050508251156109ed57565b60046040517f76ecffc0000000000000000000000000000000000000000000000000000000008152fd5b60405190815273ffffffffffffffffffffffffffffffffffffffff91821660048201529216602483015292945090918290829060449082905afa918215610a8f578092610a6c575b50509138808080806109df565b610a8892503d8091833e610a808183610476565b8101906108a2565b3880610a5f565b604051903d90823e3d90fd5b610ab09197503d8086833e610a808183610476565b95386109d2565b6040513d86823e3d90fd5b6000926000809373ffffffffffffffffffffffffffffffffffffffff829416906040908151917f7d72150400000000000000000000000000000000000000000000000000000000835260208084600481885afa938415610cdc578694610cad575b508151947fbbf5ce780000000000000000000000000000000000000000000000000000000086528186600481845afa958615610ca3578796610c70575b5084151580610c67575b610b78575b50505050505050565b909295995060049396985081839295985051938480927fee27c6890000000000000000000000000000000000000000000000000000000082525afa928315610c5e57508792610c30575b50508115610be7575b945015610be257905b909138808080808080610b6f565b610bd4565b8015610c03576ec097ce7bc90715b34b9f100000000004610bcb565b6024867f4e487b710000000000000000000000000000000000000000000000000000000081526012600452fd5b90809250813d8311610c57575b610c478183610476565b810103126103aa57513880610bc2565b503d610c3d565b513d89823e3d90fd5b50851515610b6a565b9095508181813d8311610c9c575b610c888183610476565b81010312610c9857519438610b60565b8680fd5b503d610c7e565b83513d89823e3d90fd5b9080945081813d8311610cd5575b610cc58183610476565b810103126103aa57519238610b23565b503d610cbb565b82513d88823e3d90fdfea26469706673582212200b538e770906f153cf3b5bb782d51e6433ee8e1b8f6cd316ebe6194f5928e04f64736f6c63430008130033" +} \ No newline at end of file