POA Network merged with the Gnosis Chain. More information about the merger.

Contract Address Details

0xa105Db0e6671C7B5f4f350ff1Af6460E6C696e71

Contract Name
PoaNetworkConsensus
Creator
0x48a1b2–21d69f at 0xca6e1f–b0b944
Balance
0 POA ( )
Tokens
Fetching tokens...
Transactions
1 Transactions
Transfers
0 Transfers
Gas Used
50,510
Last Balance Update
30929773
Contract name:
PoaNetworkConsensus




Optimization enabled
true
Compiler version
v0.4.24+commit.e67f0147




Verified at
2018-10-24T15:46:58.518821Z

Contract source code

Sol2uml
new
pragma solidity ^0.4.24;


interface IProxyStorage {
    function initializeAddresses(
        address, address, address, address, address, address, address, address
    ) external;

    function setContractAddress(uint256, address) external returns(bool);
    function getBallotsStorage() external view returns(address);
    function getKeysManager() external view returns(address);
    function getPoaConsensus() external view returns(address);
    function getValidatorMetadata() external view returns(address);
    function getVotingToChangeKeys() external view returns(address);
    function getVotingToChangeMinThreshold() external view returns(address);
}


interface IPoaNetworkConsensus {
    function addValidator(address, bool) external returns(bool);
    function finalizeChange() external;
    function removeValidator(address, bool) external returns(bool);
    function swapValidatorKey(address, address) external returns(bool);
    function isMasterOfCeremonyRemoved() external view returns(bool);
    function isValidator(address) external view returns(bool);
    function getCurrentValidatorsLength() external view returns(uint256);
    function getCurrentValidatorsLengthWithoutMoC() external view returns(uint256);
    function getPendingList() external view returns(address[]);
    function getValidators() external view returns(address[]);
    function masterOfCeremony() external view returns(address);
}


interface IPoaNetworkConsensusForVotingToChange {
    function currentValidators(uint256) external view returns(address);
    function getCurrentValidatorsLength() external view returns(uint256);
}





contract PoaNetworkConsensus is IPoaNetworkConsensus {
    /// Issue this log event to signal a desired change in validator set.
    /// This will not lead to a change in active validator set until 
    /// finalizeChange is called.
    ///
    /// Only the last log event of any block can take effect.
    /// If a signal is issued while another is being finalized it may never
    /// take effect.
    /// 
    /// parentHash here should be the parent block hash, or the
    /// signal will not be recognized.
    event InitiateChange(bytes32 indexed parentHash, address[] newSet);
    event ChangeFinalized(address[] newSet);
    event MoCInitializedProxyStorage(address proxyStorage);
    
    struct ValidatorState {
        // Is this a validator.
        bool isValidator;
        // Is a validator finalized.
        bool isValidatorFinalized;
        // Index in the currentValidators.
        uint256 index;
    }
    
    IProxyStorage public proxyStorage;
    address public systemAddress = 0xffffFFFfFFffffffffffffffFfFFFfffFFFfFFfE;
    
    address[] public currentValidators;
    address[] public pendingList;
    mapping(address => ValidatorState) public validatorsState;
    
    address internal _moc;
    address internal _mocPending;
    address internal _owner;

    bool internal _isMoCRemoved = false;
    bool internal _isMoCRemovedPending = false;

    bool public finalized = false;
    bool public wasProxyStorageSet = false;

    modifier onlySystemAndNotFinalized() {
        require(msg.sender == systemAddress && !finalized);
        _;
    }

    modifier onlyKeysManager() {
        require(msg.sender == getKeysManager());
        _;
    }

    constructor(address _masterOfCeremony, address[] validators) public {
        // TODO: When you deploy this contract, make sure you hardcode items below
        // Make sure you have those addresses defined in spec.json
        require(_masterOfCeremony != address(0));
        _moc = _masterOfCeremony;
        currentValidators = [_masterOfCeremony];
        for (uint256 y = 0; y < validators.length; y++) {
            require(validators[y] != address(0));
            currentValidators.push(validators[y]);
        }
        for (uint256 i = 0; i < currentValidators.length; i++) {
            address validator = currentValidators[i];
            require(!isValidator(validator));
            validatorsState[validator] = ValidatorState({
                isValidator: true,
                isValidatorFinalized: true,
                index: i
            });
        }
        pendingList = currentValidators;
        _owner = msg.sender;
    }

    function isMasterOfCeremonyRemoved() public view returns(bool) {
        return _isMoCRemoved;
    }

    function isMasterOfCeremonyRemovedPending() public view returns(bool) {
        return _isMoCRemovedPending;
    }

    function masterOfCeremony() public view returns(address) {
        return _moc;
    }

    function masterOfCeremonyPending() public view returns(address) {
        return _mocPending;
    }

    /// Get current validator set (last enacted or initial if no changes ever made)
    function getValidators() public view returns(address[]) {
        return currentValidators;
    }

    function getPendingList() public view returns(address[]) {
        return pendingList;
    }

    /// Called when an initiated change reaches finality and is activated. 
    /// Only valid when msg.sender == SUPER_USER (EIP96, 2**160 - 2)
    ///
    /// Also called when the contract is first enabled for consensus. In this case,
    /// the "change" finalized is the activation of the initial set.
    function finalizeChange() public onlySystemAndNotFinalized {
        finalized = true;
        for (uint256 i = 0; i < pendingList.length; i++) {
            ValidatorState storage state = validatorsState[pendingList[i]];
            if (!state.isValidatorFinalized) {
                state.isValidatorFinalized = true;
            }
        }
        currentValidators = pendingList;
        if (_mocPending != address(0)) {
            _moc = _mocPending;
            _mocPending = address(0);
        }
        if (_isMoCRemovedPending) {
            _isMoCRemoved = true;
            _isMoCRemovedPending = false;
        }
        emit ChangeFinalized(getValidators());
    }

    function addValidator(address _validator, bool _shouldFireEvent)
        public
        onlyKeysManager
        returns(bool)
    {
        if (_addValidatorAllowed(_validator)) {
            _addValidator(_validator, _shouldFireEvent);
            return true;
        }
        return false;
    }

    function removeValidator(
        address _validator,
        bool _shouldFireEvent
    ) public onlyKeysManager returns(bool) {
        if (_removeValidatorAllowed(_validator)) {
            _removeValidator(_validator, _shouldFireEvent);
            return true;
        }
        return false;
    }

    function swapValidatorKey(address _newKey, address _oldKey)
        public
        onlyKeysManager
        returns(bool)
    {
        if (!_removeValidatorAllowed(_oldKey) || !_addValidatorAllowed(_newKey)) return false;
        _removeValidator(_oldKey, false);
        _addValidator(_newKey, false);
        if (_oldKey == _moc) {
            _mocPending = _newKey;
        }
        emit InitiateChange(blockhash(block.number - 1), pendingList);
        return true;
    }

    function setProxyStorage(address _newAddress) public {
        require(msg.sender == _moc && !_isMoCRemoved || msg.sender == _owner);
        require(!wasProxyStorageSet);
        require(_newAddress != address(0));
        proxyStorage = IProxyStorage(_newAddress);
        wasProxyStorageSet = true;
        emit MoCInitializedProxyStorage(proxyStorage);
    }

    function isValidator(address _someone) public view returns(bool) {
        return validatorsState[_someone].isValidator;
    }

    function isValidatorFinalized(address _someone) public view returns(bool) {
        bool _isValidator = validatorsState[_someone].isValidator;
        bool _isFinalized = validatorsState[_someone].isValidatorFinalized;
        return _isValidator && _isFinalized;
    }

    function getKeysManager() public view returns(address) {
        return proxyStorage.getKeysManager();
    }

    function getCurrentValidatorsLength() public view returns(uint256) {
        return currentValidators.length;
    }

    function getCurrentValidatorsLengthWithoutMoC() public view returns(uint256) {
        if (_isMoCRemoved) {
            return currentValidators.length;
        }
        if (currentValidators.length == 0) {
            return 0;
        }
        return currentValidators.length - 1; // exclude MoC
    }

    function _addValidatorAllowed(address _validator) private view returns(bool) {
        if (_validator == address(0)) return false;
        if (isValidator(_validator)) return false;
        return true;
    }

    function _addValidator(address _validator, bool _shouldFireEvent) private {
        validatorsState[_validator] = ValidatorState({
            isValidator: true,
            isValidatorFinalized: false,
            index: pendingList.length
        });
        pendingList.push(_validator);
        finalized = false;
        if (_shouldFireEvent) {
            emit InitiateChange(blockhash(block.number - 1), pendingList);
        }
    }

    function _removeValidatorAllowed(address _validator) private view returns(bool) {
        if (pendingList.length == 0) return false;
        if (!isValidator(_validator)) return false;
        return true;
    }

    function _removeValidator(address _validator, bool _shouldFireEvent) private {
        uint256 removedIndex = validatorsState[_validator].index;
        // Can not remove the last validator.
        uint256 lastIndex = pendingList.length - 1;
        address lastValidator = pendingList[lastIndex];
        // Override the removed validator with the last one.
        pendingList[removedIndex] = lastValidator;
        // Update the index of the last validator.
        validatorsState[lastValidator].index = removedIndex;
        pendingList.length--;
        validatorsState[_validator].index = 0;
        validatorsState[_validator].isValidator = false;
        validatorsState[_validator].isValidatorFinalized = false;
        finalized = false;
        if (_shouldFireEvent) {
            if (_validator == _moc) {
                _isMoCRemovedPending = true;
            }
            emit InitiateChange(blockhash(block.number - 1), pendingList);
        }
    }
}
        

Contract ABI

[{"type":"function","stateMutability":"view","payable":false,"outputs":[{"type":"address","name":""}],"name":"pendingList","inputs":[{"type":"uint256","name":""}],"constant":true},{"type":"function","stateMutability":"view","payable":false,"outputs":[{"type":"uint256","name":""}],"name":"getCurrentValidatorsLength","inputs":[],"constant":true},{"type":"function","stateMutability":"nonpayable","payable":false,"outputs":[],"name":"setProxyStorage","inputs":[{"type":"address","name":"_newAddress"}],"constant":false},{"type":"function","stateMutability":"nonpayable","payable":false,"outputs":[{"type":"bool","name":""}],"name":"addValidator","inputs":[{"type":"address","name":"_validator"},{"type":"bool","name":"_shouldFireEvent"}],"constant":false},{"type":"function","stateMutability":"view","payable":false,"outputs":[{"type":"bool","name":""}],"name":"isMasterOfCeremonyRemovedPending","inputs":[],"constant":true},{"type":"function","stateMutability":"view","payable":false,"outputs":[{"type":"bool","name":""}],"name":"isMasterOfCeremonyRemoved","inputs":[],"constant":true},{"type":"function","stateMutability":"view","payable":false,"outputs":[{"type":"bool","name":"isValidator"},{"type":"bool","name":"isValidatorFinalized"},{"type":"uint256","name":"index"}],"name":"validatorsState","inputs":[{"type":"address","name":""}],"constant":true},{"type":"function","stateMutability":"view","payable":false,"outputs":[{"type":"address[]","name":""}],"name":"getPendingList","inputs":[],"constant":true},{"type":"function","stateMutability":"nonpayable","payable":false,"outputs":[],"name":"finalizeChange","inputs":[],"constant":false},{"type":"function","stateMutability":"nonpayable","payable":false,"outputs":[{"type":"bool","name":""}],"name":"swapValidatorKey","inputs":[{"type":"address","name":"_newKey"},{"type":"address","name":"_oldKey"}],"constant":false},{"type":"function","stateMutability":"view","payable":false,"outputs":[{"type":"bool","name":""}],"name":"isValidatorFinalized","inputs":[{"type":"address","name":"_someone"}],"constant":true},{"type":"function","stateMutability":"view","payable":false,"outputs":[{"type":"address","name":""}],"name":"currentValidators","inputs":[{"type":"uint256","name":""}],"constant":true},{"type":"function","stateMutability":"view","payable":false,"outputs":[{"type":"address","name":""}],"name":"getKeysManager","inputs":[],"constant":true},{"type":"function","stateMutability":"view","payable":false,"outputs":[{"type":"bool","name":""}],"name":"wasProxyStorageSet","inputs":[],"constant":true},{"type":"function","stateMutability":"view","payable":false,"outputs":[{"type":"uint256","name":""}],"name":"getCurrentValidatorsLengthWithoutMoC","inputs":[],"constant":true},{"type":"function","stateMutability":"view","payable":false,"outputs":[{"type":"address","name":""}],"name":"proxyStorage","inputs":[],"constant":true},{"type":"function","stateMutability":"view","payable":false,"outputs":[{"type":"bool","name":""}],"name":"finalized","inputs":[],"constant":true},{"type":"function","stateMutability":"view","payable":false,"outputs":[{"type":"address[]","name":""}],"name":"getValidators","inputs":[],"constant":true},{"type":"function","stateMutability":"view","payable":false,"outputs":[{"type":"address","name":""}],"name":"systemAddress","inputs":[],"constant":true},{"type":"function","stateMutability":"view","payable":false,"outputs":[{"type":"address","name":""}],"name":"masterOfCeremonyPending","inputs":[],"constant":true},{"type":"function","stateMutability":"nonpayable","payable":false,"outputs":[{"type":"bool","name":""}],"name":"removeValidator","inputs":[{"type":"address","name":"_validator"},{"type":"bool","name":"_shouldFireEvent"}],"constant":false},{"type":"function","stateMutability":"view","payable":false,"outputs":[{"type":"address","name":""}],"name":"masterOfCeremony","inputs":[],"constant":true},{"type":"function","stateMutability":"view","payable":false,"outputs":[{"type":"bool","name":""}],"name":"isValidator","inputs":[{"type":"address","name":"_someone"}],"constant":true},{"type":"constructor","stateMutability":"nonpayable","payable":false,"inputs":[{"type":"address","name":"_masterOfCeremony"},{"type":"address[]","name":"validators"}]},{"type":"event","name":"InitiateChange","inputs":[{"type":"bytes32","name":"parentHash","indexed":true},{"type":"address[]","name":"newSet","indexed":false}],"anonymous":false},{"type":"event","name":"ChangeFinalized","inputs":[{"type":"address[]","name":"newSet","indexed":false}],"anonymous":false},{"type":"event","name":"MoCInitializedProxyStorage","inputs":[{"type":"address","name":"proxyStorage","indexed":false}],"anonymous":false}]
              

Contract Creation Code

0x608060405260018054600160a060020a031916600260a060020a031790556007805460a060020a63ffffffff02191690553480156200003d57600080fd5b506040516200146438038062001464833981016040528051602082015190910160008080600160a060020a03851615156200007757600080fd5b60058054600160a060020a031916600160a060020a0387169081179091556040805160208101909152908152620000b39060029060016200025a565b50600092505b83518310156200014f578351600090859085908110620000d557fe5b60209081029091010151600160a060020a03161415620000f457600080fd5b600284848151811015156200010557fe5b6020908102919091018101518254600180820185556000948552929093209092018054600160a060020a031916600160a060020a03909316929092179091559290920191620000b9565b600091505b6002548210156200020b5760028054839081106200016e57fe5b600091825260209091200154600160a060020a0316905062000199816401000000006200023c810204565b15620001a457600080fd5b6040805160608101825260018082526020808301828152838501878152600160a060020a038716600090815260049093529490912092518354915115156101000261ff001991151560ff199093169290921716178255915190820155919091019062000154565b600280546200021d91600391620002c4565b505060078054600160a060020a03191633179055506200033192505050565b600160a060020a031660009081526004602052604090205460ff1690565b828054828255906000526020600020908101928215620002b2579160200282015b82811115620002b25782518254600160a060020a031916600160a060020a039091161782556020909201916001909101906200027b565b50620002c092915062000307565b5090565b828054828255906000526020600020908101928215620002b25760005260206000209182015b82811115620002b2578254825591600101919060010190620002ea565b6200032e91905b80821115620002c0578054600160a060020a03191681556001016200030e565b90565b61112380620003416000396000f3006080604052600436106101325763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166303aca79281146101375780630eaba26a1461016b578063108552691461019257806321a3fb85146101b5578063273cb593146101ef578063379fed9a146102045780634110a4891461021957806345199e0a1461025a57806375286211146102bf578063879736b2146102d45780638f2eabe1146102fb578063900eb5a81461031c5780639a57378614610334578063a5f8b87414610349578063a87563371461035e578063ae4b1b5b14610373578063b3f05b9714610388578063b7ab4db51461039d578063d3e848f1146103b2578063ec7de1e9146103c7578063f89a77b1146103dc578063fa81b20014610402578063facd743b14610417575b600080fd5b34801561014357600080fd5b5061014f600435610438565b60408051600160a060020a039092168252519081900360200190f35b34801561017757600080fd5b50610180610460565b60408051918252519081900360200190f35b34801561019e57600080fd5b506101b3600160a060020a0360043516610467565b005b3480156101c157600080fd5b506101db600160a060020a0360043516602435151561059f565b604080519115158252519081900360200190f35b3480156101fb57600080fd5b506101db6105e7565b34801561021057600080fd5b506101db610609565b34801561022557600080fd5b5061023a600160a060020a036004351661062a565b604080519315158452911515602084015282820152519081900360600190f35b34801561026657600080fd5b5061026f610650565b60408051602080825283518183015283519192839290830191858101910280838360005b838110156102ab578181015183820152602001610293565b505050509050019250505060405180910390f35b3480156102cb57600080fd5b506101b36106b2565b3480156102e057600080fd5b506101db600160a060020a03600435811690602435166108eb565b34801561030757600080fd5b506101db600160a060020a0360043516610a18565b34801561032857600080fd5b5061014f600435610a4f565b34801561034057600080fd5b5061014f610a5d565b34801561035557600080fd5b506101db610afb565b34801561036a57600080fd5b50610180610b1f565b34801561037f57600080fd5b5061014f610b6a565b34801561039457600080fd5b506101db610b79565b3480156103a957600080fd5b5061026f610b9c565b3480156103be57600080fd5b5061014f610bfc565b3480156103d357600080fd5b5061014f610c0b565b3480156103e857600080fd5b506101db600160a060020a03600435166024351515610c1a565b34801561040e57600080fd5b5061014f610c50565b34801561042357600080fd5b506101db600160a060020a0360043516610c5f565b600380548290811061044657fe5b600091825260209091200154600160a060020a0316905081565b6002545b90565b600554600160a060020a03163314801561049c575060075474010000000000000000000000000000000000000000900460ff16155b806104b15750600754600160a060020a031633145b15156104bc57600080fd5b60075477010000000000000000000000000000000000000000000000900460ff16156104e757600080fd5b600160a060020a03811615156104fc57600080fd5b60008054600160a060020a0380841673ffffffffffffffffffffffffffffffffffffffff1990921691909117918290556007805477ff000000000000000000000000000000000000000000000019167701000000000000000000000000000000000000000000000017905560408051929091168252517f600bcf04a13e752d1e3670a5a9f1c21177ca2a93c6f5391d4f1298d098097c229181900360200190a150565b60006105a9610a5d565b600160a060020a031633146105bd57600080fd5b6105c683610c81565b156105dd576105d58383610cb9565b5060016105e1565b5060005b92915050565b6007547501000000000000000000000000000000000000000000900460ff1690565b60075474010000000000000000000000000000000000000000900460ff1690565b6004602052600090815260409020805460019091015460ff808316926101009004169083565b606060038054806020026020016040519081016040528092919081815260200182805480156106a857602002820191906000526020600020905b8154600160a060020a0316815260019091019060200180831161068a575b5050505050905090565b6001546000908190600160a060020a0316331480156106ee5750600754760100000000000000000000000000000000000000000000900460ff16155b15156106f957600080fd5b6007805476ff000000000000000000000000000000000000000000001916760100000000000000000000000000000000000000000000179055600091505b6003548210156107a5576004600060038481548110151561075457fe5b6000918252602080832090910154600160a060020a031683528201929092526040019020805490915060ff61010090910416151561079a57805461ff0019166101001781555b600190910190610737565b600380546107b591600291611033565b50600654600160a060020a0316156107fa57600680546005805473ffffffffffffffffffffffffffffffffffffffff19908116600160a060020a038416179091551690555b6007547501000000000000000000000000000000000000000000900460ff161561086f576007805475ff0000000000000000000000000000000000000000001974ff00000000000000000000000000000000000000001990911674010000000000000000000000000000000000000000171690555b7f8564cd629b15f47dc310d45bcbfc9bcf5420b0d51bf0659a16c67f91d2763253610898610b9c565b60408051602080825283518183015283519192839290830191858101910280838360005b838110156108d45781810151838201526020016108bc565b505050509050019250505060405180910390a15050565b60006108f5610a5d565b600160a060020a0316331461090957600080fd5b61091282610e1f565b1580610924575061092283610c81565b155b15610931575060006105e1565b61093c826000610e4a565b610947836000610cb9565b600554600160a060020a0383811691161415610986576006805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0385161790555b6001430340600019167f55252fa6eee4741b4e24a74a70e9c11fd2c2281df8d6ea13126ff845f7825c89600360405180806020018281038252838181548152602001915080548015610a0157602002820191906000526020600020905b8154600160a060020a031681526001909101906020018083116109e3575b50509250505060405180910390a250600192915050565b600160a060020a03811660009081526004602052604081205460ff80821691610100900416818015610a475750805b949350505050565b600280548290811061044657fe5b60008060009054906101000a9004600160a060020a0316600160a060020a0316639a5737866040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b158015610aca57600080fd5b505af1158015610ade573d6000803e3d6000fd5b505050506040513d6020811015610af457600080fd5b5051905090565b60075477010000000000000000000000000000000000000000000000900460ff1681565b60075460009074010000000000000000000000000000000000000000900460ff1615610b4e5750600254610464565b6002541515610b5f57506000610464565b506002546000190190565b600054600160a060020a031681565b600754760100000000000000000000000000000000000000000000900460ff1681565b606060028054806020026020016040519081016040528092919081815260200182805480156106a857602002820191906000526020600020908154600160a060020a0316815260019091019060200180831161068a575050505050905090565b600154600160a060020a031681565b600654600160a060020a031690565b6000610c24610a5d565b600160a060020a03163314610c3857600080fd5b610c4183610e1f565b156105dd576105d58383610e4a565b600554600160a060020a031690565b600160a060020a03811660009081526004602052604090205460ff165b919050565b6000600160a060020a0382161515610c9b57506000610c7c565b610ca482610c5f565b15610cb157506000610c7c565b506001919050565b6040805160608101825260018082526000602080840182815260038054868801908152600160a060020a038a16808652600490945296842095518654925115156101000261ff001991151560ff19909416939093171691909117855594519383019390935583549182018455929092527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b909101805473ffffffffffffffffffffffffffffffffffffffff191690911790556007805476ff00000000000000000000000000000000000000000000191690558015610e1b576001430340600019167f55252fa6eee4741b4e24a74a70e9c11fd2c2281df8d6ea13126ff845f7825c89600360405180806020018281038252838181548152602001915080548015610e0c57602002820191906000526020600020905b8154600160a060020a03168152600190910190602001808311610dee575b50509250505060405180910390a25b5050565b6003546000901515610e3357506000610c7c565b610e3c82610c5f565b1515610cb157506000610c7c565b600160a060020a03821660009081526004602052604081206001015460038054919260001983019290919083908110610e7f57fe5b60009182526020909120015460038054600160a060020a039092169250829185908110610ea857fe5b6000918252602080832091909101805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0394851617905591831681526004909152604090206001018390556003805490610f04906000198301611083565b50600160a060020a03851660009081526004602052604081206001810191909155805461ffff191690556007805476ff0000000000000000000000000000000000000000000019169055831561102c57600554600160a060020a0386811691161415610fa2576007805475ff000000000000000000000000000000000000000000191675010000000000000000000000000000000000000000001790555b6001430340600019167f55252fa6eee4741b4e24a74a70e9c11fd2c2281df8d6ea13126ff845f7825c8960036040518080602001828103825283818154815260200191508054801561101d57602002820191906000526020600020905b8154600160a060020a03168152600190910190602001808311610fff575b50509250505060405180910390a25b5050505050565b8280548282559060005260206000209081019282156110735760005260206000209182015b82811115611073578254825591600101919060010190611058565b5061107f9291506110ac565b5090565b8154818355818111156110a7576000838152602090206110a79181019083016110dd565b505050565b61046491905b8082111561107f57805473ffffffffffffffffffffffffffffffffffffffff191681556001016110b2565b61046491905b8082111561107f57600081556001016110e35600a165627a7a72305820595fdbe15d010f8d47f173860e9864085949d4b256e1ff156f8c0f26ec1a287a0029000000000000000000000000cf260ea317555637c55f70e55dba8d5ad8414cb000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000014000000000000000000000000bc70e7a838ef3d468e25efa5ecb8946d3d0f913b0000000000000000000000008e6cdfacdae218ae312ad24cb1e8cf34bb9f6b610000000000000000000000007a6a585db8cdfa88b9e8403c054ec2e912e9d32e00000000000000000000000049bbdebd7f3d39f297135d7af3831ce152a99b670000000000000000000000000f1e7c925d502855dcd31dde4703770a0cf6cdfc0000000000000000000000008fe38b0349b99c17242d44d5b1b859b0e941dced000000000000000000000000dc4765d9dabf6c6c4908fe97e649ef1f05cb62520000000000000000000000003091aee5cb7a290da8e05cc4b70dac7715de39a00000000000000000000000006e4f8fc73b93ba5160fadf914603a590d467649400000000000000000000000018bea833d503341c529a788c82909337e552a44e000000000000000000000000f1f51e933d6aad056236e0a45c1cc5b335ca1a7500000000000000000000000028e7605a631441870e80a283aa43ae4145f82cc3000000000000000000000000dad49e6cbde849353ab27dec6319e687bfc91a410000000000000000000000006e349be21acb0db3b2092fd4e3b738202842697e00000000000000000000000071300d93a8cdf93385af9635388cf2d00b95a48000000000000000000000000059d82a4b6068188ac06605a8416b5c7d40d6fc43000000000000000000000000d495483cf6373b619cf770a2a279ef4be7afbd0d0000000000000000000000000c6c0665804fd28cd8d1b2208104e31ce2051ce20000000000000000000000005ee341ac44d344ade1ca3a771c59b98eb2a77df200000000000000000000000066c9343c7e8ca673a1fedf9dbf2cd7936dbbf7e3

Deployed ByteCode

0x6080604052600436106101325763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166303aca79281146101375780630eaba26a1461016b578063108552691461019257806321a3fb85146101b5578063273cb593146101ef578063379fed9a146102045780634110a4891461021957806345199e0a1461025a57806375286211146102bf578063879736b2146102d45780638f2eabe1146102fb578063900eb5a81461031c5780639a57378614610334578063a5f8b87414610349578063a87563371461035e578063ae4b1b5b14610373578063b3f05b9714610388578063b7ab4db51461039d578063d3e848f1146103b2578063ec7de1e9146103c7578063f89a77b1146103dc578063fa81b20014610402578063facd743b14610417575b600080fd5b34801561014357600080fd5b5061014f600435610438565b60408051600160a060020a039092168252519081900360200190f35b34801561017757600080fd5b50610180610460565b60408051918252519081900360200190f35b34801561019e57600080fd5b506101b3600160a060020a0360043516610467565b005b3480156101c157600080fd5b506101db600160a060020a0360043516602435151561059f565b604080519115158252519081900360200190f35b3480156101fb57600080fd5b506101db6105e7565b34801561021057600080fd5b506101db610609565b34801561022557600080fd5b5061023a600160a060020a036004351661062a565b604080519315158452911515602084015282820152519081900360600190f35b34801561026657600080fd5b5061026f610650565b60408051602080825283518183015283519192839290830191858101910280838360005b838110156102ab578181015183820152602001610293565b505050509050019250505060405180910390f35b3480156102cb57600080fd5b506101b36106b2565b3480156102e057600080fd5b506101db600160a060020a03600435811690602435166108eb565b34801561030757600080fd5b506101db600160a060020a0360043516610a18565b34801561032857600080fd5b5061014f600435610a4f565b34801561034057600080fd5b5061014f610a5d565b34801561035557600080fd5b506101db610afb565b34801561036a57600080fd5b50610180610b1f565b34801561037f57600080fd5b5061014f610b6a565b34801561039457600080fd5b506101db610b79565b3480156103a957600080fd5b5061026f610b9c565b3480156103be57600080fd5b5061014f610bfc565b3480156103d357600080fd5b5061014f610c0b565b3480156103e857600080fd5b506101db600160a060020a03600435166024351515610c1a565b34801561040e57600080fd5b5061014f610c50565b34801561042357600080fd5b506101db600160a060020a0360043516610c5f565b600380548290811061044657fe5b600091825260209091200154600160a060020a0316905081565b6002545b90565b600554600160a060020a03163314801561049c575060075474010000000000000000000000000000000000000000900460ff16155b806104b15750600754600160a060020a031633145b15156104bc57600080fd5b60075477010000000000000000000000000000000000000000000000900460ff16156104e757600080fd5b600160a060020a03811615156104fc57600080fd5b60008054600160a060020a0380841673ffffffffffffffffffffffffffffffffffffffff1990921691909117918290556007805477ff000000000000000000000000000000000000000000000019167701000000000000000000000000000000000000000000000017905560408051929091168252517f600bcf04a13e752d1e3670a5a9f1c21177ca2a93c6f5391d4f1298d098097c229181900360200190a150565b60006105a9610a5d565b600160a060020a031633146105bd57600080fd5b6105c683610c81565b156105dd576105d58383610cb9565b5060016105e1565b5060005b92915050565b6007547501000000000000000000000000000000000000000000900460ff1690565b60075474010000000000000000000000000000000000000000900460ff1690565b6004602052600090815260409020805460019091015460ff808316926101009004169083565b606060038054806020026020016040519081016040528092919081815260200182805480156106a857602002820191906000526020600020905b8154600160a060020a0316815260019091019060200180831161068a575b5050505050905090565b6001546000908190600160a060020a0316331480156106ee5750600754760100000000000000000000000000000000000000000000900460ff16155b15156106f957600080fd5b6007805476ff000000000000000000000000000000000000000000001916760100000000000000000000000000000000000000000000179055600091505b6003548210156107a5576004600060038481548110151561075457fe5b6000918252602080832090910154600160a060020a031683528201929092526040019020805490915060ff61010090910416151561079a57805461ff0019166101001781555b600190910190610737565b600380546107b591600291611033565b50600654600160a060020a0316156107fa57600680546005805473ffffffffffffffffffffffffffffffffffffffff19908116600160a060020a038416179091551690555b6007547501000000000000000000000000000000000000000000900460ff161561086f576007805475ff0000000000000000000000000000000000000000001974ff00000000000000000000000000000000000000001990911674010000000000000000000000000000000000000000171690555b7f8564cd629b15f47dc310d45bcbfc9bcf5420b0d51bf0659a16c67f91d2763253610898610b9c565b60408051602080825283518183015283519192839290830191858101910280838360005b838110156108d45781810151838201526020016108bc565b505050509050019250505060405180910390a15050565b60006108f5610a5d565b600160a060020a0316331461090957600080fd5b61091282610e1f565b1580610924575061092283610c81565b155b15610931575060006105e1565b61093c826000610e4a565b610947836000610cb9565b600554600160a060020a0383811691161415610986576006805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0385161790555b6001430340600019167f55252fa6eee4741b4e24a74a70e9c11fd2c2281df8d6ea13126ff845f7825c89600360405180806020018281038252838181548152602001915080548015610a0157602002820191906000526020600020905b8154600160a060020a031681526001909101906020018083116109e3575b50509250505060405180910390a250600192915050565b600160a060020a03811660009081526004602052604081205460ff80821691610100900416818015610a475750805b949350505050565b600280548290811061044657fe5b60008060009054906101000a9004600160a060020a0316600160a060020a0316639a5737866040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b158015610aca57600080fd5b505af1158015610ade573d6000803e3d6000fd5b505050506040513d6020811015610af457600080fd5b5051905090565b60075477010000000000000000000000000000000000000000000000900460ff1681565b60075460009074010000000000000000000000000000000000000000900460ff1615610b4e5750600254610464565b6002541515610b5f57506000610464565b506002546000190190565b600054600160a060020a031681565b600754760100000000000000000000000000000000000000000000900460ff1681565b606060028054806020026020016040519081016040528092919081815260200182805480156106a857602002820191906000526020600020908154600160a060020a0316815260019091019060200180831161068a575050505050905090565b600154600160a060020a031681565b600654600160a060020a031690565b6000610c24610a5d565b600160a060020a03163314610c3857600080fd5b610c4183610e1f565b156105dd576105d58383610e4a565b600554600160a060020a031690565b600160a060020a03811660009081526004602052604090205460ff165b919050565b6000600160a060020a0382161515610c9b57506000610c7c565b610ca482610c5f565b15610cb157506000610c7c565b506001919050565b6040805160608101825260018082526000602080840182815260038054868801908152600160a060020a038a16808652600490945296842095518654925115156101000261ff001991151560ff19909416939093171691909117855594519383019390935583549182018455929092527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b909101805473ffffffffffffffffffffffffffffffffffffffff191690911790556007805476ff00000000000000000000000000000000000000000000191690558015610e1b576001430340600019167f55252fa6eee4741b4e24a74a70e9c11fd2c2281df8d6ea13126ff845f7825c89600360405180806020018281038252838181548152602001915080548015610e0c57602002820191906000526020600020905b8154600160a060020a03168152600190910190602001808311610dee575b50509250505060405180910390a25b5050565b6003546000901515610e3357506000610c7c565b610e3c82610c5f565b1515610cb157506000610c7c565b600160a060020a03821660009081526004602052604081206001015460038054919260001983019290919083908110610e7f57fe5b60009182526020909120015460038054600160a060020a039092169250829185908110610ea857fe5b6000918252602080832091909101805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0394851617905591831681526004909152604090206001018390556003805490610f04906000198301611083565b50600160a060020a03851660009081526004602052604081206001810191909155805461ffff191690556007805476ff0000000000000000000000000000000000000000000019169055831561102c57600554600160a060020a0386811691161415610fa2576007805475ff000000000000000000000000000000000000000000191675010000000000000000000000000000000000000000001790555b6001430340600019167f55252fa6eee4741b4e24a74a70e9c11fd2c2281df8d6ea13126ff845f7825c8960036040518080602001828103825283818154815260200191508054801561101d57602002820191906000526020600020905b8154600160a060020a03168152600190910190602001808311610fff575b50509250505060405180910390a25b5050505050565b8280548282559060005260206000209081019282156110735760005260206000209182015b82811115611073578254825591600101919060010190611058565b5061107f9291506110ac565b5090565b8154818355818111156110a7576000838152602090206110a79181019083016110dd565b505050565b61046491905b8082111561107f57805473ffffffffffffffffffffffffffffffffffffffff191681556001016110b2565b61046491905b8082111561107f57600081556001016110e35600a165627a7a72305820595fdbe15d010f8d47f173860e9864085949d4b256e1ff156f8c0f26ec1a287a0029