Contract 0x5FBe4eB536DADBcee54d5b55eD6559E29C60B055 4

 

Contract Overview

Balance:
484.574487522168243659 BNB

BNB Value:
$199,290.95 (@ $411.27/BNB)

Token:
 
Txn Hash Method
Block
From
To
Value [Txn Fee]
0x2d473ba178602bdf0d986a0ca206f4b24ab57405587f4369d7a657a006f12aa0Mint110204792021-09-18 11:24:436 hrs 51 mins ago0x12e0b7fd14d17b17d3177d82b39efd3e2fed9d5a IN  0x5fbe4eb536dadbcee54d5b55ed6559e29c60b0550.58 BNB0.00034724
0x258014d33399cb272697a944b725f6f14d66aac4233c966fe84b4dbf4aee20bdMint109803972021-09-17 1:57:421 day 16 hrs ago0x2bfb71124e2f3656c69c6278a744eb0fe5fd3153 IN  0x5fbe4eb536dadbcee54d5b55ed6559e29c60b0554 BNB0.00027224
0xf53eed93ea964e66ce47126ad142dc9284537867d00a1fc489d7216712eb5193Mint109653292021-09-16 13:23:042 days 4 hrs ago0x7a287e9c57bc92228fedbd0c6a6538c18175e80e IN  0x5fbe4eb536dadbcee54d5b55ed6559e29c60b0550.1 BNB0.00027224
0x8679446d5e3757ff1f3fd863423c447f8804faa7a6dcee689a2b37a3380bf585Mint109652462021-09-16 13:18:552 days 4 hrs ago0x7a287e9c57bc92228fedbd0c6a6538c18175e80e IN  0x5fbe4eb536dadbcee54d5b55ed6559e29c60b0550.1 BNB0.00027224
0x9a0ff961e1ba5e8c35aab273f3561b0bafd0dc199f8859e0c6302bf4b193fb33Redeem108758202021-09-13 10:32:515 days 7 hrs ago0xbe0fbc36e9f55b198e835b98bd38ad413fd34b75 IN  0x5fbe4eb536dadbcee54d5b55ed6559e29c60b0550 BNB0.00096767
0x3f339b408d16b5f89245600b779c3e38fc5747fe78659d4cf04bff0fcb5f44a9Redeem108120462021-09-11 5:12:437 days 13 hrs ago0x3aac9ab49190ca80ccbc1c0edecd510bc15b2b8f IN  0x5fbe4eb536dadbcee54d5b55ed6559e29c60b0550 BNB0.000747605
0x9ea928fe3ae3b4bf1ae78b40e70f76af45b7d124f6d8c61b1ff5e0e792921f6eMint108000912021-09-10 19:07:027 days 23 hrs ago0x3aac9ab49190ca80ccbc1c0edecd510bc15b2b8f IN  0x5fbe4eb536dadbcee54d5b55ed6559e29c60b0550.5 BNB0.00034724
0xeb1a2c75f746fb992b2a445c3e29de569e9ea127e195f203ff3793c755b4f7daMint107947122021-09-10 14:31:468 days 3 hrs ago0x7d8cb270c03ce561d6a8f32c51fc31e78472c6fa IN  0x5fbe4eb536dadbcee54d5b55ed6559e29c60b0555 BNB0.00027224
0x0856663781e24ad04e2e4a4c58879edb6d54987da41cdb07cb060e8927df0304Mint107373272021-09-08 14:12:3310 days 4 hrs ago0x4334703b0b74e2045926f82f4158a103fce1df4f IN  0x5fbe4eb536dadbcee54d5b55ed6559e29c60b05523.5 BNB0.00027224
0x21f677973ff6702c3b0257395f14bf728fc91b983726d710937534d7790190faMint107215012021-09-08 0:51:5310 days 17 hrs ago0x7d8cb270c03ce561d6a8f32c51fc31e78472c6fa IN  0x5fbe4eb536dadbcee54d5b55ed6559e29c60b0553 BNB0.00027224
0xb2d2408a06eb0f25ca7d5ff584ca025a22f277a0944dcb27a136f94ac531a030Mint107117432021-09-07 16:35:3011 days 1 hr ago0x7d8cb270c03ce561d6a8f32c51fc31e78472c6fa IN  0x5fbe4eb536dadbcee54d5b55ed6559e29c60b0551 BNB0.00027224
0x804dcaf9491907529f70a570cdcdc87800280c0d717e048a80ef18b0963f6769Mint107113642021-09-07 16:16:2411 days 1 hr ago0x7d8cb270c03ce561d6a8f32c51fc31e78472c6fa IN  0x5fbe4eb536dadbcee54d5b55ed6559e29c60b0551 BNB0.00027224
0x639f119d074bb9aa5dbd8226405390d201bb0db014cc74b95a1679822517aa48Redeem106966442021-09-07 3:41:2811 days 14 hrs ago0x9c67dd13645be82695e71c3ebb0e5767532609b5 IN  0x5fbe4eb536dadbcee54d5b55ed6559e29c60b0550 BNB0.00089259
0x5aef35b0661f9c93839c5af01f5c860d7de41aa36339d3c94d4a490d04c8cc33Mint106707042021-09-06 5:53:1112 days 12 hrs ago0x8f0053269d1ac7dcb6385fb73b04fc48289940fd IN  0x5fbe4eb536dadbcee54d5b55ed6559e29c60b0550.6 BNB0.00034724
0x32fc0f8bcceaa079475b3200a0f295a9965a264551a62a7a331371e667f04808Redeem106491302021-09-05 11:52:5913 days 6 hrs ago0x46d3e50d47b89a4da9556ee217cefd98dec5234f IN  0x5fbe4eb536dadbcee54d5b55ed6559e29c60b0550 BNB0.002366185
0x1cb3bb1b5cab8ad02cf9e5b37607056d40c7934c5f52bdb36376fcc82de23645Redeem105720502021-09-02 19:09:0115 days 23 hrs ago0xf85385347f56819c316939434d427d0c9537eddc IN  0x5fbe4eb536dadbcee54d5b55ed6559e29c60b0550 BNB0.001600055
0xb0e6cb54188404c0991a735cebcaa68ec96dcb5e0fbd4624e5872992ba69d675Redeem105679992021-09-02 15:43:3916 days 2 hrs ago0xe701276b046f04542054de4d69afac9b8aa02689 IN  0x5fbe4eb536dadbcee54d5b55ed6559e29c60b0550 BNB0.001341115
0x879bd5c694a303aba5366b5412724b855a216e9f4d85d2397cb33071a47ab7daRedeem105673272021-09-02 15:08:2916 days 3 hrs ago0x33a888a62f01ddb2419a160e008aeaef53b379e4 IN  0x5fbe4eb536dadbcee54d5b55ed6559e29c60b0550 BNB0.00179863
0x984b632c9a0654ffaa31262cede30018c8284c4f56ad718422b72c8236853524Redeem105532172021-09-02 3:17:1516 days 14 hrs ago0xa854e18f192500133a728004a1c8ce10d9d91f8f IN  0x5fbe4eb536dadbcee54d5b55ed6559e29c60b0550 BNB0.001599975
0x8642ac2ae7479eac87616cd3a8cf214141b690376fb45530833da12be9673841Redeem105493162021-09-01 23:59:3616 days 18 hrs ago0x7231b28f08a5c8978c09a81237f45088f8b6a0bc IN  0x5fbe4eb536dadbcee54d5b55ed6559e29c60b0550 BNB0.00089253
0xf93b17d6ab02c92f24901ab00c67a198062c2bfa21e5ffd5a21f179c2441940cMint105389492021-09-01 15:16:0917 days 2 hrs ago0xa854e18f192500133a728004a1c8ce10d9d91f8f IN  0x5fbe4eb536dadbcee54d5b55ed6559e29c60b0551 BNB0.00027224
0x2f8632583dda8e214cc53549767886cc91c4efbc9e3e171b6750edfcf7e13844Redeem104745332021-08-30 8:31:3319 days 9 hrs ago0x219836d5136312dd2e45e399cf95f9545d656940 IN  0x5fbe4eb536dadbcee54d5b55ed6559e29c60b0550 BNB0.000986901
0x0d5de9c0bea68cced6a3c3c48cfd9c89b7c12f9d78f4f072174a58114ab9b8edMint103413672021-08-25 16:10:0024 days 2 hrs ago0x33a888a62f01ddb2419a160e008aeaef53b379e4 IN  0x5fbe4eb536dadbcee54d5b55ed6559e29c60b055100 BNB0.00027224
0x30100b13a082960a991de309ce1b4b58e34aeedef5db3d03b0138c699a102069Redeem103031472021-08-24 8:09:4825 days 10 hrs ago0x9918f05f96066b5f3f52496b4476079b17c0f61a IN  0x5fbe4eb536dadbcee54d5b55ed6559e29c60b0550 BNB0.00089253
0x8eea0f64242ea57deeef7e2020db086f51cfad8af80a79f10da2d8f1e51c075aRedeem103020882021-08-24 7:16:5125 days 10 hrs ago0x4334703b0b74e2045926f82f4158a103fce1df4f IN  0x5fbe4eb536dadbcee54d5b55ed6559e29c60b0550 BNB0.001674995
[ Download CSV Export 
Latest 25 internal transaction
Parent Txn Hash Block From To Value
0x9a0ff961e1ba5e8c35aab273f3561b0bafd0dc199f8859e0c6302bf4b193fb33108758202021-09-13 10:32:515 days 7 hrs ago 0x5fbe4eb536dadbcee54d5b55ed6559e29c60b0550xbe0fbc36e9f55b198e835b98bd38ad413fd34b750.250434788753101341 BNB
0x3f339b408d16b5f89245600b779c3e38fc5747fe78659d4cf04bff0fcb5f44a9108120462021-09-11 5:12:437 days 13 hrs ago 0x5fbe4eb536dadbcee54d5b55ed6559e29c60b0550x3aac9ab49190ca80ccbc1c0edecd510bc15b2b8f0.5 BNB
0x639f119d074bb9aa5dbd8226405390d201bb0db014cc74b95a1679822517aa48106966442021-09-07 3:41:2811 days 14 hrs ago 0x5fbe4eb536dadbcee54d5b55ed6559e29c60b0550x9c67dd13645be82695e71c3ebb0e5767532609b5120 BNB
0x32fc0f8bcceaa079475b3200a0f295a9965a264551a62a7a331371e667f04808106491302021-09-05 11:52:5913 days 6 hrs ago 0x5fbe4eb536dadbcee54d5b55ed6559e29c60b0550x46d3e50d47b89a4da9556ee217cefd98dec5234f4 BNB
0x1cb3bb1b5cab8ad02cf9e5b37607056d40c7934c5f52bdb36376fcc82de23645105720502021-09-02 19:09:0115 days 23 hrs ago 0x5fbe4eb536dadbcee54d5b55ed6559e29c60b0550xf85385347f56819c316939434d427d0c9537eddc116 BNB
0xb0e6cb54188404c0991a735cebcaa68ec96dcb5e0fbd4624e5872992ba69d675105679992021-09-02 15:43:3916 days 2 hrs ago 0x5fbe4eb536dadbcee54d5b55ed6559e29c60b0550xe701276b046f04542054de4d69afac9b8aa026892 BNB
0x879bd5c694a303aba5366b5412724b855a216e9f4d85d2397cb33071a47ab7da105673272021-09-02 15:08:2916 days 3 hrs ago 0x5fbe4eb536dadbcee54d5b55ed6559e29c60b0550x33a888a62f01ddb2419a160e008aeaef53b379e4125.681 BNB
0x984b632c9a0654ffaa31262cede30018c8284c4f56ad718422b72c8236853524105532172021-09-02 3:17:1516 days 14 hrs ago 0x5fbe4eb536dadbcee54d5b55ed6559e29c60b0550xa854e18f192500133a728004a1c8ce10d9d91f8f5 BNB
0x8642ac2ae7479eac87616cd3a8cf214141b690376fb45530833da12be9673841105493162021-09-01 23:59:3616 days 18 hrs ago 0x5fbe4eb536dadbcee54d5b55ed6559e29c60b0550x7231b28f08a5c8978c09a81237f45088f8b6a0bc11.5 BNB
0x2f8632583dda8e214cc53549767886cc91c4efbc9e3e171b6750edfcf7e13844104745332021-08-30 8:31:3319 days 9 hrs ago 0x5fbe4eb536dadbcee54d5b55ed6559e29c60b0550x219836d5136312dd2e45e399cf95f9545d6569400.4 BNB
0x30100b13a082960a991de309ce1b4b58e34aeedef5db3d03b0138c699a102069103031472021-08-24 8:09:4825 days 10 hrs ago 0x5fbe4eb536dadbcee54d5b55ed6559e29c60b0550x9918f05f96066b5f3f52496b4476079b17c0f61a3 BNB
0x8eea0f64242ea57deeef7e2020db086f51cfad8af80a79f10da2d8f1e51c075a103020882021-08-24 7:16:5125 days 10 hrs ago 0x5fbe4eb536dadbcee54d5b55ed6559e29c60b0550x4334703b0b74e2045926f82f4158a103fce1df4f5 BNB
0x3ee9dc16c4f42ff10395bb161a747034241f0423c10496d49bd4ea9d78a85530102664642021-08-23 1:24:3026 days 16 hrs ago 0x5fbe4eb536dadbcee54d5b55ed6559e29c60b0550x78a9e225d62db4fc59c13963f5680c720eddff220.11 BNB
0x38e3fda1c6b2c334e5795f169ba75a8e4fd26d2f3708cece31397c8e8c6bb0c8102653112021-08-23 0:26:5126 days 17 hrs ago 0x5fbe4eb536dadbcee54d5b55ed6559e29c60b0550x33a888a62f01ddb2419a160e008aeaef53b379e460.319 BNB
0xcc97de40e7bc848df9cf8896327ed449d0afd6ac1c68745f18151b51b928aeca102539842021-08-22 15:00:1327 days 3 hrs ago 0x5fbe4eb536dadbcee54d5b55ed6559e29c60b0550x33a888a62f01ddb2419a160e008aeaef53b379e446 BNB
0xe8eef7115832bdc87ffe02eb188076e44ecd496b4de15107ae74180cc372d964100841232021-08-16 16:40:0533 days 1 hr ago 0x5fbe4eb536dadbcee54d5b55ed6559e29c60b0550x63859a014bc64209059c0c7196d077cb423f166c6.50464831092348239 BNB
0x59996d746a6d9cc683d8e9491d1a3d66a2809b7f28d7d255b85271e2248ef29c100835482021-08-16 16:11:2033 days 2 hrs ago 0x5fbe4eb536dadbcee54d5b55ed6559e29c60b0550x7d8cb270c03ce561d6a8f32c51fc31e78472c6fa1 BNB
0x2f0073c06d229877e8872083ee200238f51a5b809b3e126bb68bff2cf032b182100551512021-08-15 16:26:0934 days 1 hr ago 0x5fbe4eb536dadbcee54d5b55ed6559e29c60b0550x7d8cb270c03ce561d6a8f32c51fc31e78472c6fa1 BNB
0xefeefae30fd2bb8fabd1472738b74487dbf43d193442d71bedde4a35469b607499655552021-08-12 12:54:5537 days 5 hrs ago 0x5fbe4eb536dadbcee54d5b55ed6559e29c60b0550x432fcd67815d5cc72808a7815a02373fdee7d74020 BNB
0x0b6ec6643a062baab40de9058830636c2bc74c8a2d1f6bc3ad8ab154d8c3c6a999413222021-08-11 15:40:4638 days 2 hrs ago 0x5fbe4eb536dadbcee54d5b55ed6559e29c60b0550x7d8cb270c03ce561d6a8f32c51fc31e78472c6fa1 BNB
0x6a7d5fde4de23259bfbdae126c3c4c90a7d88a9c0a27fcdcdc6ebba04f043da799412142021-08-11 15:35:2238 days 2 hrs ago 0x5fbe4eb536dadbcee54d5b55ed6559e29c60b0550xab6147944d5d8106c359041683754e5cc0582cbe0.5725 BNB
0xc4fd4e03d6a6f83fb9d93cd5ef26e3df21f199c592644ea9fa929caea9d5783999387662021-08-11 13:27:0038 days 4 hrs ago 0x5fbe4eb536dadbcee54d5b55ed6559e29c60b0550x432fcd67815d5cc72808a7815a02373fdee7d74045 BNB
0xf269ce60260fff2d0e84ee96adb4ab58b089b67b74415ebe9f3df272e652ba0199231622021-08-11 0:22:0638 days 17 hrs ago 0x5fbe4eb536dadbcee54d5b55ed6559e29c60b0550x17296842cbdb2bee63462fa6304b10a01a5e6f4531.5 BNB
0x187c819a511618ac4c3d7229504c951d8fb284906ac69c4594335f7ed3cb93b999100882021-08-10 13:27:2139 days 4 hrs ago 0x5fbe4eb536dadbcee54d5b55ed6559e29c60b0550x680d766f3888af5d680bcdcc1d174886dbdd24b4153.996917766420395185 BNB
0x30049a625039f160aa7cd6b8657735fac126539e071a869ff7b846896291506499095842021-08-10 13:02:0739 days 5 hrs ago 0x5fbe4eb536dadbcee54d5b55ed6559e29c60b0550x680d766f3888af5d680bcdcc1d174886dbdd24b41 BNB
[ Download CSV Export 
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
KEther

Compiler Version
v0.5.16+commit.9c3226ce

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity Standard Json-Input format)

File 1 of 9 : EIP20Interface.sol
pragma solidity ^0.5.16;

/**
Copyright 2020 Compound Labs, Inc.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

/**
 * @title ERC 20 Token Standard Interface
 *  https://eips.ethereum.org/EIPS/eip-20
 */
interface EIP20Interface {
    function name() external view returns (string memory);
    function symbol() external view returns (string memory);
    function decimals() external view returns (uint8);

    /**
      * @notice Get the total number of tokens in circulation
      * @return The supply of tokens
      */
    function totalSupply() external view returns (uint256);

    /**
     * @notice Gets the balance of the specified address
     * @param owner The address from which the balance will be retrieved
     * @return The balance
     */
    function balanceOf(address owner) external view returns (uint256 balance);

    /**
      * @notice Transfer `amount` tokens from `msg.sender` to `dst`
      * @param dst The address of the destination account
      * @param amount The number of tokens to transfer
      * @return Whether or not the transfer succeeded
      */
    function transfer(address dst, uint256 amount) external returns (bool success);

    /**
      * @notice Transfer `amount` tokens from `src` to `dst`
      * @param src The address of the source account
      * @param dst The address of the destination account
      * @param amount The number of tokens to transfer
      * @return Whether or not the transfer succeeded
      */
    function transferFrom(address src, address dst, uint256 amount) external returns (bool success);

    /**
      * @notice Approve `spender` to transfer up to `amount` from `src`
      * @dev This will overwrite the approval amount for `spender`
      *  and is subject to issues noted [here](https://eips.ethereum.org/EIPS/eip-20#approve)
      * @param spender The address of the account which may transfer tokens
      * @param amount The number of tokens that are approved (-1 means infinite)
      * @return Whether or not the approval succeeded
      */
    function approve(address spender, uint256 amount) external returns (bool success);

    /**
      * @notice Get the current allowance from `owner` for `spender`
      * @param owner The address of the account which owns the tokens to be spent
      * @param spender The address of the account which may transfer tokens
      * @return The number of tokens allowed to be spent (-1 means infinite)
      */
    function allowance(address owner, address spender) external view returns (uint256 remaining);

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

File 2 of 9 : EIP20NonStandardInterface.sol
pragma solidity ^0.5.16;

/**
Copyright 2020 Compound Labs, Inc.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

/**
 * @title EIP20NonStandardInterface
 * @dev Version of ERC20 with no return values for `transfer` and `transferFrom`
 *  See https://medium.com/coinmonks/missing-return-value-bug-at-least-130-tokens-affected-d67bf08521ca
 */
interface EIP20NonStandardInterface {

    /**
     * @notice Get the total number of tokens in circulation
     * @return The supply of tokens
     */
    function totalSupply() external view returns (uint256);

    /**
     * @notice Gets the balance of the specified address
     * @param owner The address from which the balance will be retrieved
     * @return The balance
     */
    function balanceOf(address owner) external view returns (uint256 balance);

    ///
    /// !!!!!!!!!!!!!!
    /// !!! NOTICE !!! `transfer` does not return a value, in violation of the ERC-20 specification
    /// !!!!!!!!!!!!!!
    ///

    /**
      * @notice Transfer `amount` tokens from `msg.sender` to `dst`
      * @param dst The address of the destination account
      * @param amount The number of tokens to transfer
      */
    function transfer(address dst, uint256 amount) external;

    ///
    /// !!!!!!!!!!!!!!
    /// !!! NOTICE !!! `transferFrom` does not return a value, in violation of the ERC-20 specification
    /// !!!!!!!!!!!!!!
    ///

    /**
      * @notice Transfer `amount` tokens from `src` to `dst`
      * @param src The address of the source account
      * @param dst The address of the destination account
      * @param amount The number of tokens to transfer
      */
    function transferFrom(address src, address dst, uint256 amount) external;

    /**
      * @notice Approve `spender` to transfer up to `amount` from `src`
      * @dev This will overwrite the approval amount for `spender`
      *  and is subject to issues noted [here](https://eips.ethereum.org/EIPS/eip-20#approve)
      * @param spender The address of the account which may transfer tokens
      * @param amount The number of tokens that are approved
      * @return Whether or not the approval succeeded
      */
    function approve(address spender, uint256 amount) external returns (bool success);

    /**
      * @notice Get the current allowance from `owner` for `spender`
      * @param owner The address of the account which owns the tokens to be spent
      * @param spender The address of the account which may transfer tokens
      * @return The number of tokens allowed to be spent
      */
    function allowance(address owner, address spender) external view returns (uint256 remaining);

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

File 3 of 9 : ErrorReporter.sol
pragma solidity ^0.5.16;

/**
Copyright 2020 Compound Labs, Inc.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

/**
* Original work from Compound: https://github.com/compound-finance/compound-protocol/blob/master/contracts/ErrorReporter.sol
* Modified to work in the Kine system.
* Main modifications:
*   1. using constant string instead of enums
*/

contract ControllerErrorReporter {
    string internal constant MARKET_NOT_LISTED = "MARKET_NOT_LISTED";
    string internal constant MARKET_ALREADY_LISTED = "MARKET_ALREADY_LISTED";
    string internal constant MARKET_ALREADY_ADDED = "MARKET_ALREADY_ADDED";
    string internal constant EXIT_MARKET_BALANCE_OWED = "EXIT_MARKET_BALANCE_OWED";
    string internal constant EXIT_MARKET_REJECTION = "EXIT_MARKET_REJECTION";
    string internal constant MINT_PAUSED = "MINT_PAUSED";
    string internal constant BORROW_PAUSED = "BORROW_PAUSED";
    string internal constant SEIZE_PAUSED = "SEIZE_PAUSED";
    string internal constant TRANSFER_PAUSED = "TRANSFER_PAUSED";
    string internal constant MARKET_BORROW_CAP_REACHED = "MARKET_BORROW_CAP_REACHED";
    string internal constant MARKET_SUPPLY_CAP_REACHED = "MARKET_SUPPLY_CAP_REACHED";
    string internal constant REDEEM_TOKENS_ZERO = "REDEEM_TOKENS_ZERO";
    string internal constant INSUFFICIENT_LIQUIDITY = "INSUFFICIENT_LIQUIDITY";
    string internal constant INSUFFICIENT_SHORTFALL = "INSUFFICIENT_SHORTFALL";
    string internal constant TOO_MUCH_REPAY = "TOO_MUCH_REPAY";
    string internal constant CONTROLLER_MISMATCH = "CONTROLLER_MISMATCH";
    string internal constant INVALID_COLLATERAL_FACTOR = "INVALID_COLLATERAL_FACTOR";
    string internal constant INVALID_CLOSE_FACTOR = "INVALID_CLOSE_FACTOR";
    string internal constant INVALID_LIQUIDATION_INCENTIVE = "INVALID_LIQUIDATION_INCENTIVE";
}

contract KTokenErrorReporter {
    string internal constant BAD_INPUT = "BAD_INPUT";
    string internal constant TRANSFER_NOT_ALLOWED = "TRANSFER_NOT_ALLOWED";
    string internal constant TRANSFER_NOT_ENOUGH = "TRANSFER_NOT_ENOUGH";
    string internal constant TRANSFER_TOO_MUCH = "TRANSFER_TOO_MUCH";
    string internal constant MINT_NEW_TOTAL_SUPPLY_CALCULATION_FAILED = "MINT_NEW_TOTAL_SUPPLY_CALCULATION_FAILED";
    string internal constant MINT_NEW_ACCOUNT_BALANCE_CALCULATION_FAILED = "MINT_NEW_ACCOUNT_BALANCE_CALCULATION_FAILED";
    string internal constant REDEEM_NEW_TOTAL_SUPPLY_CALCULATION_FAILED = "REDEEM_NEW_TOTAL_SUPPLY_CALCULATION_FAILED";
    string internal constant REDEEM_NEW_ACCOUNT_BALANCE_CALCULATION_FAILED = "REDEEM_NEW_ACCOUNT_BALANCE_CALCULATION_FAILED";
    string internal constant BORROW_NEW_ACCOUNT_BORROW_BALANCE_CALCULATION_FAILED = "BORROW_NEW_ACCOUNT_BORROW_BALANCE_CALCULATION_FAILED";
    string internal constant BORROW_NEW_TOTAL_BALANCE_CALCULATION_FAILED = "BORROW_NEW_TOTAL_BALANCE_CALCULATION_FAILED";
    string internal constant REPAY_BORROW_NEW_ACCOUNT_BORROW_BALANCE_CALCULATION_FAILED = "REPAY_BORROW_NEW_ACCOUNT_BORROW_BALANCE_CALCULATION_FAILED";
    string internal constant REPAY_BORROW_NEW_TOTAL_BALANCE_CALCULATION_FAILED = "REPAY_BORROW_NEW_TOTAL_BALANCE_CALCULATION_FAILED";
    string internal constant INVALID_CLOSE_AMOUNT_REQUESTED = "INVALID_CLOSE_AMOUNT_REQUESTED";
    string internal constant LIQUIDATE_SEIZE_TOO_MUCH = "LIQUIDATE_SEIZE_TOO_MUCH";
    string internal constant TOKEN_INSUFFICIENT_CASH = "TOKEN_INSUFFICIENT_CASH";
    string internal constant INVALID_ACCOUNT_PAIR = "INVALID_ACCOUNT_PAIR";
    string internal constant LIQUIDATE_SEIZE_BALANCE_DECREMENT_FAILED = "LIQUIDATE_SEIZE_BALANCE_DECREMENT_FAILED";
    string internal constant LIQUIDATE_SEIZE_BALANCE_INCREMENT_FAILED = "LIQUIDATE_SEIZE_BALANCE_INCREMENT_FAILED";
    string internal constant TOKEN_TRANSFER_IN_FAILED = "TOKEN_TRANSFER_IN_FAILED";
    string internal constant TOKEN_TRANSFER_IN_OVERFLOW = "TOKEN_TRANSFER_IN_OVERFLOW";
    string internal constant TOKEN_TRANSFER_OUT_FAILED = "TOKEN_TRANSFER_OUT_FAILED";

}

File 4 of 9 : Exponential.sol
pragma solidity ^0.5.16;

import "./KineSafeMath.sol";

/**
Copyright 2020 Compound Labs, Inc.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

/**
* Original work from Compound: https://github.com/compound-finance/compound-protocol/blob/master/contracts/Comptroller.sol
* Modified to work in the Kine system.
* Main modifications:
*   1. use SafeMath instead of CarefulMath to fail fast and loudly
*/

/**
 * @title Exponential module for storing fixed-precision decimals
 * @author Compound
 * @notice Exp is a struct which stores decimals with a fixed precision of 18 decimal places.
 *         Thus, if we wanted to store the 5.1, mantissa would store 5.1e18. That is:
 *         `Exp({mantissa: 5100000000000000000})`.
 */
contract Exponential {
    using KineSafeMath for uint;
    uint constant expScale = 1e18;
    uint constant doubleScale = 1e36;
    uint constant halfExpScale = expScale / 2;
    uint constant mantissaOne = expScale;

    struct Exp {
        uint mantissa;
    }

    struct Double {
        uint mantissa;
    }

    /**
     * @dev Creates an exponential from numerator and denominator values.
     */
    function getExp(uint num, uint denom) pure internal returns (Exp memory) {
        uint rational = num.mul(expScale).div(denom);
        return Exp({mantissa : rational});
    }

    /**
     * @dev Adds two exponentials, returning a new exponential.
     */
    function addExp(Exp memory a, Exp memory b) pure internal returns (Exp memory) {
        uint result = a.mantissa.add(b.mantissa);
        return Exp({mantissa : result});
    }

    /**
     * @dev Subtracts two exponentials, returning a new exponential.
     */
    function subExp(Exp memory a, Exp memory b) pure internal returns (Exp memory) {
        uint result = a.mantissa.sub(b.mantissa);
        return Exp({mantissa : result});
    }

    /**
     * @dev Multiply an Exp by a scalar, returning a new Exp.
     */
    function mulScalar(Exp memory a, uint scalar) pure internal returns (Exp memory) {
        uint scaledMantissa = a.mantissa.mul(scalar);
        return Exp({mantissa : scaledMantissa});
    }

    /**
     * @dev Multiply an Exp by a scalar, then truncate to return an unsigned integer.
     */
    function mulScalarTruncate(Exp memory a, uint scalar) pure internal returns (uint) {
        Exp memory product = mulScalar(a, scalar);
        return truncate(product);
    }

    /**
     * @dev Multiply an Exp by a scalar, truncate, then add an to an unsigned integer, returning an unsigned integer.
     */
    function mulScalarTruncateAddUInt(Exp memory a, uint scalar, uint addend) pure internal returns (uint) {
        Exp memory product = mulScalar(a, scalar);
        return truncate(product).add(addend);
    }

    /**
     * @dev Divide an Exp by a scalar, returning a new Exp.
     */
    function divScalar(Exp memory a, uint scalar) pure internal returns (Exp memory) {
        uint descaledMantissa = a.mantissa.div(scalar);
        return Exp({mantissa : descaledMantissa});
    }

    /**
     * @dev Divide a scalar by an Exp, returning a new Exp.
     */
    function divScalarByExp(uint scalar, Exp memory divisor) pure internal returns (Exp memory) {
        /*
          We are doing this as:
          getExp(expScale.mul(scalar), divisor.mantissa)

          How it works:
          Exp = a / b;
          Scalar = s;
          `s / (a / b)` = `b * s / a` and since for an Exp `a = mantissa, b = expScale`
        */
        uint numerator = expScale.mul(scalar);
        return getExp(numerator, divisor.mantissa);
    }

    /**
     * @dev Divide a scalar by an Exp, then truncate to return an unsigned integer.
     */
    function divScalarByExpTruncate(uint scalar, Exp memory divisor) pure internal returns (uint) {
        Exp memory fraction = divScalarByExp(scalar, divisor);
        return truncate(fraction);
    }

    /**
     * @dev Multiplies two exponentials, returning a new exponential.
     */
    function mulExp(Exp memory a, Exp memory b) pure internal returns (Exp memory) {
        uint doubleScaledProduct = a.mantissa.mul(b.mantissa);

        // We add half the scale before dividing so that we get rounding instead of truncation.
        //  See "Listing 6" and text above it at https://accu.org/index.php/journals/1717
        // Without this change, a result like 6.6...e-19 will be truncated to 0 instead of being rounded to 1e-18.
        uint doubleScaledProductWithHalfScale = halfExpScale.add(doubleScaledProduct);
        uint product = doubleScaledProductWithHalfScale.div(expScale);
        return Exp({mantissa : product});
    }

    /**
     * @dev Multiplies two exponentials given their mantissas, returning a new exponential.
     */
    function mulExp(uint a, uint b) pure internal returns (Exp memory) {
        return mulExp(Exp({mantissa : a}), Exp({mantissa : b}));
    }

    /**
     * @dev Divides two exponentials, returning a new exponential.
     *     (a/scale) / (b/scale) = (a/scale) * (scale/b) = a/b,
     *  which we can scale as an Exp by calling getExp(a.mantissa, b.mantissa)
     */
    function divExp(Exp memory a, Exp memory b) pure internal returns (Exp memory) {
        return getExp(a.mantissa, b.mantissa);
    }

    /**
     * @dev Truncates the given exp to a whole number value.
     *      For example, truncate(Exp{mantissa: 15 * expScale}) = 15
     */
    function truncate(Exp memory exp) pure internal returns (uint) {
        // Note: We are not using careful math here as we're performing a division that cannot fail
        return exp.mantissa / expScale;
    }

    /**
     * @dev Checks if first Exp is less than second Exp.
     */
    function lessThanExp(Exp memory left, Exp memory right) pure internal returns (bool) {
        return left.mantissa < right.mantissa;
    }

    /**
     * @dev Checks if left Exp <= right Exp.
     */
    function lessThanOrEqualExp(Exp memory left, Exp memory right) pure internal returns (bool) {
        return left.mantissa <= right.mantissa;
    }

    /**
     * @dev Checks if left Exp > right Exp.
     */
    function greaterThanExp(Exp memory left, Exp memory right) pure internal returns (bool) {
        return left.mantissa > right.mantissa;
    }

    /**
     * @dev returns true if Exp is exactly zero
     */
    function isZeroExp(Exp memory value) pure internal returns (bool) {
        return value.mantissa == 0;
    }

    function safe224(uint n, string memory errorMessage) pure internal returns (uint224) {
        require(n < 2 ** 224, errorMessage);
        return uint224(n);
    }

    function safe32(uint n, string memory errorMessage) pure internal returns (uint32) {
        require(n < 2 ** 32, errorMessage);
        return uint32(n);
    }

    function add_(Exp memory a, Exp memory b) pure internal returns (Exp memory) {
        return Exp({mantissa : add_(a.mantissa, b.mantissa)});
    }

    function add_(Double memory a, Double memory b) pure internal returns (Double memory) {
        return Double({mantissa : add_(a.mantissa, b.mantissa)});
    }

    function add_(uint a, uint b) pure internal returns (uint) {
        return add_(a, b, "addition overflow");
    }

    function add_(uint a, uint b, string memory errorMessage) pure internal returns (uint) {
        uint c = a + b;
        require(c >= a, errorMessage);
        return c;
    }

    function sub_(Exp memory a, Exp memory b) pure internal returns (Exp memory) {
        return Exp({mantissa : sub_(a.mantissa, b.mantissa)});
    }

    function sub_(Double memory a, Double memory b) pure internal returns (Double memory) {
        return Double({mantissa : sub_(a.mantissa, b.mantissa)});
    }

    function sub_(uint a, uint b) pure internal returns (uint) {
        return sub_(a, b, "subtraction underflow");
    }

    function sub_(uint a, uint b, string memory errorMessage) pure internal returns (uint) {
        require(b <= a, errorMessage);
        return a - b;
    }

    function mul_(Exp memory a, Exp memory b) pure internal returns (Exp memory) {
        return Exp({mantissa : mul_(a.mantissa, b.mantissa) / expScale});
    }

    function mul_(Exp memory a, uint b) pure internal returns (Exp memory) {
        return Exp({mantissa : mul_(a.mantissa, b)});
    }

    function mul_(uint a, Exp memory b) pure internal returns (uint) {
        return mul_(a, b.mantissa) / expScale;
    }

    function mul_(Double memory a, Double memory b) pure internal returns (Double memory) {
        return Double({mantissa : mul_(a.mantissa, b.mantissa) / doubleScale});
    }

    function mul_(Double memory a, uint b) pure internal returns (Double memory) {
        return Double({mantissa : mul_(a.mantissa, b)});
    }

    function mul_(uint a, Double memory b) pure internal returns (uint) {
        return mul_(a, b.mantissa) / doubleScale;
    }

    function mul_(uint a, uint b) pure internal returns (uint) {
        return mul_(a, b, "multiplication overflow");
    }

    function mul_(uint a, uint b, string memory errorMessage) pure internal returns (uint) {
        if (a == 0 || b == 0) {
            return 0;
        }
        uint c = a * b;
        require(c / a == b, errorMessage);
        return c;
    }

    function div_(Exp memory a, Exp memory b) pure internal returns (Exp memory) {
        return Exp({mantissa : div_(mul_(a.mantissa, expScale), b.mantissa)});
    }

    function div_(Exp memory a, uint b) pure internal returns (Exp memory) {
        return Exp({mantissa : div_(a.mantissa, b)});
    }

    function div_(uint a, Exp memory b) pure internal returns (uint) {
        return div_(mul_(a, expScale), b.mantissa);
    }

    function div_(Double memory a, Double memory b) pure internal returns (Double memory) {
        return Double({mantissa : div_(mul_(a.mantissa, doubleScale), b.mantissa)});
    }

    function div_(Double memory a, uint b) pure internal returns (Double memory) {
        return Double({mantissa : div_(a.mantissa, b)});
    }

    function div_(uint a, Double memory b) pure internal returns (uint) {
        return div_(mul_(a, doubleScale), b.mantissa);
    }

    function div_(uint a, uint b) pure internal returns (uint) {
        return div_(a, b, "divide by zero");
    }

    function div_(uint a, uint b, string memory errorMessage) pure internal returns (uint) {
        require(b > 0, errorMessage);
        return a / b;
    }

    function fraction(uint a, uint b) pure internal returns (Double memory) {
        return Double({mantissa : div_(mul_(a, doubleScale), b)});
    }
}

File 5 of 9 : KEther.sol
pragma solidity ^0.5.16;

import "./KToken.sol";

/**
Copyright 2020 Compound Labs, Inc.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

/**
* Original work from Compound: https://github.com/compound-finance/compound-protocol/blob/master/contracts/CEther.sol
* Modified to work in the Kine system.
* Main modifications:
*   1. removed Comp token related logics.
*   2. removed interest rate model related logics.
*   3. removed borrow logics, user can only borrow Kine MCD (see KMCD).
*   4. removed error code propagation mechanism, using revert to fail fast and loudly.
*/


/**
 * @title Kine's KEther Contract
 * @notice KToken which wraps Ether
 * @author Kine
 */
contract KEther is KToken {
    /**
     * @notice Construct a new CEther money market
     * @param controller_ The address of the Controller
     * @param name_ ERC-20 name of this token
     * @param symbol_ ERC-20 symbol of this token
     * @param decimals_ ERC-20 decimal precision of this token
     * @param admin_ Address of the administrator of this token
     */
    constructor(KineControllerInterface controller_,
        string memory name_,
        string memory symbol_,
        uint8 decimals_,
        address payable admin_) public {
        // Creator of the contract is admin during initialization
        admin = msg.sender;
        initialized = false;

        initialize(controller_, name_, symbol_, decimals_);

        // Set the proper admin now that initialization is done
        admin = admin_;
    }


    /*** User Interface ***/

    /**
     * @notice Sender supplies assets into the market and receives kTokens in exchange
     * @dev Reverts upon any failure
     * @return the actual mint amount.
     */
    function mint() external payable returns (uint) {
        return mintInternal(msg.value);
    }

    /**
     * @notice Sender redeems kTokens in exchange for the underlying asset
     * @param redeemTokens The number of kTokens to redeem into underlying
     */
    function redeem(uint redeemTokens) external {
        redeemInternal(redeemTokens);
    }

    /**
     * @notice Send Ether to CEther to mint
     */
    function() external payable {
        mintInternal(msg.value);
    }

    /*** Safe Token ***/

    /**
     * @notice Gets balance of this contract in terms of Ether, before this message
     * @dev This excludes the value of the current message, if any
     * @return The quantity of Ether owned by this contract
     */
    function getCashPrior() internal view returns (uint) {
        uint startingBalance = address(this).balance.sub(msg.value);
        return startingBalance;
    }

    /**
     * @notice Perform the actual transfer in, which is a no-op
     * @param from Address sending the Ether
     * @param amount Amount of Ether being sent
     * @return The actual amount of Ether transferred
     */
    function doTransferIn(address from, uint amount) internal returns (uint) {
        // Sanity checks
        require(msg.sender == from, "sender mismatch");
        require(msg.value == amount, "value mismatch");
        return amount;
    }

    function doTransferOut(address payable to, uint amount) internal {
        /* Send the Ether, with minimal gas and revert on failure */
        to.transfer(amount);
    }
}

File 6 of 9 : KToken.sol
pragma solidity ^0.5.16;

import "./KineControllerInterface.sol";
import "./KTokenInterfaces.sol";
import "./ErrorReporter.sol";
import "./Exponential.sol";
import "./EIP20Interface.sol";
import "./EIP20NonStandardInterface.sol";

/**
Copyright 2020 Compound Labs, Inc.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

/**
* Original work from Compound: https://github.com/compound-finance/compound-protocol/blob/master/contracts/CToken.sol
* Modified to work in the Kine system.
* Main modifications:
*   1. removed Comp token related logics.
*   2. removed interest rate model related logics.
*   3. removed borrow/repay logics. users can only mint/redeem kTokens and borrow Kine MCD (see KMCD).
*   4. removed error code propagation mechanism, using revert to fail fast and loudly.
*/

/**
 * @title Kine's KToken Contract
 * @notice Abstract base for KTokens
 * @author Kine
 */
contract KToken is KTokenInterface, Exponential, KTokenErrorReporter {
    modifier onlyAdmin(){
        require(msg.sender == admin, "only admin can call this function");
        _;
    }

    /**
     * @notice Initialize the money market
     * @param controller_ The address of the Controller
     * @param name_ EIP-20 name of this token
     * @param symbol_ EIP-20 symbol of this token
     * @param decimals_ EIP-20 decimal precision of this token
     */
    function initialize(KineControllerInterface controller_,
        string memory name_,
        string memory symbol_,
        uint8 decimals_) public {
        require(msg.sender == admin, "only admin may initialize the market");
        require(initialized == false, "market may only be initialized once");

        // Set the controller
        _setController(controller_);

        name = name_;
        symbol = symbol_;
        decimals = decimals_;

        // The counter starts true to prevent changing it from zero to non-zero (i.e. smaller cost/refund)
        _notEntered = true;
        initialized = true;
    }

    /**
     * @notice Transfer `tokens` tokens from `src` to `dst` by `spender`
     * @dev Called by both `transfer` and `transferFrom` internally
     * @param spender The address of the account performing the transfer
     * @param src The address of the source account
     * @param dst The address of the destination account
     * @param tokens The number of tokens to transfer
     */
    function transferTokens(address spender, address src, address dst, uint tokens) internal {
        /* Fail if transfer not allowed */
        (bool allowed, string memory reason) = controller.transferAllowed(address(this), src, dst, tokens);
        require(allowed, reason);

        /* Do not allow self-transfers */
        require(src != dst, BAD_INPUT);

        /* Get the allowance, infinite for the account owner */
        uint startingAllowance = 0;
        if (spender == src) {
            startingAllowance = uint(- 1);
        } else {
            startingAllowance = transferAllowances[src][spender];
        }

        /* Do the calculations, checking for {under,over}flow */
        uint allowanceNew = startingAllowance.sub(tokens, TRANSFER_NOT_ALLOWED);
        uint srcTokensNew = accountTokens[src].sub(tokens, TRANSFER_NOT_ENOUGH);
        uint dstTokensNew = accountTokens[dst].add(tokens, TRANSFER_TOO_MUCH);

        /////////////////////////
        // EFFECTS & INTERACTIONS
        accountTokens[src] = srcTokensNew;
        accountTokens[dst] = dstTokensNew;

        /* Eat some of the allowance (if necessary) */
        if (startingAllowance != uint(- 1)) {
            transferAllowances[src][spender] = allowanceNew;
        }

        /* We emit a Transfer event */
        emit Transfer(src, dst, tokens);

        controller.transferVerify(address(this), src, dst, tokens);
    }

    /**
     * @notice Transfer `amount` tokens from `msg.sender` to `dst`
     * @param dst The address of the destination account
     * @param amount The number of tokens to transfer
     * @return Whether or not the transfer succeeded
     */
    function transfer(address dst, uint256 amount) external nonReentrant returns (bool) {
        transferTokens(msg.sender, msg.sender, dst, amount);
        return true;
    }

    /**
     * @notice Transfer `amount` tokens from `src` to `dst`
     * @param src The address of the source account
     * @param dst The address of the destination account
     * @param amount The number of tokens to transfer
     * @return Whether or not the transfer succeeded
     */
    function transferFrom(address src, address dst, uint256 amount) external nonReentrant returns (bool) {
        transferTokens(msg.sender, src, dst, amount);
        return true;
    }

    /**
     * @notice Approve `spender` to transfer up to `amount` from `src`
     * @dev This will overwrite the approval amount for `spender`
     *  and is subject to issues noted [here](https://eips.ethereum.org/EIPS/eip-20#approve)
     * @param spender The address of the account which may transfer tokens
     * @param amount The number of tokens that are approved (uint256(-1) means infinite)
     * @return Whether or not the approval succeeded
     */
    function approve(address spender, uint256 amount) external returns (bool) {
        address src = msg.sender;
        transferAllowances[src][spender] = amount;
        emit Approval(src, spender, amount);
        return true;
    }

    /**
     * @notice Get the current allowance from `owner` for `spender`
     * @param owner The address of the account which owns the tokens to be spent
     * @param spender The address of the account which may transfer tokens
     * @return The number of tokens allowed to be spent (-1 means infinite)
     */
    function allowance(address owner, address spender) external view returns (uint256) {
        return transferAllowances[owner][spender];
    }

    /**
     * @notice Get the token balance of the `owner`
     * @param owner The address of the account to query
     * @return The number of tokens owned by `owner`
     */
    function balanceOf(address owner) external view returns (uint256) {
        return accountTokens[owner];
    }


    /**
     * @notice Get a snapshot of the account's balances
     * @dev This is used by controller to more efficiently perform liquidity checks.
     * and for kTokens, there is only token balance, for kMCD, there is only borrow balance
     * @param account Address of the account to snapshot
     * @return (token balance, borrow balance)
     */
    function getAccountSnapshot(address account) external view returns (uint, uint) {
        return (accountTokens[account], 0);
    }

    /**
     * @dev Function to simply retrieve block number
     *  This exists mainly for inheriting test contracts to stub this result.
     */
    function getBlockNumber() internal view returns (uint) {
        return block.number;
    }

    /**
     * @notice Get cash balance of this kToken in the underlying asset
     * @return The quantity of underlying asset owned by this contract
     */
    function getCash() external view returns (uint) {
        return getCashPrior();
    }

    /**
     * @notice Sender supplies assets into the market and receives kTokens in exchange
     * @param mintAmount The amount of the underlying asset to supply
     * @return the actual mint amount.
     */
    function mintInternal(uint mintAmount) internal nonReentrant returns (uint) {
        return mintFresh(msg.sender, mintAmount);
    }

    struct MintLocalVars {
        uint mintTokens;
        uint totalSupplyNew;
        uint accountTokensNew;
        uint actualMintAmount;
    }

    /**
     * @notice User supplies assets into the market and receives kTokens in exchange
     * @param minter The address of the account which is supplying the assets
     * @param mintAmount The amount of the underlying asset to supply
     * @return the actual mint amount.
     */
    function mintFresh(address minter, uint mintAmount) internal returns (uint) {
        /* Fail if mint not allowed */
        (bool allowed, string memory reason) = controller.mintAllowed(address(this), minter, mintAmount);
        require(allowed, reason);

        MintLocalVars memory vars;

        /////////////////////////
        // EFFECTS & INTERACTIONS

        /*
         *  We call `doTransferIn` for the minter and the mintAmount.
         *  Note: The kToken must handle variations between ERC-20 and ETH underlying.
         *  `doTransferIn` reverts if anything goes wrong, since we can't be sure if
         *  side-effects occurred. The function returns the amount actually transferred,
         *  in case of a fee. On success, the kToken holds an additional `actualMintAmount`
         *  of cash.
         */
        vars.actualMintAmount = doTransferIn(minter, mintAmount);

        /*
         *  mintTokens = actualMintAmount
         */
        vars.mintTokens = vars.actualMintAmount;

        /*
         * We calculate the new total supply of kTokens and minter token balance, checking for overflow:
         *  totalSupplyNew = totalSupply + mintTokens
         *  accountTokensNew = accountTokens[minter] + mintTokens
         */
        vars.totalSupplyNew = totalSupply.add(vars.mintTokens, MINT_NEW_TOTAL_SUPPLY_CALCULATION_FAILED);
        vars.accountTokensNew = accountTokens[minter].add(vars.mintTokens, MINT_NEW_ACCOUNT_BALANCE_CALCULATION_FAILED);

        /* We write previously calculated values into storage */
        totalSupply = vars.totalSupplyNew;
        accountTokens[minter] = vars.accountTokensNew;

        /* We emit a Mint event, and a Transfer event */
        emit Mint(minter, vars.actualMintAmount, vars.mintTokens);
        emit Transfer(address(this), minter, vars.mintTokens);

        /* We call the defense hook */
        controller.mintVerify(address(this), minter, vars.actualMintAmount, vars.mintTokens);

        return vars.actualMintAmount;
    }

    /**
     * @notice Sender redeems kTokens in exchange for the underlying asset
     * @param redeemTokens The number of kTokens to redeem into underlying
     */
    function redeemInternal(uint redeemTokens) internal nonReentrant {
        redeemFresh(msg.sender, redeemTokens);
    }

    struct RedeemLocalVars {
        uint totalSupplyNew;
        uint accountTokensNew;
    }

    /**
     * @notice User redeems kTokens in exchange for the underlying asset
     * @param redeemer The address of the account which is redeeming the tokens
     * @param redeemTokensIn The number of kTokens to redeem into underlying (only one of redeemTokensIn or redeemAmountIn may be non-zero)
     */
    function redeemFresh(address payable redeemer, uint redeemTokensIn) internal {
        require(redeemTokensIn != 0, "redeemTokensIn must not be zero");

        RedeemLocalVars memory vars;

        /* Fail if redeem not allowed */
        (bool allowed, string memory reason) = controller.redeemAllowed(address(this), redeemer, redeemTokensIn);
        require(allowed, reason);

        /*
         * We calculate the new total supply and redeemer balance, checking for underflow:
         *  totalSupplyNew = totalSupply - redeemTokens
         *  accountTokensNew = accountTokens[redeemer] - redeemTokens
         */
        vars.totalSupplyNew = totalSupply.sub(redeemTokensIn, REDEEM_NEW_TOTAL_SUPPLY_CALCULATION_FAILED);

        vars.accountTokensNew = accountTokens[redeemer].sub(redeemTokensIn, REDEEM_NEW_ACCOUNT_BALANCE_CALCULATION_FAILED);

        /* Fail gracefully if protocol has insufficient cash */
        require(getCashPrior() >= redeemTokensIn, TOKEN_INSUFFICIENT_CASH);

        /////////////////////////
        // EFFECTS & INTERACTIONS

        /* We write previously calculated values into storage */
        totalSupply = vars.totalSupplyNew;
        accountTokens[redeemer] = vars.accountTokensNew;
        /*
         * We invoke doTransferOut for the redeemer and the redeemAmount.
         *  Note: The kToken must handle variations between ERC-20 and ETH underlying.
         *  On success, the kToken has redeemAmount less of cash.
         *  doTransferOut reverts if anything goes wrong, since we can't be sure if side effects occurred.
         */
        doTransferOut(redeemer, redeemTokensIn);

        /* We emit a Transfer event, and a Redeem event */
        emit Transfer(redeemer, address(this), redeemTokensIn);
        emit Redeem(redeemer, redeemTokensIn);

        /* We call the defense hook */
        controller.redeemVerify(address(this), redeemer, redeemTokensIn);
    }

    /**
     * @notice Transfers collateral tokens (this market) to the liquidator.
     * @dev Will fail unless called by another kToken during the process of liquidation.
     *  Its absolutely critical to use msg.sender as the borrowed kToken and not a parameter.
     * @param liquidator The account receiving seized collateral
     * @param borrower The account having collateral seized
     * @param seizeTokens The number of kTokens to seize
     */
    function seize(address liquidator, address borrower, uint seizeTokens) external nonReentrant {
        seizeInternal(msg.sender, liquidator, borrower, seizeTokens);
    }

    /**
     * @notice Transfers collateral tokens (this market) to the liquidator.
     * @dev Called only during an in-kind liquidation, or by liquidateBorrow during the liquidation of another KToken.
     *  Its absolutely critical to use msg.sender as the seizer kToken and not a parameter.
     * @param seizerToken The contract seizing the collateral (i.e. borrowed kToken)
     * @param liquidator The account receiving seized collateral
     * @param borrower The account having collateral seized
     * @param seizeTokens The number of kTokens to seize
     */
    function seizeInternal(address seizerToken, address liquidator, address borrower, uint seizeTokens) internal {
        /* Fail if seize not allowed */
        (bool allowed, string memory reason) = controller.seizeAllowed(address(this), seizerToken, liquidator, borrower, seizeTokens);
        require(allowed, reason);

        /* Fail if borrower = liquidator */
        require(borrower != liquidator, INVALID_ACCOUNT_PAIR);

        /*
         * We calculate the new borrower and liquidator token balances, failing on underflow/overflow:
         *  borrowerTokensNew = accountTokens[borrower] - seizeTokens
         *  liquidatorTokensNew = accountTokens[liquidator] + seizeTokens
         */
        uint borrowerTokensNew = accountTokens[borrower].sub(seizeTokens, LIQUIDATE_SEIZE_BALANCE_DECREMENT_FAILED);

        uint liquidatorTokensNew = accountTokens[liquidator].add(seizeTokens, LIQUIDATE_SEIZE_BALANCE_INCREMENT_FAILED);

        /////////////////////////
        // EFFECTS & INTERACTIONS

        /* We write the previously calculated values into storage */
        accountTokens[borrower] = borrowerTokensNew;
        accountTokens[liquidator] = liquidatorTokensNew;

        /* Emit a Transfer event */
        emit Transfer(borrower, liquidator, seizeTokens);

        /* We call the defense hook */
        controller.seizeVerify(address(this), seizerToken, liquidator, borrower, seizeTokens);
    }


    /*** Admin Functions ***/

    /**
      * @notice Begins transfer of admin rights. The newPendingAdmin must call `_acceptAdmin` to finalize the transfer.
      * @dev Admin function to begin change of admin. The newPendingAdmin must call `_acceptAdmin` to finalize the transfer.
      * @param newPendingAdmin New pending admin.
      */
    function _setPendingAdmin(address payable newPendingAdmin) external onlyAdmin() {
        address oldPendingAdmin = pendingAdmin;
        pendingAdmin = newPendingAdmin;
        emit NewPendingAdmin(oldPendingAdmin, newPendingAdmin);
    }

    /**
      * @notice Accepts transfer of admin rights. msg.sender must be pendingAdmin
      * @dev Admin function for pending admin to accept role and update admin
      */
    function _acceptAdmin() external {
        // Check caller is pendingAdmin and pendingAdmin ≠ address(0)
        require(msg.sender == pendingAdmin && msg.sender != address(0), "unauthorized");

        // Save current values for inclusion in log
        address oldAdmin = admin;
        address oldPendingAdmin = pendingAdmin;

        // Store admin with value pendingAdmin
        admin = pendingAdmin;

        // Clear the pending value
        pendingAdmin = address(0);

        emit NewAdmin(oldAdmin, admin);
        emit NewPendingAdmin(oldPendingAdmin, pendingAdmin);
    }

    /**
      * @notice Sets a new controller for the market
      * @dev Admin function to set a new controller
      */
    function _setController(KineControllerInterface newController) public onlyAdmin() {
        KineControllerInterface oldController = controller;
        // Ensure invoke controller.isController() returns true
        require(newController.isController(), "marker method returned false");

        // Set market's controller to newController
        controller = newController;

        // Emit NewController(oldController, newController)
        emit NewController(oldController, newController);
    }

    /**
     * @notice Gets balance of this contract in terms of the underlying
     * @dev This excludes the value of the current message, if any
     * @return The quantity of underlying owned by this contract
     */
    function getCashPrior() internal view returns (uint);

    /**
     * @dev Performs a transfer in, reverting upon failure. Returns the amount actually transferred to the protocol, in case of a fee.
     *  This may revert due to insufficient balance or insufficient allowance.
     */
    function doTransferIn(address from, uint amount) internal returns (uint);

    /**
     * @dev Performs a transfer out, ideally returning an explanatory error code upon failure tather than reverting.
     *  If caller has not called checked protocol's balance, may revert due to insufficient cash held in the contract.
     *  If caller has checked protocol's balance, and verified it is >= amount, this should not revert in normal conditions.
     */
    function doTransferOut(address payable to, uint amount) internal;


    /*** Reentrancy Guard ***/

    /**
     * @dev Prevents a contract from calling itself, directly or indirectly.
     */
    modifier nonReentrant() {
        require(_notEntered, "re-entered");
        _notEntered = false;
        _;
        _notEntered = true;
        // get a gas-refund post-Istanbul
    }
}

File 7 of 9 : KTokenInterfaces.sol
pragma solidity ^0.5.16;

import "./KineControllerInterface.sol";

contract KTokenStorage {
    /**
     * @dev Guard variable for re-entrancy checks
     */
    bool internal _notEntered;

    /**
    * @notice flag that kToken has been initialized;
    */
    bool public initialized;

    /**
     * @notice EIP-20 token name for this token
     */
    string public name;

    /**
     * @notice EIP-20 token symbol for this token
     */
    string public symbol;

    /**
     * @notice EIP-20 token decimals for this token
     */
    uint8 public decimals;

    /**
     * @notice Administrator for this contract
     */
    address payable public admin;

    /**
     * @notice Pending administrator for this contract
     */
    address payable public pendingAdmin;

    /**
     * @notice Contract which oversees inter-kToken operations
     */
    KineControllerInterface public controller;

    /**
     * @notice Total number of tokens in circulation
     */
    uint public totalSupply;

    /**
     * @notice Official record of token balances for each account
     */
    mapping (address => uint) internal accountTokens;

    /**
     * @notice Approved token transfer amounts on behalf of others
     */
    mapping (address => mapping (address => uint)) internal transferAllowances;

}

contract KTokenInterface is KTokenStorage {
    /**
     * @notice Indicator that this is a KToken contract (for inspection)
     */
    bool public constant isKToken = true;


    /*** Market Events ***/

    /**
     * @notice Event emitted when tokens are minted
     */
    event Mint(address minter, uint mintAmount, uint mintTokens);

    /**
     * @notice Event emitted when tokens are redeemed
     */
    event Redeem(address redeemer, uint redeemTokens);


    /*** Admin Events ***/

    /**
     * @notice Event emitted when pendingAdmin is changed
     */
    event NewPendingAdmin(address oldPendingAdmin, address newPendingAdmin);

    /**
     * @notice Event emitted when pendingAdmin is accepted, which means admin is updated
     */
    event NewAdmin(address oldAdmin, address newAdmin);

    /**
     * @notice Event emitted when controller is changed
     */
    event NewController(KineControllerInterface oldController, KineControllerInterface newController);

    /**
     * @notice EIP20 Transfer event
     */
    event Transfer(address indexed from, address indexed to, uint amount);

    /**
     * @notice EIP20 Approval event
     */
    event Approval(address indexed owner, address indexed spender, uint amount);


    /*** User Interface ***/

    function transfer(address dst, uint amount) external returns (bool);
    function transferFrom(address src, address dst, uint amount) external returns (bool);
    function approve(address spender, uint amount) external returns (bool);
    function allowance(address owner, address spender) external view returns (uint);
    function balanceOf(address owner) external view returns (uint);
    function getAccountSnapshot(address account) external view returns (uint, uint);
    function getCash() external view returns (uint);
    function seize(address liquidator, address borrower, uint seizeTokens) external;


    /*** Admin Functions ***/

    function _setPendingAdmin(address payable newPendingAdmin) external;
    function _acceptAdmin() external;
    function _setController(KineControllerInterface newController) public;
}

contract KErc20Storage {
    /**
     * @notice Underlying asset for this KToken
     */
    address public underlying;
}

contract KErc20Interface is KErc20Storage {

    /*** User Interface ***/

    function mint(uint mintAmount) external returns (uint);
    function redeem(uint redeemTokens) external;

}

contract KDelegationStorage {
    /**
     * @notice Implementation address for this contract
     */
    address public implementation;
}

contract KDelegatorInterface is KDelegationStorage {
    /**
     * @notice Emitted when implementation is changed
     */
    event NewImplementation(address oldImplementation, address newImplementation);

    /**
     * @notice Called by the admin to update the implementation of the delegator
     * @param implementation_ The address of the new implementation for delegation
     * @param allowResign Flag to indicate whether to call _resignImplementation on the old implementation
     * @param becomeImplementationData The encoded bytes data to be passed to _becomeImplementation
     */
    function _setImplementation(address implementation_, bool allowResign, bytes memory becomeImplementationData) public;
}

contract KDelegateInterface is KDelegationStorage {
    /**
     * @notice Called by the delegator on a delegate to initialize it for duty
     * @dev Should revert if any issues arise which make it unfit for delegation
     * @param data The encoded bytes data for any initialization
     */
    function _becomeImplementation(bytes memory data) public;

    /**
     * @notice Called by the delegator on a delegate to forfeit its responsibility
     */
    function _resignImplementation() public;
}

File 8 of 9 : KineControllerInterface.sol
pragma solidity ^0.5.16;

/**
Copyright 2020 Compound Labs, Inc.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

/**
* Original work from Compound: https://github.com/compound-finance/compound-protocol/blob/master/contracts/ComptrollerInterface.sol
* Modified to work in the Kine system.
* Main modifications:
*   1. removed Comp token related logics.
*   2. removed interest rate model related logics.
*   3. removed error code propagation mechanism to fail fast and loudly
*/

contract KineControllerInterface {
    /// @notice Indicator that this is a Controller contract (for inspection)
    bool public constant isController = true;

    /// @notice oracle getter function
    function getOracle() external view returns (address);

    /*** Assets You Are In ***/

    function enterMarkets(address[] calldata kTokens) external;

    function exitMarket(address kToken) external;

    /*** Policy Hooks ***/

    function mintAllowed(address kToken, address minter, uint mintAmount) external returns (bool, string memory);

    function mintVerify(address kToken, address minter, uint mintAmount, uint mintTokens) external;

    function redeemAllowed(address kToken, address redeemer, uint redeemTokens) external returns (bool, string memory);

    function redeemVerify(address kToken, address redeemer, uint redeemTokens) external;

    function borrowAllowed(address kToken, address borrower, uint borrowAmount) external returns (bool, string memory);

    function borrowVerify(address kToken, address borrower, uint borrowAmount) external;

    function repayBorrowAllowed(
        address kToken,
        address payer,
        address borrower,
        uint repayAmount) external returns (bool, string memory);

    function repayBorrowVerify(
        address kToken,
        address payer,
        address borrower,
        uint repayAmount) external;

    function liquidateBorrowAllowed(
        address kTokenBorrowed,
        address kTokenCollateral,
        address liquidator,
        address borrower,
        uint repayAmount) external returns (bool, string memory);

    function liquidateBorrowVerify(
        address kTokenBorrowed,
        address kTokenCollateral,
        address liquidator,
        address borrower,
        uint repayAmount,
        uint seizeTokens) external;

    function seizeAllowed(
        address kTokenCollateral,
        address kTokenBorrowed,
        address liquidator,
        address borrower,
        uint seizeTokens) external returns (bool, string memory);

    function seizeVerify(
        address kTokenCollateral,
        address kTokenBorrowed,
        address liquidator,
        address borrower,
        uint seizeTokens) external;

    function transferAllowed(address kToken, address src, address dst, uint transferTokens) external returns (bool, string memory);

    function transferVerify(address kToken, address src, address dst, uint transferTokens) external;

    /*** Liquidity/Liquidation Calculations ***/

    function liquidateCalculateSeizeTokens(
        address target,
        address kTokenBorrowed,
        address kTokenCollateral,
        uint repayAmount) external view returns (uint);
}

File 9 of 9 : KineSafeMath.sol
pragma solidity ^0.5.0;

/**
 * @dev Wrappers over Solidity's arithmetic operations with added overflow
 * checks.
 *
 * Arithmetic operations in Solidity wrap on overflow. This can easily result
 * in bugs, because programmers usually assume that an overflow raises an
 * error, which is the standard behavior in high level programming languages.
 * `SafeMath` restores this intuition by reverting the transaction when an
 * operation overflows.
 *
 * Using this library instead of the unchecked operations eliminates an entire
 * class of bugs, so it's recommended to use it always.
 */

/**
 * Original work from OpenZeppelin: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v2.5.0/contracts/math/SafeMath.sol
 * changes we made:
 * 1. add two methods that take errorMessage as input parameter
 */

library KineSafeMath {
    /**
     * @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 on
     * overflow.
     *
     * Counterpart to Solidity's `+` operator.
     *
     * Requirements:
     * - Addition cannot overflow.
     * added by Kine
     */
    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
     * overflow (when the result is negative).
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     * - Subtraction cannot overflow.
     */
    function sub(uint256 a, uint256 b) internal pure returns (uint256) {
        return sub(a, b, "SafeMath: subtraction overflow");
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting with custom message on
     * overflow (when the result is negative).
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     * - Subtraction cannot overflow.
     *
     * _Available since v2.4.0._
     */
    function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b <= a, errorMessage);
        uint256 c = a - b;

        return c;
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `*` operator.
     *
     * Requirements:
     * - Multiplication cannot overflow.
     */
    function mul(uint256 a, uint256 b) internal pure returns (uint256) {
        // Gas optimization: this is cheaper than requiring 'a' not being zero, but the
        // benefit is lost if 'b' is also tested.
        // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
        if (a == 0) {
            return 0;
        }

        uint256 c = a * b;
        require(c / a == b, "SafeMath: multiplication overflow");

        return c;
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `*` operator.
     *
     * Requirements:
     * - Multiplication cannot overflow.
     * added by Kine
     */
    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.
     *
     * _Available since v2.4.0._
     */
    function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        // Solidity only automatically asserts when dividing by 0
        require(b > 0, errorMessage);
        uint256 c = a / b;
        // assert(a == b * c + a % b); // There is no case in which this doesn't hold

        return c;
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * Reverts when dividing by zero.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     * - The divisor cannot be zero.
     */
    function mod(uint256 a, uint256 b) internal pure returns (uint256) {
        return mod(a, b, "SafeMath: modulo by zero");
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * Reverts with custom message when dividing by zero.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     * - The divisor cannot be zero.
     *
     * _Available since v2.4.0._
     */
    function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b != 0, errorMessage);
        return a % b;
    }
}

Settings
{
  "remappings": [],
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "evmVersion": "istanbul",
  "libraries": {},
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "abi"
      ]
    }
  }
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"contract KineControllerInterface","name":"controller_","type":"address"},{"internalType":"string","name":"name_","type":"string"},{"internalType":"string","name":"symbol_","type":"string"},{"internalType":"uint8","name":"decimals_","type":"uint8"},{"internalType":"address payable","name":"admin_","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"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":"address","name":"oldAdmin","type":"address"},{"indexed":false,"internalType":"address","name":"newAdmin","type":"address"}],"name":"NewAdmin","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"contract KineControllerInterface","name":"oldController","type":"address"},{"indexed":false,"internalType":"contract KineControllerInterface","name":"newController","type":"address"}],"name":"NewController","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"oldPendingAdmin","type":"address"},{"indexed":false,"internalType":"address","name":"newPendingAdmin","type":"address"}],"name":"NewPendingAdmin","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"redeemer","type":"address"},{"indexed":false,"internalType":"uint256","name":"redeemTokens","type":"uint256"}],"name":"Redeem","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":"amount","type":"uint256"}],"name":"Transfer","type":"event"},{"payable":true,"stateMutability":"payable","type":"fallback"},{"constant":false,"inputs":[],"name":"_acceptAdmin","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"contract KineControllerInterface","name":"newController","type":"address"}],"name":"_setController","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address payable","name":"newPendingAdmin","type":"address"}],"name":"_setPendingAdmin","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"admin","outputs":[{"internalType":"address payable","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","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":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"controller","outputs":[{"internalType":"contract KineControllerInterface","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":true,"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"getAccountSnapshot","outputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getCash","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"contract KineControllerInterface","name":"controller_","type":"address"},{"internalType":"string","name":"name_","type":"string"},{"internalType":"string","name":"symbol_","type":"string"},{"internalType":"uint8","name":"decimals_","type":"uint8"}],"name":"initialize","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"initialized","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"isKToken","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"mint","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":true,"stateMutability":"payable","type":"function"},{"constant":true,"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"pendingAdmin","outputs":[{"internalType":"address payable","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"redeemTokens","type":"uint256"}],"name":"redeem","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"liquidator","type":"address"},{"internalType":"address","name":"borrower","type":"address"},{"internalType":"uint256","name":"seizeTokens","type":"uint256"}],"name":"seize","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":true,"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"dst","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"src","type":"address"},{"internalType":"address","name":"dst","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"}]

60806040523480156200001157600080fd5b506040516200294e3803806200294e833981810160405260a08110156200003757600080fd5b8151602083018051604051929492938301929190846401000000008211156200005f57600080fd5b9083019060208201858111156200007557600080fd5b82516401000000008111828201881017156200009057600080fd5b82525081516020918201929091019080838360005b83811015620000bf578181015183820152602001620000a5565b50505050905090810190601f168015620000ed5780820380516001836020036101000a031916815260200191505b50604052602001805160405193929190846401000000008211156200011157600080fd5b9083019060208201858111156200012757600080fd5b82516401000000008111828201881017156200014257600080fd5b82525081516020918201929091019080838360005b838110156200017157818101518382015260200162000157565b50505050905090810190601f1680156200019f5780820380516001836020036101000a031916815260200191505b506040908152602082015191015160038054610100600160a81b03191633610100021790556000805461ff00191690559092509050620001e28585858562000213565b600380546001600160a01b0390921661010002610100600160a81b0319909216919091179055506200053792505050565b60035461010090046001600160a01b03163314620002635760405162461bcd60e51b8152600401808060200182810382526024815260200180620029076024913960400191505060405180910390fd5b600054610100900460ff1615620002ac5760405162461bcd60e51b81526004018080602001828103825260238152602001806200292b6023913960400191505060405180910390fd5b620002c0846001600160e01b036200031a16565b8251620002d590600190602086019062000492565b508151620002eb90600290602085019062000492565b506003805460ff90921660ff199283161790556000805461ff0019921660011791909116610100179055505050565b60035461010090046001600160a01b031633146200036a5760405162461bcd60e51b8152600401808060200182810382526021815260200180620028e66021913960400191505060405180910390fd5b60055460408051634e1647fb60e01b815290516001600160a01b0392831692841691634e1647fb916004808301926020929190829003018186803b158015620003b257600080fd5b505afa158015620003c7573d6000803e3d6000fd5b505050506040513d6020811015620003de57600080fd5b505162000432576040805162461bcd60e51b815260206004820152601c60248201527f6d61726b6572206d6574686f642072657475726e65642066616c736500000000604482015290519081900360640190fd5b600580546001600160a01b0319166001600160a01b03848116918217909255604080519284168352602083019190915280517ff9b6a28700579d5c8fab50f0ac2dcaa52109b85c369c4f511fcc873330ab6cbb9281900390910190a15050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10620004d557805160ff191683800117855562000505565b8280016001018555821562000505579182015b8281111562000505578251825591602001919060010190620004e8565b506200051392915062000517565b5090565b6200053491905b808211156200051357600081556001016200051e565b90565b61239f80620005476000396000f3fe6080604052600436106101405760003560e01c806383de424e116100b6578063db006a751161006f578063db006a75146104a8578063dd62ed3e146104d2578063e9c714f21461050d578063f6d2ee8614610522578063f77c47911461066d578063f851a4401461068257610140565b806383de424e1461036357806395d89b4114610398578063a9059cbb146103ad578063b2a02ff1146103e6578063b71d1a0c14610429578063c37f68e21461045c57610140565b806323b872dd1161010857806323b872dd1461026757806326782247146102aa57806329d9109c146102db578063313ce567146102f05780633b1d21a21461031b57806370a082311461033057610140565b806306fdde031461014c578063095ea7b3146101d65780631249c58b14610223578063158ef93e1461023d57806318160ddd14610252575b61014934610697565b50005b34801561015857600080fd5b50610161610704565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561019b578181015183820152602001610183565b50505050905090810190601f1680156101c85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101e257600080fd5b5061020f600480360360408110156101f957600080fd5b506001600160a01b038135169060200135610791565b604080519115158252519081900360200190f35b61022b6107fc565b60408051918252519081900360200190f35b34801561024957600080fd5b5061020f61080d565b34801561025e57600080fd5b5061022b61081b565b34801561027357600080fd5b5061020f6004803603606081101561028a57600080fd5b506001600160a01b03813581169160208101359091169060400135610821565b3480156102b657600080fd5b506102bf610893565b604080516001600160a01b039092168252519081900360200190f35b3480156102e757600080fd5b5061020f6108a2565b3480156102fc57600080fd5b506103056108a7565b6040805160ff9092168252519081900360200190f35b34801561032757600080fd5b5061022b6108b0565b34801561033c57600080fd5b5061022b6004803603602081101561035357600080fd5b50356001600160a01b03166108ba565b34801561036f57600080fd5b506103966004803603602081101561038657600080fd5b50356001600160a01b03166108d5565b005b3480156103a457600080fd5b50610161610a47565b3480156103b957600080fd5b5061020f600480360360408110156103d057600080fd5b506001600160a01b038135169060200135610a9f565b3480156103f257600080fd5b506103966004803603606081101561040957600080fd5b506001600160a01b03813581169160208101359091169060400135610b10565b34801561043557600080fd5b506103966004803603602081101561044c57600080fd5b50356001600160a01b0316610b7c565b34801561046857600080fd5b5061048f6004803603602081101561047f57600080fd5b50356001600160a01b0316610c2d565b6040805192835260208301919091528051918290030190f35b3480156104b457600080fd5b50610396600480360360208110156104cb57600080fd5b5035610c48565b3480156104de57600080fd5b5061022b600480360360408110156104f557600080fd5b506001600160a01b0381358116916020013516610c54565b34801561051957600080fd5b50610396610c7f565b34801561052e57600080fd5b506103966004803603608081101561054557600080fd5b6001600160a01b038235169190810190604081016020820135600160201b81111561056f57600080fd5b82018360208201111561058157600080fd5b803590602001918460018302840111600160201b831117156105a257600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295949360208101935035915050600160201b8111156105f457600080fd5b82018360208201111561060657600080fd5b803590602001918460018302840111600160201b8311171561062757600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295505050903560ff169150610da39050565b34801561067957600080fd5b506102bf610e97565b34801561068e57600080fd5b506102bf610ea6565b6000805460ff166106dc576040805162461bcd60e51b815260206004820152600a6024820152691c994b595b9d195c995960b21b604482015290519081900360640190fd5b6000805460ff191690556106f03383610eba565b90506000805460ff19166001179055919050565b60018054604080516020600284861615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156107895780601f1061075e57610100808354040283529160200191610789565b820191906000526020600020905b81548152906001019060200180831161076c57829003601f168201915b505050505081565b3360008181526008602090815260408083206001600160a01b03871680855290835281842086905581518681529151939493909284927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a35060019392505050565b600061080734610697565b90505b90565b600054610100900460ff1681565b60065481565b6000805460ff16610866576040805162461bcd60e51b815260206004820152600a6024820152691c994b595b9d195c995960b21b604482015290519081900360640190fd5b6000805460ff1916905561087c33858585611263565b5060016000805460ff191660011790559392505050565b6004546001600160a01b031681565b600181565b60035460ff1681565b60006108076116ea565b6001600160a01b031660009081526007602052604090205490565b60035461010090046001600160a01b031633146109235760405162461bcd60e51b81526004018080602001828103825260218152602001806121e96021913960400191505060405180910390fd5b60055460408051634e1647fb60e01b815290516001600160a01b0392831692841691634e1647fb916004808301926020929190829003018186803b15801561096a57600080fd5b505afa15801561097e573d6000803e3d6000fd5b505050506040513d602081101561099457600080fd5b50516109e7576040805162461bcd60e51b815260206004820152601c60248201527f6d61726b6572206d6574686f642072657475726e65642066616c736500000000604482015290519081900360640190fd5b600580546001600160a01b0319166001600160a01b03848116918217909255604080519284168352602083019190915280517ff9b6a28700579d5c8fab50f0ac2dcaa52109b85c369c4f511fcc873330ab6cbb9281900390910190a15050565b6002805460408051602060018416156101000260001901909316849004601f810184900484028201840190925281815292918301828280156107895780601f1061075e57610100808354040283529160200191610789565b6000805460ff16610ae4576040805162461bcd60e51b815260206004820152600a6024820152691c994b595b9d195c995960b21b604482015290519081900360640190fd5b6000805460ff19169055610afa33808585611263565b5060016000805460ff1916600117905592915050565b60005460ff16610b54576040805162461bcd60e51b815260206004820152600a6024820152691c994b595b9d195c995960b21b604482015290519081900360640190fd5b6000805460ff19169055610b6a33848484611703565b50506000805460ff1916600117905550565b60035461010090046001600160a01b03163314610bca5760405162461bcd60e51b81526004018080602001828103825260218152602001806121e96021913960400191505060405180910390fd5b600480546001600160a01b038381166001600160a01b0319831681179093556040805191909216808252602082019390935281517fca4f2f25d0898edd99413412fb94012f9e54ec8142f9b093e7720646a95b16a9929181900390910190a15050565b6001600160a01b031660009081526007602052604081205491565b610c5181611ab1565b50565b6001600160a01b03918216600090815260086020908152604080832093909416825291909152205490565b6004546001600160a01b031633148015610c9857503315155b610cd8576040805162461bcd60e51b815260206004820152600c60248201526b1d5b985d5d1a1bdc9a5e995960a21b604482015290519081900360640190fd5b60038054600480546001600160a01b03818116610100818102610100600160a81b0319871617968790556001600160a01b031990931690935560408051948390048216808652929095041660208401528351909391927ff9ffabca9c8276e99321725bcb43fb076a6c66a54b7f21c4e8146d8519b417dc92908290030190a1600454604080516001600160a01b038085168252909216602083015280517fca4f2f25d0898edd99413412fb94012f9e54ec8142f9b093e7720646a95b16a99281900390910190a15050565b60035461010090046001600160a01b03163314610df15760405162461bcd60e51b815260040180806020018281038252602481526020018061220a6024913960400191505060405180910390fd5b600054610100900460ff1615610e385760405162461bcd60e51b815260040180806020018281038252602381526020018061222e6023913960400191505060405180910390fd5b610e41846108d5565b8251610e5490600190602086019061210e565b508151610e6890600290602085019061210e565b506003805460ff90921660ff199283161790556000805461ff0019921660011791909116610100179055505050565b6005546001600160a01b031681565b60035461010090046001600160a01b031681565b60055460408051634ef4c3e160e01b81523060048201526001600160a01b0385811660248301526044820185905291516000938493606093911691634ef4c3e191606480820192879290919082900301818387803b158015610f1b57600080fd5b505af1158015610f2f573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040908152811015610f5857600080fd5b815160208301805160405192949293830192919084600160201b821115610f7e57600080fd5b908301906020820185811115610f9357600080fd5b8251600160201b811182820188101715610fac57600080fd5b82525081516020918201929091019080838360005b83811015610fd9578181015183820152602001610fc1565b50505050905090810190601f1680156110065780820380516001836020036101000a031916815260200191505b506040525050509150915081819061109c5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611061578181015183820152602001611049565b50505050905090810190601f16801561108e5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506110a561218c565b6110af8686611b19565b606080830182905281835260408051918201905260288082526110e69291906122f36020830139600654919063ffffffff611bb516565b81602001818152505061113681600001516040518060600160405280602b81526020016122a8602b91396001600160a01b038916600090815260076020526040902054919063ffffffff611bb516565b60408083018290526020808401516006556001600160a01b0389166000818152600783528390209390935560608085015185518451958652928501528383019190915290517f4c209b5fc8ad50758f13e2e1088ba56a560dff690a1c6fef26394f4c03821c4f9281900390910190a1805160408051918252516001600160a01b0388169130916000805160206122d38339815191529181900360200190a360055460608201518251604080516341c728b960e01b81523060048201526001600160a01b038b81166024830152604482019490945260648101929092525191909216916341c728b991608480830192600092919082900301818387803b15801561123e57600080fd5b505af1158015611252573d6000803e3d6000fd5b505050506060015195945050505050565b600554604080516317b9b84b60e31b81523060048201526001600160a01b0386811660248301528581166044830152606482018590529151600093606093169163bdcdc258916084808301928792919082900301818387803b1580156112c857600080fd5b505af11580156112dc573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604090815281101561130557600080fd5b815160208301805160405192949293830192919084600160201b82111561132b57600080fd5b90830190602082018581111561134057600080fd5b8251600160201b81118282018810171561135957600080fd5b82525081516020918201929091019080838360005b8381101561138657818101518382015260200161136e565b50505050905090810190601f1680156113b35780820380516001836020036101000a031916815260200191505b506040525050509150915081819061140c5760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315611061578181015183820152602001611049565b50836001600160a01b0316856001600160a01b031614156040518060400160405280600981526020016810905117d25394155560ba1b815250906114915760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315611061578181015183820152602001611049565b5060006001600160a01b0387811690871614156114b157506000196114d9565b506001600160a01b038086166000908152600860209081526040808320938a16835292905220545b600061151c85604051806040016040528060148152602001731514905394d1915497d393d517d0531313d5d15160621b81525084611c139092919063ffffffff16565b60408051808201825260138152720a8a4829ca68c8aa4be9c9ea8be8a9c9eaa8e9606b1b6020808301919091526001600160a01b038b166000908152600790915291822054929350909161157791889063ffffffff611c1316565b60408051808201825260118152700a8a4829ca68c8aa4bea89e9ebe9aaa869607b1b6020808301919091526001600160a01b038b16600090815260079091529182205492935090916115d091899063ffffffff611bb516565b6001600160a01b03808b16600090815260076020526040808220869055918b168152208190559050600019841461162a576001600160a01b03808a166000908152600860209081526040808320938e168352929052208390555b876001600160a01b0316896001600160a01b03166000805160206122d3833981519152896040518082815260200191505060405180910390a36005546040805163352b4a3f60e11b81523060048201526001600160a01b038c811660248301528b81166044830152606482018b905291519190921691636a56947e91608480830192600092919082900301818387803b1580156116c657600080fd5b505af11580156116da573d6000803e3d6000fd5b5050505050505050505050505050565b6000806116fd473463ffffffff611c6d16565b91505090565b6005546040805163d02f735160e01b81523060048201526001600160a01b03878116602483015286811660448301528581166064830152608482018590529151600093606093169163d02f73519160a4808301928792919082900301818387803b15801561177057600080fd5b505af1158015611784573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160409081528110156117ad57600080fd5b815160208301805160405192949293830192919084600160201b8211156117d357600080fd5b9083019060208201858111156117e857600080fd5b8251600160201b81118282018810171561180157600080fd5b82525081516020918201929091019080838360005b8381101561182e578181015183820152602001611816565b50505050905090810190601f16801561185b5780820380516001836020036101000a031916815260200191505b50604052505050915091508181906118b45760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315611061578181015183820152602001611049565b50846001600160a01b0316846001600160a01b031614156040518060400160405280601481526020017324a72b20a624a22fa0a1a1a7aaa72a2fa820a4a960611b815250906119445760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315611061578181015183820152602001611049565b50600061198a8460405180606001604052806028815260200161231b602891396001600160a01b038816600090815260076020526040902054919063ffffffff611c1316565b905060006119d185604051806060016040528060288152602001612343602891396001600160a01b038a16600090815260076020526040902054919063ffffffff611bb516565b6001600160a01b038088166000818152600760209081526040808320889055938c168083529184902085905583518a81529351949550909391926000805160206122d3833981519152929081900390910190a360055460408051636d35bf9160e01b81523060048201526001600160a01b038b811660248301528a8116604483015289811660648301526084820189905291519190921691636d35bf919160a480830192600092919082900301818387803b158015611a8f57600080fd5b505af1158015611aa3573d6000803e3d6000fd5b505050505050505050505050565b60005460ff16611af5576040805162461bcd60e51b815260206004820152600a6024820152691c994b595b9d195c995960b21b604482015290519081900360640190fd5b6000805460ff19169055611b093382611cb6565b506000805460ff19166001179055565b6000336001600160a01b03841614611b6a576040805162461bcd60e51b815260206004820152600f60248201526e0e6cadcc8cae440dad2e6dac2e8c6d608b1b604482015290519081900360640190fd5b813414611baf576040805162461bcd60e51b815260206004820152600e60248201526d0ecc2d8eaca40dad2e6dac2e8c6d60931b604482015290519081900360640190fd5b50919050565b60008383018285821015611c0a5760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315611061578181015183820152602001611049565b50949350505050565b60008184841115611c655760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315611061578181015183820152602001611049565b505050900390565b6000611caf83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c13565b9392505050565b80611d08576040805162461bcd60e51b815260206004820152601f60248201527f72656465656d546f6b656e73496e206d757374206e6f74206265207a65726f00604482015290519081900360640190fd5b611d106121b4565b6005546040805163eabe7d9160e01b81523060048201526001600160a01b038681166024830152604482018690529151600093606093169163eabe7d91916064808301928792919082900301818387803b158015611d6d57600080fd5b505af1158015611d81573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040908152811015611daa57600080fd5b815160208301805160405192949293830192919084600160201b821115611dd057600080fd5b908301906020820185811115611de557600080fd5b8251600160201b811182820188101715611dfe57600080fd5b82525081516020918201929091019080838360005b83811015611e2b578181015183820152602001611e13565b50505050905090810190601f168015611e585780820380516001836020036101000a031916815260200191505b5060405250505091509150818190611eb15760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315611061578181015183820152602001611049565b50611edf846040518060600160405280602a815260200161227e602a9139600654919063ffffffff611c1316565b83526040805160608101909152602d808252611f2591869161225160208301396001600160a01b038816600090815260076020526040902054919063ffffffff611c1316565b602084015283611f336116ea565b10156040518060400160405280601781526020017f544f4b454e5f494e53554646494349454e545f4341534800000000000000000081525090611fb75760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315611061578181015183820152602001611049565b5082516006556020808401516001600160a01b03871660009081526007909252604090912055611fe785856120d3565b60408051858152905130916001600160a01b038816916000805160206122d38339815191529181900360200190a3604080516001600160a01b03871681526020810186905281517f222838db2794d11532d940e8dec38ae307ed0b63cd97c233322e221f998767a6929181900390910190a160055460408051630d91761360e31b81523060048201526001600160a01b0388811660248301526044820188905291519190921691636c8bb09891606480830192600092919082900301818387803b1580156120b457600080fd5b505af11580156120c8573d6000803e3d6000fd5b505050505050505050565b6040516001600160a01b0383169082156108fc029083906000818181858888f19350505050158015612109573d6000803e3d6000fd5b505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061214f57805160ff191683800117855561217c565b8280016001018555821561217c579182015b8281111561217c578251825591602001919060010190612161565b506121889291506121ce565b5090565b6040518060800160405280600081526020016000815260200160008152602001600081525090565b604051806040016040528060008152602001600081525090565b61080a91905b8082111561218857600081556001016121d456fe6f6e6c792061646d696e2063616e2063616c6c20746869732066756e6374696f6e6f6e6c792061646d696e206d617920696e697469616c697a6520746865206d61726b65746d61726b6574206d6179206f6e6c7920626520696e697469616c697a6564206f6e636552454445454d5f4e45575f4143434f554e545f42414c414e43455f43414c43554c4154494f4e5f4641494c454452454445454d5f4e45575f544f54414c5f535550504c595f43414c43554c4154494f4e5f4641494c45444d494e545f4e45575f4143434f554e545f42414c414e43455f43414c43554c4154494f4e5f4641494c4544ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef4d494e545f4e45575f544f54414c5f535550504c595f43414c43554c4154494f4e5f4641494c45444c49515549444154455f5345495a455f42414c414e43455f44454352454d454e545f4641494c45444c49515549444154455f5345495a455f42414c414e43455f494e4352454d454e545f4641494c4544a265627a7a72315820a7fae6d18d78a0ae31b8adc6e39eb7bf1582c22a9f02d0ba233421aaf3d4521e64736f6c634300051000326f6e6c792061646d696e2063616e2063616c6c20746869732066756e6374696f6e6f6e6c792061646d696e206d617920696e697469616c697a6520746865206d61726b65746d61726b6574206d6179206f6e6c7920626520696e697469616c697a6564206f6e63650000000000000000000000003c2ddd486c07343b711a4415cdc9ab90ed32b57100000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000000800000000000000000000000017d04113a3651e79e7d40a40e47aae23046f776100000000000000000000000000000000000000000000000000000000000000124b6f6c6c61746572616c697a656420424e42000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000046b424e4200000000000000000000000000000000000000000000000000000000

Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)

0000000000000000000000003c2ddd486c07343b711a4415cdc9ab90ed32b57100000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000000800000000000000000000000017d04113a3651e79e7d40a40e47aae23046f776100000000000000000000000000000000000000000000000000000000000000124b6f6c6c61746572616c697a656420424e42000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000046b424e4200000000000000000000000000000000000000000000000000000000

-----Decoded View---------------
Arg [0] : controller_ (address): 0x3c2ddd486c07343b711a4415cdc9ab90ed32b571
Arg [1] : name_ (string): Kollateralized BNB
Arg [2] : symbol_ (string): kBNB
Arg [3] : decimals_ (uint8): 8
Arg [4] : admin_ (address): 0x17d04113a3651e79e7d40a40e47aae23046f7761

-----Encoded View---------------
9 Constructor Arguments found :
Arg [0] : 0000000000000000000000003c2ddd486c07343b711a4415cdc9ab90ed32b571
Arg [1] : 00000000000000000000000000000000000000000000000000000000000000a0
Arg [2] : 00000000000000000000000000000000000000000000000000000000000000e0
Arg [3] : 0000000000000000000000000000000000000000000000000000000000000008
Arg [4] : 00000000000000000000000017d04113a3651e79e7d40a40e47aae23046f7761
Arg [5] : 0000000000000000000000000000000000000000000000000000000000000012
Arg [6] : 4b6f6c6c61746572616c697a656420424e420000000000000000000000000000
Arg [7] : 0000000000000000000000000000000000000000000000000000000000000004
Arg [8] : 6b424e4200000000000000000000000000000000000000000000000000000000


Block Transaction Gas Used Reward
Age Block Fee Address BC Fee Address Voting Power Jailed Incoming
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.