Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
Latest 1 from a total of 1 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
0x60806040 | 10822610 | 1474 days ago | IN | 0 ETH | 0.1441434 |
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Contract Name:
MainnetSUsdToSUsdAssimilator
Compiler Version
v0.5.15+commit.6a57276f
Contract Source Code (Solidity)
/** *Submitted for verification at Etherscan.io on 2020-09-08 */ // hevm: flattened sources of src/assimilators/mainnet/susdReserves/mainnetSUsdToSUsdAssimilator.sol pragma solidity >0.4.13 >=0.4.23 >=0.5.0 <0.6.0 >=0.5.7 <0.6.0; ////// lib/abdk-libraries-solidity/src/ABDKMath64x64.sol /* * ABDK Math 64.64 Smart Contract Library. Copyright © 2019 by ABDK Consulting. * Author: Mikhail Vladimirov <[email protected]> */ /* pragma solidity ^0.5.7; */ /** * Smart contract library of mathematical functions operating with signed * 64.64-bit fixed point numbers. Signed 64.64-bit fixed point number is * basically a simple fraction whose numerator is signed 128-bit integer and * denominator is 2^64. As long as denominator is always the same, there is no * need to store it, thus in Solidity signed 64.64-bit fixed point numbers are * represented by int128 type holding only the numerator. */ library ABDKMath64x64 { /** * Minimum value signed 64.64-bit fixed point number may have. */ int128 private constant MIN_64x64 = -0x80000000000000000000000000000000; /** * Maximum value signed 64.64-bit fixed point number may have. */ int128 private constant MAX_64x64 = 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF; /** * Convert signed 256-bit integer number into signed 64.64-bit fixed point * number. Revert on overflow. * * @param x signed 256-bit integer number * @return signed 64.64-bit fixed point number */ function fromInt (int256 x) internal pure returns (int128) { require (x >= -0x8000000000000000 && x <= 0x7FFFFFFFFFFFFFFF); return int128 (x << 64); } /** * Convert signed 64.64 fixed point number into signed 64-bit integer number * rounding down. * * @param x signed 64.64-bit fixed point number * @return signed 64-bit integer number */ function toInt (int128 x) internal pure returns (int64) { return int64 (x >> 64); } /** * Convert unsigned 256-bit integer number into signed 64.64-bit fixed point * number. Revert on overflow. * * @param x unsigned 256-bit integer number * @return signed 64.64-bit fixed point number */ function fromUInt (uint256 x) internal pure returns (int128) { require (x <= 0x7FFFFFFFFFFFFFFF); return int128 (x << 64); } /** * Convert signed 64.64 fixed point number into unsigned 64-bit integer * number rounding down. Revert on underflow. * * @param x signed 64.64-bit fixed point number * @return unsigned 64-bit integer number */ function toUInt (int128 x) internal pure returns (uint64) { require (x >= 0); return uint64 (x >> 64); } /** * Convert signed 128.128 fixed point number into signed 64.64-bit fixed point * number rounding down. Revert on overflow. * * @param x signed 128.128-bin fixed point number * @return signed 64.64-bit fixed point number */ function from128x128 (int256 x) internal pure returns (int128) { int256 result = x >> 64; require (result >= MIN_64x64 && result <= MAX_64x64); return int128 (result); } /** * Convert signed 64.64 fixed point number into signed 128.128 fixed point * number. * * @param x signed 64.64-bit fixed point number * @return signed 128.128 fixed point number */ function to128x128 (int128 x) internal pure returns (int256) { return int256 (x) << 64; } /** * Calculate x + y. Revert on overflow. * * @param x signed 64.64-bit fixed point number * @param y signed 64.64-bit fixed point number * @return signed 64.64-bit fixed point number */ function add (int128 x, int128 y) internal pure returns (int128) { int256 result = int256(x) + y; require (result >= MIN_64x64 && result <= MAX_64x64); return int128 (result); } /** * Calculate x - y. Revert on overflow. * * @param x signed 64.64-bit fixed point number * @param y signed 64.64-bit fixed point number * @return signed 64.64-bit fixed point number */ function sub (int128 x, int128 y) internal pure returns (int128) { int256 result = int256(x) - y; require (result >= MIN_64x64 && result <= MAX_64x64); return int128 (result); } /** * Calculate x * y rounding down. Revert on overflow. * * @param x signed 64.64-bit fixed point number * @param y signed 64.64-bit fixed point number * @return signed 64.64-bit fixed point number */ function mul (int128 x, int128 y) internal pure returns (int128) { int256 result = int256(x) * y >> 64; require (result >= MIN_64x64 && result <= MAX_64x64); return int128 (result); } /** * Calculate x * y rounding towards zero, where x is signed 64.64 fixed point * number and y is signed 256-bit integer number. Revert on overflow. * * @param x signed 64.64 fixed point number * @param y signed 256-bit integer number * @return signed 256-bit integer number */ function muli (int128 x, int256 y) internal pure returns (int256) { if (x == MIN_64x64) { require (y >= -0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF && y <= 0x1000000000000000000000000000000000000000000000000); return -y << 63; } else { bool negativeResult = false; if (x < 0) { x = -x; negativeResult = true; } if (y < 0) { y = -y; // We rely on overflow behavior here negativeResult = !negativeResult; } uint256 absoluteResult = mulu (x, uint256 (y)); if (negativeResult) { require (absoluteResult <= 0x8000000000000000000000000000000000000000000000000000000000000000); return -int256 (absoluteResult); // We rely on overflow behavior here } else { require (absoluteResult <= 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF); return int256 (absoluteResult); } } } /** * Calculate x * y rounding down, where x is signed 64.64 fixed point number * and y is unsigned 256-bit integer number. Revert on overflow. * * @param x signed 64.64 fixed point number * @param y unsigned 256-bit integer number * @return unsigned 256-bit integer number */ function mulu (int128 x, uint256 y) internal pure returns (uint256) { if (y == 0) return 0; require (x >= 0); uint256 lo = (uint256 (x) * (y & 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF)) >> 64; uint256 hi = uint256 (x) * (y >> 128); require (hi <= 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF); hi <<= 64; require (hi <= 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF - lo); return hi + lo; } /** * Calculate x / y rounding towards zero. Revert on overflow or when y is * zero. * * @param x signed 64.64-bit fixed point number * @param y signed 64.64-bit fixed point number * @return signed 64.64-bit fixed point number */ function div (int128 x, int128 y) internal pure returns (int128) { require (y != 0); int256 result = (int256 (x) << 64) / y; require (result >= MIN_64x64 && result <= MAX_64x64); return int128 (result); } /** * Calculate x / y rounding towards zero, where x and y are signed 256-bit * integer numbers. Revert on overflow or when y is zero. * * @param x signed 256-bit integer number * @param y signed 256-bit integer number * @return signed 64.64-bit fixed point number */ function divi (int256 x, int256 y) internal pure returns (int128) { require (y != 0); bool negativeResult = false; if (x < 0) { x = -x; // We rely on overflow behavior here negativeResult = true; } if (y < 0) { y = -y; // We rely on overflow behavior here negativeResult = !negativeResult; } uint128 absoluteResult = divuu (uint256 (x), uint256 (y)); if (negativeResult) { require (absoluteResult <= 0x80000000000000000000000000000000); return -int128 (absoluteResult); // We rely on overflow behavior here } else { require (absoluteResult <= 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF); return int128 (absoluteResult); // We rely on overflow behavior here } } /** * Calculate x / y rounding towards zero, where x and y are unsigned 256-bit * integer numbers. Revert on overflow or when y is zero. * * @param x unsigned 256-bit integer number * @param y unsigned 256-bit integer number * @return signed 64.64-bit fixed point number */ function divu (uint256 x, uint256 y) internal pure returns (int128) { require (y != 0); uint128 result = divuu (x, y); require (result <= uint128 (MAX_64x64)); return int128 (result); } /** * Calculate -x. Revert on overflow. * * @param x signed 64.64-bit fixed point number * @return signed 64.64-bit fixed point number */ function neg (int128 x) internal pure returns (int128) { require (x != MIN_64x64); return -x; } /** * Calculate |x|. Revert on overflow. * * @param x signed 64.64-bit fixed point number * @return signed 64.64-bit fixed point number */ function abs (int128 x) internal pure returns (int128) { require (x != MIN_64x64); return x < 0 ? -x : x; } /** * Calculate 1 / x rounding towards zero. Revert on overflow or when x is * zero. * * @param x signed 64.64-bit fixed point number * @return signed 64.64-bit fixed point number */ function inv (int128 x) internal pure returns (int128) { require (x != 0); int256 result = int256 (0x100000000000000000000000000000000) / x; require (result >= MIN_64x64 && result <= MAX_64x64); return int128 (result); } /** * Calculate arithmetics average of x and y, i.e. (x + y) / 2 rounding down. * * @param x signed 64.64-bit fixed point number * @param y signed 64.64-bit fixed point number * @return signed 64.64-bit fixed point number */ function avg (int128 x, int128 y) internal pure returns (int128) { return int128 ((int256 (x) + int256 (y)) >> 1); } /** * Calculate geometric average of x and y, i.e. sqrt (x * y) rounding down. * Revert on overflow or in case x * y is negative. * * @param x signed 64.64-bit fixed point number * @param y signed 64.64-bit fixed point number * @return signed 64.64-bit fixed point number */ function gavg (int128 x, int128 y) internal pure returns (int128) { int256 m = int256 (x) * int256 (y); require (m >= 0); require (m < 0x4000000000000000000000000000000000000000000000000000000000000000); return int128 (sqrtu (uint256 (m), uint256 (x) + uint256 (y) >> 1)); } /** * Calculate x^y assuming 0^0 is 1, where x is signed 64.64 fixed point number * and y is unsigned 256-bit integer number. Revert on overflow. * * @param x signed 64.64-bit fixed point number * @param y uint256 value * @return signed 64.64-bit fixed point number */ function pow (int128 x, uint256 y) internal pure returns (int128) { uint256 absoluteResult; bool negativeResult = false; if (x >= 0) { absoluteResult = powu (uint256 (x) << 63, y); } else { // We rely on overflow behavior here absoluteResult = powu (uint256 (uint128 (-x)) << 63, y); negativeResult = y & 1 > 0; } absoluteResult >>= 63; if (negativeResult) { require (absoluteResult <= 0x80000000000000000000000000000000); return -int128 (absoluteResult); // We rely on overflow behavior here } else { require (absoluteResult <= 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF); return int128 (absoluteResult); // We rely on overflow behavior here } } /** * Calculate sqrt (x) rounding down. Revert if x < 0. * * @param x signed 64.64-bit fixed point number * @return signed 64.64-bit fixed point number */ function sqrt (int128 x) internal pure returns (int128) { require (x >= 0); return int128 (sqrtu (uint256 (x) << 64, 0x10000000000000000)); } /** * Calculate binary logarithm of x. Revert if x <= 0. * * @param x signed 64.64-bit fixed point number * @return signed 64.64-bit fixed point number */ function log_2 (int128 x) internal pure returns (int128) { require (x > 0); int256 msb = 0; int256 xc = x; if (xc >= 0x10000000000000000) { xc >>= 64; msb += 64; } if (xc >= 0x100000000) { xc >>= 32; msb += 32; } if (xc >= 0x10000) { xc >>= 16; msb += 16; } if (xc >= 0x100) { xc >>= 8; msb += 8; } if (xc >= 0x10) { xc >>= 4; msb += 4; } if (xc >= 0x4) { xc >>= 2; msb += 2; } if (xc >= 0x2) msb += 1; // No need to shift xc anymore int256 result = msb - 64 << 64; uint256 ux = uint256 (x) << 127 - msb; for (int256 bit = 0x8000000000000000; bit > 0; bit >>= 1) { ux *= ux; uint256 b = ux >> 255; ux >>= 127 + b; result += bit * int256 (b); } return int128 (result); } /** * Calculate natural logarithm of x. Revert if x <= 0. * * @param x signed 64.64-bit fixed point number * @return signed 64.64-bit fixed point number */ function ln (int128 x) internal pure returns (int128) { require (x > 0); return int128 ( uint256 (log_2 (x)) * 0xB17217F7D1CF79ABC9E3B39803F2F6AF >> 128); } /** * Calculate binary exponent of x. Revert on overflow. * * @param x signed 64.64-bit fixed point number * @return signed 64.64-bit fixed point number */ function exp_2 (int128 x) internal pure returns (int128) { require (x < 0x400000000000000000); // Overflow if (x < -0x400000000000000000) return 0; // Underflow uint256 result = 0x80000000000000000000000000000000; if (x & 0x8000000000000000 > 0) result = result * 0x16A09E667F3BCC908B2FB1366EA957D3E >> 128; if (x & 0x4000000000000000 > 0) result = result * 0x1306FE0A31B7152DE8D5A46305C85EDEC >> 128; if (x & 0x2000000000000000 > 0) result = result * 0x1172B83C7D517ADCDF7C8C50EB14A791F >> 128; if (x & 0x1000000000000000 > 0) result = result * 0x10B5586CF9890F6298B92B71842A98363 >> 128; if (x & 0x800000000000000 > 0) result = result * 0x1059B0D31585743AE7C548EB68CA417FD >> 128; if (x & 0x400000000000000 > 0) result = result * 0x102C9A3E778060EE6F7CACA4F7A29BDE8 >> 128; if (x & 0x200000000000000 > 0) result = result * 0x10163DA9FB33356D84A66AE336DCDFA3F >> 128; if (x & 0x100000000000000 > 0) result = result * 0x100B1AFA5ABCBED6129AB13EC11DC9543 >> 128; if (x & 0x80000000000000 > 0) result = result * 0x10058C86DA1C09EA1FF19D294CF2F679B >> 128; if (x & 0x40000000000000 > 0) result = result * 0x1002C605E2E8CEC506D21BFC89A23A00F >> 128; if (x & 0x20000000000000 > 0) result = result * 0x100162F3904051FA128BCA9C55C31E5DF >> 128; if (x & 0x10000000000000 > 0) result = result * 0x1000B175EFFDC76BA38E31671CA939725 >> 128; if (x & 0x8000000000000 > 0) result = result * 0x100058BA01FB9F96D6CACD4B180917C3D >> 128; if (x & 0x4000000000000 > 0) result = result * 0x10002C5CC37DA9491D0985C348C68E7B3 >> 128; if (x & 0x2000000000000 > 0) result = result * 0x1000162E525EE054754457D5995292026 >> 128; if (x & 0x1000000000000 > 0) result = result * 0x10000B17255775C040618BF4A4ADE83FC >> 128; if (x & 0x800000000000 > 0) result = result * 0x1000058B91B5BC9AE2EED81E9B7D4CFAB >> 128; if (x & 0x400000000000 > 0) result = result * 0x100002C5C89D5EC6CA4D7C8ACC017B7C9 >> 128; if (x & 0x200000000000 > 0) result = result * 0x10000162E43F4F831060E02D839A9D16D >> 128; if (x & 0x100000000000 > 0) result = result * 0x100000B1721BCFC99D9F890EA06911763 >> 128; if (x & 0x80000000000 > 0) result = result * 0x10000058B90CF1E6D97F9CA14DBCC1628 >> 128; if (x & 0x40000000000 > 0) result = result * 0x1000002C5C863B73F016468F6BAC5CA2B >> 128; if (x & 0x20000000000 > 0) result = result * 0x100000162E430E5A18F6119E3C02282A5 >> 128; if (x & 0x10000000000 > 0) result = result * 0x1000000B1721835514B86E6D96EFD1BFE >> 128; if (x & 0x8000000000 > 0) result = result * 0x100000058B90C0B48C6BE5DF846C5B2EF >> 128; if (x & 0x4000000000 > 0) result = result * 0x10000002C5C8601CC6B9E94213C72737A >> 128; if (x & 0x2000000000 > 0) result = result * 0x1000000162E42FFF037DF38AA2B219F06 >> 128; if (x & 0x1000000000 > 0) result = result * 0x10000000B17217FBA9C739AA5819F44F9 >> 128; if (x & 0x800000000 > 0) result = result * 0x1000000058B90BFCDEE5ACD3C1CEDC823 >> 128; if (x & 0x400000000 > 0) result = result * 0x100000002C5C85FE31F35A6A30DA1BE50 >> 128; if (x & 0x200000000 > 0) result = result * 0x10000000162E42FF0999CE3541B9FFFCF >> 128; if (x & 0x100000000 > 0) result = result * 0x100000000B17217F80F4EF5AADDA45554 >> 128; if (x & 0x80000000 > 0) result = result * 0x10000000058B90BFBF8479BD5A81B51AD >> 128; if (x & 0x40000000 > 0) result = result * 0x1000000002C5C85FDF84BD62AE30A74CC >> 128; if (x & 0x20000000 > 0) result = result * 0x100000000162E42FEFB2FED257559BDAA >> 128; if (x & 0x10000000 > 0) result = result * 0x1000000000B17217F7D5A7716BBA4A9AE >> 128; if (x & 0x8000000 > 0) result = result * 0x100000000058B90BFBE9DDBAC5E109CCE >> 128; if (x & 0x4000000 > 0) result = result * 0x10000000002C5C85FDF4B15DE6F17EB0D >> 128; if (x & 0x2000000 > 0) result = result * 0x1000000000162E42FEFA494F1478FDE05 >> 128; if (x & 0x1000000 > 0) result = result * 0x10000000000B17217F7D20CF927C8E94C >> 128; if (x & 0x800000 > 0) result = result * 0x1000000000058B90BFBE8F71CB4E4B33D >> 128; if (x & 0x400000 > 0) result = result * 0x100000000002C5C85FDF477B662B26945 >> 128; if (x & 0x200000 > 0) result = result * 0x10000000000162E42FEFA3AE53369388C >> 128; if (x & 0x100000 > 0) result = result * 0x100000000000B17217F7D1D351A389D40 >> 128; if (x & 0x80000 > 0) result = result * 0x10000000000058B90BFBE8E8B2D3D4EDE >> 128; if (x & 0x40000 > 0) result = result * 0x1000000000002C5C85FDF4741BEA6E77E >> 128; if (x & 0x20000 > 0) result = result * 0x100000000000162E42FEFA39FE95583C2 >> 128; if (x & 0x10000 > 0) result = result * 0x1000000000000B17217F7D1CFB72B45E1 >> 128; if (x & 0x8000 > 0) result = result * 0x100000000000058B90BFBE8E7CC35C3F0 >> 128; if (x & 0x4000 > 0) result = result * 0x10000000000002C5C85FDF473E242EA38 >> 128; if (x & 0x2000 > 0) result = result * 0x1000000000000162E42FEFA39F02B772C >> 128; if (x & 0x1000 > 0) result = result * 0x10000000000000B17217F7D1CF7D83C1A >> 128; if (x & 0x800 > 0) result = result * 0x1000000000000058B90BFBE8E7BDCBE2E >> 128; if (x & 0x400 > 0) result = result * 0x100000000000002C5C85FDF473DEA871F >> 128; if (x & 0x200 > 0) result = result * 0x10000000000000162E42FEFA39EF44D91 >> 128; if (x & 0x100 > 0) result = result * 0x100000000000000B17217F7D1CF79E949 >> 128; if (x & 0x80 > 0) result = result * 0x10000000000000058B90BFBE8E7BCE544 >> 128; if (x & 0x40 > 0) result = result * 0x1000000000000002C5C85FDF473DE6ECA >> 128; if (x & 0x20 > 0) result = result * 0x100000000000000162E42FEFA39EF366F >> 128; if (x & 0x10 > 0) result = result * 0x1000000000000000B17217F7D1CF79AFA >> 128; if (x & 0x8 > 0) result = result * 0x100000000000000058B90BFBE8E7BCD6D >> 128; if (x & 0x4 > 0) result = result * 0x10000000000000002C5C85FDF473DE6B2 >> 128; if (x & 0x2 > 0) result = result * 0x1000000000000000162E42FEFA39EF358 >> 128; if (x & 0x1 > 0) result = result * 0x10000000000000000B17217F7D1CF79AB >> 128; result >>= 63 - (x >> 64); require (result <= uint256 (MAX_64x64)); return int128 (result); } /** * Calculate natural exponent of x. Revert on overflow. * * @param x signed 64.64-bit fixed point number * @return signed 64.64-bit fixed point number */ function exp (int128 x) internal pure returns (int128) { require (x < 0x400000000000000000); // Overflow if (x < -0x400000000000000000) return 0; // Underflow return exp_2 ( int128 (int256 (x) * 0x171547652B82FE1777D0FFDA0D23A7D12 >> 128)); } /** * Calculate x / y rounding towards zero, where x and y are unsigned 256-bit * integer numbers. Revert on overflow or when y is zero. * * @param x unsigned 256-bit integer number * @param y unsigned 256-bit integer number * @return unsigned 64.64-bit fixed point number */ function divuu (uint256 x, uint256 y) private pure returns (uint128) { require (y != 0); uint256 result; if (x <= 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF) result = (x << 64) / y; else { uint256 msb = 192; uint256 xc = x >> 192; if (xc >= 0x100000000) { xc >>= 32; msb += 32; } if (xc >= 0x10000) { xc >>= 16; msb += 16; } if (xc >= 0x100) { xc >>= 8; msb += 8; } if (xc >= 0x10) { xc >>= 4; msb += 4; } if (xc >= 0x4) { xc >>= 2; msb += 2; } if (xc >= 0x2) msb += 1; // No need to shift xc anymore result = (x << 255 - msb) / ((y - 1 >> msb - 191) + 1); require (result <= 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF); uint256 hi = result * (y >> 128); uint256 lo = result * (y & 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF); uint256 xh = x >> 192; uint256 xl = x << 64; if (xl < lo) xh -= 1; xl -= lo; // We rely on overflow behavior here lo = hi << 128; if (xl < lo) xh -= 1; xl -= lo; // We rely on overflow behavior here assert (xh == hi >> 128); result += xl / y; } require (result <= 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF); return uint128 (result); } /** * Calculate x^y assuming 0^0 is 1, where x is unsigned 129.127 fixed point * number and y is unsigned 256-bit integer number. Revert on overflow. * * @param x unsigned 129.127-bit fixed point number * @param y uint256 value * @return unsigned 129.127-bit fixed point number */ function powu (uint256 x, uint256 y) private pure returns (uint256) { if (y == 0) return 0x80000000000000000000000000000000; else if (x == 0) return 0; else { int256 msb = 0; uint256 xc = x; if (xc >= 0x100000000000000000000000000000000) { xc >>= 128; msb += 128; } if (xc >= 0x10000000000000000) { xc >>= 64; msb += 64; } if (xc >= 0x100000000) { xc >>= 32; msb += 32; } if (xc >= 0x10000) { xc >>= 16; msb += 16; } if (xc >= 0x100) { xc >>= 8; msb += 8; } if (xc >= 0x10) { xc >>= 4; msb += 4; } if (xc >= 0x4) { xc >>= 2; msb += 2; } if (xc >= 0x2) msb += 1; // No need to shift xc anymore int256 xe = msb - 127; if (xe > 0) x >>= xe; else x <<= -xe; uint256 result = 0x80000000000000000000000000000000; int256 re = 0; while (y > 0) { if (y & 1 > 0) { result = result * x; y -= 1; re += xe; if (result >= 0x8000000000000000000000000000000000000000000000000000000000000000) { result >>= 128; re += 1; } else result >>= 127; if (re < -127) return 0; // Underflow require (re < 128); // Overflow } else { x = x * x; y >>= 1; xe <<= 1; if (x >= 0x8000000000000000000000000000000000000000000000000000000000000000) { x >>= 128; xe += 1; } else x >>= 127; if (xe < -127) return 0; // Underflow require (xe < 128); // Overflow } } if (re > 0) result <<= re; else if (re < 0) result >>= -re; return result; } } /** * Calculate sqrt (x) rounding down, where x is unsigned 256-bit integer * number. * * @param x unsigned 256-bit integer number * @return unsigned 128-bit integer number */ function sqrtu (uint256 x, uint256 r) private pure returns (uint128) { if (x == 0) return 0; else { require (r > 0); while (true) { uint256 rr = x / r; if (r == rr || r + 1 == rr) return uint128 (r); else if (r == rr + 1) return uint128 (rr); r = r + rr + 1 >> 1; } } } } ////// src/interfaces/IAssimilator.sol // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. /* pragma solidity ^0.5.0; */ interface IAssimilator { function intakeRaw (uint256 amount) external returns (int128); function intakeRawAndGetBalance (uint256 amount) external returns (int128, int128); function intakeNumeraire (int128 amount) external returns (uint256); function outputRaw (address dst, uint256 amount) external returns (int128); function outputRawAndGetBalance (address dst, uint256 amount) external returns (int128, int128); function outputNumeraire (address dst, int128 amount) external returns (uint256); function viewRawAmount (int128) external view returns (uint256); function viewNumeraireAmount (uint256) external view returns (int128); function viewNumeraireBalance (address) external view returns (int128); function viewNumeraireAmountAndBalance (address, uint256) external view returns (int128, int128); } ////// src/interfaces/IERC20.sol /* pragma solidity ^0.5.0; */ /** * @dev Interface of the ERC20 standard as defined in the EIP. Does not include * the optional functions; to access them see {ERC20Detailed}. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); } ////// src/assimilators/mainnet/susdReserves/mainnetSUsdToSUsdAssimilator.sol // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. /* pragma solidity ^0.5.0; */ /* import "abdk-libraries-solidity/ABDKMath64x64.sol"; */ /* import "../../../interfaces/IERC20.sol"; */ /* import "../../../interfaces/IAssimilator.sol"; */ contract MainnetSUsdToSUsdAssimilator is IAssimilator { using ABDKMath64x64 for int128; using ABDKMath64x64 for uint256; IERC20 constant susd = IERC20(0x57Ab1ec28D129707052df4dF418D58a2D46d5f51); constructor () public { } function intakeRawAndGetBalance (uint256 _amount) public returns (int128 amount_, int128 balance_) { bool _success = susd.transferFrom(msg.sender, address(this), _amount); require(_success, "Shell/SUSD-transfer-from-failed"); uint256 _balance = susd.balanceOf(address(this)); balance_ = _balance.divu(1e18); amount_ = _amount.divu(1e18); } function intakeRaw (uint256 _amount) public returns (int128 amount_) { bool _success = susd.transferFrom(msg.sender, address(this), _amount); require(_success, "Shell/SUSD-transfer-from-failed"); amount_ = _amount.divu(1e18); } function intakeNumeraire (int128 _amount) public returns (uint256 amount_) { // truncate stray decimals caused by conversion amount_ = _amount.mulu(1e18) / 1e3 * 1e3; bool _success = susd.transferFrom(msg.sender, address(this), amount_); require(_success, "Shell/SUSD-transfer-from-failed"); } function outputRawAndGetBalance (address _dst, uint256 _amount) public returns (int128 amount_, int128 balance_) { bool _success = susd.transfer(_dst, _amount); require(_success, "Shell/SUSD-transfer-failed"); uint256 _balance = susd.balanceOf(address(this)); amount_ = _amount.divu(1e18); balance_ = _balance.divu(1e18); } function outputRaw (address _dst, uint256 _amount) public returns (int128 amount_) { bool _success = susd.transfer(_dst, _amount); require(_success, "Shell/SUSD-transfer-failed"); amount_ = _amount.divu(1e18); } // takes numeraire amount, transfers to destination, returns raw amount function outputNumeraire (address _dst, int128 _amount) public returns (uint256 amount_) { amount_ = _amount.mulu(1e18); bool _success = susd.transfer(_dst, amount_); require(_success, "Shell/SUSD-transfer-failed"); } // takes numeraire amount, returns raw amount function viewRawAmount (int128 _amount) public view returns (uint256 amount_) { amount_ = _amount.mulu(1e18); } // takes raw amount, returns numeraire amount function viewNumeraireAmount (uint256 _amount) public view returns (int128 amount_) { amount_ = _amount.divu(1e18); } // returns numeraire value of reserve asset, in this case ASUsd function viewNumeraireBalance (address _addr) public view returns (int128 balance_) { uint256 _balance = susd.balanceOf(_addr); balance_ = _balance.divu(1e18); } // takes raw amount, returns numeraire amount function viewNumeraireAmountAndBalance (address _addr, uint256 _amount) public view returns (int128 amount_, int128 balance_) { amount_ = _amount.divu(1e18); uint256 _balance = susd.balanceOf(_addr); balance_ = _balance.divu(1e18); } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"constant":false,"inputs":[{"internalType":"int128","name":"_amount","type":"int128"}],"name":"intakeNumeraire","outputs":[{"internalType":"uint256","name":"amount_","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"intakeRaw","outputs":[{"internalType":"int128","name":"amount_","type":"int128"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"intakeRawAndGetBalance","outputs":[{"internalType":"int128","name":"amount_","type":"int128"},{"internalType":"int128","name":"balance_","type":"int128"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"_dst","type":"address"},{"internalType":"int128","name":"_amount","type":"int128"}],"name":"outputNumeraire","outputs":[{"internalType":"uint256","name":"amount_","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"_dst","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"outputRaw","outputs":[{"internalType":"int128","name":"amount_","type":"int128"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"_dst","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"outputRawAndGetBalance","outputs":[{"internalType":"int128","name":"amount_","type":"int128"},{"internalType":"int128","name":"balance_","type":"int128"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"viewNumeraireAmount","outputs":[{"internalType":"int128","name":"amount_","type":"int128"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"_addr","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"viewNumeraireAmountAndBalance","outputs":[{"internalType":"int128","name":"amount_","type":"int128"},{"internalType":"int128","name":"balance_","type":"int128"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"_addr","type":"address"}],"name":"viewNumeraireBalance","outputs":[{"internalType":"int128","name":"balance_","type":"int128"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"int128","name":"_amount","type":"int128"}],"name":"viewRawAmount","outputs":[{"internalType":"uint256","name":"amount_","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"}]
Contract Creation Code
608060405234801561001057600080fd5b506114cf806100206000396000f3fe608060405234801561001057600080fd5b506004361061009e5760003560e01c80637f328ecc116100665780637f328ecc1461027c578063ac969a73146102d1578063f09a3fc31461032f578063f5e6c0ca14610397578063fa00102a146103df5761009e565b80630271c3c8146100a35780631e9b2cba146100e8578063523bf2571461015d5780636b677a8f146101d25780636fc3905214610217575b600080fd5b6100d2600480360360208110156100b957600080fd5b810190808035600f0b9060200190929190505050610427565b6040518082815260200191505060405180910390f35b610134600480360360408110156100fe57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506105dd565b6040518083600f0b600f0b815260200182600f0b600f0b81526020019250505060405180910390f35b6101a96004803603604081101561017357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506106f2565b6040518083600f0b600f0b815260200182600f0b600f0b81526020019250505060405180910390f35b610201600480360360208110156101e857600080fd5b810190808035600f0b9060200190929190505050610955565b6040518082815260200191505060405180910390f35b6102666004803603604081101561022d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035600f0b906020019092919050505061097c565b6040518082815260200191505060405180910390f35b6102a86004803603602081101561029257600080fd5b8101908080359060200190929190505050610af2565b6040518083600f0b600f0b815260200182600f0b600f0b81526020019250505060405180910390f35b610313600480360360208110156102e757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d87565b6040518082600f0b600f0b815260200191505060405180910390f35b61037b6004803603604081101561034557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610e7b565b6040518082600f0b600f0b815260200191505060405180910390f35b6103c3600480360360208110156103ad57600080fd5b8101908080359060200190929190505050610fed565b6040518082600f0b600f0b815260200191505060405180910390f35b61040b600480360360208110156103f557600080fd5b8101908080359060200190929190505050611011565b6040518082600f0b600f0b815260200191505060405180910390f35b60006103e88061044b670de0b6b3a764000085600f0b6111b690919063ffffffff16565b8161045257fe5b0402905060007357ab1ec28d129707052df4df418d58a2d46d5f5173ffffffffffffffffffffffffffffffffffffffff166323b872dd3330856040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b15801561052757600080fd5b505af115801561053b573d6000803e3d6000fd5b505050506040513d602081101561055157600080fd5b81019080805190602001909291905050509050806105d7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f5368656c6c2f535553442d7472616e736665722d66726f6d2d6661696c65640081525060200191505060405180910390fd5b50919050565b6000806105fb670de0b6b3a76400008461127190919063ffffffff16565b915060007357ab1ec28d129707052df4df418d58a2d46d5f5173ffffffffffffffffffffffffffffffffffffffff166370a08231866040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b15801561069057600080fd5b505afa1580156106a4573d6000803e3d6000fd5b505050506040513d60208110156106ba57600080fd5b810190808051906020019092919050505090506106e8670de0b6b3a76400008261127190919063ffffffff16565b9150509250929050565b60008060007357ab1ec28d129707052df4df418d58a2d46d5f5173ffffffffffffffffffffffffffffffffffffffff1663a9059cbb86866040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561079257600080fd5b505af11580156107a6573d6000803e3d6000fd5b505050506040513d60208110156107bc57600080fd5b8101908080519060200190929190505050905080610842576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f5368656c6c2f535553442d7472616e736665722d6661696c656400000000000081525060200191505060405180910390fd5b60007357ab1ec28d129707052df4df418d58a2d46d5f5173ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b1580156108d557600080fd5b505afa1580156108e9573d6000803e3d6000fd5b505050506040513d60208110156108ff57600080fd5b8101908080519060200190929190505050905061092d670de0b6b3a76400008661127190919063ffffffff16565b935061094a670de0b6b3a76400008261127190919063ffffffff16565b925050509250929050565b6000610975670de0b6b3a764000083600f0b6111b690919063ffffffff16565b9050919050565b600061099c670de0b6b3a764000083600f0b6111b690919063ffffffff16565b905060007357ab1ec28d129707052df4df418d58a2d46d5f5173ffffffffffffffffffffffffffffffffffffffff1663a9059cbb85846040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015610a3b57600080fd5b505af1158015610a4f573d6000803e3d6000fd5b505050506040513d6020811015610a6557600080fd5b8101908080519060200190929190505050905080610aeb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f5368656c6c2f535553442d7472616e736665722d6661696c656400000000000081525060200191505060405180910390fd5b5092915050565b60008060007357ab1ec28d129707052df4df418d58a2d46d5f5173ffffffffffffffffffffffffffffffffffffffff166323b872dd3330876040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b158015610bc657600080fd5b505af1158015610bda573d6000803e3d6000fd5b505050506040513d6020811015610bf057600080fd5b8101908080519060200190929190505050905080610c76576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f5368656c6c2f535553442d7472616e736665722d66726f6d2d6661696c65640081525060200191505060405180910390fd5b60007357ab1ec28d129707052df4df418d58a2d46d5f5173ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015610d0957600080fd5b505afa158015610d1d573d6000803e3d6000fd5b505050506040513d6020811015610d3357600080fd5b81019080805190602001909291905050509050610d61670de0b6b3a76400008261127190919063ffffffff16565b9250610d7e670de0b6b3a76400008661127190919063ffffffff16565b93505050915091565b6000807357ab1ec28d129707052df4df418d58a2d46d5f5173ffffffffffffffffffffffffffffffffffffffff166370a08231846040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015610e1b57600080fd5b505afa158015610e2f573d6000803e3d6000fd5b505050506040513d6020811015610e4557600080fd5b81019080805190602001909291905050509050610e73670de0b6b3a76400008261127190919063ffffffff16565b915050919050565b6000807357ab1ec28d129707052df4df418d58a2d46d5f5173ffffffffffffffffffffffffffffffffffffffff1663a9059cbb85856040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015610f1957600080fd5b505af1158015610f2d573d6000803e3d6000fd5b505050506040513d6020811015610f4357600080fd5b8101908080519060200190929190505050905080610fc9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f5368656c6c2f535553442d7472616e736665722d6661696c656400000000000081525060200191505060405180910390fd5b610fe4670de0b6b3a76400008461127190919063ffffffff16565b91505092915050565b600061100a670de0b6b3a76400008361127190919063ffffffff16565b9050919050565b6000807357ab1ec28d129707052df4df418d58a2d46d5f5173ffffffffffffffffffffffffffffffffffffffff166323b872dd3330866040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b1580156110e357600080fd5b505af11580156110f7573d6000803e3d6000fd5b505050506040513d602081101561110d57600080fd5b8101908080519060200190929190505050905080611193576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f5368656c6c2f535553442d7472616e736665722d66726f6d2d6661696c65640081525060200191505060405180910390fd5b6111ae670de0b6b3a76400008461127190919063ffffffff16565b915050919050565b6000808214156111c9576000905061126b565b600083600f0b12156111da57600080fd5b600060406fffffffffffffffffffffffffffffffff841685600f0b02901c90506000608084901c85600f0b02905077ffffffffffffffffffffffffffffffffffffffffffffffff81111561122d57600080fd5b604081901b9050817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0381111561126357600080fd5b818101925050505b92915050565b60008082141561128057600080fd5b600061128c84846112d9565b90506f7fffffffffffffffffffffffffffffff6fffffffffffffffffffffffffffffffff16816fffffffffffffffffffffffffffffffff1611156112cf57600080fd5b8091505092915050565b6000808214156112e857600080fd5b600077ffffffffffffffffffffffffffffffffffffffffffffffff841161131e5782604085901b8161131657fe5b049050611473565b600060c09050600060c086901c9050640100000000811061134757602081901c90506020820191505b62010000811061135f57601081901c90506010820191505b610100811061137657600881901c90506008820191505b6010811061138c57600481901c90506004820191505b600481106113a257600281901c90506002820191505b600281106113b1576001820191505b600160bf830360018703901c018260ff0387901b816113cc57fe5b0492506fffffffffffffffffffffffffffffffff8311156113ec57600080fd5b6000608086901c8402905060006fffffffffffffffffffffffffffffffff871685029050600060c089901c9050600060408a901b905082811015611431576001820391505b8281039050608084901b92508281101561144c576001820391505b8281039050608084901c821461145e57fe5b88818161146757fe5b04870196505050505050505b6fffffffffffffffffffffffffffffffff81111561149057600080fd5b809150509291505056fea265627a7a723158201fc1f34cb2219a9e8163aad79e721117a36b2c9e015203282936750c5e78fc0864736f6c634300050f0032
Deployed Bytecode
0x608060405234801561001057600080fd5b506004361061009e5760003560e01c80637f328ecc116100665780637f328ecc1461027c578063ac969a73146102d1578063f09a3fc31461032f578063f5e6c0ca14610397578063fa00102a146103df5761009e565b80630271c3c8146100a35780631e9b2cba146100e8578063523bf2571461015d5780636b677a8f146101d25780636fc3905214610217575b600080fd5b6100d2600480360360208110156100b957600080fd5b810190808035600f0b9060200190929190505050610427565b6040518082815260200191505060405180910390f35b610134600480360360408110156100fe57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506105dd565b6040518083600f0b600f0b815260200182600f0b600f0b81526020019250505060405180910390f35b6101a96004803603604081101561017357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506106f2565b6040518083600f0b600f0b815260200182600f0b600f0b81526020019250505060405180910390f35b610201600480360360208110156101e857600080fd5b810190808035600f0b9060200190929190505050610955565b6040518082815260200191505060405180910390f35b6102666004803603604081101561022d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035600f0b906020019092919050505061097c565b6040518082815260200191505060405180910390f35b6102a86004803603602081101561029257600080fd5b8101908080359060200190929190505050610af2565b6040518083600f0b600f0b815260200182600f0b600f0b81526020019250505060405180910390f35b610313600480360360208110156102e757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d87565b6040518082600f0b600f0b815260200191505060405180910390f35b61037b6004803603604081101561034557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610e7b565b6040518082600f0b600f0b815260200191505060405180910390f35b6103c3600480360360208110156103ad57600080fd5b8101908080359060200190929190505050610fed565b6040518082600f0b600f0b815260200191505060405180910390f35b61040b600480360360208110156103f557600080fd5b8101908080359060200190929190505050611011565b6040518082600f0b600f0b815260200191505060405180910390f35b60006103e88061044b670de0b6b3a764000085600f0b6111b690919063ffffffff16565b8161045257fe5b0402905060007357ab1ec28d129707052df4df418d58a2d46d5f5173ffffffffffffffffffffffffffffffffffffffff166323b872dd3330856040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b15801561052757600080fd5b505af115801561053b573d6000803e3d6000fd5b505050506040513d602081101561055157600080fd5b81019080805190602001909291905050509050806105d7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f5368656c6c2f535553442d7472616e736665722d66726f6d2d6661696c65640081525060200191505060405180910390fd5b50919050565b6000806105fb670de0b6b3a76400008461127190919063ffffffff16565b915060007357ab1ec28d129707052df4df418d58a2d46d5f5173ffffffffffffffffffffffffffffffffffffffff166370a08231866040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b15801561069057600080fd5b505afa1580156106a4573d6000803e3d6000fd5b505050506040513d60208110156106ba57600080fd5b810190808051906020019092919050505090506106e8670de0b6b3a76400008261127190919063ffffffff16565b9150509250929050565b60008060007357ab1ec28d129707052df4df418d58a2d46d5f5173ffffffffffffffffffffffffffffffffffffffff1663a9059cbb86866040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561079257600080fd5b505af11580156107a6573d6000803e3d6000fd5b505050506040513d60208110156107bc57600080fd5b8101908080519060200190929190505050905080610842576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f5368656c6c2f535553442d7472616e736665722d6661696c656400000000000081525060200191505060405180910390fd5b60007357ab1ec28d129707052df4df418d58a2d46d5f5173ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b1580156108d557600080fd5b505afa1580156108e9573d6000803e3d6000fd5b505050506040513d60208110156108ff57600080fd5b8101908080519060200190929190505050905061092d670de0b6b3a76400008661127190919063ffffffff16565b935061094a670de0b6b3a76400008261127190919063ffffffff16565b925050509250929050565b6000610975670de0b6b3a764000083600f0b6111b690919063ffffffff16565b9050919050565b600061099c670de0b6b3a764000083600f0b6111b690919063ffffffff16565b905060007357ab1ec28d129707052df4df418d58a2d46d5f5173ffffffffffffffffffffffffffffffffffffffff1663a9059cbb85846040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015610a3b57600080fd5b505af1158015610a4f573d6000803e3d6000fd5b505050506040513d6020811015610a6557600080fd5b8101908080519060200190929190505050905080610aeb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f5368656c6c2f535553442d7472616e736665722d6661696c656400000000000081525060200191505060405180910390fd5b5092915050565b60008060007357ab1ec28d129707052df4df418d58a2d46d5f5173ffffffffffffffffffffffffffffffffffffffff166323b872dd3330876040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b158015610bc657600080fd5b505af1158015610bda573d6000803e3d6000fd5b505050506040513d6020811015610bf057600080fd5b8101908080519060200190929190505050905080610c76576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f5368656c6c2f535553442d7472616e736665722d66726f6d2d6661696c65640081525060200191505060405180910390fd5b60007357ab1ec28d129707052df4df418d58a2d46d5f5173ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015610d0957600080fd5b505afa158015610d1d573d6000803e3d6000fd5b505050506040513d6020811015610d3357600080fd5b81019080805190602001909291905050509050610d61670de0b6b3a76400008261127190919063ffffffff16565b9250610d7e670de0b6b3a76400008661127190919063ffffffff16565b93505050915091565b6000807357ab1ec28d129707052df4df418d58a2d46d5f5173ffffffffffffffffffffffffffffffffffffffff166370a08231846040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015610e1b57600080fd5b505afa158015610e2f573d6000803e3d6000fd5b505050506040513d6020811015610e4557600080fd5b81019080805190602001909291905050509050610e73670de0b6b3a76400008261127190919063ffffffff16565b915050919050565b6000807357ab1ec28d129707052df4df418d58a2d46d5f5173ffffffffffffffffffffffffffffffffffffffff1663a9059cbb85856040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015610f1957600080fd5b505af1158015610f2d573d6000803e3d6000fd5b505050506040513d6020811015610f4357600080fd5b8101908080519060200190929190505050905080610fc9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f5368656c6c2f535553442d7472616e736665722d6661696c656400000000000081525060200191505060405180910390fd5b610fe4670de0b6b3a76400008461127190919063ffffffff16565b91505092915050565b600061100a670de0b6b3a76400008361127190919063ffffffff16565b9050919050565b6000807357ab1ec28d129707052df4df418d58a2d46d5f5173ffffffffffffffffffffffffffffffffffffffff166323b872dd3330866040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b1580156110e357600080fd5b505af11580156110f7573d6000803e3d6000fd5b505050506040513d602081101561110d57600080fd5b8101908080519060200190929190505050905080611193576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f5368656c6c2f535553442d7472616e736665722d66726f6d2d6661696c65640081525060200191505060405180910390fd5b6111ae670de0b6b3a76400008461127190919063ffffffff16565b915050919050565b6000808214156111c9576000905061126b565b600083600f0b12156111da57600080fd5b600060406fffffffffffffffffffffffffffffffff841685600f0b02901c90506000608084901c85600f0b02905077ffffffffffffffffffffffffffffffffffffffffffffffff81111561122d57600080fd5b604081901b9050817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0381111561126357600080fd5b818101925050505b92915050565b60008082141561128057600080fd5b600061128c84846112d9565b90506f7fffffffffffffffffffffffffffffff6fffffffffffffffffffffffffffffffff16816fffffffffffffffffffffffffffffffff1611156112cf57600080fd5b8091505092915050565b6000808214156112e857600080fd5b600077ffffffffffffffffffffffffffffffffffffffffffffffff841161131e5782604085901b8161131657fe5b049050611473565b600060c09050600060c086901c9050640100000000811061134757602081901c90506020820191505b62010000811061135f57601081901c90506010820191505b610100811061137657600881901c90506008820191505b6010811061138c57600481901c90506004820191505b600481106113a257600281901c90506002820191505b600281106113b1576001820191505b600160bf830360018703901c018260ff0387901b816113cc57fe5b0492506fffffffffffffffffffffffffffffffff8311156113ec57600080fd5b6000608086901c8402905060006fffffffffffffffffffffffffffffffff871685029050600060c089901c9050600060408a901b905082811015611431576001820391505b8281039050608084901b92508281101561144c576001820391505b8281039050608084901c821461145e57fe5b88818161146757fe5b04870196505050505050505b6fffffffffffffffffffffffffffffffff81111561149057600080fd5b809150509291505056fea265627a7a723158201fc1f34cb2219a9e8163aad79e721117a36b2c9e015203282936750c5e78fc0864736f6c634300050f0032
Deployed Bytecode Sourcemap
30488:3261:0:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;30488:3261:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;31427:342;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;31427:342:0;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;33471:273;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;33471:273:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;31777:385;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;31777:385:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;32822:129;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;32822:129:0;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;32506:257;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;32506:257:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;30743:401;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;30743:401:0;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;33222:190;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;33222:190:0;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;32170:251;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;32170:251:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;33010:135;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;33010:135:0;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;31152:267;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;31152:267:0;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;31427:342;31485:15;31609:3;31603;31582:18;31595:4;31582:7;:12;;;;:18;;;;:::i;:::-;:24;;;;;;:30;31572:40;;31625:13;30658:42;31641:17;;;31659:10;31679:4;31686:7;31641:53;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;31641:53:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;31641:53:0;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;31641:53:0;;;;;;;;;;;;;;;;31625:69;;31715:8;31707:52;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;31427:342;;;;:::o;33471:273::-;33564:14;33580:15;33620:18;33633:4;33620:7;:12;;:18;;;;:::i;:::-;33610:28;;33651:16;30658:42;33670:14;;;33685:5;33670:21;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;33670:21:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;33670:21:0;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;33670:21:0;;;;;;;;;;;;;;;;33651:40;;33715:19;33729:4;33715:8;:13;;:19;;;;:::i;:::-;33704:30;;33471:273;;;;;;:::o;31777:385::-;31857:14;31873:15;31903:13;30658:42;31919:13;;;31933:4;31939:7;31919:28;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;31919:28:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;31919:28:0;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;31919:28:0;;;;;;;;;;;;;;;;31903:44;;31968:8;31960:47;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;32020:16;30658:42;32039:14;;;32062:4;32039:29;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;32039:29:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;32039:29:0;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;32039:29:0;;;;;;;;;;;;;;;;32020:48;;32091:18;32104:4;32091:7;:12;;:18;;;;:::i;:::-;32081:28;;32133:19;32147:4;32133:8;:13;;:19;;;;:::i;:::-;32122:30;;31777:385;;;;;;;:::o;32822:129::-;32883:15;32923:18;32936:4;32923:7;:12;;;;:18;;;;:::i;:::-;32913:28;;32822:129;;;:::o;32506:257::-;32578:15;32618:18;32631:4;32618:7;:12;;;;:18;;;;:::i;:::-;32608:28;;32649:13;30658:42;32665:13;;;32679:4;32685:7;32665:28;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;32665:28:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;32665:28:0;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;32665:28:0;;;;;;;;;;;;;;;;32649:44;;32714:8;32706:47;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;32506:257;;;;;:::o;30743:401::-;30809:14;30825:15;30855:13;30658:42;30871:17;;;30889:10;30909:4;30916:7;30871:53;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;30871:53:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;30871:53:0;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;30871:53:0;;;;;;;;;;;;;;;;30855:69;;30945:8;30937:52;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;31002:16;30658:42;31021:14;;;31044:4;31021:29;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;31021:29:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;31021:29:0;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;31021:29:0;;;;;;;;;;;;;;;;31002:48;;31074:19;31088:4;31074:8;:13;;:19;;;;:::i;:::-;31063:30;;31116:18;31129:4;31116:7;:12;;:18;;;;:::i;:::-;31106:28;;30743:401;;;;;:::o;33222:190::-;33289:15;33319:16;30658:42;33338:14;;;33353:5;33338:21;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;33338:21:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;33338:21:0;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;33338:21:0;;;;;;;;;;;;;;;;33319:40;;33383:19;33397:4;33383:8;:13;;:19;;;;:::i;:::-;33372:30;;33222:190;;;;:::o;32170:251::-;32237:14;32266:13;30658:42;32282:13;;;32296:4;32302:7;32282:28;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;32282:28:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;32282:28:0;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;32282:28:0;;;;;;;;;;;;;;;;32266:44;;32331:8;32323:47;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;32393:18;32406:4;32393:7;:12;;:18;;;;:::i;:::-;32383:28;;32170:251;;;;;:::o;33010:135::-;33078:14;33117:18;33130:4;33117:7;:12;;:18;;;;:::i;:::-;33107:28;;33010:135;;;:::o;31152:267::-;31205:14;31234:13;30658:42;31250:17;;;31268:10;31288:4;31295:7;31250:53;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;31250:53:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;31250:53:0;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;31250:53:0;;;;;;;;;;;;;;;;31234:69;;31324:8;31316:52;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;31391:18;31404:4;31391:7;:12;;:18;;;;:::i;:::-;31381:28;;31152:267;;;;:::o;6311:469::-;6370:7;6395:1;6390;:6;6386:20;;;6405:1;6398:8;;;;6386:20;6429:1;6424;:6;;;;6415:16;;;;;;6440:10;6513:2;6473:34;6469:1;:38;6463:1;6454:11;;:54;6453:62;;6440:75;;6522:10;6555:3;6550:1;:8;;6544:1;6535:11;;:24;6522:37;;6583:50;6577:2;:56;;6568:66;;;;;;6648:2;6641:9;;;;;6750:2;6681:66;:71;6668:2;:84;;6659:94;;;;;;6772:2;6767;:7;6760:14;;;;6311:469;;;;;:::o;8656:208::-;8716:6;8745:1;8740;:6;;8731:16;;;;;;8754:14;8771:12;8778:1;8781;8771:5;:12::i;:::-;8754:29;;1175:34;8799:29;;:6;:29;;;;8790:39;;;;;;8851:6;8836:22;;;8656:208;;;;:::o;21228:1257::-;21288:7;21318:1;21313;:6;;21304:16;;;;;;21329:14;21361:50;21356:1;:55;21352:1035;;21441:1;21435:2;21430:1;:7;;21429:13;;;;;;21420:22;;21352:1035;;;21463:11;21477:3;21463:17;;21489:10;21507:3;21502:1;:8;;21489:21;;21529:11;21523:2;:17;21519:48;;21551:2;21544:9;;;;;21562:2;21555:9;;;;21519:48;21585:7;21579:2;:13;21575:44;;21603:2;21596:9;;;;;21614:2;21607:9;;;;21575:44;21637:5;21631:2;:11;21627:40;;21653:1;21646:8;;;;;21663:1;21656:8;;;;21627:40;21685:4;21679:2;:10;21675:39;;21700:1;21693:8;;;;;21710:1;21703:8;;;;21675:39;21732:3;21726:2;:9;21722:38;;21746:1;21739:8;;;;;21756:1;21749:8;;;;21722:38;21778:3;21772:2;:9;21768:23;;21790:1;21783:8;;;;21768:23;21886:1;21879:3;21873;:9;21868:1;21864;:5;:18;;21863:24;21855:3;21849;:9;21844:1;:14;;21843:45;;;;;;21834:54;;21916:34;21906:6;:44;;21897:54;;;;;;21962:10;21990:3;21985:1;:8;;21975:6;:19;21962:32;;22003:10;22030:34;22026:1;:38;22016:6;:49;22003:62;;22076:10;22094:3;22089:1;:8;;22076:21;;22106:10;22124:2;22119:1;:7;;22106:20;;22146:2;22141;:7;22137:20;;;22156:1;22150:7;;;;22137:20;22172:2;22166:8;;;;22231:3;22225:2;:9;;22220:14;;22252:2;22247;:7;22243:20;;;22262:1;22256:7;;;;22243:20;22278:2;22272:8;;;;22348:3;22342:2;:9;;22336:2;:15;22328:24;;;;22378:1;22373:2;:6;;;;;;22363:16;;;;21352:1035;;;;;;;22414:34;22404:6;:44;;22395:54;;;;;;22472:6;22456:23;;;21228:1257;;;;:::o
Swarm Source
bzzr://1fc1f34cb2219a9e8163aad79e721117a36b2c9e015203282936750c5e78fc08
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 27 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.