ETH Price: $2,934.17 (-2.29%)
Gas: 5 Gwei

Token

Synthetix Network Token (SNX)
 

Overview

Max Total Supply

328,193,104.088773603337882496 SNX

Holders

3 (0.00%)

Market

Price

$2.61 @ 0.000890 ETH (-0.30%)

Onchain Market Cap

$856,584,001.67

Circulating Supply Market Cap

$854,115,056.00

Other Info

Token Contract (WITH 18 Decimals)

Filtered by Token Holder
Synthetix: Legacy Proxy SNX
Balance
507.809929100000000184 SNX

Value
$1,325.38 ( ~0.451705127311781 Eth) [0.0002%]
0xc011a72400e58ecd99ee497cf89e3775d4bd732f
Loading...
Loading
Loading...
Loading
Loading...
Loading

OVERVIEW

Synthetix is the backbone for derivatives trading in DeFi, allowing anyone, anywhere to gain on-chain exposure to a vast range of assets.

# Exchange Pair Price  24H Volume % Volume
1
Binance
SNX-USDT$2.61
0.0008884 Eth
$6,258,409.00
2,436,912.500 SNX
18.3808%
2
Gate.io
SNX-USDT$2.61
0.0008884 Eth
$4,647,271.00
1,820,970.980 SNX
13.7349%
3
OKX
SNX-USDT$2.61
0.0008887 Eth
$2,426,246.00
944,446.451 SNX
7.1236%
4
WhiteBIT
SNX-USDT$2.60
0.0008863 Eth
$1,666,903.00
640,996.459 SNX
4.8348%
5
Bybit
SNX-USDT$2.60
0.0008877 Eth
$1,203,294.00
469,481.040 SNX
3.5411%
6
BitVenus
SNX-USDT$2.61
0.0008881 Eth
$950,257.00
368,754.700 SNX
2.7814%
7
Trubit
SNX-USDT$2.60
0.0008866 Eth
$943,114.00
366,047.500 SNX
2.7610%
8
LBank
SNX-USDT$2.60
0.0008870 Eth
$936,850.00
359,982.912 SNX
2.7152%
9
Coinbase Exchange
SNX-USD$2.61
0.0008891 Eth
$915,572.00
350,928.425 SNX
2.6469%
10
DigiFinex
SNX-USDT$2.61
0.0008891 Eth
$903,362.00
346,245.100 SNX
2.6116%
11
Bitci TR
SNX-USDT$2.60
0.0008876 Eth
$876,594.00
339,457.500 SNX
2.5604%
12
Uniswap V3 (Optimism)
0X8700DAEC35AF8FF88C16BDF0418774CB3D7599B4-0X4200000000000000000000000000000000000006$2.60
0.0008874 Eth
$832,309.00
322,451.150 0X8700DAEC35AF8FF88C16BDF0418774CB3D7599B4
2.4321%
13
HTX
SNX-USDT$2.62
0.0008933 Eth
$798,422.00
308,873.177 SNX
2.3297%
14
Azbit
SNX-BTC$2.60
0.0008875 Eth
$784,769.00
305,247.500 SNX
2.3024%
15
CoinW
SNX-USDT$2.61
0.0008882 Eth
$682,029.00
261,681.659 SNX
1.9738%
16
Azbit
SNX-USDT$2.60
0.0008870 Eth
$530,561.00
205,765.700 SNX
1.5520%
17
BtcTurk | Kripto
SNX-TRY$2.62
0.0008942 Eth
$510,217.00
194,442.220 SNX
1.4666%
18
Coinstore
SNX-USDT$2.60
0.0008859 Eth
$504,242.00
195,955.300 SNX
1.4780%
19
KuCoin
SNX-USDT$2.60
0.0008867 Eth
$484,752.00
186,297.330 SNX
1.4052%
20
CoinCatch
SNX-USDT$2.61
0.0008883 Eth
$483,901.00
187,362.374 SNX
1.4132%
21
Velodrome SlipStream
0X0B2C639C533813F4AA9D7837CAF62653D097FF85-0X8700DAEC35AF8FF88C16BDF0418774CB3D7599B4$2.61
0.0008885 Eth
$448,917.00
445,158.475 0X0B2C639C533813F4AA9D7837CAF62653D097FF85
3.3577%
22
Icrypex
SNX-USDT$2.60
0.0008876 Eth
$418,331.00
160,619.662 SNX
1.2115%
23
BitMart
SNX-USDT$2.60
0.0008874 Eth
$373,259.00
143,338.760 SNX
1.0812%
24
Bitazza
SNX-USDT$2.61
0.0008897 Eth
$320,376.00
124,153.600 SNX
0.9364%
25
Hotcoin Global
SNX-USDT$2.61
0.0008881 Eth
$318,207.00
122,104.200 SNX
0.9210%
26
XT.COM
SNX-USDT$2.61
0.0008887 Eth
$284,089.00
110,108.800 SNX
0.8305%
27
Phemex
SNX-USDT$2.61
0.0008880 Eth
$280,115.00
107,509.917 SNX
0.8109%
28
BitDelta
SNX-USDT$2.61
0.0008881 Eth
$241,303.00
93,630.200 SNX
0.7062%
29
BtcTurk | Kripto
SNX-USDT$2.60
0.0008867 Eth
$237,802.00
91,390.820 SNX
0.6893%
30
Bitget
SNX-USDT$2.61
0.0008893 Eth
$226,831.00
88,441.430 SNX
0.6671%
31
FameEX
SNX-USDT$2.61
0.0008882 Eth
$219,843.00
85,344.694 SNX
0.6437%
32
CoinTR Pro
SNX-USDT$2.61
0.0008887 Eth
$172,559.00
67,150.800 SNX
0.5065%
33
Bitunix
SNX-USDT$2.61
0.0008882 Eth
$171,356.00
65,732.970 SNX
0.4958%
34
Kraken
SNX-USD$2.61
0.0008877 Eth
$169,704.00
65,145.376 SNX
0.4914%
35
BingX
SNX-USDT$2.61
0.0008884 Eth
$166,994.00
65,002.603 SNX
0.4903%
36
PointPay
SNX-USDT$2.61
0.0008881 Eth
$150,921.00
58,770.088 SNX
0.4433%
37
BYDFi
SNX-USDT$2.60
0.0008880 Eth
$144,877.00
55,623.900 SNX
0.4196%
38
AscendEX (BitMax)
SNX-USDT$2.60
0.0008849 Eth
$140,626.00
54,147.550 SNX
0.4084%
39
Binance
SNX-BTC$2.61
0.0008878 Eth
$131,949.00
51,531.100 SNX
0.3887%
40
P2B
SNX-USDT$2.61
0.0008884 Eth
$130,921.00
50,218.300 SNX
0.3788%
41
Velodrome Finance v2
0X8700DAEC35AF8FF88C16BDF0418774CB3D7599B4-0X7F5C764CBC14F9669B88837CA1490CCA17C31607$2.61
0.0008891 Eth
$123,761.00
48,427.311 0X8700DAEC35AF8FF88C16BDF0418774CB3D7599B4
0.3653%
42
MEXC
SNX-USDT$2.61
0.0008880 Eth
$110,649.00
42,461.460 SNX
0.3203%
43
Deepcoin
SNX-USDT$2.60
0.0008876 Eth
$106,160.00
41,955.400 SNX
0.3165%
44
Upbit
SNX-BTC$2.62
0.0008931 Eth
$95,739.00
36,529.167 SNX
0.2755%
45
Kraken
SNX-EUR$2.60
0.0008874 Eth
$85,824.00
32,956.436 SNX
0.2486%
46
Bitkub
SNX-THB$2.61
0.0008892 Eth
$80,721.00
30,933.897 SNX
0.2333%
47
Bitrue
SNX-USDT$2.61
0.0008883 Eth
$49,572.00
19,016.000 SNX
0.1434%
48
P2B
SNX-USD$2.61
0.0008898 Eth
$47,604.00
18,232.100 SNX
0.1375%
49
LATOKEN
SNX-USDT$2.61
0.0008883 Eth
$45,020.00
17,269.030 SNX
0.1303%
50
Bitvavo
SNX-EUR$2.60
0.0008849 Eth
$44,666.00
17,198.418 SNX
0.1297%
51
Tapbit
SNX-USDT$2.60
0.0008870 Eth
$42,387.00
16,492.700 SNX
0.1244%
52
Coinbase Exchange
SNX-GBP$2.60
0.0008875 Eth
$38,842.00
14,913.756 SNX
0.1125%
53
Dex-Trade
SNX-USDT$2.60
0.0008873 Eth
$37,529.00
14,415.100 SNX
0.1087%
54
Uniswap V3 (Polygon)
0X50B728D8D964FD00C2D0AAD81718B71311FEF68A-0X0D500B1D8E8EF31E21C99D1DB9A6444D3ADF1270$2.60
0.0008868 Eth
$36,394.00
13,777.271 0X50B728D8D964FD00C2D0AAD81718B71311FEF68A
0.1039%
55
WhiteBIT
SNX-BTC$2.60
0.0008875 Eth
$35,188.00
13,513.000 SNX
0.1019%
56
Coinbase Exchange
SNX-EUR$2.61
0.0008889 Eth
$33,350.00
12,785.520 SNX
0.0964%
57
Kanga
SNX-USDT$2.60
0.0008863 Eth
$32,413.00
0.000 SNX
0.0000%
58
Slex
SNX-USDT$2.60
0.0008870 Eth
$31,927.00
12,460.300 SNX
0.0940%
59
Bitazza
SNX-THB$2.62
0.0008924 Eth
$30,528.00
11,755.400 SNX
0.0887%
60
HitBTC
SNX-USDT$2.61
0.0008879 Eth
$24,093.00
9,342.530 SNX
0.0705%
61
WOO X
SNX-USDT$2.60
0.0008876 Eth
$22,878.00
8,784.090 SNX
0.0663%
62
KuCoin
SNX-ETH$2.60
0.0008874 Eth
$21,607.00
8,296.927 SNX
0.0626%
63
ProBit Global
SNX-USDT$2.61
0.0008897 Eth
$20,594.00
7,887.451 SNX
0.0595%
64
Uniswap V3 (Optimism)
0X8700DAEC35AF8FF88C16BDF0418774CB3D7599B4-0X7F5C764CBC14F9669B88837CA1490CCA17C31607$2.60
0.0008873 Eth
$19,928.97
7,728.113 0X8700DAEC35AF8FF88C16BDF0418774CB3D7599B4
0.0583%
65
Cryptology
SNX-USDT$2.60
0.0008871 Eth
$19,016.63
7,308.700 SNX
0.0551%
66
BTSE
SNX-USDT$2.60
0.0008870 Eth
$14,889.37
5,721.215 SNX
0.0432%
67
TokoCrypto
SNX-USDT$2.61
0.0008888 Eth
$14,802.70
5,682.067 SNX
0.0429%
68
Crypto.com Exchange
SNX-USD$2.61
0.0008886 Eth
$14,684.12
5,630.200 SNX
0.0425%
69
Indodax
SNX-IDR$2.59
0.0008821 Eth
$13,640.59
5,269.368 SNX
0.0397%
70
Coinbase Exchange
SNX-BTC$2.61
0.0008878 Eth
$13,086.13
5,022.750 SNX
0.0379%
71
Bitso
SNX-USD$2.61
0.0008878 Eth
$12,989.14
4,986.233 SNX
0.0376%
72
PointPay
SNX-BTC$2.61
0.0008890 Eth
$12,787.07
4,979.826 SNX
0.0376%
73
Coins.ph
SNX-PHP$2.62
0.0008925 Eth
$12,786.77
4,897.010 SNX
0.0369%
74
Crypto.com Exchange
SNX-USDT$2.61
0.0008883 Eth
$11,317.82
4,341.200 SNX
0.0327%
75
BitStorage
SNX-USDT$2.61
0.0008890 Eth
$10,295.91
3,946.200 SNX
0.0298%
76
Gemini
SNX-USD$2.60
0.0008853 Eth
$10,055.51
3,870.481 SNX
0.0292%
77
Kraken
SNX-XBT$2.61
0.0008895 Eth
$9,613.03
3,687.719 SNX
0.0278%
78
CoinEx
SNX-USDT$2.61
0.0008884 Eth
$7,427.78
2,878.257 SNX
0.0217%
79
Velodrome Finance v2
0X1F32B1C2345538C0C6F582FCB022739C4A194EBB-0X8700DAEC35AF8FF88C16BDF0418774CB3D7599B4$2.61
0.0008892 Eth
$6,458.41
1.869 0X1F32B1C2345538C0C6F582FCB022739C4A194EBB
0.0000%
80
Uniswap V2 (Ethereum)
0XC011A73EE8576FB46F5E1C5751CA3B9FE0AF2A6F-0XC02AAA39B223FE8D0A0E5C4F27EAD9083C756CC2$2.62
0.0008933 Eth
$5,577.47
2,156.099 0XC011A73EE8576FB46F5E1C5751CA3B9FE0AF2A6F
0.0163%
81
Bitstamp
SNX-USD$2.61
0.0008891 Eth
$5,387.98
2,065.144 SNX
0.0156%
82
Solidly V3 (Optimism)
0X8700DAEC35AF8FF88C16BDF0418774CB3D7599B4-0X4200000000000000000000000000000000000006$2.61
0.0008880 Eth
$4,455.93
1,714.887 0X8700DAEC35AF8FF88C16BDF0418774CB3D7599B4
0.0129%
83
WEEX
SNX-USDT$2.60
0.0008872 Eth
$3,924.90
1,529.338 SNX
0.0115%
84
HashKey Exchange
SNX-USD$2.60
0.0008869 Eth
$3,618.82
1,400.290 SNX
0.0106%
85
Koinpark
SNX-USDT$2.60
0.0008876 Eth
$2,579.82
990.430 SNX
0.0075%
86
CoinEx
SNX-USDC$2.60
0.0008869 Eth
$2,479.22
961.265 SNX
0.0073%
87
Uniswap V3 (Optimism)
0X4200000000000000000000000000000000000042-0X8700DAEC35AF8FF88C16BDF0418774CB3D7599B4$2.60
0.0008879 Eth
$1,764.47
672.287 0X4200000000000000000000000000000000000042
0.0051%
88
KuCoin
SNX-BTC$2.59
0.0008837 Eth
$1,486.97
573.390 SNX
0.0043%
89
Velodrome Finance
0X8700DAEC35AF8FF88C16BDF0418774CB3D7599B4-0X7F5C764CBC14F9669B88837CA1490CCA17C31607$2.60
0.0008860 Eth
$1,395.02
543.926 0X8700DAEC35AF8FF88C16BDF0418774CB3D7599B4
0.0041%
90
Uniswap V3 (Polygon)
0X50B728D8D964FD00C2D0AAD81718B71311FEF68A-0X7CEB23FD6BC0ADD59E62AC25578270CFF1B9F619$2.62
0.0008939 Eth
$1,288.78
496.539 0X50B728D8D964FD00C2D0AAD81718B71311FEF68A
0.0037%
91
ApeSwap (Polygon)
0X50B728D8D964FD00C2D0AAD81718B71311FEF68A-0X0D500B1D8E8EF31E21C99D1DB9A6444D3ADF1270$2.61
0.0008909 Eth
$1,175.50
444.324 0X50B728D8D964FD00C2D0AAD81718B71311FEF68A
0.0034%
92
Sushiswap (Polygon POS)
0X50B728D8D964FD00C2D0AAD81718B71311FEF68A-0X7CEB23FD6BC0ADD59E62AC25578270CFF1B9F619$2.62
0.0008934 Eth
$751.25
290.144 0X50B728D8D964FD00C2D0AAD81718B71311FEF68A
0.0022%
93
Bancor (V2)
SNX-BNT$2.65
0.0009019 Eth
$706.12
266.793 SNX
0.0020%
94
Dex-Trade
SNX-BTC$2.60
0.0008877 Eth
$690.21
265.000 SNX
0.0020%
95
Nominex
SNX-USDT$2.60
0.0008880 Eth
$595.95
228.807 SNX
0.0017%
96
Coinmetro
SNX-EUR$2.61
0.0008880 Eth
$426.78
163.800 SNX
0.0012%
97
Uniswap V3 (Polygon)
0X50B728D8D964FD00C2D0AAD81718B71311FEF68A-0XD6DF932A45C0F255F85145F286EA0B292B21C90B$2.62
0.0008918 Eth
$352.67
133.966 0X50B728D8D964FD00C2D0AAD81718B71311FEF68A
0.0010%
98
Balancer V2 (Polygon)
0X50B728D8D964FD00C2D0AAD81718B71311FEF68A-USDC$2.62
0.0008921 Eth
$210.86
80.547 0X50B728D8D964FD00C2D0AAD81718B71311FEF68A
0.0006%
99
Uniswap V3 (Optimism)
0X0B2C639C533813F4AA9D7837CAF62653D097FF85-0X8700DAEC35AF8FF88C16BDF0418774CB3D7599B4$2.60
0.0008879 Eth
$188.86
188.259 0X0B2C639C533813F4AA9D7837CAF62653D097FF85
0.0014%
100
Coinmetro
SNX-USD$2.61
0.0008883 Eth
$0.00
0.000 SNX
0.0000%

Contract Source Code Verified (Exact Match)

Contract Name:
Synthetix

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 2023-03-22
*/

/*

⚠⚠⚠ WARNING WARNING WARNING ⚠⚠⚠

This is a TARGET contract - DO NOT CONNECT TO IT DIRECTLY IN YOUR CONTRACTS or DAPPS!

This contract has an associated PROXY that MUST be used for all integrations - this TARGET will be REPLACED in an upcoming Synthetix release!
The proxy for this contract can be found here:

https://contracts.synthetix.io/ProxySynthetix

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

* Synthetix: Synthetix.sol
*
* Latest source (may be newer): https://github.com/Synthetixio/synthetix/blob/master/contracts/Synthetix.sol
* Docs: https://docs.synthetix.io/contracts/Synthetix
*
* Contract Dependencies: 
*	- BaseSynthetix
*	- ExternStateToken
*	- IAddressResolver
*	- IERC20
*	- ISynthetix
*	- MixinResolver
*	- Owned
*	- Proxyable
*	- State
* Libraries: 
*	- SafeDecimalMath
*	- SafeMath
*	- VestingEntries
*
* MIT License
* ===========
*
* Copyright (c) 2023 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
*/



pragma solidity >=0.4.24;

// https://docs.synthetix.io/contracts/source/interfaces/ierc20
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);
}


// https://docs.synthetix.io/contracts/source/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 {
        _onlyOwner();
        _;
    }

    function _onlyOwner() private view {
        require(msg.sender == owner, "Only the contract owner may perform this action");
    }

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


// Inheritance


// Internal references


// https://docs.synthetix.io/contracts/source/contracts/proxy
contract Proxy is Owned {
    Proxyable public target;

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

    function setTarget(Proxyable _target) external onlyOwner {
        target = _target;
        emit TargetUpdated(_target);
    }

    function _emit(
        bytes calldata callData,
        uint numTopics,
        bytes32 topic1,
        bytes32 topic2,
        bytes32 topic3,
        bytes32 topic4
    ) external onlyTarget {
        uint size = callData.length;
        bytes memory _callData = callData;

        assembly {
            /* The first 32 bytes of callData contain its length (as specified by the abi).
             * Length is assumed to be a uint256 and therefore maximum of 32 bytes
             * in length. It is also leftpadded to be a multiple of 32 bytes.
             * This means moving call_data across 32 bytes guarantees we correctly access
             * the data itself. */
            switch numTopics
                case 0 {
                    log0(add(_callData, 32), size)
                }
                case 1 {
                    log1(add(_callData, 32), size, topic1)
                }
                case 2 {
                    log2(add(_callData, 32), size, topic1, topic2)
                }
                case 3 {
                    log3(add(_callData, 32), size, topic1, topic2, topic3)
                }
                case 4 {
                    log4(add(_callData, 32), size, topic1, topic2, topic3, topic4)
                }
        }
    }

    // solhint-disable no-complex-fallback
    function() external payable {
        // Mutable call setting Proxyable.messageSender as this is using call not delegatecall
        target.setMessageSender(msg.sender);

        assembly {
            let free_ptr := mload(0x40)
            calldatacopy(free_ptr, 0, calldatasize)

            /* We must explicitly forward ether to the underlying contract as well. */
            let result := call(gas, sload(target_slot), callvalue, free_ptr, calldatasize, 0, 0)
            returndatacopy(free_ptr, 0, returndatasize)

            if iszero(result) {
                revert(free_ptr, returndatasize)
            }
            return(free_ptr, returndatasize)
        }
    }

    modifier onlyTarget {
        require(Proxyable(msg.sender) == target, "Must be proxy target");
        _;
    }

    event TargetUpdated(Proxyable newTarget);
}


// Inheritance


// Internal references


// https://docs.synthetix.io/contracts/source/contracts/proxyable
contract Proxyable is Owned {
    // This contract should be treated like an abstract contract

    /* The proxy this contract exists behind. */
    Proxy public proxy;

    /* The caller of the proxy, passed through to this contract.
     * Note that every function using this member must apply the onlyProxy or
     * optionalProxy modifiers, otherwise their invocations can use stale values. */
    address public messageSender;

    constructor(address payable _proxy) internal {
        // This contract is abstract, and thus cannot be instantiated directly
        require(owner != address(0), "Owner must be set");

        proxy = Proxy(_proxy);
        emit ProxyUpdated(_proxy);
    }

    function setProxy(address payable _proxy) external onlyOwner {
        proxy = Proxy(_proxy);
        emit ProxyUpdated(_proxy);
    }

    function setMessageSender(address sender) external onlyProxy {
        messageSender = sender;
    }

    modifier onlyProxy {
        _onlyProxy();
        _;
    }

    function _onlyProxy() private view {
        require(Proxy(msg.sender) == proxy, "Only the proxy can call");
    }

    modifier optionalProxy {
        _optionalProxy();
        _;
    }

    function _optionalProxy() private {
        if (Proxy(msg.sender) != proxy && messageSender != msg.sender) {
            messageSender = msg.sender;
        }
    }

    modifier optionalProxy_onlyOwner {
        _optionalProxy_onlyOwner();
        _;
    }

    // solhint-disable-next-line func-name-mixedcase
    function _optionalProxy_onlyOwner() private {
        if (Proxy(msg.sender) != proxy && messageSender != msg.sender) {
            messageSender = msg.sender;
        }
        require(messageSender == owner, "Owner only function");
    }

    event ProxyUpdated(address proxyAddress);
}


/**
 * @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/source/libraries/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;
    }

    // Computes `a - b`, setting the value to 0 if b > a.
    function floorsub(uint a, uint b) internal pure returns (uint) {
        return b >= a ? 0 : a - b;
    }

    /* ---------- Utilities ---------- */
    /*
     * Absolute value of the input, returned as a signed number.
     */
    function signedAbs(int x) internal pure returns (int) {
        return x < 0 ? -x : x;
    }

    /*
     * Absolute value of the input, returned as an unsigned number.
     */
    function abs(int x) internal pure returns (uint) {
        return uint(signedAbs(x));
    }
}


// Inheritance


// https://docs.synthetix.io/contracts/source/contracts/state
contract State is Owned {
    // the address of the contract that can modify variables
    // this can only be changed by the owner of this contract
    address public associatedContract;

    constructor(address _associatedContract) internal {
        // This contract is abstract, and thus cannot be instantiated directly
        require(owner != address(0), "Owner must be set");

        associatedContract = _associatedContract;
        emit AssociatedContractUpdated(_associatedContract);
    }

    /* ========== SETTERS ========== */

    // Change the associated contract to a new address
    function setAssociatedContract(address _associatedContract) external onlyOwner {
        associatedContract = _associatedContract;
        emit AssociatedContractUpdated(_associatedContract);
    }

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

    modifier onlyAssociatedContract {
        require(msg.sender == associatedContract, "Only the associated contract can perform this action");
        _;
    }

    /* ========== EVENTS ========== */

    event AssociatedContractUpdated(address associatedContract);
}


// Inheritance


// https://docs.synthetix.io/contracts/source/contracts/tokenstate
contract TokenState is Owned, State {
    /* ERC20 fields. */
    mapping(address => uint) public balanceOf;
    mapping(address => mapping(address => uint)) public allowance;

    constructor(address _owner, address _associatedContract) public Owned(_owner) State(_associatedContract) {}

    /* ========== SETTERS ========== */

    /**
     * @notice Set ERC20 allowance.
     * @dev Only the associated contract may call this.
     * @param tokenOwner The authorising party.
     * @param spender The authorised party.
     * @param value The total value the authorised party may spend on the
     * authorising party's behalf.
     */
    function setAllowance(
        address tokenOwner,
        address spender,
        uint value
    ) external onlyAssociatedContract {
        allowance[tokenOwner][spender] = value;
    }

    /**
     * @notice Set the balance in a given account
     * @dev Only the associated contract may call this.
     * @param account The account whose value to set.
     * @param value The new balance of the given account.
     */
    function setBalanceOf(address account, uint value) external onlyAssociatedContract {
        balanceOf[account] = value;
    }
}


// Inheritance


// Libraries


// Internal references


// https://docs.synthetix.io/contracts/source/contracts/externstatetoken
contract ExternStateToken is Owned, Proxyable {
    using SafeMath for uint;
    using SafeDecimalMath for uint;

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

    /* Stores balances and allowances. */
    TokenState public tokenState;

    /* Other ERC20 fields. */
    string public name;
    string public symbol;
    uint public totalSupply;
    uint8 public decimals;

    constructor(
        address payable _proxy,
        TokenState _tokenState,
        string memory _name,
        string memory _symbol,
        uint _totalSupply,
        uint8 _decimals,
        address _owner
    ) public Owned(_owner) Proxyable(_proxy) {
        tokenState = _tokenState;

        name = _name;
        symbol = _symbol;
        totalSupply = _totalSupply;
        decimals = _decimals;
    }

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

    /**
     * @notice Returns the ERC20 allowance of one party to spend on behalf of another.
     * @param owner The party authorising spending of their funds.
     * @param spender The party spending tokenOwner's funds.
     */
    function allowance(address owner, address spender) public view returns (uint) {
        return tokenState.allowance(owner, spender);
    }

    /**
     * @notice Returns the ERC20 token balance of a given account.
     */
    function balanceOf(address account) external view returns (uint) {
        return tokenState.balanceOf(account);
    }

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

    /**
     * @notice Set the address of the TokenState contract.
     * @dev This can be used to "pause" transfer functionality, by pointing the tokenState at 0x000..
     * as balances would be unreachable.
     */
    function setTokenState(TokenState _tokenState) external optionalProxy_onlyOwner {
        tokenState = _tokenState;
        emitTokenStateUpdated(address(_tokenState));
    }

    function _internalTransfer(
        address from,
        address to,
        uint value
    ) internal returns (bool) {
        /* Disallow transfers to irretrievable-addresses. */
        require(to != address(0) && to != address(this) && to != address(proxy), "Cannot transfer to this address");

        // Insufficient balance will be handled by the safe subtraction.
        tokenState.setBalanceOf(from, tokenState.balanceOf(from).sub(value));
        tokenState.setBalanceOf(to, tokenState.balanceOf(to).add(value));

        // Emit a standard ERC20 transfer event
        emitTransfer(from, to, value);

        return true;
    }

    /**
     * @dev Perform an ERC20 token transfer. Designed to be called by transfer functions possessing
     * the onlyProxy or optionalProxy modifiers.
     */
    function _transferByProxy(
        address from,
        address to,
        uint value
    ) internal returns (bool) {
        return _internalTransfer(from, to, value);
    }

    /*
     * @dev Perform an ERC20 token transferFrom. Designed to be called by transferFrom functions
     * possessing the optionalProxy or optionalProxy modifiers.
     */
    function _transferFromByProxy(
        address sender,
        address from,
        address to,
        uint value
    ) internal returns (bool) {
        /* Insufficient allowance will be handled by the safe subtraction. */
        tokenState.setAllowance(from, sender, tokenState.allowance(from, sender).sub(value));
        return _internalTransfer(from, to, value);
    }

    /**
     * @notice Approves spender to transfer on the message sender's behalf.
     */
    function approve(address spender, uint value) public optionalProxy returns (bool) {
        address sender = messageSender;

        tokenState.setAllowance(sender, spender, value);
        emitApproval(sender, spender, value);
        return true;
    }

    /* ========== EVENTS ========== */
    function addressToBytes32(address input) internal pure returns (bytes32) {
        return bytes32(uint256(uint160(input)));
    }

    event Transfer(address indexed from, address indexed to, uint value);
    bytes32 internal constant TRANSFER_SIG = keccak256("Transfer(address,address,uint256)");

    function emitTransfer(
        address from,
        address to,
        uint value
    ) internal {
        proxy._emit(abi.encode(value), 3, TRANSFER_SIG, addressToBytes32(from), addressToBytes32(to), 0);
    }

    event Approval(address indexed owner, address indexed spender, uint value);
    bytes32 internal constant APPROVAL_SIG = keccak256("Approval(address,address,uint256)");

    function emitApproval(
        address owner,
        address spender,
        uint value
    ) internal {
        proxy._emit(abi.encode(value), 3, APPROVAL_SIG, addressToBytes32(owner), addressToBytes32(spender), 0);
    }

    event TokenStateUpdated(address newTokenState);
    bytes32 internal constant TOKENSTATEUPDATED_SIG = keccak256("TokenStateUpdated(address)");

    function emitTokenStateUpdated(address newTokenState) internal {
        proxy._emit(abi.encode(newTokenState), 1, TOKENSTATEUPDATED_SIG, 0, 0, 0);
    }
}


// https://docs.synthetix.io/contracts/source/interfaces/iaddressresolver
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);
}


// https://docs.synthetix.io/contracts/source/interfaces/isynth
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;
}


// https://docs.synthetix.io/contracts/source/interfaces/iissuer
interface IIssuer {
    // Views

    function allNetworksDebtInfo()
        external
        view
        returns (
            uint256 debt,
            uint256 sharesSupply,
            bool isStale
        );

    function anySynthOrSNXRateIsInvalid() external view returns (bool anyRateInvalid);

    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 collateralisationRatioAndAnyRatesInvalid(address _issuer)
        external
        view
        returns (uint cratio, bool anyRateIsInvalid);

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

    function issuanceRatio() external view returns (uint);

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

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

    function minimumStakeTime() external view returns (uint);

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

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

    function getSynths(bytes32[] calldata currencyKeys) external view returns (ISynth[] memory);

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

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

    function transferableSynthetixAndAnyRateIsInvalid(address account, uint balance)
        external
        view
        returns (uint transferable, bool anyRateIsInvalid);

    function liquidationAmounts(address account, bool isSelfLiquidation)
        external
        view
        returns (
            uint totalRedeemed,
            uint debtToRemove,
            uint escrowToLiquidate,
            uint initialDebtBalance
        );

    // Restricted: used internally to Synthetix
    function addSynths(ISynth[] calldata synthsToAdd) external;

    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 burnForRedemption(
        address deprecatedSynthProxy,
        address account,
        uint balance
    ) external;

    function setCurrentPeriodId(uint128 periodId) external;

    function liquidateAccount(address account, bool isSelfLiquidation)
        external
        returns (
            uint totalRedeemed,
            uint debtRemoved,
            uint escrowToLiquidate
        );

    function issueSynthsWithoutDebt(
        bytes32 currencyKey,
        address to,
        uint amount
    ) external returns (bool rateInvalid);

    function burnSynthsWithoutDebt(
        bytes32 currencyKey,
        address to,
        uint amount
    ) external returns (bool rateInvalid);

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


// Inheritance


// Internal references


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

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

    /* ========== RESTRICTED 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++) {
            bytes32 name = names[i];
            address destination = destinations[i];
            repository[name] = destination;
            emit AddressImported(name, destination);
        }
    }

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

    function rebuildCaches(MixinResolver[] calldata destinations) external {
        for (uint i = 0; i < destinations.length; i++) {
            destinations[i].rebuildCache();
        }
    }

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

    function areAddressesImported(bytes32[] calldata names, address[] calldata destinations) external view returns (bool) {
        for (uint i = 0; i < names.length; i++) {
            if (repository[names[i]] != destinations[i]) {
                return false;
            }
        }
        return true;
    }

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

    /* ========== EVENTS ========== */

    event AddressImported(bytes32 name, address destination);
}


// Internal references


// https://docs.synthetix.io/contracts/source/contracts/mixinresolver
contract MixinResolver {
    AddressResolver public resolver;

    mapping(bytes32 => address) private addressCache;

    constructor(address _resolver) internal {
        resolver = AddressResolver(_resolver);
    }

    /* ========== INTERNAL FUNCTIONS ========== */

    function combineArrays(bytes32[] memory first, bytes32[] memory second)
        internal
        pure
        returns (bytes32[] memory combination)
    {
        combination = new bytes32[](first.length + second.length);

        for (uint i = 0; i < first.length; i++) {
            combination[i] = first[i];
        }

        for (uint j = 0; j < second.length; j++) {
            combination[first.length + j] = second[j];
        }
    }

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

    // Note: this function is public not external in order for it to be overridden and invoked via super in subclasses
    function resolverAddressesRequired() public view returns (bytes32[] memory addresses) {}

    function rebuildCache() public {
        bytes32[] memory requiredAddresses = resolverAddressesRequired();
        // The resolver must call this function whenver it updates its state
        for (uint i = 0; i < requiredAddresses.length; i++) {
            bytes32 name = requiredAddresses[i];
            // Note: can only be invoked once the resolver has all the targets needed added
            address destination =
                resolver.requireAndGetAddress(name, string(abi.encodePacked("Resolver missing target: ", name)));
            addressCache[name] = destination;
            emit CacheUpdated(name, destination);
        }
    }

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

    function isResolverCached() external view returns (bool) {
        bytes32[] memory requiredAddresses = resolverAddressesRequired();
        for (uint i = 0; i < requiredAddresses.length; i++) {
            bytes32 name = requiredAddresses[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;
    }

    /* ========== INTERNAL FUNCTIONS ========== */

    function requireAndGetAddress(bytes32 name) internal view returns (address) {
        address _foundAddress = addressCache[name];
        require(_foundAddress != address(0), string(abi.encodePacked("Missing address: ", name)));
        return _foundAddress;
    }

    /* ========== EVENTS ========== */

    event CacheUpdated(bytes32 name, address destination);
}


interface IVirtualSynth {
    // Views
    function balanceOfUnderlying(address account) external view returns (uint);

    function rate() external view returns (uint);

    function readyToSettle() external view returns (bool);

    function secsLeftInWaitingPeriod() external view returns (uint);

    function settled() external view returns (bool);

    function synth() external view returns (ISynth);

    // Mutative functions
    function settle(address account) external;
}


// https://docs.synthetix.io/contracts/source/interfaces/isynthetix
interface ISynthetix {
    // Views
    function anySynthOrSNXRateIsInvalid() external view returns (bool anyRateInvalid);

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

    function availableSynthCount() external view returns (uint);

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

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

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

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

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

    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) external view returns (uint);

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

    function transferableSynthetix(address account) external view returns (uint transferable);

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

    // Mutative Functions
    function burnSynths(uint amount) external;

    function burnSynthsOnBehalf(address burnForAddress, uint amount) external;

    function burnSynthsToTarget() external;

    function burnSynthsToTargetOnBehalf(address burnForAddress) external;

    function exchange(
        bytes32 sourceCurrencyKey,
        uint sourceAmount,
        bytes32 destinationCurrencyKey
    ) external returns (uint amountReceived);

    function exchangeOnBehalf(
        address exchangeForAddress,
        bytes32 sourceCurrencyKey,
        uint sourceAmount,
        bytes32 destinationCurrencyKey
    ) external returns (uint amountReceived);

    function exchangeWithTracking(
        bytes32 sourceCurrencyKey,
        uint sourceAmount,
        bytes32 destinationCurrencyKey,
        address rewardAddress,
        bytes32 trackingCode
    ) external returns (uint amountReceived);

    function exchangeWithTrackingForInitiator(
        bytes32 sourceCurrencyKey,
        uint sourceAmount,
        bytes32 destinationCurrencyKey,
        address rewardAddress,
        bytes32 trackingCode
    ) external returns (uint amountReceived);

    function exchangeOnBehalfWithTracking(
        address exchangeForAddress,
        bytes32 sourceCurrencyKey,
        uint sourceAmount,
        bytes32 destinationCurrencyKey,
        address rewardAddress,
        bytes32 trackingCode
    ) external returns (uint amountReceived);

    function exchangeWithVirtual(
        bytes32 sourceCurrencyKey,
        uint sourceAmount,
        bytes32 destinationCurrencyKey,
        bytes32 trackingCode
    ) external returns (uint amountReceived, IVirtualSynth vSynth);

    function exchangeAtomically(
        bytes32 sourceCurrencyKey,
        uint sourceAmount,
        bytes32 destinationCurrencyKey,
        bytes32 trackingCode,
        uint minAmount
    ) external returns (uint amountReceived);

    function issueMaxSynths() external;

    function issueMaxSynthsOnBehalf(address issueForAddress) external;

    function issueSynths(uint amount) external;

    function issueSynthsOnBehalf(address issueForAddress, uint amount) external;

    function mint() external returns (bool);

    function settle(bytes32 currencyKey)
        external
        returns (
            uint reclaimed,
            uint refunded,
            uint numEntries
        );

    // Liquidations
    function liquidateDelinquentAccount(address account) external returns (bool);

    function liquidateDelinquentAccountEscrowIndex(address account, uint escrowStartIndex) external returns (bool);

    function liquidateSelf() external returns (bool);

    // Restricted Functions

    function mintSecondary(address account, uint amount) external;

    function mintSecondaryRewards(uint amount) external;

    function burnSecondary(address account, uint amount) external;

    function revokeAllEscrow(address account) external;

    function migrateAccountBalances(address account) external returns (uint totalEscrowRevoked, uint totalLiquidBalance);
}


// https://docs.synthetix.io/contracts/source/interfaces/isystemstatus
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 systemSuspended() external view returns (bool);

    function requireIssuanceActive() external view;

    function requireExchangeActive() external view;

    function requireFuturesActive() external view;

    function requireFuturesMarketActive(bytes32 marketKey) external view;

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

    function requireSynthActive(bytes32 currencyKey) external view;

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

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

    function systemSuspension() external view returns (bool suspended, uint248 reason);

    function issuanceSuspension() external view returns (bool suspended, uint248 reason);

    function exchangeSuspension() external view returns (bool suspended, uint248 reason);

    function futuresSuspension() external view returns (bool suspended, uint248 reason);

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

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

    function futuresMarketSuspension(bytes32 marketKey) external view returns (bool suspended, uint248 reason);

    function getSynthExchangeSuspensions(bytes32[] calldata synths)
        external
        view
        returns (bool[] memory exchangeSuspensions, uint256[] memory reasons);

    function getSynthSuspensions(bytes32[] calldata synths)
        external
        view
        returns (bool[] memory suspensions, uint256[] memory reasons);

    function getFuturesMarketSuspensions(bytes32[] calldata marketKeys)
        external
        view
        returns (bool[] memory suspensions, uint256[] memory reasons);

    // Restricted functions
    function suspendIssuance(uint256 reason) external;

    function suspendSynth(bytes32 currencyKey, uint256 reason) external;

    function suspendFuturesMarket(bytes32 marketKey, uint256 reason) external;

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


pragma experimental ABIEncoderV2;


// https://docs.synthetix.io/contracts/source/interfaces/iexchanger
interface IExchanger {
    struct ExchangeEntrySettlement {
        bytes32 src;
        uint amount;
        bytes32 dest;
        uint reclaim;
        uint rebate;
        uint srcRoundIdAtPeriodEnd;
        uint destRoundIdAtPeriodEnd;
        uint timestamp;
    }

    struct ExchangeEntry {
        uint sourceRate;
        uint destinationRate;
        uint destinationAmount;
        uint exchangeFeeRate;
        uint exchangeDynamicFeeRate;
        uint roundIdForSrc;
        uint roundIdForDest;
        uint sourceAmountAfterSettlement;
    }

    // Views
    function calculateAmountAfterSettlement(
        address from,
        bytes32 currencyKey,
        uint amount,
        uint refunded
    ) external view returns (uint amountAfterSettlement);

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

    function maxSecsLeftInWaitingPeriod(address account, bytes32 currencyKey) external view returns (uint);

    function settlementOwing(address account, bytes32 currencyKey)
        external
        view
        returns (
            uint reclaimAmount,
            uint rebateAmount,
            uint numEntries
        );

    function hasWaitingPeriodOrSettlementOwing(address account, bytes32 currencyKey) external view returns (bool);

    function feeRateForExchange(bytes32 sourceCurrencyKey, bytes32 destinationCurrencyKey) external view returns (uint);

    function dynamicFeeRateForExchange(bytes32 sourceCurrencyKey, bytes32 destinationCurrencyKey)
        external
        view
        returns (uint feeRate, bool tooVolatile);

    function getAmountsForExchange(
        uint sourceAmount,
        bytes32 sourceCurrencyKey,
        bytes32 destinationCurrencyKey
    )
        external
        view
        returns (
            uint amountReceived,
            uint fee,
            uint exchangeFeeRate
        );

    function priceDeviationThresholdFactor() external view returns (uint);

    function waitingPeriodSecs() external view returns (uint);

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

    // Mutative functions
    function exchange(
        address exchangeForAddress,
        address from,
        bytes32 sourceCurrencyKey,
        uint sourceAmount,
        bytes32 destinationCurrencyKey,
        address destinationAddress,
        bool virtualSynth,
        address rewardAddress,
        bytes32 trackingCode
    ) external returns (uint amountReceived, IVirtualSynth vSynth);

    function exchangeAtomically(
        address from,
        bytes32 sourceCurrencyKey,
        uint sourceAmount,
        bytes32 destinationCurrencyKey,
        address destinationAddress,
        bytes32 trackingCode,
        uint minAmount
    ) external returns (uint amountReceived);

    function settle(address from, bytes32 currencyKey)
        external
        returns (
            uint reclaimed,
            uint refunded,
            uint numEntries
        );
}

// Used to have strongly-typed access to internal mutative functions in Synthetix
interface ISynthetixInternal {
    function emitExchangeTracking(
        bytes32 trackingCode,
        bytes32 toCurrencyKey,
        uint256 toAmount,
        uint256 fee
    ) external;

    function emitSynthExchange(
        address account,
        bytes32 fromCurrencyKey,
        uint fromAmount,
        bytes32 toCurrencyKey,
        uint toAmount,
        address toAddress
    ) external;

    function emitAtomicSynthExchange(
        address account,
        bytes32 fromCurrencyKey,
        uint fromAmount,
        bytes32 toCurrencyKey,
        uint toAmount,
        address toAddress
    ) external;

    function emitExchangeReclaim(
        address account,
        bytes32 currencyKey,
        uint amount
    ) external;

    function emitExchangeRebate(
        address account,
        bytes32 currencyKey,
        uint amount
    ) external;
}

interface IExchangerInternalDebtCache {
    function updateCachedSynthDebtsWithRates(bytes32[] calldata currencyKeys, uint[] calldata currencyRates) external;

    function updateCachedSynthDebts(bytes32[] calldata currencyKeys) external;
}


// https://docs.synthetix.io/contracts/source/interfaces/irewardsdistribution
interface IRewardsDistribution {
    // Structs
    struct DistributionData {
        address destination;
        uint amount;
    }

    // Views
    function authority() external view returns (address);

    function distributions(uint index) external view returns (address destination, uint amount); // DistributionData

    function distributionsLength() external view returns (uint);

    // Mutative Functions
    function distributeRewards(uint amount) external returns (bool);
}


interface ILiquidator {
    // Views
    function issuanceRatio() external view returns (uint);

    function liquidationDelay() external view returns (uint);

    function liquidationRatio() external view returns (uint);

    function liquidationEscrowDuration() external view returns (uint);

    function liquidationPenalty() external view returns (uint);

    function selfLiquidationPenalty() external view returns (uint);

    function liquidateReward() external view returns (uint);

    function flagReward() external view returns (uint);

    function liquidationCollateralRatio() external view returns (uint);

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

    function getLiquidationCallerForAccount(address account) external view returns (address);

    function isLiquidationOpen(address account, bool isSelfLiquidation) external view returns (bool);

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

    function calculateAmountToFixCollateral(
        uint debtBalance,
        uint collateral,
        uint penalty
    ) external view returns (uint);

    function liquidationAmounts(address account, bool isSelfLiquidation)
        external
        view
        returns (
            uint totalRedeemed,
            uint debtToRemove,
            uint escrowToLiquidate,
            uint initialDebtBalance
        );

    // Mutative Functions
    function flagAccountForLiquidation(address account) external;

    // Restricted: used internally to Synthetix contracts
    function removeAccountInLiquidation(address account) external;

    function checkAndRemoveAccountInLiquidation(address account) external;
}


interface ILiquidatorRewards {
    // Views

    function earned(address account) external view returns (uint256);

    // Mutative

    function getReward(address account) external;

    function notifyRewardAmount(uint256 reward) external;

    function updateEntry(address account) external;
}


library VestingEntries {
    struct VestingEntry {
        uint64 endTime;
        uint256 escrowAmount;
    }
    struct VestingEntryWithID {
        uint64 endTime;
        uint256 escrowAmount;
        uint256 entryID;
    }
}

/// SIP-252: this is the interface for immutable V2 escrow (renamed with suffix Frozen).
/// These sources need to exist here and match on-chain frozen contracts for tests and reference.
/// the reason for the naming mess is that the immutable LiquidatorRewards expects a working
/// RewardEscrowV2 resolver entry for its getReward method, so the "new" (would be V3)
/// needs to be found at that entry for liq-rewards to function.
interface IRewardEscrowV2Frozen {
    // Views
    function balanceOf(address account) external view returns (uint);

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

    function totalEscrowedBalance() external view returns (uint);

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

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

    function getVestingQuantity(address account, uint256[] calldata entryIDs) external view returns (uint);

    function getVestingSchedules(
        address account,
        uint256 index,
        uint256 pageSize
    ) external view returns (VestingEntries.VestingEntryWithID[] memory);

    function getAccountVestingEntryIDs(
        address account,
        uint256 index,
        uint256 pageSize
    ) external view returns (uint256[] memory);

    function getVestingEntryClaimable(address account, uint256 entryID) external view returns (uint);

    function getVestingEntry(address account, uint256 entryID) external view returns (uint64, uint256);

    // Mutative functions
    function vest(uint256[] calldata entryIDs) external;

    function createEscrowEntry(
        address beneficiary,
        uint256 deposit,
        uint256 duration
    ) external;

    function appendVestingEntry(
        address account,
        uint256 quantity,
        uint256 duration
    ) external;

    function migrateVestingSchedule(address _addressToMigrate) external;

    function migrateAccountEscrowBalances(
        address[] calldata accounts,
        uint256[] calldata escrowBalances,
        uint256[] calldata vestedBalances
    ) external;

    // Account Merging
    function startMergingWindow() external;

    function mergeAccount(address accountToMerge, uint256[] calldata entryIDs) external;

    function nominateAccountToMerge(address account) external;

    function accountMergingIsOpen() external view returns (bool);

    // L2 Migration
    function importVestingEntries(
        address account,
        uint256 escrowedAmount,
        VestingEntries.VestingEntry[] calldata vestingEntries
    ) external;

    // Return amount of SNX transfered to SynthetixBridgeToOptimism deposit contract
    function burnForMigration(address account, uint256[] calldata entryIDs)
        external
        returns (uint256 escrowedAccountBalance, VestingEntries.VestingEntry[] memory vestingEntries);

    function nextEntryId() external view returns (uint);

    function vestingSchedules(address account, uint256 entryId) external view returns (VestingEntries.VestingEntry memory);

    function accountVestingEntryIDs(address account, uint256 index) external view returns (uint);

    //function totalEscrowedAccountBalance(address account) external view returns (uint);
    //function totalVestedAccountBalance(address account) external view returns (uint);
}


interface IRewardEscrowV2Storage {
    /// Views
    function numVestingEntries(address account) external view returns (uint);

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

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

    function totalEscrowedBalance() external view returns (uint);

    function nextEntryId() external view returns (uint);

    function vestingSchedules(address account, uint256 entryId) external view returns (VestingEntries.VestingEntry memory);

    function accountVestingEntryIDs(address account, uint256 index) external view returns (uint);

    /// Mutative
    function setZeroAmount(address account, uint entryId) external;

    function setZeroAmountUntilTarget(
        address account,
        uint startIndex,
        uint targetAmount
    )
        external
        returns (
            uint total,
            uint endIndex,
            uint lastEntryTime
        );

    function updateEscrowAccountBalance(address account, int delta) external;

    function updateVestedAccountBalance(address account, int delta) external;

    function updateTotalEscrowedBalance(int delta) external;

    function addVestingEntry(address account, VestingEntries.VestingEntry calldata entry) external returns (uint);

    // setFallbackRewardEscrow is used for configuration but not used by contracts
}

/// this should remain backwards compatible to IRewardEscrowV2Frozen
/// ideally this would be done by inheriting from that interface
/// but solidity v0.5 doesn't support interface inheritance
interface IRewardEscrowV2 {
    // Views
    function balanceOf(address account) external view returns (uint);

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

    function totalEscrowedBalance() external view returns (uint);

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

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

    function getVestingQuantity(address account, uint256[] calldata entryIDs) external view returns (uint);

    function getVestingSchedules(
        address account,
        uint256 index,
        uint256 pageSize
    ) external view returns (VestingEntries.VestingEntryWithID[] memory);

    function getAccountVestingEntryIDs(
        address account,
        uint256 index,
        uint256 pageSize
    ) external view returns (uint256[] memory);

    function getVestingEntryClaimable(address account, uint256 entryID) external view returns (uint);

    function getVestingEntry(address account, uint256 entryID) external view returns (uint64, uint256);

    // Mutative functions
    function vest(uint256[] calldata entryIDs) external;

    function createEscrowEntry(
        address beneficiary,
        uint256 deposit,
        uint256 duration
    ) external;

    function appendVestingEntry(
        address account,
        uint256 quantity,
        uint256 duration
    ) external;

    function migrateVestingSchedule(address _addressToMigrate) external;

    function migrateAccountEscrowBalances(
        address[] calldata accounts,
        uint256[] calldata escrowBalances,
        uint256[] calldata vestedBalances
    ) external;

    // Account Merging
    function startMergingWindow() external;

    function mergeAccount(address accountToMerge, uint256[] calldata entryIDs) external;

    function nominateAccountToMerge(address account) external;

    function accountMergingIsOpen() external view returns (bool);

    // L2 Migration
    function importVestingEntries(
        address account,
        uint256 escrowedAmount,
        VestingEntries.VestingEntry[] calldata vestingEntries
    ) external;

    // Return amount of SNX transfered to SynthetixBridgeToOptimism deposit contract
    function burnForMigration(address account, uint256[] calldata entryIDs)
        external
        returns (uint256 escrowedAccountBalance, VestingEntries.VestingEntry[] memory vestingEntries);

    function nextEntryId() external view returns (uint);

    function vestingSchedules(address account, uint256 entryId) external view returns (VestingEntries.VestingEntry memory);

    function accountVestingEntryIDs(address account, uint256 index) external view returns (uint);

    /// below are methods not available in IRewardEscrowV2Frozen

    // revoke entries for liquidations (access controlled to Synthetix)
    function revokeFrom(
        address account,
        address recipient,
        uint targetAmount,
        uint startIndex
    ) external;
}


// Inheritance


// Internal references


contract BaseSynthetix is IERC20, ExternStateToken, MixinResolver, ISynthetix {
    // ========== STATE VARIABLES ==========

    // Available Synths which can be used with the system
    string public constant TOKEN_NAME = "Synthetix Network Token";
    string public constant TOKEN_SYMBOL = "SNX";
    uint8 public constant DECIMALS = 18;
    bytes32 public constant sUSD = "sUSD";

    // ========== ADDRESS RESOLVER CONFIGURATION ==========
    bytes32 private constant CONTRACT_SYSTEMSTATUS = "SystemStatus";
    bytes32 private constant CONTRACT_EXCHANGER = "Exchanger";
    bytes32 private constant CONTRACT_ISSUER = "Issuer";
    bytes32 private constant CONTRACT_REWARDSDISTRIBUTION = "RewardsDistribution";
    bytes32 private constant CONTRACT_LIQUIDATORREWARDS = "LiquidatorRewards";
    bytes32 private constant CONTRACT_LIQUIDATOR = "Liquidator";
    bytes32 private constant CONTRACT_REWARDESCROW_V2 = "RewardEscrowV2";
    bytes32 private constant CONTRACT_V3_LEGACYMARKET = "LegacyMarket";
    bytes32 private constant CONTRACT_DEBT_MIGRATOR_ON_ETHEREUM = "DebtMigratorOnEthereum";

    // ========== CONSTRUCTOR ==========

    constructor(
        address payable _proxy,
        TokenState _tokenState,
        address _owner,
        uint _totalSupply,
        address _resolver
    )
        public
        ExternStateToken(_proxy, _tokenState, TOKEN_NAME, TOKEN_SYMBOL, _totalSupply, DECIMALS, _owner)
        MixinResolver(_resolver)
    {}

    // ========== VIEWS ==========

    // Note: use public visibility so that it can be invoked in a subclass
    function resolverAddressesRequired() public view returns (bytes32[] memory addresses) {
        addresses = new bytes32[](7);
        addresses[0] = CONTRACT_SYSTEMSTATUS;
        addresses[1] = CONTRACT_EXCHANGER;
        addresses[2] = CONTRACT_ISSUER;
        addresses[3] = CONTRACT_REWARDSDISTRIBUTION;
        addresses[4] = CONTRACT_LIQUIDATORREWARDS;
        addresses[5] = CONTRACT_LIQUIDATOR;
        addresses[6] = CONTRACT_REWARDESCROW_V2;
    }

    function systemStatus() internal view returns (ISystemStatus) {
        return ISystemStatus(requireAndGetAddress(CONTRACT_SYSTEMSTATUS));
    }

    function exchanger() internal view returns (IExchanger) {
        return IExchanger(requireAndGetAddress(CONTRACT_EXCHANGER));
    }

    function issuer() internal view returns (IIssuer) {
        return IIssuer(requireAndGetAddress(CONTRACT_ISSUER));
    }

    function rewardsDistribution() internal view returns (IRewardsDistribution) {
        return IRewardsDistribution(requireAndGetAddress(CONTRACT_REWARDSDISTRIBUTION));
    }

    function liquidatorRewards() internal view returns (ILiquidatorRewards) {
        return ILiquidatorRewards(requireAndGetAddress(CONTRACT_LIQUIDATORREWARDS));
    }

    function rewardEscrowV2() internal view returns (IRewardEscrowV2) {
        return IRewardEscrowV2(requireAndGetAddress(CONTRACT_REWARDESCROW_V2));
    }

    function liquidator() internal view returns (ILiquidator) {
        return ILiquidator(requireAndGetAddress(CONTRACT_LIQUIDATOR));
    }

    function debtBalanceOf(address account, bytes32 currencyKey) external view returns (uint) {
        return issuer().debtBalanceOf(account, currencyKey);
    }

    function totalIssuedSynths(bytes32 currencyKey) external view returns (uint) {
        return issuer().totalIssuedSynths(currencyKey, false);
    }

    function totalIssuedSynthsExcludeOtherCollateral(bytes32 currencyKey) external view returns (uint) {
        return issuer().totalIssuedSynths(currencyKey, true);
    }

    function availableCurrencyKeys() external view returns (bytes32[] memory) {
        return issuer().availableCurrencyKeys();
    }

    function availableSynthCount() external view returns (uint) {
        return issuer().availableSynthCount();
    }

    function availableSynths(uint index) external view returns (ISynth) {
        return issuer().availableSynths(index);
    }

    function synths(bytes32 currencyKey) external view returns (ISynth) {
        return issuer().synths(currencyKey);
    }

    function synthsByAddress(address synthAddress) external view returns (bytes32) {
        return issuer().synthsByAddress(synthAddress);
    }

    function isWaitingPeriod(bytes32 currencyKey) external view returns (bool) {
        return exchanger().maxSecsLeftInWaitingPeriod(messageSender, currencyKey) > 0;
    }

    function anySynthOrSNXRateIsInvalid() external view returns (bool anyRateInvalid) {
        return issuer().anySynthOrSNXRateIsInvalid();
    }

    function maxIssuableSynths(address account) external view returns (uint maxIssuable) {
        return issuer().maxIssuableSynths(account);
    }

    function remainingIssuableSynths(address account)
        external
        view
        returns (
            uint maxIssuable,
            uint alreadyIssued,
            uint totalSystemDebt
        )
    {
        return issuer().remainingIssuableSynths(account);
    }

    function collateralisationRatio(address _issuer) external view returns (uint) {
        return issuer().collateralisationRatio(_issuer);
    }

    function collateral(address account) external view returns (uint) {
        return issuer().collateral(account);
    }

    function transferableSynthetix(address account) external view returns (uint transferable) {
        (transferable, ) = issuer().transferableSynthetixAndAnyRateIsInvalid(account, tokenState.balanceOf(account));
    }

    /// the index of the first non zero RewardEscrowV2 entry for an account in order of iteration over accountVestingEntryIDs.
    /// This is intended as a convenience off-chain view for liquidators to calculate the startIndex to pass
    /// into liquidateDelinquentAccountEscrowIndex to save gas.
    function getFirstNonZeroEscrowIndex(address account) external view returns (uint) {
        uint numIds = rewardEscrowV2().numVestingEntries(account);
        uint entryID;
        VestingEntries.VestingEntry memory entry;
        for (uint i = 0; i < numIds; i++) {
            entryID = rewardEscrowV2().accountVestingEntryIDs(account, i);
            entry = rewardEscrowV2().vestingSchedules(account, entryID);
            if (entry.escrowAmount > 0) {
                return i;
            }
        }
        revert("all entries are zero");
    }

    function _canTransfer(address account, uint value) internal view returns (bool) {
        // Always allow legacy market to transfer
        // note if legacy market is not yet available this will just return 0 address and it  will never be true
        address legacyMarketAddress = resolver.getAddress(CONTRACT_V3_LEGACYMARKET);
        if ((messageSender != address(0) && messageSender == legacyMarketAddress) || account == legacyMarketAddress) {
            return true;
        }

        if (issuer().debtBalanceOf(account, sUSD) > 0) {
            (uint transferable, bool anyRateIsInvalid) =
                issuer().transferableSynthetixAndAnyRateIsInvalid(account, tokenState.balanceOf(account));
            require(value <= transferable, "Cannot transfer staked or escrowed SNX");
            require(!anyRateIsInvalid, "A synth or SNX rate is invalid");
        }

        return true;
    }

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

    function exchange(
        bytes32 sourceCurrencyKey,
        uint sourceAmount,
        bytes32 destinationCurrencyKey
    ) external exchangeActive(sourceCurrencyKey, destinationCurrencyKey) optionalProxy returns (uint amountReceived) {
        (amountReceived, ) = exchanger().exchange(
            messageSender,
            messageSender,
            sourceCurrencyKey,
            sourceAmount,
            destinationCurrencyKey,
            messageSender,
            false,
            messageSender,
            bytes32(0)
        );
    }

    function exchangeOnBehalf(
        address exchangeForAddress,
        bytes32 sourceCurrencyKey,
        uint sourceAmount,
        bytes32 destinationCurrencyKey
    ) external exchangeActive(sourceCurrencyKey, destinationCurrencyKey) optionalProxy returns (uint amountReceived) {
        (amountReceived, ) = exchanger().exchange(
            exchangeForAddress,
            messageSender,
            sourceCurrencyKey,
            sourceAmount,
            destinationCurrencyKey,
            exchangeForAddress,
            false,
            exchangeForAddress,
            bytes32(0)
        );
    }

    function settle(bytes32 currencyKey)
        external
        optionalProxy
        returns (
            uint reclaimed,
            uint refunded,
            uint numEntriesSettled
        )
    {
        return exchanger().settle(messageSender, currencyKey);
    }

    function exchangeWithTracking(
        bytes32 sourceCurrencyKey,
        uint sourceAmount,
        bytes32 destinationCurrencyKey,
        address rewardAddress,
        bytes32 trackingCode
    ) external exchangeActive(sourceCurrencyKey, destinationCurrencyKey) optionalProxy returns (uint amountReceived) {
        (amountReceived, ) = exchanger().exchange(
            messageSender,
            messageSender,
            sourceCurrencyKey,
            sourceAmount,
            destinationCurrencyKey,
            messageSender,
            false,
            rewardAddress,
            trackingCode
        );
    }

    function exchangeOnBehalfWithTracking(
        address exchangeForAddress,
        bytes32 sourceCurrencyKey,
        uint sourceAmount,
        bytes32 destinationCurrencyKey,
        address rewardAddress,
        bytes32 trackingCode
    ) external exchangeActive(sourceCurrencyKey, destinationCurrencyKey) optionalProxy returns (uint amountReceived) {
        (amountReceived, ) = exchanger().exchange(
            exchangeForAddress,
            messageSender,
            sourceCurrencyKey,
            sourceAmount,
            destinationCurrencyKey,
            exchangeForAddress,
            false,
            rewardAddress,
            trackingCode
        );
    }

    function transfer(address to, uint value) external onlyProxyOrInternal systemActive returns (bool) {
        // Ensure they're not trying to exceed their locked amount -- only if they have debt.
        _canTransfer(messageSender, value);

        // Perform the transfer: if there is a problem an exception will be thrown in this call.
        _transferByProxy(messageSender, to, value);

        return true;
    }

    function transferFrom(
        address from,
        address to,
        uint value
    ) external onlyProxyOrInternal systemActive returns (bool) {
        // Ensure they're not trying to exceed their locked amount -- only if they have debt.
        _canTransfer(from, value);

        // Perform the transfer: if there is a problem,
        // an exception will be thrown in this call.
        return _transferFromByProxy(messageSender, from, to, value);
    }

    // SIP-252: migration of SNX token balance from old to new escrow rewards contract
    function migrateEscrowContractBalance() external onlyOwner {
        address from = resolver.requireAndGetAddress("RewardEscrowV2Frozen", "Old escrow address unset");
        // technically the below could use `rewardEscrowV2()`, but in the case of a migration it's better to avoid
        // using the cached value and read the most updated one directly from the resolver
        address to = resolver.requireAndGetAddress("RewardEscrowV2", "New escrow address unset");
        require(to != from, "cannot migrate to same address");

        uint currentBalance = tokenState.balanceOf(from);
        // allow no-op for idempotent migration steps in case action was performed already
        if (currentBalance > 0) {
            _internalTransfer(from, to, currentBalance);
        }
    }

    function issueSynths(uint amount) external issuanceActive optionalProxy {
        return issuer().issueSynths(messageSender, amount);
    }

    function issueSynthsOnBehalf(address issueForAddress, uint amount) external issuanceActive optionalProxy {
        return issuer().issueSynthsOnBehalf(issueForAddress, messageSender, amount);
    }

    function issueMaxSynths() external issuanceActive optionalProxy {
        return issuer().issueMaxSynths(messageSender);
    }

    function issueMaxSynthsOnBehalf(address issueForAddress) external issuanceActive optionalProxy {
        return issuer().issueMaxSynthsOnBehalf(issueForAddress, messageSender);
    }

    function burnSynths(uint amount) external issuanceActive optionalProxy {
        return issuer().burnSynths(messageSender, amount);
    }

    function burnSynthsOnBehalf(address burnForAddress, uint amount) external issuanceActive optionalProxy {
        return issuer().burnSynthsOnBehalf(burnForAddress, messageSender, amount);
    }

    function burnSynthsToTarget() external issuanceActive optionalProxy {
        return issuer().burnSynthsToTarget(messageSender);
    }

    function burnSynthsToTargetOnBehalf(address burnForAddress) external issuanceActive optionalProxy {
        return issuer().burnSynthsToTargetOnBehalf(burnForAddress, messageSender);
    }

    /// @notice Force liquidate a delinquent account and distribute the redeemed SNX rewards amongst the appropriate recipients.
    /// @dev The SNX transfers will revert if the amount to send is more than balanceOf account (i.e. due to escrowed balance).
    function liquidateDelinquentAccount(address account) external systemActive optionalProxy returns (bool) {
        return _liquidateDelinquentAccount(account, 0, messageSender);
    }

    /// @param escrowStartIndex: index into the account's vesting entries list to start iterating from
    /// when liquidating from escrow in order to save gas (the default method uses 0 as default)
    function liquidateDelinquentAccountEscrowIndex(address account, uint escrowStartIndex)
        external
        systemActive
        optionalProxy
        returns (bool)
    {
        return _liquidateDelinquentAccount(account, escrowStartIndex, messageSender);
    }

    /// @notice Force liquidate a delinquent account and distribute the redeemed SNX rewards amongst the appropriate recipients.
    /// @dev The SNX transfers will revert if the amount to send is more than balanceOf account (i.e. due to escrowed balance).
    function _liquidateDelinquentAccount(
        address account,
        uint escrowStartIndex,
        address liquidatorAccount
    ) internal returns (bool) {
        // ensure the user has no liquidation rewards (also counted towards collateral) outstanding
        liquidatorRewards().getReward(account);

        (uint totalRedeemed, uint debtToRemove, uint escrowToLiquidate) = issuer().liquidateAccount(account, false);

        // This transfers the to-be-liquidated part of escrow to the account (!) as liquid SNX.
        // It is transferred to the account instead of to the rewards because of the liquidator / flagger
        // rewards that may need to be paid (so need to be transferrable, to avoid edge cases)
        if (escrowToLiquidate > 0) {
            rewardEscrowV2().revokeFrom(account, account, escrowToLiquidate, escrowStartIndex);
        }

        emitAccountLiquidated(account, totalRedeemed, debtToRemove, liquidatorAccount);

        // First, pay out the flag and liquidate rewards.
        uint flagReward = liquidator().flagReward();
        uint liquidateReward = liquidator().liquidateReward();

        // Transfer the flagReward to the account who flagged this account for liquidation.
        address flagger = liquidator().getLiquidationCallerForAccount(account);
        bool flagRewardTransferSucceeded = _transferByProxy(account, flagger, flagReward);
        require(flagRewardTransferSucceeded, "Flag reward transfer did not succeed");

        // Transfer the liquidateReward to liquidator (the account who invoked this liquidation).
        bool liquidateRewardTransferSucceeded = _transferByProxy(account, liquidatorAccount, liquidateReward);
        require(liquidateRewardTransferSucceeded, "Liquidate reward transfer did not succeed");

        if (totalRedeemed > 0) {
            // Send the remaining SNX to the LiquidatorRewards contract.
            bool liquidatorRewardTransferSucceeded = _transferByProxy(account, address(liquidatorRewards()), totalRedeemed);
            require(liquidatorRewardTransferSucceeded, "Transfer to LiquidatorRewards failed");

            // Inform the LiquidatorRewards contract about the incoming SNX rewards.
            liquidatorRewards().notifyRewardAmount(totalRedeemed);
        }

        return true;
    }

    /// @notice Allows an account to self-liquidate anytime its c-ratio is below the target issuance ratio.
    function liquidateSelf() external systemActive optionalProxy returns (bool) {
        // must store liquidated account address because below functions may attempt to transfer SNX which changes messageSender
        address liquidatedAccount = messageSender;

        // ensure the user has no liquidation rewards (also counted towards collateral) outstanding
        liquidatorRewards().getReward(liquidatedAccount);

        // Self liquidate the account (`isSelfLiquidation` flag must be set to `true`).
        // escrowToLiquidate is unused because it cannot be used for self-liquidations
        (uint totalRedeemed, uint debtRemoved, ) = issuer().liquidateAccount(liquidatedAccount, true);
        require(debtRemoved > 0, "cannot self liquidate");

        emitAccountLiquidated(liquidatedAccount, totalRedeemed, debtRemoved, liquidatedAccount);

        // Transfer the redeemed SNX to the LiquidatorRewards contract.
        // Reverts if amount to redeem is more than balanceOf account (i.e. due to escrowed balance).
        bool success = _transferByProxy(liquidatedAccount, address(liquidatorRewards()), totalRedeemed);
        require(success, "Transfer to LiquidatorRewards failed");

        // Inform the LiquidatorRewards contract about the incoming SNX rewards.
        liquidatorRewards().notifyRewardAmount(totalRedeemed);

        return success;
    }

    /**
     * @notice allows for migration from v2x to v3 when an account has pending escrow entries
     */
    function revokeAllEscrow(address account) external systemActive {
        address legacyMarketAddress = resolver.getAddress(CONTRACT_V3_LEGACYMARKET);
        require(msg.sender == legacyMarketAddress, "Only LegacyMarket can revoke escrow");
        rewardEscrowV2().revokeFrom(account, legacyMarketAddress, rewardEscrowV2().totalEscrowedAccountBalance(account), 0);
    }

    function migrateAccountBalances(address account)
        external
        systemActive
        returns (uint totalEscrowRevoked, uint totalLiquidBalance)
    {
        address debtMigratorOnEthereum = resolver.getAddress(CONTRACT_DEBT_MIGRATOR_ON_ETHEREUM);
        require(msg.sender == debtMigratorOnEthereum, "Only L1 DebtMigrator");

        // get their liquid SNX balance and transfer it to the migrator contract
        totalLiquidBalance = tokenState.balanceOf(account);
        if (totalLiquidBalance > 0) {
            bool succeeded = _transferByProxy(account, debtMigratorOnEthereum, totalLiquidBalance);
            require(succeeded, "snx transfer failed");
        }

        // get their escrowed SNX balance and revoke it all
        totalEscrowRevoked = rewardEscrowV2().totalEscrowedAccountBalance(account);
        if (totalEscrowRevoked > 0) {
            rewardEscrowV2().revokeFrom(account, debtMigratorOnEthereum, totalEscrowRevoked, 0);
        }
    }

    function exchangeWithTrackingForInitiator(
        bytes32,
        uint,
        bytes32,
        address,
        bytes32
    ) external returns (uint) {
        _notImplemented();
    }

    function exchangeWithVirtual(
        bytes32,
        uint,
        bytes32,
        bytes32
    ) external returns (uint, IVirtualSynth) {
        _notImplemented();
    }

    function exchangeAtomically(
        bytes32,
        uint,
        bytes32,
        bytes32,
        uint
    ) external returns (uint) {
        _notImplemented();
    }

    function mint() external returns (bool) {
        _notImplemented();
    }

    function mintSecondary(address, uint) external {
        _notImplemented();
    }

    function mintSecondaryRewards(uint) external {
        _notImplemented();
    }

    function burnSecondary(address, uint) external {
        _notImplemented();
    }

    function _notImplemented() internal pure {
        revert("Cannot be run on this layer");
    }

    // ========== MODIFIERS ==========

    modifier systemActive() {
        _systemActive();
        _;
    }

    function _systemActive() private view {
        systemStatus().requireSystemActive();
    }

    modifier issuanceActive() {
        _issuanceActive();
        _;
    }

    function _issuanceActive() private view {
        systemStatus().requireIssuanceActive();
    }

    modifier exchangeActive(bytes32 src, bytes32 dest) {
        _exchangeActive(src, dest);
        _;
    }

    function _exchangeActive(bytes32 src, bytes32 dest) private view {
        systemStatus().requireExchangeBetweenSynthsAllowed(src, dest);
    }

    modifier onlyExchanger() {
        _onlyExchanger();
        _;
    }

    function _onlyExchanger() private view {
        require(msg.sender == address(exchanger()), "Only Exchanger can invoke this");
    }

    modifier onlyProxyOrInternal {
        _onlyProxyOrInternal();
        _;
    }

    function _onlyProxyOrInternal() internal {
        if (msg.sender == address(proxy)) {
            // allow proxy through, messageSender should be already set correctly
            return;
        } else if (_isInternalTransferCaller(msg.sender)) {
            // optionalProxy behaviour only for the internal legacy contracts
            messageSender = msg.sender;
        } else {
            revert("Only the proxy can call");
        }
    }

    /// some legacy internal contracts use transfer methods directly on implementation
    /// which isn't supported due to SIP-238 for other callers
    function _isInternalTransferCaller(address caller) internal view returns (bool) {
        // These entries are not required or cached in order to allow them to not exist (==address(0))
        // e.g. due to not being available on L2 or at some future point in time.
        return
            // ordered to reduce gas for more frequent calls, bridge first, vesting and migrating after, legacy last
            caller == resolver.getAddress("SynthetixBridgeToOptimism") ||
            caller == resolver.getAddress("RewardEscrowV2") ||
            caller == resolver.getAddress("DebtMigratorOnOptimism") ||
            // legacy contracts
            caller == resolver.getAddress("RewardEscrow") ||
            caller == resolver.getAddress("SynthetixEscrow") ||
            caller == resolver.getAddress("Depot");
    }

    // ========== EVENTS ==========
    event AccountLiquidated(address indexed account, uint snxRedeemed, uint amountLiquidated, address liquidator);
    bytes32 internal constant ACCOUNTLIQUIDATED_SIG = keccak256("AccountLiquidated(address,uint256,uint256,address)");

    function emitAccountLiquidated(
        address account,
        uint256 snxRedeemed,
        uint256 amountLiquidated,
        address liquidator
    ) internal {
        proxy._emit(
            abi.encode(snxRedeemed, amountLiquidated, liquidator),
            2,
            ACCOUNTLIQUIDATED_SIG,
            addressToBytes32(account),
            0,
            0
        );
    }

    event SynthExchange(
        address indexed account,
        bytes32 fromCurrencyKey,
        uint256 fromAmount,
        bytes32 toCurrencyKey,
        uint256 toAmount,
        address toAddress
    );
    bytes32 internal constant SYNTH_EXCHANGE_SIG =
        keccak256("SynthExchange(address,bytes32,uint256,bytes32,uint256,address)");

    function emitSynthExchange(
        address account,
        bytes32 fromCurrencyKey,
        uint256 fromAmount,
        bytes32 toCurrencyKey,
        uint256 toAmount,
        address toAddress
    ) external onlyExchanger {
        proxy._emit(
            abi.encode(fromCurrencyKey, fromAmount, toCurrencyKey, toAmount, toAddress),
            2,
            SYNTH_EXCHANGE_SIG,
            addressToBytes32(account),
            0,
            0
        );
    }

    event ExchangeTracking(bytes32 indexed trackingCode, bytes32 toCurrencyKey, uint256 toAmount, uint256 fee);
    bytes32 internal constant EXCHANGE_TRACKING_SIG = keccak256("ExchangeTracking(bytes32,bytes32,uint256,uint256)");

    function emitExchangeTracking(
        bytes32 trackingCode,
        bytes32 toCurrencyKey,
        uint256 toAmount,
        uint256 fee
    ) external onlyExchanger {
        proxy._emit(abi.encode(toCurrencyKey, toAmount, fee), 2, EXCHANGE_TRACKING_SIG, trackingCode, 0, 0);
    }

    event ExchangeReclaim(address indexed account, bytes32 currencyKey, uint amount);
    bytes32 internal constant EXCHANGERECLAIM_SIG = keccak256("ExchangeReclaim(address,bytes32,uint256)");

    function emitExchangeReclaim(
        address account,
        bytes32 currencyKey,
        uint256 amount
    ) external onlyExchanger {
        proxy._emit(abi.encode(currencyKey, amount), 2, EXCHANGERECLAIM_SIG, addressToBytes32(account), 0, 0);
    }

    event ExchangeRebate(address indexed account, bytes32 currencyKey, uint amount);
    bytes32 internal constant EXCHANGEREBATE_SIG = keccak256("ExchangeRebate(address,bytes32,uint256)");

    function emitExchangeRebate(
        address account,
        bytes32 currencyKey,
        uint256 amount
    ) external onlyExchanger {
        proxy._emit(abi.encode(currencyKey, amount), 2, EXCHANGEREBATE_SIG, addressToBytes32(account), 0, 0);
    }
}


// https://docs.synthetix.io/contracts/source/interfaces/irewardescrow
interface IRewardEscrow {
    // Views
    function balanceOf(address account) external view returns (uint);

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

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

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

    function getVestingScheduleEntry(address account, uint index) external view returns (uint[2] memory);

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

    // Mutative functions
    function appendVestingEntry(address account, uint quantity) external;

    function vest() external;
}


// https://docs.synthetix.io/contracts/source/interfaces/isupplyschedule
interface ISupplySchedule {
    // Views
    function mintableSupply() external view returns (uint);

    function isMintable() external view returns (bool);

    function minterReward() external view returns (uint);

    // Mutative functions
    function recordMintEvent(uint supplyMinted) external returns (uint);
}


// Inheritance


// Internal references


// https://docs.synthetix.io/contracts/source/contracts/synthetix
contract Synthetix is BaseSynthetix {
    bytes32 public constant CONTRACT_NAME = "Synthetix";

    // ========== ADDRESS RESOLVER CONFIGURATION ==========
    bytes32 private constant CONTRACT_REWARD_ESCROW = "RewardEscrow";
    bytes32 private constant CONTRACT_SUPPLYSCHEDULE = "SupplySchedule";

    // ========== CONSTRUCTOR ==========

    constructor(
        address payable _proxy,
        TokenState _tokenState,
        address _owner,
        uint _totalSupply,
        address _resolver
    ) public BaseSynthetix(_proxy, _tokenState, _owner, _totalSupply, _resolver) {}

    function resolverAddressesRequired() public view returns (bytes32[] memory addresses) {
        bytes32[] memory existingAddresses = BaseSynthetix.resolverAddressesRequired();
        bytes32[] memory newAddresses = new bytes32[](2);
        newAddresses[0] = CONTRACT_REWARD_ESCROW;
        newAddresses[1] = CONTRACT_SUPPLYSCHEDULE;
        return combineArrays(existingAddresses, newAddresses);
    }

    // ========== VIEWS ==========

    function rewardEscrow() internal view returns (IRewardEscrow) {
        return IRewardEscrow(requireAndGetAddress(CONTRACT_REWARD_ESCROW));
    }

    function supplySchedule() internal view returns (ISupplySchedule) {
        return ISupplySchedule(requireAndGetAddress(CONTRACT_SUPPLYSCHEDULE));
    }

    // ========== OVERRIDDEN FUNCTIONS ==========

    function exchangeWithVirtual(
        bytes32 sourceCurrencyKey,
        uint sourceAmount,
        bytes32 destinationCurrencyKey,
        bytes32 trackingCode
    )
        external
        exchangeActive(sourceCurrencyKey, destinationCurrencyKey)
        optionalProxy
        returns (uint amountReceived, IVirtualSynth vSynth)
    {
        return
            exchanger().exchange(
                messageSender,
                messageSender,
                sourceCurrencyKey,
                sourceAmount,
                destinationCurrencyKey,
                messageSender,
                true,
                messageSender,
                trackingCode
            );
    }

    // SIP-140 The initiating user of this exchange will receive the proceeds of the exchange
    // Note: this function may have unintended consequences if not understood correctly. Please
    // read SIP-140 for more information on the use-case
    function exchangeWithTrackingForInitiator(
        bytes32 sourceCurrencyKey,
        uint sourceAmount,
        bytes32 destinationCurrencyKey,
        address rewardAddress,
        bytes32 trackingCode
    ) external exchangeActive(sourceCurrencyKey, destinationCurrencyKey) optionalProxy returns (uint amountReceived) {
        (amountReceived, ) = exchanger().exchange(
            messageSender,
            messageSender,
            sourceCurrencyKey,
            sourceAmount,
            destinationCurrencyKey,
            // solhint-disable avoid-tx-origin
            tx.origin,
            false,
            rewardAddress,
            trackingCode
        );
    }

    function exchangeAtomically(
        bytes32 sourceCurrencyKey,
        uint sourceAmount,
        bytes32 destinationCurrencyKey,
        bytes32 trackingCode,
        uint minAmount
    ) external exchangeActive(sourceCurrencyKey, destinationCurrencyKey) optionalProxy returns (uint amountReceived) {
        return
            exchanger().exchangeAtomically(
                messageSender,
                sourceCurrencyKey,
                sourceAmount,
                destinationCurrencyKey,
                messageSender,
                trackingCode,
                minAmount
            );
    }

    function settle(bytes32 currencyKey)
        external
        optionalProxy
        returns (
            uint reclaimed,
            uint refunded,
            uint numEntriesSettled
        )
    {
        return exchanger().settle(messageSender, currencyKey);
    }

    function mint() external issuanceActive returns (bool) {
        require(address(rewardsDistribution()) != address(0), "RewardsDistribution not set");

        ISupplySchedule _supplySchedule = supplySchedule();
        IRewardsDistribution _rewardsDistribution = rewardsDistribution();

        uint supplyToMint = _supplySchedule.mintableSupply();
        require(supplyToMint > 0, "No supply is mintable");

        emitTransfer(address(0), address(this), supplyToMint);

        // record minting event before mutation to token supply
        uint minterReward = _supplySchedule.recordMintEvent(supplyToMint);

        // Set minted SNX balance to RewardEscrow's balance
        // Minus the minterReward and set balance of minter to add reward
        uint amountToDistribute = supplyToMint.sub(minterReward);

        // Set the token balance to the RewardsDistribution contract
        tokenState.setBalanceOf(
            address(_rewardsDistribution),
            tokenState.balanceOf(address(_rewardsDistribution)).add(amountToDistribute)
        );
        emitTransfer(address(this), address(_rewardsDistribution), amountToDistribute);

        // Kick off the distribution of rewards
        _rewardsDistribution.distributeRewards(amountToDistribute);

        // Assign the minters reward.
        tokenState.setBalanceOf(msg.sender, tokenState.balanceOf(msg.sender).add(minterReward));
        emitTransfer(address(this), msg.sender, minterReward);

        // Increase total supply by minted amount
        totalSupply = totalSupply.add(supplyToMint);

        return true;
    }

    /* Once off function for SIP-60 to migrate SNX balances in the RewardEscrow contract
     * To the new RewardEscrowV2 contract
     */
    function migrateEscrowBalanceToRewardEscrowV2() external onlyOwner {
        // Record balanceOf(RewardEscrow) contract
        uint rewardEscrowBalance = tokenState.balanceOf(address(rewardEscrow()));

        // transfer all of RewardEscrow's balance to RewardEscrowV2
        // _internalTransfer emits the transfer event
        _internalTransfer(address(rewardEscrow()), address(rewardEscrowV2()), rewardEscrowBalance);
    }

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

    event AtomicSynthExchange(
        address indexed account,
        bytes32 fromCurrencyKey,
        uint256 fromAmount,
        bytes32 toCurrencyKey,
        uint256 toAmount,
        address toAddress
    );
    bytes32 internal constant ATOMIC_SYNTH_EXCHANGE_SIG =
        keccak256("AtomicSynthExchange(address,bytes32,uint256,bytes32,uint256,address)");

    function emitAtomicSynthExchange(
        address account,
        bytes32 fromCurrencyKey,
        uint256 fromAmount,
        bytes32 toCurrencyKey,
        uint256 toAmount,
        address toAddress
    ) external onlyExchanger {
        proxy._emit(
            abi.encode(fromCurrencyKey, fromAmount, toCurrencyKey, toAmount, toAddress),
            2,
            ATOMIC_SYNTH_EXCHANGE_SIG,
            addressToBytes32(account),
            0,
            0
        );
    }
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address payable","name":"_proxy","type":"address"},{"internalType":"contract TokenState","name":"_tokenState","type":"address"},{"internalType":"address","name":"_owner","type":"address"},{"internalType":"uint256","name":"_totalSupply","type":"uint256"},{"internalType":"address","name":"_resolver","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint256","name":"snxRedeemed","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amountLiquidated","type":"uint256"},{"indexed":false,"internalType":"address","name":"liquidator","type":"address"}],"name":"AccountLiquidated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"bytes32","name":"fromCurrencyKey","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"fromAmount","type":"uint256"},{"indexed":false,"internalType":"bytes32","name":"toCurrencyKey","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"toAmount","type":"uint256"},{"indexed":false,"internalType":"address","name":"toAddress","type":"address"}],"name":"AtomicSynthExchange","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"name","type":"bytes32"},{"indexed":false,"internalType":"address","name":"destination","type":"address"}],"name":"CacheUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"bytes32","name":"currencyKey","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"ExchangeRebate","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"bytes32","name":"currencyKey","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"ExchangeReclaim","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"trackingCode","type":"bytes32"},{"indexed":false,"internalType":"bytes32","name":"toCurrencyKey","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"toAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"fee","type":"uint256"}],"name":"ExchangeTracking","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":"address","name":"proxyAddress","type":"address"}],"name":"ProxyUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"bytes32","name":"fromCurrencyKey","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"fromAmount","type":"uint256"},{"indexed":false,"internalType":"bytes32","name":"toCurrencyKey","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"toAmount","type":"uint256"},{"indexed":false,"internalType":"address","name":"toAddress","type":"address"}],"name":"SynthExchange","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"newTokenState","type":"address"}],"name":"TokenStateUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"constant":true,"inputs":[],"name":"CONTRACT_NAME","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"DECIMALS","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"TOKEN_NAME","outputs":[{"internalType":"string","name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"TOKEN_SYMBOL","outputs":[{"internalType":"string","name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"acceptOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"anySynthOrSNXRateIsInvalid","outputs":[{"internalType":"bool","name":"anyRateInvalid","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"availableCurrencyKeys","outputs":[{"internalType":"bytes32[]","name":"","type":"bytes32[]"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"availableSynthCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"availableSynths","outputs":[{"internalType":"contract ISynth","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"burnSecondary","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"burnSynths","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"burnForAddress","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"burnSynthsOnBehalf","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"burnSynthsToTarget","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"burnForAddress","type":"address"}],"name":"burnSynthsToTargetOnBehalf","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"collateral","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"_issuer","type":"address"}],"name":"collateralisationRatio","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"bytes32","name":"currencyKey","type":"bytes32"}],"name":"debtBalanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"bytes32","name":"fromCurrencyKey","type":"bytes32"},{"internalType":"uint256","name":"fromAmount","type":"uint256"},{"internalType":"bytes32","name":"toCurrencyKey","type":"bytes32"},{"internalType":"uint256","name":"toAmount","type":"uint256"},{"internalType":"address","name":"toAddress","type":"address"}],"name":"emitAtomicSynthExchange","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"bytes32","name":"currencyKey","type":"bytes32"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"emitExchangeRebate","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"bytes32","name":"currencyKey","type":"bytes32"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"emitExchangeReclaim","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"bytes32","name":"trackingCode","type":"bytes32"},{"internalType":"bytes32","name":"toCurrencyKey","type":"bytes32"},{"internalType":"uint256","name":"toAmount","type":"uint256"},{"internalType":"uint256","name":"fee","type":"uint256"}],"name":"emitExchangeTracking","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"bytes32","name":"fromCurrencyKey","type":"bytes32"},{"internalType":"uint256","name":"fromAmount","type":"uint256"},{"internalType":"bytes32","name":"toCurrencyKey","type":"bytes32"},{"internalType":"uint256","name":"toAmount","type":"uint256"},{"internalType":"address","name":"toAddress","type":"address"}],"name":"emitSynthExchange","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"bytes32","name":"sourceCurrencyKey","type":"bytes32"},{"internalType":"uint256","name":"sourceAmount","type":"uint256"},{"internalType":"bytes32","name":"destinationCurrencyKey","type":"bytes32"}],"name":"exchange","outputs":[{"internalType":"uint256","name":"amountReceived","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"bytes32","name":"sourceCurrencyKey","type":"bytes32"},{"internalType":"uint256","name":"sourceAmount","type":"uint256"},{"internalType":"bytes32","name":"destinationCurrencyKey","type":"bytes32"},{"internalType":"bytes32","name":"trackingCode","type":"bytes32"},{"internalType":"uint256","name":"minAmount","type":"uint256"}],"name":"exchangeAtomically","outputs":[{"internalType":"uint256","name":"amountReceived","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"exchangeForAddress","type":"address"},{"internalType":"bytes32","name":"sourceCurrencyKey","type":"bytes32"},{"internalType":"uint256","name":"sourceAmount","type":"uint256"},{"internalType":"bytes32","name":"destinationCurrencyKey","type":"bytes32"}],"name":"exchangeOnBehalf","outputs":[{"internalType":"uint256","name":"amountReceived","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"exchangeForAddress","type":"address"},{"internalType":"bytes32","name":"sourceCurrencyKey","type":"bytes32"},{"internalType":"uint256","name":"sourceAmount","type":"uint256"},{"internalType":"bytes32","name":"destinationCurrencyKey","type":"bytes32"},{"internalType":"address","name":"rewardAddress","type":"address"},{"internalType":"bytes32","name":"trackingCode","type":"bytes32"}],"name":"exchangeOnBehalfWithTracking","outputs":[{"internalType":"uint256","name":"amountReceived","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"bytes32","name":"sourceCurrencyKey","type":"bytes32"},{"internalType":"uint256","name":"sourceAmount","type":"uint256"},{"internalType":"bytes32","name":"destinationCurrencyKey","type":"bytes32"},{"internalType":"address","name":"rewardAddress","type":"address"},{"internalType":"bytes32","name":"trackingCode","type":"bytes32"}],"name":"exchangeWithTracking","outputs":[{"internalType":"uint256","name":"amountReceived","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"bytes32","name":"sourceCurrencyKey","type":"bytes32"},{"internalType":"uint256","name":"sourceAmount","type":"uint256"},{"internalType":"bytes32","name":"destinationCurrencyKey","type":"bytes32"},{"internalType":"address","name":"rewardAddress","type":"address"},{"internalType":"bytes32","name":"trackingCode","type":"bytes32"}],"name":"exchangeWithTrackingForInitiator","outputs":[{"internalType":"uint256","name":"amountReceived","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"bytes32","name":"sourceCurrencyKey","type":"bytes32"},{"internalType":"uint256","name":"sourceAmount","type":"uint256"},{"internalType":"bytes32","name":"destinationCurrencyKey","type":"bytes32"},{"internalType":"bytes32","name":"trackingCode","type":"bytes32"}],"name":"exchangeWithVirtual","outputs":[{"internalType":"uint256","name":"amountReceived","type":"uint256"},{"internalType":"contract IVirtualSynth","name":"vSynth","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"getFirstNonZeroEscrowIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"isResolverCached","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"bytes32","name":"currencyKey","type":"bytes32"}],"name":"isWaitingPeriod","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"issueMaxSynths","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"issueForAddress","type":"address"}],"name":"issueMaxSynthsOnBehalf","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"issueSynths","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"issueForAddress","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"issueSynthsOnBehalf","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"liquidateDelinquentAccount","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"escrowStartIndex","type":"uint256"}],"name":"liquidateDelinquentAccountEscrowIndex","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"liquidateSelf","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"maxIssuableSynths","outputs":[{"internalType":"uint256","name":"maxIssuable","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"messageSender","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"migrateAccountBalances","outputs":[{"internalType":"uint256","name":"totalEscrowRevoked","type":"uint256"},{"internalType":"uint256","name":"totalLiquidBalance","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"migrateEscrowBalanceToRewardEscrowV2","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"migrateEscrowContractBalance","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"mint","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"mintSecondary","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"mintSecondaryRewards","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"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":true,"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"proxy","outputs":[{"internalType":"contract Proxy","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"rebuildCache","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"remainingIssuableSynths","outputs":[{"internalType":"uint256","name":"maxIssuable","type":"uint256"},{"internalType":"uint256","name":"alreadyIssued","type":"uint256"},{"internalType":"uint256","name":"totalSystemDebt","type":"uint256"}],"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":[],"name":"resolverAddressesRequired","outputs":[{"internalType":"bytes32[]","name":"addresses","type":"bytes32[]"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"revokeAllEscrow","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"sUSD","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"sender","type":"address"}],"name":"setMessageSender","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address payable","name":"_proxy","type":"address"}],"name":"setProxy","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"contract TokenState","name":"_tokenState","type":"address"}],"name":"setTokenState","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"bytes32","name":"currencyKey","type":"bytes32"}],"name":"settle","outputs":[{"internalType":"uint256","name":"reclaimed","type":"uint256"},{"internalType":"uint256","name":"refunded","type":"uint256"},{"internalType":"uint256","name":"numEntriesSettled","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"bytes32","name":"currencyKey","type":"bytes32"}],"name":"synths","outputs":[{"internalType":"contract ISynth","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"synthAddress","type":"address"}],"name":"synthsByAddress","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"tokenState","outputs":[{"internalType":"contract TokenState","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"bytes32","name":"currencyKey","type":"bytes32"}],"name":"totalIssuedSynths","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"bytes32","name":"currencyKey","type":"bytes32"}],"name":"totalIssuedSynthsExcludeOtherCollateral","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"transferableSynthetix","outputs":[{"internalType":"uint256","name":"transferable","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"}]

60806040523480156200001157600080fd5b50604051620064b6380380620064b6833981016040819052620000349162000315565b84848484848085856040518060400160405280601781526020017f53796e746865746978204e6574776f726b20546f6b656e000000000000000000815250604051806040016040528060038152602001620a69cb60eb1b81525086601289868160006001600160a01b0316816001600160a01b03161415620000d35760405162461bcd60e51b8152600401620000ca9062000463565b60405180910390fd5b600080546001600160a01b0319166001600160a01b0383161781556040517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c91620001209184906200042b565b60405180910390a1506000546001600160a01b0316620001545760405162461bcd60e51b8152600401620000ca9062000451565b600280546001600160a01b0319166001600160a01b0383161790556040517ffc80377ca9c49cc11ae6982f390a42db976d5530af7c43889264b13fbbd7c57e90620001a19083906200041b565b60405180910390a150600480546001600160a01b0319166001600160a01b0388161790558451620001da90600590602088019062000243565b508351620001f090600690602087019062000243565b50506007919091556008805460ff191660ff90921691909117610100600160a81b0319166101006001600160a01b0397909716969096029590951790945550620004e19c50505050505050505050505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106200028657805160ff1916838001178555620002b6565b82800160010185558215620002b6579182015b82811115620002b657825182559160200191906001019062000299565b50620002c4929150620002c8565b5090565b620002e591905b80821115620002c45760008155600101620002cf565b90565b8051620002f581620004b1565b92915050565b8051620002f581620004cb565b8051620002f581620004d6565b600080600080600060a086880312156200032e57600080fd5b60006200033c8888620002e8565b95505060206200034f88828901620002fb565b94505060406200036288828901620002e8565b9350506060620003758882890162000308565b92505060806200038888828901620002e8565b9150509295509295909350565b620003a081620004a4565b82525050565b620003a0816200047e565b6000620003c060118362000475565b7013dddb995c881b5d5cdd081899481cd95d607a1b815260200192915050565b6000620003ef60198362000475565b7f4f776e657220616464726573732063616e6e6f74206265203000000000000000815260200192915050565b60208101620002f5828462000395565b604081016200043b828562000395565b6200044a6020830184620003a6565b9392505050565b60208082528101620002f581620003b1565b60208082528101620002f581620003e0565b90815260200190565b6000620002f58262000498565b6000620002f5826200047e565b6001600160a01b031690565b6000620002f5826200048b565b620004bc816200047e565b8114620004c857600080fd5b50565b620004bc816200048b565b620004bc81620002e5565b615fc580620004f16000396000f3fe608060405234801561001057600080fd5b50600436106104545760003560e01c80636c00f310116102415780639f7698071161013b578063d37c4d8b116100c3578063e8e09b8b11610087578063e8e09b8b14610911578063e90dd9e214610924578063ec5568891461092c578063edef719a146106bb578063ee52a2f31461093457610454565b8063d37c4d8b146108c8578063d67bdd25146108db578063d8a1f76f146108e3578063dbf63340146108f6578063dd62ed3e146108fe57610454565b8063ace88afd1161010a578063ace88afd14610874578063af086c7e14610887578063bc67f8321461088f578063c2bf3880146108a2578063c836fa0a146108b557610454565b80639f76980714610828578063a311c7c21461083b578063a5fdc5de1461084e578063a9059cbb1461086157610454565b806384358843116101c95780639324cac71161018d5780639324cac7146107ea57806395d89b41146107f257806397107d6d146107fa5780639741fb221461080d578063987757dd1461081557610454565b80638435884314610793578063899ffef4146107b45780638a290014146107bc5780638da5cb5b146107cf57806391e56b68146107d757610454565b806372cb051f1161021057806372cb051f14610748578063741853601461075d57806379ba509714610765578063835e119c1461076d57806383d625d41461078057610454565b80636c00f310146106fc5780636f01a9861461070f578063704e7b851461072257806370a082311461073557610454565b80632d3169eb116103525780634e99bda9116102da578063614d08f81161029e578063614d08f8146106b3578063666ed4f1146106bb5780636a427795146106ce5780636ac0bf9c146106e15780636b76222f146106f457610454565b80634e99bda914610668578063528c7efb1461067057806353a47bb7146106785780635af090ef1461068d5780635e22846a146106a057610454565b8063313ce56711610321578063313ce56714610614578063320223db1461061c578063326080391461062f5780633e89b9e51461064257806344b3e9231461065557610454565b80632d3169eb146105c65780632e0f2625146105d95780632f7206ce146105ee57806330ead7601461060157610454565b806316b2213f116103e05780632621716f116103a45780632621716f1461057d578063295da87d146105905780632a905318146105a35780632af64bd3146105ab5780632c955fa7146105b357610454565b806316b2213f1461053457806318160ddd14610547578063188214001461054f5780631fce304d1461055757806323b872dd1461056a57610454565b8063095ea7b311610427578063095ea7b3146104b65780630e30963c146104d65780631137aedf146104f75780631249c58b146105195780631627540c1461052157610454565b806303fbc5471461045957806304f3bcec1461046357806305b3c1c91461048157806306fdde03146104a1575b600080fd5b610461610947565b005b61046b610b34565b6040516104789190615c0d565b60405180910390f35b61049461048f3660046147dd565b610b48565b6040516104789190615a6e565b6104a9610bd5565b6040516104789190615c1b565b6104c96104c43660046148a0565b610c63565b6040516104789190615a60565b6104e96104e4366004614af3565b610cf0565b604051610478929190615e16565b61050a6105053660046147dd565b610dff565b60405161047893929190615b12565b6104c9610e94565b61046161052f3660046147dd565b61124e565b6104946105423660046147dd565b6112ac565b6104946112e1565b6104a96112e7565b6104c9610565366004614ab7565b611320565b6104c9610578366004614853565b6113b5565b61049461058b3660046147dd565b6113f4565b61046161059e366004614ab7565b6115d5565b6104a9611656565b6104c9611675565b6104616105c13660046147dd565b611791565b6104616105d4366004614af3565b6117dd565b6105e1611893565b6040516104789190615e59565b6104616105fc3660046149ea565b611898565b61049461060f366004614b36565b61195a565b6105e1611a18565b61046161062a3660046147dd565b611a21565b61046b61063d366004614ab7565b611a6d565b610494610650366004614ab7565b611af2565b610494610663366004614bab565b611b2a565b6104c9611be2565b6104c9611c61565b610680611e41565b6040516104789190615807565b61049461069b366004614b36565b611e50565b6104c96106ae3660046147dd565b611eb0565b610494611edc565b6104616106c93660046148a0565b611eec565b6104616106dc3660046147dd565b611ef8565b6104946106ef3660046147dd565b6120b1565b6104616121b9565b61046161070a3660046149ea565b612264565b61046161071d3660046148d0565b6122b7565b6104c96107303660046148a0565b612370565b6104946107433660046147dd565b61239b565b6107506123cd565b6040516104789190615a4f565b61046161244b565b61046161259d565b61046b61077b366004614ab7565b612639565b61049461078e366004614ab7565b61266e565b6107a66107a13660046147dd565b6126a6565b604051610478929190615a98565b61075061292d565b6104616107ca366004614ab7565b6129c1565b610680612a0b565b6104946107e5366004614963565b612a1a565b610494612ada565b6104a9612ae5565b6104616108083660046147dd565b612b40565b610461612b93565b61050a610823366004614ab7565b612c0c565b610461610836366004614c20565b612c82565b6104946108493660046147dd565b612cae565b61049461085c3660046147dd565b612ce3565b6104c961086f3660046148a0565b612d18565b6104616108823660046148d0565b612d62565b610461612daf565b61046161089d3660046147dd565b612df8565b6104616108b03660046148a0565b612e22565b6104946108c3366004614902565b612e70565b6104946108d63660046148a0565b612f2e565b610680612fb5565b6104616108f1366004614ab7565b612fc4565b610494612fcc565b61049461090c366004614819565b613046565b61046161091f3660046148a0565b61307a565b61046b6130c8565b61046b6130d7565b610494610942366004614b15565b6130e6565b61094f6131a2565b60085460405163dacb2d0160e01b815260009161010090046001600160a01b03169063dacb2d019061098390600401615df8565b60206040518083038186803b15801561099b57600080fd5b505afa1580156109af573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506109d391908101906147fb565b60085460405163dacb2d0160e01b81529192506000916101009091046001600160a01b03169063dacb2d0190610a0b90600401615d70565b60206040518083038186803b158015610a2357600080fd5b505afa158015610a37573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610a5b91908101906147fb565b9050816001600160a01b0316816001600160a01b03161415610a985760405162461bcd60e51b8152600401610a8f90615de8565b60405180910390fd5b600480546040516370a0823160e01b81526000926001600160a01b03909216916370a0823191610aca91879101615807565b60206040518083038186803b158015610ae257600080fd5b505afa158015610af6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610b1a9190810190614ad5565b90508015610b2f57610b2d8383836131cc565b505b505050565b60085461010090046001600160a01b031681565b6000610b526133a8565b6001600160a01b03166305b3c1c9836040518263ffffffff1660e01b8152600401610b7d9190615807565b60206040518083038186803b158015610b9557600080fd5b505afa158015610ba9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610bcd9190810190614ad5565b90505b919050565b6005805460408051602060026001851615610100026000190190941693909304601f81018490048402820184019092528181529291830182828015610c5b5780601f10610c3057610100808354040283529160200191610c5b565b820191906000526020600020905b815481529060010190602001808311610c3e57829003601f168201915b505050505081565b6000610c6d6133bc565b60035460048054604051633691826360e21b81526001600160a01b03938416939091169163da46098c91610ca7918591899189910161592f565b600060405180830381600087803b158015610cc157600080fd5b505af1158015610cd5573d6000803e3d6000fd5b50505050610ce48185856133fb565b60019150505b92915050565b6000808584610cff828261347b565b610d076133bc565b610d0f6134dc565b6001600160a01b0316634f8633d2600360009054906101000a90046001600160a01b0316600360009054906101000a90046001600160a01b03168b8b8b600360009054906101000a90046001600160a01b03166001600360009054906101000a90046001600160a01b03168e6040518a63ffffffff1660e01b8152600401610d9f999897969594939291906158df565b6040805180830381600087803b158015610db857600080fd5b505af1158015610dcc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610df09190810190614c8c565b93509350505094509492505050565b6000806000610e0c6133a8565b6001600160a01b0316631137aedf856040518263ffffffff1660e01b8152600401610e379190615807565b60606040518083038186803b158015610e4f57600080fd5b505afa158015610e63573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610e879190810190614cbc565b9250925092509193909250565b6000610e9e6134f3565b6000610ea8613547565b6001600160a01b03161415610ecf5760405162461bcd60e51b8152600401610a8f90615d23565b6000610ed9613568565b90506000610ee5613547565b90506000826001600160a01b031663cc5c095c6040518163ffffffff1660e01b815260040160206040518083038186803b158015610f2257600080fd5b505afa158015610f36573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610f5a9190810190614ad5565b905060008111610f7c5760405162461bcd60e51b8152600401610a8f90615dbb565b610f8860003083613584565b604051637e7961d760e01b81526000906001600160a01b03851690637e7961d790610fb7908590600401615a6e565b602060405180830381600087803b158015610fd157600080fd5b505af1158015610fe5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506110099190810190614ad5565b9050600061101d838363ffffffff6135c716565b600480546040516370a0823160e01b81529293506001600160a01b03169163b46310f69187916110b991869186916370a082319161105d91879101615807565b60206040518083038186803b15801561107557600080fd5b505afa158015611089573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506110ad9190810190614ad5565b9063ffffffff6135ef16565b6040518363ffffffff1660e01b81526004016110d69291906159e5565b600060405180830381600087803b1580156110f057600080fd5b505af1158015611104573d6000803e3d6000fd5b50505050611113308583613584565b604051630b32e9c760e31b81526001600160a01b038516906359974e389061113f908490600401615a6e565b602060405180830381600087803b15801561115957600080fd5b505af115801561116d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506111919190810190614a99565b50600480546040516370a0823160e01b81526001600160a01b039091169163b46310f69133916111d191879186916370a082319161105d91879101615815565b6040518363ffffffff1660e01b81526004016111ee929190615823565b600060405180830381600087803b15801561120857600080fd5b505af115801561121c573d6000803e3d6000fd5b5050505061122b303384613584565b60075461123e908463ffffffff6135ef16565b6007555060019450505050505b90565b6112566131a2565b600180546001600160a01b0319166001600160a01b0383161790556040517f906a1c6bd7e3091ea86693dd029a831c19049ce77f1dce2ce0bab1cacbabce22906112a1908390615807565b60405180910390a150565b60006112b66133a8565b6001600160a01b03166316b2213f836040518263ffffffff1660e01b8152600401610b7d9190615807565b60075481565b6040518060400160405280601781526020017f53796e746865746978204e6574776f726b20546f6b656e00000000000000000081525081565b60008061132b6134dc565b6003546040516301670a7b60e21b81526001600160a01b039283169263059c29ec9261135e9291169087906004016159e5565b60206040518083038186803b15801561137657600080fd5b505afa15801561138a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506113ae9190810190614ad5565b1192915050565b60006113bf613614565b6113c7613669565b6113d184836136a9565b506003546113ea906001600160a01b031685858561397a565b90505b9392505050565b6000806113ff613a26565b6001600160a01b031663204b676a846040518263ffffffff1660e01b815260040161142a9190615807565b60206040518083038186803b15801561144257600080fd5b505afa158015611456573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061147a9190810190614ad5565b905060006114866146a8565b60005b838110156115bc57611499613a26565b6001600160a01b031663ae58254987836040518363ffffffff1660e01b81526004016114c69291906159e5565b60206040518083038186803b1580156114de57600080fd5b505afa1580156114f2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506115169190810190614ad5565b9250611520613a26565b6001600160a01b03166345626bd687856040518363ffffffff1660e01b815260040161154d9291906159e5565b604080518083038186803b15801561156457600080fd5b505afa158015611578573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061159c9190810190614c3e565b6020810151909250156115b4579350610bd092505050565b600101611489565b5060405162461bcd60e51b8152600401610a8f90615c96565b6115dd6134f3565b6115e56133bc565b6115ed6133a8565b60035460405163b06e8c6560e01b81526001600160a01b039283169263b06e8c65926116209291169085906004016159e5565b600060405180830381600087803b15801561163a57600080fd5b505af115801561164e573d6000803e3d6000fd5b505050505b50565b604051806040016040528060038152602001620a69cb60eb1b81525081565b6000606061168161292d565b905060005b815181101561178857600082828151811061169d57fe5b602090810291909101810151600081815260099092526040918290205460085492516321f8a72160e01b81529193506001600160a01b0390811692610100900416906321f8a721906116f3908590600401615a6e565b60206040518083038186803b15801561170b57600080fd5b505afa15801561171f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061174391908101906147fb565b6001600160a01b031614158061176e57506000818152600960205260409020546001600160a01b0316155b1561177f576000935050505061124b565b50600101611686565b50600191505090565b6117996134f3565b6117a16133bc565b6117a96133a8565b60035460405163159fa0d560e11b81526001600160a01b0392831692632b3f41aa926116209286929091169060040161583e565b6117e5613a42565b6002546040516001600160a01b039091169063907dff979061180f90869086908690602001615b12565b604051602081830303815290604052600260405161182c9061578f565b6040519081900381206001600160e01b031960e086901b16825261185b9392918a906000908190600401615b8c565b600060405180830381600087803b15801561187557600080fd5b505af1158015611889573d6000803e3d6000fd5b5050505050505050565b601281565b6118a0613a42565b6002546040516001600160a01b039091169063907dff97906118ce9088908890889088908890602001615ac6565b60405160208183030381529060405260026040516118eb90615779565b60405180910390206118fc8b613a7a565b6000806040518763ffffffff1660e01b815260040161192096959493929190615b8c565b600060405180830381600087803b15801561193a57600080fd5b505af115801561194e573d6000803e3d6000fd5b50505050505050505050565b60008584611968828261347b565b6119706133bc565b6119786134dc565b6003546040516327c319e960e11b81526001600160a01b0392831692634f8633d2926119ba9291169081908d908d908d9084906000908f908f906004016158df565b6040805180830381600087803b1580156119d357600080fd5b505af11580156119e7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250611a0b9190810190614c8c565b5098975050505050505050565b60085460ff1681565b611a296134f3565b611a316133bc565b611a396133a8565b60035460405163fd864ccf60e01b81526001600160a01b039283169263fd864ccf926116209286929091169060040161583e565b6000611a776133a8565b6001600160a01b03166332608039836040518263ffffffff1660e01b8152600401611aa29190615a6e565b60206040518083038186803b158015611aba57600080fd5b505afa158015611ace573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610bcd9190810190614c02565b6000611afc6133a8565b6001600160a01b0316637b1001b78360016040518363ffffffff1660e01b8152600401610b7d929190615a8a565b60008584611b38828261347b565b611b406133bc565b611b486134dc565b60035460405162674ed160e71b81526001600160a01b03928316926333a7688092611b84929116908c908c908c9084908d908d906004016159f3565b602060405180830381600087803b158015611b9e57600080fd5b505af1158015611bb2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250611bd69190810190614ad5565b98975050505050505050565b6000611bec6133a8565b6001600160a01b0316634e99bda96040518163ffffffff1660e01b815260040160206040518083038186803b158015611c2457600080fd5b505afa158015611c38573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250611c5c9190810190614a99565b905090565b6000611c6b613669565b611c736133bc565b6003546001600160a01b0316611c87613a86565b6001600160a01b031663c00007b0826040518263ffffffff1660e01b8152600401611cb29190615807565b600060405180830381600087803b158015611ccc57600080fd5b505af1158015611ce0573d6000803e3d6000fd5b50505050600080611cef6133a8565b6001600160a01b03166372c658168460016040518363ffffffff1660e01b8152600401611d1d9291906159ca565b606060405180830381600087803b158015611d3757600080fd5b505af1158015611d4b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250611d6f9190810190614cbc565b509150915060008111611d945760405162461bcd60e51b8152600401610a8f90615d9e565b611da083838386613aa5565b6000611db484611dae613a86565b85613b21565b905080611dd35760405162461bcd60e51b8152600401610a8f90615d43565b611ddb613a86565b6001600160a01b0316633c6b16ab846040518263ffffffff1660e01b8152600401611e069190615a6e565b600060405180830381600087803b158015611e2057600080fd5b505af1158015611e34573d6000803e3d6000fd5b5092965050505050505090565b6001546001600160a01b031681565b60008584611e5e828261347b565b611e666133bc565b611e6e6134dc565b6003546040516327c319e960e11b81526001600160a01b0392831692634f8633d2926119ba9291169081908d908d908d9032906000908f908f90600401615859565b6000611eba613669565b611ec26133bc565b600354610bcd9083906000906001600160a01b0316613b2e565b680a6f2dce8d0cae8d2f60bb1b81565b611ef4613f30565b5050565b611f00613669565b6008546040516321f8a72160e01b815260009161010090046001600160a01b0316906321f8a72190611f45906b131959d858de53585c9ad95d60a21b90600401615a6e565b60206040518083038186803b158015611f5d57600080fd5b505afa158015611f71573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250611f9591908101906147fb565b9050336001600160a01b03821614611fbf5760405162461bcd60e51b8152600401610a8f90615d53565b611fc7613a26565b6001600160a01b031663de065f678383611fdf613a26565b6001600160a01b031663326a3cfb876040518263ffffffff1660e01b815260040161200a9190615807565b60206040518083038186803b15801561202257600080fd5b505afa158015612036573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061205a9190810190614ad5565b60006040518563ffffffff1660e01b815260040161207b9493929190615957565b600060405180830381600087803b15801561209557600080fd5b505af11580156120a9573d6000803e3d6000fd5b505050505050565b60006120bb6133a8565b600480546040516370a0823160e01b81526001600160a01b0393841693636bed0415938793909116916370a08231916120f691859101615807565b60206040518083038186803b15801561210e57600080fd5b505afa158015612122573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506121469190810190614ad5565b6040518363ffffffff1660e01b81526004016121639291906159e5565b604080518083038186803b15801561217a57600080fd5b505afa15801561218e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506121b29190810190614c5c565b5092915050565b6121c16131a2565b6004546000906001600160a01b03166370a082316121dd613f48565b6040518263ffffffff1660e01b81526004016121f99190615807565b60206040518083038186803b15801561221157600080fd5b505afa158015612225573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506122499190810190614ad5565b9050611ef4612256613f48565b61225e613a26565b836131cc565b61226c613a42565b6002546040516001600160a01b039091169063907dff979061229a9088908890889088908890602001615ac6565b60405160208183030381529060405260026040516118eb906157ba565b6122bf613a42565b6002546040516001600160a01b039091169063907dff97906122e79085908590602001615a98565b6040516020818303038152906040526002604051612304906157d0565b604051809103902061231588613a7a565b6000806040518763ffffffff1660e01b815260040161233996959493929190615b8c565b600060405180830381600087803b15801561235357600080fd5b505af1158015612367573d6000803e3d6000fd5b50505050505050565b600061237a613669565b6123826133bc565b6003546113ed90849084906001600160a01b0316613b2e565b600480546040516370a0823160e01b81526000926001600160a01b03909216916370a0823191610b7d91869101615807565b60606123d76133a8565b6001600160a01b03166372cb051f6040518163ffffffff1660e01b815260040160006040518083038186803b15801561240f57600080fd5b505afa158015612423573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052611c5c9190810190614a64565b606061245561292d565b905060005b8151811015611ef457600082828151811061247157fe5b602002602001015190506000600860019054906101000a90046001600160a01b03166001600160a01b031663dacb2d0183846040516020016124b391906157f1565b6040516020818303038152906040526040518363ffffffff1660e01b81526004016124df929190615aa6565b60206040518083038186803b1580156124f757600080fd5b505afa15801561250b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061252f91908101906147fb565b6000838152600960205260409081902080546001600160a01b0319166001600160a01b038416179055519091507f88a93678a3692f6789d9546fc621bf7234b101ddb7d4fe479455112831b8aa689061258b9084908490615a7c565b60405180910390a1505060010161245a565b6001546001600160a01b031633146125c75760405162461bcd60e51b8152600401610a8f90615c59565b6000546001546040517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9261260a926001600160a01b039182169291169061583e565b60405180910390a160018054600080546001600160a01b03199081166001600160a01b03841617909155169055565b60006126436133a8565b6001600160a01b031663835e119c836040518263ffffffff1660e01b8152600401611aa29190615a6e565b60006126786133a8565b6001600160a01b0316637b1001b78360006040518363ffffffff1660e01b8152600401610b7d929190615a8a565b6000806126b1613669565b6008546040516321f8a72160e01b815260009161010090046001600160a01b0316906321f8a721906127009075446562744d69677261746f724f6e457468657265756d60501b90600401615a6e565b60206040518083038186803b15801561271857600080fd5b505afa15801561272c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061275091908101906147fb565b9050336001600160a01b0382161461277a5760405162461bcd60e51b8152600401610a8f90615c2c565b600480546040516370a0823160e01b81526001600160a01b03909116916370a08231916127a991889101615807565b60206040518083038186803b1580156127c157600080fd5b505afa1580156127d5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506127f99190810190614ad5565b9150811561282f57600061280e858385613b21565b90508061282d5760405162461bcd60e51b8152600401610a8f90615ce3565b505b612837613a26565b6001600160a01b031663326a3cfb856040518263ffffffff1660e01b81526004016128629190615807565b60206040518083038186803b15801561287a57600080fd5b505afa15801561288e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506128b29190810190614ad5565b92508215612927576128c2613a26565b6001600160a01b031663de065f6785838660006040518563ffffffff1660e01b81526004016128f49493929190615957565b600060405180830381600087803b15801561290e57600080fd5b505af1158015612922573d6000803e3d6000fd5b505050505b50915091565b606080612938613f62565b6040805160028082526060808301845293945090916020830190803883390190505090506b526577617264457363726f7760a01b8160008151811061297957fe5b6020026020010181815250506d537570706c795363686564756c6560901b816001815181106129a457fe5b6020026020010181815250506129ba82826140ab565b9250505090565b6129c96134f3565b6129d16133bc565b6129d96133a8565b6003546040516285c0d160e31b81526001600160a01b039283169263042e0688926116209291169085906004016159e5565b6000546001600160a01b031681565b60008584612a28828261347b565b612a306133bc565b612a386134dc565b6003546040516327c319e960e11b81526001600160a01b0392831692634f8633d292612a7b928e92909116908d908d908d9085906000908f908f906004016158df565b6040805180830381600087803b158015612a9457600080fd5b505af1158015612aa8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250612acc9190810190614c8c565b509998505050505050505050565b631cd554d160e21b81565b6006805460408051602060026001851615610100026000190190941693909304601f81018490048402820184019092528181529291830182828015610c5b5780601f10610c3057610100808354040283529160200191610c5b565b612b486131a2565b600280546001600160a01b0319166001600160a01b0383161790556040517ffc80377ca9c49cc11ae6982f390a42db976d5530af7c43889264b13fbbd7c57e906112a1908390615815565b612b9b6134f3565b612ba36133bc565b612bab6133a8565b6003546040516324beb82560e11b81526001600160a01b039283169263497d704a92612bdc92911690600401615807565b600060405180830381600087803b158015612bf657600080fd5b505af1158015610b2d573d6000803e3d6000fd5b565b6000806000612c196133bc565b612c216134dc565b6003546040516306c5a00b60e21b81526001600160a01b0392831692631b16802c92612c549291169088906004016159e5565b606060405180830381600087803b158015612c6e57600080fd5b505af1158015610e63573d6000803e3d6000fd5b612c8a614160565b600480546001600160a01b0319166001600160a01b038316179055611653816141ce565b6000612cb86133a8565b6001600160a01b031663a311c7c2836040518263ffffffff1660e01b8152600401610b7d9190615807565b6000612ced6133a8565b6001600160a01b031663a5fdc5de836040518263ffffffff1660e01b8152600401610b7d9190615807565b6000612d22613614565b612d2a613669565b600354612d40906001600160a01b0316836136a9565b50600354612d58906001600160a01b03168484613b21565b5060019392505050565b612d6a613a42565b6002546040516001600160a01b039091169063907dff9790612d929085908590602001615a98565b604051602081830303815290604052600260405161230490615784565b612db76134f3565b612dbf6133bc565b612dc76133a8565b60035460405163644bb89960e11b81526001600160a01b039283169263c897713292612bdc92911690600401615807565b612e00614240565b600380546001600160a01b0319166001600160a01b0392909216919091179055565b612e2a6134f3565b612e326133bc565b612e3a6133a8565b600354604051632694552d60e21b81526001600160a01b0392831692639a5154b49261207b92879290911690869060040161592f565b60008382612e7e828261347b565b612e866133bc565b612e8e6134dc565b6003546040516327c319e960e11b81526001600160a01b0392831692634f8633d292612ed1928c92909116908b908b908b908590600090829082906004016158df565b6040805180830381600087803b158015612eea57600080fd5b505af1158015612efe573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250612f229190810190614c8c565b50979650505050505050565b6000612f386133a8565b6001600160a01b031663d37c4d8b84846040518363ffffffff1660e01b8152600401612f659291906159e5565b60206040518083038186803b158015612f7d57600080fd5b505afa158015612f91573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506113ed9190810190614ad5565b6003546001600160a01b031681565b611653613f30565b6000612fd66133a8565b6001600160a01b031663dbf633406040518163ffffffff1660e01b815260040160206040518083038186803b15801561300e57600080fd5b505afa158015613022573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250611c5c9190810190614ad5565b60048054604051636eb1769f60e11b81526000926001600160a01b039092169163dd62ed3e91612f6591879187910161583e565b6130826134f3565b61308a6133bc565b6130926133a8565b60035460405163227635b160e11b81526001600160a01b03928316926344ec6b629261207b92879290911690869060040161592f565b6004546001600160a01b031681565b6002546001600160a01b031681565b600083826130f4828261347b565b6130fc6133bc565b6131046134dc565b6003546040516327c319e960e11b81526001600160a01b0392831692634f8633d2926131469291169081908b908b908b908490600090829082906004016158df565b6040805180830381600087803b15801561315f57600080fd5b505af1158015613173573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506131979190810190614c8c565b509695505050505050565b6000546001600160a01b03163314612c0a5760405162461bcd60e51b8152600401610a8f90615d33565b60006001600160a01b038316158015906131ef57506001600160a01b0383163014155b801561320957506002546001600160a01b03848116911614155b6132255760405162461bcd60e51b8152600401610a8f90615c3c565b600480546040516370a0823160e01b81526001600160a01b039091169163b46310f69187916132c091879186916370a082319161326491879101615807565b60206040518083038186803b15801561327c57600080fd5b505afa158015613290573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506132b49190810190614ad5565b9063ffffffff6135c716565b6040518363ffffffff1660e01b81526004016132dd9291906159e5565b600060405180830381600087803b1580156132f757600080fd5b505af115801561330b573d6000803e3d6000fd5b5050600480546040516370a0823160e01b81526001600160a01b03909116935063b46310f69250869161334e91879186916370a082319161105d91879101615807565b6040518363ffffffff1660e01b815260040161336b9291906159e5565b600060405180830381600087803b15801561338557600080fd5b505af1158015613399573d6000803e3d6000fd5b50505050612d58848484613584565b6000611c5c6524b9b9bab2b960d11b61426a565b6002546001600160a01b031633148015906133e257506003546001600160a01b03163314155b15612c0a57600380546001600160a01b03191633179055565b6002546040516001600160a01b039091169063907dff9790613421908490602001615a6e565b604051602081830303815290604052600360405161343e906157c5565b604051809103902061344f88613a7a565b61345888613a7a565b60006040518763ffffffff1660e01b815260040161233996959493929190615bc6565b6134836142c7565b6001600160a01b0316631ce00ba283836040518363ffffffff1660e01b81526004016134b0929190615a98565b60006040518083038186803b1580156134c857600080fd5b505afa1580156120a9573d6000803e3d6000fd5b6000611c5c6822bc31b430b733b2b960b91b61426a565b6134fb6142c7565b6001600160a01b0316637c3125416040518163ffffffff1660e01b815260040160006040518083038186803b15801561353357600080fd5b505afa158015610b2d573d6000803e3d6000fd5b6000611c5c722932bbb0b93239a234b9ba3934b13aba34b7b760691b61426a565b6000611c5c6d537570706c795363686564756c6560901b61426a565b6002546040516001600160a01b039091169063907dff97906135aa908490602001615a6e565b604051602081830303815290604052600360405161343e906157fc565b6000828211156135e95760405162461bcd60e51b8152600401610a8f90615cd3565b50900390565b6000828201838110156113ed5760405162461bcd60e51b8152600401610a8f90615ca6565b6002546001600160a01b031633141561362c57612c0a565b613635336142e1565b1561365157600380546001600160a01b03191633179055612c0a565b60405162461bcd60e51b8152600401610a8f90615dcb565b6136716142c7565b6001600160a01b031663086dabd16040518163ffffffff1660e01b815260040160006040518083038186803b15801561353357600080fd5b6008546040516321f8a72160e01b815260009182916101009091046001600160a01b0316906321f8a721906136f1906b131959d858de53585c9ad95d60a21b90600401615a6e565b60206040518083038186803b15801561370957600080fd5b505afa15801561371d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061374191908101906147fb565b6003549091506001600160a01b03161580159061376b57506003546001600160a01b038281169116145b806137875750806001600160a01b0316846001600160a01b0316145b15613796576001915050610cea565b60006137a06133a8565b6001600160a01b031663d37c4d8b86631cd554d160e21b6040518363ffffffff1660e01b81526004016137d49291906159e5565b60206040518083038186803b1580156137ec57600080fd5b505afa158015613800573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506138249190810190614ad5565b1115610ce4576000806138356133a8565b600480546040516370a0823160e01b81526001600160a01b0393841693636bed0415938b93909116916370a082319161387091859101615807565b60206040518083038186803b15801561388857600080fd5b505afa15801561389c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506138c09190810190614ad5565b6040518363ffffffff1660e01b81526004016138dd9291906159e5565b604080518083038186803b1580156138f457600080fd5b505afa158015613908573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061392c9190810190614c5c565b91509150818511156139505760405162461bcd60e51b8152600401610a8f90615d03565b801561396e5760405162461bcd60e51b8152600401610a8f90615d13565b50600195945050505050565b60048054604051636eb1769f60e11b81526000926001600160a01b039092169163da46098c91879189916139c0918891879163dd62ed3e9161326491889188910161583e565b6040518463ffffffff1660e01b81526004016139de9392919061592f565b600060405180830381600087803b1580156139f857600080fd5b505af1158015613a0c573d6000803e3d6000fd5b50505050613a1b8484846131cc565b90505b949350505050565b6000611c5c6d2932bbb0b93222b9b1b937bbab1960911b61426a565b613a4a6134dc565b6001600160a01b0316336001600160a01b031614612c0a5760405162461bcd60e51b8152600401610a8f90615c86565b6001600160a01b031690565b6000611c5c704c697175696461746f725265776172647360781b61426a565b6002546040516001600160a01b039091169063907dff9790613acf90869086908690602001615e31565b6040516020818303038152906040526002604051613aec906157e6565b6040518091039020613afd89613a7a565b6000806040518763ffffffff1660e01b815260040161185b96959493929190615b8c565b60006113ea8484846131cc565b6000613b38613a86565b6001600160a01b031663c00007b0856040518263ffffffff1660e01b8152600401613b639190615807565b600060405180830381600087803b158015613b7d57600080fd5b505af1158015613b91573d6000803e3d6000fd5b505050506000806000613ba26133a8565b6001600160a01b03166372c658168860006040518363ffffffff1660e01b8152600401613bd09291906159ca565b606060405180830381600087803b158015613bea57600080fd5b505af1158015613bfe573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250613c229190810190614cbc565b919450925090508015613c9b57613c37613a26565b6001600160a01b031663de065f678889848a6040518563ffffffff1660e01b8152600401613c689493929190615995565b600060405180830381600087803b158015613c8257600080fd5b505af1158015613c96573d6000803e3d6000fd5b505050505b613ca787848488613aa5565b6000613cb1614690565b6001600160a01b0316638074b3726040518163ffffffff1660e01b815260040160206040518083038186803b158015613ce957600080fd5b505afa158015613cfd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250613d219190810190614ad5565b90506000613d2d614690565b6001600160a01b03166331e4e0306040518163ffffffff1660e01b815260040160206040518083038186803b158015613d6557600080fd5b505afa158015613d79573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250613d9d9190810190614ad5565b90506000613da9614690565b6001600160a01b0316635616c9578b6040518263ffffffff1660e01b8152600401613dd49190615807565b60206040518083038186803b158015613dec57600080fd5b505afa158015613e00573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250613e2491908101906147fb565b90506000613e338b8386613b21565b905080613e525760405162461bcd60e51b8152600401610a8f90615cb6565b6000613e5f8c8b86613b21565b905080613e7e5760405162461bcd60e51b8152600401610a8f90615d8e565b8715613f1e576000613e988d613e92613a86565b8b613b21565b905080613eb75760405162461bcd60e51b8152600401610a8f90615d43565b613ebf613a86565b6001600160a01b0316633c6b16ab8a6040518263ffffffff1660e01b8152600401613eea9190615a6e565b600060405180830381600087803b158015613f0457600080fd5b505af1158015613f18573d6000803e3d6000fd5b50505050505b5060019b9a5050505050505050505050565b60405162461bcd60e51b8152600401610a8f90615cf3565b6000611c5c6b526577617264457363726f7760a01b61426a565b60408051600780825261010082019092526060916020820160e0803883390190505090506b53797374656d53746174757360a01b81600081518110613fa357fe5b6020026020010181815250506822bc31b430b733b2b960b91b81600181518110613fc957fe5b6020026020010181815250506524b9b9bab2b960d11b81600281518110613fec57fe5b602002602001018181525050722932bbb0b93239a234b9ba3934b13aba34b7b760691b8160038151811061401c57fe5b602002602001018181525050704c697175696461746f725265776172647360781b8160048151811061404a57fe5b602002602001018181525050692634b8bab4b230ba37b960b11b8160058151811061407157fe5b6020026020010181815250506d2932bbb0b93222b9b1b937bbab1960911b8160068151811061409c57fe5b60200260200101818152505090565b606081518351016040519080825280602002602001820160405280156140db578160200160208202803883390190505b50905060005b835181101561411d578381815181106140f657fe5b602002602001015182828151811061410a57fe5b60209081029190910101526001016140e1565b5060005b82518110156121b25782818151811061413657fe5b602002602001015182828651018151811061414d57fe5b6020908102919091010152600101614121565b6002546001600160a01b0316331480159061418657506003546001600160a01b03163314155b1561419e57600380546001600160a01b031916331790555b6000546003546001600160a01b03908116911614612c0a5760405162461bcd60e51b8152600401610a8f90615c76565b6002546040516001600160a01b039091169063907dff97906141f4908490602001615807565b6040516020818303038152906040526001604051614211906157db565b6040519081900381206001600160e01b031960e086901b16825261162093929160009081908190600401615b2d565b6002546001600160a01b03163314612c0a5760405162461bcd60e51b8152600401610a8f90615dcb565b60008181526009602090815260408083205490516001600160a01b03909116918215159161429a9186910161579a565b604051602081830303815290604052906121b25760405162461bcd60e51b8152600401610a8f9190615c1b565b6000611c5c6b53797374656d53746174757360a01b61426a565b6008546040516321f8a72160e01b815260009161010090046001600160a01b0316906321f8a7219061431590600401615ddb565b60206040518083038186803b15801561432d57600080fd5b505afa158015614341573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061436591908101906147fb565b6001600160a01b0316826001600160a01b0316148061441657506008546040516321f8a72160e01b81526101009091046001600160a01b0316906321f8a721906143b190600401615d63565b60206040518083038186803b1580156143c957600080fd5b505afa1580156143dd573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061440191908101906147fb565b6001600160a01b0316826001600160a01b0316145b806144b357506008546040516321f8a72160e01b81526101009091046001600160a01b0316906321f8a7219061444e90600401615c4c565b60206040518083038186803b15801561446657600080fd5b505afa15801561447a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061449e91908101906147fb565b6001600160a01b0316826001600160a01b0316145b8061455057506008546040516321f8a72160e01b81526101009091046001600160a01b0316906321f8a721906144eb90600401615cc6565b60206040518083038186803b15801561450357600080fd5b505afa158015614517573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061453b91908101906147fb565b6001600160a01b0316826001600160a01b0316145b806145ed57506008546040516321f8a72160e01b81526101009091046001600160a01b0316906321f8a7219061458890600401615c69565b60206040518083038186803b1580156145a057600080fd5b505afa1580156145b4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506145d891908101906147fb565b6001600160a01b0316826001600160a01b0316145b80610bcd57506008546040516321f8a72160e01b81526101009091046001600160a01b0316906321f8a7219061462590600401615dae565b60206040518083038186803b15801561463d57600080fd5b505afa158015614651573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061467591908101906147fb565b6001600160a01b0316826001600160a01b0316149050919050565b6000611c5c692634b8bab4b230ba37b960b11b61426a565b604080518082019091526000808252602082015290565b8035610cea81615f4a565b8051610cea81615f4a565b600082601f8301126146e657600080fd5b81516146f96146f482615e8e565b615e67565b9150818183526020840193506020810190508385602084028201111561471e57600080fd5b60005b8381101561474a5781614734888261476a565b8452506020928301929190910190600101614721565b5050505092915050565b8051610cea81615f5e565b8035610cea81615f67565b8051610cea81615f67565b8051610cea81615f70565b8035610cea81615f70565b60006040828403121561479d57600080fd5b6147a76040615e67565b905060006147b584846147d2565b82525060206147c68484830161476a565b60208301525092915050565b8051610cea81615f79565b6000602082840312156147ef57600080fd5b6000613a1e84846146bf565b60006020828403121561480d57600080fd5b6000613a1e84846146ca565b6000806040838503121561482c57600080fd5b600061483885856146bf565b9250506020614849858286016146bf565b9150509250929050565b60008060006060848603121561486857600080fd5b600061487486866146bf565b9350506020614885868287016146bf565b92505060406148968682870161475f565b9150509250925092565b600080604083850312156148b357600080fd5b60006148bf85856146bf565b92505060206148498582860161475f565b6000806000606084860312156148e557600080fd5b60006148f186866146bf565b93505060206148858682870161475f565b6000806000806080858703121561491857600080fd5b600061492487876146bf565b94505060206149358782880161475f565b93505060406149468782880161475f565b92505060606149578782880161475f565b91505092959194509250565b60008060008060008060c0878903121561497c57600080fd5b600061498889896146bf565b965050602061499989828a0161475f565b95505060406149aa89828a0161475f565b94505060606149bb89828a0161475f565b93505060806149cc89828a016146bf565b92505060a06149dd89828a0161475f565b9150509295509295509295565b60008060008060008060c08789031215614a0357600080fd5b6000614a0f89896146bf565b9650506020614a2089828a0161475f565b9550506040614a3189828a0161475f565b9450506060614a4289828a0161475f565b9350506080614a5389828a0161475f565b92505060a06149dd89828a016146bf565b600060208284031215614a7657600080fd5b815167ffffffffffffffff811115614a8d57600080fd5b613a1e848285016146d5565b600060208284031215614aab57600080fd5b6000613a1e8484614754565b600060208284031215614ac957600080fd5b6000613a1e848461475f565b600060208284031215614ae757600080fd5b6000613a1e848461476a565b60008060008060808587031215614b0957600080fd5b6000614924878761475f565b600080600060608486031215614b2a57600080fd5b60006148f1868661475f565b600080600080600060a08688031215614b4e57600080fd5b6000614b5a888861475f565b9550506020614b6b8882890161475f565b9450506040614b7c8882890161475f565b9350506060614b8d888289016146bf565b9250506080614b9e8882890161475f565b9150509295509295909350565b600080600080600060a08688031215614bc357600080fd5b6000614bcf888861475f565b9550506020614be08882890161475f565b9450506040614bf18882890161475f565b9350506060614b8d8882890161475f565b600060208284031215614c1457600080fd5b6000613a1e8484614775565b600060208284031215614c3257600080fd5b6000613a1e8484614780565b600060408284031215614c5057600080fd5b6000613a1e848461478b565b60008060408385031215614c6f57600080fd5b6000614c7b858561476a565b925050602061484985828601614754565b60008060408385031215614c9f57600080fd5b6000614cab858561476a565b925050602061484985828601614775565b600080600060608486031215614cd157600080fd5b6000614cdd868661476a565b9350506020614cee8682870161476a565b92505060406148968682870161476a565b6000614d0b8383614d8d565b505060200190565b614d1c81615ef0565b82525050565b614d1c81615ec2565b6000614d3682615eb5565b614d408185615eb9565b9350614d4b83615eaf565b8060005b83811015614d79578151614d638882614cff565b9750614d6e83615eaf565b925050600101614d4f565b509495945050505050565b614d1c81615ecd565b614d1c8161124b565b614d1c614da28261124b565b61124b565b6000614db282615eb5565b614dbc8185615eb9565b9350614dcc818560208601615f14565b614dd581615f40565b9093019392505050565b614d1c81615ed2565b614d1c81615efb565b614d1c81615f09565b6000614e07601483615eb9565b7327b7363c902618902232b13a26b4b3b930ba37b960611b815260200192915050565b6000614e37601f83615eb9565b7f43616e6e6f74207472616e7366657220746f2074686973206164647265737300815260200192915050565b75446562744d69677261746f724f6e4f7074696d69736d60501b9052565b6000614e8e603583615eb9565b7f596f75206d757374206265206e6f6d696e61746564206265666f726520796f7581527402063616e20616363657074206f776e65727368697605c1b602082015260400192915050565b6e53796e746865746978457363726f7760881b9052565b6000614efc601383615eb9565b7227bbb732b91037b7363c90333ab731ba34b7b760691b815260200192915050565b6000614f2b601e83615eb9565b7f4f6e6c792045786368616e6765722063616e20696e766f6b6520746869730000815260200192915050565b6000614f64604483610bd0565b7f41746f6d696353796e746845786368616e676528616464726573732c6279746581527f7333322c75696e743235362c627974657333322c75696e743235362c616464726020820152636573732960e01b604082015260440192915050565b6000614fd0601483615eb9565b73616c6c20656e747269657320617265207a65726f60601b815260200192915050565b6000615000601b83615eb9565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000815260200192915050565b6000615039602483615eb9565b7f466c616720726577617264207472616e7366657220646964206e6f742073756381526318d9595960e21b602082015260400192915050565b6b526577617264457363726f7760a01b9052565b6000615093601883615eb9565b7f4e657720657363726f77206164647265737320756e7365740000000000000000815260200192915050565b60006150cc602883610bd0565b7f45786368616e67655265636c61696d28616464726573732c627974657333322c81526775696e743235362960c01b602082015260280192915050565b6000615116601e83615eb9565b7f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815260200192915050565b600061514f601383615eb9565b721cdb9e081d1c985b9cd9995c8819985a5b1959606a1b815260200192915050565b600061517e601b83615eb9565b7f43616e6e6f742062652072756e206f6e2074686973206c617965720000000000815260200192915050565b60006151b7603183610bd0565b7f45786368616e6765547261636b696e6728627974657333322c627974657333328152702c75696e743235362c75696e743235362960781b602082015260310192915050565b600061520a601183610bd0565b70026b4b9b9b4b7339030b2323932b9b99d1607d1b815260110192915050565b6000615237603e83610bd0565b7f53796e746845786368616e676528616464726573732c627974657333322c756981527f6e743235362c627974657333322c75696e743235362c616464726573732900006020820152603e0192915050565b6000615296602683615eb9565b7f43616e6e6f74207472616e73666572207374616b6564206f7220657363726f778152650cac840a69cb60d31b602082015260400192915050565b60006152de601e83615eb9565b7f412073796e7468206f7220534e58207261746520697320696e76616c69640000815260200192915050565b6000615317601b83615eb9565b7f52657761726473446973747269627574696f6e206e6f74207365740000000000815260200192915050565b6000615350602f83615eb9565b7f4f6e6c792074686520636f6e7472616374206f776e6572206d6179207065726681526e37b936903a3434b99030b1ba34b7b760891b602082015260400192915050565b60006153a1602483615eb9565b7f5472616e7366657220746f204c697175696461746f72526577617264732066618152631a5b195960e21b602082015260400192915050565b60006153e7602183610bd0565b7f417070726f76616c28616464726573732c616464726573732c75696e743235368152602960f81b602082015260210192915050565b600061542a602783610bd0565b7f45786368616e676552656261746528616464726573732c627974657333322c75815266696e743235362960c81b602082015260270192915050565b6000615473601a83610bd0565b7f546f6b656e5374617465557064617465642861646472657373290000000000008152601a0192915050565b60006154ac602383615eb9565b7f4f6e6c79204c65676163794d61726b65742063616e207265766f6b6520657363815262726f7760e81b602082015260400192915050565b60006154f1603283610bd0565b7f4163636f756e744c69717569646174656428616464726573732c75696e743235815271362c75696e743235362c616464726573732960701b602082015260320192915050565b6d2932bbb0b93222b9b1b937bbab1960911b9052565b600061555b601983610bd0565b7f5265736f6c766572206d697373696e67207461726765743a2000000000000000815260190192915050565b6000615594602983615eb9565b7f4c697175696461746520726577617264207472616e7366657220646964206e6f8152681d081cdd58d8d9595960ba1b602082015260400192915050565b60006155df601583615eb9565b7463616e6e6f742073656c66206c697175696461746560581b815260200192915050565b6411195c1bdd60da1b9052565b600061561d601583615eb9565b744e6f20737570706c79206973206d696e7461626c6560581b815260200192915050565b600061564e601883615eb9565b7f4f6c6420657363726f77206164647265737320756e7365740000000000000000815260200192915050565b6000615687602183610bd0565b7f5472616e7366657228616464726573732c616464726573732c75696e743235368152602960f81b602082015260210192915050565b60006156ca601783615eb9565b7f4f6e6c79207468652070726f78792063616e2063616c6c000000000000000000815260200192915050565b7f53796e746865746978427269646765546f4f7074696d69736d000000000000009052565b6000615728601e83615eb9565b7f63616e6e6f74206d69677261746520746f2073616d6520616464726573730000815260200192915050565b732932bbb0b93222b9b1b937bbab19233937bd32b760611b9052565b614d1c81615eea565b6000610cea82614f57565b6000610cea826150bf565b6000610cea826151aa565b60006157a5826151fd565b91506157b18284614d96565b50602001919050565b6000610cea8261522a565b6000610cea826153da565b6000610cea8261541d565b6000610cea82615466565b6000610cea826154e4565b60006157a58261554e565b6000610cea8261567a565b60208101610cea8284614d22565b60208101610cea8284614d13565b604081016158318285614d13565b6113ed6020830184614d8d565b6040810161584c8285614d22565b6113ed6020830184614d22565b6101208101615868828c614d22565b615875602083018b614d22565b615882604083018a614d8d565b61588f6060830189614d8d565b61589c6080830188614d8d565b6158a960a0830187614d13565b6158b660c0830186614d84565b6158c360e0830185614d22565b6158d1610100830184614d8d565b9a9950505050505050505050565b61012081016158ee828c614d22565b6158fb602083018b614d22565b615908604083018a614d8d565b6159156060830189614d8d565b6159226080830188614d8d565b6158a960a0830187614d22565b6060810161593d8286614d22565b61594a6020830185614d22565b613a1e6040830184614d8d565b608081016159658287614d22565b6159726020830186614d22565b61597f6040830185614d8d565b61598c6060830184614df1565b95945050505050565b608081016159a38287614d22565b6159b06020830186614d22565b6159bd6040830185614d8d565b61598c6060830184614d8d565b604081016159d88285614d22565b6113ed6020830184614d84565b604081016158318285614d22565b60e08101615a01828a614d22565b615a0e6020830189614d8d565b615a1b6040830188614d8d565b615a286060830187614d8d565b615a356080830186614d22565b615a4260a0830185614d8d565b611bd660c0830184614d8d565b602080825281016113ed8184614d2b565b60208101610cea8284614d84565b60208101610cea8284614d8d565b6040810161584c8285614d8d565b604081016159d88285614d8d565b604081016158318285614d8d565b60408101615ab48285614d8d565b81810360208301526113ea8184614da7565b60a08101615ad48288614d8d565b615ae16020830187614d8d565b615aee6040830186614d8d565b615afb6060830185614d8d565b615b086080830184614d22565b9695505050505050565b60608101615b208286614d8d565b61594a6020830185614d8d565b60c08082528101615b3e8189614da7565b9050615b4d6020830188614df1565b615b5a6040830187614d8d565b615b676060830186614de8565b615b746080830185614de8565b615b8160a0830184614de8565b979650505050505050565b60c08082528101615b9d8189614da7565b9050615bac6020830188614df1565b615bb96040830187614d8d565b615b676060830186614d8d565b60c08082528101615bd78189614da7565b9050615be66020830188614df1565b615bf36040830187614d8d565b615c006060830186614d8d565b615b746080830185614d8d565b60208101610cea8284614ddf565b602080825281016113ed8184614da7565b60208082528101610bcd81614dfa565b60208082528101610bcd81614e2a565b60208101610bd082614e63565b60208082528101610bcd81614e81565b60208101610bd082614ed8565b60208082528101610bcd81614eef565b60208082528101610bcd81614f1e565b60208082528101610bcd81614fc3565b60208082528101610bcd81614ff3565b60208082528101610bcd8161502c565b60208101610bd082615072565b60208082528101610bcd81615109565b60208082528101610bcd81615142565b60208082528101610bcd81615171565b60208082528101610bcd81615289565b60208082528101610bcd816152d1565b60208082528101610bcd8161530a565b60208082528101610bcd81615343565b60208082528101610bcd81615394565b60208082528101610bcd8161549f565b60208101610bd082615538565b60408101615d7d82615538565b8181036020830152610bcd81615086565b60208082528101610bcd81615587565b60208082528101610bcd816155d2565b60208101610bd082615603565b60208082528101610bcd81615610565b60208082528101610bcd816156bd565b60208101610bd0826156f6565b60208082528101610bcd8161571b565b60408101615e0582615754565b8181036020830152610bcd81615641565b60408101615e248285614d8d565b6113ed6020830184614ddf565b60608101615e3f8286614d8d565b615e4c6020830185614d8d565b613a1e6040830184614d22565b60208101610cea8284615770565b60405181810167ffffffffffffffff81118282101715615e8657600080fd5b604052919050565b600067ffffffffffffffff821115615ea557600080fd5b5060209081020190565b60200190565b5190565b90815260200190565b6000610bcd82613a7a565b151590565b6000610bcd82615ec2565b67ffffffffffffffff1690565b60ff1690565b6000610bcd82615ed2565b6000610bcd614da28361124b565b6000610bcd8261124b565b60005b83811015615f2f578181015183820152602001615f17565b83811115610b2d5750506000910152565b601f01601f191690565b615f5381615ec2565b811461165357600080fd5b615f5381615ecd565b615f538161124b565b615f5381615ed2565b615f5381615edd56fea365627a7a72315820c4a71ea3fb5c172ec821d95fb794efd1ce91fa8825b8f001d1678551c52cc1f76c6578706572696d656e74616cf564736f6c63430005100040000000000000000000000000c011a73ee8576fb46f5e1c5751ca3b9fe0af2a6f0000000000000000000000005b1b5fea1b99d83ad479df0c222f0492385381dd000000000000000000000000302d2451d9f47620374b54c521423bf0403916a20000000000000000000000000000000000000000010562ccfb70ee2114b2cb800000000000000000000000004e3b31eb0e5cb73641ee1e65e7dcefe520ba3ef2

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106104545760003560e01c80636c00f310116102415780639f7698071161013b578063d37c4d8b116100c3578063e8e09b8b11610087578063e8e09b8b14610911578063e90dd9e214610924578063ec5568891461092c578063edef719a146106bb578063ee52a2f31461093457610454565b8063d37c4d8b146108c8578063d67bdd25146108db578063d8a1f76f146108e3578063dbf63340146108f6578063dd62ed3e146108fe57610454565b8063ace88afd1161010a578063ace88afd14610874578063af086c7e14610887578063bc67f8321461088f578063c2bf3880146108a2578063c836fa0a146108b557610454565b80639f76980714610828578063a311c7c21461083b578063a5fdc5de1461084e578063a9059cbb1461086157610454565b806384358843116101c95780639324cac71161018d5780639324cac7146107ea57806395d89b41146107f257806397107d6d146107fa5780639741fb221461080d578063987757dd1461081557610454565b80638435884314610793578063899ffef4146107b45780638a290014146107bc5780638da5cb5b146107cf57806391e56b68146107d757610454565b806372cb051f1161021057806372cb051f14610748578063741853601461075d57806379ba509714610765578063835e119c1461076d57806383d625d41461078057610454565b80636c00f310146106fc5780636f01a9861461070f578063704e7b851461072257806370a082311461073557610454565b80632d3169eb116103525780634e99bda9116102da578063614d08f81161029e578063614d08f8146106b3578063666ed4f1146106bb5780636a427795146106ce5780636ac0bf9c146106e15780636b76222f146106f457610454565b80634e99bda914610668578063528c7efb1461067057806353a47bb7146106785780635af090ef1461068d5780635e22846a146106a057610454565b8063313ce56711610321578063313ce56714610614578063320223db1461061c578063326080391461062f5780633e89b9e51461064257806344b3e9231461065557610454565b80632d3169eb146105c65780632e0f2625146105d95780632f7206ce146105ee57806330ead7601461060157610454565b806316b2213f116103e05780632621716f116103a45780632621716f1461057d578063295da87d146105905780632a905318146105a35780632af64bd3146105ab5780632c955fa7146105b357610454565b806316b2213f1461053457806318160ddd14610547578063188214001461054f5780631fce304d1461055757806323b872dd1461056a57610454565b8063095ea7b311610427578063095ea7b3146104b65780630e30963c146104d65780631137aedf146104f75780631249c58b146105195780631627540c1461052157610454565b806303fbc5471461045957806304f3bcec1461046357806305b3c1c91461048157806306fdde03146104a1575b600080fd5b610461610947565b005b61046b610b34565b6040516104789190615c0d565b60405180910390f35b61049461048f3660046147dd565b610b48565b6040516104789190615a6e565b6104a9610bd5565b6040516104789190615c1b565b6104c96104c43660046148a0565b610c63565b6040516104789190615a60565b6104e96104e4366004614af3565b610cf0565b604051610478929190615e16565b61050a6105053660046147dd565b610dff565b60405161047893929190615b12565b6104c9610e94565b61046161052f3660046147dd565b61124e565b6104946105423660046147dd565b6112ac565b6104946112e1565b6104a96112e7565b6104c9610565366004614ab7565b611320565b6104c9610578366004614853565b6113b5565b61049461058b3660046147dd565b6113f4565b61046161059e366004614ab7565b6115d5565b6104a9611656565b6104c9611675565b6104616105c13660046147dd565b611791565b6104616105d4366004614af3565b6117dd565b6105e1611893565b6040516104789190615e59565b6104616105fc3660046149ea565b611898565b61049461060f366004614b36565b61195a565b6105e1611a18565b61046161062a3660046147dd565b611a21565b61046b61063d366004614ab7565b611a6d565b610494610650366004614ab7565b611af2565b610494610663366004614bab565b611b2a565b6104c9611be2565b6104c9611c61565b610680611e41565b6040516104789190615807565b61049461069b366004614b36565b611e50565b6104c96106ae3660046147dd565b611eb0565b610494611edc565b6104616106c93660046148a0565b611eec565b6104616106dc3660046147dd565b611ef8565b6104946106ef3660046147dd565b6120b1565b6104616121b9565b61046161070a3660046149ea565b612264565b61046161071d3660046148d0565b6122b7565b6104c96107303660046148a0565b612370565b6104946107433660046147dd565b61239b565b6107506123cd565b6040516104789190615a4f565b61046161244b565b61046161259d565b61046b61077b366004614ab7565b612639565b61049461078e366004614ab7565b61266e565b6107a66107a13660046147dd565b6126a6565b604051610478929190615a98565b61075061292d565b6104616107ca366004614ab7565b6129c1565b610680612a0b565b6104946107e5366004614963565b612a1a565b610494612ada565b6104a9612ae5565b6104616108083660046147dd565b612b40565b610461612b93565b61050a610823366004614ab7565b612c0c565b610461610836366004614c20565b612c82565b6104946108493660046147dd565b612cae565b61049461085c3660046147dd565b612ce3565b6104c961086f3660046148a0565b612d18565b6104616108823660046148d0565b612d62565b610461612daf565b61046161089d3660046147dd565b612df8565b6104616108b03660046148a0565b612e22565b6104946108c3366004614902565b612e70565b6104946108d63660046148a0565b612f2e565b610680612fb5565b6104616108f1366004614ab7565b612fc4565b610494612fcc565b61049461090c366004614819565b613046565b61046161091f3660046148a0565b61307a565b61046b6130c8565b61046b6130d7565b610494610942366004614b15565b6130e6565b61094f6131a2565b60085460405163dacb2d0160e01b815260009161010090046001600160a01b03169063dacb2d019061098390600401615df8565b60206040518083038186803b15801561099b57600080fd5b505afa1580156109af573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506109d391908101906147fb565b60085460405163dacb2d0160e01b81529192506000916101009091046001600160a01b03169063dacb2d0190610a0b90600401615d70565b60206040518083038186803b158015610a2357600080fd5b505afa158015610a37573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610a5b91908101906147fb565b9050816001600160a01b0316816001600160a01b03161415610a985760405162461bcd60e51b8152600401610a8f90615de8565b60405180910390fd5b600480546040516370a0823160e01b81526000926001600160a01b03909216916370a0823191610aca91879101615807565b60206040518083038186803b158015610ae257600080fd5b505afa158015610af6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610b1a9190810190614ad5565b90508015610b2f57610b2d8383836131cc565b505b505050565b60085461010090046001600160a01b031681565b6000610b526133a8565b6001600160a01b03166305b3c1c9836040518263ffffffff1660e01b8152600401610b7d9190615807565b60206040518083038186803b158015610b9557600080fd5b505afa158015610ba9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610bcd9190810190614ad5565b90505b919050565b6005805460408051602060026001851615610100026000190190941693909304601f81018490048402820184019092528181529291830182828015610c5b5780601f10610c3057610100808354040283529160200191610c5b565b820191906000526020600020905b815481529060010190602001808311610c3e57829003601f168201915b505050505081565b6000610c6d6133bc565b60035460048054604051633691826360e21b81526001600160a01b03938416939091169163da46098c91610ca7918591899189910161592f565b600060405180830381600087803b158015610cc157600080fd5b505af1158015610cd5573d6000803e3d6000fd5b50505050610ce48185856133fb565b60019150505b92915050565b6000808584610cff828261347b565b610d076133bc565b610d0f6134dc565b6001600160a01b0316634f8633d2600360009054906101000a90046001600160a01b0316600360009054906101000a90046001600160a01b03168b8b8b600360009054906101000a90046001600160a01b03166001600360009054906101000a90046001600160a01b03168e6040518a63ffffffff1660e01b8152600401610d9f999897969594939291906158df565b6040805180830381600087803b158015610db857600080fd5b505af1158015610dcc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610df09190810190614c8c565b93509350505094509492505050565b6000806000610e0c6133a8565b6001600160a01b0316631137aedf856040518263ffffffff1660e01b8152600401610e379190615807565b60606040518083038186803b158015610e4f57600080fd5b505afa158015610e63573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610e879190810190614cbc565b9250925092509193909250565b6000610e9e6134f3565b6000610ea8613547565b6001600160a01b03161415610ecf5760405162461bcd60e51b8152600401610a8f90615d23565b6000610ed9613568565b90506000610ee5613547565b90506000826001600160a01b031663cc5c095c6040518163ffffffff1660e01b815260040160206040518083038186803b158015610f2257600080fd5b505afa158015610f36573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610f5a9190810190614ad5565b905060008111610f7c5760405162461bcd60e51b8152600401610a8f90615dbb565b610f8860003083613584565b604051637e7961d760e01b81526000906001600160a01b03851690637e7961d790610fb7908590600401615a6e565b602060405180830381600087803b158015610fd157600080fd5b505af1158015610fe5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506110099190810190614ad5565b9050600061101d838363ffffffff6135c716565b600480546040516370a0823160e01b81529293506001600160a01b03169163b46310f69187916110b991869186916370a082319161105d91879101615807565b60206040518083038186803b15801561107557600080fd5b505afa158015611089573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506110ad9190810190614ad5565b9063ffffffff6135ef16565b6040518363ffffffff1660e01b81526004016110d69291906159e5565b600060405180830381600087803b1580156110f057600080fd5b505af1158015611104573d6000803e3d6000fd5b50505050611113308583613584565b604051630b32e9c760e31b81526001600160a01b038516906359974e389061113f908490600401615a6e565b602060405180830381600087803b15801561115957600080fd5b505af115801561116d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506111919190810190614a99565b50600480546040516370a0823160e01b81526001600160a01b039091169163b46310f69133916111d191879186916370a082319161105d91879101615815565b6040518363ffffffff1660e01b81526004016111ee929190615823565b600060405180830381600087803b15801561120857600080fd5b505af115801561121c573d6000803e3d6000fd5b5050505061122b303384613584565b60075461123e908463ffffffff6135ef16565b6007555060019450505050505b90565b6112566131a2565b600180546001600160a01b0319166001600160a01b0383161790556040517f906a1c6bd7e3091ea86693dd029a831c19049ce77f1dce2ce0bab1cacbabce22906112a1908390615807565b60405180910390a150565b60006112b66133a8565b6001600160a01b03166316b2213f836040518263ffffffff1660e01b8152600401610b7d9190615807565b60075481565b6040518060400160405280601781526020017f53796e746865746978204e6574776f726b20546f6b656e00000000000000000081525081565b60008061132b6134dc565b6003546040516301670a7b60e21b81526001600160a01b039283169263059c29ec9261135e9291169087906004016159e5565b60206040518083038186803b15801561137657600080fd5b505afa15801561138a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506113ae9190810190614ad5565b1192915050565b60006113bf613614565b6113c7613669565b6113d184836136a9565b506003546113ea906001600160a01b031685858561397a565b90505b9392505050565b6000806113ff613a26565b6001600160a01b031663204b676a846040518263ffffffff1660e01b815260040161142a9190615807565b60206040518083038186803b15801561144257600080fd5b505afa158015611456573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061147a9190810190614ad5565b905060006114866146a8565b60005b838110156115bc57611499613a26565b6001600160a01b031663ae58254987836040518363ffffffff1660e01b81526004016114c69291906159e5565b60206040518083038186803b1580156114de57600080fd5b505afa1580156114f2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506115169190810190614ad5565b9250611520613a26565b6001600160a01b03166345626bd687856040518363ffffffff1660e01b815260040161154d9291906159e5565b604080518083038186803b15801561156457600080fd5b505afa158015611578573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061159c9190810190614c3e565b6020810151909250156115b4579350610bd092505050565b600101611489565b5060405162461bcd60e51b8152600401610a8f90615c96565b6115dd6134f3565b6115e56133bc565b6115ed6133a8565b60035460405163b06e8c6560e01b81526001600160a01b039283169263b06e8c65926116209291169085906004016159e5565b600060405180830381600087803b15801561163a57600080fd5b505af115801561164e573d6000803e3d6000fd5b505050505b50565b604051806040016040528060038152602001620a69cb60eb1b81525081565b6000606061168161292d565b905060005b815181101561178857600082828151811061169d57fe5b602090810291909101810151600081815260099092526040918290205460085492516321f8a72160e01b81529193506001600160a01b0390811692610100900416906321f8a721906116f3908590600401615a6e565b60206040518083038186803b15801561170b57600080fd5b505afa15801561171f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061174391908101906147fb565b6001600160a01b031614158061176e57506000818152600960205260409020546001600160a01b0316155b1561177f576000935050505061124b565b50600101611686565b50600191505090565b6117996134f3565b6117a16133bc565b6117a96133a8565b60035460405163159fa0d560e11b81526001600160a01b0392831692632b3f41aa926116209286929091169060040161583e565b6117e5613a42565b6002546040516001600160a01b039091169063907dff979061180f90869086908690602001615b12565b604051602081830303815290604052600260405161182c9061578f565b6040519081900381206001600160e01b031960e086901b16825261185b9392918a906000908190600401615b8c565b600060405180830381600087803b15801561187557600080fd5b505af1158015611889573d6000803e3d6000fd5b5050505050505050565b601281565b6118a0613a42565b6002546040516001600160a01b039091169063907dff97906118ce9088908890889088908890602001615ac6565b60405160208183030381529060405260026040516118eb90615779565b60405180910390206118fc8b613a7a565b6000806040518763ffffffff1660e01b815260040161192096959493929190615b8c565b600060405180830381600087803b15801561193a57600080fd5b505af115801561194e573d6000803e3d6000fd5b50505050505050505050565b60008584611968828261347b565b6119706133bc565b6119786134dc565b6003546040516327c319e960e11b81526001600160a01b0392831692634f8633d2926119ba9291169081908d908d908d9084906000908f908f906004016158df565b6040805180830381600087803b1580156119d357600080fd5b505af11580156119e7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250611a0b9190810190614c8c565b5098975050505050505050565b60085460ff1681565b611a296134f3565b611a316133bc565b611a396133a8565b60035460405163fd864ccf60e01b81526001600160a01b039283169263fd864ccf926116209286929091169060040161583e565b6000611a776133a8565b6001600160a01b03166332608039836040518263ffffffff1660e01b8152600401611aa29190615a6e565b60206040518083038186803b158015611aba57600080fd5b505afa158015611ace573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610bcd9190810190614c02565b6000611afc6133a8565b6001600160a01b0316637b1001b78360016040518363ffffffff1660e01b8152600401610b7d929190615a8a565b60008584611b38828261347b565b611b406133bc565b611b486134dc565b60035460405162674ed160e71b81526001600160a01b03928316926333a7688092611b84929116908c908c908c9084908d908d906004016159f3565b602060405180830381600087803b158015611b9e57600080fd5b505af1158015611bb2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250611bd69190810190614ad5565b98975050505050505050565b6000611bec6133a8565b6001600160a01b0316634e99bda96040518163ffffffff1660e01b815260040160206040518083038186803b158015611c2457600080fd5b505afa158015611c38573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250611c5c9190810190614a99565b905090565b6000611c6b613669565b611c736133bc565b6003546001600160a01b0316611c87613a86565b6001600160a01b031663c00007b0826040518263ffffffff1660e01b8152600401611cb29190615807565b600060405180830381600087803b158015611ccc57600080fd5b505af1158015611ce0573d6000803e3d6000fd5b50505050600080611cef6133a8565b6001600160a01b03166372c658168460016040518363ffffffff1660e01b8152600401611d1d9291906159ca565b606060405180830381600087803b158015611d3757600080fd5b505af1158015611d4b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250611d6f9190810190614cbc565b509150915060008111611d945760405162461bcd60e51b8152600401610a8f90615d9e565b611da083838386613aa5565b6000611db484611dae613a86565b85613b21565b905080611dd35760405162461bcd60e51b8152600401610a8f90615d43565b611ddb613a86565b6001600160a01b0316633c6b16ab846040518263ffffffff1660e01b8152600401611e069190615a6e565b600060405180830381600087803b158015611e2057600080fd5b505af1158015611e34573d6000803e3d6000fd5b5092965050505050505090565b6001546001600160a01b031681565b60008584611e5e828261347b565b611e666133bc565b611e6e6134dc565b6003546040516327c319e960e11b81526001600160a01b0392831692634f8633d2926119ba9291169081908d908d908d9032906000908f908f90600401615859565b6000611eba613669565b611ec26133bc565b600354610bcd9083906000906001600160a01b0316613b2e565b680a6f2dce8d0cae8d2f60bb1b81565b611ef4613f30565b5050565b611f00613669565b6008546040516321f8a72160e01b815260009161010090046001600160a01b0316906321f8a72190611f45906b131959d858de53585c9ad95d60a21b90600401615a6e565b60206040518083038186803b158015611f5d57600080fd5b505afa158015611f71573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250611f9591908101906147fb565b9050336001600160a01b03821614611fbf5760405162461bcd60e51b8152600401610a8f90615d53565b611fc7613a26565b6001600160a01b031663de065f678383611fdf613a26565b6001600160a01b031663326a3cfb876040518263ffffffff1660e01b815260040161200a9190615807565b60206040518083038186803b15801561202257600080fd5b505afa158015612036573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061205a9190810190614ad5565b60006040518563ffffffff1660e01b815260040161207b9493929190615957565b600060405180830381600087803b15801561209557600080fd5b505af11580156120a9573d6000803e3d6000fd5b505050505050565b60006120bb6133a8565b600480546040516370a0823160e01b81526001600160a01b0393841693636bed0415938793909116916370a08231916120f691859101615807565b60206040518083038186803b15801561210e57600080fd5b505afa158015612122573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506121469190810190614ad5565b6040518363ffffffff1660e01b81526004016121639291906159e5565b604080518083038186803b15801561217a57600080fd5b505afa15801561218e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506121b29190810190614c5c565b5092915050565b6121c16131a2565b6004546000906001600160a01b03166370a082316121dd613f48565b6040518263ffffffff1660e01b81526004016121f99190615807565b60206040518083038186803b15801561221157600080fd5b505afa158015612225573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506122499190810190614ad5565b9050611ef4612256613f48565b61225e613a26565b836131cc565b61226c613a42565b6002546040516001600160a01b039091169063907dff979061229a9088908890889088908890602001615ac6565b60405160208183030381529060405260026040516118eb906157ba565b6122bf613a42565b6002546040516001600160a01b039091169063907dff97906122e79085908590602001615a98565b6040516020818303038152906040526002604051612304906157d0565b604051809103902061231588613a7a565b6000806040518763ffffffff1660e01b815260040161233996959493929190615b8c565b600060405180830381600087803b15801561235357600080fd5b505af1158015612367573d6000803e3d6000fd5b50505050505050565b600061237a613669565b6123826133bc565b6003546113ed90849084906001600160a01b0316613b2e565b600480546040516370a0823160e01b81526000926001600160a01b03909216916370a0823191610b7d91869101615807565b60606123d76133a8565b6001600160a01b03166372cb051f6040518163ffffffff1660e01b815260040160006040518083038186803b15801561240f57600080fd5b505afa158015612423573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052611c5c9190810190614a64565b606061245561292d565b905060005b8151811015611ef457600082828151811061247157fe5b602002602001015190506000600860019054906101000a90046001600160a01b03166001600160a01b031663dacb2d0183846040516020016124b391906157f1565b6040516020818303038152906040526040518363ffffffff1660e01b81526004016124df929190615aa6565b60206040518083038186803b1580156124f757600080fd5b505afa15801561250b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061252f91908101906147fb565b6000838152600960205260409081902080546001600160a01b0319166001600160a01b038416179055519091507f88a93678a3692f6789d9546fc621bf7234b101ddb7d4fe479455112831b8aa689061258b9084908490615a7c565b60405180910390a1505060010161245a565b6001546001600160a01b031633146125c75760405162461bcd60e51b8152600401610a8f90615c59565b6000546001546040517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9261260a926001600160a01b039182169291169061583e565b60405180910390a160018054600080546001600160a01b03199081166001600160a01b03841617909155169055565b60006126436133a8565b6001600160a01b031663835e119c836040518263ffffffff1660e01b8152600401611aa29190615a6e565b60006126786133a8565b6001600160a01b0316637b1001b78360006040518363ffffffff1660e01b8152600401610b7d929190615a8a565b6000806126b1613669565b6008546040516321f8a72160e01b815260009161010090046001600160a01b0316906321f8a721906127009075446562744d69677261746f724f6e457468657265756d60501b90600401615a6e565b60206040518083038186803b15801561271857600080fd5b505afa15801561272c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061275091908101906147fb565b9050336001600160a01b0382161461277a5760405162461bcd60e51b8152600401610a8f90615c2c565b600480546040516370a0823160e01b81526001600160a01b03909116916370a08231916127a991889101615807565b60206040518083038186803b1580156127c157600080fd5b505afa1580156127d5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506127f99190810190614ad5565b9150811561282f57600061280e858385613b21565b90508061282d5760405162461bcd60e51b8152600401610a8f90615ce3565b505b612837613a26565b6001600160a01b031663326a3cfb856040518263ffffffff1660e01b81526004016128629190615807565b60206040518083038186803b15801561287a57600080fd5b505afa15801561288e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506128b29190810190614ad5565b92508215612927576128c2613a26565b6001600160a01b031663de065f6785838660006040518563ffffffff1660e01b81526004016128f49493929190615957565b600060405180830381600087803b15801561290e57600080fd5b505af1158015612922573d6000803e3d6000fd5b505050505b50915091565b606080612938613f62565b6040805160028082526060808301845293945090916020830190803883390190505090506b526577617264457363726f7760a01b8160008151811061297957fe5b6020026020010181815250506d537570706c795363686564756c6560901b816001815181106129a457fe5b6020026020010181815250506129ba82826140ab565b9250505090565b6129c96134f3565b6129d16133bc565b6129d96133a8565b6003546040516285c0d160e31b81526001600160a01b039283169263042e0688926116209291169085906004016159e5565b6000546001600160a01b031681565b60008584612a28828261347b565b612a306133bc565b612a386134dc565b6003546040516327c319e960e11b81526001600160a01b0392831692634f8633d292612a7b928e92909116908d908d908d9085906000908f908f906004016158df565b6040805180830381600087803b158015612a9457600080fd5b505af1158015612aa8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250612acc9190810190614c8c565b509998505050505050505050565b631cd554d160e21b81565b6006805460408051602060026001851615610100026000190190941693909304601f81018490048402820184019092528181529291830182828015610c5b5780601f10610c3057610100808354040283529160200191610c5b565b612b486131a2565b600280546001600160a01b0319166001600160a01b0383161790556040517ffc80377ca9c49cc11ae6982f390a42db976d5530af7c43889264b13fbbd7c57e906112a1908390615815565b612b9b6134f3565b612ba36133bc565b612bab6133a8565b6003546040516324beb82560e11b81526001600160a01b039283169263497d704a92612bdc92911690600401615807565b600060405180830381600087803b158015612bf657600080fd5b505af1158015610b2d573d6000803e3d6000fd5b565b6000806000612c196133bc565b612c216134dc565b6003546040516306c5a00b60e21b81526001600160a01b0392831692631b16802c92612c549291169088906004016159e5565b606060405180830381600087803b158015612c6e57600080fd5b505af1158015610e63573d6000803e3d6000fd5b612c8a614160565b600480546001600160a01b0319166001600160a01b038316179055611653816141ce565b6000612cb86133a8565b6001600160a01b031663a311c7c2836040518263ffffffff1660e01b8152600401610b7d9190615807565b6000612ced6133a8565b6001600160a01b031663a5fdc5de836040518263ffffffff1660e01b8152600401610b7d9190615807565b6000612d22613614565b612d2a613669565b600354612d40906001600160a01b0316836136a9565b50600354612d58906001600160a01b03168484613b21565b5060019392505050565b612d6a613a42565b6002546040516001600160a01b039091169063907dff9790612d929085908590602001615a98565b604051602081830303815290604052600260405161230490615784565b612db76134f3565b612dbf6133bc565b612dc76133a8565b60035460405163644bb89960e11b81526001600160a01b039283169263c897713292612bdc92911690600401615807565b612e00614240565b600380546001600160a01b0319166001600160a01b0392909216919091179055565b612e2a6134f3565b612e326133bc565b612e3a6133a8565b600354604051632694552d60e21b81526001600160a01b0392831692639a5154b49261207b92879290911690869060040161592f565b60008382612e7e828261347b565b612e866133bc565b612e8e6134dc565b6003546040516327c319e960e11b81526001600160a01b0392831692634f8633d292612ed1928c92909116908b908b908b908590600090829082906004016158df565b6040805180830381600087803b158015612eea57600080fd5b505af1158015612efe573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250612f229190810190614c8c565b50979650505050505050565b6000612f386133a8565b6001600160a01b031663d37c4d8b84846040518363ffffffff1660e01b8152600401612f659291906159e5565b60206040518083038186803b158015612f7d57600080fd5b505afa158015612f91573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506113ed9190810190614ad5565b6003546001600160a01b031681565b611653613f30565b6000612fd66133a8565b6001600160a01b031663dbf633406040518163ffffffff1660e01b815260040160206040518083038186803b15801561300e57600080fd5b505afa158015613022573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250611c5c9190810190614ad5565b60048054604051636eb1769f60e11b81526000926001600160a01b039092169163dd62ed3e91612f6591879187910161583e565b6130826134f3565b61308a6133bc565b6130926133a8565b60035460405163227635b160e11b81526001600160a01b03928316926344ec6b629261207b92879290911690869060040161592f565b6004546001600160a01b031681565b6002546001600160a01b031681565b600083826130f4828261347b565b6130fc6133bc565b6131046134dc565b6003546040516327c319e960e11b81526001600160a01b0392831692634f8633d2926131469291169081908b908b908b908490600090829082906004016158df565b6040805180830381600087803b15801561315f57600080fd5b505af1158015613173573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506131979190810190614c8c565b509695505050505050565b6000546001600160a01b03163314612c0a5760405162461bcd60e51b8152600401610a8f90615d33565b60006001600160a01b038316158015906131ef57506001600160a01b0383163014155b801561320957506002546001600160a01b03848116911614155b6132255760405162461bcd60e51b8152600401610a8f90615c3c565b600480546040516370a0823160e01b81526001600160a01b039091169163b46310f69187916132c091879186916370a082319161326491879101615807565b60206040518083038186803b15801561327c57600080fd5b505afa158015613290573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506132b49190810190614ad5565b9063ffffffff6135c716565b6040518363ffffffff1660e01b81526004016132dd9291906159e5565b600060405180830381600087803b1580156132f757600080fd5b505af115801561330b573d6000803e3d6000fd5b5050600480546040516370a0823160e01b81526001600160a01b03909116935063b46310f69250869161334e91879186916370a082319161105d91879101615807565b6040518363ffffffff1660e01b815260040161336b9291906159e5565b600060405180830381600087803b15801561338557600080fd5b505af1158015613399573d6000803e3d6000fd5b50505050612d58848484613584565b6000611c5c6524b9b9bab2b960d11b61426a565b6002546001600160a01b031633148015906133e257506003546001600160a01b03163314155b15612c0a57600380546001600160a01b03191633179055565b6002546040516001600160a01b039091169063907dff9790613421908490602001615a6e565b604051602081830303815290604052600360405161343e906157c5565b604051809103902061344f88613a7a565b61345888613a7a565b60006040518763ffffffff1660e01b815260040161233996959493929190615bc6565b6134836142c7565b6001600160a01b0316631ce00ba283836040518363ffffffff1660e01b81526004016134b0929190615a98565b60006040518083038186803b1580156134c857600080fd5b505afa1580156120a9573d6000803e3d6000fd5b6000611c5c6822bc31b430b733b2b960b91b61426a565b6134fb6142c7565b6001600160a01b0316637c3125416040518163ffffffff1660e01b815260040160006040518083038186803b15801561353357600080fd5b505afa158015610b2d573d6000803e3d6000fd5b6000611c5c722932bbb0b93239a234b9ba3934b13aba34b7b760691b61426a565b6000611c5c6d537570706c795363686564756c6560901b61426a565b6002546040516001600160a01b039091169063907dff97906135aa908490602001615a6e565b604051602081830303815290604052600360405161343e906157fc565b6000828211156135e95760405162461bcd60e51b8152600401610a8f90615cd3565b50900390565b6000828201838110156113ed5760405162461bcd60e51b8152600401610a8f90615ca6565b6002546001600160a01b031633141561362c57612c0a565b613635336142e1565b1561365157600380546001600160a01b03191633179055612c0a565b60405162461bcd60e51b8152600401610a8f90615dcb565b6136716142c7565b6001600160a01b031663086dabd16040518163ffffffff1660e01b815260040160006040518083038186803b15801561353357600080fd5b6008546040516321f8a72160e01b815260009182916101009091046001600160a01b0316906321f8a721906136f1906b131959d858de53585c9ad95d60a21b90600401615a6e565b60206040518083038186803b15801561370957600080fd5b505afa15801561371d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061374191908101906147fb565b6003549091506001600160a01b03161580159061376b57506003546001600160a01b038281169116145b806137875750806001600160a01b0316846001600160a01b0316145b15613796576001915050610cea565b60006137a06133a8565b6001600160a01b031663d37c4d8b86631cd554d160e21b6040518363ffffffff1660e01b81526004016137d49291906159e5565b60206040518083038186803b1580156137ec57600080fd5b505afa158015613800573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506138249190810190614ad5565b1115610ce4576000806138356133a8565b600480546040516370a0823160e01b81526001600160a01b0393841693636bed0415938b93909116916370a082319161387091859101615807565b60206040518083038186803b15801561388857600080fd5b505afa15801561389c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506138c09190810190614ad5565b6040518363ffffffff1660e01b81526004016138dd9291906159e5565b604080518083038186803b1580156138f457600080fd5b505afa158015613908573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061392c9190810190614c5c565b91509150818511156139505760405162461bcd60e51b8152600401610a8f90615d03565b801561396e5760405162461bcd60e51b8152600401610a8f90615d13565b50600195945050505050565b60048054604051636eb1769f60e11b81526000926001600160a01b039092169163da46098c91879189916139c0918891879163dd62ed3e9161326491889188910161583e565b6040518463ffffffff1660e01b81526004016139de9392919061592f565b600060405180830381600087803b1580156139f857600080fd5b505af1158015613a0c573d6000803e3d6000fd5b50505050613a1b8484846131cc565b90505b949350505050565b6000611c5c6d2932bbb0b93222b9b1b937bbab1960911b61426a565b613a4a6134dc565b6001600160a01b0316336001600160a01b031614612c0a5760405162461bcd60e51b8152600401610a8f90615c86565b6001600160a01b031690565b6000611c5c704c697175696461746f725265776172647360781b61426a565b6002546040516001600160a01b039091169063907dff9790613acf90869086908690602001615e31565b6040516020818303038152906040526002604051613aec906157e6565b6040518091039020613afd89613a7a565b6000806040518763ffffffff1660e01b815260040161185b96959493929190615b8c565b60006113ea8484846131cc565b6000613b38613a86565b6001600160a01b031663c00007b0856040518263ffffffff1660e01b8152600401613b639190615807565b600060405180830381600087803b158015613b7d57600080fd5b505af1158015613b91573d6000803e3d6000fd5b505050506000806000613ba26133a8565b6001600160a01b03166372c658168860006040518363ffffffff1660e01b8152600401613bd09291906159ca565b606060405180830381600087803b158015613bea57600080fd5b505af1158015613bfe573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250613c229190810190614cbc565b919450925090508015613c9b57613c37613a26565b6001600160a01b031663de065f678889848a6040518563ffffffff1660e01b8152600401613c689493929190615995565b600060405180830381600087803b158015613c8257600080fd5b505af1158015613c96573d6000803e3d6000fd5b505050505b613ca787848488613aa5565b6000613cb1614690565b6001600160a01b0316638074b3726040518163ffffffff1660e01b815260040160206040518083038186803b158015613ce957600080fd5b505afa158015613cfd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250613d219190810190614ad5565b90506000613d2d614690565b6001600160a01b03166331e4e0306040518163ffffffff1660e01b815260040160206040518083038186803b158015613d6557600080fd5b505afa158015613d79573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250613d9d9190810190614ad5565b90506000613da9614690565b6001600160a01b0316635616c9578b6040518263ffffffff1660e01b8152600401613dd49190615807565b60206040518083038186803b158015613dec57600080fd5b505afa158015613e00573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250613e2491908101906147fb565b90506000613e338b8386613b21565b905080613e525760405162461bcd60e51b8152600401610a8f90615cb6565b6000613e5f8c8b86613b21565b905080613e7e5760405162461bcd60e51b8152600401610a8f90615d8e565b8715613f1e576000613e988d613e92613a86565b8b613b21565b905080613eb75760405162461bcd60e51b8152600401610a8f90615d43565b613ebf613a86565b6001600160a01b0316633c6b16ab8a6040518263ffffffff1660e01b8152600401613eea9190615a6e565b600060405180830381600087803b158015613f0457600080fd5b505af1158015613f18573d6000803e3d6000fd5b50505050505b5060019b9a5050505050505050505050565b60405162461bcd60e51b8152600401610a8f90615cf3565b6000611c5c6b526577617264457363726f7760a01b61426a565b60408051600780825261010082019092526060916020820160e0803883390190505090506b53797374656d53746174757360a01b81600081518110613fa357fe5b6020026020010181815250506822bc31b430b733b2b960b91b81600181518110613fc957fe5b6020026020010181815250506524b9b9bab2b960d11b81600281518110613fec57fe5b602002602001018181525050722932bbb0b93239a234b9ba3934b13aba34b7b760691b8160038151811061401c57fe5b602002602001018181525050704c697175696461746f725265776172647360781b8160048151811061404a57fe5b602002602001018181525050692634b8bab4b230ba37b960b11b8160058151811061407157fe5b6020026020010181815250506d2932bbb0b93222b9b1b937bbab1960911b8160068151811061409c57fe5b60200260200101818152505090565b606081518351016040519080825280602002602001820160405280156140db578160200160208202803883390190505b50905060005b835181101561411d578381815181106140f657fe5b602002602001015182828151811061410a57fe5b60209081029190910101526001016140e1565b5060005b82518110156121b25782818151811061413657fe5b602002602001015182828651018151811061414d57fe5b6020908102919091010152600101614121565b6002546001600160a01b0316331480159061418657506003546001600160a01b03163314155b1561419e57600380546001600160a01b031916331790555b6000546003546001600160a01b03908116911614612c0a5760405162461bcd60e51b8152600401610a8f90615c76565b6002546040516001600160a01b039091169063907dff97906141f4908490602001615807565b6040516020818303038152906040526001604051614211906157db565b6040519081900381206001600160e01b031960e086901b16825261162093929160009081908190600401615b2d565b6002546001600160a01b03163314612c0a5760405162461bcd60e51b8152600401610a8f90615dcb565b60008181526009602090815260408083205490516001600160a01b03909116918215159161429a9186910161579a565b604051602081830303815290604052906121b25760405162461bcd60e51b8152600401610a8f9190615c1b565b6000611c5c6b53797374656d53746174757360a01b61426a565b6008546040516321f8a72160e01b815260009161010090046001600160a01b0316906321f8a7219061431590600401615ddb565b60206040518083038186803b15801561432d57600080fd5b505afa158015614341573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061436591908101906147fb565b6001600160a01b0316826001600160a01b0316148061441657506008546040516321f8a72160e01b81526101009091046001600160a01b0316906321f8a721906143b190600401615d63565b60206040518083038186803b1580156143c957600080fd5b505afa1580156143dd573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061440191908101906147fb565b6001600160a01b0316826001600160a01b0316145b806144b357506008546040516321f8a72160e01b81526101009091046001600160a01b0316906321f8a7219061444e90600401615c4c565b60206040518083038186803b15801561446657600080fd5b505afa15801561447a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061449e91908101906147fb565b6001600160a01b0316826001600160a01b0316145b8061455057506008546040516321f8a72160e01b81526101009091046001600160a01b0316906321f8a721906144eb90600401615cc6565b60206040518083038186803b15801561450357600080fd5b505afa158015614517573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061453b91908101906147fb565b6001600160a01b0316826001600160a01b0316145b806145ed57506008546040516321f8a72160e01b81526101009091046001600160a01b0316906321f8a7219061458890600401615c69565b60206040518083038186803b1580156145a057600080fd5b505afa1580156145b4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506145d891908101906147fb565b6001600160a01b0316826001600160a01b0316145b80610bcd57506008546040516321f8a72160e01b81526101009091046001600160a01b0316906321f8a7219061462590600401615dae565b60206040518083038186803b15801561463d57600080fd5b505afa158015614651573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061467591908101906147fb565b6001600160a01b0316826001600160a01b0316149050919050565b6000611c5c692634b8bab4b230ba37b960b11b61426a565b604080518082019091526000808252602082015290565b8035610cea81615f4a565b8051610cea81615f4a565b600082601f8301126146e657600080fd5b81516146f96146f482615e8e565b615e67565b9150818183526020840193506020810190508385602084028201111561471e57600080fd5b60005b8381101561474a5781614734888261476a565b8452506020928301929190910190600101614721565b5050505092915050565b8051610cea81615f5e565b8035610cea81615f67565b8051610cea81615f67565b8051610cea81615f70565b8035610cea81615f70565b60006040828403121561479d57600080fd5b6147a76040615e67565b905060006147b584846147d2565b82525060206147c68484830161476a565b60208301525092915050565b8051610cea81615f79565b6000602082840312156147ef57600080fd5b6000613a1e84846146bf565b60006020828403121561480d57600080fd5b6000613a1e84846146ca565b6000806040838503121561482c57600080fd5b600061483885856146bf565b9250506020614849858286016146bf565b9150509250929050565b60008060006060848603121561486857600080fd5b600061487486866146bf565b9350506020614885868287016146bf565b92505060406148968682870161475f565b9150509250925092565b600080604083850312156148b357600080fd5b60006148bf85856146bf565b92505060206148498582860161475f565b6000806000606084860312156148e557600080fd5b60006148f186866146bf565b93505060206148858682870161475f565b6000806000806080858703121561491857600080fd5b600061492487876146bf565b94505060206149358782880161475f565b93505060406149468782880161475f565b92505060606149578782880161475f565b91505092959194509250565b60008060008060008060c0878903121561497c57600080fd5b600061498889896146bf565b965050602061499989828a0161475f565b95505060406149aa89828a0161475f565b94505060606149bb89828a0161475f565b93505060806149cc89828a016146bf565b92505060a06149dd89828a0161475f565b9150509295509295509295565b60008060008060008060c08789031215614a0357600080fd5b6000614a0f89896146bf565b9650506020614a2089828a0161475f565b9550506040614a3189828a0161475f565b9450506060614a4289828a0161475f565b9350506080614a5389828a0161475f565b92505060a06149dd89828a016146bf565b600060208284031215614a7657600080fd5b815167ffffffffffffffff811115614a8d57600080fd5b613a1e848285016146d5565b600060208284031215614aab57600080fd5b6000613a1e8484614754565b600060208284031215614ac957600080fd5b6000613a1e848461475f565b600060208284031215614ae757600080fd5b6000613a1e848461476a565b60008060008060808587031215614b0957600080fd5b6000614924878761475f565b600080600060608486031215614b2a57600080fd5b60006148f1868661475f565b600080600080600060a08688031215614b4e57600080fd5b6000614b5a888861475f565b9550506020614b6b8882890161475f565b9450506040614b7c8882890161475f565b9350506060614b8d888289016146bf565b9250506080614b9e8882890161475f565b9150509295509295909350565b600080600080600060a08688031215614bc357600080fd5b6000614bcf888861475f565b9550506020614be08882890161475f565b9450506040614bf18882890161475f565b9350506060614b8d8882890161475f565b600060208284031215614c1457600080fd5b6000613a1e8484614775565b600060208284031215614c3257600080fd5b6000613a1e8484614780565b600060408284031215614c5057600080fd5b6000613a1e848461478b565b60008060408385031215614c6f57600080fd5b6000614c7b858561476a565b925050602061484985828601614754565b60008060408385031215614c9f57600080fd5b6000614cab858561476a565b925050602061484985828601614775565b600080600060608486031215614cd157600080fd5b6000614cdd868661476a565b9350506020614cee8682870161476a565b92505060406148968682870161476a565b6000614d0b8383614d8d565b505060200190565b614d1c81615ef0565b82525050565b614d1c81615ec2565b6000614d3682615eb5565b614d408185615eb9565b9350614d4b83615eaf565b8060005b83811015614d79578151614d638882614cff565b9750614d6e83615eaf565b925050600101614d4f565b509495945050505050565b614d1c81615ecd565b614d1c8161124b565b614d1c614da28261124b565b61124b565b6000614db282615eb5565b614dbc8185615eb9565b9350614dcc818560208601615f14565b614dd581615f40565b9093019392505050565b614d1c81615ed2565b614d1c81615efb565b614d1c81615f09565b6000614e07601483615eb9565b7327b7363c902618902232b13a26b4b3b930ba37b960611b815260200192915050565b6000614e37601f83615eb9565b7f43616e6e6f74207472616e7366657220746f2074686973206164647265737300815260200192915050565b75446562744d69677261746f724f6e4f7074696d69736d60501b9052565b6000614e8e603583615eb9565b7f596f75206d757374206265206e6f6d696e61746564206265666f726520796f7581527402063616e20616363657074206f776e65727368697605c1b602082015260400192915050565b6e53796e746865746978457363726f7760881b9052565b6000614efc601383615eb9565b7227bbb732b91037b7363c90333ab731ba34b7b760691b815260200192915050565b6000614f2b601e83615eb9565b7f4f6e6c792045786368616e6765722063616e20696e766f6b6520746869730000815260200192915050565b6000614f64604483610bd0565b7f41746f6d696353796e746845786368616e676528616464726573732c6279746581527f7333322c75696e743235362c627974657333322c75696e743235362c616464726020820152636573732960e01b604082015260440192915050565b6000614fd0601483615eb9565b73616c6c20656e747269657320617265207a65726f60601b815260200192915050565b6000615000601b83615eb9565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000815260200192915050565b6000615039602483615eb9565b7f466c616720726577617264207472616e7366657220646964206e6f742073756381526318d9595960e21b602082015260400192915050565b6b526577617264457363726f7760a01b9052565b6000615093601883615eb9565b7f4e657720657363726f77206164647265737320756e7365740000000000000000815260200192915050565b60006150cc602883610bd0565b7f45786368616e67655265636c61696d28616464726573732c627974657333322c81526775696e743235362960c01b602082015260280192915050565b6000615116601e83615eb9565b7f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815260200192915050565b600061514f601383615eb9565b721cdb9e081d1c985b9cd9995c8819985a5b1959606a1b815260200192915050565b600061517e601b83615eb9565b7f43616e6e6f742062652072756e206f6e2074686973206c617965720000000000815260200192915050565b60006151b7603183610bd0565b7f45786368616e6765547261636b696e6728627974657333322c627974657333328152702c75696e743235362c75696e743235362960781b602082015260310192915050565b600061520a601183610bd0565b70026b4b9b9b4b7339030b2323932b9b99d1607d1b815260110192915050565b6000615237603e83610bd0565b7f53796e746845786368616e676528616464726573732c627974657333322c756981527f6e743235362c627974657333322c75696e743235362c616464726573732900006020820152603e0192915050565b6000615296602683615eb9565b7f43616e6e6f74207472616e73666572207374616b6564206f7220657363726f778152650cac840a69cb60d31b602082015260400192915050565b60006152de601e83615eb9565b7f412073796e7468206f7220534e58207261746520697320696e76616c69640000815260200192915050565b6000615317601b83615eb9565b7f52657761726473446973747269627574696f6e206e6f74207365740000000000815260200192915050565b6000615350602f83615eb9565b7f4f6e6c792074686520636f6e7472616374206f776e6572206d6179207065726681526e37b936903a3434b99030b1ba34b7b760891b602082015260400192915050565b60006153a1602483615eb9565b7f5472616e7366657220746f204c697175696461746f72526577617264732066618152631a5b195960e21b602082015260400192915050565b60006153e7602183610bd0565b7f417070726f76616c28616464726573732c616464726573732c75696e743235368152602960f81b602082015260210192915050565b600061542a602783610bd0565b7f45786368616e676552656261746528616464726573732c627974657333322c75815266696e743235362960c81b602082015260270192915050565b6000615473601a83610bd0565b7f546f6b656e5374617465557064617465642861646472657373290000000000008152601a0192915050565b60006154ac602383615eb9565b7f4f6e6c79204c65676163794d61726b65742063616e207265766f6b6520657363815262726f7760e81b602082015260400192915050565b60006154f1603283610bd0565b7f4163636f756e744c69717569646174656428616464726573732c75696e743235815271362c75696e743235362c616464726573732960701b602082015260320192915050565b6d2932bbb0b93222b9b1b937bbab1960911b9052565b600061555b601983610bd0565b7f5265736f6c766572206d697373696e67207461726765743a2000000000000000815260190192915050565b6000615594602983615eb9565b7f4c697175696461746520726577617264207472616e7366657220646964206e6f8152681d081cdd58d8d9595960ba1b602082015260400192915050565b60006155df601583615eb9565b7463616e6e6f742073656c66206c697175696461746560581b815260200192915050565b6411195c1bdd60da1b9052565b600061561d601583615eb9565b744e6f20737570706c79206973206d696e7461626c6560581b815260200192915050565b600061564e601883615eb9565b7f4f6c6420657363726f77206164647265737320756e7365740000000000000000815260200192915050565b6000615687602183610bd0565b7f5472616e7366657228616464726573732c616464726573732c75696e743235368152602960f81b602082015260210192915050565b60006156ca601783615eb9565b7f4f6e6c79207468652070726f78792063616e2063616c6c000000000000000000815260200192915050565b7f53796e746865746978427269646765546f4f7074696d69736d000000000000009052565b6000615728601e83615eb9565b7f63616e6e6f74206d69677261746520746f2073616d6520616464726573730000815260200192915050565b732932bbb0b93222b9b1b937bbab19233937bd32b760611b9052565b614d1c81615eea565b6000610cea82614f57565b6000610cea826150bf565b6000610cea826151aa565b60006157a5826151fd565b91506157b18284614d96565b50602001919050565b6000610cea8261522a565b6000610cea826153da565b6000610cea8261541d565b6000610cea82615466565b6000610cea826154e4565b60006157a58261554e565b6000610cea8261567a565b60208101610cea8284614d22565b60208101610cea8284614d13565b604081016158318285614d13565b6113ed6020830184614d8d565b6040810161584c8285614d22565b6113ed6020830184614d22565b6101208101615868828c614d22565b615875602083018b614d22565b615882604083018a614d8d565b61588f6060830189614d8d565b61589c6080830188614d8d565b6158a960a0830187614d13565b6158b660c0830186614d84565b6158c360e0830185614d22565b6158d1610100830184614d8d565b9a9950505050505050505050565b61012081016158ee828c614d22565b6158fb602083018b614d22565b615908604083018a614d8d565b6159156060830189614d8d565b6159226080830188614d8d565b6158a960a0830187614d22565b6060810161593d8286614d22565b61594a6020830185614d22565b613a1e6040830184614d8d565b608081016159658287614d22565b6159726020830186614d22565b61597f6040830185614d8d565b61598c6060830184614df1565b95945050505050565b608081016159a38287614d22565b6159b06020830186614d22565b6159bd6040830185614d8d565b61598c6060830184614d8d565b604081016159d88285614d22565b6113ed6020830184614d84565b604081016158318285614d22565b60e08101615a01828a614d22565b615a0e6020830189614d8d565b615a1b6040830188614d8d565b615a286060830187614d8d565b615a356080830186614d22565b615a4260a0830185614d8d565b611bd660c0830184614d8d565b602080825281016113ed8184614d2b565b60208101610cea8284614d84565b60208101610cea8284614d8d565b6040810161584c8285614d8d565b604081016159d88285614d8d565b604081016158318285614d8d565b60408101615ab48285614d8d565b81810360208301526113ea8184614da7565b60a08101615ad48288614d8d565b615ae16020830187614d8d565b615aee6040830186614d8d565b615afb6060830185614d8d565b615b086080830184614d22565b9695505050505050565b60608101615b208286614d8d565b61594a6020830185614d8d565b60c08082528101615b3e8189614da7565b9050615b4d6020830188614df1565b615b5a6040830187614d8d565b615b676060830186614de8565b615b746080830185614de8565b615b8160a0830184614de8565b979650505050505050565b60c08082528101615b9d8189614da7565b9050615bac6020830188614df1565b615bb96040830187614d8d565b615b676060830186614d8d565b60c08082528101615bd78189614da7565b9050615be66020830188614df1565b615bf36040830187614d8d565b615c006060830186614d8d565b615b746080830185614d8d565b60208101610cea8284614ddf565b602080825281016113ed8184614da7565b60208082528101610bcd81614dfa565b60208082528101610bcd81614e2a565b60208101610bd082614e63565b60208082528101610bcd81614e81565b60208101610bd082614ed8565b60208082528101610bcd81614eef565b60208082528101610bcd81614f1e565b60208082528101610bcd81614fc3565b60208082528101610bcd81614ff3565b60208082528101610bcd8161502c565b60208101610bd082615072565b60208082528101610bcd81615109565b60208082528101610bcd81615142565b60208082528101610bcd81615171565b60208082528101610bcd81615289565b60208082528101610bcd816152d1565b60208082528101610bcd8161530a565b60208082528101610bcd81615343565b60208082528101610bcd81615394565b60208082528101610bcd8161549f565b60208101610bd082615538565b60408101615d7d82615538565b8181036020830152610bcd81615086565b60208082528101610bcd81615587565b60208082528101610bcd816155d2565b60208101610bd082615603565b60208082528101610bcd81615610565b60208082528101610bcd816156bd565b60208101610bd0826156f6565b60208082528101610bcd8161571b565b60408101615e0582615754565b8181036020830152610bcd81615641565b60408101615e248285614d8d565b6113ed6020830184614ddf565b60608101615e3f8286614d8d565b615e4c6020830185614d8d565b613a1e6040830184614d22565b60208101610cea8284615770565b60405181810167ffffffffffffffff81118282101715615e8657600080fd5b604052919050565b600067ffffffffffffffff821115615ea557600080fd5b5060209081020190565b60200190565b5190565b90815260200190565b6000610bcd82613a7a565b151590565b6000610bcd82615ec2565b67ffffffffffffffff1690565b60ff1690565b6000610bcd82615ed2565b6000610bcd614da28361124b565b6000610bcd8261124b565b60005b83811015615f2f578181015183820152602001615f17565b83811115610b2d5750506000910152565b601f01601f191690565b615f5381615ec2565b811461165357600080fd5b615f5381615ecd565b615f538161124b565b615f5381615ed2565b615f5381615edd56fea365627a7a72315820c4a71ea3fb5c172ec821d95fb794efd1ce91fa8825b8f001d1678551c52cc1f76c6578706572696d656e74616cf564736f6c63430005100040

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

000000000000000000000000c011a73ee8576fb46f5e1c5751ca3b9fe0af2a6f0000000000000000000000005b1b5fea1b99d83ad479df0c222f0492385381dd000000000000000000000000302d2451d9f47620374b54c521423bf0403916a20000000000000000000000000000000000000000010562ccfb70ee2114b2cb800000000000000000000000004e3b31eb0e5cb73641ee1e65e7dcefe520ba3ef2

-----Decoded View---------------
Arg [0] : _proxy (address): 0xC011a73ee8576Fb46F5E1c5751cA3B9Fe0af2a6F
Arg [1] : _tokenState (address): 0x5b1b5fEa1b99D83aD479dF0C222F0492385381dD
Arg [2] : _owner (address): 0x302d2451d9f47620374B54c521423Bf0403916A2
Arg [3] : _totalSupply (uint256): 315996212088773603337882496
Arg [4] : _resolver (address): 0x4E3b31eB0E5CB73641EE1E65E7dCEFe520bA3ef2

-----Encoded View---------------
5 Constructor Arguments found :
Arg [0] : 000000000000000000000000c011a73ee8576fb46f5e1c5751ca3b9fe0af2a6f
Arg [1] : 0000000000000000000000005b1b5fea1b99d83ad479df0c222f0492385381dd
Arg [2] : 000000000000000000000000302d2451d9f47620374b54c521423bf0403916a2
Arg [3] : 0000000000000000000000000000000000000000010562ccfb70ee2114b2cb80
Arg [4] : 0000000000000000000000004e3b31eb0e5cb73641ee1e65e7dcefe520ba3ef2


Loading...
Loading
[ Download: CSV Export  ]
[ Download: CSV Export  ]

A token is a representation of an on-chain or off-chain asset. The token page shows information such as price, total supply, holders, transfers and social links. Learn more about this page in our Knowledge Base.