Contract 0x0e633c2a342A41cE84c6D746c91f290A90955F8e

Contract Overview

Balance:
1,055.74 Ether
Txn Hash Method
Block
From
To
Value
0x3a12ad996900a6083613dc22fe1b592bbdbf88e133aff99aed9d37f3b0527f94Open Loan82255452021-03-13 6:18:4593 days 20 hrs ago0x0b03ea205d9bee6d8f7343a7f8ffe064b01e1737 IN  0x0e633c2a342a41ce84c6d746c91f290a90955f8e5 Ether0.028163928104
0x04dff2c12f63af6734fddcc614f2b1ca651b472965ede022669561d9add4fd5dOpen Loan82209582021-03-12 11:11:5294 days 15 hrs ago0x0e65811cb1fc31e6b9fce78f7dad7854a2ea2101 IN  0x0e633c2a342a41ce84c6d746c91f290a90955f8e10 Ether0.027893121103
0xbb8cb0546f462570b39b10a81336902ed4df091101f723edf9094bc295b811e2Open Loan79403882021-01-22 16:45:20143 days 10 hrs ago0xab96b1105a62448ffcdb4cc5641bfed88c722fa9 IN  0x0e633c2a342a41ce84c6d746c91f290a90955f8e0.1 Ether0.033850875125
0x0a70e986962edcf26a159c752efe29d6885529333fd468fab876640f2d5bf351Open Loan79378082021-01-22 6:00:16143 days 20 hrs ago0x7bcab7d3d15116d9f4079262be4780de73c7169f IN  0x0e633c2a342a41ce84c6d746c91f290a90955f8e1 Ether0.0189564970
0xc64a8b6cfede409a6ff8f68f32f75da527e0a072e6ae1f0107831638fa39ff62Open Loan79235312021-01-19 18:30:24146 days 8 hrs ago0xc3b02b0bdd01c8337c9caa4a33dc174b9ce90e9c IN  0x0e633c2a342a41ce84c6d746c91f290a90955f8e19 Ether0.01867391173
0x05f728e803cc0130f1c9d249a84c11120466f02826e682f6af192be11d57ee46Open Loan79233542021-01-19 17:46:09146 days 9 hrs ago0xc3b02b0bdd01c8337c9caa4a33dc174b9ce90e9c IN  0x0e633c2a342a41ce84c6d746c91f290a90955f8e9 Ether0.01878294678
0x5fbe870c385fbb7aeeed4a415dcead7246725e78c95e002eafff6f6f096b997dOpen Loan79231612021-01-19 16:57:52146 days 9 hrs ago0xc3b02b0bdd01c8337c9caa4a33dc174b9ce90e9c IN  0x0e633c2a342a41ce84c6d746c91f290a90955f8e5 Ether0.025043928104
0x15bfe00d1e8683eadb8e8fd4717e4a88a2173de3f1f222cecc53facd279f8435Open Loan79200442021-01-19 3:58:30146 days 22 hrs ago0xc3b02b0bdd01c8337c9caa4a33dc174b9ce90e9c IN  0x0e633c2a342a41ce84c6d746c91f290a90955f8e1 Ether0.01922729771
0xff5651e2c295c9f6ca89b56e28c51c0f413ffd6f92a1f39fc9356c4db2e843d6Set Resolver And...77662302020-12-22 21:23:16174 days 5 hrs ago0xb64ff7a4a33acdf48d97dab0d764afd0f6176882 IN  0x0e633c2a342a41ce84c6d746c91f290a90955f8e0 Ether0.0002636283
0xa468197243839b6ce757b94ac3b8c3b84f7c7bc3f0eb306e51324eefabf02578Open Loan76178832020-11-26 22:08:10200 days 4 hrs ago0xf75fc827a71bf5b1273d35c90629de4e173fb7ae IN  0x0e633c2a342a41ce84c6d746c91f290a90955f8e92 Ether0.0082560835
0xbb8dc4638a6c3bd2c43ee9e1f6397a95eaf3e4123aae2b127804ce5fbd02e30fSet Resolver And...75315342020-11-11 21:49:14215 days 4 hrs ago0xb64ff7a4a33acdf48d97dab0d764afd0f6176882 IN  0x0e633c2a342a41ce84c6d746c91f290a90955f8e0 Ether0.000417535
0x5c3c039aa0c3d7ceb1ce2e1fd3192514337e3bc18f99ce4ddd8ef05ad39fa091Open Loan75234572020-11-10 12:09:33216 days 14 hrs ago0x7999a633f5587abd3ae670a230445e282e336ac0 IN  0x0e633c2a342a41ce84c6d746c91f290a90955f8e4 Ether0.00662716224.4
0xbc6d481c5bf9c47050c53d8d1101a6f059082f79b1859c8ce066342bfdc3635fOpen Loan75184072020-11-09 15:06:48217 days 11 hrs ago0xf75fc827a71bf5b1273d35c90629de4e173fb7ae IN  0x0e633c2a342a41ce84c6d746c91f290a90955f8e350 Ether0.00487549519
0x96b7467dcb95dcc162c38df2b40ff5089cabfb4b6434ffbaa1b8a900ae5b1ae8Open Loan75134602020-11-08 18:29:53218 days 8 hrs ago0xf75fc827a71bf5b1273d35c90629de4e173fb7ae IN  0x0e633c2a342a41ce84c6d746c91f290a90955f8e239.84 Ether0.004711297519.5
0x2893d2603dfd0983c1a2dac55ceac07a25af3b4b1753c6891a3f9637414f5509Open Loan75129952020-11-08 16:33:38218 days 10 hrs ago0xf75fc827a71bf5b1273d35c90629de4e173fb7ae IN  0x0e633c2a342a41ce84c6d746c91f290a90955f8e250 Ether0.00787654529
0xe8a7db6c6b8040772cac3641f0bf723c1a77cbc388dae2ce60d4bab0d7abbbf5Open Loan74366822020-10-26 10:24:27231 days 16 hrs ago0x5a06274d387400602951bac70765d2646049b386 IN  0x0e633c2a342a41ce84c6d746c91f290a90955f8e0.8 Ether0.00950617535
0xa47bfd013dce53a2a5aa51cc0fdc1a9acc5e1557281ba13f3ead091c3ce98f94Open Loan73841962020-10-17 7:35:09240 days 19 hrs ago0x47b2812cc92981998c61e4cd63e4fd5a7c32e585 IN  0x0e633c2a342a41ce84c6d746c91f290a90955f8e3 Ether0.005097865521.1
0x40114210b367cbd443a08930f6f3c497a9989e9841efd97d6bcac3e1f84c16ecOpen Loan73841332020-10-17 7:19:24240 days 19 hrs ago0x47b2812cc92981998c61e4cd63e4fd5a7c32e585 IN  0x0e633c2a342a41ce84c6d746c91f290a90955f8e1 Ether0.005730865521.1
0xd42493bce29c6d467fd9dc568cf88acb67f8482f20b91d7f81a654c0065be317Open Loan73746622020-10-15 15:49:53242 days 10 hrs ago0xba2ef5189b762bd4c9e7f0b50fbbab65193935e8 IN  0x0e633c2a342a41ce84c6d746c91f290a90955f8e50 Ether0.00846796533
0x3cc0707395978f4ecc3a04731b53198cc047d3646e6c9ec70a5ff24405347ceeSet Min Loan Siz...73561272020-10-12 10:31:43245 days 16 hrs ago0xb64ff7a4a33acdf48d97dab0d764afd0f6176882 IN  0x0e633c2a342a41ce84c6d746c91f290a90955f8e0 Ether0.0001208455
0x1cd5e2bf77e5fa4c3dd2497247b4fa64a9bc4c43ca4751de239c391da2c13914Close Loan73561262020-10-12 10:31:28245 days 16 hrs ago0x3395285dcd2ec3c896905310c603374a80671ca3 IN  0x0e633c2a342a41ce84c6d746c91f290a90955f8e0 Ether0.001886515
0xf9ff2b5cc6a5d4d29890d80009004144557690c9c3cff8c967c21f84a99ee9d2Open Loan73561252020-10-12 10:31:13245 days 16 hrs ago0x3395285dcd2ec3c896905310c603374a80671ca3 IN  0x0e633c2a342a41ce84c6d746c91f290a90955f8e100 wei0.0012830255
0xd7b198339913496df304d2d08870725b6472c97e5de1c459ad211009cd983e51Set Min Loan Siz...73561242020-10-12 10:30:58245 days 16 hrs ago0xb64ff7a4a33acdf48d97dab0d764afd0f6176882 IN  0x0e633c2a342a41ce84c6d746c91f290a90955f8e0 Ether0.0001208455
0x4f6bc167efdcb6379c46e4ec6dcb9808777cb2f0c11ae048b4706e4209b51bf6Open Loan73345652020-10-08 16:36:05249 days 10 hrs ago0x435878b1935064e3a8c0002af28c69fd2af10bc8 IN  0x0e633c2a342a41ce84c6d746c91f290a90955f8e1 Ether0.0164291468
0x06e9510aaecb10b12193b3c7bb999fd07bed1ddf7a86d99c1116f47b9bddfa66Open Loan73345582020-10-08 16:34:20249 days 10 hrs ago0x435878b1935064e3a8c0002af28c69fd2af10bc8 IN  0x0e633c2a342a41ce84c6d746c91f290a90955f8e1 Ether0.0174491468
[ Download CSV Export 
Latest 25 internal transaction
Parent Txn Hash Block From To Value
0x2ed291fd17196a3322aa840ddaf6ddf14b3aa48587a2417416658bcf18003fa183155162021-03-28 21:16:4278 days 5 hrs ago 0x1a9f7ec8ba471809adf1ac44222d728e627cec6b 0x0e633c2a342a41ce84c6d746c91f290a90955f8e0 Ether
0xb4798372846ce126028b26d38d1e3366fa3f06c7c0280d156becb474f2a7759d82255822021-03-13 6:28:0093 days 20 hrs ago 0x1a9f7ec8ba471809adf1ac44222d728e627cec6b 0x0e633c2a342a41ce84c6d746c91f290a90955f8e0 Ether
0x545d14885c3d3fabfac0509d1a63b5797f3a6747c1da5681bbafeb19c14dbb8782255752021-03-13 6:26:1593 days 20 hrs ago 0x1a9f7ec8ba471809adf1ac44222d728e627cec6b 0x0e633c2a342a41ce84c6d746c91f290a90955f8e0 Ether
0x3a12ad996900a6083613dc22fe1b592bbdbf88e133aff99aed9d37f3b0527f9482255452021-03-13 6:18:4593 days 20 hrs ago 0x0e633c2a342a41ce84c6d746c91f290a90955f8e 0x3ffb97644a1c01e81635b7b30a051c5ffa390e1a0 Ether
0x3a12ad996900a6083613dc22fe1b592bbdbf88e133aff99aed9d37f3b0527f9482255452021-03-13 6:18:4593 days 20 hrs ago 0x0e633c2a342a41ce84c6d746c91f290a90955f8e 0x04ae13aa58b46e8193631e5fce9b36dae9cf3adc0 Ether
0x3a12ad996900a6083613dc22fe1b592bbdbf88e133aff99aed9d37f3b0527f9482255452021-03-13 6:18:4593 days 20 hrs ago 0x0e633c2a342a41ce84c6d746c91f290a90955f8e 0x8a8debdf5ca68d381de99244aaea8b906daf78a70 Ether
0x04dff2c12f63af6734fddcc614f2b1ca651b472965ede022669561d9add4fd5d82209582021-03-12 11:11:5294 days 15 hrs ago 0x0e633c2a342a41ce84c6d746c91f290a90955f8e 0x3ffb97644a1c01e81635b7b30a051c5ffa390e1a0 Ether
0x04dff2c12f63af6734fddcc614f2b1ca651b472965ede022669561d9add4fd5d82209582021-03-12 11:11:5294 days 15 hrs ago 0x0e633c2a342a41ce84c6d746c91f290a90955f8e 0x04ae13aa58b46e8193631e5fce9b36dae9cf3adc0 Ether
0x04dff2c12f63af6734fddcc614f2b1ca651b472965ede022669561d9add4fd5d82209582021-03-12 11:11:5294 days 15 hrs ago 0x0e633c2a342a41ce84c6d746c91f290a90955f8e 0x8a8debdf5ca68d381de99244aaea8b906daf78a70 Ether
0x808c142dbb2d03d742ebc7e17b47b0a75028c4a4c099f5d8e6b5443e4ab455da82092952021-03-10 10:34:0796 days 16 hrs ago 0x1a9f7ec8ba471809adf1ac44222d728e627cec6b 0x0e633c2a342a41ce84c6d746c91f290a90955f8e0 Ether
0x25865148dfeb859f3bfeb30f2c89ab958d851c47f6de95c9e517da8616f251f082092672021-03-10 10:27:0596 days 16 hrs ago 0x1a9f7ec8ba471809adf1ac44222d728e627cec6b 0x0e633c2a342a41ce84c6d746c91f290a90955f8e0 Ether
0x5b648037ae05cd716c537b61c0349ad6ce6b6c7703eaf2d8b5fa357ef565a76182092662021-03-10 10:26:5096 days 16 hrs ago 0x1a9f7ec8ba471809adf1ac44222d728e627cec6b 0x0e633c2a342a41ce84c6d746c91f290a90955f8e0 Ether
0x9263e1064555a094464679b7dca46d2ced69e12acab4c4a78b9ffa5d39bb458281003662021-02-19 11:33:55115 days 15 hrs ago 0x1a9f7ec8ba471809adf1ac44222d728e627cec6b 0x0e633c2a342a41ce84c6d746c91f290a90955f8e0 Ether
0x8f859a9d826ba71c66fda2e589397a6e6208add93a857f6a3ea11732247dc98e81002042021-02-19 10:53:23115 days 15 hrs ago 0x1a9f7ec8ba471809adf1ac44222d728e627cec6b 0x0e633c2a342a41ce84c6d746c91f290a90955f8e0 Ether
0x7abfc18064f5a1eecb085bfa7d9b3030698c105aa914aba9e66636b6586403fa80998982021-02-19 9:36:53115 days 17 hrs ago 0x1a9f7ec8ba471809adf1ac44222d728e627cec6b 0x0e633c2a342a41ce84c6d746c91f290a90955f8e0 Ether
0x2246100be9c7d76cbe080159ddf430fc0ce3f92953cb2c0edfce4a586ddb5af780977452021-02-19 0:38:08116 days 2 hrs ago 0x1a9f7ec8ba471809adf1ac44222d728e627cec6b 0x0e633c2a342a41ce84c6d746c91f290a90955f8e0 Ether
0xcb3c693a653a55ad3cb6e66cafe9677ec42b11e58c5773d04d11b8535aa68b5b80977412021-02-19 0:37:08116 days 2 hrs ago 0x1a9f7ec8ba471809adf1ac44222d728e627cec6b 0x0e633c2a342a41ce84c6d746c91f290a90955f8e0 Ether
0x60e78a43f5eb33742085d527a2a7a7f2d5eec587b8736532def86f43f5d6d8db80968552021-02-18 20:55:28116 days 5 hrs ago 0x1a9f7ec8ba471809adf1ac44222d728e627cec6b 0x0e633c2a342a41ce84c6d746c91f290a90955f8e0 Ether
0xa0bf752506bc620b7ad47fea8a8041be23c2ec85b12cb9af4a1dedd54f78fadc80947472021-02-18 12:07:54116 days 14 hrs ago 0x1a9f7ec8ba471809adf1ac44222d728e627cec6b 0x0e633c2a342a41ce84c6d746c91f290a90955f8e0 Ether
0x389a82e4be52193a9b317cb36756a00a96c91b87fb1c3c71177020ca7625b51180926502021-02-18 3:23:13116 days 23 hrs ago 0x1a9f7ec8ba471809adf1ac44222d728e627cec6b 0x0e633c2a342a41ce84c6d746c91f290a90955f8e0 Ether
0x60ccb1f37174188056d93c66fe2a07df71cc6b076b10abaf5621a46237e422cf80916522021-02-17 23:13:34117 days 3 hrs ago 0x1a9f7ec8ba471809adf1ac44222d728e627cec6b 0x0e633c2a342a41ce84c6d746c91f290a90955f8e0 Ether
0xde5745200712b79ad60e43ddcb98b913fe3213d7107f4b192b3097df5eece26e80913462021-02-17 21:57:00117 days 4 hrs ago 0x1a9f7ec8ba471809adf1ac44222d728e627cec6b 0x0e633c2a342a41ce84c6d746c91f290a90955f8e0 Ether
0xb49855e1404f5c1db02c83f6debc00c595acc683c52ed528bf0c6f8537155e9f80904502021-02-17 18:12:49117 days 8 hrs ago 0x1a9f7ec8ba471809adf1ac44222d728e627cec6b 0x0e633c2a342a41ce84c6d746c91f290a90955f8e0 Ether
0xbab1e4925471a40e584ad5203cc2e9a1466f7554bd4f4f70b13862f9d15313db80904362021-02-17 18:09:19117 days 8 hrs ago 0x1a9f7ec8ba471809adf1ac44222d728e627cec6b 0x0e633c2a342a41ce84c6d746c91f290a90955f8e0 Ether
0x973c4a593a0f64af2b451fd247587c53d520992a78f48862187af8df62cf7ea380881702021-02-17 8:42:09117 days 18 hrs ago 0x1a9f7ec8ba471809adf1ac44222d728e627cec6b 0x0e633c2a342a41ce84c6d746c91f290a90955f8e0 Ether
[ Download CSV Export 
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
EtherCollateral

Compiler Version
v0.5.16+commit.9c3226ce

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity)

/**
 *Submitted for verification at Etherscan.io on 2020-07-29
*/

/*
   ____            __   __        __   _
  / __/__ __ ___  / /_ / /  ___  / /_ (_)__ __
 _\ \ / // // _ \/ __// _ \/ -_)/ __// / \ \ /
/___/ \_, //_//_/\__//_//_/\__/ \__//_/ /_\_\
     /___/

* Synthetix: EtherCollateral.sol
*
* Latest source (may be newer): https://github.com/Synthetixio/synthetix/blob/master/contracts/EtherCollateral.sol
* Docs: https://docs.synthetix.io/contracts/EtherCollateral
*
* Contract Dependencies: 
*	- IAddressResolver
*	- IEtherCollateral
*	- MixinResolver
*	- Owned
*	- Pausable
*	- ReentrancyGuard
* Libraries: 
*	- SafeDecimalMath
*	- SafeMath
*
* MIT License
* ===========
*
* Copyright (c) 2020 Synthetix
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
*/

/* ===============================================
* Flattened with Solidifier by Coinage
* 
* https://solidifier.coina.ge
* ===============================================
*/


pragma solidity ^0.5.16;


// https://docs.synthetix.io/contracts/Owned
contract Owned {
    address public owner;
    address public nominatedOwner;

    constructor(address _owner) public {
        require(_owner != address(0), "Owner address cannot be 0");
        owner = _owner;
        emit OwnerChanged(address(0), _owner);
    }

    function nominateNewOwner(address _owner) external onlyOwner {
        nominatedOwner = _owner;
        emit OwnerNominated(_owner);
    }

    function acceptOwnership() external {
        require(msg.sender == nominatedOwner, "You must be nominated before you can accept ownership");
        emit OwnerChanged(owner, nominatedOwner);
        owner = nominatedOwner;
        nominatedOwner = address(0);
    }

    modifier onlyOwner {
        require(msg.sender == owner, "Only the contract owner may perform this action");
        _;
    }

    event OwnerNominated(address newOwner);
    event OwnerChanged(address oldOwner, address newOwner);
}


// Inheritance


// https://docs.synthetix.io/contracts/Pausable
contract Pausable is Owned {
    uint public lastPauseTime;
    bool public paused;

    constructor() internal {
        // This contract is abstract, and thus cannot be instantiated directly
        require(owner != address(0), "Owner must be set");
        // Paused will be false, and lastPauseTime will be 0 upon initialisation
    }

    /**
     * @notice Change the paused state of the contract
     * @dev Only the contract owner may call this.
     */
    function setPaused(bool _paused) external onlyOwner {
        // Ensure we're actually changing the state before we do anything
        if (_paused == paused) {
            return;
        }

        // Set our paused state.
        paused = _paused;

        // If applicable, set the last pause time.
        if (paused) {
            lastPauseTime = now;
        }

        // Let everyone know that our pause state has changed.
        emit PauseChanged(paused);
    }

    event PauseChanged(bool isPaused);

    modifier notPaused {
        require(!paused, "This action cannot be performed while the contract is paused");
        _;
    }
}


/**
 * @dev Contract module that helps prevent reentrant calls to a function.
 *
 * Inheriting from `ReentrancyGuard` will make the `nonReentrant` modifier
 * available, which can be aplied to functions to make sure there are no nested
 * (reentrant) calls to them.
 *
 * Note that because there is a single `nonReentrant` guard, functions marked as
 * `nonReentrant` may not call one another. This can be worked around by making
 * those functions `private`, and then adding `external` `nonReentrant` entry
 * points to them.
 */
contract ReentrancyGuard {
    /// @dev counter to allow mutex lock with only one SSTORE operation
    uint256 private _guardCounter;

    constructor () internal {
        // The counter starts at one to prevent changing it from zero to a non-zero
        // value, which is a more expensive operation.
        _guardCounter = 1;
    }

    /**
     * @dev Prevents a contract from calling itself, directly or indirectly.
     * Calling a `nonReentrant` function from another `nonReentrant`
     * function is not supported. It is possible to prevent this from happening
     * by making the `nonReentrant` function external, and make it call a
     * `private` function that does the actual work.
     */
    modifier nonReentrant() {
        _guardCounter += 1;
        uint256 localCounter = _guardCounter;
        _;
        require(localCounter == _guardCounter, "ReentrancyGuard: reentrant call");
    }
}


interface IAddressResolver {
    function getAddress(bytes32 name) external view returns (address);

    function getSynth(bytes32 key) external view returns (address);

    function requireAndGetAddress(bytes32 name, string calldata reason) external view returns (address);
}


interface ISynth {
    // Views
    function currencyKey() external view returns (bytes32);

    function transferableSynths(address account) external view returns (uint);

    // Mutative functions
    function transferAndSettle(address to, uint value) external returns (bool);

    function transferFromAndSettle(
        address from,
        address to,
        uint value
    ) external returns (bool);

    // Restricted: used internally to Synthetix
    function burn(address account, uint amount) external;

    function issue(address account, uint amount) external;
}


interface IIssuer {
    // Views
    function anySynthOrSNXRateIsStale() external view returns (bool anyRateStale);

    function availableCurrencyKeys() external view returns (bytes32[] memory);

    function availableSynthCount() external view returns (uint);

    function availableSynths(uint index) external view returns (ISynth);

    function canBurnSynths(address account) external view returns (bool);

    function collateral(address account) external view returns (uint);

    function collateralisationRatio(address issuer) external view returns (uint);

    function collateralisationRatioAndAnyRatesStale(address _issuer)
        external
        view
        returns (uint cratio, bool anyRateIsStale);

    function debtBalanceOf(address issuer, bytes32 currencyKey) external view returns (uint debtBalance);

    function lastIssueEvent(address account) external view returns (uint);

    function maxIssuableSynths(address issuer) external view returns (uint maxIssuable);

    function remainingIssuableSynths(address issuer)
        external
        view
        returns (
            uint maxIssuable,
            uint alreadyIssued,
            uint totalSystemDebt
        );

    function synths(bytes32 currencyKey) external view returns (ISynth);

    function synthsByAddress(address synthAddress) external view returns (bytes32);

    function totalIssuedSynths(bytes32 currencyKey, bool excludeEtherCollateral) external view returns (uint);

    function transferableSynthetixAndAnyRateIsStale(address account, uint balance)
        external
        view
        returns (uint transferable, bool anyRateIsStale);

    // Restricted: used internally to Synthetix
    function issueSynths(address from, uint amount) external;

    function issueSynthsOnBehalf(
        address issueFor,
        address from,
        uint amount
    ) external;

    function issueMaxSynths(address from) external;

    function issueMaxSynthsOnBehalf(address issueFor, address from) external;

    function burnSynths(address from, uint amount) external;

    function burnSynthsOnBehalf(
        address burnForAddress,
        address from,
        uint amount
    ) external;

    function burnSynthsToTarget(address from) external;

    function burnSynthsToTargetOnBehalf(address burnForAddress, address from) external;

    function liquidateDelinquentAccount(address account, uint susdAmount, address liquidator) external returns (uint totalRedeemed, uint amountToLiquidate);
}


// Inheritance


// https://docs.synthetix.io/contracts/AddressResolver
contract AddressResolver is Owned, IAddressResolver {
    mapping(bytes32 => address) public repository;

    constructor(address _owner) public Owned(_owner) {}

    /* ========== MUTATIVE FUNCTIONS ========== */

    function importAddresses(bytes32[] calldata names, address[] calldata destinations) external onlyOwner {
        require(names.length == destinations.length, "Input lengths must match");

        for (uint i = 0; i < names.length; i++) {
            repository[names[i]] = destinations[i];
        }
    }

    /* ========== VIEWS ========== */

    function getAddress(bytes32 name) external view returns (address) {
        return repository[name];
    }

    function requireAndGetAddress(bytes32 name, string calldata reason) external view returns (address) {
        address _foundAddress = repository[name];
        require(_foundAddress != address(0), reason);
        return _foundAddress;
    }

    function getSynth(bytes32 key) external view returns (address) {
        IIssuer issuer = IIssuer(repository["Issuer"]);
        require(address(issuer) != address(0), "Cannot find Issuer address");
        return address(issuer.synths(key));
    }
}


// Inheritance


// Internal references


// https://docs.synthetix.io/contracts/MixinResolver
contract MixinResolver is Owned {
    AddressResolver public resolver;

    mapping(bytes32 => address) private addressCache;

    bytes32[] public resolverAddressesRequired;

    uint public constant MAX_ADDRESSES_FROM_RESOLVER = 24;

    constructor(address _resolver, bytes32[MAX_ADDRESSES_FROM_RESOLVER] memory _addressesToCache) internal {
        // This contract is abstract, and thus cannot be instantiated directly
        require(owner != address(0), "Owner must be set");

        for (uint i = 0; i < _addressesToCache.length; i++) {
            if (_addressesToCache[i] != bytes32(0)) {
                resolverAddressesRequired.push(_addressesToCache[i]);
            } else {
                // End early once an empty item is found - assumes there are no empty slots in
                // _addressesToCache
                break;
            }
        }
        resolver = AddressResolver(_resolver);
        // Do not sync the cache as addresses may not be in the resolver yet
    }

    /* ========== SETTERS ========== */
    function setResolverAndSyncCache(AddressResolver _resolver) external onlyOwner {
        resolver = _resolver;

        for (uint i = 0; i < resolverAddressesRequired.length; i++) {
            bytes32 name = resolverAddressesRequired[i];
            // Note: can only be invoked once the resolver has all the targets needed added
            addressCache[name] = resolver.requireAndGetAddress(name, "Resolver missing target");
        }
    }

    /* ========== VIEWS ========== */

    function requireAndGetAddress(bytes32 name, string memory reason) internal view returns (address) {
        address _foundAddress = addressCache[name];
        require(_foundAddress != address(0), reason);
        return _foundAddress;
    }

    // Note: this could be made external in a utility contract if addressCache was made public
    // (used for deployment)
    function isResolverCached(AddressResolver _resolver) external view returns (bool) {
        if (resolver != _resolver) {
            return false;
        }

        // otherwise, check everything
        for (uint i = 0; i < resolverAddressesRequired.length; i++) {
            bytes32 name = resolverAddressesRequired[i];
            // false if our cache is invalid or if the resolver doesn't have the required address
            if (resolver.getAddress(name) != addressCache[name] || addressCache[name] == address(0)) {
                return false;
            }
        }

        return true;
    }

    // Note: can be made external into a utility contract (used for deployment)
    function getResolverAddressesRequired()
        external
        view
        returns (bytes32[MAX_ADDRESSES_FROM_RESOLVER] memory addressesRequired)
    {
        for (uint i = 0; i < resolverAddressesRequired.length; i++) {
            addressesRequired[i] = resolverAddressesRequired[i];
        }
    }

    /* ========== INTERNAL FUNCTIONS ========== */
    function appendToAddressCache(bytes32 name) internal {
        resolverAddressesRequired.push(name);
        require(resolverAddressesRequired.length < MAX_ADDRESSES_FROM_RESOLVER, "Max resolver cache size met");
        // Because this is designed to be called internally in constructors, we don't
        // check the address exists already in the resolver
        addressCache[name] = resolver.getAddress(name);
    }
}


interface IEtherCollateral {
    // Views
    function totalIssuedSynths() external view returns (uint256);

    function totalLoansCreated() external view returns (uint256);

    function totalOpenLoanCount() external view returns (uint256);

    // Mutative functions
    function openLoan() external payable returns (uint256 loanID);

    function closeLoan(uint256 loanID) external;

    function liquidateUnclosedLoan(address _loanCreatorsAddress, uint256 _loanID) external;
}


/**
 * @dev Wrappers over Solidity's arithmetic operations with added overflow
 * checks.
 *
 * Arithmetic operations in Solidity wrap on overflow. This can easily result
 * in bugs, because programmers usually assume that an overflow raises an
 * error, which is the standard behavior in high level programming languages.
 * `SafeMath` restores this intuition by reverting the transaction when an
 * operation overflows.
 *
 * Using this library instead of the unchecked operations eliminates an entire
 * class of bugs, so it's recommended to use it always.
 */
library SafeMath {
    /**
     * @dev Returns the addition of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `+` operator.
     *
     * Requirements:
     * - Addition cannot overflow.
     */
    function add(uint256 a, uint256 b) internal pure returns (uint256) {
        uint256 c = a + b;
        require(c >= a, "SafeMath: addition overflow");

        return c;
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting on
     * overflow (when the result is negative).
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     * - Subtraction cannot overflow.
     */
    function sub(uint256 a, uint256 b) internal pure returns (uint256) {
        require(b <= a, "SafeMath: subtraction overflow");
        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-solidity/pull/522
        if (a == 0) {
            return 0;
        }

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

        return c;
    }

    /**
     * @dev Returns the integer division of two unsigned integers. Reverts on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b) internal pure returns (uint256) {
        // Solidity only automatically asserts when dividing by 0
        require(b > 0, "SafeMath: division by zero");
        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) {
        require(b != 0, "SafeMath: modulo by zero");
        return a % b;
    }
}


// Libraries


// https://docs.synthetix.io/contracts/SafeDecimalMath
library SafeDecimalMath {
    using SafeMath for uint;

    /* Number of decimal places in the representations. */
    uint8 public constant decimals = 18;
    uint8 public constant highPrecisionDecimals = 27;

    /* The number representing 1.0. */
    uint public constant UNIT = 10**uint(decimals);

    /* The number representing 1.0 for higher fidelity numbers. */
    uint public constant PRECISE_UNIT = 10**uint(highPrecisionDecimals);
    uint private constant UNIT_TO_HIGH_PRECISION_CONVERSION_FACTOR = 10**uint(highPrecisionDecimals - decimals);

    /**
     * @return Provides an interface to UNIT.
     */
    function unit() external pure returns (uint) {
        return UNIT;
    }

    /**
     * @return Provides an interface to PRECISE_UNIT.
     */
    function preciseUnit() external pure returns (uint) {
        return PRECISE_UNIT;
    }

    /**
     * @return The result of multiplying x and y, interpreting the operands as fixed-point
     * decimals.
     *
     * @dev A unit factor is divided out after the product of x and y is evaluated,
     * so that product must be less than 2**256. As this is an integer division,
     * the internal division always rounds down. This helps save on gas. Rounding
     * is more expensive on gas.
     */
    function multiplyDecimal(uint x, uint y) internal pure returns (uint) {
        /* Divide by UNIT to remove the extra factor introduced by the product. */
        return x.mul(y) / UNIT;
    }

    /**
     * @return The result of safely multiplying x and y, interpreting the operands
     * as fixed-point decimals of the specified precision unit.
     *
     * @dev The operands should be in the form of a the specified unit factor which will be
     * divided out after the product of x and y is evaluated, so that product must be
     * less than 2**256.
     *
     * Unlike multiplyDecimal, this function rounds the result to the nearest increment.
     * Rounding is useful when you need to retain fidelity for small decimal numbers
     * (eg. small fractions or percentages).
     */
    function _multiplyDecimalRound(
        uint x,
        uint y,
        uint precisionUnit
    ) private pure returns (uint) {
        /* Divide by UNIT to remove the extra factor introduced by the product. */
        uint quotientTimesTen = x.mul(y) / (precisionUnit / 10);

        if (quotientTimesTen % 10 >= 5) {
            quotientTimesTen += 10;
        }

        return quotientTimesTen / 10;
    }

    /**
     * @return The result of safely multiplying x and y, interpreting the operands
     * as fixed-point decimals of a precise unit.
     *
     * @dev The operands should be in the precise unit factor which will be
     * divided out after the product of x and y is evaluated, so that product must be
     * less than 2**256.
     *
     * Unlike multiplyDecimal, this function rounds the result to the nearest increment.
     * Rounding is useful when you need to retain fidelity for small decimal numbers
     * (eg. small fractions or percentages).
     */
    function multiplyDecimalRoundPrecise(uint x, uint y) internal pure returns (uint) {
        return _multiplyDecimalRound(x, y, PRECISE_UNIT);
    }

    /**
     * @return The result of safely multiplying x and y, interpreting the operands
     * as fixed-point decimals of a standard unit.
     *
     * @dev The operands should be in the standard unit factor which will be
     * divided out after the product of x and y is evaluated, so that product must be
     * less than 2**256.
     *
     * Unlike multiplyDecimal, this function rounds the result to the nearest increment.
     * Rounding is useful when you need to retain fidelity for small decimal numbers
     * (eg. small fractions or percentages).
     */
    function multiplyDecimalRound(uint x, uint y) internal pure returns (uint) {
        return _multiplyDecimalRound(x, y, UNIT);
    }

    /**
     * @return The result of safely dividing x and y. The return value is a high
     * precision decimal.
     *
     * @dev y is divided after the product of x and the standard precision unit
     * is evaluated, so the product of x and UNIT must be less than 2**256. As
     * this is an integer division, the result is always rounded down.
     * This helps save on gas. Rounding is more expensive on gas.
     */
    function divideDecimal(uint x, uint y) internal pure returns (uint) {
        /* Reintroduce the UNIT factor that will be divided out by y. */
        return x.mul(UNIT).div(y);
    }

    /**
     * @return The result of safely dividing x and y. The return value is as a rounded
     * decimal in the precision unit specified in the parameter.
     *
     * @dev y is divided after the product of x and the specified precision unit
     * is evaluated, so the product of x and the specified precision unit must
     * be less than 2**256. The result is rounded to the nearest increment.
     */
    function _divideDecimalRound(
        uint x,
        uint y,
        uint precisionUnit
    ) private pure returns (uint) {
        uint resultTimesTen = x.mul(precisionUnit * 10).div(y);

        if (resultTimesTen % 10 >= 5) {
            resultTimesTen += 10;
        }

        return resultTimesTen / 10;
    }

    /**
     * @return The result of safely dividing x and y. The return value is as a rounded
     * standard precision decimal.
     *
     * @dev y is divided after the product of x and the standard precision unit
     * is evaluated, so the product of x and the standard precision unit must
     * be less than 2**256. The result is rounded to the nearest increment.
     */
    function divideDecimalRound(uint x, uint y) internal pure returns (uint) {
        return _divideDecimalRound(x, y, UNIT);
    }

    /**
     * @return The result of safely dividing x and y. The return value is as a rounded
     * high precision decimal.
     *
     * @dev y is divided after the product of x and the high precision unit
     * is evaluated, so the product of x and the high precision unit must
     * be less than 2**256. The result is rounded to the nearest increment.
     */
    function divideDecimalRoundPrecise(uint x, uint y) internal pure returns (uint) {
        return _divideDecimalRound(x, y, PRECISE_UNIT);
    }

    /**
     * @dev Convert a standard decimal representation to a high precision one.
     */
    function decimalToPreciseDecimal(uint i) internal pure returns (uint) {
        return i.mul(UNIT_TO_HIGH_PRECISION_CONVERSION_FACTOR);
    }

    /**
     * @dev Convert a high precision decimal to a standard decimal representation.
     */
    function preciseDecimalToDecimal(uint i) internal pure returns (uint) {
        uint quotientTimesTen = i / (UNIT_TO_HIGH_PRECISION_CONVERSION_FACTOR / 10);

        if (quotientTimesTen % 10 >= 5) {
            quotientTimesTen += 10;
        }

        return quotientTimesTen / 10;
    }
}


interface ISystemStatus {
    struct Status {
        bool canSuspend;
        bool canResume;
    }

    struct Suspension {
        bool suspended;
        // reason is an integer code,
        // 0 => no reason, 1 => upgrading, 2+ => defined by system usage
        uint248 reason;
    }

    // Views
    function accessControl(bytes32 section, address account) external view returns (bool canSuspend, bool canResume);

    function requireSystemActive() external view;

    function requireIssuanceActive() external view;

    function requireExchangeActive() external view;

    function requireSynthActive(bytes32 currencyKey) external view;

    function requireSynthsActive(bytes32 sourceCurrencyKey, bytes32 destinationCurrencyKey) external view;

    function synthSuspension(bytes32 currencyKey) external view returns (bool suspended, uint248 reason);

    // Restricted functions
    function suspendSynth(bytes32 currencyKey, uint256 reason) external;

    function updateAccessControl(
        bytes32 section,
        address account,
        bool canSuspend,
        bool canResume
    ) external;
}


interface IFeePool {
    // Views
    function getExchangeFeeRateForSynth(bytes32 synthKey) external view returns (uint);

    // solhint-disable-next-line func-name-mixedcase
    function FEE_ADDRESS() external view returns (address);

    function feesAvailable(address account) external view returns (uint, uint);

    function isFeesClaimable(address account) external view returns (bool);

    function totalFeesAvailable() external view returns (uint);

    function totalRewardsAvailable() external view returns (uint);

    // Mutative Functions
    function claimFees() external returns (bool);

    function claimOnBehalf(address claimingForAddress) external returns (bool);

    function closeCurrentFeePeriod() external;

    // Restricted: used internally to Synthetix
    function appendAccountIssuanceRecord(
        address account,
        uint lockedAmount,
        uint debtEntryIndex
    ) external;

    function recordFeePaid(uint sUSDAmount) external;

    function setRewardsToDistribute(uint amount) external;
}


interface IERC20 {
    // ERC20 Optional Views
    function name() external view returns (string memory);

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

    function decimals() external view returns (uint8);

    // Views
    function totalSupply() external view returns (uint);

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

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

    // Mutative functions
    function transfer(address to, uint value) external returns (bool);

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

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

    // Events
    event Transfer(address indexed from, address indexed to, uint value);

    event Approval(address indexed owner, address indexed spender, uint value);
}


interface IDepot {

    // Views
    function fundsWallet() external view returns (address payable);

    function maxEthPurchase() external view returns (uint);

    function minimumDepositAmount() external view returns (uint);

    function synthsReceivedForEther(uint amount) external view returns (uint);

    function totalSellableDeposits() external view returns (uint);

    // Mutative functions
    function depositSynths(uint amount) external;

    function exchangeEtherForSynths() external payable returns (uint);

    function exchangeEtherForSynthsAtRate(uint guaranteedRate) external payable returns (uint);

    function withdrawMyDepositedSynths() external;

    // Note: On mainnet no SNX has been deposited. The following functions are kept alive for testnet SNX faucets.
    function exchangeEtherForSNX() external payable returns (uint);

    function exchangeEtherForSNXAtRate(uint guaranteedRate, uint guaranteedSynthetixRate) external payable returns (uint);

    function exchangeSynthsForSNX(uint synthAmount) external returns (uint);

    function synthetixReceivedForEther(uint amount) external view returns (uint);

    function synthetixReceivedForSynths(uint amount) external view returns (uint);

    function withdrawSynthetix(uint amount) external;
}


// https://docs.synthetix.io/contracts/source/interfaces/IExchangeRates
interface IExchangeRates {
    // Views
    function aggregators(bytes32 currencyKey) external view returns (address);

    function anyRateIsStale(bytes32[] calldata currencyKeys) external view returns (bool);

    function currentRoundForRate(bytes32 currencyKey) external view returns (uint);

    function effectiveValue(
        bytes32 sourceCurrencyKey,
        uint sourceAmount,
        bytes32 destinationCurrencyKey
    ) external view returns (uint value);

    function effectiveValueAndRates(
        bytes32 sourceCurrencyKey,
        uint sourceAmount,
        bytes32 destinationCurrencyKey
    )
        external
        view
        returns (
            uint value,
            uint sourceRate,
            uint destinationRate
        );

    function effectiveValueAtRound(
        bytes32 sourceCurrencyKey,
        uint sourceAmount,
        bytes32 destinationCurrencyKey,
        uint roundIdForSrc,
        uint roundIdForDest
    ) external view returns (uint value);

    function getCurrentRoundId(bytes32 currencyKey) external view returns (uint);

    function getLastRoundIdBeforeElapsedSecs(
        bytes32 currencyKey,
        uint startingRoundId,
        uint startingTimestamp,
        uint timediff
    ) external view returns (uint);

    function inversePricing(bytes32 currencyKey)
        external
        view
        returns (
            uint entryPoint,
            uint upperLimit,
            uint lowerLimit,
            bool frozen
        );

    function lastRateUpdateTimes(bytes32 currencyKey) external view returns (uint256);

    function oracle() external view returns (address);

    function rateAndTimestampAtRound(bytes32 currencyKey, uint roundId) external view returns (uint rate, uint time);

    function rateAndUpdatedTime(bytes32 currencyKey) external view returns (uint rate, uint time);

    function rateForCurrency(bytes32 currencyKey) external view returns (uint);

    function rateIsFrozen(bytes32 currencyKey) external view returns (bool);

    function rateIsStale(bytes32 currencyKey) external view returns (bool);

    function rateStalePeriod() external view returns (uint);

    function ratesAndUpdatedTimeForCurrencyLastNRounds(bytes32 currencyKey, uint numRounds)
        external
        view
        returns (uint[] memory rates, uint[] memory times);

    function ratesAndStaleForCurrencies(bytes32[] calldata currencyKeys) external view returns (uint[] memory, bool);

    function ratesForCurrencies(bytes32[] calldata currencyKeys) external view returns (uint[] memory);
}


// Inheritance


// Libraries


// Internal references


// https://docs.synthetix.io/contracts/EtherCollateral
contract EtherCollateral is Owned, Pausable, ReentrancyGuard, MixinResolver, IEtherCollateral {
    using SafeMath for uint256;
    using SafeDecimalMath for uint256;

    // ========== CONSTANTS ==========
    uint256 internal constant ONE_THOUSAND = 1e18 * 1000;
    uint256 internal constant ONE_HUNDRED = 1e18 * 100;

    uint256 internal constant SECONDS_IN_A_YEAR = 31536000; // Common Year

    // Where fees are pooled in sUSD.
    address internal constant FEE_ADDRESS = 0xfeEFEEfeefEeFeefEEFEEfEeFeefEEFeeFEEFEeF;

    // ========== SETTER STATE VARIABLES ==========

    // The ratio of Collateral to synths issued
    uint256 public collateralizationRatio = SafeDecimalMath.unit() * 125; // SCCP-27

    // If updated, all outstanding loans will pay this interest rate in on closure of the loan. Default 5%
    uint256 public interestRate = (5 * SafeDecimalMath.unit()) / 100;
    uint256 public interestPerSecond = interestRate.div(SECONDS_IN_A_YEAR);

    // Minting fee for issuing the synths. Default 50 bips.
    uint256 public issueFeeRate = (5 * SafeDecimalMath.unit()) / 1000;

    // Maximum amount of sETH that can be issued by the EtherCollateral contract. Default 5000
    uint256 public issueLimit = SafeDecimalMath.unit() * 5000;

    // Minimum amount of ETH to create loan preventing griefing and gas consumption. Min 1ETH = 0.8 sETH
    uint256 public minLoanSize = SafeDecimalMath.unit() * 1;

    // Maximum number of loans an account can create
    uint256 public accountLoanLimit = 50;

    // If true then any wallet addres can close a loan not just the loan creator.
    bool public loanLiquidationOpen = false;

    // Time when remaining loans can be liquidated
    uint256 public liquidationDeadline;

    // ========== STATE VARIABLES ==========

    // The total number of synths issued by the collateral in this contract
    uint256 public totalIssuedSynths;

    // Total number of loans ever created
    uint256 public totalLoansCreated;

    // Total number of open loans
    uint256 public totalOpenLoanCount;

    // Synth loan storage struct
    struct SynthLoanStruct {
        //  Acccount that created the loan
        address account;
        //  Amount (in collateral token ) that they deposited
        uint256 collateralAmount;
        //  Amount (in synths) that they issued to borrow
        uint256 loanAmount;
        // When the loan was created
        uint256 timeCreated;
        // ID for the loan
        uint256 loanID;
        // When the loan was paidback (closed)
        uint256 timeClosed;
    }

    // Users Loans by address
    mapping(address => SynthLoanStruct[]) public accountsSynthLoans;

    // Account Open Loan Counter
    mapping(address => uint256) public accountOpenLoanCounter;

    /* ========== ADDRESS RESOLVER CONFIGURATION ========== */

    bytes32 private constant CONTRACT_SYSTEMSTATUS = "SystemStatus";
    bytes32 private constant CONTRACT_SYNTHSETH = "SynthsETH";
    bytes32 private constant CONTRACT_SYNTHSUSD = "SynthsUSD";
    bytes32 private constant CONTRACT_DEPOT = "Depot";
    bytes32 private constant CONTRACT_EXRATES = "ExchangeRates";

    bytes32[24] private addressesToCache = [
        CONTRACT_SYSTEMSTATUS,
        CONTRACT_SYNTHSETH,
        CONTRACT_SYNTHSUSD,
        CONTRACT_DEPOT,
        CONTRACT_EXRATES
    ];

    // ========== CONSTRUCTOR ==========
    constructor(address _owner, address _resolver)
        public
        Owned(_owner)
        Pausable()
        MixinResolver(_resolver, addressesToCache)
    {
        liquidationDeadline = now + 92 days; // Time before loans can be liquidated
    }

    // ========== SETTERS ==========

    function setCollateralizationRatio(uint256 ratio) external onlyOwner {
        require(ratio <= ONE_THOUSAND, "Too high");
        require(ratio >= ONE_HUNDRED, "Too low");
        collateralizationRatio = ratio;
        emit CollateralizationRatioUpdated(ratio);
    }

    function setInterestRate(uint256 _interestRate) external onlyOwner {
        require(_interestRate > SECONDS_IN_A_YEAR, "Interest rate cannot be less that the SECONDS_IN_A_YEAR");
        require(_interestRate <= SafeDecimalMath.unit(), "Interest cannot be more than 100% APR");
        interestRate = _interestRate;
        interestPerSecond = _interestRate.div(SECONDS_IN_A_YEAR);
        emit InterestRateUpdated(interestRate);
    }

    function setIssueFeeRate(uint256 _issueFeeRate) external onlyOwner {
        issueFeeRate = _issueFeeRate;
        emit IssueFeeRateUpdated(issueFeeRate);
    }

    function setIssueLimit(uint256 _issueLimit) external onlyOwner {
        issueLimit = _issueLimit;
        emit IssueLimitUpdated(issueLimit);
    }

    function setMinLoanSize(uint256 _minLoanSize) external onlyOwner {
        minLoanSize = _minLoanSize;
        emit MinLoanSizeUpdated(minLoanSize);
    }

    function setAccountLoanLimit(uint256 _loanLimit) external onlyOwner {
        uint256 HARD_CAP = 1000;
        require(_loanLimit < HARD_CAP, "Owner cannot set higher than HARD_CAP");
        accountLoanLimit = _loanLimit;
        emit AccountLoanLimitUpdated(accountLoanLimit);
    }

    function setLoanLiquidationOpen(bool _loanLiquidationOpen) external onlyOwner {
        require(now > liquidationDeadline, "Before liquidation deadline");
        loanLiquidationOpen = _loanLiquidationOpen;
        emit LoanLiquidationOpenUpdated(loanLiquidationOpen);
    }

    // ========== PUBLIC VIEWS ==========

    function getContractInfo()
        external
        view
        returns (
            uint256 _collateralizationRatio,
            uint256 _issuanceRatio,
            uint256 _interestRate,
            uint256 _interestPerSecond,
            uint256 _issueFeeRate,
            uint256 _issueLimit,
            uint256 _minLoanSize,
            uint256 _totalIssuedSynths,
            uint256 _totalLoansCreated,
            uint256 _totalOpenLoanCount,
            uint256 _ethBalance,
            uint256 _liquidationDeadline,
            bool _loanLiquidationOpen
        )
    {
        _collateralizationRatio = collateralizationRatio;
        _issuanceRatio = issuanceRatio();
        _interestRate = interestRate;
        _interestPerSecond = interestPerSecond;
        _issueFeeRate = issueFeeRate;
        _issueLimit = issueLimit;
        _minLoanSize = minLoanSize;
        _totalIssuedSynths = totalIssuedSynths;
        _totalLoansCreated = totalLoansCreated;
        _totalOpenLoanCount = totalOpenLoanCount;
        _ethBalance = address(this).balance;
        _liquidationDeadline = liquidationDeadline;
        _loanLiquidationOpen = loanLiquidationOpen;
    }

    // returns value of 100 / collateralizationRatio.
    // e.g. 100/125 = 0.8
    // or in wei 100000000000000000000/125000000000000000000 = 800000000000000000
    function issuanceRatio() public view returns (uint256) {
        // this Rounds so you get slightly more rather than slightly less
        // 4999999999999999995000
        return ONE_HUNDRED.divideDecimalRound(collateralizationRatio);
    }

    function loanAmountFromCollateral(uint256 collateralAmount) public view returns (uint256) {
        return collateralAmount.multiplyDecimal(issuanceRatio());
    }

    function collateralAmountForLoan(uint256 loanAmount) external view returns (uint256) {
        return loanAmount.multiplyDecimal(collateralizationRatio.divideDecimalRound(ONE_HUNDRED));
    }

    function currentInterestOnLoan(address _account, uint256 _loanID) external view returns (uint256) {
        // Get the loan from storage
        SynthLoanStruct memory synthLoan = _getLoanFromStorage(_account, _loanID);
        uint256 loanLifeSpan = _loanLifeSpan(synthLoan);
        return accruedInterestOnLoan(synthLoan.loanAmount, loanLifeSpan);
    }

    function accruedInterestOnLoan(uint256 _loanAmount, uint256 _seconds) public view returns (uint256 interestAmount) {
        // Simple interest calculated per second
        // Interest = Principal * rate * time
        interestAmount = _loanAmount.multiplyDecimalRound(interestPerSecond.mul(_seconds));
    }

    function calculateMintingFee(address _account, uint256 _loanID) external view returns (uint256) {
        // Get the loan from storage
        SynthLoanStruct memory synthLoan = _getLoanFromStorage(_account, _loanID);
        return _calculateMintingFee(synthLoan);
    }

    function openLoanIDsByAccount(address _account) external view returns (uint256[] memory) {
        SynthLoanStruct[] memory synthLoans = accountsSynthLoans[_account];

        uint256[] memory _openLoanIDs = new uint256[](synthLoans.length);
        uint256 _counter = 0;

        for (uint256 i = 0; i < synthLoans.length; i++) {
            if (synthLoans[i].timeClosed == 0) {
                _openLoanIDs[_counter] = synthLoans[i].loanID;
                _counter++;
            }
        }
        // Create the fixed size array to return
        uint256[] memory _result = new uint256[](_counter);

        // Copy loanIDs from dynamic array to fixed array
        for (uint256 j = 0; j < _counter; j++) {
            _result[j] = _openLoanIDs[j];
        }
        // Return an array with list of open Loan IDs
        return _result;
    }

    function getLoan(address _account, uint256 _loanID)
        external
        view
        returns (
            address account,
            uint256 collateralAmount,
            uint256 loanAmount,
            uint256 timeCreated,
            uint256 loanID,
            uint256 timeClosed,
            uint256 interest,
            uint256 totalFees
        )
    {
        SynthLoanStruct memory synthLoan = _getLoanFromStorage(_account, _loanID);
        account = synthLoan.account;
        collateralAmount = synthLoan.collateralAmount;
        loanAmount = synthLoan.loanAmount;
        timeCreated = synthLoan.timeCreated;
        loanID = synthLoan.loanID;
        timeClosed = synthLoan.timeClosed;
        interest = accruedInterestOnLoan(synthLoan.loanAmount, _loanLifeSpan(synthLoan));
        totalFees = interest.add(_calculateMintingFee(synthLoan));
    }

    function loanLifeSpan(address _account, uint256 _loanID) external view returns (uint256 loanLifeSpanResult) {
        SynthLoanStruct memory synthLoan = _getLoanFromStorage(_account, _loanID);
        loanLifeSpanResult = _loanLifeSpan(synthLoan);
    }

    // ========== PUBLIC FUNCTIONS ==========

    function openLoan() external payable notPaused nonReentrant sETHRateNotStale returns (uint256 loanID) {
        systemStatus().requireIssuanceActive();

        // Require ETH sent to be greater than minLoanSize
        require(msg.value >= minLoanSize, "Not enough ETH to create this loan. Please see the minLoanSize");

        // Require loanLiquidationOpen to be false or we are in liquidation phase
        require(loanLiquidationOpen == false, "Loans are now being liquidated");

        // Each account is limted to creating 50 (accountLoanLimit) loans
        require(accountsSynthLoans[msg.sender].length < accountLoanLimit, "Each account is limted to 50 loans");

        // Calculate issuance amount
        uint256 loanAmount = loanAmountFromCollateral(msg.value);

        // Require sETH to mint does not exceed cap
        require(totalIssuedSynths.add(loanAmount) < issueLimit, "Loan Amount exceeds the supply cap.");

        // Get a Loan ID
        loanID = _incrementTotalLoansCounter();

        // Create Loan storage object
        SynthLoanStruct memory synthLoan = SynthLoanStruct({
            account: msg.sender,
            collateralAmount: msg.value,
            loanAmount: loanAmount,
            timeCreated: now,
            loanID: loanID,
            timeClosed: 0
        });

        // Record loan in mapping to account in an array of the accounts open loans
        accountsSynthLoans[msg.sender].push(synthLoan);

        // Increment totalIssuedSynths
        totalIssuedSynths = totalIssuedSynths.add(loanAmount);

        // Issue the synth
        synthsETH().issue(msg.sender, loanAmount);

        // Tell the Dapps a loan was created
        emit LoanCreated(msg.sender, loanID, loanAmount);
    }

    function closeLoan(uint256 loanID) external nonReentrant sETHRateNotStale {
        _closeLoan(msg.sender, loanID);
    }

    // Liquidation of an open loan available for anyone
    function liquidateUnclosedLoan(address _loanCreatorsAddress, uint256 _loanID) external nonReentrant sETHRateNotStale {
        require(loanLiquidationOpen, "Liquidation is not open");
        // Close the creators loan and send collateral to the closer.
        _closeLoan(_loanCreatorsAddress, _loanID);
        // Tell the Dapps this loan was liquidated
        emit LoanLiquidated(_loanCreatorsAddress, _loanID, msg.sender);
    }

    // ========== PRIVATE FUNCTIONS ==========

    function _closeLoan(address account, uint256 loanID) private {
        systemStatus().requireIssuanceActive();

        // Get the loan from storage
        SynthLoanStruct memory synthLoan = _getLoanFromStorage(account, loanID);

        require(synthLoan.loanID > 0, "Loan does not exist");
        require(synthLoan.timeClosed == 0, "Loan already closed");
        require(
            IERC20(address(synthsETH())).balanceOf(msg.sender) >= synthLoan.loanAmount,
            "You do not have the required Synth balance to close this loan."
        );

        // Record loan as closed
        _recordLoanClosure(synthLoan);

        // Decrement totalIssuedSynths
        totalIssuedSynths = totalIssuedSynths.sub(synthLoan.loanAmount);

        // Calculate and deduct interest(5%) and minting fee(50 bips) in ETH
        uint256 interestAmount = accruedInterestOnLoan(synthLoan.loanAmount, _loanLifeSpan(synthLoan));
        uint256 mintingFee = _calculateMintingFee(synthLoan);
        uint256 totalFeeETH = interestAmount.add(mintingFee);

        // Burn all Synths issued for the loan
        synthsETH().burn(msg.sender, synthLoan.loanAmount);

        // Fee Distribution. Purchase sUSD with ETH from Depot
        require(
            IERC20(address(synthsUSD())).balanceOf(address(depot())) >= depot().synthsReceivedForEther(totalFeeETH),
            "The sUSD Depot does not have enough sUSD to buy for fees"
        );
        depot().exchangeEtherForSynths.value(totalFeeETH)();

        // Transfer the sUSD to distribute to SNX holders.
        IERC20(address(synthsUSD())).transfer(FEE_ADDRESS, IERC20(address(synthsUSD())).balanceOf(address(this)));

        // Send remainder ETH to caller
        address(msg.sender).transfer(synthLoan.collateralAmount.sub(totalFeeETH));

        // Tell the Dapps
        emit LoanClosed(account, loanID, totalFeeETH);
    }

    function _getLoanFromStorage(address account, uint256 loanID) private view returns (SynthLoanStruct memory) {
        SynthLoanStruct[] memory synthLoans = accountsSynthLoans[account];
        for (uint256 i = 0; i < synthLoans.length; i++) {
            if (synthLoans[i].loanID == loanID) {
                return synthLoans[i];
            }
        }
    }

    function _recordLoanClosure(SynthLoanStruct memory synthLoan) private {
        // Get storage pointer to the accounts array of loans
        SynthLoanStruct[] storage synthLoans = accountsSynthLoans[synthLoan.account];
        for (uint256 i = 0; i < synthLoans.length; i++) {
            if (synthLoans[i].loanID == synthLoan.loanID) {
                // Record the time the loan was closed
                synthLoans[i].timeClosed = now;
            }
        }

        // Reduce Total Open Loans Count
        totalOpenLoanCount = totalOpenLoanCount.sub(1);
    }

    function _incrementTotalLoansCounter() private returns (uint256) {
        // Increase the total Open loan count
        totalOpenLoanCount = totalOpenLoanCount.add(1);
        // Increase the total Loans Created count
        totalLoansCreated = totalLoansCreated.add(1);
        // Return total count to be used as a unique ID.
        return totalLoansCreated;
    }

    function _calculateMintingFee(SynthLoanStruct memory synthLoan) private view returns (uint256 mintingFee) {
        mintingFee = synthLoan.loanAmount.multiplyDecimalRound(issueFeeRate);
    }

    function _loanLifeSpan(SynthLoanStruct memory synthLoan) private view returns (uint256 loanLifeSpanResult) {
        // Get time loan is open for, and if closed from the timeClosed
        bool loanClosed = synthLoan.timeClosed > 0;
        // Calculate loan life span in seconds as (Now - Loan creation time)
        loanLifeSpanResult = loanClosed ? synthLoan.timeClosed.sub(synthLoan.timeCreated) : now.sub(synthLoan.timeCreated);
    }

    /* ========== INTERNAL VIEWS ========== */

    function systemStatus() internal view returns (ISystemStatus) {
        return ISystemStatus(requireAndGetAddress(CONTRACT_SYSTEMSTATUS, "Missing SystemStatus address"));
    }

    function synthsETH() internal view returns (ISynth) {
        return ISynth(requireAndGetAddress(CONTRACT_SYNTHSETH, "Missing SynthsETH address"));
    }

    function synthsUSD() internal view returns (ISynth) {
        return ISynth(requireAndGetAddress(CONTRACT_SYNTHSUSD, "Missing SynthsUSD address"));
    }

    function depot() internal view returns (IDepot) {
        return IDepot(requireAndGetAddress(CONTRACT_DEPOT, "Missing Depot address"));
    }

    function exchangeRates() internal view returns (IExchangeRates) {
        return IExchangeRates(requireAndGetAddress(CONTRACT_EXRATES, "Missing ExchangeRates address"));
    }

    /* ========== MODIFIERS ========== */

    modifier sETHRateNotStale() {
        require(!exchangeRates().rateIsStale("sETH"), "Blocked as sETH rate is stale");
        _;
    }

    // ========== EVENTS ==========

    event CollateralizationRatioUpdated(uint256 ratio);
    event InterestRateUpdated(uint256 interestRate);
    event IssueFeeRateUpdated(uint256 issueFeeRate);
    event IssueLimitUpdated(uint256 issueLimit);
    event MinLoanSizeUpdated(uint256 minLoanSize);
    event AccountLoanLimitUpdated(uint256 loanLimit);
    event LoanLiquidationOpenUpdated(bool loanLiquidationOpen);
    event LoanCreated(address indexed account, uint256 loanID, uint256 amount);
    event LoanClosed(address indexed account, uint256 loanID, uint256 feesPaid);
    event LoanLiquidated(address indexed account, uint256 loanID, address liquidator);
}

Contract ABI

[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"address","name":"_resolver","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"loanLimit","type":"uint256"}],"name":"AccountLoanLimitUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"ratio","type":"uint256"}],"name":"CollateralizationRatioUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"interestRate","type":"uint256"}],"name":"InterestRateUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"issueFeeRate","type":"uint256"}],"name":"IssueFeeRateUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"issueLimit","type":"uint256"}],"name":"IssueLimitUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint256","name":"loanID","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"feesPaid","type":"uint256"}],"name":"LoanClosed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint256","name":"loanID","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"LoanCreated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint256","name":"loanID","type":"uint256"},{"indexed":false,"internalType":"address","name":"liquidator","type":"address"}],"name":"LoanLiquidated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bool","name":"loanLiquidationOpen","type":"bool"}],"name":"LoanLiquidationOpenUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"minLoanSize","type":"uint256"}],"name":"MinLoanSizeUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"oldOwner","type":"address"},{"indexed":false,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnerChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnerNominated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bool","name":"isPaused","type":"bool"}],"name":"PauseChanged","type":"event"},{"constant":true,"inputs":[],"name":"MAX_ADDRESSES_FROM_RESOLVER","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"acceptOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"accountLoanLimit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"accountOpenLoanCounter","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"accountsSynthLoans","outputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"collateralAmount","type":"uint256"},{"internalType":"uint256","name":"loanAmount","type":"uint256"},{"internalType":"uint256","name":"timeCreated","type":"uint256"},{"internalType":"uint256","name":"loanID","type":"uint256"},{"internalType":"uint256","name":"timeClosed","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"uint256","name":"_loanAmount","type":"uint256"},{"internalType":"uint256","name":"_seconds","type":"uint256"}],"name":"accruedInterestOnLoan","outputs":[{"internalType":"uint256","name":"interestAmount","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"_account","type":"address"},{"internalType":"uint256","name":"_loanID","type":"uint256"}],"name":"calculateMintingFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"loanID","type":"uint256"}],"name":"closeLoan","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"internalType":"uint256","name":"loanAmount","type":"uint256"}],"name":"collateralAmountForLoan","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"collateralizationRatio","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"_account","type":"address"},{"internalType":"uint256","name":"_loanID","type":"uint256"}],"name":"currentInterestOnLoan","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getContractInfo","outputs":[{"internalType":"uint256","name":"_collateralizationRatio","type":"uint256"},{"internalType":"uint256","name":"_issuanceRatio","type":"uint256"},{"internalType":"uint256","name":"_interestRate","type":"uint256"},{"internalType":"uint256","name":"_interestPerSecond","type":"uint256"},{"internalType":"uint256","name":"_issueFeeRate","type":"uint256"},{"internalType":"uint256","name":"_issueLimit","type":"uint256"},{"internalType":"uint256","name":"_minLoanSize","type":"uint256"},{"internalType":"uint256","name":"_totalIssuedSynths","type":"uint256"},{"internalType":"uint256","name":"_totalLoansCreated","type":"uint256"},{"internalType":"uint256","name":"_totalOpenLoanCount","type":"uint256"},{"internalType":"uint256","name":"_ethBalance","type":"uint256"},{"internalType":"uint256","name":"_liquidationDeadline","type":"uint256"},{"internalType":"bool","name":"_loanLiquidationOpen","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"_account","type":"address"},{"internalType":"uint256","name":"_loanID","type":"uint256"}],"name":"getLoan","outputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"collateralAmount","type":"uint256"},{"internalType":"uint256","name":"loanAmount","type":"uint256"},{"internalType":"uint256","name":"timeCreated","type":"uint256"},{"internalType":"uint256","name":"loanID","type":"uint256"},{"internalType":"uint256","name":"timeClosed","type":"uint256"},{"internalType":"uint256","name":"interest","type":"uint256"},{"internalType":"uint256","name":"totalFees","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getResolverAddressesRequired","outputs":[{"internalType":"bytes32[24]","name":"addressesRequired","type":"bytes32[24]"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"interestPerSecond","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"interestRate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"contract AddressResolver","name":"_resolver","type":"address"}],"name":"isResolverCached","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"issuanceRatio","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"issueFeeRate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"issueLimit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"lastPauseTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"_loanCreatorsAddress","type":"address"},{"internalType":"uint256","name":"_loanID","type":"uint256"}],"name":"liquidateUnclosedLoan","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"liquidationDeadline","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"uint256","name":"collateralAmount","type":"uint256"}],"name":"loanAmountFromCollateral","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"_account","type":"address"},{"internalType":"uint256","name":"_loanID","type":"uint256"}],"name":"loanLifeSpan","outputs":[{"internalType":"uint256","name":"loanLifeSpanResult","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"loanLiquidationOpen","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"minLoanSize","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"_owner","type":"address"}],"name":"nominateNewOwner","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"nominatedOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"openLoan","outputs":[{"internalType":"uint256","name":"loanID","type":"uint256"}],"payable":true,"stateMutability":"payable","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"_account","type":"address"}],"name":"openLoanIDsByAccount","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"resolver","outputs":[{"internalType":"contract AddressResolver","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"resolverAddressesRequired","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"_loanLimit","type":"uint256"}],"name":"setAccountLoanLimit","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"ratio","type":"uint256"}],"name":"setCollateralizationRatio","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"_interestRate","type":"uint256"}],"name":"setInterestRate","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"_issueFeeRate","type":"uint256"}],"name":"setIssueFeeRate","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"_issueLimit","type":"uint256"}],"name":"setIssueLimit","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"bool","name":"_loanLiquidationOpen","type":"bool"}],"name":"setLoanLiquidationOpen","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"_minLoanSize","type":"uint256"}],"name":"setMinLoanSize","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"bool","name":"_paused","type":"bool"}],"name":"setPaused","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"contract AddressResolver","name":"_resolver","type":"address"}],"name":"setResolverAndSyncCache","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"totalIssuedSynths","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"totalLoansCreated","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"totalOpenLoanCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"}]

60806040819052630241ebdb60e61b815273fe9c9fda0dd1a07356e7bb236f9224fa3ab5a5879063907af6c09060849060209060048186803b1580156200004557600080fd5b505af41580156200005a573d6000803e3d6000fd5b505050506040513d60208110156200007157600080fd5b5051607d0260085560408051630241ebdb60e61b8152905160649173fe9c9fda0dd1a07356e7bb236f9224fa3ab5a5879163907af6c091600480820192602092909190829003018186803b158015620000c957600080fd5b505af4158015620000de573d6000803e3d6000fd5b505050506040513d6020811015620000f557600080fd5b5051600502816200010257fe5b04600955620001266301e133806009546200059360201b620023101790919060201c565b600a556103e873fe9c9fda0dd1a07356e7bb236f9224fa3ab5a58763907af6c06040518163ffffffff1660e01b815260040160206040518083038186803b1580156200017157600080fd5b505af415801562000186573d6000803e3d6000fd5b505050506040513d60208110156200019d57600080fd5b505160050281620001aa57fe5b04600b5573fe9c9fda0dd1a07356e7bb236f9224fa3ab5a58763907af6c06040518163ffffffff1660e01b815260040160206040518083038186803b158015620001f357600080fd5b505af415801562000208573d6000803e3d6000fd5b505050506040513d60208110156200021f57600080fd5b505161138802600c5560408051630241ebdb60e61b8152905173fe9c9fda0dd1a07356e7bb236f9224fa3ab5a5879163907af6c0916004808301926020929190829003018186803b1580156200027457600080fd5b505af415801562000289573d6000803e3d6000fd5b505050506040513d6020811015620002a057600080fd5b5051600d556032600e55600f805460ff191690556040805160a0810182526b53797374656d53746174757360a01b8152680a6f2dce8d0e68aa8960bb1b60208201526814de5b9d1a1cd554d160ba1b918101919091526411195c1bdd60da1b60608201526c45786368616e6765526174657360981b60808201526200032a906016906005620005ff565b503480156200033857600080fd5b50604051620037e5380380620037e5833981810160405260408110156200035e57600080fd5b50805160209091015160408051610300810191829052829160169060189082845b8154815260200190600101908083116200037f57508793505050506001600160a01b038116620003f6576040805162461bcd60e51b815260206004820152601960248201527f4f776e657220616464726573732063616e6e6f74206265203000000000000000604482015290519081900360640190fd5b600080546001600160a01b0319166001600160a01b038316908117825560408051928352602083019190915280517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9281900390910190a1506000546001600160a01b0316620004a1576040805162461bcd60e51b815260206004820152601160248201527013dddb995c881b5d5cdd081899481cd95d607a1b604482015290519081900360640190fd5b60016004556000546001600160a01b0316620004f8576040805162461bcd60e51b815260206004820152601160248201527013dddb995c881b5d5cdd081899481cd95d607a1b604482015290519081900360640190fd5b60005b6018811015620005605760008282601881106200051457fe5b602002015114620005515760078282601881106200052e57fe5b602090810291909101518254600181018455600093845291909220015562000557565b62000560565b600101620004fb565b5050600580546001600160a01b0319166001600160a01b039290921691909117905550504262794a000160105562000662565b6000808211620005ea576040805162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b6000828481620005f657fe5b04949350505050565b826018810192821562000630579160200282015b828111156200063057825182559160200191906001019062000613565b506200063e92915062000642565b5090565b6200065f91905b808211156200063e576000815560010162000649565b90565b61317380620006726000396000f3fe6080604052600436106102885760003560e01c80638c4638691161015a578063c6c9d828116100c1578063e3c1e58c1161007a578063e3c1e58c146109f8578063e40108ed14610a0d578063e5829d2014610a22578063ee5f3f5c14610a4c578063eea8f5da14610a61578063f53dfb8414610a7657610288565b8063c6c9d8281461092c578063cf09b4ae14610956578063d05951a01461096b578063dcaf9c4414610995578063e220a811146109aa578063e3235c91146109e357610288565b8063a2e1734211610113578063a2e17342146107cd578063a76cdfa5146107fd578063aa754a2a14610827578063ab49848c1461089d578063b410a034146108eb578063bb8c6d6c1461090057610288565b80638c463869146106a75780638da5cb5b146106e05780638fdc8f3b146106f557806391b4ded91461071f5780639f7d568814610734578063a1c515861461074957610288565b80634f069f66116101fe578063631e1444116101b7578063631e14441461058d5780636b231938146105c057806379ba5097146105c85780637c3a00fd146105dd5780637cc1f867146105f257806389c937de1461066e57610288565b80634f069f66146104a757806350e3b2e7146104d157806353a47bb7146104fb5780635c975abb146105105780635d1a2229146105395780635f84f3021461056357610288565b806323aa7f0f1161025057806323aa7f0f1461037957806327cff2e51461038e5780632f2bf15b146103c7578063361e20861461044a5780633be99e6f1461045f5780634189bb491461049257610288565b806304f3bcec1461028d578063089f7fb4146102be5780631474b279146103035780631627540c1461031857806316c38b3c1461034d575b600080fd5b34801561029957600080fd5b506102a2610aa0565b604080516001600160a01b039092168252519081900360200190f35b3480156102ca57600080fd5b506102f1600480360360208110156102e157600080fd5b50356001600160a01b0316610aaf565b60408051918252519081900360200190f35b34801561030f57600080fd5b506102f1610ac1565b34801561032457600080fd5b5061034b6004803603602081101561033b57600080fd5b50356001600160a01b0316610ac7565b005b34801561035957600080fd5b5061034b6004803603602081101561037057600080fd5b50351515610b64565b34801561038557600080fd5b506102f1610c1f565b34801561039a57600080fd5b506102f1600480360360408110156103b157600080fd5b506001600160a01b038135169060200135610c25565b3480156103d357600080fd5b506103fa600480360360208110156103ea57600080fd5b50356001600160a01b0316610c4e565b60408051602080825283518183015283519192839290830191858101910280838360005b8381101561043657818101518382015260200161041e565b505050509050019250505060405180910390f35b34801561045657600080fd5b506102f1610e0e565b34801561046b57600080fd5b5061034b6004803603602081101561048257600080fd5b50356001600160a01b0316610e14565b34801561049e57600080fd5b506102f1610f82565b3480156104b357600080fd5b5061034b600480360360208110156104ca57600080fd5b5035610f88565b3480156104dd57600080fd5b5061034b600480360360208110156104f457600080fd5b503561100c565b34801561050757600080fd5b506102a2611090565b34801561051c57600080fd5b5061052561109f565b604080519115158252519081900360200190f35b34801561054557600080fd5b5061034b6004803603602081101561055c57600080fd5b50356110a8565b34801561056f57600080fd5b5061034b6004803603602081101561058657600080fd5b503561116e565b34801561059957600080fd5b50610525600480360360208110156105b057600080fd5b50356001600160a01b03166112fb565b6102f1611416565b3480156105d457600080fd5b5061034b6118ab565b3480156105e957600080fd5b506102f1611967565b3480156105fe57600080fd5b5061060761196d565b604080519d8e5260208e019c909c528c8c019a909a5260608c019890985260808b019690965260a08a019490945260c089019290925260e0880152610100870152610120860152610140850152610160840152151561018083015251908190036101a00190f35b34801561067a57600080fd5b506102f16004803603604081101561069157600080fd5b506001600160a01b0381351690602001356119d8565b3480156106b357600080fd5b506102f1600480360360408110156106ca57600080fd5b506001600160a01b038135169060200135611a12565b3480156106ec57600080fd5b506102a2611a31565b34801561070157600080fd5b506102f16004803603602081101561071857600080fd5b5035611a40565b34801561072b57600080fd5b506102f1611a5a565b34801561074057600080fd5b506102f1611a60565b34801561075557600080fd5b506107826004803603604081101561076c57600080fd5b506001600160a01b038135169060200135611a66565b604080516001600160a01b0390991689526020890197909752878701959095526060870193909352608086019190915260a085015260c084015260e083015251908190036101000190f35b3480156107d957600080fd5b506102f1600480360360408110156107f057600080fd5b5080359060200135611aed565b34801561080957600080fd5b5061034b6004803603602081101561082057600080fd5b5035611b1b565b34801561083357600080fd5b506108606004803603604081101561084a57600080fd5b506001600160a01b038135169060200135611b9f565b604080516001600160a01b0390971687526020870195909552858501939093526060850191909152608084015260a0830152519081900360c00190f35b3480156108a957600080fd5b506108b2611bfa565b604051808261030080838360005b838110156108d85781810151838201526020016108c0565b5050505090500191505060405180910390f35b3480156108f757600080fd5b506102f1611c40565b34801561090c57600080fd5b5061034b6004803603602081101561092357600080fd5b50351515611c65565b34801561093857600080fd5b506102f16004803603602081101561094f57600080fd5b5035611d50565b34801561096257600080fd5b506102f1611d6e565b34801561097757600080fd5b5061034b6004803603602081101561098e57600080fd5b5035611d74565b3480156109a157600080fd5b506102f1611eae565b3480156109b657600080fd5b5061034b600480360360408110156109cd57600080fd5b506001600160a01b038135169060200135611eb4565b3480156109ef57600080fd5b506102f161208c565b348015610a0457600080fd5b50610525612091565b348015610a1957600080fd5b506102f161209a565b348015610a2e57600080fd5b5061034b60048036036020811015610a4557600080fd5b50356120a0565b348015610a5857600080fd5b506102f16121b5565b348015610a6d57600080fd5b506102f16121bb565b348015610a8257600080fd5b506102f160048036036020811015610a9957600080fd5b50356121c1565b6005546001600160a01b031681565b60156020526000908152604090205481565b600e5481565b6000546001600160a01b03163314610b105760405162461bcd60e51b815260040180806020018281038252602f815260200180612fa3602f913960400191505060405180910390fd5b600180546001600160a01b0383166001600160a01b0319909116811790915560408051918252517f906a1c6bd7e3091ea86693dd029a831c19049ce77f1dce2ce0bab1cacbabce229181900360200190a150565b6000546001600160a01b03163314610bad5760405162461bcd60e51b815260040180806020018281038252602f815260200180612fa3602f913960400191505060405180910390fd5b60035460ff1615158115151415610bc357610c1c565b6003805460ff1916821515179081905560ff1615610be057426002555b6003546040805160ff90921615158252517f8fb6c181ee25a520cf3dd6565006ef91229fcfe5a989566c2a3b8c115570cec59181900360200190a15b50565b60125481565b6000610c2f612ea5565b610c3984846121e4565b9050610c44816122f5565b9150505b92915050565b6001600160a01b03811660009081526014602090815260408083208054825181850281018501909352808352606094859484015b82821015610cf35760008481526020908190206040805160c0810182526006860290920180546001600160a01b031683526001808201548486015260028201549284019290925260038101546060840152600481015460808401526005015460a08301529083529092019101610c82565b50505050905060608151604051908082528060200260200182016040528015610d26578160200160208202803883390190505b5090506000805b8351811015610d9457838181518110610d4257fe5b602002602001015160a0015160001415610d8c57838181518110610d6257fe5b602002602001015160800151838381518110610d7a57fe5b60209081029190910101526001909101905b600101610d2d565b50606081604051908082528060200260200182016040528015610dc1578160200160208202803883390190505b50905060005b82811015610e0257838181518110610ddb57fe5b6020026020010151828281518110610def57fe5b6020908102919091010152600101610dc7565b5093505050505b919050565b600b5481565b6000546001600160a01b03163314610e5d5760405162461bcd60e51b815260040180806020018281038252602f815260200180612fa3602f913960400191505060405180910390fd5b600580546001600160a01b0319166001600160a01b03831617905560005b600754811015610f7e57600060078281548110610e9457fe5b600091825260209182902001546005546040805163dacb2d0160e01b81526004810184905260248101829052601760448201527f5265736f6c766572206d697373696e6720746172676574000000000000000000606482015290519294506001600160a01b039091169263dacb2d0192608480840193829003018186803b158015610f1e57600080fd5b505afa158015610f32573d6000803e3d6000fd5b505050506040513d6020811015610f4857600080fd5b505160009182526006602052604090912080546001600160a01b0319166001600160a01b03909216919091179055600101610e7b565b5050565b60135481565b6000546001600160a01b03163314610fd15760405162461bcd60e51b815260040180806020018281038252602f815260200180612fa3602f913960400191505060405180910390fd5b600c8190556040805182815290517fbb72ce8874020b3b98429d653df927cac6618ac1932384b1446bf04bf9a1b7e59181900360200190a150565b6000546001600160a01b031633146110555760405162461bcd60e51b815260040180806020018281038252602f815260200180612fa3602f913960400191505060405180910390fd5b600d8190556040805182815290517f8640e538c9503bd8d11554fc26280efe867c12195c0eee0aeede5f4a8d5288399181900360200190a150565b6001546001600160a01b031681565b60035460ff1681565b6000546001600160a01b031633146110f15760405162461bcd60e51b815260040180806020018281038252602f815260200180612fa3602f913960400191505060405180910390fd5b6103e88082106111325760405162461bcd60e51b8152600401808060200182810382526025815260200180612f396025913960400191505060405180910390fd5b600e8290556040805183815290517f59822dc2d999f6f0618e8b0db5cfc8496084574c769b09609d9b5f4394a310b69181900360200190a15050565b6000546001600160a01b031633146111b75760405162461bcd60e51b815260040180806020018281038252602f815260200180612fa3602f913960400191505060405180910390fd5b6301e1338081116111f95760405162461bcd60e51b81526004018080602001828103825260378152602001806131086037913960400191505060405180910390fd5b73fe9c9fda0dd1a07356e7bb236f9224fa3ab5a58763907af6c06040518163ffffffff1660e01b815260040160206040518083038186803b15801561123d57600080fd5b505af4158015611251573d6000803e3d6000fd5b505050506040513d602081101561126757600080fd5b50518111156112a75760405162461bcd60e51b815260040180806020018281038252602581526020018061306d6025913960400191505060405180910390fd5b60098190556112c0816301e1338063ffffffff61231016565b600a5560095460408051918252517fa90e14be5aa57b910aa6dc16c31ff1b5cda380ae25a793b0d3f74df6131a7d749181900360200190a150565b6005546000906001600160a01b0383811691161461131b57506000610e09565b60005b60075481101561140d5760006007828154811061133757fe5b6000918252602080832090910154808352600682526040928390205460055484516321f8a72160e01b81526004810184905294519295506001600160a01b03918216949116926321f8a72192602480840193829003018186803b15801561139d57600080fd5b505afa1580156113b1573d6000803e3d6000fd5b505050506040513d60208110156113c757600080fd5b50516001600160a01b03161415806113f457506000818152600660205260409020546001600160a01b0316155b1561140457600092505050610e09565b5060010161131e565b50600192915050565b60035460009060ff161561145b5760405162461bcd60e51b815260040180806020018281038252603c815260200180613031603c913960400191505060405180910390fd5b600480546001019081905561146e61237a565b6001600160a01b0316629919c06040518163ffffffff1660e01b81526004018080630e68aa8960e31b815250602001905060206040518083038186803b1580156114b757600080fd5b505afa1580156114cb573d6000803e3d6000fd5b505050506040513d60208110156114e157600080fd5b505115611535576040805162461bcd60e51b815260206004820152601d60248201527f426c6f636b656420617320734554482072617465206973207374616c65000000604482015290519081900360640190fd5b61153d6123cb565b6001600160a01b0316637c3125416040518163ffffffff1660e01b815260040160006040518083038186803b15801561157557600080fd5b505afa158015611589573d6000803e3d6000fd5b50505050600d543410156115ce5760405162461bcd60e51b815260040180806020018281038252603e815260200180612ff3603e913960400191505060405180910390fd5b600f5460ff1615611626576040805162461bcd60e51b815260206004820152601e60248201527f4c6f616e7320617265206e6f77206265696e67206c6971756964617465640000604482015290519081900360640190fd5b600e5433600090815260146020526040902054106116755760405162461bcd60e51b8152600401808060200182810382526022815260200180612f5e6022913960400191505060405180910390fd5b600061168034611a40565b9050600c5461169a8260115461241b90919063ffffffff16565b106116d65760405162461bcd60e51b8152600401808060200182810382526023815260200180612f806023913960400191505060405180910390fd5b6116de612475565b92506116e8612ea5565b506040805160c081018252338082523460208084019182528385018681524260608601908152608086018a8152600060a0880181815296815260148552978820805460018082018355918a5294909820875160069095020180546001600160a01b0319166001600160a01b039095169490941784559351968301969096555160028201559351600385015551600484015551600590920191909155601154611790908361241b565b60115561179b6124ad565b6001600160a01b031663867904b433846040518363ffffffff1660e01b815260040180836001600160a01b03166001600160a01b0316815260200182815260200192505050600060405180830381600087803b1580156117fa57600080fd5b505af115801561180e573d6000803e3d6000fd5b5050604080518781526020810186905281513394507f58d170de3a12438e22d81380f353b2fcac86f0a708a1374deaa5c6322a95992f93509081900390910190a2505060045481146118a7576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b5090565b6001546001600160a01b031633146118f45760405162461bcd60e51b8152600401808060200182810382526035815260200180612f046035913960400191505060405180910390fd5b600054600154604080516001600160a01b03938416815292909116602083015280517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9281900390910190a160018054600080546001600160a01b03199081166001600160a01b03841617909155169055565b60095481565b60085460008080808080808080808080611985611c40565b9b506009549a50600a549950600b549850600c549750600d5496506011549550601254945060135493504792506010549150600f60009054906101000a900460ff169050909192939495969798999a9b9c565b60006119e2612ea5565b6119ec84846121e4565b905060006119f9826124fa565b9050611a09826040015182611aed565b95945050505050565b6000611a1c612ea5565b611a2684846121e4565b9050610c44816124fa565b6000546001600160a01b031681565b6000610c48611a4d611c40565b839063ffffffff61253d16565b60025481565b60105481565b600080600080600080600080611a7a612ea5565b611a848b8b6121e4565b8051602082015160408301516060840151608085015160a0860151949e50929c50909a509850965094509050611ac287611abd836124fa565b611aed565b9250611add611ad0826122f5565b849063ffffffff61241b16565b9150509295985092959890939650565b6000611b14611b0783600a5461256790919063ffffffff16565b849063ffffffff6125c016565b9392505050565b6000546001600160a01b03163314611b645760405162461bcd60e51b815260040180806020018281038252602f815260200180612fa3602f913960400191505060405180910390fd5b600b8190556040805182815290517fe7bd72551c54d568cd97b00dc52d2787b5c5d4f0070d3582c1e8ba25141f799c9181900360200190a150565b60146020528160005260406000208181548110611bb857fe5b60009182526020909120600690910201805460018201546002830154600384015460048501546005909501546001600160a01b03909416965091945092909186565b611c02612ee4565b60005b6007548110156118a75760078181548110611c1c57fe5b9060005260206000200154828260188110611c3357fe5b6020020152600101611c05565b6000611c6060085468056bc75e2d631000006125d590919063ffffffff16565b905090565b6000546001600160a01b03163314611cae5760405162461bcd60e51b815260040180806020018281038252602f815260200180612fa3602f913960400191505060405180910390fd5b6010544211611d04576040805162461bcd60e51b815260206004820152601b60248201527f4265666f7265206c69717569646174696f6e20646561646c696e650000000000604482015290519081900360640190fd5b600f805460ff191682151517908190556040805160ff90921615158252517faa52cf15c1fbb778214c66f64726e141551158858d1c06ca0392c6c5869c8567916020908290030190a150565b60078181548110611d5d57fe5b600091825260209091200154905081565b600d5481565b6004805460010190819055611d8761237a565b6001600160a01b0316629919c06040518163ffffffff1660e01b81526004018080630e68aa8960e31b815250602001905060206040518083038186803b158015611dd057600080fd5b505afa158015611de4573d6000803e3d6000fd5b505050506040513d6020811015611dfa57600080fd5b505115611e4e576040805162461bcd60e51b815260206004820152601d60248201527f426c6f636b656420617320734554482072617465206973207374616c65000000604482015290519081900360640190fd5b611e5833836125ea565b6004548114610f7e576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b60085481565b6004805460010190819055611ec761237a565b6001600160a01b0316629919c06040518163ffffffff1660e01b81526004018080630e68aa8960e31b815250602001905060206040518083038186803b158015611f1057600080fd5b505afa158015611f24573d6000803e3d6000fd5b505050506040513d6020811015611f3a57600080fd5b505115611f8e576040805162461bcd60e51b815260206004820152601d60248201527f426c6f636b656420617320734554482072617465206973207374616c65000000604482015290519081900360640190fd5b600f5460ff16611fe5576040805162461bcd60e51b815260206004820152601760248201527f4c69717569646174696f6e206973206e6f74206f70656e000000000000000000604482015290519081900360640190fd5b611fef83836125ea565b6040805183815233602082015281516001600160a01b038616927fde21b2a43b0a2c2109c049fb1e4bb8653fd67d0ffd74fdcb662db381f1eeab38928290030190a26004548114612087576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b505050565b601881565b600f5460ff1681565b600a5481565b6000546001600160a01b031633146120e95760405162461bcd60e51b815260040180806020018281038252602f815260200180612fa3602f913960400191505060405180910390fd5b683635c9adc5dea00000811115612132576040805162461bcd60e51b81526020600482015260086024820152670a8dede40d0d2ced60c31b604482015290519081900360640190fd5b68056bc75e2d6310000081101561217a576040805162461bcd60e51b8152602060048201526007602482015266546f6f206c6f7760c81b604482015290519081900360640190fd5b60088190556040805182815290517ffb0ebe8c7316e6a251494c38876d13d9a3a029273fce7964c12aa2ce078695309181900360200190a150565b60115481565b600c5481565b6000610c48611a4d68056bc75e2d631000006008546125d590919063ffffffff16565b6121ec612ea5565b6001600160a01b0383166000908152601460209081526040808320805482518185028101850190935280835260609492939192909184015b828210156122955760008481526020908190206040805160c0810182526006860290920180546001600160a01b031683526001808201548486015260028201549284019290925260038101546060840152600481015460808401526005015460a08301529083529092019101612224565b509293506000925050505b81518110156122ed57838282815181106122b657fe5b60200260200101516080015114156122e5578181815181106122d457fe5b602002602001015192505050610c48565b6001016122a0565b505092915050565b6000610c48600b5483604001516125c090919063ffffffff16565b6000808211612366576040805162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b600082848161237157fe5b04949350505050565b6000611c606c45786368616e6765526174657360981b6040518060400160405280601d81526020017f4d697373696e672045786368616e676552617465732061646472657373000000815250612c0d565b6000611c606b53797374656d53746174757360a01b6040518060400160405280601c81526020017f4d697373696e672053797374656d537461747573206164647265737300000000815250612c0d565b600082820183811015611b14576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b60135460009061248c90600163ffffffff61241b16565b6013556012546124a390600163ffffffff61241b16565b6012819055905090565b6000611c60680a6f2dce8d0e68aa8960bb1b6040518060400160405280601981526020017f4d697373696e672053796e746873455448206164647265737300000000000000815250612c0d565b60a081015160009015158061252457606083015161251f90429063ffffffff612cb716565b611b14565b606083015160a0840151611b149163ffffffff612cb716565b6000670de0b6b3a7640000612558848463ffffffff61256716565b8161255f57fe5b049392505050565b60008261257657506000610c48565b8282028284828161258357fe5b0414611b145760405162461bcd60e51b8152600401808060200182810382526021815260200180612fd26021913960400191505060405180910390fd5b6000611b148383670de0b6b3a7640000612d14565b6000611b148383670de0b6b3a7640000612d51565b6125f26123cb565b6001600160a01b0316637c3125416040518163ffffffff1660e01b815260040160006040518083038186803b15801561262a57600080fd5b505afa15801561263e573d6000803e3d6000fd5b5050505061264a612ea5565b61265483836121e4565b905060008160800151116126a5576040805162461bcd60e51b8152602060048201526013602482015272131bd85b88191bd95cc81b9bdd08195e1a5cdd606a1b604482015290519081900360640190fd5b60a0810151156126f2576040805162461bcd60e51b8152602060048201526013602482015272131bd85b88185b1c9958591e4818db1bdcd959606a1b604482015290519081900360640190fd5b80604001516126ff6124ad565b6001600160a01b03166370a08231336040518263ffffffff1660e01b815260040180826001600160a01b03166001600160a01b0316815260200191505060206040518083038186803b15801561275457600080fd5b505afa158015612768573d6000803e3d6000fd5b505050506040513d602081101561277e57600080fd5b505110156127bd5760405162461bcd60e51b815260040180806020018281038252603e8152602001806130ca603e913960400191505060405180910390fd5b6127c681612d83565b60408101516011546127dd9163ffffffff612cb716565b60115560408101516000906127f590611abd846124fa565b90506000612802836122f5565b90506000612816838363ffffffff61241b16565b90506128206124ad565b6001600160a01b0316639dc29fac3386604001516040518363ffffffff1660e01b815260040180836001600160a01b03166001600160a01b0316815260200182815260200192505050600060405180830381600087803b15801561288357600080fd5b505af1158015612897573d6000803e3d6000fd5b505050506128a3612e17565b6001600160a01b0316630c928f05826040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b1580156128e657600080fd5b505afa1580156128fa573d6000803e3d6000fd5b505050506040513d602081101561291057600080fd5b505161291a612e58565b6001600160a01b03166370a08231612930612e17565b6040518263ffffffff1660e01b815260040180826001600160a01b03166001600160a01b0316815260200191505060206040518083038186803b15801561297657600080fd5b505afa15801561298a573d6000803e3d6000fd5b505050506040513d60208110156129a057600080fd5b505110156129df5760405162461bcd60e51b81526004018080602001828103825260388152602001806130926038913960400191505060405180910390fd5b6129e7612e17565b6001600160a01b0316631f930115826040518263ffffffff1660e01b81526004016020604051808303818588803b158015612a2157600080fd5b505af1158015612a35573d6000803e3d6000fd5b50505050506040513d6020811015612a4c57600080fd5b50612a579050612e58565b6001600160a01b031663a9059cbb73feefeefeefeefeefeefeefeefeefeefeefeefeef612a82612e58565b6001600160a01b03166370a08231306040518263ffffffff1660e01b815260040180826001600160a01b03166001600160a01b0316815260200191505060206040518083038186803b158015612ad757600080fd5b505afa158015612aeb573d6000803e3d6000fd5b505050506040513d6020811015612b0157600080fd5b5051604080516001600160e01b031960e086901b1681526001600160a01b03909316600484015260248301919091525160448083019260209291908290030181600087803b158015612b5257600080fd5b505af1158015612b66573d6000803e3d6000fd5b505050506040513d6020811015612b7c57600080fd5b5050602084015133906108fc90612b99908463ffffffff612cb716565b6040518115909202916000818181858888f19350505050158015612bc1573d6000803e3d6000fd5b50604080518681526020810183905281516001600160a01b038916927f3cc9f5d298758bad94536f27fa6a3033c2793e0a387a2d78e72550a3b8dacf1e928290030190a2505050505050565b6000828152600660205260408120546001600160a01b03168281612caf5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612c74578181015183820152602001612c5c565b50505050905090810190601f168015612ca15780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b509392505050565b600082821115612d0e576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b600080600a8304612d2b868663ffffffff61256716565b81612d3257fe5b0490506005600a825b0610612d4557600a015b600a9004949350505050565b600080612d7784612d6b87600a870263ffffffff61256716565b9063ffffffff61231016565b90506005600a82612d3b565b80516001600160a01b03166000908152601460205260408120905b8154811015612dfb578260800151828281548110612db857fe5b9060005260206000209060060201600401541415612df35742828281548110612ddd57fe5b9060005260206000209060060201600501819055505b600101612d9e565b50601354612e1090600163ffffffff612cb716565b6013555050565b6000611c606411195c1bdd60da1b604051806040016040528060158152602001744d697373696e67204465706f74206164647265737360581b815250612c0d565b6000611c606814de5b9d1a1cd554d160ba1b6040518060400160405280601981526020017f4d697373696e672053796e746873555344206164647265737300000000000000815250612c0d565b6040518060c0016040528060006001600160a01b0316815260200160008152602001600081526020016000815260200160008152602001600081525090565b604051806103000160405280601890602082028038833950919291505056fe596f75206d757374206265206e6f6d696e61746564206265666f726520796f752063616e20616363657074206f776e6572736869704f776e65722063616e6e6f742073657420686967686572207468616e20484152445f43415045616368206163636f756e74206973206c696d74656420746f203530206c6f616e734c6f616e20416d6f756e7420657863656564732074686520737570706c79206361702e4f6e6c792074686520636f6e7472616374206f776e6572206d617920706572666f726d207468697320616374696f6e536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f774e6f7420656e6f7567682045544820746f206372656174652074686973206c6f616e2e20506c656173652073656520746865206d696e4c6f616e53697a655468697320616374696f6e2063616e6e6f7420626520706572666f726d6564207768696c652074686520636f6e747261637420697320706175736564496e7465726573742063616e6e6f74206265206d6f7265207468616e2031303025204150525468652073555344204465706f7420646f6573206e6f74206861766520656e6f756768207355534420746f2062757920666f722066656573596f7520646f206e6f742068617665207468652072657175697265642053796e74682062616c616e636520746f20636c6f73652074686973206c6f616e2e496e74657265737420726174652063616e6e6f74206265206c657373207468617420746865205345434f4e44535f494e5f415f59454152a265627a7a723158209d476129114ccd34745998b5a3b0af3a75c6f37f5e09a662eb0186025949d44e64736f6c63430005100032000000000000000000000000b64ff7a4a33acdf48d97dab0d764afd0f617688200000000000000000000000001bf3a96c4b0fa6e36ef23150a4c407f653be9b9

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

000000000000000000000000b64ff7a4a33acdf48d97dab0d764afd0f617688200000000000000000000000001bf3a96c4b0fa6e36ef23150a4c407f653be9b9

-----Decoded View---------------
Arg [0] : _owner (address): 0xb64ff7a4a33acdf48d97dab0d764afd0f6176882
Arg [1] : _resolver (address): 0x01bf3a96c4b0fa6e36ef23150a4c407f653be9b9

-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 000000000000000000000000b64ff7a4a33acdf48d97dab0d764afd0f6176882
Arg [1] : 00000000000000000000000001bf3a96c4b0fa6e36ef23150a4c407f653be9b9


Library Used

SafeDecimalMath : 0xfe9c9fda0dd1a07356e7bb236f9224fa3ab5a587

Block Transaction Difficulty Gas Used Reward
Block Uncle Number Difficulty Gas Used Reward
Loading