Contract 0x25006ea73bc2c9096c90c3b32abc57d439b9add4 1

 

Contract Overview

Balance:
0 ETH

ETH Value:
$0.00

Token:
Txn Hash Method
Block
From
To
Value [Txn Fee]
0x434b0f06a82c986d336234880865da84753b62b4c249fbb9c7fdf3020e6bae3bApprove1712438592024-01-17 5:01:0391 days 20 hrs ago0x03098d021e9f45e594f1588a30078e95410df80e IN  0x25006ea73bc2c9096c90c3b32abc57d439b9add40 ETH0.000069940.1
0xa0d0ba11d9786b98e5ce27ae30c7429d6e261d3e9013c6f7042a1c1d8c2d2f7bApprove1678843912024-01-07 3:36:34101 days 21 hrs ago0xa6078fa84ca1f69201a3d818a731bb1000bb7122 IN  0x25006ea73bc2c9096c90c3b32abc57d439b9add40 ETH0.00004914 0.1
0xfa050fa700c6380f6829c684de25adcfed961cb590e0a281c7b9786fa57b90f2Approve1552391002023-11-29 13:21:32140 days 12 hrs ago0x4d172ebf657c0e7d9af8408abe00002d7e20a243 IN  0x25006ea73bc2c9096c90c3b32abc57d439b9add40 ETH0.00006224 0.1
0xc805da77b24d6ab0bb6592b4c6cef9eebee985e0a6a67d5e7c3109917fcd4f3fApprove771597292023-04-05 3:18:36378 days 22 hrs ago0x03098d021e9f45e594f1588a30078e95410df80e IN  0x25006ea73bc2c9096c90c3b32abc57d439b9add40 ETH0.000075120.1
0x9168f9603e1e0eac157c84467bf5ea3c453880b9b06c41e17217a7e3c82b20dcApprove750867862023-03-30 1:17:32385 days 9 mins ago0x5920ca4a51d93052f111e90c387f70bcf723ea3f IN  0x25006ea73bc2c9096c90c3b32abc57d439b9add40 ETH0.000053460.1
0x70578be11f503804510eeb871102f1573309afc22f8969b12502d3b37a899b5aApprove731288042023-03-24 9:07:56390 days 16 hrs ago0x4d172ebf657c0e7d9af8408abe00002d7e20a243 IN  0x25006ea73bc2c9096c90c3b32abc57d439b9add40 ETH0.00003868 0.1
0xe2b11c3dd26587dff286b1cc0b51ff2cf73dc769e543d19f4b7e8bfdd6ccbacaApprove731245122023-03-24 8:49:38390 days 16 hrs ago0x4d172ebf657c0e7d9af8408abe00002d7e20a243 IN  0x25006ea73bc2c9096c90c3b32abc57d439b9add40 ETH0.00003303 0.1
0x74e17a148ec7c8088ff4b0208a0a8b54acf15de103b814de0a012813b4c72519Approve729397812023-03-23 20:16:42391 days 5 hrs ago0x2b0c06be831a935b66c95f3d99e6fdebb2660df3 IN  0x25006ea73bc2c9096c90c3b32abc57d439b9add40 ETH0.00004568 0.1
0x1973e6b6a2f959c73c42d5c8ee01bdc4fffcc07cd16e6ae51ce456cf427f15b6Approve725387242023-03-22 17:22:45392 days 8 hrs ago0xa6078fa84ca1f69201a3d818a731bb1000bb7122 IN  0x25006ea73bc2c9096c90c3b32abc57d439b9add40 ETH0.00004899 0.1
0xfdfc707c61acf5ca6170181f96d20b2eec46fbd2823a5d73d6e189accdff9e4bApprove712012822023-03-18 20:22:21396 days 5 hrs ago0xd204e3dc1937d3a30fc6f20abc48ac5506c94d1e IN  0x25006ea73bc2c9096c90c3b32abc57d439b9add40 ETH0.00003579 0.1
0xf15ea92bb0b7c030a60b9e314881ae121d970af9d6d01e3d50b22bf503d028f0Approve705342432023-03-16 21:36:16398 days 3 hrs ago0xcbbadd610cb89c65e2c53f798627a12f72c53ad5 IN  0x25006ea73bc2c9096c90c3b32abc57d439b9add40 ETH0.000057550.1
0xa531c62c84bdadc2a9a987ab73eff2997c26f056cc7d8a13b06fe77762d899f7Approve700159532023-03-15 8:31:50399 days 16 hrs ago0xef33c88cbdd4f8e80f4e95cd59802560fd8ae585 IN  0x25006ea73bc2c9096c90c3b32abc57d439b9add40 ETH0.00003778 0.1
0x494260adc11835a4e174d0b2ca7763a01478293d845a279fe8818d191064fe73Approve695249652023-03-13 19:18:01401 days 6 hrs ago0x6aef48ea854bc0e805232cecbab2fab592037c19 IN  0x25006ea73bc2c9096c90c3b32abc57d439b9add40 ETH0.000060090.1
0x59b70656a1095c2b082768c1e2afae06d6613efcf391024dfb5c49fd44c28e3eApprove691338942023-03-12 12:25:44402 days 13 hrs ago0xf50bf4cdf303f764155b73c42746775eb0b89a75 IN  0x25006ea73bc2c9096c90c3b32abc57d439b9add40 ETH0.000029590.1
0x72b1e0000bff633617812305145bf529f508eb7bfc0c8858e9b88b6e7f1e52b9Approve685472532023-03-10 13:47:31404 days 11 hrs ago0xa31aeea459c1ab0124ed44711a678d6e18874692 IN  0x25006ea73bc2c9096c90c3b32abc57d439b9add40 ETH0.00002533 0.1
0xdc2882c0fcacf18869569d20afa70a8bd72a1cfea64eec723fcbd516a653bf9dApprove671024922023-03-05 21:58:22409 days 3 hrs ago0xe9c166724be16f9af12bde6bfa3f09e1ab98949e IN  0x25006ea73bc2c9096c90c3b32abc57d439b9add40 ETH0.00005471 0.1
0xfb467a44373c45668bb3b98e846ad826fcb0061314f62144daaa0b05fb349b2dApprove669262932023-03-05 7:47:38409 days 17 hrs ago0x70000e997a0144424a0af5ddfe7992872b66bfc6 IN  0x25006ea73bc2c9096c90c3b32abc57d439b9add40 ETH0.00004122 0.1
0xc9614cc559a6138580782cd36688cf853656d1c24a34a43f4886f258e46d02f6Approve666142852023-03-04 7:12:03410 days 18 hrs ago0xf50bf4cdf303f764155b73c42746775eb0b89a75 IN  0x25006ea73bc2c9096c90c3b32abc57d439b9add40 ETH0.000036360.1
0xfc52b4542848979f4beabf97d8e4d791b32225a615f855f83f94f3a1f9976104Approve664503862023-03-03 18:01:44411 days 7 hrs ago0xfc3507df42ac603704efc0c37cb58dc3b25643c1 IN  0x25006ea73bc2c9096c90c3b32abc57d439b9add40 ETH0.00009971 0.1
0x447b254a4c867a03b4d6d5481eac1df426708eda1d3614721db26fb234967249Approve659314262023-03-02 3:26:02412 days 22 hrs ago0x8ab8226e45224cd2330934d0cc5cc25dcab0b7ba IN  0x25006ea73bc2c9096c90c3b32abc57d439b9add40 ETH0.00004492 0.1
0x6dcb374d1c76a95db1d473cb2c011c25731c233a978928a44926ba4cd29310bbApprove652674542023-02-28 2:12:55414 days 23 hrs ago0xb9b98205f564666f7b432b942642e45d23acd5d4 IN  0x25006ea73bc2c9096c90c3b32abc57d439b9add40 ETH0.00004022 0.1
0xbb0462c5907dcc60ead022698d4209204faf956e30c835269120706453326f3aApprove643108522023-02-25 3:36:19417 days 21 hrs ago0x0ddcc002bf01dffb0704603a2251787ec71cf779 IN  0x25006ea73bc2c9096c90c3b32abc57d439b9add40 ETH0.00004648 0.1
0x6290cce9ab556f4cc22d21f7b68fbfca53e3e89d9b21521d9b595a2e8c1204cbApprove640017632023-02-24 5:11:03418 days 20 hrs ago0x90f15e09b8fb5bc080b968170c638920db3a3446 IN  0x25006ea73bc2c9096c90c3b32abc57d439b9add40 ETH0.000048510.1
0x5f619446d18c5a79266452e8a4b25f65e39909d5e303ee2c027fe9d1328dddcbApprove639703012023-02-24 2:54:10418 days 22 hrs ago0xd9f88a2a5692b7dced6211475dfedf6b4fd98bcf IN  0x25006ea73bc2c9096c90c3b32abc57d439b9add40 ETH0.00004849 0.1
0xfc6c3d9efa24e63b0ebc506ba114e655257bd53ba34837c917eb3c8d31edb649Approve639578692023-02-24 1:58:36418 days 23 hrs ago0x7e0f45e65ef57bf3cc8e635c1027ce62a9239a53 IN  0x25006ea73bc2c9096c90c3b32abc57d439b9add40 ETH0.00005136 0.1
[ Download CSV Export 
Latest 25 internal transaction
Parent Txn Hash Block From To Value
0x84114d770ec116f61925cc84bc70d8892d4faea7856ee44de064a7cb22cb5717720705542023-03-21 9:12:27393 days 16 hrs ago 0x25006ea73bc2c9096c90c3b32abc57d439b9add4 0xb19c02a1b97665a19fc7fc0f828c608d01cb66df0 ETH
0x84114d770ec116f61925cc84bc70d8892d4faea7856ee44de064a7cb22cb5717720705542023-03-21 9:12:27393 days 16 hrs ago 0x25006ea73bc2c9096c90c3b32abc57d439b9add4 0xb19c02a1b97665a19fc7fc0f828c608d01cb66df0 ETH
0x84114d770ec116f61925cc84bc70d8892d4faea7856ee44de064a7cb22cb5717720705542023-03-21 9:12:27393 days 16 hrs ago 0x25006ea73bc2c9096c90c3b32abc57d439b9add4 0xb19c02a1b97665a19fc7fc0f828c608d01cb66df0 ETH
0x84114d770ec116f61925cc84bc70d8892d4faea7856ee44de064a7cb22cb5717720705542023-03-21 9:12:27393 days 16 hrs ago 0x25006ea73bc2c9096c90c3b32abc57d439b9add4 0xb19c02a1b97665a19fc7fc0f828c608d01cb66df0 ETH
0x84114d770ec116f61925cc84bc70d8892d4faea7856ee44de064a7cb22cb5717720705542023-03-21 9:12:27393 days 16 hrs ago 0x25006ea73bc2c9096c90c3b32abc57d439b9add4 0xb19c02a1b97665a19fc7fc0f828c608d01cb66df0 ETH
0x84114d770ec116f61925cc84bc70d8892d4faea7856ee44de064a7cb22cb5717720705542023-03-21 9:12:27393 days 16 hrs ago 0x25006ea73bc2c9096c90c3b32abc57d439b9add4 0xb19c02a1b97665a19fc7fc0f828c608d01cb66df0 ETH
0x84114d770ec116f61925cc84bc70d8892d4faea7856ee44de064a7cb22cb5717720705542023-03-21 9:12:27393 days 16 hrs ago 0x25006ea73bc2c9096c90c3b32abc57d439b9add4 0x36df0a76a124d8b2205fa11766ec2eff8ce38a350 ETH
0x84114d770ec116f61925cc84bc70d8892d4faea7856ee44de064a7cb22cb5717720705542023-03-21 9:12:27393 days 16 hrs ago 0x25006ea73bc2c9096c90c3b32abc57d439b9add4 0x06daa8f11a6bd40474df28287f6cb88207e6489f0 ETH
0x84114d770ec116f61925cc84bc70d8892d4faea7856ee44de064a7cb22cb5717720705542023-03-21 9:12:27393 days 16 hrs ago 0xc07f52b6c6cd1c2305335234228381368b5d7c82 0x25006ea73bc2c9096c90c3b32abc57d439b9add40 ETH
0x84114d770ec116f61925cc84bc70d8892d4faea7856ee44de064a7cb22cb5717720705542023-03-21 9:12:27393 days 16 hrs ago 0x25006ea73bc2c9096c90c3b32abc57d439b9add4 0xb19c02a1b97665a19fc7fc0f828c608d01cb66df0 ETH
0x84114d770ec116f61925cc84bc70d8892d4faea7856ee44de064a7cb22cb5717720705542023-03-21 9:12:27393 days 16 hrs ago 0x25006ea73bc2c9096c90c3b32abc57d439b9add4 0xb19c02a1b97665a19fc7fc0f828c608d01cb66df0 ETH
0x84114d770ec116f61925cc84bc70d8892d4faea7856ee44de064a7cb22cb5717720705542023-03-21 9:12:27393 days 16 hrs ago 0x25006ea73bc2c9096c90c3b32abc57d439b9add4 0xb19c02a1b97665a19fc7fc0f828c608d01cb66df0 ETH
0x84114d770ec116f61925cc84bc70d8892d4faea7856ee44de064a7cb22cb5717720705542023-03-21 9:12:27393 days 16 hrs ago 0x25006ea73bc2c9096c90c3b32abc57d439b9add4 0xb19c02a1b97665a19fc7fc0f828c608d01cb66df0 ETH
0x84114d770ec116f61925cc84bc70d8892d4faea7856ee44de064a7cb22cb5717720705542023-03-21 9:12:27393 days 16 hrs ago 0x25006ea73bc2c9096c90c3b32abc57d439b9add4 0xb19c02a1b97665a19fc7fc0f828c608d01cb66df0 ETH
0x84114d770ec116f61925cc84bc70d8892d4faea7856ee44de064a7cb22cb5717720705542023-03-21 9:12:27393 days 16 hrs ago 0x25006ea73bc2c9096c90c3b32abc57d439b9add4 0xb19c02a1b97665a19fc7fc0f828c608d01cb66df0 ETH
0x84114d770ec116f61925cc84bc70d8892d4faea7856ee44de064a7cb22cb5717720705542023-03-21 9:12:27393 days 16 hrs ago 0x25006ea73bc2c9096c90c3b32abc57d439b9add4 0x36df0a76a124d8b2205fa11766ec2eff8ce38a350 ETH
0x84114d770ec116f61925cc84bc70d8892d4faea7856ee44de064a7cb22cb5717720705542023-03-21 9:12:27393 days 16 hrs ago 0x25006ea73bc2c9096c90c3b32abc57d439b9add4 0xc07f52b6c6cd1c2305335234228381368b5d7c820 ETH
0x84114d770ec116f61925cc84bc70d8892d4faea7856ee44de064a7cb22cb5717720705542023-03-21 9:12:27393 days 16 hrs ago 0x06daa8f11a6bd40474df28287f6cb88207e6489f 0x25006ea73bc2c9096c90c3b32abc57d439b9add40 ETH
0x84114d770ec116f61925cc84bc70d8892d4faea7856ee44de064a7cb22cb5717720705542023-03-21 9:12:27393 days 16 hrs ago 0x25006ea73bc2c9096c90c3b32abc57d439b9add4 0xb19c02a1b97665a19fc7fc0f828c608d01cb66df0 ETH
0x84114d770ec116f61925cc84bc70d8892d4faea7856ee44de064a7cb22cb5717720705542023-03-21 9:12:27393 days 16 hrs ago 0x25006ea73bc2c9096c90c3b32abc57d439b9add4 0xb19c02a1b97665a19fc7fc0f828c608d01cb66df0 ETH
0x84114d770ec116f61925cc84bc70d8892d4faea7856ee44de064a7cb22cb5717720705542023-03-21 9:12:27393 days 16 hrs ago 0x0022358ebfd5261c325f8160c7c17bc8671d07b4 0x25006ea73bc2c9096c90c3b32abc57d439b9add40 ETH
0x49a7b5cb476a494b9d4958e3aaa87deae9cf148b5318751372c718217dce49f0712013032023-03-18 20:22:26396 days 5 hrs ago 0x25006ea73bc2c9096c90c3b32abc57d439b9add4 0xb19c02a1b97665a19fc7fc0f828c608d01cb66df0 ETH
0x49a7b5cb476a494b9d4958e3aaa87deae9cf148b5318751372c718217dce49f0712013032023-03-18 20:22:26396 days 5 hrs ago 0x25006ea73bc2c9096c90c3b32abc57d439b9add4 0xb19c02a1b97665a19fc7fc0f828c608d01cb66df0 ETH
0x49a7b5cb476a494b9d4958e3aaa87deae9cf148b5318751372c718217dce49f0712013032023-03-18 20:22:26396 days 5 hrs ago 0x25006ea73bc2c9096c90c3b32abc57d439b9add4 0xb19c02a1b97665a19fc7fc0f828c608d01cb66df0 ETH
0x49a7b5cb476a494b9d4958e3aaa87deae9cf148b5318751372c718217dce49f0712013032023-03-18 20:22:26396 days 5 hrs ago 0x25006ea73bc2c9096c90c3b32abc57d439b9add4 0xb19c02a1b97665a19fc7fc0f828c608d01cb66df0 ETH
[ Download CSV Export 
Loading

Similar Match Source Code
This contract matches the deployed Bytecode of the Source Code for Contract 0xd3aaE3D708976531c4f28E38AE124598131c70d2
The constructor portion of the code might be different and could alter the actual behaviour of the contract

Contract Name:
Collateral

Compiler Version
v0.5.16+commit.9c3226ce

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 16 : Collateral.sol
pragma solidity =0.5.16;

import "./PoolToken.sol";
import "./CStorage.sol";
import "./CSetter.sol";
import "./interfaces/IERC20.sol";
import "./interfaces/IBorrowable.sol";
import "./interfaces/ICollateral.sol";
import "./interfaces/IFactory.sol";
import "./interfaces/ITarotSolidlyPriceOracleV2.sol";
import "./interfaces/ITarotCallee.sol";
import "./interfaces/IBaseV1Pair.sol";
import "./interfaces/IVaultToken.sol";
import "./libraries/Math.sol";

contract Collateral is ICollateral, PoolToken, CStorage, CSetter {
    constructor() public {}

    /*** Collateralization Model ***/

    function getPrices() public returns (uint256 price0, uint256 price1) {
        (uint256 reserve0, uint256 reserve1) = getReserves();
        uint256 t = IBaseV1Pair(underlying).totalSupply();
        (uint256 decimals0, uint256 decimals1, , , , , ) = IBaseV1Pair(underlying).metadata();
        
        reserve0 = reserve0.mul(1e18).div(decimals0);
        reserve1 = reserve1.mul(1e18).div(decimals1);
        uint256 f;
        {
            uint256 a = reserve0.mul(reserve0).div(1e18);
            uint256 b = reserve1.mul(reserve1).div(1e18);
            f = a.mul(3).add(b).mul(1e18).div(b.mul(3).add(a));
        }
        price0 = t.mul(f).div(f.add(1e18)).mul(1e18).div(reserve0).mul(1e18).div(decimals0);
        price1 = t.mul(1e18).div(f.add(1e18)).mul(1e18).div(reserve1).mul(1e18).div(decimals1);
    }

    function _k(uint256 x, uint256 y, uint256 d0, uint256 d1) internal pure returns (uint256) {
        uint _x = x.mul(1e18).div(d0);
        uint _y = y.mul(1e18).div(d1);
        uint _a = _x.mul(_y).div(1e18);
        uint _b = _x.mul(_x).div(1e18).add(_y.mul(_y).div(1e18));
        return _a.mul(_b).div(1e18);  // x3y+y3x >= k
    }

    function getReserves() public returns (uint112 reserve0, uint112 reserve1) {
        (uint256 _twapReserve0, uint256 _twapReserve1, ) =
            ITarotSolidlyPriceOracleV2(tarotPriceOracle).getResult(underlying);
        if (isUnderlyingVaultToken()) {
            uint256 scale = IVaultToken(underlying).getScale();
            _twapReserve0 = _twapReserve0.mul(scale).div(1e18);
            _twapReserve1 = _twapReserve1.mul(scale).div(1e18);
        }

        (uint256 decimals0, uint256 decimals1, , , , , ) = IBaseV1Pair(underlying).metadata();
        (uint256 _currReserve0, uint256 _currReserve1, ) = IBaseV1Pair(underlying).getReserves();
        
        uint256 twapK = _k(_twapReserve0, _twapReserve1, decimals0, decimals1);
        uint256 currK = _k(_currReserve0, _currReserve1, decimals0, decimals1);

        uint256 _adjustment = Math.sqrt(Math.sqrt(currK.mul(1e18).div(twapK).mul(1e18)).mul(1e18));
        reserve0 = safe112(_twapReserve0.mul(_adjustment).div(1e18));
        reserve1 = safe112(_twapReserve1.mul(_adjustment).div(1e18));

        require(reserve0 > 100 && reserve1 > 100, "Tarot: INSUFFICIENT_RESERVES");
    }

    function _fm(uint256 p1, uint256 m) internal pure returns (bool) {
        uint256 a = m.mul(m).div(1e18).mul(m).div(1e18).add(m.mul(3));
        uint256 b = p1.mul(3).mul(m).div(1e18).mul(m).div(1e18);
        return a > b && a.sub(b) > p1;
    }

    function _get_m(uint256 p1, uint256 a, uint256 b, uint256 _mTolerance) internal pure returns (uint256 m) {
        for (uint256 i = 0; i < 255; i++) {
            uint256 mid = b.sub(a).div(2);
            m = a.add(mid);
            if (mid <= _mTolerance) {
                return m;
            }
            if (_fm(p1, m)) {
                b = m;
            } else {
                a = m;
            }
        }
    }

    function _reserveRatioSwingGivenPriceSwing(ReserveInfo memory reserveInfo, uint256 _priceSwing, uint256 _mTolerance) internal pure returns (uint256 reserveRatioSwing) {
        if (_priceSwing == 1e18) {
            return 1e18;
        }

        uint256 x = reserveInfo.x;
        uint256 y = reserveInfo.y;

        uint256 a = x.mul(x).div(1e18);
        uint256 b = y.mul(y).div(1e18);
        uint256 c = a.mul(3).add(b);
        uint256 d = b.mul(3).add(a);
        uint256 p1 = y.mul(c).div(x);
        p1 = p1.mul(1e18).div(d);
        p1 = p1.mul(_priceSwing).div(1e18);

        (uint256 lower, uint256 upper) = p1 > 1e18 ? (uint256(1e18), p1.mul(3)) : (p1.div(3), uint256(1e18));
        reserveRatioSwing = _get_m(p1, lower, upper, _mTolerance);
        reserveRatioSwing = reserveRatioSwing.mul(x).div(y);
    }

    function _safetyMarginReserveRatioSwings(ReserveInfo memory reserveInfo, uint256 _safetyMargin, uint256 _mTolerance) internal pure returns (uint256 ratioSwingA, uint256 ratioSwingB) {
        ratioSwingA = _reserveRatioSwingGivenPriceSwing(reserveInfo, _safetyMargin, _mTolerance);
        ratioSwingB = _reserveRatioSwingGivenPriceSwing(reserveInfo, uint256(1e36).div(_safetyMargin), _mTolerance);
    }

    function _reserveDeltas(ReserveInfo memory reserveInfo, uint256 m) internal pure returns (uint256 deltaX, uint256 deltaY, uint256 priceFactor) {
        uint256 x = reserveInfo.x;
        uint256 y = reserveInfo.y;
        uint256 a = x.mul(x).div(1e18);
        uint256 b = y.mul(y).div(1e18);
        uint256 c = b.mul(m).div(1e18).mul(m).div(1e18);
        uint256 d = m.mul(a.add(c)).div(1e18);
        deltaX = Math.sqrt(Math.sqrt(a.add(b).mul(1e18).div(d).mul(1e18)).mul(1e18));
        deltaY = deltaX.mul(m).div(1e18);
        priceFactor = a.mul(3).add(c).mul(1e18).div(c.mul(3).add(a));
    }

    struct ReserveInfo {
        uint256 x;
        uint256 y;
    }

    // returns liquidity in  collateral's underlying
    function _calculateLiquidity(
        uint256 _amountCollateral,
        uint256 _amount0,
        uint256 _amount1
    ) internal returns (uint256 liquidity, uint256 shortfall) {
        ReserveInfo memory reserveInfo;
        (uint256 reserve0, uint256 reserve1) = getReserves();
        {
            (uint256 decimals0, uint256 decimals1, , , , , ) = IBaseV1Pair(underlying).metadata();
            reserveInfo.x = reserve0.mul(1e18).div(decimals0);
            reserveInfo.y = reserve1.mul(1e18).div(decimals1);
        }
        (uint256 ratioSwingA, uint256 ratioSwingB) = _safetyMarginReserveRatioSwings(reserveInfo, safetyMargin, mTolerance);
        uint256 totalUnderlying = IBaseV1Pair(underlying).totalSupply();
        uint256 collateralNeededA;
        uint256 amount0 = _amount0;
        uint256 amount1 = _amount1;
        uint256 amountCollateral = _amountCollateral;
        {
            (uint256 dx1, uint256 dy1, uint256 a1) = _reserveDeltas(reserveInfo, ratioSwingA);
            uint256 price0 = totalUnderlying.mul(1e18).div(reserve0);
            price0 = price0.mul(1e18).div(dx1);
            price0 = price0.mul(a1).div(a1.add(1e18));
            uint256 price1 = totalUnderlying.mul(1e18).div(reserve1);
            price1 = price1.mul(1e18).div(dy1);
            price1 = price1.mul(1e18).div(a1.add(1e18));
            collateralNeededA = amount0.mul(price0).div(1e18);
            collateralNeededA = collateralNeededA.add(amount1.mul(price1).div(1e18));
            collateralNeededA = collateralNeededA.mul(liquidationPenalty()).div(1e18);
        }
        uint256 collateralNeededB;
        {
            (uint256 dx2, uint256 dy2, uint256 a2) = _reserveDeltas(reserveInfo, ratioSwingB);
            uint256 price0 = totalUnderlying.mul(1e18).div(reserve0);
            price0 = price0.mul(1e18).div(dx2);
            price0 = price0.mul(a2).div(a2.add(1e18));
            uint256 price1 = totalUnderlying.mul(1e18).div(reserve1);
            price1 = price1.mul(1e18).div(dy2);
            price1 = price1.mul(1e18).div(a2.add(1e18));
            collateralNeededB = amount0.mul(price0).div(1e18);
            collateralNeededB = collateralNeededB.add(amount1.mul(price1).div(1e18));
            collateralNeededB = collateralNeededB.mul(liquidationPenalty()).div(1e18);
        }        
        uint256 collateralNeeded = (collateralNeededA > collateralNeededB) ? collateralNeededA : collateralNeededB;
        if (amountCollateral >= collateralNeeded) {
            return (amountCollateral - collateralNeeded, 0);
        } else {
            return (0, collateralNeeded - amountCollateral);
        }
    }

    /*** ERC20 ***/

    function _transfer(
        address from,
        address to,
        uint256 value
    ) internal {
        require(tokensUnlocked(from, value), "Tarot: INSUFFICIENT_LIQUIDITY");
        super._transfer(from, to, value);
    }

    function tokensUnlocked(address from, uint256 value) public returns (bool) {
        uint256 _balance = balanceOf[from];
        if (value > _balance) return false;
        uint256 finalBalance = _balance - value;
        uint256 amountCollateral = finalBalance.mul(exchangeRate()).div(1e18);
        uint256 amount0 = IBorrowable(borrowable0).borrowBalance(from);
        uint256 amount1 = IBorrowable(borrowable1).borrowBalance(from);
        (, uint256 shortfall) =
            _calculateLiquidity(amountCollateral, amount0, amount1);
        return shortfall == 0;
    }

    /*** Collateral ***/

    function accountLiquidityAmounts(
        address borrower,
        uint256 amount0,
        uint256 amount1
    ) public returns (uint256 liquidity, uint256 shortfall) {
        if (amount0 == uint256(-1))
            amount0 = IBorrowable(borrowable0).borrowBalance(borrower);
        if (amount1 == uint256(-1))
            amount1 = IBorrowable(borrowable1).borrowBalance(borrower);
        uint256 amountCollateral =
            balanceOf[borrower].mul(exchangeRate()).div(1e18);
        return _calculateLiquidity(amountCollateral, amount0, amount1);
    }

    function accountLiquidity(address borrower)
        public
        returns (uint256 liquidity, uint256 shortfall)
    {
        return accountLiquidityAmounts(borrower, uint256(-1), uint256(-1));
    }

    function canBorrow(
        address borrower,
        address borrowable,
        uint256 accountBorrows
    ) public returns (bool) {
        address _borrowable0 = borrowable0;
        address _borrowable1 = borrowable1;
        require(
            borrowable == _borrowable0 || borrowable == _borrowable1,
            "Tarot: INVALID_BORROWABLE"
        );
        uint256 amount0 =
            borrowable == _borrowable0 ? accountBorrows : uint256(-1);
        uint256 amount1 =
            borrowable == _borrowable1 ? accountBorrows : uint256(-1);
        (, uint256 shortfall) =
            accountLiquidityAmounts(borrower, amount0, amount1);
        return shortfall == 0;
    }

    // this function must be called from borrowable0 or borrowable1
    function seize(
        address liquidator,
        address borrower,
        uint256 repayAmount
    ) external returns (uint256 seizeTokens) {
        require(
            msg.sender == borrowable0 || msg.sender == borrowable1,
            "Tarot: UNAUTHORIZED"
        );

        (, uint256 shortfall) = accountLiquidity(borrower);
        require(shortfall > 0, "Tarot: INSUFFICIENT_SHORTFALL");

        uint256 price;
        if (msg.sender == borrowable0) (price, ) = getPrices();
        else (, price) = getPrices();

        uint256 collateralEquivalent = repayAmount.mul(price).div(exchangeRate());

        seizeTokens = collateralEquivalent
            .mul(liquidationIncentive)
            .div(1e18);

        balanceOf[borrower] = balanceOf[borrower].sub(
            seizeTokens,
            "Tarot: LIQUIDATING_TOO_MUCH"
        );
        balanceOf[liquidator] = balanceOf[liquidator].add(seizeTokens);
        emit Transfer(borrower, liquidator, seizeTokens);

        if (liquidationFee > 0) {
            uint256 seizeFee = collateralEquivalent.mul(liquidationFee).div(1e18);
            address reservesManager = IFactory(factory).reservesManager();
            balanceOf[borrower] = balanceOf[borrower].sub(seizeFee, "Tarot: LIQUIDATING_TOO_MUCH");
            balanceOf[reservesManager] = balanceOf[reservesManager].add(seizeFee);
            emit Transfer(borrower, reservesManager, seizeFee);
        }
    }

    // this low-level function should be called from another contract
    function flashRedeem(
        address redeemer,
        uint256 redeemAmount,
        bytes calldata data
    ) external nonReentrant update {
        require(redeemAmount <= totalBalance, "Tarot: INSUFFICIENT_CASH");

        // optimistically transfer funds
        _safeTransfer(redeemer, redeemAmount);
        if (data.length > 0)
            ITarotCallee(redeemer).tarotRedeem(msg.sender, redeemAmount, data);

        uint256 redeemTokens = balanceOf[address(this)];
        uint256 declaredRedeemTokens =
            redeemAmount.mul(1e18).div(exchangeRate()).add(1); // rounded up
        require(
            redeemTokens >= declaredRedeemTokens,
            "Tarot: INSUFFICIENT_REDEEM_TOKENS"
        );

        _burn(address(this), redeemTokens);
        emit Redeem(msg.sender, redeemer, redeemAmount, redeemTokens);
    }

    function isUnderlyingVaultToken()
        public
        view
        returns (bool)
    {
        (bool success, bytes memory returnData) = address(underlying).staticcall(
            abi.encodeWithSelector(IVaultToken(underlying).isVaultToken.selector)
        );
        if (success) {
            return abi.decode(returnData, (bool));
        } else {
            return false;
        }
    }

    function safe112(uint256 n) internal pure returns (uint112) {
        require(n < 2**112, "Tarot: SAFE112");
        return uint112(n);
    }
}

File 2 of 16 : PoolToken.sol
pragma solidity =0.5.16;

import "./TarotERC20.sol";
import "./interfaces/IERC20.sol";
import "./interfaces/IPoolToken.sol";
import "./libraries/SafeMath.sol";

contract PoolToken is IPoolToken, TarotERC20 {
    uint256 internal constant initialExchangeRate = 1e18;
    address public underlying;
    address public factory;
    uint256 public totalBalance;
    uint256 public constant MINIMUM_LIQUIDITY = 1000;

    event Mint(
        address indexed sender,
        address indexed minter,
        uint256 mintAmount,
        uint256 mintTokens
    );
    event Redeem(
        address indexed sender,
        address indexed redeemer,
        uint256 redeemAmount,
        uint256 redeemTokens
    );
    event Sync(uint256 totalBalance);

    /*** Initialize ***/

    // called once by the factory
    function _setFactory() external {
        require(factory == address(0), "Tarot: FACTORY_ALREADY_SET");
        factory = msg.sender;
    }

    /*** PoolToken ***/

    function _update() internal {
        totalBalance = IERC20(underlying).balanceOf(address(this));
        emit Sync(totalBalance);
    }

    function exchangeRate() public returns (uint256) {
        uint256 _totalSupply = totalSupply; // gas savings
        uint256 _totalBalance = totalBalance; // gas savings
        if (_totalSupply == 0 || _totalBalance == 0) return initialExchangeRate;
        return _totalBalance.mul(1e18).div(_totalSupply);
    }

    // this low-level function should be called from another contract
    function mint(address minter)
        external
        nonReentrant
        update
        returns (uint256 mintTokens)
    {
        uint256 balance = IERC20(underlying).balanceOf(address(this));
        uint256 mintAmount = balance.sub(totalBalance);
        mintTokens = mintAmount.mul(1e18).div(exchangeRate());

        if (totalSupply == 0) {
            // permanently lock the first MINIMUM_LIQUIDITY tokens
            mintTokens = mintTokens.sub(MINIMUM_LIQUIDITY);
            _mint(address(0), MINIMUM_LIQUIDITY);
        }
        require(mintTokens > 0, "Tarot: MINT_AMOUNT_ZERO");
        _mint(minter, mintTokens);
        emit Mint(msg.sender, minter, mintAmount, mintTokens);
    }

    // this low-level function should be called from another contract
    function redeem(address redeemer)
        external
        nonReentrant
        update
        returns (uint256 redeemAmount)
    {
        uint256 redeemTokens = balanceOf[address(this)];
        redeemAmount = redeemTokens.mul(exchangeRate()).div(1e18);

        require(redeemAmount > 0, "Tarot: REDEEM_AMOUNT_ZERO");
        require(redeemAmount <= totalBalance, "Tarot: INSUFFICIENT_CASH");
        _burn(address(this), redeemTokens);
        _safeTransfer(redeemer, redeemAmount);
        emit Redeem(msg.sender, redeemer, redeemAmount, redeemTokens);
    }

    // force real balance to match totalBalance
    function skim(address to) external nonReentrant {
        _safeTransfer(
            to,
            IERC20(underlying).balanceOf(address(this)).sub(totalBalance)
        );
    }

    // force totalBalance to match real balance
    function sync() external nonReentrant update {}

    /*** Utilities ***/

    // same safe transfer function used by UniSwapV2 (with fixed underlying)
    bytes4 private constant SELECTOR =
        bytes4(keccak256(bytes("transfer(address,uint256)")));

    function _safeTransfer(address to, uint256 amount) internal {
        (bool success, bytes memory data) =
            underlying.call(abi.encodeWithSelector(SELECTOR, to, amount));
        require(
            success && (data.length == 0 || abi.decode(data, (bool))),
            "Tarot: TRANSFER_FAILED"
        );
    }

    // prevents a contract from calling itself, directly or indirectly.
    bool internal _notEntered = true;
    modifier nonReentrant() {
        require(_notEntered, "Tarot: REENTERED");
        _notEntered = false;
        _;
        _notEntered = true;
    }

    // update totalBalance with current balance
    modifier update() {
        _;
        _update();
    }
}

File 3 of 16 : CStorage.sol
pragma solidity =0.5.16;


contract CStorage {
	address public borrowable0;
	address public borrowable1;
	address public tarotPriceOracle;
	uint public safetyMargin = 1.08e18; // safetyMargin: 108%
	uint public mTolerance = 1e8;
	uint public liquidationIncentive = 1.01e18; // 101%
	uint public liquidationFee = 0.005e18; // 0.5%
	
	function liquidationPenalty() public view returns (uint) {
		return liquidationIncentive + liquidationFee;
	}
}

File 4 of 16 : CSetter.sol
pragma solidity =0.5.16;

import "./CStorage.sol";
import "./PoolToken.sol";
import "./interfaces/IFactory.sol";
import "./interfaces/ITarotSolidlyPriceOracleV2.sol";

contract CSetter is PoolToken, CStorage {
    uint256 public constant SAFETY_MARGIN_MIN = 1.00e18; //safetyMargin: 100%
    uint256 public constant SAFETY_MARGIN_MAX = 1.50e18; //safetyMargin: 150%
    uint256 public constant LIQUIDATION_INCENTIVE_MIN = 1.00e18; //100%
    uint256 public constant LIQUIDATION_INCENTIVE_MAX = 1.05e18; //105%
	uint256 public constant LIQUIDATION_FEE_MAX = 0.05e18; //5%
    uint256 public constant M_TOLERANCE_MIN = 1;
    uint256 public constant M_TOLERANCE_MAX = 1e12;

    event NewSafetyMargin(uint256 newSafetyMargin);
    event NewLiquidationIncentive(uint256 newLiquidationIncentive);
    event NewLiquidationFee(uint256 newLiquidationFee);
    event NewMTolerance(uint256 newMTolerance);

    // called once by the factory at the time of deployment
    function _initialize(
        string calldata _name,
        string calldata _symbol,
        address _underlying,
        address _borrowable0,
        address _borrowable1
    ) external {
        require(msg.sender == factory, "Tarot: UNAUTHORIZED"); // sufficient check
        _setName(_name, _symbol);
        underlying = _underlying;
        borrowable0 = _borrowable0;
        borrowable1 = _borrowable1;
        tarotPriceOracle = IFactory(factory).tarotPriceOracle();
    }

    function _setSafetyMargin(uint256 newSafetyMargin)
        external
        nonReentrant
    {
        _checkSetting(
            newSafetyMargin,
            SAFETY_MARGIN_MIN,
            SAFETY_MARGIN_MAX
        );
        safetyMargin = newSafetyMargin;
        emit NewSafetyMargin(newSafetyMargin);
    }

    function _setLiquidationIncentive(uint256 newLiquidationIncentive)
        external
        nonReentrant
    {
        _checkSetting(
            newLiquidationIncentive,
            LIQUIDATION_INCENTIVE_MIN,
            LIQUIDATION_INCENTIVE_MAX
        );
        liquidationIncentive = newLiquidationIncentive;
        emit NewLiquidationIncentive(newLiquidationIncentive);
    }

    function _setLiquidationFee(uint256 newLiquidationFee)
        external
        nonReentrant
    {
        _checkSetting(
            newLiquidationFee,
            0,
            LIQUIDATION_FEE_MAX
        );
        liquidationFee = newLiquidationFee;
        emit NewLiquidationFee(newLiquidationFee);
    }

    function _setMTolerance(uint256 newMTolerance)
        external
        nonReentrant
    {
        _checkSetting(
            newMTolerance,
            M_TOLERANCE_MIN,
            M_TOLERANCE_MAX
        );
        mTolerance = newMTolerance;
        emit NewMTolerance(newMTolerance);
    }

    function _checkSetting(
        uint256 parameter,
        uint256 min,
        uint256 max
    ) internal view {
        _checkAdmin();
        require(parameter >= min, "Tarot: INVALID_SETTING");
        require(parameter <= max, "Tarot: INVALID_SETTING");
    }

    function _checkAdmin() internal view {
        require(msg.sender == IFactory(factory).admin(), "Tarot: UNAUTHORIZED");
    }
}

File 5 of 16 : IERC20.sol
pragma solidity >=0.5.0;

interface IERC20 {
    event Approval(address indexed owner, address indexed spender, uint value);
    event Transfer(address indexed from, address indexed to, uint value);

    function name() external view returns (string memory);
    function symbol() external view returns (string memory);
    function decimals() external view returns (uint8);
    function totalSupply() external view returns (uint);
    function balanceOf(address owner) external view returns (uint);
    function allowance(address owner, address spender) external view returns (uint);

    function approve(address spender, uint value) external returns (bool);
    function transfer(address to, uint value) external returns (bool);
    function transferFrom(address from, address to, uint value) external returns (bool);
}

File 6 of 16 : IBorrowable.sol
pragma solidity >=0.5.0;

interface IBorrowable {
    /*** Tarot ERC20 ***/

    event Transfer(address indexed from, address indexed to, uint256 value);
    event Approval(
        address indexed owner,
        address indexed spender,
        uint256 value
    );

    function name() external pure returns (string memory);

    function symbol() external pure returns (string memory);

    function decimals() external pure returns (uint8);

    function totalSupply() external view returns (uint256);

    function balanceOf(address owner) external view returns (uint256);

    function allowance(address owner, address spender)
        external
        view
        returns (uint256);

    function approve(address spender, uint256 value) external returns (bool);

    function transfer(address to, uint256 value) external returns (bool);

    function transferFrom(
        address from,
        address to,
        uint256 value
    ) external returns (bool);

    function DOMAIN_SEPARATOR() external view returns (bytes32);

    function PERMIT_TYPEHASH() external pure returns (bytes32);

    function nonces(address owner) external view returns (uint256);

    function permit(
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external;

    /*** Pool Token ***/

    event Mint(
        address indexed sender,
        address indexed minter,
        uint256 mintAmount,
        uint256 mintTokens
    );
    event Redeem(
        address indexed sender,
        address indexed redeemer,
        uint256 redeemAmount,
        uint256 redeemTokens
    );
    event Sync(uint256 totalBalance);

    function underlying() external view returns (address);

    function factory() external view returns (address);

    function totalBalance() external view returns (uint256);

    function MINIMUM_LIQUIDITY() external pure returns (uint256);

    function exchangeRate() external returns (uint256);

    function mint(address minter) external returns (uint256 mintTokens);

    function redeem(address redeemer) external returns (uint256 redeemAmount);

    function skim(address to) external;

    function sync() external;

    function _setFactory() external;

    /*** Borrowable ***/

    event BorrowApproval(
        address indexed owner,
        address indexed spender,
        uint256 value
    );
    event Borrow(
        address indexed sender,
        address indexed borrower,
        address indexed receiver,
        uint256 borrowAmount,
        uint256 repayAmount,
        uint256 accountBorrowsPrior,
        uint256 accountBorrows,
        uint256 totalBorrows
    );
    event Liquidate(
        address indexed sender,
        address indexed borrower,
        address indexed liquidator,
        uint256 seizeTokens,
        uint256 repayAmount,
        uint256 accountBorrowsPrior,
        uint256 accountBorrows,
        uint256 totalBorrows
    );

    function BORROW_FEE() external pure returns (uint256);

    function collateral() external view returns (address);

    function reserveFactor() external view returns (uint256);

    function exchangeRateLast() external view returns (uint256);

    function borrowIndex() external view returns (uint256);

    function totalBorrows() external view returns (uint256);

    function borrowAllowance(address owner, address spender)
        external
        view
        returns (uint256);

    function borrowBalance(address borrower) external view returns (uint256);

    function borrowTracker() external view returns (address);

    function BORROW_PERMIT_TYPEHASH() external pure returns (bytes32);

    function borrowApprove(address spender, uint256 value)
        external
        returns (bool);

    function borrowPermit(
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external;

    function borrow(
        address borrower,
        address receiver,
        uint256 borrowAmount,
        bytes calldata data
    ) external;

    function liquidate(address borrower, address liquidator)
        external
        returns (uint256 seizeTokens);

    function trackBorrow(address borrower) external;

    /*** Borrowable Interest Rate Model ***/

    event AccrueInterest(
        uint256 interestAccumulated,
        uint256 borrowIndex,
        uint256 totalBorrows
    );
    event CalculateKink(uint256 kinkRate);
    event CalculateBorrowRate(uint256 borrowRate);

    function KINK_BORROW_RATE_MAX() external pure returns (uint256);

    function KINK_BORROW_RATE_MIN() external pure returns (uint256);

    function KINK_MULTIPLIER() external pure returns (uint256);

    function borrowRate() external view returns (uint256);

    function kinkBorrowRate() external view returns (uint256);

    function kinkUtilizationRateLower() external view returns (uint256);

    function kinkUtilizationRateUpper() external view returns (uint256);

    function adjustSpeed() external view returns (uint256);

    function rateUpdateTimestamp() external view returns (uint32);

    function accrualTimestamp() external view returns (uint32);

    function accrueInterest() external;

    /*** Borrowable Setter ***/

    event NewReserveFactor(uint256 newReserveFactor);
    event NewKinkUtilizationRates(uint256 newKinkUtilizationRateLower, uint256 newKinkUtilizationRateUpper);
    event NewAdjustSpeed(uint256 newAdjustSpeed);
    event NewBorrowTracker(address newBorrowTracker);

    function RESERVE_FACTOR_MAX() external pure returns (uint256);

    function KINK_UR_MIN() external pure returns (uint256);

    function KINK_UR_MAX() external pure returns (uint256);

    function ADJUST_SPEED_MIN() external pure returns (uint256);

    function ADJUST_SPEED_MAX() external pure returns (uint256);

    function _initialize(
        string calldata _name,
        string calldata _symbol,
        address _underlying,
        address _collateral
    ) external;

    function _setReserveFactor(uint256 newReserveFactor) external;

    function _setKinkUtilizationRates(uint256 newKinkUtilizationRateLower, uint256 newKinkUtilizationRateUpper) external;

    function _setAdjustSpeed(uint256 newAdjustSpeed) external;

    function _setBorrowTracker(address newBorrowTracker) external;
}

File 7 of 16 : ICollateral.sol
pragma solidity >=0.5.0;

interface ICollateral {
    /*** Tarot ERC20 ***/

    event Transfer(address indexed from, address indexed to, uint256 value);
    event Approval(
        address indexed owner,
        address indexed spender,
        uint256 value
    );

    function name() external pure returns (string memory);

    function symbol() external pure returns (string memory);

    function decimals() external pure returns (uint8);

    function totalSupply() external view returns (uint256);

    function balanceOf(address owner) external view returns (uint256);

    function allowance(address owner, address spender)
        external
        view
        returns (uint256);

    function approve(address spender, uint256 value) external returns (bool);

    function transfer(address to, uint256 value) external returns (bool);

    function transferFrom(
        address from,
        address to,
        uint256 value
    ) external returns (bool);

    function DOMAIN_SEPARATOR() external view returns (bytes32);

    function PERMIT_TYPEHASH() external pure returns (bytes32);

    function nonces(address owner) external view returns (uint256);

    function permit(
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external;

    /*** Pool Token ***/

    event Mint(
        address indexed sender,
        address indexed minter,
        uint256 mintAmount,
        uint256 mintTokens
    );
    event Redeem(
        address indexed sender,
        address indexed redeemer,
        uint256 redeemAmount,
        uint256 redeemTokens
    );
    event Sync(uint256 totalBalance);

    function underlying() external view returns (address);

    function factory() external view returns (address);

    function totalBalance() external view returns (uint256);

    function MINIMUM_LIQUIDITY() external pure returns (uint256);

    function exchangeRate() external returns (uint256);

    function mint(address minter) external returns (uint256 mintTokens);

    function redeem(address redeemer) external returns (uint256 redeemAmount);

    function skim(address to) external;

    function sync() external;

    function _setFactory() external;

    /*** Collateral ***/

    function borrowable0() external view returns (address);

    function borrowable1() external view returns (address);

    function tarotPriceOracle() external view returns (address);

    function safetyMargin() external view returns (uint256);

    function mTolerance() external view returns (uint256);

    function liquidationIncentive() external view returns (uint256);

    function liquidationFee() external view returns (uint256);

    function liquidationPenalty() external view returns (uint256);

    function getPrices() external returns (uint256 price0, uint256 price1);

    function getReserves() external returns (uint112 reserve0, uint112 reserve1);

    function tokensUnlocked(address from, uint256 value)
        external
        returns (bool);

    function accountLiquidityAmounts(
        address account,
        uint256 amount0,
        uint256 amount1
    ) external returns (uint256 liquidity, uint256 shortfall);

    function accountLiquidity(address account)
        external
        returns (uint256 liquidity, uint256 shortfall);

    function canBorrow(
        address account,
        address borrowable,
        uint256 accountBorrows
    ) external returns (bool);

    function seize(
        address liquidator,
        address borrower,
        uint256 repayAmount
    ) external returns (uint256 seizeTokens);

    function flashRedeem(
        address redeemer,
        uint256 redeemAmount,
        bytes calldata data
    ) external;

    /*** Collateral Setter ***/

    event NewSafetyMargin(uint256 newSafetyMarginSqrt);
    event NewLiquidationIncentive(uint256 newLiquidationIncentive);
    event NewLiquidationFee(uint256 newLiquidationFee);
    event NewMTolerance(uint256 mTolerance);

    function M_TOLERANCE_MIN() external pure returns (uint256);
    
    function M_TOLERANCE_MAX() external pure returns (uint256);

    function SAFETY_MARGIN_MIN() external pure returns (uint256);

    function SAFETY_MARGIN_MAX() external pure returns (uint256);

    function LIQUIDATION_INCENTIVE_MIN() external pure returns (uint256);

    function LIQUIDATION_INCENTIVE_MAX() external pure returns (uint256);

    function LIQUIDATION_FEE_MAX() external pure returns (uint256);

    function _initialize(
        string calldata _name,
        string calldata _symbol,
        address _underlying,
        address _borrowable0,
        address _borrowable1
    ) external;

    function _setSafetyMargin(uint256 newSafetyMargin) external;

    function _setLiquidationIncentive(uint256 newLiquidationIncentive) external;

    function _setLiquidationFee(uint256 newLiquidationFee) external;
    
    function _setMTolerance(uint256 newMTolerance) external;

    function isUnderlyingVaultToken() external view returns (bool);
}

File 8 of 16 : IFactory.sol
pragma solidity >=0.5.0;

interface IFactory {
	event LendingPoolInitialized(address indexed uniswapV2Pair, address indexed token0, address indexed token1,
		address collateral, address borrowable0, address borrowable1, uint lendingPoolId);
	event NewPendingAdmin(address oldPendingAdmin, address newPendingAdmin);
	event NewAdmin(address oldAdmin, address newAdmin);
	event NewReservesPendingAdmin(address oldReservesPendingAdmin, address newReservesPendingAdmin);
	event NewReservesAdmin(address oldReservesAdmin, address newReservesAdmin);
	event NewReservesManager(address oldReservesManager, address newReservesManager);
	
	function admin() external view returns (address);
	function pendingAdmin() external view returns (address);
	function reservesAdmin() external view returns (address);
	function reservesPendingAdmin() external view returns (address);
	function reservesManager() external view returns (address);

	function getLendingPool(address uniswapV2Pair) external view returns (
		bool initialized, 
		uint24 lendingPoolId, 
		address collateral, 
		address borrowable0, 
		address borrowable1
	);
	function allLendingPools(uint) external view returns (address uniswapV2Pair);
	function allLendingPoolsLength() external view returns (uint);
	
	function bDeployer() external view returns (address);
	function cDeployer() external view returns (address);
	function tarotPriceOracle() external view returns (address);

	function createCollateral(address uniswapV2Pair) external returns (address collateral);
	function createBorrowable0(address uniswapV2Pair) external returns (address borrowable0);
	function createBorrowable1(address uniswapV2Pair) external returns (address borrowable1);
	function initializeLendingPool(address uniswapV2Pair) external;

	function _setPendingAdmin(address newPendingAdmin) external;
	function _acceptAdmin() external;
	function _setReservesPendingAdmin(address newPendingAdmin) external;
	function _acceptReservesAdmin() external;
	function _setReservesManager(address newReservesManager) external;
}

File 9 of 16 : ITarotSolidlyPriceOracleV2.sol
pragma solidity >=0.5;

interface ITarotSolidlyPriceOracleV2 {
    function MIN_T() external pure returns (uint32);

    function getResult(address pair) external returns (uint112 reserve0, uint112 reserve1, uint32 T);
}

File 10 of 16 : ITarotCallee.sol
pragma solidity >=0.5.0;

interface ITarotCallee {
    function tarotBorrow(
        address sender,
        address borrower,
        uint256 borrowAmount,
        bytes calldata data
    ) external;

    function tarotRedeem(
        address sender,
        uint256 redeemAmount,
        bytes calldata data
    ) external;
}

File 11 of 16 : IBaseV1Pair.sol
pragma solidity >=0.5.0;

interface IBaseV1Pair {
    event Approval(address indexed owner, address indexed spender, uint value);
    event Transfer(address indexed from, address indexed to, uint value);

    function stable() external view returns (bool);
    function totalSupply() external view returns (uint);
    function balanceOf(address owner) external view returns (uint);
    function allowance(address owner, address spender) external view returns (uint);

    function approve(address spender, uint value) external returns (bool);
    function transfer(address to, uint value) external returns (bool);
    function transferFrom(address from, address to, uint value) external returns (bool);
	
    function token0() external view returns (address);
    function token1() external view returns (address);
    function tokens() external view returns (address, address);
    function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast);

    function observationLength() external view returns (uint);
    function observations(uint) external view returns (
        uint timestamp,
        uint reserve0Cumulative,
        uint reserve1Cumulative
    );
    function currentCumulativePrices() external view returns (
        uint reserve0Cumulative,
        uint reserve1Cumulative,
        uint timestamp
    );

    function metadata() external view returns (uint, uint, uint, uint, bool, address, address);
}

File 12 of 16 : IVaultToken.sol
pragma solidity >=0.5.0;

interface IVaultToken {

    function isVaultToken() external pure returns (bool);

    function getScale() external view returns (uint);
}

File 13 of 16 : Math.sol
pragma solidity =0.5.16;

// a library for performing various math operations
// forked from: https://github.com/Uniswap/uniswap-v2-core/blob/master/contracts/libraries/Math.sol

library Math {
    function min(uint x, uint y) internal pure returns (uint z) {
        z = x < y ? x : y;
    }

    // babylonian method (https://en.wikipedia.org/wiki/Methods_of_computing_square_roots#Babylonian_method)
    function sqrt(uint y) internal pure returns (uint z) {
        if (y > 3) {
            z = y;
            uint x = y / 2 + 1;
            while (x < z) {
                z = x;
                x = (y / x + x) / 2;
            }
        } else if (y != 0) {
            z = 1;
        }
    }
}

File 14 of 16 : TarotERC20.sol
pragma solidity =0.5.16;

import "./libraries/SafeMath.sol";

// This contract is basically UniswapV2ERC20 with small modifications
// src: https://github.com/Uniswap/uniswap-v2-core/blob/master/contracts/UniswapV2ERC20.sol

contract TarotERC20 {
    using SafeMath for uint256;

    string public name;
    string public symbol;
    uint8 public decimals = 18;
    uint256 public totalSupply;
    mapping(address => uint256) public balanceOf;
    mapping(address => mapping(address => uint256)) public allowance;

    bytes32 public DOMAIN_SEPARATOR;
    mapping(address => uint256) public nonces;

    event Transfer(address indexed from, address indexed to, uint256 value);
    event Approval(
        address indexed owner,
        address indexed spender,
        uint256 value
    );

    constructor() public {}

    function _setName(string memory _name, string memory _symbol) internal {
        name = _name;
        symbol = _symbol;
        uint256 chainId;
        assembly {
            chainId := chainid
        }
        DOMAIN_SEPARATOR = keccak256(
            abi.encode(
                keccak256(
                    "EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"
                ),
                keccak256(bytes(_name)),
                keccak256(bytes("1")),
                chainId,
                address(this)
            )
        );
    }

    function _mint(address to, uint256 value) internal {
        totalSupply = totalSupply.add(value);
        balanceOf[to] = balanceOf[to].add(value);
        emit Transfer(address(0), to, value);
    }

    function _burn(address from, uint256 value) internal {
        balanceOf[from] = balanceOf[from].sub(value);
        totalSupply = totalSupply.sub(value);
        emit Transfer(from, address(0), value);
    }

    function _approve(
        address owner,
        address spender,
        uint256 value
    ) private {
        allowance[owner][spender] = value;
        emit Approval(owner, spender, value);
    }

    function _transfer(
        address from,
        address to,
        uint256 value
    ) internal {
        balanceOf[from] = balanceOf[from].sub(
            value,
            "Tarot: TRANSFER_TOO_HIGH"
        );
        balanceOf[to] = balanceOf[to].add(value);
        emit Transfer(from, to, value);
    }

    function approve(address spender, uint256 value) external returns (bool) {
        _approve(msg.sender, spender, value);
        return true;
    }

    function transfer(address to, uint256 value) external returns (bool) {
        _transfer(msg.sender, to, value);
        return true;
    }

    function transferFrom(
        address from,
        address to,
        uint256 value
    ) external returns (bool) {
        if (allowance[from][msg.sender] != uint256(-1)) {
            allowance[from][msg.sender] = allowance[from][msg.sender].sub(
                value,
                "Tarot: TRANSFER_NOT_ALLOWED"
            );
        }
        _transfer(from, to, value);
        return true;
    }

    function _checkSignature(
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s,
        bytes32 typehash
    ) internal {
        require(deadline >= block.timestamp, "Tarot: EXPIRED");
        bytes32 digest =
            keccak256(
                abi.encodePacked(
                    "\x19\x01",
                    DOMAIN_SEPARATOR,
                    keccak256(
                        abi.encode(
                            typehash,
                            owner,
                            spender,
                            value,
                            nonces[owner]++,
                            deadline
                        )
                    )
                )
            );
        address recoveredAddress = ecrecover(digest, v, r, s);
        require(
            recoveredAddress != address(0) && recoveredAddress == owner,
            "Tarot: INVALID_SIGNATURE"
        );
    }

    // keccak256("Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)");
    bytes32 public constant PERMIT_TYPEHASH =
        0x6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9;

    function permit(
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external {
        _checkSignature(
            owner,
            spender,
            value,
            deadline,
            v,
            r,
            s,
            PERMIT_TYPEHASH
        );
        _approve(owner, spender, value);
    }
}

File 15 of 16 : IPoolToken.sol
pragma solidity >=0.5.0;

interface IPoolToken {
    /*** Tarot ERC20 ***/

    event Transfer(address indexed from, address indexed to, uint256 value);
    event Approval(
        address indexed owner,
        address indexed spender,
        uint256 value
    );

    function name() external pure returns (string memory);

    function symbol() external pure returns (string memory);

    function decimals() external pure returns (uint8);

    function totalSupply() external view returns (uint256);

    function balanceOf(address owner) external view returns (uint256);

    function allowance(address owner, address spender)
        external
        view
        returns (uint256);

    function approve(address spender, uint256 value) external returns (bool);

    function transfer(address to, uint256 value) external returns (bool);

    function transferFrom(
        address from,
        address to,
        uint256 value
    ) external returns (bool);

    function DOMAIN_SEPARATOR() external view returns (bytes32);

    function PERMIT_TYPEHASH() external pure returns (bytes32);

    function nonces(address owner) external view returns (uint256);

    function permit(
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external;

    /*** Pool Token ***/

    event Mint(
        address indexed sender,
        address indexed minter,
        uint256 mintAmount,
        uint256 mintTokens
    );
    event Redeem(
        address indexed sender,
        address indexed redeemer,
        uint256 redeemAmount,
        uint256 redeemTokens
    );
    event Sync(uint256 totalBalance);

    function underlying() external view returns (address);

    function factory() external view returns (address);

    function totalBalance() external view returns (uint256);

    function MINIMUM_LIQUIDITY() external pure returns (uint256);

    function exchangeRate() external returns (uint256);

    function mint(address minter) external returns (uint256 mintTokens);

    function redeem(address redeemer) external returns (uint256 redeemAmount);

    function skim(address to) external;

    function sync() external;

    function _setFactory() external;
}

File 16 of 16 : SafeMath.sol
pragma solidity =0.5.16;

// From https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/math/Math.sol
// Subject to the MIT license.

/**
 * @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 addition of two unsigned integers, reverting with custom message on overflow.
     *
     * Counterpart to Solidity's `+` operator.
     *
     * Requirements:
     * - Addition cannot overflow.
     */
    function add(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        uint256 c = a + b;
        require(c >= a, errorMessage);

        return c;
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting on underflow (when the result is negative).
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     * - Subtraction cannot underflow.
     */
    function sub(uint256 a, uint256 b) internal pure returns (uint256) {
        return sub(a, b, "SafeMath: subtraction underflow");
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting with custom message on underflow (when the result is negative).
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     * - Subtraction cannot underflow.
     */
    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 multiplication of two unsigned integers, reverting on overflow.
     *
     * Counterpart to Solidity's `*` operator.
     *
     * Requirements:
     * - Multiplication cannot overflow.
     */
    function mul(uint256 a, uint256 b, string memory errorMessage) 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, errorMessage);

        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.
     */
    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.
     */
    function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b != 0, errorMessage);
        return a % b;
    }
}

Settings
{
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "libraries": {}
}

Contract ABI

[{"inputs":[],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":true,"internalType":"address","name":"minter","type":"address"},{"indexed":false,"internalType":"uint256","name":"mintAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"mintTokens","type":"uint256"}],"name":"Mint","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"newLiquidationFee","type":"uint256"}],"name":"NewLiquidationFee","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"newLiquidationIncentive","type":"uint256"}],"name":"NewLiquidationIncentive","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"newMTolerance","type":"uint256"}],"name":"NewMTolerance","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"newSafetyMargin","type":"uint256"}],"name":"NewSafetyMargin","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":true,"internalType":"address","name":"redeemer","type":"address"},{"indexed":false,"internalType":"uint256","name":"redeemAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"redeemTokens","type":"uint256"}],"name":"Redeem","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"totalBalance","type":"uint256"}],"name":"Sync","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"constant":true,"inputs":[],"name":"DOMAIN_SEPARATOR","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"LIQUIDATION_FEE_MAX","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"LIQUIDATION_INCENTIVE_MAX","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"LIQUIDATION_INCENTIVE_MIN","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"MINIMUM_LIQUIDITY","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"M_TOLERANCE_MAX","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"M_TOLERANCE_MIN","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"PERMIT_TYPEHASH","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"SAFETY_MARGIN_MAX","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"SAFETY_MARGIN_MIN","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"string","name":"_name","type":"string"},{"internalType":"string","name":"_symbol","type":"string"},{"internalType":"address","name":"_underlying","type":"address"},{"internalType":"address","name":"_borrowable0","type":"address"},{"internalType":"address","name":"_borrowable1","type":"address"}],"name":"_initialize","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"_setFactory","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"newLiquidationFee","type":"uint256"}],"name":"_setLiquidationFee","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"newLiquidationIncentive","type":"uint256"}],"name":"_setLiquidationIncentive","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"newMTolerance","type":"uint256"}],"name":"_setMTolerance","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"newSafetyMargin","type":"uint256"}],"name":"_setSafetyMargin","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"borrower","type":"address"}],"name":"accountLiquidity","outputs":[{"internalType":"uint256","name":"liquidity","type":"uint256"},{"internalType":"uint256","name":"shortfall","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"borrower","type":"address"},{"internalType":"uint256","name":"amount0","type":"uint256"},{"internalType":"uint256","name":"amount1","type":"uint256"}],"name":"accountLiquidityAmounts","outputs":[{"internalType":"uint256","name":"liquidity","type":"uint256"},{"internalType":"uint256","name":"shortfall","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"borrowable0","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"borrowable1","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"borrower","type":"address"},{"internalType":"address","name":"borrowable","type":"address"},{"internalType":"uint256","name":"accountBorrows","type":"uint256"}],"name":"canBorrow","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"exchangeRate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"factory","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"redeemer","type":"address"},{"internalType":"uint256","name":"redeemAmount","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"flashRedeem","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"getPrices","outputs":[{"internalType":"uint256","name":"price0","type":"uint256"},{"internalType":"uint256","name":"price1","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"getReserves","outputs":[{"internalType":"uint112","name":"reserve0","type":"uint112"},{"internalType":"uint112","name":"reserve1","type":"uint112"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"isUnderlyingVaultToken","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"liquidationFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"liquidationIncentive","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"liquidationPenalty","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"mTolerance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"minter","type":"address"}],"name":"mint","outputs":[{"internalType":"uint256","name":"mintTokens","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"nonces","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"permit","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"redeemer","type":"address"}],"name":"redeem","outputs":[{"internalType":"uint256","name":"redeemAmount","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"safetyMargin","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"liquidator","type":"address"},{"internalType":"address","name":"borrower","type":"address"},{"internalType":"uint256","name":"repayAmount","type":"uint256"}],"name":"seize","outputs":[{"internalType":"uint256","name":"seizeTokens","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"to","type":"address"}],"name":"skim","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"sync","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"tarotPriceOracle","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"tokensUnlocked","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"totalBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"underlying","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"}]

Deployed Bytecode

0x608060405234801561001057600080fd5b506004361061030c5760003560e01c80637069b4421161019d578063ba9a7a56116100e9578063d505accf116100a2578063dba2976e1161007c578063dba2976e14610945578063dd62ed3e14610962578063ec27f6dd14610990578063fff6cae9146109985761030c565b8063d505accf146108e4578063daf8881814610935578063db8cce331461093d5761030c565b8063ba9a7a56146107c9578063bc25cf77146107d1578063bc9bd12a1461058f578063bd9a548b146107f7578063c45a0155146107ff578063c548e3c5146108075761030c565b806395d89b4111610156578063a9059cbb11610130578063a9059cbb14610757578063ad7a672f14610783578063afc8276c1461078b578063b2a02ff1146107935761030c565b806395d89b41146107115780639aac2c5314610719578063a36a36301461074f5761030c565b80637069b4421461067257806370a082311461068f5780637ecebe00146106b55780638c553bf0146106db5780638c765e94146106e357806395a2251f146106eb5761030c565b806334fb08a81161025c5780635a0f03c6116102155780636a627842116101ef5780636a627842146105e65780636e01be101461060c5780636f13cb83146106385780636f307dc31461066a5761030c565b80635a0f03c61461059757806361820728146105d65780636a184ad2146105de5761030c565b806334fb08a8146105525780633644e5151461055a5780633ba0b9a9146105625780634a5d316c1461056a5780634fd42e1714610572578063552af0c11461058f5761030c565b806323b872dd116102c95780632fef02f4116102a35780632fef02f41461051c57806330adf81f14610524578063313ce5671461052c57806333fabfd11461054a5761030c565b806323b872dd146104ba57806323f5589a146104f05780632fa5ae1b146104f85761030c565b806306fdde03146103115780630902f1ac1461038e578063095ea7b3146103bc57806318160ddd146103fc57806319f3400d146104165780631ef63a791461049d575b600080fd5b6103196109a0565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561035357818101518382015260200161033b565b50505050905090810190601f1680156103805780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610396610a2e565b604080516001600160701b03938416815291909216602082015281519081900390910190f35b6103e8600480360360408110156103d257600080fd5b506001600160a01b038135169060200135610dcd565b604080519115158252519081900360200190f35b610404610de4565b60408051918252519081900360200190f35b61049b6004803603606081101561042c57600080fd5b6001600160a01b038235169160208101359181019060608101604082013564010000000081111561045c57600080fd5b82018360208201111561046e57600080fd5b8035906020019184600183028401116401000000008311171561049057600080fd5b509092509050610dea565b005b61049b600480360360208110156104b357600080fd5b5035611035565b6103e8600480360360608110156104d057600080fd5b506001600160a01b038135811691602081013590911690604001356110e4565b6104046111b4565b6105006111bf565b604080516001600160a01b039092168252519081900360200190f35b6104046111d3565b6104046111d9565b6105346111fd565b6040805160ff9092168252519081900360200190f35b610404611206565b610500611211565b610404611220565b610404611226565b61049b611275565b61049b6004803603602081101561058857600080fd5b50356112e7565b61040461139e565b6105bd600480360360208110156105ad57600080fd5b50356001600160a01b03166113aa565b6040805192835260208301919091528051918290030190f35b6104046113c3565b6104046113cc565b610404600480360360208110156105fc57600080fd5b50356001600160a01b03166113d2565b6103e86004803603604081101561062257600080fd5b506001600160a01b0381351690602001356115d0565b6105bd6004803603606081101561064e57600080fd5b506001600160a01b03813516906020810135906040013561175c565b6105006118ca565b61049b6004803603602081101561068857600080fd5b50356118d9565b610404600480360360208110156106a557600080fd5b50356001600160a01b0316611986565b610404600480360360208110156106cb57600080fd5b50356001600160a01b0316611998565b6103e86119aa565b610404611ab1565b6104046004803603602081101561070157600080fd5b50356001600160a01b0316611ab7565b610319611c50565b6103e86004803603606081101561072f57600080fd5b506001600160a01b03813581169160208101359091169060400135611caa565b610404611d93565b6103e86004803603604081101561076d57600080fd5b506001600160a01b038135169060200135611d99565b610404611da6565b610404611dac565b610404600480360360608110156107a957600080fd5b506001600160a01b03813581169160208101359091169060400135611db8565b610404612184565b61049b600480360360208110156107e757600080fd5b50356001600160a01b031661218a565b6105bd612284565b6105006124e6565b61049b600480360360a081101561081d57600080fd5b81019060208101813564010000000081111561083857600080fd5b82018360208201111561084a57600080fd5b8035906020019184600183028401116401000000008311171561086c57600080fd5b91939092909160208101903564010000000081111561088a57600080fd5b82018360208201111561089c57600080fd5b803590602001918460018302840111640100000000831117156108be57600080fd5b91935091506001600160a01b0381358116916020810135821691604090910135166124f5565b61049b600480360360e08110156108fa57600080fd5b506001600160a01b03813581169160208101359091169060408101359060608101359060ff6080820135169060a08101359060c00135612696565b6105006126da565b6104046126e9565b61049b6004803603602081101561095b57600080fd5b50356126f5565b6104046004803603604081101561097857600080fd5b506001600160a01b03813581169160200135166127ac565b6104046127c9565b61049b6127ce565b6000805460408051602060026001851615610100026000190190941693909304601f81018490048402820184019092528181529291830182828015610a265780601f106109fb57610100808354040283529160200191610a26565b820191906000526020600020905b815481529060010190602001808311610a0957829003601f168201915b505050505081565b600d546008546040805163022351bf60e51b81526001600160a01b0392831660048201529051600093849384938493919092169163446a37e091602480830192606092919082900301818787803b158015610a8857600080fd5b505af1158015610a9c573d6000803e3d6000fd5b505050506040513d6060811015610ab257600080fd5b5080516020909101516001600160701b039182169350169050610ad36119aa565b15610b9557600854604080516316b9bb5760e31b815290516000926001600160a01b03169163b5cddab8916004808301926020929190829003018186803b158015610b1d57600080fd5b505afa158015610b31573d6000803e3d6000fd5b505050506040513d6020811015610b4757600080fd5b50519050610b73670de0b6b3a7640000610b67858463ffffffff61283916565b9063ffffffff61289216565b9250610b91670de0b6b3a7640000610b67848463ffffffff61283916565b9150505b600080600860009054906101000a90046001600160a01b03166001600160a01b031663392f37e96040518163ffffffff1660e01b815260040160e06040518083038186803b158015610be657600080fd5b505afa158015610bfa573d6000803e3d6000fd5b505050506040513d60e0811015610c1057600080fd5b50805160209091015160085460408051630240bc6b60e21b8152905193955091935060009283926001600160a01b0390921691630902f1ac916004808301926060929190829003018186803b158015610c6857600080fd5b505afa158015610c7c573d6000803e3d6000fd5b505050506040513d6060811015610c9257600080fd5b5080516020909101516001600160701b0391821693501690506000610cb9878787876128d4565b90506000610cc9848488886128d4565b90506000610d04610cff670de0b6b3a7640000610cf382828289610b678a8463ffffffff61283916565b9063ffffffff61283916565b61299f565b9050610d2a610d25670de0b6b3a7640000610b678c8563ffffffff61283916565b6129f1565b9a50610d4b610d25670de0b6b3a7640000610b678b8563ffffffff61283916565b995060648b6001600160701b0316118015610d6f575060648a6001600160701b0316115b610dc0576040805162461bcd60e51b815260206004820152601c60248201527f5461726f743a20494e53554646494349454e545f524553455256455300000000604482015290519081900360640190fd5b5050505050505050509091565b6000610dda338484612a40565b5060015b92915050565b60035481565b600b5460ff16610e34576040805162461bcd60e51b815260206004820152601060248201526f15185c9bdd0e8814915153951154915160821b604482015290519081900360640190fd5b600b805460ff19169055600a54831115610e90576040805162461bcd60e51b81526020600482015260186024820152770a8c2e4dee87440929ca6aa8c8c9286928a9ca8be8682a6960431b604482015290519081900360640190fd5b610e9a8484612aa2565b8015610f4057604051636b4d4dc160e01b8152336004820181815260248301869052606060448401908152606484018590526001600160a01b03881693636b4d4dc193928892889288929190608401848480828437600081840152601f19601f82011690508083019250505095505050505050600060405180830381600087803b158015610f2757600080fd5b505af1158015610f3b573d6000803e3d6000fd5b505050505b3060009081526004602052604081205490610f856001610f79610f61611226565b610b6789670de0b6b3a764000063ffffffff61283916565b9063ffffffff612c3416565b905080821015610fc65760405162461bcd60e51b8152600401808060200182810382526021815260200180613de96021913960400191505060405180910390fd5b610fd03083612c8e565b604080518681526020810184905281516001600160a01b0389169233927f3f693fff038bb8a046aa76d9516190ac7444f7d69cf952c4cbdc086fdef2d6fc929081900390910190a35050611022612d19565b5050600b805460ff191660011790555050565b600b5460ff1661107f576040805162461bcd60e51b815260206004820152601060248201526f15185c9bdd0e8814915153951154915160821b604482015290519081900360640190fd5b600b805460ff1916905561109c81600066b1a2bc2ec50000612dc9565b60118190556040805182815290517f21e5451a492a87031e8324e7e1e2ba821fdec0c40972393c9f74dd38bd88a6af9181900360200190a150600b805460ff19166001179055565b6001600160a01b03831660009081526005602090815260408083203384529091528120546000191461119e57604080518082018252601b81527f5461726f743a205452414e534645525f4e4f545f414c4c4f57454400000000006020808301919091526001600160a01b038716600090815260058252838120338252909152919091205461117991849063ffffffff612e7216565b6001600160a01b03851660009081526005602090815260408083203384529091529020555b6111a9848484612f09565b5060015b9392505050565b601154601054015b90565b600b5461010090046001600160a01b031681565b600f5481565b7f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c981565b60025460ff1681565b66b1a2bc2ec5000081565b600d546001600160a01b031681565b60065481565b600354600a546000919081158061123b575080155b1561125257670de0b6b3a7640000925050506111bc565b61126e82610b6783670de0b6b3a764000063ffffffff61283916565b9250505090565b6009546001600160a01b0316156112d3576040805162461bcd60e51b815260206004820152601a60248201527f5461726f743a20464143544f52595f414c52454144595f534554000000000000604482015290519081900360640190fd5b600980546001600160a01b03191633179055565b600b5460ff16611331576040805162461bcd60e51b815260206004820152601060248201526f15185c9bdd0e8814915153951154915160821b604482015290519081900360640190fd5b600b805460ff1916905561135681670de0b6b3a7640000670e92596fd6290000612dc9565b60108190556040805182815290517f8a9bb9067f9ecb13a322b548e6df3dd1bd10a54698834dac43ed8f0e765bf94d9181900360200190a150600b805460ff19166001179055565b670de0b6b3a764000081565b6000806113ba836000198061175c565b91509150915091565b64e8d4a5100081565b600e5481565b600b5460009060ff1661141f576040805162461bcd60e51b815260206004820152601060248201526f15185c9bdd0e8814915153951154915160821b604482015290519081900360640190fd5b600b805460ff19169055600854604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b15801561147457600080fd5b505afa158015611488573d6000803e3d6000fd5b505050506040513d602081101561149e57600080fd5b5051600a549091506000906114ba90839063ffffffff612f6f16565b90506114df6114c7611226565b610b6783670de0b6b3a764000063ffffffff61283916565b92506003546000141561150d576114fe836103e863ffffffff612f6f16565b925061150d60006103e8612fb1565b60008311611562576040805162461bcd60e51b815260206004820152601760248201527f5461726f743a204d494e545f414d4f554e545f5a45524f000000000000000000604482015290519081900360640190fd5b61156c8484612fb1565b604080518281526020810185905281516001600160a01b0387169233927f2f00e3cdd69a77be7ed215ec7b2a36784dd158f921fca79ac29deffa353fe6ee929081900390910190a350506115be612d19565b600b805460ff19166001179055919050565b6001600160a01b038216600090815260046020526040812054808311156115fb576000915050610dde565b8281036000611624670de0b6b3a7640000610b67611617611226565b859063ffffffff61283916565b90506000600b60019054906101000a90046001600160a01b03166001600160a01b0316634d73e9ba886040518263ffffffff1660e01b815260040180826001600160a01b03166001600160a01b0316815260200191505060206040518083038186803b15801561169357600080fd5b505afa1580156116a7573d6000803e3d6000fd5b505050506040513d60208110156116bd57600080fd5b5051600c54604080516326b9f4dd60e11b81526001600160a01b038b8116600483015291519394506000939190921691634d73e9ba916024808301926020929190829003018186803b15801561171257600080fd5b505afa158015611726573d6000803e3d6000fd5b505050506040513d602081101561173c57600080fd5b50519050600061174d848484613036565b159a9950505050505050505050565b6000806000198414156117eb57600b54604080516326b9f4dd60e11b81526001600160a01b038881166004830152915161010090930490911691634d73e9ba91602480820192602092909190829003018186803b1580156117bc57600080fd5b505afa1580156117d0573d6000803e3d6000fd5b505050506040513d60208110156117e657600080fd5b505193505b60001983141561187157600c54604080516326b9f4dd60e11b81526001600160a01b03888116600483015291519190921691634d73e9ba916024808301926020929190829003018186803b15801561184257600080fd5b505afa158015611856573d6000803e3d6000fd5b505050506040513d602081101561186c57600080fd5b505192505b60006118af670de0b6b3a7640000610b6761188a611226565b6001600160a01b038a166000908152600460205260409020549063ffffffff61283916565b90506118bc818686613036565b92509250505b935093915050565b6008546001600160a01b031681565b600b5460ff16611923576040805162461bcd60e51b815260206004820152601060248201526f15185c9bdd0e8814915153951154915160821b604482015290519081900360640190fd5b600b805460ff1916905561193e81600164e8d4a51000612dc9565b600f8190556040805182815290517f1406e372b0b2138514c9e92f6c2fb8c03c4014b77165a13db9a2c53cdd859f6f9181900360200190a150600b805460ff19166001179055565b60046020526000908152604090205481565b60076020526000908152604090205481565b60085460408051600481526024810182526020810180516001600160e01b0316636ee2722760e01b1781529151815160009485946060946001600160a01b039092169391928291908083835b60208310611a155780518252601f1990920191602091820191016119f6565b6001836020036101000a038019825116818451168082178552505050505050905001915050600060405180830381855afa9150503d8060008114611a75576040519150601f19603f3d011682016040523d82523d6000602084013e611a7a565b606091505b50915091508115611aa657808060200190516020811015611a9a57600080fd5b505192506111bc915050565b6000925050506111bc565b60105481565b600b5460009060ff16611b04576040805162461bcd60e51b815260206004820152601060248201526f15185c9bdd0e8814915153951154915160821b604482015290519081900360640190fd5b600b805460ff1916905530600090815260046020526040902054611b42670de0b6b3a7640000610b67611b35611226565b849063ffffffff61283916565b915060008211611b99576040805162461bcd60e51b815260206004820152601960248201527f5461726f743a2052454445454d5f414d4f554e545f5a45524f00000000000000604482015290519081900360640190fd5b600a54821115611beb576040805162461bcd60e51b81526020600482015260186024820152770a8c2e4dee87440929ca6aa8c8c9286928a9ca8be8682a6960431b604482015290519081900360640190fd5b611bf53082612c8e565b611bff8383612aa2565b604080518381526020810183905281516001600160a01b0386169233927f3f693fff038bb8a046aa76d9516190ac7444f7d69cf952c4cbdc086fdef2d6fc929081900390910190a3506115be612d19565b60018054604080516020600284861615610100026000190190941693909304601f81018490048402820184019092528181529291830182828015610a265780601f106109fb57610100808354040283529160200191610a26565b600b54600c546000916001600160a01b036101009091048116918116908516821480611ce75750806001600160a01b0316856001600160a01b0316145b611d38576040805162461bcd60e51b815260206004820152601960248201527f5461726f743a20494e56414c49445f424f52524f5741424c4500000000000000604482015290519081900360640190fd5b6000826001600160a01b0316866001600160a01b031614611d5b57600019611d5d565b845b90506000826001600160a01b0316876001600160a01b031614611d8257600019611d84565b855b9050600061174d89848461175c565b60115481565b6000610dda338484612f09565b600a5481565b670e92596fd629000081565b600b5460009061010090046001600160a01b0316331480611de35750600c546001600160a01b031633145b611e2a576040805162461bcd60e51b815260206004820152601360248201527215185c9bdd0e8815539055551213d492569151606a1b604482015290519081900360640190fd5b6000611e35846113aa565b91505060008111611e8d576040805162461bcd60e51b815260206004820152601d60248201527f5461726f743a20494e53554646494349454e545f53484f525446414c4c000000604482015290519081900360640190fd5b600b5460009061010090046001600160a01b0316331415611eb857611eb0612284565b509050611ec4565b611ec0612284565b9150505b6000611ee1611ed1611226565b610b67878563ffffffff61283916565b9050611f04670de0b6b3a7640000610b676010548461283990919063ffffffff16565b9350611f75846040518060400160405280601b81526020017f5461726f743a204c49515549444154494e475f544f4f5f4d5543480000000000815250600460008a6001600160a01b03166001600160a01b0316815260200190815260200160002054612e729092919063ffffffff16565b6001600160a01b038088166000908152600460205260408082209390935590891681522054611faa908563ffffffff612c3416565b6001600160a01b0380891660008181526004602090815260409182902094909455805188815290519193928a1692600080516020613e7d83398151915292918290030190a36011541561217a57600061201a670de0b6b3a7640000610b676011548561283990919063ffffffff16565b90506000600960009054906101000a90046001600160a01b03166001600160a01b031663345ef9416040518163ffffffff1660e01b815260040160206040518083038186803b15801561206c57600080fd5b505afa158015612080573d6000803e3d6000fd5b505050506040513d602081101561209657600080fd5b5051604080518082018252601b81527f5461726f743a204c49515549444154494e475f544f4f5f4d55434800000000006020828101919091526001600160a01b038c166000908152600490915291909120549192506120fd9190849063ffffffff612e7216565b6001600160a01b03808a166000908152600460205260408082209390935590831681522054612132908363ffffffff612c3416565b6001600160a01b0380831660008181526004602090815260409182902094909455805186815290519193928c1692600080516020613e7d83398151915292918290030190a350505b5050509392505050565b6103e881565b600b5460ff166121d4576040805162461bcd60e51b815260206004820152601060248201526f15185c9bdd0e8814915153951154915160821b604482015290519081900360640190fd5b600b805460ff19169055600a54600854604080516370a0823160e01b8152306004820152905161227493859361226f9391926001600160a01b03909116916370a08231916024808301926020929190829003018186803b15801561223757600080fd5b505afa15801561224b573d6000803e3d6000fd5b505050506040513d602081101561226157600080fd5b50519063ffffffff612f6f16565b612aa2565b50600b805460ff19166001179055565b600080600080612292610a2e565b6001600160701b031691506001600160701b031691506000600860009054906101000a90046001600160a01b03166001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b1580156122f857600080fd5b505afa15801561230c573d6000803e3d6000fd5b505050506040513d602081101561232257600080fd5b50516008546040805163392f37e960e01b8152905192935060009283926001600160a01b03169163392f37e99160048083019260e0929190829003018186803b15801561236e57600080fd5b505afa158015612382573d6000803e3d6000fd5b505050506040513d60e081101561239857600080fd5b50805160209091015190925090506123c282610b6787670de0b6b3a764000063ffffffff61283916565b94506123e081610b6786670de0b6b3a764000063ffffffff61283916565b9350600080612401670de0b6b3a7640000610b67898063ffffffff61283916565b90506000612421670de0b6b3a7640000610b67898063ffffffff61283916565b905061245c61243b83610f7984600363ffffffff61283916565b610b67670de0b6b3a7640000610cf385610f7988600363ffffffff61283916565b92506124999150849050610b67670de0b6b3a7640000610cf38a8383836124898a8363ffffffff612c3416565b610b678e8c63ffffffff61283916565b97506124da82610b67670de0b6b3a7640000610cf3898383836124c28a8363ffffffff612c3416565b610b678e670de0b6b3a764000063ffffffff61283916565b96505050505050509091565b6009546001600160a01b031681565b6009546001600160a01b0316331461254a576040805162461bcd60e51b815260206004820152601360248201527215185c9bdd0e8815539055551213d492569151606a1b604482015290519081900360640190fd5b6125bd87878080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050604080516020601f8b0181900481028201810190925289815292508991508890819084018382808284376000920191909152506134ab92505050565b600880546001600160a01b03199081166001600160a01b0386811691909117909255600b8054610100600160a81b03191661010086851602179055600c80549091168383161790556009546040805163069f611560e31b8152905191909216916334fb08a8916004808301926020929190829003018186803b15801561264257600080fd5b505afa158015612656573d6000803e3d6000fd5b505050506040513d602081101561266c57600080fd5b5051600d80546001600160a01b0319166001600160a01b0390921691909117905550505050505050565b6126c6878787878787877f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9613573565b6126d1878787612a40565b50505050505050565b600c546001600160a01b031681565b6714d1120d7b16000081565b600b5460ff1661273f576040805162461bcd60e51b815260206004820152601060248201526f15185c9bdd0e8814915153951154915160821b604482015290519081900360640190fd5b600b805460ff1916905561276481670de0b6b3a76400006714d1120d7b160000612dc9565b600e8190556040805182815290517fdff9a61839be6f6ce5ea77311cc351786a39a9f337c507ff35e7b358fd39c0439181900360200190a150600b805460ff19166001179055565b600560209081526000928352604080842090915290825290205481565b600181565b600b5460ff16612818576040805162461bcd60e51b815260206004820152601060248201526f15185c9bdd0e8814915153951154915160821b604482015290519081900360640190fd5b600b805460ff1916905561282a612d19565b600b805460ff19166001179055565b60008261284857506000610dde565b8282028284828161285557fe5b04146111ad5760405162461bcd60e51b8152600401808060200182810382526021815260200180613e5c6021913960400191505060405180910390fd5b60006111ad83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250613748565b6000806128f384610b6788670de0b6b3a764000063ffffffff61283916565b9050600061291384610b6788670de0b6b3a764000063ffffffff61283916565b90506000612933670de0b6b3a7640000610b67858563ffffffff61283916565b90506000612972612956670de0b6b3a7640000610b67868063ffffffff61283916565b610f79670de0b6b3a7640000610b67888063ffffffff61283916565b9050612990670de0b6b3a7640000610b67848463ffffffff61283916565b9450505050505b949350505050565b600060038211156129e2575080600160028204015b818110156129dc578091506002818285816129cb57fe5b0401816129d457fe5b0490506129b4565b506129ec565b81156129ec575060015b919050565b6000600160701b8210612a3c576040805162461bcd60e51b815260206004820152600e60248201526d2a30b937ba1d1029a0a32298989960911b604482015290519081900360640190fd5b5090565b6001600160a01b03808416600081815260056020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b600854604080518082018252601981527f7472616e7366657228616464726573732c75696e74323536290000000000000060209182015281516001600160a01b0386811660248301526044808301879052845180840390910181526064909201845291810180516001600160e01b031663a9059cbb60e01b1781529251815160009560609594169382918083835b60208310612b4f5780518252601f199092019160209182019101612b30565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114612bb1576040519150601f19603f3d011682016040523d82523d6000602084013e612bb6565b606091505b5091509150818015612be4575080511580612be45750808060200190516020811015612be157600080fd5b50515b612c2e576040805162461bcd60e51b815260206004820152601660248201527515185c9bdd0e881514905394d1915497d1905253115160521b604482015290519081900360640190fd5b50505050565b6000828201838110156111ad576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b6001600160a01b038216600090815260046020526040902054612cb7908263ffffffff612f6f16565b6001600160a01b038316600090815260046020526040902055600354612ce3908263ffffffff612f6f16565b6003556040805182815290516000916001600160a01b03851691600080516020613e7d8339815191529181900360200190a35050565b600854604080516370a0823160e01b815230600482015290516001600160a01b03909216916370a0823191602480820192602092909190829003018186803b158015612d6457600080fd5b505afa158015612d78573d6000803e3d6000fd5b505050506040513d6020811015612d8e57600080fd5b5051600a81905560408051918252517f8a0df8ef054fae2c3d2d19a7b322e864870cc9fd3cb07fb9526309c596244bf49181900360200190a1565b612dd16137ad565b81831015612e1f576040805162461bcd60e51b81526020600482015260166024820152755461726f743a20494e56414c49445f53455454494e4760501b604482015290519081900360640190fd5b80831115612e6d576040805162461bcd60e51b81526020600482015260166024820152755461726f743a20494e56414c49445f53455454494e4760501b604482015290519081900360640190fd5b505050565b60008184841115612f015760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612ec6578181015183820152602001612eae565b50505050905090810190601f168015612ef35780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b612f1383826115d0565b612f64576040805162461bcd60e51b815260206004820152601d60248201527f5461726f743a20494e53554646494349454e545f4c4951554944495459000000604482015290519081900360640190fd5b612e6d83838361387b565b60006111ad83836040518060400160405280601f81526020017f536166654d6174683a207375627472616374696f6e20756e646572666c6f7700815250612e72565b600354612fc4908263ffffffff612c3416565b6003556001600160a01b038216600090815260046020526040902054612ff0908263ffffffff612c3416565b6001600160a01b0383166000818152600460209081526040808320949094558351858152935192939192600080516020613e7d8339815191529281900390910190a35050565b600080613041613d40565b60008061304c610a2e565b6001600160701b031691506001600160701b03169150600080600860009054906101000a90046001600160a01b03166001600160a01b031663392f37e96040518163ffffffff1660e01b815260040160e06040518083038186803b1580156130b357600080fd5b505afa1580156130c7573d6000803e3d6000fd5b505050506040513d60e08110156130dd57600080fd5b508051602090910151909250905061310782610b6786670de0b6b3a764000063ffffffff61283916565b855261312581610b6785670de0b6b3a764000063ffffffff61283916565b856020018181525050505060008061314285600e54600f5461395b565b915091506000600860009054906101000a90046001600160a01b03166001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561319657600080fd5b505afa1580156131aa573d6000803e3d6000fd5b505050506040513d60208110156131c057600080fd5b5051905060008a8a8d8380806131d68d8b61399e565b9194509250905060006131fb8d610b678b670de0b6b3a764000063ffffffff61283916565b905061321984610b6783670de0b6b3a764000063ffffffff61283916565b905061324661323683670de0b6b3a764000063ffffffff612c3416565b610b67838563ffffffff61283916565b905060006132668d610b678c670de0b6b3a764000063ffffffff61283916565b905061328484610b6783670de0b6b3a764000063ffffffff61283916565b90506132a16114c784670de0b6b3a764000063ffffffff612c3416565b90506132bf670de0b6b3a7640000610b678a8563ffffffff61283916565b98506132ed6132e0670de0b6b3a7640000610b678a8563ffffffff61283916565b8a9063ffffffff612c3416565b9850613313670de0b6b3a7640000610b676133066111b4565b8c9063ffffffff61283916565b9850505050505060008060008061332a8e8b61399e565b91945092509050600061334f8e610b678c670de0b6b3a764000063ffffffff61283916565b905061336d84610b6783670de0b6b3a764000063ffffffff61283916565b905061338a61323683670de0b6b3a764000063ffffffff612c3416565b905060006133aa8e610b678d670de0b6b3a764000063ffffffff61283916565b90506133c884610b6783670de0b6b3a764000063ffffffff61283916565b90506133e56114c784670de0b6b3a764000063ffffffff612c3416565b9050613403670de0b6b3a7640000610b678b8563ffffffff61283916565b9550613431613424670de0b6b3a7640000610b678b8563ffffffff61283916565b879063ffffffff612c3416565b9550613457670de0b6b3a7640000610b6761344a6111b4565b899063ffffffff61283916565b95505050505050600081861161346d578161346f565b855b9050808310613491579091039b5060009a506118c29950505050505050505050565b60009d50919091039a506118c29950505050505050505050565b81516134be906000906020850190613d5a565b5080516134d2906001906020840190613d5a565b506040514690806052613e0a8239604080519182900360520182208651602097880120838301835260018452603160f81b93880193909352815180880191909152808201929092527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc6606083015260808201939093523060a0808301919091528351808303909101815260c090910190925250805192019190912060065550565b428510156135b9576040805162461bcd60e51b815260206004820152600e60248201526d15185c9bdd0e881156141254915160921b604482015290519081900360640190fd5b6006546001600160a01b03808a1660008181526007602090815260408083208054600180820190925582518085018a905280840196909652958e166060860152608085018d905260a085019590955260c08085018c90528151808603909101815260e08501825280519083012061190160f01b6101008601526101028501969096526101228085019690965280518085039096018652610142840180825286519683019690962095839052610162840180825286905260ff8a166101828501526101a284018990526101c28401889052519193926101e280820193601f1981019281900390910190855afa1580156136b5573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116158015906136eb5750896001600160a01b0316816001600160a01b0316145b61373c576040805162461bcd60e51b815260206004820152601860248201527f5461726f743a20494e56414c49445f5349474e41545552450000000000000000604482015290519081900360640190fd5b50505050505050505050565b600081836137975760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315612ec6578181015183820152602001612eae565b5060008385816137a357fe5b0495945050505050565b600960009054906101000a90046001600160a01b03166001600160a01b031663f851a4406040518163ffffffff1660e01b815260040160206040518083038186803b1580156137fb57600080fd5b505afa15801561380f573d6000803e3d6000fd5b505050506040513d602081101561382557600080fd5b50516001600160a01b03163314613879576040805162461bcd60e51b815260206004820152601360248201527215185c9bdd0e8815539055551213d492569151606a1b604482015290519081900360640190fd5b565b604080518082018252601881527f5461726f743a205452414e534645525f544f4f5f4849474800000000000000006020808301919091526001600160a01b0386166000908152600490915291909120546138dc91839063ffffffff612e7216565b6001600160a01b038085166000908152600460205260408082209390935590841681522054613911908263ffffffff612c3416565b6001600160a01b038084166000818152600460209081526040918290209490945580518581529051919392871692600080516020613e7d83398151915292918290030190a3505050565b600080613969858585613ad2565b91506139948561398e6ec097ce7bc90715b34b9f10000000008763ffffffff61289216565b85613ad2565b9050935093915050565b815160208301516000918291829190826139ca670de0b6b3a7640000610b67858063ffffffff61283916565b905060006139ea670de0b6b3a7640000610b67858063ffffffff61283916565b90506000613a10670de0b6b3a7640000610b678b610cf38383888463ffffffff61283916565b90506000613a40670de0b6b3a7640000610b67613a33878663ffffffff612c3416565b8d9063ffffffff61283916565b9050613a6a610cff670de0b6b3a7640000610cf382828287610b6783838e8e63ffffffff612c3416565b9850613a88670de0b6b3a7640000610b678b8d63ffffffff61283916565b9750613ac3613aa285610f7985600363ffffffff61283916565b610b67670de0b6b3a7640000610cf386610f798a600363ffffffff61283916565b96505050505050509250925092565b600082670de0b6b3a76400001415613af35750670de0b6b3a76400006111ad565b835160208501516000613b18670de0b6b3a7640000610b67858063ffffffff61283916565b90506000613b38670de0b6b3a7640000610b67858063ffffffff61283916565b90506000613b5182610f7985600363ffffffff61283916565b90506000613b6a84610f7985600363ffffffff61283916565b90506000613b8287610b67888663ffffffff61283916565b9050613ba082610b6783670de0b6b3a764000063ffffffff61283916565b9050613bbe670de0b6b3a7640000610b67838d63ffffffff61283916565b9050600080670de0b6b3a76400008311613bf157613be383600363ffffffff61289216565b670de0b6b3a7640000613c0b565b670de0b6b3a7640000613c0b84600363ffffffff61283916565b91509150613c1b8383838e613c42565b9950613c3188610b678c8c63ffffffff61283916565b9d9c50505050505050505050505050565b6000805b60ff811015613cad576000613c666002610b67878963ffffffff612f6f16565b9050613c78868263ffffffff612c3416565b9250838111613c8957506129979050565b613c938784613cb6565b15613ca057829450613ca4565b8295505b50600101613c46565b50949350505050565b600080613cef613ccd84600363ffffffff61283916565b610f79670de0b6b3a7640000610b6787610cf38383838063ffffffff61283916565b90506000613d18670de0b6b3a7640000610b6786610cf3838383838d600363ffffffff61283916565b90508082118015613d37575084613d35838363ffffffff612f6f16565b115b95945050505050565b604051806040016040528060008152602001600081525090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10613d9b57805160ff1916838001178555613dc8565b82800160010185558215613dc8579182015b82811115613dc8578251825591602001919060010190613dad565b50612a3c926111bc9250905b80821115612a3c5760008155600101613dd456fe5461726f743a20494e53554646494349454e545f52454445454d5f544f4b454e53454950373132446f6d61696e28737472696e67206e616d652c737472696e672076657273696f6e2c75696e7432353620636861696e49642c6164647265737320766572696679696e67436f6e747261637429536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa265627a7a723158204179e2ae80346fc9b8136450a8fdf526914a774be8358416faa629ce7bfb234564736f6c63430005100032

Block Transaction Gas Used Reward
Age Block Fee Address BC Fee Address Voting Power Jailed Incoming
Block Uncle Number Difficulty Gas Used Reward
Loading
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.