Address Details
contract
0x366DB2cd12f6bbF4333C407A462aD25e3c383F34
- Contract Name
- ConstantSumPricingModule
- Creator
- 0x56fd3f–9b8d81 at 0x95f495–86961b
- Balance
- 0 CELO ( )
- Locked CELO Balance
- 0.00 CELO
- Voting CELO Balance
- 0.00 CELO
- Pending Unlocked Gold
- 0.00 CELO
- Tokens
-
Fetching tokens...
- Transactions
- 0 Transactions
- Transfers
- 0 Transfers
- Gas Used
- Fetching gas used...
- Last Balance Update
- 21368356
This contract has been verified via Sourcify.
View contract in Sourcify repository
- Contract name:
- ConstantSumPricingModule
- Optimization enabled
- true
- Compiler version
- v0.5.17+commit.d19bba13
- Optimization runs
- 10000
- EVM Version
- istanbul
- Verified at
- 2023-03-10T06:56:30.326677Z
lib/mento-core/contracts/ConstantSumPricingModule.sol
// SPDX-License-Identifier: GPL-3.0-or-later pragma solidity ^0.5.13; pragma experimental ABIEncoderV2; import { IPricingModule } from "./interfaces/IPricingModule.sol"; import { SafeMath } from "openzeppelin-solidity/contracts/math/SafeMath.sol"; import { FixidityLib } from "./common/FixidityLib.sol"; /** * @title ConstantSumPricingModule * @notice The ConstantSumPricingModule calculates the amount in and the amount out for a constant sum AMM. */ contract ConstantSumPricingModule is IPricingModule { using SafeMath for uint256; using FixidityLib for FixidityLib.Fraction; /* ==================== View Functions ==================== */ /** * @notice Calculates the amount of tokens that should be received based on the given parameters * @dev amountOut = (1 - spread) * amountIn * @param tokenOutBucketSize The bucket size of the token swapt out. * @param spread The spread that is applied to a swap. * @param amountIn The amount of tokens in wei that is swapt in. * @return amountOut The amount of tokens in wei that should be received. */ function getAmountOut( uint256, uint256 tokenOutBucketSize, uint256 spread, uint256 amountIn ) external view returns (uint256 amountOut) { if (amountIn == 0) return 0; FixidityLib.Fraction memory spreadFraction = FixidityLib.fixed1().subtract(FixidityLib.wrap(spread)); amountOut = spreadFraction.multiply(FixidityLib.newFixed(amountIn)).unwrap(); amountOut = amountOut.div(FixidityLib.fixed1().unwrap()); require( amountOut <= FixidityLib.newFixed(tokenOutBucketSize).unwrap(), "amountOut cant be greater then the tokenOutPool size" ); return amountOut; } /** * @notice Calculates the amount of tokens that should be provided in order to receive the desired amount out. * @dev amountIn = amountOut / (1 - spread) * @param tokenOutBucketSize The bucket size of the token swapt out. * @param spread The spread that is applied to a swap. * @param amountOut The amount of tokens in wei that should be swapt out. * @return amountIn The amount of tokens in wei that should be provided. */ function getAmountIn( uint256, uint256 tokenOutBucketSize, uint256 spread, uint256 amountOut ) external view returns (uint256 amountIn) { require(amountOut <= tokenOutBucketSize, "amountOut cant be greater then the tokenOutPool size"); if (amountOut == 0) return 0; FixidityLib.Fraction memory denominator = FixidityLib.fixed1().subtract(FixidityLib.wrap(spread)); FixidityLib.Fraction memory numerator = FixidityLib.newFixed(amountOut); // Can't use FixidityLib.divide because numerator can be greater // than maxFixedDivisor. // Fortunately, we expect an integer result, so integer division gives us as // much precision as we could hope for. return numerator.unwrap().div(denominator.unwrap()); } /** * @notice Returns the AMM that the IPricingModule implements * @return Constant Sum. */ function name() external view returns (string memory) { return "ConstantSum"; } }
/lib/mento-core/contracts/common/FixidityLib.sol
pragma solidity ^0.5.13; /** * @title FixidityLib * @author Gadi Guy, Alberto Cuesta Canada * @notice This library provides fixed point arithmetic with protection against * overflow. * All operations are done with uint256 and the operands must have been created * with any of the newFrom* functions, which shift the comma digits() to the * right and check for limits, or with wrap() which expects a number already * in the internal representation of a fraction. * When using this library be sure to use maxNewFixed() as the upper limit for * creation of fixed point numbers. * @dev All contained functions are pure and thus marked internal to be inlined * on consuming contracts at compile time for gas efficiency. */ library FixidityLib { struct Fraction { uint256 value; } /** * @notice Number of positions that the comma is shifted to the right. */ function digits() internal pure returns (uint8) { return 24; } uint256 private constant FIXED1_UINT = 1000000000000000000000000; /** * @notice This is 1 in the fixed point units used in this library. * @dev Test fixed1() equals 10^digits() * Hardcoded to 24 digits. */ function fixed1() internal pure returns (Fraction memory) { return Fraction(FIXED1_UINT); } /** * @notice Wrap a uint256 that represents a 24-decimal fraction in a Fraction * struct. * @param x Number that already represents a 24-decimal fraction. * @return A Fraction struct with contents x. */ function wrap(uint256 x) internal pure returns (Fraction memory) { return Fraction(x); } /** * @notice Unwraps the uint256 inside of a Fraction struct. */ function unwrap(Fraction memory x) internal pure returns (uint256) { return x.value; } /** * @notice The amount of decimals lost on each multiplication operand. * @dev Test mulPrecision() equals sqrt(fixed1) */ function mulPrecision() internal pure returns (uint256) { return 1000000000000; } /** * @notice Maximum value that can be converted to fixed point. Optimize for deployment. * @dev * Test maxNewFixed() equals maxUint256() / fixed1() */ function maxNewFixed() internal pure returns (uint256) { return 115792089237316195423570985008687907853269984665640564; } /** * @notice Converts a uint256 to fixed point Fraction * @dev Test newFixed(0) returns 0 * Test newFixed(1) returns fixed1() * Test newFixed(maxNewFixed()) returns maxNewFixed() * fixed1() * Test newFixed(maxNewFixed()+1) fails */ function newFixed(uint256 x) internal pure returns (Fraction memory) { require(x <= maxNewFixed(), "can't create fixidity number larger than maxNewFixed()"); return Fraction(x * FIXED1_UINT); } /** * @notice Converts a uint256 in the fixed point representation of this * library to a non decimal. All decimal digits will be truncated. */ function fromFixed(Fraction memory x) internal pure returns (uint256) { return x.value / FIXED1_UINT; } /** * @notice Converts two uint256 representing a fraction to fixed point units, * equivalent to multiplying dividend and divisor by 10^digits(). * @param numerator numerator must be <= maxNewFixed() * @param denominator denominator must be <= maxNewFixed() and denominator can't be 0 * @dev * Test newFixedFraction(1,0) fails * Test newFixedFraction(0,1) returns 0 * Test newFixedFraction(1,1) returns fixed1() * Test newFixedFraction(1,fixed1()) returns 1 */ function newFixedFraction(uint256 numerator, uint256 denominator) internal pure returns (Fraction memory) { Fraction memory convertedNumerator = newFixed(numerator); Fraction memory convertedDenominator = newFixed(denominator); return divide(convertedNumerator, convertedDenominator); } /** * @notice Returns the integer part of a fixed point number. * @dev * Test integer(0) returns 0 * Test integer(fixed1()) returns fixed1() * Test integer(newFixed(maxNewFixed())) returns maxNewFixed()*fixed1() */ function integer(Fraction memory x) internal pure returns (Fraction memory) { return Fraction((x.value / FIXED1_UINT) * FIXED1_UINT); // Can't overflow } /** * @notice Returns the fractional part of a fixed point number. * In the case of a negative number the fractional is also negative. * @dev * Test fractional(0) returns 0 * Test fractional(fixed1()) returns 0 * Test fractional(fixed1()-1) returns 10^24-1 */ function fractional(Fraction memory x) internal pure returns (Fraction memory) { return Fraction(x.value - (x.value / FIXED1_UINT) * FIXED1_UINT); // Can't overflow } /** * @notice x+y. * @dev The maximum value that can be safely used as an addition operator is defined as * maxFixedAdd = maxUint256()-1 / 2, or * 57896044618658097711785492504343953926634992332820282019728792003956564819967. * Test add(maxFixedAdd,maxFixedAdd) equals maxFixedAdd + maxFixedAdd * Test add(maxFixedAdd+1,maxFixedAdd+1) throws */ function add(Fraction memory x, Fraction memory y) internal pure returns (Fraction memory) { uint256 z = x.value + y.value; require(z >= x.value, "add overflow detected"); return Fraction(z); } /** * @notice x-y. * @dev * Test subtract(6, 10) fails */ function subtract(Fraction memory x, Fraction memory y) internal pure returns (Fraction memory) { require(x.value >= y.value, "substraction underflow detected"); return Fraction(x.value - y.value); } /** * @notice x*y. If any of the operators is higher than the max multiplier value it * might overflow. * @dev The maximum value that can be safely used as a multiplication operator * (maxFixedMul) is calculated as sqrt(maxUint256()*fixed1()), * or 340282366920938463463374607431768211455999999999999 * Test multiply(0,0) returns 0 * Test multiply(maxFixedMul,0) returns 0 * Test multiply(0,maxFixedMul) returns 0 * Test multiply(fixed1()/mulPrecision(),fixed1()*mulPrecision()) returns fixed1() * Test multiply(maxFixedMul,maxFixedMul) is around maxUint256() * Test multiply(maxFixedMul+1,maxFixedMul+1) fails */ // solhint-disable-next-line code-complexity function multiply(Fraction memory x, Fraction memory y) internal pure returns (Fraction memory) { if (x.value == 0 || y.value == 0) return Fraction(0); if (y.value == FIXED1_UINT) return x; if (x.value == FIXED1_UINT) return y; // Separate into integer and fractional parts // x = x1 + x2, y = y1 + y2 uint256 x1 = integer(x).value / FIXED1_UINT; uint256 x2 = fractional(x).value; uint256 y1 = integer(y).value / FIXED1_UINT; uint256 y2 = fractional(y).value; // (x1 + x2) * (y1 + y2) = (x1 * y1) + (x1 * y2) + (x2 * y1) + (x2 * y2) uint256 x1y1 = x1 * y1; if (x1 != 0) require(x1y1 / x1 == y1, "overflow x1y1 detected"); // x1y1 needs to be multiplied back by fixed1 // solhint-disable-next-line var-name-mixedcase uint256 fixed_x1y1 = x1y1 * FIXED1_UINT; if (x1y1 != 0) require(fixed_x1y1 / x1y1 == FIXED1_UINT, "overflow x1y1 * fixed1 detected"); x1y1 = fixed_x1y1; uint256 x2y1 = x2 * y1; if (x2 != 0) require(x2y1 / x2 == y1, "overflow x2y1 detected"); uint256 x1y2 = x1 * y2; if (x1 != 0) require(x1y2 / x1 == y2, "overflow x1y2 detected"); x2 = x2 / mulPrecision(); y2 = y2 / mulPrecision(); uint256 x2y2 = x2 * y2; if (x2 != 0) require(x2y2 / x2 == y2, "overflow x2y2 detected"); // result = fixed1() * x1 * y1 + x1 * y2 + x2 * y1 + x2 * y2 / fixed1(); Fraction memory result = Fraction(x1y1); result = add(result, Fraction(x2y1)); // Add checks for overflow result = add(result, Fraction(x1y2)); // Add checks for overflow result = add(result, Fraction(x2y2)); // Add checks for overflow return result; } /** * @notice 1/x * @dev * Test reciprocal(0) fails * Test reciprocal(fixed1()) returns fixed1() * Test reciprocal(fixed1()*fixed1()) returns 1 // Testing how the fractional is truncated * Test reciprocal(1+fixed1()*fixed1()) returns 0 // Testing how the fractional is truncated * Test reciprocal(newFixedFraction(1, 1e24)) returns newFixed(1e24) */ function reciprocal(Fraction memory x) internal pure returns (Fraction memory) { require(x.value != 0, "can't call reciprocal(0)"); return Fraction((FIXED1_UINT * FIXED1_UINT) / x.value); // Can't overflow } /** * @notice x/y. If the dividend is higher than the max dividend value, it * might overflow. You can use multiply(x,reciprocal(y)) instead. * @dev The maximum value that can be safely used as a dividend (maxNewFixed) is defined as * divide(maxNewFixed,newFixedFraction(1,fixed1())) is around maxUint256(). * This yields the value 115792089237316195423570985008687907853269984665640564. * Test maxNewFixed equals maxUint256()/fixed1() * Test divide(maxNewFixed,1) equals maxNewFixed*(fixed1) * Test divide(maxNewFixed+1,multiply(mulPrecision(),mulPrecision())) throws * Test divide(fixed1(),0) fails * Test divide(maxNewFixed,1) = maxNewFixed*(10^digits()) * Test divide(maxNewFixed+1,1) throws */ function divide(Fraction memory x, Fraction memory y) internal pure returns (Fraction memory) { require(y.value != 0, "can't divide by 0"); // solhint-disable-next-line var-name-mixedcase uint256 X = x.value * FIXED1_UINT; require(X / FIXED1_UINT == x.value, "overflow at divide"); return Fraction(X / y.value); } /** * @notice x > y */ function gt(Fraction memory x, Fraction memory y) internal pure returns (bool) { return x.value > y.value; } /** * @notice x >= y */ function gte(Fraction memory x, Fraction memory y) internal pure returns (bool) { return x.value >= y.value; } /** * @notice x < y */ function lt(Fraction memory x, Fraction memory y) internal pure returns (bool) { return x.value < y.value; } /** * @notice x <= y */ function lte(Fraction memory x, Fraction memory y) internal pure returns (bool) { return x.value <= y.value; } /** * @notice x == y */ function equals(Fraction memory x, Fraction memory y) internal pure returns (bool) { return x.value == y.value; } /** * @notice x <= 1 */ function isProperFraction(Fraction memory x) internal pure returns (bool) { return lte(x, fixed1()); } }
/lib/mento-core/contracts/interfaces/IPricingModule.sol
// SPDX-License-Identifier: GPL-3.0-or-later pragma solidity ^0.5.13; /** * @title Interface for a Mento Pricing Module. * @notice A Mento pricing module represents an exchange relation between a pair of ERC20 assets. */ interface IPricingModule { /** * @notice Returns the output amount and new bucket sizes for a given input amount. * @param tokenInBucketSize Size of the tokenIn bucket. * @param tokenOutBucketSize Size of the tokenOut bucket. * @param spread Spread charged on exchanges. * @param amountIn Amount of tokenIn being paid in. * @return amountOut Amount of tokenOut that will be paid out. */ function getAmountOut( uint256 tokenInBucketSize, uint256 tokenOutBucketSize, uint256 spread, uint256 amountIn ) external view returns (uint256 amountOut); /** * @notice Returns the input amount necessary for a given output amount. * @param tokenInBucketSize Size of the tokenIn bucket. * @param tokenOutBucketSize Size of the tokenOut bucket. * @param spread Spread charged on exchanges. * @param amountOut Amount of tokenIn being paid out. * @return amountIn Amount of tokenOut that would have to be paid in. */ function getAmountIn( uint256 tokenInBucketSize, uint256 tokenOutBucketSize, uint256 spread, uint256 amountOut ) external view returns (uint256 amountIn); /** * @notice Retrieve the name of this pricing module. * @return exchangeName The name of the pricing module. */ function name() external view returns (string memory pricingModuleName); }
/lib/mento-core/lib/openzeppelin-contracts/contracts/math/SafeMath.sol
pragma solidity ^0.5.0; /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming languages. * `SafeMath` restores this intuition by reverting the transaction when an * operation overflows. * * Using this library instead of the unchecked operations eliminates an entire * class of bugs, so it's recommended to use it always. */ library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * - Subtraction cannot overflow. * * _Available since v2.4.0._ */ function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } /** * @dev Returns the integer division of two unsigned integers. Reverts on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } /** * @dev Returns the integer division of two unsigned integers. Reverts with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. * * _Available since v2.4.0._ */ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { // Solidity only automatically asserts when dividing by 0 require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts with custom message when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. * * _Available since v2.4.0._ */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } }
Contract ABI
[{"type":"function","stateMutability":"view","payable":false,"outputs":[{"type":"uint256","name":"amountIn","internalType":"uint256"}],"name":"getAmountIn","inputs":[{"type":"uint256","name":"","internalType":"uint256"},{"type":"uint256","name":"tokenOutBucketSize","internalType":"uint256"},{"type":"uint256","name":"spread","internalType":"uint256"},{"type":"uint256","name":"amountOut","internalType":"uint256"}],"constant":true},{"type":"function","stateMutability":"view","payable":false,"outputs":[{"type":"uint256","name":"amountOut","internalType":"uint256"}],"name":"getAmountOut","inputs":[{"type":"uint256","name":"","internalType":"uint256"},{"type":"uint256","name":"tokenOutBucketSize","internalType":"uint256"},{"type":"uint256","name":"spread","internalType":"uint256"},{"type":"uint256","name":"amountIn","internalType":"uint256"}],"constant":true},{"type":"function","stateMutability":"view","payable":false,"outputs":[{"type":"string","name":"","internalType":"string"}],"name":"name","inputs":[],"constant":true}]
Contract Creation Code
0x608060405234801561001057600080fd5b50610c3c806100206000396000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c806306fdde031461004657806352707d8c14610064578063571fd01214610084575b600080fd5b61004e610097565b60405161005b9190610acf565b60405180910390f35b6100776100723660046107da565b6100ce565b60405161005b9190610b70565b6100776100923660046107da565b61019f565b60408051808201909152600b81527f436f6e7374616e7453756d000000000000000000000000000000000000000000602082015290565b6000816100dd57506000610197565b6100e56107bc565b6101056100f18561023d565b6100f9610257565b9063ffffffff61027b16565b9050610128610123610116856102d9565b839063ffffffff61034216565b61062d565b9150610145610138610123610257565b839063ffffffff61063116565b9150610153610123866102d9565b821115610195576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161018c90610b20565b60405180910390fd5b505b949350505050565b6000838211156101db576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161018c90610b20565b816101e857506000610197565b6101f06107bc565b6101fc6100f18561023d565b90506102066107bc565b61020f846102d9565b905061023261021d8361062d565b6102268361062d565b9063ffffffff61063116565b979650505050505050565b6102456107bc565b50604080516020810190915290815290565b61025f6107bc565b50604080516020810190915269d3c21bcecceda1000000815290565b6102836107bc565b8151835110156102bf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161018c90610af0565b506040805160208101909152815183510381525b92915050565b6102e16107bc565b6102e961067a565b821115610322576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161018c90610b10565b50604080516020810190915269d3c21bcecceda100000082028152919050565b61034a6107bc565b8251158061035757508151155b1561037157506040805160208101909152600081526102d3565b815169d3c21bcecceda1000000141561038b5750816102d3565b825169d3c21bcecceda100000014156103a55750806102d3565b600069d3c21bcecceda10000006103bb85610695565b51816103c357fe5b04905060006103d1856106ca565b519050600069d3c21bcecceda10000006103ea86610695565b51816103f257fe5b0490506000610400866106ca565b519050838202841561044e578285828161041657fe5b041461044e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161018c90610ae0565b69d3c21bcecceda1000000810281156104ad5769d3c21bcecceda100000082828161047557fe5b04146104ad576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161018c90610b50565b90508084840285156104fb57848682816104c357fe5b04146104fb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161018c90610b60565b8684028715610546578488828161050e57fe5b0414610546576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161018c90610b30565b61054e610704565b878161055657fe5b049650610561610704565b858161056957fe5b04945086850287156105b7578588828161057f57fe5b04146105b7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161018c90610b00565b6105bf6107bc565b60405180602001604052808781525090506105e88160405180602001604052808781525061070d565b90506106028160405180602001604052808681525061070d565b905061061c8160405180602001604052808581525061070d565b9d9c50505050505050505050505050565b5190565b600061067383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061076b565b9392505050565b7601357c299a88ea76a58924d52ce4f26a85af186c2b9e7490565b61069d6107bc565b604051806020016040528069d3c21bcecceda1000000808560000151816106c057fe5b0402905292915050565b6106d26107bc565b604051806020016040528069d3c21bcecceda1000000808560000151816106f557fe5b95519504029093039092525090565b64e8d4a5100090565b6107156107bc565b8151835190810190811015610756576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161018c90610b40565b60408051602081019091529081529392505050565b600081836107a6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161018c9190610acf565b5060008385816107b257fe5b0495945050505050565b6040518060200160405280600081525090565b80356102d381610be2565b600080600080608085870312156107f057600080fd5b60006107fc87876107cf565b945050602061080d878288016107cf565b935050604061081e878288016107cf565b925050606061082f878288016107cf565b91505092959194509250565b60006108468261062d565b6108508185610b7e565b9350610860818560208601610b8a565b61086981610bba565b9093019392505050565b6000610880601683610b7e565b7f6f766572666c6f77207831793120646574656374656400000000000000000000815260200192915050565b60006108b9601f83610b7e565b7f737562737472616374696f6e20756e646572666c6f7720646574656374656400815260200192915050565b60006108f2601683610b7e565b7f6f766572666c6f77207832793220646574656374656400000000000000000000815260200192915050565b600061092b603683610b7e565b7f63616e277420637265617465206669786964697479206e756d626572206c617281527f676572207468616e206d61784e65774669786564282900000000000000000000602082015260400192915050565b600061098a603483610b7e565b7f616d6f756e744f75742063616e742062652067726561746572207468656e207481527f686520746f6b656e4f7574506f6f6c2073697a65000000000000000000000000602082015260400192915050565b60006109e9601683610b7e565b7f6f766572666c6f77207831793220646574656374656400000000000000000000815260200192915050565b6000610a22601583610b7e565b7f616464206f766572666c6f772064657465637465640000000000000000000000815260200192915050565b6000610a5b601f83610b7e565b7f6f766572666c6f772078317931202a2066697865643120646574656374656400815260200192915050565b6000610a94601683610b7e565b7f6f766572666c6f77207832793120646574656374656400000000000000000000815260200192915050565b610ac981610b87565b82525050565b60208082528101610673818461083b565b602080825281016102d381610873565b602080825281016102d3816108ac565b602080825281016102d3816108e5565b602080825281016102d38161091e565b602080825281016102d38161097d565b602080825281016102d3816109dc565b602080825281016102d381610a15565b602080825281016102d381610a4e565b602080825281016102d381610a87565b602081016102d38284610ac0565b90815260200190565b90565b60005b83811015610ba5578181015183820152602001610b8d565b83811115610bb4576000848401525b50505050565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01690565b610beb81610b87565b8114610bf657600080fd5b5056fea365627a7a72315820b5d3f83f62e0a86aa9dcc82dd2bb232c88cfa635741c5f6b70fd4409389451fb6c6578706572696d656e74616cf564736f6c63430005110040
Deployed ByteCode
0x608060405234801561001057600080fd5b50600436106100415760003560e01c806306fdde031461004657806352707d8c14610064578063571fd01214610084575b600080fd5b61004e610097565b60405161005b9190610acf565b60405180910390f35b6100776100723660046107da565b6100ce565b60405161005b9190610b70565b6100776100923660046107da565b61019f565b60408051808201909152600b81527f436f6e7374616e7453756d000000000000000000000000000000000000000000602082015290565b6000816100dd57506000610197565b6100e56107bc565b6101056100f18561023d565b6100f9610257565b9063ffffffff61027b16565b9050610128610123610116856102d9565b839063ffffffff61034216565b61062d565b9150610145610138610123610257565b839063ffffffff61063116565b9150610153610123866102d9565b821115610195576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161018c90610b20565b60405180910390fd5b505b949350505050565b6000838211156101db576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161018c90610b20565b816101e857506000610197565b6101f06107bc565b6101fc6100f18561023d565b90506102066107bc565b61020f846102d9565b905061023261021d8361062d565b6102268361062d565b9063ffffffff61063116565b979650505050505050565b6102456107bc565b50604080516020810190915290815290565b61025f6107bc565b50604080516020810190915269d3c21bcecceda1000000815290565b6102836107bc565b8151835110156102bf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161018c90610af0565b506040805160208101909152815183510381525b92915050565b6102e16107bc565b6102e961067a565b821115610322576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161018c90610b10565b50604080516020810190915269d3c21bcecceda100000082028152919050565b61034a6107bc565b8251158061035757508151155b1561037157506040805160208101909152600081526102d3565b815169d3c21bcecceda1000000141561038b5750816102d3565b825169d3c21bcecceda100000014156103a55750806102d3565b600069d3c21bcecceda10000006103bb85610695565b51816103c357fe5b04905060006103d1856106ca565b519050600069d3c21bcecceda10000006103ea86610695565b51816103f257fe5b0490506000610400866106ca565b519050838202841561044e578285828161041657fe5b041461044e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161018c90610ae0565b69d3c21bcecceda1000000810281156104ad5769d3c21bcecceda100000082828161047557fe5b04146104ad576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161018c90610b50565b90508084840285156104fb57848682816104c357fe5b04146104fb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161018c90610b60565b8684028715610546578488828161050e57fe5b0414610546576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161018c90610b30565b61054e610704565b878161055657fe5b049650610561610704565b858161056957fe5b04945086850287156105b7578588828161057f57fe5b04146105b7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161018c90610b00565b6105bf6107bc565b60405180602001604052808781525090506105e88160405180602001604052808781525061070d565b90506106028160405180602001604052808681525061070d565b905061061c8160405180602001604052808581525061070d565b9d9c50505050505050505050505050565b5190565b600061067383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061076b565b9392505050565b7601357c299a88ea76a58924d52ce4f26a85af186c2b9e7490565b61069d6107bc565b604051806020016040528069d3c21bcecceda1000000808560000151816106c057fe5b0402905292915050565b6106d26107bc565b604051806020016040528069d3c21bcecceda1000000808560000151816106f557fe5b95519504029093039092525090565b64e8d4a5100090565b6107156107bc565b8151835190810190811015610756576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161018c90610b40565b60408051602081019091529081529392505050565b600081836107a6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161018c9190610acf565b5060008385816107b257fe5b0495945050505050565b6040518060200160405280600081525090565b80356102d381610be2565b600080600080608085870312156107f057600080fd5b60006107fc87876107cf565b945050602061080d878288016107cf565b935050604061081e878288016107cf565b925050606061082f878288016107cf565b91505092959194509250565b60006108468261062d565b6108508185610b7e565b9350610860818560208601610b8a565b61086981610bba565b9093019392505050565b6000610880601683610b7e565b7f6f766572666c6f77207831793120646574656374656400000000000000000000815260200192915050565b60006108b9601f83610b7e565b7f737562737472616374696f6e20756e646572666c6f7720646574656374656400815260200192915050565b60006108f2601683610b7e565b7f6f766572666c6f77207832793220646574656374656400000000000000000000815260200192915050565b600061092b603683610b7e565b7f63616e277420637265617465206669786964697479206e756d626572206c617281527f676572207468616e206d61784e65774669786564282900000000000000000000602082015260400192915050565b600061098a603483610b7e565b7f616d6f756e744f75742063616e742062652067726561746572207468656e207481527f686520746f6b656e4f7574506f6f6c2073697a65000000000000000000000000602082015260400192915050565b60006109e9601683610b7e565b7f6f766572666c6f77207831793220646574656374656400000000000000000000815260200192915050565b6000610a22601583610b7e565b7f616464206f766572666c6f772064657465637465640000000000000000000000815260200192915050565b6000610a5b601f83610b7e565b7f6f766572666c6f772078317931202a2066697865643120646574656374656400815260200192915050565b6000610a94601683610b7e565b7f6f766572666c6f77207832793120646574656374656400000000000000000000815260200192915050565b610ac981610b87565b82525050565b60208082528101610673818461083b565b602080825281016102d381610873565b602080825281016102d3816108ac565b602080825281016102d3816108e5565b602080825281016102d38161091e565b602080825281016102d38161097d565b602080825281016102d3816109dc565b602080825281016102d381610a15565b602080825281016102d381610a4e565b602080825281016102d381610a87565b602081016102d38284610ac0565b90815260200190565b90565b60005b83811015610ba5578181015183820152602001610b8d565b83811115610bb4576000848401525b50505050565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01690565b610beb81610b87565b8114610bf657600080fd5b5056fea365627a7a72315820b5d3f83f62e0a86aa9dcc82dd2bb232c88cfa635741c5f6b70fd4409389451fb6c6578706572696d656e74616cf564736f6c63430005110040
External libraries
AddressLinkedList : 0x6200f54d73491d56b8d7a975c9ee18efb4d518df
AddressSortedLinkedListWithMedian : 0xed477a99035d0c1e11369f1d7a4e587893cc002b