Contract 0x75ddb769e76f7d30340357f4810300eb3a4d9a87 1

 

Contract Overview

Balance:
0 Ether

EtherValue:
$0.00

Token:
Txn Hash Method
Index
From
To
Value
0x48bb76c9298463341187306a3513172aa96a6bacd3db7e482b2865dbb51c9532Approve259179232022-09-28 6:41:302 days 15 hrs ago0xf3b7b6065dd815fa4efbed65b41e27b743426000 IN  0x75ddb769e76f7d30340357f4810300eb3a4d9a870 Ether0.0000425844610.0011
0xbdc7161db7c3da00e48b4d39a250233fa49701605fb92c0826be1a159b7a58a4Approve258803562022-09-28 2:45:492 days 19 hrs ago0xe699e8334d901986d9ff6bc5ae4b44ae5122f1ee IN  0x75ddb769e76f7d30340357f4810300eb3a4d9a870 Ether0.0000794041640.00100155
0x945d4dfc633b045bedf4be98d2ea21851f5da303e2b3f5c4dd5d342f789f2d26Approve256984152022-09-27 6:26:423 days 15 hrs ago0xe77590755d8300c225ff40c8f0f7c78bcd03bdbe IN  0x75ddb769e76f7d30340357f4810300eb3a4d9a870 Ether0.0000397362940.00100155
0xd04bb8a8b6395142d1d6d5226005fc2bb21385482b86fb363744c87c1124d636Transfer249382092022-09-23 18:29:317 days 3 hrs ago0x7c71d666414abbe69454770e066133f3f876ca76 IN  0x75ddb769e76f7d30340357f4810300eb3a4d9a870 Ether0.0000410315590.00100155
0x6c72e4c3a58f7502e80a0883e855bbd11ec4e1c3c1e447853399dc9ea224a504Approve246655012022-09-22 23:21:527 days 23 hrs ago0x7c71d666414abbe69454770e066133f3f876ca76 IN  0x75ddb769e76f7d30340357f4810300eb3a4d9a870 Ether0.0000272765890.00100155
0x1ff5d1de496bc9c30ffb9ff81e677fa55a4eb8ee024bf1e31a27535ae7e07637Approve244278232022-09-22 3:29:428 days 18 hrs ago0x5388a7f24e86c9c9d855a98c2f5a339afa6a3acc IN  0x75ddb769e76f7d30340357f4810300eb3a4d9a870 Ether0.0000219949820.00100155
0xbcfcadc9ce713f91f9572d2542b4c1c946ed1386a68e3a113b162b9117c8b18cTransfer232431522022-09-15 8:33:5115 days 13 hrs ago0x37be92f21943dc91629d884f8c41c8203024633a IN  0x75ddb769e76f7d30340357f4810300eb3a4d9a870 Ether0.000107656720.001
0x1c9bdb887b9fa21baa309b60cfd02f95b011f532b21b095c4d191ced8721fb2aApprove229346332022-09-13 6:54:5817 days 15 hrs ago0x3112e8059368ef351afb13162095d52494743e9d IN  0x75ddb769e76f7d30340357f4810300eb3a4d9a870 Ether0.0000316281880.001
0x8a3ccef7491dc6024e02405d9fb2a9ff81eb4717c38440adb1eaafdc62c317a0Approve227462752022-09-11 16:53:4919 days 5 hrs ago0xdb2b9d473014d8c6a5e55da92205199457ba6624 IN  0x75ddb769e76f7d30340357f4810300eb3a4d9a870 Ether0.0000556417220.001
0x83e8b7f305fb1266e088b8b6772eb117c2e2d287e2bc7c2b4d2bad1c02f5926cApprove227394422022-09-11 15:17:3619 days 7 hrs ago0x1793202d781ba4c2590218d66c7889db4cde26b0 IN  0x75ddb769e76f7d30340357f4810300eb3a4d9a870 Ether0.0000626933930.001
0xf1572b56805f7d3dc100253e730027c02ab7d4a508dd1f5c7237ab03eb3a27b4Approve226716332022-09-10 22:44:2819 days 23 hrs ago0xaf1bff74708098db603e48aaebec1bbae03dcf11 IN  0x75ddb769e76f7d30340357f4810300eb3a4d9a870 Ether0.0000670824550.001
0xd29c66009f818803a307ad978ae55bc2a6671fcf214976e362401c77aece74a6Approve226570232022-09-10 18:46:5520 days 3 hrs ago0xf9c840804d361d8fbe9968c14da1e6433fc27139 IN  0x75ddb769e76f7d30340357f4810300eb3a4d9a870 Ether0.0000243912530.001
0x219b2dafc7d5d6bff92d2d6d4bd618d085c2f09e8d633b56a3a753112c8fabc5Approve221841452022-09-06 19:27:2624 days 2 hrs ago0x4a5c218cf4fb73f0c28d7a0b913a73876da21eb9 IN  0x75ddb769e76f7d30340357f4810300eb3a4d9a870 Ether0.0000904321050.001
0x483c34d13069c6d55258796eec068ed28df3a202b8efad839f886a93ad4cffa7Approve220727172022-09-06 3:19:1024 days 19 hrs ago0xda5d339742caac045b625a5dbe240162932f2c10 IN  0x75ddb769e76f7d30340357f4810300eb3a4d9a870 Ether0.0000283903270.001
0xc40fd876b49dbe00c5b2ae2399a66b0381ba0cc7d6ab086488ecf605168f7fa7Approve219946592022-09-05 11:38:4225 days 10 hrs ago0xda5d339742caac045b625a5dbe240162932f2c10 IN  0x75ddb769e76f7d30340357f4810300eb3a4d9a870 Ether0.0000211774430.001
0xd8b2b65d9ea76661757673ab152818f082ddf4047b7e76a4155801ccd06cad4eApprove213973042022-08-31 22:23:1030 days ago0x1dc619c4f2d36965ee1f8cd94732dac48003a917 IN  0x75ddb769e76f7d30340357f4810300eb3a4d9a870 Ether0.0000816081560.001
0x07238487e3712450282a87288ba2b1b014dff2a324a7e751cb858e8e5868e462Borrow Approve213663682022-08-31 16:46:2130 days 5 hrs ago0x60fb4b046b07ce529fb93598286339873d26dd0c IN  0x75ddb769e76f7d30340357f4810300eb3a4d9a870 Ether0.0001299463790.002
0x6e0760a6605bc51eae7d462d2a6106b44e3af4c7059a6e54b4c2d0f5e418f111Approve212381532022-08-30 21:00:4831 days 1 hr ago0xb3f09f6d5d1d22579383e56123b7c360f343e255 IN  0x75ddb769e76f7d30340357f4810300eb3a4d9a870 Ether0.0000866766770.001
0x25f403499ab12e9fafa3a586d27f35500558df071ecab28aaf297223bcfac5aaBorrow Approve212154152022-08-30 17:33:4931 days 4 hrs ago0x4deb56a42fc63650b2f0bfb9abe1850e3a091371 IN  0x75ddb769e76f7d30340357f4810300eb3a4d9a870 Ether0.0000851801960.001
0x3a15f056cf6e7687dbc8553d99e96bc055a2fa46741285c3d73adeb8020feae6Approve211092102022-08-30 4:50:4431 days 17 hrs ago0xfee0a5607c453f0ea32599ad0388eabd37a9c404 IN  0x75ddb769e76f7d30340357f4810300eb3a4d9a870 Ether0.000056271340.001
0xd99a4296c9c628e6a70962865119a01f87e16d722c33bfef4cc8e3fcf28bc52bBorrow Approve210848902022-08-30 0:43:4131 days 21 hrs ago0x445ff0ce036003cfbf5b2e4d0f1aaefb9caec16f IN  0x75ddb769e76f7d30340357f4810300eb3a4d9a870 Ether0.0000548428120.001
0x11a9de96018687f52b54ecac2f6d1821cbe4df540371c04f5ac0c8346bcae194Approve209803342022-08-29 6:38:3332 days 15 hrs ago0x8896e0833d371a358ee06eba7d4052d3e69aa189 IN  0x75ddb769e76f7d30340357f4810300eb3a4d9a870 Ether0.0000195000030.001
0x244cbc44352e8d5b767ad01740652992e876d5679b886d2e5bcf8b6b52ada95aApprove208759592022-08-28 11:31:1633 days 10 hrs ago0xdb2b9d473014d8c6a5e55da92205199457ba6624 IN  0x75ddb769e76f7d30340357f4810300eb3a4d9a870 Ether0.0000150610480.001
0x59a9c88cb75dc9abc154927ecf5efce4aa63571d3256a28ccfc83e2228425a51Approve208568682022-08-28 6:58:5133 days 15 hrs ago0x666ef6654b56885af2351c4c375519d7d8cc87a4 IN  0x75ddb769e76f7d30340357f4810300eb3a4d9a870 Ether0.0000221540350.001
0x6e07db5c14e1c237685b2198568a754dea9415b6404d6b7b670a39dbda9ef385Borrow Approve207479692022-08-27 6:59:2934 days 15 hrs ago0x9aea832986a8c6978bb9de1a4d24f4a44f924bfb IN  0x75ddb769e76f7d30340357f4810300eb3a4d9a870 Ether0.0000450855260.0007
[ Download CSV Export 
Latest 25 internal transaction
Parent Txn Hash Block From To Value
0xca13a7a4f030977cd58ccc5e8f044262d85cfe604f7be84ce92609b902d09ebe265676342022-09-30 20:03:572 hrs 19 mins ago 0x75ddb769e76f7d30340357f4810300eb3a4d9a87 0x7f5c764cbc14f9669b88837ca1490cca17c316070 Ether
0xca13a7a4f030977cd58ccc5e8f044262d85cfe604f7be84ce92609b902d09ebe265676342022-09-30 20:03:572 hrs 19 mins ago 0x75ddb769e76f7d30340357f4810300eb3a4d9a87 0x7f5c764cbc14f9669b88837ca1490cca17c316070 Ether
0xca13a7a4f030977cd58ccc5e8f044262d85cfe604f7be84ce92609b902d09ebe265676342022-09-30 20:03:572 hrs 19 mins ago 0xa516b9c7378799799e6dfadbdabf45d5b584405f 0x75ddb769e76f7d30340357f4810300eb3a4d9a870 Ether
0xca13a7a4f030977cd58ccc5e8f044262d85cfe604f7be84ce92609b902d09ebe265676342022-09-30 20:03:572 hrs 19 mins ago 0xa516b9c7378799799e6dfadbdabf45d5b584405f 0x75ddb769e76f7d30340357f4810300eb3a4d9a870 Ether
0xca13a7a4f030977cd58ccc5e8f044262d85cfe604f7be84ce92609b902d09ebe265676342022-09-30 20:03:572 hrs 19 mins ago 0xa516b9c7378799799e6dfadbdabf45d5b584405f 0x75ddb769e76f7d30340357f4810300eb3a4d9a870 Ether
0xca13a7a4f030977cd58ccc5e8f044262d85cfe604f7be84ce92609b902d09ebe265676342022-09-30 20:03:572 hrs 19 mins ago 0xa516b9c7378799799e6dfadbdabf45d5b584405f 0x75ddb769e76f7d30340357f4810300eb3a4d9a870 Ether
0x6b0ca4373b50ab6c2aa85d183d21b54307119470af3324f1ae9a0c44db99f65a265673632022-09-30 20:02:272 hrs 20 mins ago 0x75ddb769e76f7d30340357f4810300eb3a4d9a87 0x7f5c764cbc14f9669b88837ca1490cca17c316070 Ether
0x6b0ca4373b50ab6c2aa85d183d21b54307119470af3324f1ae9a0c44db99f65a265673632022-09-30 20:02:272 hrs 20 mins ago 0x75ddb769e76f7d30340357f4810300eb3a4d9a87 0x7f5c764cbc14f9669b88837ca1490cca17c316070 Ether
0x6b0ca4373b50ab6c2aa85d183d21b54307119470af3324f1ae9a0c44db99f65a265673632022-09-30 20:02:272 hrs 20 mins ago 0xa516b9c7378799799e6dfadbdabf45d5b584405f 0x75ddb769e76f7d30340357f4810300eb3a4d9a870 Ether
0x6b0ca4373b50ab6c2aa85d183d21b54307119470af3324f1ae9a0c44db99f65a265673632022-09-30 20:02:272 hrs 20 mins ago 0xa516b9c7378799799e6dfadbdabf45d5b584405f 0x75ddb769e76f7d30340357f4810300eb3a4d9a870 Ether
0x6b0ca4373b50ab6c2aa85d183d21b54307119470af3324f1ae9a0c44db99f65a265673632022-09-30 20:02:272 hrs 20 mins ago 0xa516b9c7378799799e6dfadbdabf45d5b584405f 0x75ddb769e76f7d30340357f4810300eb3a4d9a870 Ether
0x6b0ca4373b50ab6c2aa85d183d21b54307119470af3324f1ae9a0c44db99f65a265673632022-09-30 20:02:272 hrs 20 mins ago 0xa516b9c7378799799e6dfadbdabf45d5b584405f 0x75ddb769e76f7d30340357f4810300eb3a4d9a870 Ether
0xf2c017098d8b15b7a676ae61363e6b8cb5531d924b3581f1cc5b9c5216cc8b51265544692022-09-30 18:27:013 hrs 56 mins ago 0x75ddb769e76f7d30340357f4810300eb3a4d9a87 0x7f5c764cbc14f9669b88837ca1490cca17c316070 Ether
0xf2c017098d8b15b7a676ae61363e6b8cb5531d924b3581f1cc5b9c5216cc8b51265544692022-09-30 18:27:013 hrs 56 mins ago 0x75ddb769e76f7d30340357f4810300eb3a4d9a87 0x7f5c764cbc14f9669b88837ca1490cca17c316070 Ether
0xf2c017098d8b15b7a676ae61363e6b8cb5531d924b3581f1cc5b9c5216cc8b51265544692022-09-30 18:27:013 hrs 56 mins ago 0x75ddb769e76f7d30340357f4810300eb3a4d9a87 0xd7cabef2c1fd77a31c5ba97c724b82d3e25fc83c0 Ether
0xf2c017098d8b15b7a676ae61363e6b8cb5531d924b3581f1cc5b9c5216cc8b51265544692022-09-30 18:27:013 hrs 56 mins ago 0xa516b9c7378799799e6dfadbdabf45d5b584405f 0x75ddb769e76f7d30340357f4810300eb3a4d9a870 Ether
0xf2c017098d8b15b7a676ae61363e6b8cb5531d924b3581f1cc5b9c5216cc8b51265544692022-09-30 18:27:013 hrs 56 mins ago 0xa516b9c7378799799e6dfadbdabf45d5b584405f 0x75ddb769e76f7d30340357f4810300eb3a4d9a870 Ether
0xf2c017098d8b15b7a676ae61363e6b8cb5531d924b3581f1cc5b9c5216cc8b51265544692022-09-30 18:27:013 hrs 56 mins ago 0xa516b9c7378799799e6dfadbdabf45d5b584405f 0x75ddb769e76f7d30340357f4810300eb3a4d9a870 Ether
0x626ce67b2aca8faf9bd3b9b7e849e3aa502dd25e3dcd165505df022cad79b760265195102022-09-30 14:56:457 hrs 26 mins ago 0xb5639e9efa70b6d70a5f1fed3c850b14d3cc66d3 0x75ddb769e76f7d30340357f4810300eb3a4d9a870 Ether
0x626ce67b2aca8faf9bd3b9b7e849e3aa502dd25e3dcd165505df022cad79b760265195102022-09-30 14:56:457 hrs 26 mins ago 0x75ddb769e76f7d30340357f4810300eb3a4d9a87 0x7f5c764cbc14f9669b88837ca1490cca17c316070 Ether
0x626ce67b2aca8faf9bd3b9b7e849e3aa502dd25e3dcd165505df022cad79b760265195102022-09-30 14:56:457 hrs 26 mins ago 0x75ddb769e76f7d30340357f4810300eb3a4d9a87 0xb5639e9efa70b6d70a5f1fed3c850b14d3cc66d30 Ether
0x626ce67b2aca8faf9bd3b9b7e849e3aa502dd25e3dcd165505df022cad79b760265195102022-09-30 14:56:457 hrs 26 mins ago 0x75ddb769e76f7d30340357f4810300eb3a4d9a87 0x7f5c764cbc14f9669b88837ca1490cca17c316070 Ether
0x626ce67b2aca8faf9bd3b9b7e849e3aa502dd25e3dcd165505df022cad79b760265195102022-09-30 14:56:457 hrs 26 mins ago 0xa516b9c7378799799e6dfadbdabf45d5b584405f 0x75ddb769e76f7d30340357f4810300eb3a4d9a870 Ether
0x626ce67b2aca8faf9bd3b9b7e849e3aa502dd25e3dcd165505df022cad79b760265195102022-09-30 14:56:457 hrs 26 mins ago 0x75ddb769e76f7d30340357f4810300eb3a4d9a87 0xa516b9c7378799799e6dfadbdabf45d5b584405f0 Ether
0x626ce67b2aca8faf9bd3b9b7e849e3aa502dd25e3dcd165505df022cad79b760265195102022-09-30 14:56:457 hrs 26 mins ago 0x75ddb769e76f7d30340357f4810300eb3a4d9a87 0x7f5c764cbc14f9669b88837ca1490cca17c316070 Ether
[ Download CSV Export 
Loading

Similar Match Source Code
Note: This contract matches the deployed ByteCode of the Source Code for Contract 0xd1e303e68aD59d067c775ee5F307191af7F9A696

Contract Name:
Borrowable

Compiler Version
v0.5.16+commit.9c3226ce

Optimization Enabled:
Yes with 200 runs

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

import "./PoolToken.sol";
import "./BAllowance.sol";
import "./BInterestRateModel.sol";
import "./BSetter.sol";
import "./BStorage.sol";
import "./interfaces/IBorrowable.sol";
import "./interfaces/ICollateral.sol";
import "./interfaces/ITarotCallee.sol";
import "./interfaces/IERC20.sol";
import "./interfaces/IFactory.sol";
import "./interfaces/IBorrowTracker.sol";
import "./libraries/Math.sol";

contract Borrowable is
    IBorrowable,
    PoolToken,
    BStorage,
    BSetter,
    BInterestRateModel,
    BAllowance
{
    uint256 public constant BORROW_FEE = 0.0001e18; //0.01%

    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
    );

    constructor() public {}

    /*** PoolToken ***/

    function _update() internal {
        super._update();
        _calculateBorrowRate();
    }

    function _mintReserves(uint256 _exchangeRate, uint256 _totalSupply)
        internal
        returns (uint256)
    {
        uint256 _exchangeRateLast = exchangeRateLast;
        if (_exchangeRate > _exchangeRateLast) {
            uint256 _exchangeRateNew =
                _exchangeRate.sub(
                    _exchangeRate.sub(_exchangeRateLast).mul(reserveFactor).div(
                        1e18
                    )
                );
            uint256 liquidity =
                _totalSupply.mul(_exchangeRate).div(_exchangeRateNew).sub(
                    _totalSupply
                );
            if (liquidity > 0) {
                address reservesManager = IFactory(factory).reservesManager();
                _mint(reservesManager, liquidity);
            }
            exchangeRateLast = _exchangeRateNew;
            return _exchangeRateNew;
        } else return _exchangeRate;
    }

    function exchangeRate() public accrue returns (uint256) {
        uint256 _totalSupply = totalSupply;
        uint256 _actualBalance = totalBalance.add(totalBorrows);
        if (_totalSupply == 0 || _actualBalance == 0)
            return initialExchangeRate;
        uint256 _exchangeRate = _actualBalance.mul(1e18).div(_totalSupply);
        return _mintReserves(_exchangeRate, _totalSupply);
    }

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

    /*** Borrowable ***/

    // this is the stored borrow balance; the current borrow balance may be slightly higher
    function borrowBalance(address borrower) public view returns (uint256) {
        BorrowSnapshot memory borrowSnapshot = borrowBalances[borrower];
        if (borrowSnapshot.interestIndex == 0) return 0; // not initialized
        return
            uint256(borrowSnapshot.principal).mul(borrowIndex).div(
                borrowSnapshot.interestIndex
            );
    }

    function _trackBorrow(
        address borrower,
        uint256 accountBorrows,
        uint256 _borrowIndex
    ) internal {
        address _borrowTracker = borrowTracker;
        if (_borrowTracker == address(0)) return;
        IBorrowTracker(_borrowTracker).trackBorrow(
            borrower,
            accountBorrows,
            _borrowIndex
        );
    }

    function _updateBorrow(
        address borrower,
        uint256 borrowAmount,
        uint256 repayAmount
    )
        private
        returns (
            uint256 accountBorrowsPrior,
            uint256 accountBorrows,
            uint256 _totalBorrows
        )
    {
        accountBorrowsPrior = borrowBalance(borrower);
        if (borrowAmount == repayAmount)
            return (accountBorrowsPrior, accountBorrowsPrior, totalBorrows);
        uint112 _borrowIndex = borrowIndex;
        if (borrowAmount > repayAmount) {
            BorrowSnapshot storage borrowSnapshot = borrowBalances[borrower];
            uint256 increaseAmount = borrowAmount - repayAmount;
            accountBorrows = accountBorrowsPrior.add(increaseAmount);
            borrowSnapshot.principal = safe112(accountBorrows);
            borrowSnapshot.interestIndex = _borrowIndex;
            _totalBorrows = uint256(totalBorrows).add(increaseAmount);
            totalBorrows = safe112(_totalBorrows);
        } else {
            BorrowSnapshot storage borrowSnapshot = borrowBalances[borrower];
            uint256 decreaseAmount = repayAmount - borrowAmount;
            accountBorrows = accountBorrowsPrior > decreaseAmount
                ? accountBorrowsPrior - decreaseAmount
                : 0;
            borrowSnapshot.principal = safe112(accountBorrows);
            if (accountBorrows == 0) {
                borrowSnapshot.interestIndex = 0;
            } else {
                borrowSnapshot.interestIndex = _borrowIndex;
            }
            uint256 actualDecreaseAmount =
                accountBorrowsPrior.sub(accountBorrows);
            _totalBorrows = totalBorrows; // gas savings
            _totalBorrows = _totalBorrows > actualDecreaseAmount
                ? _totalBorrows - actualDecreaseAmount
                : 0;
            totalBorrows = safe112(_totalBorrows);
        }
        _trackBorrow(borrower, accountBorrows, _borrowIndex);
    }

    // this low-level function should be called from another contract
    function borrow(
        address borrower,
        address receiver,
        uint256 borrowAmount,
        bytes calldata data
    ) external nonReentrant update accrue {
        uint256 _totalBalance = totalBalance;
        require(borrowAmount <= _totalBalance, "Tarot: INSUFFICIENT_CASH");
        _checkBorrowAllowance(borrower, msg.sender, borrowAmount);

        // optimistically transfer funds
        if (borrowAmount > 0) _safeTransfer(receiver, borrowAmount);
        if (data.length > 0)
            ITarotCallee(receiver).tarotBorrow(
                msg.sender,
                borrower,
                borrowAmount,
                data
            );
        uint256 balance = IERC20(underlying).balanceOf(address(this));

        uint256 borrowFee = borrowAmount.mul(BORROW_FEE).div(1e18);
        uint256 adjustedBorrowAmount = borrowAmount.add(borrowFee);
        uint256 repayAmount = balance.add(borrowAmount).sub(_totalBalance);
        (
            uint256 accountBorrowsPrior,
            uint256 accountBorrows,
            uint256 _totalBorrows
        ) = _updateBorrow(borrower, adjustedBorrowAmount, repayAmount);

        if (adjustedBorrowAmount > repayAmount)
            require(
                ICollateral(collateral).canBorrow(
                    borrower,
                    address(this),
                    accountBorrows
                ),
                "Tarot: INSUFFICIENT_LIQUIDITY"
            );

        emit Borrow(
            msg.sender,
            borrower,
            receiver,
            borrowAmount,
            repayAmount,
            accountBorrowsPrior,
            accountBorrows,
            _totalBorrows
        );
    }

    // this low-level function should be called from another contract
    function liquidate(address borrower, address liquidator)
        external
        nonReentrant
        update
        accrue
        returns (uint256 seizeTokens)
    {
        uint256 balance = IERC20(underlying).balanceOf(address(this));
        uint256 repayAmount = balance.sub(totalBalance);

        uint256 actualRepayAmount =
            Math.min(borrowBalance(borrower), repayAmount);
        seizeTokens = ICollateral(collateral).seize(
            liquidator,
            borrower,
            actualRepayAmount
        );
        (
            uint256 accountBorrowsPrior,
            uint256 accountBorrows,
            uint256 _totalBorrows
        ) = _updateBorrow(borrower, 0, repayAmount);

        emit Liquidate(
            msg.sender,
            borrower,
            liquidator,
            seizeTokens,
            repayAmount,
            accountBorrowsPrior,
            accountBorrows,
            _totalBorrows
        );
    }

    function trackBorrow(address borrower) external {
        _trackBorrow(borrower, borrowBalance(borrower), borrowIndex);
    }

    modifier accrue() {
        accrueInterest();
        _;
    }
}

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 : BAllowance.sol
pragma solidity =0.5.16;

import "./BStorage.sol";
import "./PoolToken.sol";

contract BAllowance is PoolToken, BStorage {
    event BorrowApproval(
        address indexed owner,
        address indexed spender,
        uint256 value
    );

    function _borrowApprove(
        address owner,
        address spender,
        uint256 value
    ) private {
        borrowAllowance[owner][spender] = value;
        emit BorrowApproval(owner, spender, value);
    }

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

    function _checkBorrowAllowance(
        address owner,
        address spender,
        uint256 value
    ) internal {
        uint256 _borrowAllowance = borrowAllowance[owner][spender];
        if (spender != owner && _borrowAllowance != uint256(-1)) {
            require(_borrowAllowance >= value, "Tarot: BORROW_NOT_ALLOWED");
            borrowAllowance[owner][spender] = _borrowAllowance - value;
        }
    }

    // keccak256("BorrowPermit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)");
    bytes32 public constant BORROW_PERMIT_TYPEHASH =
        0xf6d86ed606f871fa1a557ac0ba607adce07767acf53f492fb215a1a4db4aea6f;

    function borrowPermit(
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external {
        _checkSignature(
            owner,
            spender,
            value,
            deadline,
            v,
            r,
            s,
            BORROW_PERMIT_TYPEHASH
        );
        _borrowApprove(owner, spender, value);
    }
}

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

import "./BStorage.sol";
import "./PoolToken.sol";

contract BInterestRateModel is PoolToken, BStorage {

	// When utilization is 100% borrowRate is kinkBorrowRate * KINK_MULTIPLIER
	// kinkBorrowRate relative adjustment per second belongs to [1-adjustSpeed, 1+adjustSpeed*(KINK_MULTIPLIER-1)]
	uint public constant KINK_MULTIPLIER = 3;
	uint public constant KINK_BORROW_RATE_MAX = 281.582952e9; //888% per year
	uint public constant KINK_BORROW_RATE_MIN = 0.31709792e9; //1% per year

	event AccrueInterest(uint interestAccumulated, uint borrowIndex, uint totalBorrows);
	event CalculateKinkBorrowRate(uint kinkBorrowRate);
	event CalculateBorrowRate(uint borrowRate);
		
	function _calculateBorrowRate() internal {
		uint _kinkUtilizationRate = kinkUtilizationRate;		
		uint _adjustSpeed = adjustSpeed;
		uint _borrowRate = borrowRate;	
		uint _kinkBorrowRate = kinkBorrowRate;
		uint32 _rateUpdateTimestamp = rateUpdateTimestamp;		
	
		// update kinkBorrowRate using previous borrowRate
		uint32 timeElapsed = getBlockTimestamp() - _rateUpdateTimestamp; // underflow is desired
		if(timeElapsed > 0) {
			rateUpdateTimestamp = getBlockTimestamp();
			uint adjustFactor;
			
			if (_borrowRate < _kinkBorrowRate) {
				// never overflows, _kinkBorrowRate is never 0
				uint tmp = (_kinkBorrowRate - _borrowRate) * 1e18 / _kinkBorrowRate * _adjustSpeed * timeElapsed / 1e18;
				adjustFactor = tmp > 1e18 ? 0 : 1e18 - tmp;
			} else {
				// never overflows, _kinkBorrowRate is never 0
				uint tmp = (_borrowRate - _kinkBorrowRate) * 1e18 / _kinkBorrowRate * _adjustSpeed * timeElapsed / 1e18;
				adjustFactor = tmp + 1e18;
			}
			
			// never overflows
			_kinkBorrowRate = _kinkBorrowRate * adjustFactor / 1e18;
			if(_kinkBorrowRate > KINK_BORROW_RATE_MAX) _kinkBorrowRate = KINK_BORROW_RATE_MAX;
			if(_kinkBorrowRate < KINK_BORROW_RATE_MIN) _kinkBorrowRate = KINK_BORROW_RATE_MIN;

			kinkBorrowRate = uint48(_kinkBorrowRate);
			emit CalculateKinkBorrowRate(_kinkBorrowRate);
		}
		
		uint _utilizationRate;
		{ // avoid stack to deep
		uint _totalBorrows = totalBorrows; // gas savings
		uint _actualBalance = totalBalance.add(_totalBorrows);
		_utilizationRate = (_actualBalance == 0) ? 0 : _totalBorrows * 1e18 / _actualBalance;
		}
		
		// update borrowRate using the new kinkBorrowRate	
		if(_utilizationRate <= _kinkUtilizationRate) {
			// never overflows, _kinkUtilizationRate is never 0
			_borrowRate = _kinkBorrowRate * _utilizationRate / _kinkUtilizationRate;
		} else {
			// never overflows, _kinkUtilizationRate is always < 1e18
			uint overUtilization = (_utilizationRate - _kinkUtilizationRate) * 1e18 / (1e18 - _kinkUtilizationRate);
			// never overflows
			_borrowRate = ((KINK_MULTIPLIER - 1) * overUtilization + 1e18) * _kinkBorrowRate / 1e18;
		}
		borrowRate = uint48(_borrowRate);
		emit CalculateBorrowRate(_borrowRate);
	}
	
	// applies accrued interest to total borrows and reserves
	function accrueInterest() public {
		uint _borrowIndex = borrowIndex;
		uint _totalBorrows = totalBorrows;
		uint32 _accrualTimestamp = accrualTimestamp;
		
		uint32 blockTimestamp = getBlockTimestamp();
		if (_accrualTimestamp == blockTimestamp) return;
		uint32 timeElapsed = blockTimestamp - _accrualTimestamp; // underflow is desired
		accrualTimestamp = blockTimestamp;
		
		uint interestFactor = uint(borrowRate).mul(timeElapsed);	
		uint interestAccumulated = interestFactor.mul(_totalBorrows).div(1e18);
		_totalBorrows = _totalBorrows.add( interestAccumulated );
		_borrowIndex = _borrowIndex.add( interestFactor.mul(_borrowIndex).div(1e18) );
	
		borrowIndex = safe112(_borrowIndex);
		totalBorrows = safe112(_totalBorrows);
		emit AccrueInterest(interestAccumulated, _borrowIndex, _totalBorrows);
	}
		
	function getBlockTimestamp() public view returns (uint32) {
		return uint32(block.timestamp % 2**32);
	}
}

File 5 of 16 : BSetter.sol
pragma solidity =0.5.16;

import "./BStorage.sol";
import "./PoolToken.sol";
import "./interfaces/IFactory.sol";

contract BSetter is PoolToken, BStorage {
    uint256 public constant RESERVE_FACTOR_MAX = 0.20e18; //20%
    uint256 public constant KINK_UR_MIN = 0.50e18; //50%
    uint256 public constant KINK_UR_MAX = 0.99e18; //99%
    uint256 public constant ADJUST_SPEED_MIN = 0.05787037e12; //0.5% per day
    uint256 public constant ADJUST_SPEED_MAX = 115.74074e12; //1000% per day

    event NewReserveFactor(uint256 newReserveFactor);
    event NewKinkUtilizationRate(uint256 newKinkUtilizationRate);
    event NewAdjustSpeed(uint256 newAdjustSpeed);
    event NewBorrowTracker(address newBorrowTracker);

    // called once by the factory at time of deployment
    function _initialize(
        string calldata _name,
        string calldata _symbol,
        address _underlying,
        address _collateral
    ) external {
        require(msg.sender == factory, "Tarot: UNAUTHORIZED"); // sufficient check
        _setName(_name, _symbol);
        underlying = _underlying;
        collateral = _collateral;
        exchangeRateLast = initialExchangeRate;
    }

    function _setReserveFactor(uint256 newReserveFactor) external nonReentrant {
        _checkSetting(newReserveFactor, 0, RESERVE_FACTOR_MAX);
        reserveFactor = newReserveFactor;
        emit NewReserveFactor(newReserveFactor);
    }

    function _setKinkUtilizationRate(uint256 newKinkUtilizationRate)
        external
        nonReentrant
    {
        _checkSetting(newKinkUtilizationRate, KINK_UR_MIN, KINK_UR_MAX);
        kinkUtilizationRate = newKinkUtilizationRate;
        emit NewKinkUtilizationRate(newKinkUtilizationRate);
    }

    function _setAdjustSpeed(uint256 newAdjustSpeed) external nonReentrant {
        _checkSetting(newAdjustSpeed, ADJUST_SPEED_MIN, ADJUST_SPEED_MAX);
        adjustSpeed = newAdjustSpeed;
        emit NewAdjustSpeed(newAdjustSpeed);
    }

    function _setBorrowTracker(address newBorrowTracker) external nonReentrant {
        _checkAdmin();
        borrowTracker = newBorrowTracker;
        emit NewBorrowTracker(newBorrowTracker);
    }

    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 6 of 16 : BStorage.sol
pragma solidity =0.5.16;

contract BStorage {
    address public collateral;

    mapping(address => mapping(address => uint256)) public borrowAllowance;

    struct BorrowSnapshot {
        uint112 principal; // amount in underlying when the borrow was last updated
        uint112 interestIndex; // borrow index when borrow was last updated
    }
    mapping(address => BorrowSnapshot) internal borrowBalances;

    // use one memory slot
    uint112 public borrowIndex = 1e18;
    uint112 public totalBorrows;
    uint32 public accrualTimestamp = uint32(block.timestamp % 2**32);

    uint256 public exchangeRateLast;

    // use one memory slot
    uint48 public borrowRate;
    uint48 public kinkBorrowRate = 6.3419584e9; //20% per year
    uint32 public rateUpdateTimestamp = uint32(block.timestamp % 2**32);

    uint256 public reserveFactor = 0.10e18; //10%
    uint256 public kinkUtilizationRate = 0.75e18; //75%
    uint256 public adjustSpeed = 50e12; //432% per day
    address public borrowTracker;

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

File 7 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 kinkUtilizationRate() 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 NewKinkUtilizationRate(uint256 newKinkUtilizationRate);
    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 _setKinkUtilizationRate(uint256 newKinkUtilizationRate) external;

    function _setAdjustSpeed(uint256 newAdjustSpeed) external;

    function _setBorrowTracker(address newBorrowTracker) external;
}

File 8 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 safetyMarginSqrt() external view returns (uint256);

    function liquidationIncentive() external view returns (uint256);

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

    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);

    function SAFETY_MARGIN_SQRT_MIN() external pure returns (uint256);

    function SAFETY_MARGIN_SQRT_MAX() external pure returns (uint256);

    function LIQUIDATION_INCENTIVE_MIN() external pure returns (uint256);

    function LIQUIDATION_INCENTIVE_MAX() external pure returns (uint256);

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

    function _setSafetyMarginSqrt(uint256 newSafetyMarginSqrt) external;

    function _setLiquidationIncentive(uint256 newLiquidationIncentive) external;
}

File 9 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 10 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 11 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 12 of 16 : IBorrowTracker.sol
pragma solidity >=0.5.0;

interface IBorrowTracker {
	function trackBorrow(address borrower, uint borrowBalance, uint borrowIndex) external;
}

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 Security Audit

Contract ABI

[{"inputs":[],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"interestAccumulated","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"borrowIndex","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"totalBorrows","type":"uint256"}],"name":"AccrueInterest","type":"event"},{"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":"borrower","type":"address"},{"indexed":true,"internalType":"address","name":"receiver","type":"address"},{"indexed":false,"internalType":"uint256","name":"borrowAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"repayAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"accountBorrowsPrior","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"accountBorrows","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"totalBorrows","type":"uint256"}],"name":"Borrow","type":"event"},{"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":"BorrowApproval","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"borrowRate","type":"uint256"}],"name":"CalculateBorrowRate","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"kinkRate","type":"uint256"}],"name":"CalculateKink","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"kinkBorrowRate","type":"uint256"}],"name":"CalculateKinkBorrowRate","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":true,"internalType":"address","name":"borrower","type":"address"},{"indexed":true,"internalType":"address","name":"liquidator","type":"address"},{"indexed":false,"internalType":"uint256","name":"seizeTokens","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"repayAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"accountBorrowsPrior","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"accountBorrows","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"totalBorrows","type":"uint256"}],"name":"Liquidate","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":"newAdjustSpeed","type":"uint256"}],"name":"NewAdjustSpeed","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"newBorrowTracker","type":"address"}],"name":"NewBorrowTracker","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"newKinkUtilizationRate","type":"uint256"}],"name":"NewKinkUtilizationRate","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"newReserveFactor","type":"uint256"}],"name":"NewReserveFactor","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":"ADJUST_SPEED_MAX","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"ADJUST_SPEED_MIN","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"BORROW_FEE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"BORROW_PERMIT_TYPEHASH","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"DOMAIN_SEPARATOR","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"KINK_BORROW_RATE_MAX","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"KINK_BORROW_RATE_MIN","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"KINK_MULTIPLIER","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"KINK_UR_MAX","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"KINK_UR_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":"PERMIT_TYPEHASH","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"RESERVE_FACTOR_MAX","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":"_collateral","type":"address"}],"name":"_initialize","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"newAdjustSpeed","type":"uint256"}],"name":"_setAdjustSpeed","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"newBorrowTracker","type":"address"}],"name":"_setBorrowTracker","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":"newKinkUtilizationRate","type":"uint256"}],"name":"_setKinkUtilizationRate","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"newReserveFactor","type":"uint256"}],"name":"_setReserveFactor","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"accrualTimestamp","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"accrueInterest","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"adjustSpeed","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","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":false,"inputs":[{"internalType":"address","name":"borrower","type":"address"},{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint256","name":"borrowAmount","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"borrow","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"}],"name":"borrowAllowance","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":"borrowApprove","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"borrower","type":"address"}],"name":"borrowBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"borrowIndex","outputs":[{"internalType":"uint112","name":"","type":"uint112"}],"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":"borrowPermit","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"borrowRate","outputs":[{"internalType":"uint48","name":"","type":"uint48"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"borrowTracker","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"collateral","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","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":"exchangeRateLast","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"factory","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getBlockTimestamp","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"kinkBorrowRate","outputs":[{"internalType":"uint48","name":"","type":"uint48"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"kinkUtilizationRate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"borrower","type":"address"},{"internalType":"address","name":"liquidator","type":"address"}],"name":"liquidate","outputs":[{"internalType":"uint256","name":"seizeTokens","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","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":true,"inputs":[],"name":"rateUpdateTimestamp","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"payable":false,"stateMutability":"view","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":"reserveFactor","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","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":"totalBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"totalBorrows","outputs":[{"internalType":"uint112","name":"","type":"uint112"}],"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":"borrower","type":"address"}],"name":"trackBorrow","outputs":[],"payable":false,"stateMutability":"nonpayable","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"}]

60806040526002805460ff199081166012908117909255600b80549091166001179055600e80546001600160701b031916670de0b6b3a7640000176001600160e01b0316600160e01b4263ffffffff16908102919091179091556010805465ffffffffffff60301b19166a017a029b000000000000001763ffffffff60601b19166c0100000000000000000000000090920291909117905567016345785d8a0000601155670a688906bd8b00009055652d79883d20006013553480156100c457600080fd5b506135e7806100d46000396000f3fe608060405234801561001057600080fd5b50600436106103995760003560e01c806370a08231116101e9578063b7f1118a1161010f578063c914b437116100ad578063e07660001161007c578063e076600014610a80578063e12b630614610a88578063fca7820b14610a90578063fff6cae914610aad57610399565b8063c914b437146109f1578063d505accf146109f9578063d8dfeb4514610a4a578063dd62ed3e14610a5257610399565b8063bc25cf77116100e9578063bc25cf77146109b3578063be340e32146109d9578063c45a0155146109e1578063c72f3fbb146109e957610399565b8063b7f1118a1461097d578063b95b92a3146109a3578063ba9a7a56146109ab57610399565b806395a2251f11610187578063a6afed9511610156578063a6afed9514610939578063a9059cbb14610941578063aa5af0fd1461096d578063ad7a672f1461097557610399565b806395a2251f146108b257806395d89b41146108d85780639e79b55c146108e0578063a07157191461093157610399565b806386b9d81f116101c357806386b9d81f1461081857806391b4274514610846578063926d845b146108695780639292b0321461089557610399565b806370a08231146107ab578063796b89b9146107d15780637ecebe00146107f257610399565b806335542822116102ce5780634d73e9ba1161026c5780636a030c111161023b5780636a030c111461067c5780636a6278421461074f5780636bd76d24146107755780636f307dc3146107a357610399565b80634d73e9ba1461062257806355957220146106485780635b2b9d1a1461066c578063685440651461067457610399565b80634322b714116102a85780634322b714146105e6578063452ae95f146105ee57806347bd3718146105f65780634a5d316c1461061a57610399565b806335542822146105b05780633644e515146105d65780633ba0b9a9146105de57610399565b80632374e8a91161033b57806327549a0b1161031557806327549a0b146105655780632d5231d31461058257806330adf81f1461058a578063313ce5671461059257610399565b80632374e8a91461051f57806323b872dd14610527578063253c24f31461055d57610399565b8063095ea7b311610377578063095ea7b31461043d57806318160ddd1461047d5780631aebf12f146104855780631e7dcc0d1461048d57610399565b806301f8c1c81461039e57806306fdde03146103b8578063075f4e7f14610435575b600080fd5b6103a6610ab5565b60408051918252519081900360200190f35b6103c0610ad9565b6040805160208082528351818301528351919283929083019185019080838360005b838110156103fa5781810151838201526020016103e2565b50505050905090810190601f1680156104275780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6103a6610b67565b6104696004803603604081101561045357600080fd5b506001600160a01b038135169060200135610b70565b604080519115158252519081900360200190f35b6103a6610b87565b6103a6610b8d565b61051d600480360360808110156104a357600080fd5b6001600160a01b038235811692602081013590911691604082013591908101906080810160608201356401000000008111156104de57600080fd5b8201836020820111156104f057600080fd5b8035906020019184600183028401116401000000008311171561051257600080fd5b509092509050610b93565b005b6103a6610fb5565b6104696004803603606081101561053d57600080fd5b506001600160a01b03813581169160208101359091169060400135610fc1565b6103a6611090565b61051d6004803603602081101561057b57600080fd5b503561109a565b6103a661114c565b6103a6611152565b61059a611176565b6040805160ff9092168252519081900360200190f35b61051d600480360360208110156105c657600080fd5b50356001600160a01b031661117f565b6103a661123c565b6103a6611242565b6103a66112c9565b6103a66112cf565b6105fe6112d8565b604080516001600160701b039092168252519081900360200190f35b61051d6112ee565b6103a66004803603602081101561063857600080fd5b50356001600160a01b0316611360565b6106506113f0565b604080516001600160a01b039092168252519081900360200190f35b6103a66113ff565b6103a6611404565b61051d6004803603608081101561069257600080fd5b8101906020810181356401000000008111156106ad57600080fd5b8201836020820111156106bf57600080fd5b803590602001918460018302840111640100000000831117156106e157600080fd5b9193909290916020810190356401000000008111156106ff57600080fd5b82018360208201111561071157600080fd5b8035906020019184600183028401116401000000008311171561073357600080fd5b91935091506001600160a01b0381358116916020013516611410565b6103a66004803603602081101561076557600080fd5b50356001600160a01b0316611524565b6103a66004803603604081101561078b57600080fd5b506001600160a01b0381358116916020013516611722565b61065061173f565b6103a6600480360360208110156107c157600080fd5b50356001600160a01b031661174e565b6107d9611760565b6040805163ffffffff9092168252519081900360200190f35b6103a66004803603602081101561080857600080fd5b50356001600160a01b031661176a565b6103a66004803603604081101561082e57600080fd5b506001600160a01b038135811691602001351661177c565b61084e6119ad565b6040805165ffffffffffff9092168252519081900360200190f35b6104696004803603604081101561087f57600080fd5b506001600160a01b0381351690602001356119c2565b61051d600480360360208110156108ab57600080fd5b50356119cf565b6103a6600480360360208110156108c857600080fd5b50356001600160a01b0316611a86565b6103c0611c1f565b61051d600480360360e08110156108f657600080fd5b506001600160a01b03813581169160208101359091169060408101359060608101359060ff6080820135169060a08101359060c00135611c79565b6103a6611cbd565b61051d611cc7565b6104696004803603604081101561095757600080fd5b506001600160a01b038135169060200135611e67565b6105fe611e74565b6103a6611e83565b61051d6004803603602081101561099357600080fd5b50356001600160a01b0316611e89565b6107d9611eaa565b6103a6611ebd565b61051d600480360360208110156109c957600080fd5b50356001600160a01b0316611ec3565b6103a6611fbd565b610650611fc3565b6103a6611fd2565b61084e611fde565b61051d600480360360e0811015610a0f57600080fd5b506001600160a01b03813581169160208101359091169060408101359060608101359060ff6080820135169060a08101359060c00135611fec565b610650612027565b6103a660048036036040811015610a6857600080fd5b506001600160a01b038135811691602001351661203b565b6103a6612058565b6107d9612060565b61051d60048036036020811015610aa657600080fd5b5035612073565b61051d612123565b7ff6d86ed606f871fa1a557ac0ba607adce07767acf53f492fb215a1a4db4aea6f81565b6000805460408051602060026001851615610100026000190190941693909304601f81018490048402820184019092528181529291830182828015610b5f5780601f10610b3457610100808354040283529160200191610b5f565b820191906000526020600020905b815481529060010190602001808311610b4257829003601f168201915b505050505081565b640d7957c4d081565b6000610b7d338484612196565b5060015b92915050565b60035481565b60125481565b600b5460ff16610bdd576040805162461bcd60e51b815260206004820152601060248201526f15185c9bdd0e8814915153951154915160821b604482015290519081900360640190fd5b600b805460ff19169055610bef611cc7565b600a5480841115610c42576040805162461bcd60e51b81526020600482015260186024820152770a8c2e4dee87440929ca6aa8c8c9286928a9ca8be8682a6960431b604482015290519081900360640190fd5b610c4d8633866121f8565b8315610c5d57610c5d85856122bd565b8115610d0f57604051631b4a79ff60e21b815233600482018181526001600160a01b038981166024850152604484018890526080606485019081526084850187905290891693636d29e7fc93928b928a928a928a92909160a401848480828437600081840152601f19601f8201169050808301925050509650505050505050600060405180830381600087803b158015610cf657600080fd5b505af1158015610d0a573d6000803e3d6000fd5b505050505b600854604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b158015610d5a57600080fd5b505afa158015610d6e573d6000803e3d6000fd5b505050506040513d6020811015610d8457600080fd5b505190506000610db8670de0b6b3a7640000610dac88655af3107a400063ffffffff61244916565b9063ffffffff6124a916565b90506000610dcc878363ffffffff6124eb16565b90506000610df085610de4868b63ffffffff6124eb16565b9063ffffffff61254516565b90506000806000610e028d8686612587565b92509250925083851115610f1c57600b60019054906101000a90046001600160a01b03166001600160a01b0316639aac2c538e30856040518463ffffffff1660e01b815260040180846001600160a01b03166001600160a01b03168152602001836001600160a01b03166001600160a01b031681526020018281526020019350505050602060405180830381600087803b158015610e9f57600080fd5b505af1158015610eb3573d6000803e3d6000fd5b505050506040513d6020811015610ec957600080fd5b5051610f1c576040805162461bcd60e51b815260206004820152601d60248201527f5461726f743a20494e53554646494349454e545f4c4951554944495459000000604482015290519081900360640190fd5b8b6001600160a01b03168d6001600160a01b0316336001600160a01b03167f33f3048bd4e6af45e53afb722adfd57dbde82da7e93e44db921fb4b8c6a70c4b8e88888888604051808681526020018581526020018481526020018381526020018281526020019550505050505060405180910390a45050505050505050610fa16127a1565b5050600b805460ff19166001179055505050565b6706f05b59d3b2000081565b6001600160a01b03831660009081526005602090815260408083203384529091528120546000191461107b57604080518082018252601b81527f5461726f743a205452414e534645525f4e4f545f414c4c4f57454400000000006020808301919091526001600160a01b038716600090815260058252838120338252909152919091205461105691849063ffffffff6127b116565b6001600160a01b03851660009081526005602090815260408083203384529091529020555b611086848484612848565b5060019392505050565b656943fdb1990081565b600b5460ff166110e4576040805162461bcd60e51b815260206004820152601060248201526f15185c9bdd0e8814915153951154915160821b604482015290519081900360640190fd5b600b805460ff1916905561110481640d7957c4d0656943fdb1990061293a565b60138190556040805182815290517f1396dfcdb64fb7eb77fb84966f27b81afe14aa70b6e966c68d74af3302a9fe909181900360200190a150600b805460ff19166001179055565b60135481565b7f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c981565b60025460ff1681565b600b5460ff166111c9576040805162461bcd60e51b815260206004820152601060248201526f15185c9bdd0e8814915153951154915160821b604482015290519081900360640190fd5b600b805460ff191690556111db6129e3565b601480546001600160a01b0383166001600160a01b0319909116811790915560408051918252517f468b6598e7e810c65c9858b5f23a2d5b8692fb753b78a032232de4c6ed3cabbf9181900360200190a150600b805460ff19166001179055565b60065481565b600061124c611cc7565b600354600e54600a546000916112729190600160701b90046001600160701b03166124eb565b905081158061127f575080155b1561129657670de0b6b3a7640000925050506112c6565b60006112b483610dac84670de0b6b3a764000063ffffffff61244916565b90506112c08184612aaf565b93505050505b90565b60115481565b64418fa6de4081565b600e54600160701b90046001600160701b031681565b6009546001600160a01b03161561134c576040805162461bcd60e51b815260206004820152601a60248201527f5461726f743a20464143544f52595f414c52454144595f534554000000000000604482015290519081900360640190fd5b600980546001600160a01b03191633179055565b600061136a61349a565b506001600160a01b0382166000908152600d60209081526040918290208251808401909352546001600160701b038082168452600160701b909104169082018190526113ba5760009150506113eb565b6020810151600e5482516113e7926001600160701b0390811692610dac928216911663ffffffff61244916565b9150505b919050565b6014546001600160a01b031681565b600381565b670dbd2fc137a3000081565b6009546001600160a01b03163314611465576040805162461bcd60e51b815260206004820152601360248201527215185c9bdd0e8815539055551213d492569151606a1b604482015290519081900360640190fd5b6114d886868080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050604080516020601f8a018190048102820181019092528881529250889150879081908401838280828437600092019190915250612bbb92505050565b600880546001600160a01b039384166001600160a01b0319909116179055600b80549190921661010002610100600160a81b03199091161790555050670de0b6b3a7640000600f555050565b600b5460009060ff16611571576040805162461bcd60e51b815260206004820152601060248201526f15185c9bdd0e8814915153951154915160821b604482015290519081900360640190fd5b600b805460ff19169055600854604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b1580156115c657600080fd5b505afa1580156115da573d6000803e3d6000fd5b505050506040513d60208110156115f057600080fd5b5051600a5490915060009061160c90839063ffffffff61254516565b9050611631611619611242565b610dac83670de0b6b3a764000063ffffffff61244916565b92506003546000141561165f57611650836103e863ffffffff61254516565b925061165f60006103e8612c83565b600083116116b4576040805162461bcd60e51b815260206004820152601760248201527f5461726f743a204d494e545f414d4f554e545f5a45524f000000000000000000604482015290519081900360640190fd5b6116be8484612c83565b604080518281526020810185905281516001600160a01b0387169233927f2f00e3cdd69a77be7ed215ec7b2a36784dd158f921fca79ac29deffa353fe6ee929081900390910190a350506117106127a1565b600b805460ff19166001179055919050565b600c60209081526000928352604080842090915290825290205481565b6008546001600160a01b031681565b60046020526000908152604090205481565b63ffffffff421690565b60076020526000908152604090205481565b600b5460009060ff166117c9576040805162461bcd60e51b815260206004820152601060248201526f15185c9bdd0e8814915153951154915160821b604482015290519081900360640190fd5b600b805460ff191690556117db611cc7565b600854604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b15801561182657600080fd5b505afa15801561183a573d6000803e3d6000fd5b505050506040513d602081101561185057600080fd5b5051600a5490915060009061186c90839063ffffffff61254516565b9050600061188261187c87611360565b83612d1a565b600b546040805163b2a02ff160e01b81526001600160a01b0389811660048301528a81166024830152604482018590529151939450610100909204169163b2a02ff1916064808201926020929091908290030181600087803b1580156118e757600080fd5b505af11580156118fb573d6000803e3d6000fd5b505050506040513d602081101561191157600080fd5b5051935060008080611924898287612587565b604080518b8152602081018a90528082018590526060810184905260808101839052905193965091945092506001600160a01b03808b1692908c169133917fb0dbe18c6ffdf0da655dd690e77211d379205c497be44c64447c3f5f021b51679181900360a00190a450505050505061199a6127a1565b600b805460ff1916600117905592915050565b601054600160301b900465ffffffffffff1681565b6000610b7d338484612d30565b600b5460ff16611a19576040805162461bcd60e51b815260206004820152601060248201526f15185c9bdd0e8814915153951154915160821b604482015290519081900360640190fd5b600b805460ff19169055611a3e816706f05b59d3b20000670dbd2fc137a3000061293a565b60128190556040805182815290517f7a550b1995ff63260fb313f12024e66e73bad425372e5af6b1e04cb3799ef38c9181900360200190a150600b805460ff19166001179055565b600b5460009060ff16611ad3576040805162461bcd60e51b815260206004820152601060248201526f15185c9bdd0e8814915153951154915160821b604482015290519081900360640190fd5b600b805460ff1916905530600090815260046020526040902054611b11670de0b6b3a7640000610dac611b04611242565b849063ffffffff61244916565b915060008211611b68576040805162461bcd60e51b815260206004820152601960248201527f5461726f743a2052454445454d5f414d4f554e545f5a45524f00000000000000604482015290519081900360640190fd5b600a54821115611bba576040805162461bcd60e51b81526020600482015260186024820152770a8c2e4dee87440929ca6aa8c8c9286928a9ca8be8682a6960431b604482015290519081900360640190fd5b611bc43082612d92565b611bce83836122bd565b604080518381526020810183905281516001600160a01b0386169233927f3f693fff038bb8a046aa76d9516190ac7444f7d69cf952c4cbdc086fdef2d6fc929081900390910190a3506117106127a1565b60018054604080516020600284861615610100026000190190941693909304601f81018490048402820184019092528181529291830182828015610b5f5780601f10610b3457610100808354040283529160200191610b5f565b611ca9878787878787877ff6d86ed606f871fa1a557ac0ba607adce07767acf53f492fb215a1a4db4aea6f612e2f565b611cb4878787612d30565b50505050505050565b655af3107a400081565b600e546001600160701b0380821691600160701b810490911690600160e01b900463ffffffff166000611cf8611760565b90508063ffffffff168263ffffffff161415611d175750505050611e65565b600e805463ffffffff808416600160e01b026001600160e01b039092169190911790915560105483830391600091611d5e9165ffffffffffff909116908085169061244916565b90506000611d7e670de0b6b3a7640000610dac848963ffffffff61244916565b9050611d90868263ffffffff6124eb16565b9550611dbe611db1670de0b6b3a7640000610dac858b63ffffffff61244916565b889063ffffffff6124eb16565b9650611dc987613004565b600e80546001600160701b0319166001600160701b0392909216919091179055611df286613004565b600e80546001600160701b0392909216600160701b02600160701b600160e01b0319909216919091179055604080518281526020810189905280820188905290517f875352fb3fadeb8c0be7cbbe8ff761b308fa7033470cd0287f02f3436fd76cb99181900360600190a1505050505050505b565b6000610b7d338484612848565b600e546001600160701b031681565b600a5481565b611ea781611e9683611360565b600e546001600160701b0316613053565b50565b600e54600160e01b900463ffffffff1681565b6103e881565b600b5460ff16611f0d576040805162461bcd60e51b815260206004820152601060248201526f15185c9bdd0e8814915153951154915160821b604482015290519081900360640190fd5b600b805460ff19169055600a54600854604080516370a0823160e01b81523060048201529051611fad938593611fa89391926001600160a01b03909116916370a08231916024808301926020929190829003018186803b158015611f7057600080fd5b505afa158015611f84573d6000803e3d6000fd5b505050506040513d6020811015611f9a57600080fd5b50519063ffffffff61254516565b6122bd565b50600b805460ff19166001179055565b600f5481565b6009546001600160a01b031681565b6702c68af0bb14000081565b60105465ffffffffffff1681565b61201c878787878787877f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9612e2f565b611cb4878787612196565b600b5461010090046001600160a01b031681565b600560209081526000928352604080842090915290825290205481565b6312e687c081565b601054600160601b900463ffffffff1681565b600b5460ff166120bd576040805162461bcd60e51b815260206004820152601060248201526f15185c9bdd0e8814915153951154915160821b604482015290519081900360640190fd5b600b805460ff191690556120db8160006702c68af0bb14000061293a565b60118190556040805182815290517f9d9cd27245b4e6b06dcf523ac57b6e851b934e199eee376313f906e94bfbfd559181900360200190a150600b805460ff19166001179055565b600b5460ff1661216d576040805162461bcd60e51b815260206004820152601060248201526f15185c9bdd0e8814915153951154915160821b604482015290519081900360640190fd5b600b805460ff1916905561217f611cc7565b6121876127a1565b600b805460ff19166001179055565b6001600160a01b03808416600081815260056020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b038084166000818152600c6020908152604080832094871680845294909152902054911480159061223257506000198114155b156122b7578181101561228c576040805162461bcd60e51b815260206004820152601960248201527f5461726f743a20424f52524f575f4e4f545f414c4c4f57454400000000000000604482015290519081900360640190fd5b6001600160a01b038085166000908152600c6020908152604080832093871683529290522082820390555b50505050565b600854604080518082018252601981527f7472616e7366657228616464726573732c75696e74323536290000000000000060209182015281516001600160a01b0386811660248301526044808301879052845180840390910181526064909201845291810180516001600160e01b031663a9059cbb60e01b1781529251815160009560609594169382918083835b6020831061236a5780518252601f19909201916020918201910161234b565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d80600081146123cc576040519150601f19603f3d011682016040523d82523d6000602084013e6123d1565b606091505b50915091508180156123ff5750805115806123ff57508080602001905160208110156123fc57600080fd5b50515b6122b7576040805162461bcd60e51b815260206004820152601660248201527515185c9bdd0e881514905394d1915497d1905253115160521b604482015290519081900360640190fd5b60008261245857506000610b81565b8282028284828161246557fe5b04146124a25760405162461bcd60e51b81526004018080602001828103825260218152602001806135926021913960400191505060405180910390fd5b9392505050565b60006124a283836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506130e1565b6000828201838110156124a2576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b60006124a283836040518060400160405280601f81526020017f536166654d6174683a207375627472616374696f6e20756e646572666c6f77008152506127b1565b600080600061259586611360565b9250838514156125bb575050600e548190600160701b90046001600160701b0316612798565b600e546001600160701b031684861115612682576001600160a01b0387166000908152600d602052604090208587036125fa868263ffffffff6124eb16565b945061260585613004565b82546001600160701b0319166001600160701b0391821617600160701b600160e01b031916600160701b8583168102919091178455600e5461264b9291900416826124eb565b935061265684613004565b600e806101000a8154816001600160701b0302191690836001600160701b031602179055505050612782565b6001600160a01b0387166000908152600d602052604090208686038086116126ab5760006126af565b8086035b94506126ba85613004565b82546001600160701b0319166001600160701b0391909116178255846126f0578154600160701b600160e01b0319168255612713565b8154600160701b600160e01b031916600160701b6001600160701b038516021782555b6000612725878763ffffffff61254516565b600e54600160701b90046001600160701b03169550905080851161274a57600061274e565b8085035b945061275985613004565b600e806101000a8154816001600160701b0302191690836001600160701b031602179055505050505b6127968784836001600160701b0316613053565b505b93509350939050565b6127a9613146565b611e656131f6565b600081848411156128405760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156128055781810151838201526020016127ed565b50505050905090810190601f1680156128325780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b604080518082018252601881527f5461726f743a205452414e534645525f544f4f5f4849474800000000000000006020808301919091526001600160a01b0386166000908152600490915291909120546128a991839063ffffffff6127b116565b6001600160a01b0380851660009081526004602052604080822093909355908416815220546128de908263ffffffff6124eb16565b6001600160a01b0380841660008181526004602090815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b6129426129e3565b81831015612990576040805162461bcd60e51b81526020600482015260166024820152755461726f743a20494e56414c49445f53455454494e4760501b604482015290519081900360640190fd5b808311156129de576040805162461bcd60e51b81526020600482015260166024820152755461726f743a20494e56414c49445f53455454494e4760501b604482015290519081900360640190fd5b505050565b600960009054906101000a90046001600160a01b03166001600160a01b031663f851a4406040518163ffffffff1660e01b815260040160206040518083038186803b158015612a3157600080fd5b505afa158015612a45573d6000803e3d6000fd5b505050506040513d6020811015612a5b57600080fd5b50516001600160a01b03163314611e65576040805162461bcd60e51b815260206004820152601360248201527215185c9bdd0e8815539055551213d492569151606a1b604482015290519081900360640190fd5b600f5460009080841115612bb2576000612b00612af3670de0b6b3a7640000610dac601154612ae7878b61254590919063ffffffff16565b9063ffffffff61244916565b869063ffffffff61254516565b90506000612b1c85610de484610dac838b63ffffffff61244916565b90508015612ba3576009546040805163345ef94160e01b815290516000926001600160a01b03169163345ef941916004808301926020929190829003018186803b158015612b6957600080fd5b505afa158015612b7d573d6000803e3d6000fd5b505050506040513d6020811015612b9357600080fd5b50519050612ba18183612c83565b505b50600f8190559150610b819050565b83915050610b81565b8151612bce9060009060208501906134b1565b508051612be29060019060208401906134b1565b5060405146908060526135408239604080519182900360520182208651602097880120838301835260018452603160f81b93880193909352815180880191909152808201929092527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc6606083015260808201939093523060a0808301919091528351808303909101815260c090910190925250805192019190912060065550565b600354612c96908263ffffffff6124eb16565b6003556001600160a01b038216600090815260046020526040902054612cc2908263ffffffff6124eb16565b6001600160a01b03831660008181526004602090815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b6000818310612d2957816124a2565b5090919050565b6001600160a01b038084166000818152600c6020908152604080832094871680845294825291829020859055815185815291517fc3c1215b41d54142382d54a05fb991007165ae91bcb1879bac8b290d9111aaf49281900390910190a3505050565b6001600160a01b038216600090815260046020526040902054612dbb908263ffffffff61254516565b6001600160a01b038316600090815260046020526040902055600354612de7908263ffffffff61254516565b6003556040805182815290516000916001600160a01b038516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a35050565b42851015612e75576040805162461bcd60e51b815260206004820152600e60248201526d15185c9bdd0e881156141254915160921b604482015290519081900360640190fd5b6006546001600160a01b03808a1660008181526007602090815260408083208054600180820190925582518085018a905280840196909652958e166060860152608085018d905260a085019590955260c08085018c90528151808603909101815260e08501825280519083012061190160f01b6101008601526101028501969096526101228085019690965280518085039096018652610142840180825286519683019690962095839052610162840180825286905260ff8a166101828501526101a284018990526101c28401889052519193926101e280820193601f1981019281900390910190855afa158015612f71573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811615801590612fa75750896001600160a01b0316816001600160a01b0316145b612ff8576040805162461bcd60e51b815260206004820152601860248201527f5461726f743a20494e56414c49445f5349474e41545552450000000000000000604482015290519081900360640190fd5b50505050505050505050565b6000600160701b821061304f576040805162461bcd60e51b815260206004820152600e60248201526d2a30b937ba1d1029a0a32298989960911b604482015290519081900360640190fd5b5090565b6014546001600160a01b03168061306a57506129de565b604080516305285d7f60e01b81526001600160a01b03868116600483015260248201869052604482018590529151918316916305285d7f9160648082019260009290919082900301818387803b1580156130c357600080fd5b505af11580156130d7573d6000803e3d6000fd5b5050505050505050565b600081836131305760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156128055781810151838201526020016127ed565b50600083858161313c57fe5b0495945050505050565b600854604080516370a0823160e01b815230600482015290516001600160a01b03909216916370a0823191602480820192602092909190829003018186803b15801561319157600080fd5b505afa1580156131a5573d6000803e3d6000fd5b505050506040513d60208110156131bb57600080fd5b5051600a81905560408051918252517f8a0df8ef054fae2c3d2d19a7b322e864870cc9fd3cb07fb9526309c596244bf49181900360200190a1565b60125460135460105465ffffffffffff80821691600160301b810490911690600160601b900463ffffffff1660008161322d611760565b03905063ffffffff8116156133a257613244611760565b6010600c6101000a81548163ffffffff021916908363ffffffff1602179055506000838510156132cd576000670de0b6b3a76400008363ffffffff168887898903670de0b6b3a7640000028161329657fe5b040202816132a057fe5b049050670de0b6b3a764000081116132c25780670de0b6b3a7640000036132c5565b60005b91505061330e565b6000670de0b6b3a76400008363ffffffff168887888a03670de0b6b3a764000002816132f557fe5b040202816132ff57fe5b04670de0b6b3a7640000019150505b670de0b6b3a764000084820204935064418fa6de408411156133335764418fa6de4093505b6312e687c0841015613347576312e687c093505b601080546bffffffffffff0000000000001916600160301b65ffffffffffff8716021790556040805185815290517f713a98ffb7d769b8e33e2ee945ebb6acb7f397532688164d3ce1081f903c77bc916020908290030190a1505b600e54600a54600091600160701b90046001600160701b03169082906133c890836124eb565b905080156133e9578082670de0b6b3a764000002816133e357fe5b046133ec565b60005b9250505086811161340a57868185028161340257fe5b049450613444565b600087670de0b6b3a764000003888303670de0b6b3a7640000028161342b57fe5b049050670de0b6b3a76400006002820281018602049550505b6010805465ffffffffffff191665ffffffffffff87161790556040805186815290517f338541dc9083f6af6715482fb419e1483c1ae9097764fd68a5dc98109bd5a788916020908290030190a150505050505050565b604080518082019091526000808252602082015290565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106134f257805160ff191683800117855561351f565b8280016001018555821561351f579182015b8281111561351f578251825591602001919060010190613504565b5061304f926112c69250905b8082111561304f576000815560010161352b56fe454950373132446f6d61696e28737472696e67206e616d652c737472696e672076657273696f6e2c75696e7432353620636861696e49642c6164647265737320766572696679696e67436f6e747261637429536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77a265627a7a72315820d22daa5609aa323d51228c8340ac73a6cfc4ec018a6d67f991179f9d77c9a49364736f6c63430005100032

Block Transaction Difficulty Gas Used Reward
Block Uncle Number Difficulty Gas Used Reward
Loading
Loading
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.