ETH Price: $2,524.22 (+2.07%)

Contract

0xF4A9e856F3d159b7168c2a55faBbC9fE5c569f96
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Bulk Register Po...87383412019-10-14 8:11:421841 days ago1571040702IN
0xF4A9e856...E5c569f96
0 ETH0.000171382
Bulk Register Po...87383412019-10-14 8:11:421841 days ago1571040702IN
0xF4A9e856...E5c569f96
0 ETH0.000171262
Bulk Register Po...87383412019-10-14 8:11:421841 days ago1571040702IN
0xF4A9e856...E5c569f96
0 ETH0.000171382
Bulk Register Po...87383412019-10-14 8:11:421841 days ago1571040702IN
0xF4A9e856...E5c569f96
0 ETH0.000171262
Bulk Register Po...87383412019-10-14 8:11:421841 days ago1571040702IN
0xF4A9e856...E5c569f96
0 ETH0.000171382
Bulk Register Po...87383412019-10-14 8:11:421841 days ago1571040702IN
0xF4A9e856...E5c569f96
0 ETH0.000171382
Bulk Register Po...87383412019-10-14 8:11:421841 days ago1571040702IN
0xF4A9e856...E5c569f96
0 ETH0.000171262
Bulk Register Po...87383412019-10-14 8:11:421841 days ago1571040702IN
0xF4A9e856...E5c569f96
0 ETH0.000171382
Bulk Register Po...87383382019-10-14 8:10:471841 days ago1571040647IN
0xF4A9e856...E5c569f96
0 ETH0.000171382
Bulk Register Po...87383382019-10-14 8:10:471841 days ago1571040647IN
0xF4A9e856...E5c569f96
0 ETH0.000171262
Bulk Register Po...87383362019-10-14 8:10:351841 days ago1571040635IN
0xF4A9e856...E5c569f96
0 ETH0.000143372
Bulk Register Po...87383362019-10-14 8:10:351841 days ago1571040635IN
0xF4A9e856...E5c569f96
0 ETH0.000171262
Bulk Register Po...87383362019-10-14 8:10:351841 days ago1571040635IN
0xF4A9e856...E5c569f96
0 ETH0.000171262
Bulk Register Po...87383362019-10-14 8:10:351841 days ago1571040635IN
0xF4A9e856...E5c569f96
0 ETH0.000171382
Bulk Register Po...87383362019-10-14 8:10:351841 days ago1571040635IN
0xF4A9e856...E5c569f96
0 ETH0.000143372
Bulk Register Po...87372682019-10-14 4:11:371841 days ago1571026297IN
0xF4A9e856...E5c569f96
0 ETH0.000308263.6
Bulk Register Po...87372682019-10-14 4:11:371841 days ago1571026297IN
0xF4A9e856...E5c569f96
0 ETH0.000308493.6
Bulk Register Po...87372682019-10-14 4:11:371841 days ago1571026297IN
0xF4A9e856...E5c569f96
0 ETH0.000308263.6
Bulk Register Po...87372682019-10-14 4:11:371841 days ago1571026297IN
0xF4A9e856...E5c569f96
0 ETH0.000308493.6
Bulk Register Po...87372682019-10-14 4:11:371841 days ago1571026297IN
0xF4A9e856...E5c569f96
0 ETH0.000308493.6
Bulk Register Po...87372682019-10-14 4:11:371841 days ago1571026297IN
0xF4A9e856...E5c569f96
0 ETH0.000308263.6
Bulk Register Po...87372682019-10-14 4:11:371841 days ago1571026297IN
0xF4A9e856...E5c569f96
0 ETH0.000308263.6
Bulk Register Po...87372682019-10-14 4:11:371841 days ago1571026297IN
0xF4A9e856...E5c569f96
0 ETH0.000308033.6
Bulk Register Po...87372662019-10-14 4:10:391841 days ago1571026239IN
0xF4A9e856...E5c569f96
0 ETH0.000442095.16666666
Bulk Register Po...87372652019-10-14 4:10:371841 days ago1571026237IN
0xF4A9e856...E5c569f96
0 ETH0.000442755.16666666
View all transactions

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
ExtendedAdvertisement

Compiler Version
v0.4.24+commit.e67f0147

Optimization Enabled:
No with 200 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity)

/**
 *Submitted for verification at Etherscan.io on 2019-02-22
*/

pragma solidity 0.4.24;

interface StorageUser {
    function getStorageAddress() external view returns(address _storage);
}

interface ErrorThrower {
    event Error(string func, string message);
}

/**
 * @title Roles
 * @author Francisco Giordano (@frangio)
 *   Library for managing addresses assigned to a Role.
 * See RBAC.sol for example usage.
 */
library Roles {
  struct Role {
    mapping (address => bool) bearer;
  }

  /**
   *   give an address access to this role
   */
  function add(Role storage _role, address _addr)
    internal
  {
    _role.bearer[_addr] = true;
  }

  /**
   *   remove an address' access to this role
   */
  function remove(Role storage _role, address _addr)
    internal
  {
    _role.bearer[_addr] = false;
  }

  /**
   *   check if an address has this role
   * // reverts
   */
  function check(Role storage _role, address _addr)
    internal
    view
  {
    require(has(_role, _addr));
  }

  /**
   *   check if an address has this role
   * @return bool
   */
  function has(Role storage _role, address _addr)
    internal
    view
    returns (bool)
  {
    return _role.bearer[_addr];
  }
}


/**
 * @title RBAC (Role-Based Access Control)
 * @author Matt Condon (@Shrugs)
 *   Stores and provides setters and getters for roles and addresses.
 * Supports unlimited numbers of roles and addresses.
 * See //contracts/mocks/RBACMock.sol for an example of usage.
 * This RBAC method uses strings to key roles. It may be beneficial
 * for you to write your own implementation of this interface using Enums or similar.
 */
contract RBAC {
  using Roles for Roles.Role;

  mapping (string => Roles.Role) private roles;

  event RoleAdded(address indexed operator, string role);
  event RoleRemoved(address indexed operator, string role);

  /**
   *   reverts if addr does not have role
   * @param _operator address
   * @param _role the name of the role
   * // reverts
   */
  function checkRole(address _operator, string _role)
    public
    view
  {
    roles[_role].check(_operator);
  }

  /**
   *   determine if addr has role
   * @param _operator address
   * @param _role the name of the role
   * @return bool
   */
  function hasRole(address _operator, string _role)
    public
    view
    returns (bool)
  {
    return roles[_role].has(_operator);
  }

  /**
   *   add a role to an address
   * @param _operator address
   * @param _role the name of the role
   */
  function addRole(address _operator, string _role)
    internal
  {
    roles[_role].add(_operator);
    emit RoleAdded(_operator, _role);
  }

  /**
   *   remove a role from an address
   * @param _operator address
   * @param _role the name of the role
   */
  function removeRole(address _operator, string _role)
    internal
  {
    roles[_role].remove(_operator);
    emit RoleRemoved(_operator, _role);
  }

  /**
   *   modifier to scope access to a single role (uses msg.sender as addr)
   * @param _role the name of the role
   * // reverts
   */
  modifier onlyRole(string _role)
  {
    checkRole(msg.sender, _role);
    _;
  }

  /**
   *   modifier to scope access to a set of roles (uses msg.sender as addr)
   * @param _roles the names of the roles to scope access to
   * // reverts
   *
   * @TODO - when solidity supports dynamic arrays as arguments to modifiers, provide this
   *  see: https://github.com/ethereum/solidity/issues/2467
   */
  // modifier onlyRoles(string[] _roles) {
  //     bool hasAnyRole = false;
  //     for (uint8 i = 0; i < _roles.length; i++) {
  //         if (hasRole(msg.sender, _roles[i])) {
  //             hasAnyRole = true;
  //             break;
  //         }
  //     }

  //     require(hasAnyRole);

  //     _;
  // }
}


/**
 * @title SafeMath
 *   Math operations with safety checks that throw on error
 */
library SafeMath {

  /**
  *   Multiplies two numbers, throws on overflow.
  */
  function mul(uint256 _a, uint256 _b) internal pure returns (uint256 c) {
    // Gas optimization: this is cheaper than asserting '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;
    }

    c = _a * _b;
    assert(c / _a == _b);
    return c;
  }

  /**
  *   Integer division of two numbers, truncating the quotient.
  */
  function div(uint256 _a, uint256 _b) internal pure returns (uint256) {
    // assert(_b > 0); // Solidity automatically throws when dividing by 0
    // uint256 c = _a / _b;
    // assert(_a == _b * c + _a % _b); // There is no case in which this doesn't hold
    return _a / _b;
  }

  /**
  *   Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
  */
  function sub(uint256 _a, uint256 _b) internal pure returns (uint256) {
    assert(_b <= _a);
    return _a - _b;
  }

  /**
  *   Adds two numbers, throws on overflow.
  */
  function add(uint256 _a, uint256 _b) internal pure returns (uint256 c) {
    c = _a + _b;
    assert(c >= _a);
    return c;
  }
}

library ExtendedCampaignLibrary {
    struct ExtendedInfo{
        bytes32 bidId;
        string endpoint;
    }

    /**
    @notice Set extended campaign id
    @param _bidId Id of the campaign
     */
    function setBidId(ExtendedInfo storage _extendedInfo, bytes32 _bidId) internal {
        _extendedInfo.bidId = _bidId;
    }
    
    /**
    @notice Get extended campaign id
    @return {'_bidId' : 'Id of the campaign'}
    */
    function getBidId(ExtendedInfo storage _extendedInfo) internal view returns(bytes32 _bidId){
        return _extendedInfo.bidId;
    }


    /**
    @notice Set URL of the signing serivce
    @param _endpoint URL of the signing serivce
    */
    function setEndpoint(ExtendedInfo storage _extendedInfo, string  _endpoint) internal {
        _extendedInfo.endpoint = _endpoint;
    }

    /**
    @notice Get URL of the signing service
    @return {'_endpoint' : 'URL of the signing serivce'} 
    */
    function getEndpoint(ExtendedInfo storage _extendedInfo) internal view returns (string _endpoint) {
        return _extendedInfo.endpoint;
    }
}

library CampaignLibrary {

    struct Campaign {
        bytes32 bidId;
        uint price;
        uint budget;
        uint startDate;
        uint endDate;
        bool valid;
        address  owner;
    }


    /**
    @notice Set campaign id 
    @param _bidId Id of the campaign
     */
    function setBidId(Campaign storage _campaign, bytes32 _bidId) internal {
        _campaign.bidId = _bidId;
    }

    /**
    @notice Get campaign id
    @return {'_bidId' : 'Id of the campaign'}
     */
    function getBidId(Campaign storage _campaign) internal view returns(bytes32 _bidId){
        return _campaign.bidId;
    }
   
    /**
    @notice Set campaing price per proof of attention
    @param _price Price of the campaign
     */
    function setPrice(Campaign storage _campaign, uint _price) internal {
        _campaign.price = _price;
    }

    /**
    @notice Get campaign price per proof of attention
    @return {'_price' : 'Price of the campaign'}
     */
    function getPrice(Campaign storage _campaign) internal view returns(uint _price){
        return _campaign.price;
    }

    /**
    @notice Set campaign total budget 
    @param _budget Total budget of the campaign
     */
    function setBudget(Campaign storage _campaign, uint _budget) internal {
        _campaign.budget = _budget;
    }

    /**
    @notice Get campaign total budget
    @return {'_budget' : 'Total budget of the campaign'}
     */
    function getBudget(Campaign storage _campaign) internal view returns(uint _budget){
        return _campaign.budget;
    }

    /**
    @notice Set campaign start date 
    @param _startDate Start date of the campaign (in milisecounds)
     */
    function setStartDate(Campaign storage _campaign, uint _startDate) internal{
        _campaign.startDate = _startDate;
    }

    /**
    @notice Get campaign start date 
    @return {'_startDate' : 'Start date of the campaign (in milisecounds)'}
     */
    function getStartDate(Campaign storage _campaign) internal view returns(uint _startDate){
        return _campaign.startDate;
    }
 
    /**
    @notice Set campaign end date 
    @param _endDate End date of the campaign (in milisecounds)
     */
    function setEndDate(Campaign storage _campaign, uint _endDate) internal {
        _campaign.endDate = _endDate;
    }

    /**
    @notice Get campaign end date 
    @return {'_endDate' : 'End date of the campaign (in milisecounds)'}
     */
    function getEndDate(Campaign storage _campaign) internal view returns(uint _endDate){
        return _campaign.endDate;
    }

    /**
    @notice Set campaign validity 
    @param _valid Validity of the campaign
     */
    function setValidity(Campaign storage _campaign, bool _valid) internal {
        _campaign.valid = _valid;
    }

    /**
    @notice Get campaign validity 
    @return {'_valid' : 'Boolean stating campaign validity'}
     */
    function getValidity(Campaign storage _campaign) internal view returns(bool _valid){
        return _campaign.valid;
    }

    /**
    @notice Set campaign owner 
    @param _owner Owner of the campaign
     */
    function setOwner(Campaign storage _campaign, address _owner) internal {
        _campaign.owner = _owner;
    }

    /**
    @notice Get campaign owner 
    @return {'_owner' : 'Address of the owner of the campaign'}
     */
    function getOwner(Campaign storage _campaign) internal view returns(address _owner){
        return _campaign.owner;
    }

    /**
    @notice Converts country index list into 3 uints
       
        Expects a list of country indexes such that the 2 digit country code is converted to an 
        index. Countries are expected to be indexed so a "AA" country code is mapped to index 0 and 
        "ZZ" country is mapped to index 675.
    @param countries List of country indexes
    @return {
        "countries1" : "First third of the byte array converted in a 256 bytes uint",
        "countries2" : "Second third of the byte array converted in a 256 bytes uint",
        "countries3" : "Third third of the byte array converted in a 256 bytes uint"
    }
    */
    function convertCountryIndexToBytes(uint[] countries) public pure
        returns (uint countries1,uint countries2,uint countries3){
        countries1 = 0;
        countries2 = 0;
        countries3 = 0;
        for(uint i = 0; i < countries.length; i++){
            uint index = countries[i];

            if(index<256){
                countries1 = countries1 | uint(1) << index;
            } else if (index<512) {
                countries2 = countries2 | uint(1) << (index - 256);
            } else {
                countries3 = countries3 | uint(1) << (index - 512);
            }
        }

        return (countries1,countries2,countries3);
    }    
}


// AppCoins contract with share splitting among different wallets
// Not fully ERC20 compliant due to tests purposes


contract ERC20Interface {
    function name() public view returns(bytes32);
    function symbol() public view returns(bytes32);
    function balanceOf (address _owner) public view returns(uint256 balance);
    function transfer(address _to, uint256 _value) public returns (bool success);
    function transferFrom(address _from, address _to, uint256 _value) public returns (uint);
    event Transfer(address indexed _from, address indexed _to, uint256 _value);
}

contract AppCoins is ERC20Interface{
    // Public variables of the token
    address public owner;
    bytes32 private token_name;
    bytes32 private token_symbol;
    uint8 public decimals = 18;
    // 18 decimals is the strongly suggested default, avoid changing it
    uint256 public totalSupply;

    // This creates an array with all balances
    mapping (address => uint256) public balances;
    mapping (address => mapping (address => uint256)) public allowance;

    // This generates a public event on the blockchain that will notify clients
    event Transfer(address indexed from, address indexed to, uint256 value);

    // This notifies clients about the amount burnt
    event Burn(address indexed from, uint256 value);

    /**
     * Constrctor function
     *
     * Initializes contract with initial supply tokens to the creator of the contract
     */
    function AppCoins() public {
        owner = msg.sender;
        token_name = "AppCoins";
        token_symbol = "APPC";
        uint256 _totalSupply = 1000000;
        totalSupply = _totalSupply * 10 ** uint256(decimals);  // Update total supply with the decimal amount
        balances[owner] = totalSupply;                // Give the creator all initial tokens
    }

    function name() public view returns(bytes32) {
        return token_name;
    }

    function symbol() public view returns(bytes32) {
        return token_symbol;
    }

    function balanceOf (address _owner) public view returns(uint256 balance) {
        return balances[_owner];
    }

    /**
     * Internal transfer, only can be called by this contract
     */
    function _transfer(address _from, address _to, uint _value) internal returns (bool) {
        // Prevent transfer to 0x0 address. Use burn() instead
        require(_to != 0x0);
        // Check if the sender has enough
        require(balances[_from] >= _value);
        // Check for overflows
        require(balances[_to] + _value > balances[_to]);
        // Save this for an assertion in the future
        uint previousBalances = balances[_from] + balances[_to];
        // Subtract from the sender
        balances[_from] -= _value;
        // Add the same to the recipient
        balances[_to] += _value;
        emit Transfer(_from, _to, _value);
        // Asserts are used to use static analysis to find bugs in your code. They should never fail
        assert(balances[_from] + balances[_to] == previousBalances);
    }

    // /**
    //  * Transfer tokens
    //  *
    //  * Send `_value` tokens to `_to` from your account
    //  *
    //  * @param _to The address of the recipient
    //  * @param _value the amount to send
    //  */
    // function transfer(address _to, uint256 _value) public {
    //     _transfer(msg.sender, _to, _value);
    // }
    function transfer (address _to, uint256 _amount) public returns (bool success) {
        if( balances[msg.sender] >= _amount && _amount > 0 && balances[_to] + _amount > balances[_to]) {

            balances[msg.sender] -= _amount;
            balances[_to] += _amount;
            emit Transfer(msg.sender, _to, _amount);
            return true;
        } else {
            return false;
        }
    }

    /**
     * Transfer tokens from other address
     *
     * Send `_value` tokens to `_to` on behalf of `_from`
     *
     * @param _from The address of the sender
     * @param _to The address of the recipient
     * @param _value the amount to send
     */
    function transferFrom(address _from, address _to, uint256 _value) public returns (uint) {
        require(_value <= allowance[_from][msg.sender]);     // Check allowance
        allowance[_from][msg.sender] -= _value;
        _transfer(_from, _to, _value);
        return allowance[_from][msg.sender];
    }

    /**
     * Set allowance for other address
     *
     * Allows `_spender` to spend no more than `_value` tokens on your behalf
     *
     * @param _spender The address authorized to spend
     * @param _value the max amount they can spend
     */
    function approve(address _spender, uint256 _value) public
        returns (bool success) {
        allowance[msg.sender][_spender] = _value;
        return true;
    }

    /**
     * Destroy tokens
     *
     * Remove `_value` tokens from the system irreversibly
     *
     * @param _value the amount of money to burn
     */
    function burn(uint256 _value) public returns (bool success) {
        require(balances[msg.sender] >= _value);   // Check if the sender has enough
        balances[msg.sender] -= _value;            // Subtract from the sender
        totalSupply -= _value;                      // Updates totalSupply
        emit Burn(msg.sender, _value);
        return true;
    }

    /**
     * Destroy tokens from other account
     *
     * Remove `_value` tokens from the system irreversibly on behalf of `_from`.
     *
     * @param _from the address of the sender
     * @param _value the amount of money to burn
     */
    function burnFrom(address _from, uint256 _value) public returns (bool success) {
        require(balances[_from] >= _value);                // Check if the targeted balance is enough
        require(_value <= allowance[_from][msg.sender]);    // Check allowance
        balances[_from] -= _value;                         // Subtract from the targeted balance
        allowance[_from][msg.sender] -= _value;             // Subtract from the sender's allowance
        totalSupply -= _value;                              // Update totalSupply
        emit Burn(_from, _value);
        return true;
    }
}


/**
 * @title Ownable
 *   The Ownable contract has an owner address, and provides basic authorization control
 * functions, this simplifies the implementation of "user permissions".
 */
contract Ownable is ErrorThrower {
    address public owner;
    
    event OwnershipRenounced(address indexed previousOwner);
    event OwnershipTransferred(
        address indexed previousOwner,
        address indexed newOwner
    );


    /**
    *   The Ownable constructor sets the original `owner` of the contract to the sender
    * account.
    */
    constructor() public {
        owner = msg.sender;
    }

    /**
    *   Throws if called by any account other than the owner.
    */
    modifier onlyOwner(string _funcName) {
        if(msg.sender != owner){
            emit Error(_funcName,"Operation can only be performed by contract owner");
            return;
        }
        _;
    }

    /**
    *   Allows the current owner to relinquish control of the contract.
    * @notice Renouncing to ownership will leave the contract without an owner.
    * It will not be possible to call the functions with the `onlyOwner`
    * modifier anymore.
    */
    function renounceOwnership() public onlyOwner("renounceOwnership") {
        emit OwnershipRenounced(owner);
        owner = address(0);
    }

    /**
    *   Allows the current owner to transfer control of the contract to a newOwner.
    * @param _newOwner The address to transfer ownership to.
    */
    function transferOwnership(address _newOwner) public onlyOwner("transferOwnership") {
        _transferOwnership(_newOwner);
    }

    /**
    *   Transfers control of the contract to a newOwner.
    * @param _newOwner The address to transfer ownership to.
    */
    function _transferOwnership(address _newOwner) internal {
        if(_newOwner == address(0)){
            emit Error("transferOwnership","New owner's address needs to be different than 0x0");
            return;
        }

        emit OwnershipTransferred(owner, _newOwner);
        owner = _newOwner;
    }
}

/**
*  @title Whitelist
*    The Whitelist contract is based on OpenZeppelin's Whitelist contract.
*       Has a whitelist of addresses and provides basic authorization control functions.
*       This simplifies the implementation of "user permissions". The main change from 
*       Whitelist's original contract (version 1.12.0) is the use of Error event instead of a revert.
 */

contract Whitelist is Ownable, RBAC {
    string public constant ROLE_WHITELISTED = "whitelist";

    /**
    *   Throws Error event if operator is not whitelisted.
    * @param _operator address
    */
    modifier onlyIfWhitelisted(string _funcname, address _operator) {
        if(!hasRole(_operator, ROLE_WHITELISTED)){
            emit Error(_funcname, "Operation can only be performed by Whitelisted Addresses");
            return;
        }
        _;
    }

    /**
    *   add an address to the whitelist
    * @param _operator address
    * @return true if the address was added to the whitelist, false if the address was already in the whitelist
    */
    function addAddressToWhitelist(address _operator)
        public
        onlyOwner("addAddressToWhitelist")
    {
        addRole(_operator, ROLE_WHITELISTED);
    }

    /**
    *   getter to determine if address is in whitelist
    */
    function whitelist(address _operator)
        public
        view
        returns (bool)
    {
        return hasRole(_operator, ROLE_WHITELISTED);
    }

    /**
    *   add addresses to the whitelist
    * @param _operators addresses
    * @return true if at least one address was added to the whitelist,
    * false if all addresses were already in the whitelist
    */
    function addAddressesToWhitelist(address[] _operators)
        public
        onlyOwner("addAddressesToWhitelist")
    {
        for (uint256 i = 0; i < _operators.length; i++) {
            addAddressToWhitelist(_operators[i]);
        }
    }

    /**
    *   remove an address from the whitelist
    * @param _operator address
    * @return true if the address was removed from the whitelist,
    * false if the address wasn't in the whitelist in the first place
    */
    function removeAddressFromWhitelist(address _operator)
        public
        onlyOwner("removeAddressFromWhitelist")
    {
        removeRole(_operator, ROLE_WHITELISTED);
    }

    /**
    *   remove addresses from the whitelist
    * @param _operators addresses
    * @return true if at least one address was removed from the whitelist,
    * false if all addresses weren't in the whitelist in the first place
    */
    function removeAddressesFromWhitelist(address[] _operators)
        public
        onlyOwner("removeAddressesFromWhitelist")
    {
        for (uint256 i = 0; i < _operators.length; i++) {
            removeAddressFromWhitelist(_operators[i]);
        }
    }

}

contract BaseAdvertisementStorage is Whitelist {
    using CampaignLibrary for CampaignLibrary.Campaign;

    mapping (bytes32 => CampaignLibrary.Campaign) public campaigns;

    bytes32 public lastBidId = 0x0;

    modifier onlyIfCampaignExists(string _funcName, bytes32 _bidId) {
        if(campaigns[_bidId].owner == 0x0){
            emit Error(_funcName,"Campaign does not exist");
            return;
        }
        _;
    }
    
    event CampaignCreated
        (
            bytes32 bidId,
            uint price,
            uint budget,
            uint startDate,
            uint endDate,
            bool valid,
            address owner
    );

    event CampaignUpdated
        (
            bytes32 bidId,
            uint price,
            uint budget,
            uint startDate,
            uint endDate,
            bool valid,
            address  owner
    );

    /**
    @notice Get a Campaign information
      
        Based on a camapaign Id (bidId), returns all stored information for that campaign.
    @param campaignId Id of the campaign
    @return {
        "bidId" : "Id of the campaign",
        "price" : "Value to pay for each proof-of-attention",
        "budget" : "Total value avaliable to be spent on the campaign",
        "startDate" : "Start date of the campaign (in miliseconds)",
        "endDate" : "End date of the campaign (in miliseconds)"
        "valid" : "Boolean informing if the campaign is valid",
        "campOwner" : "Address of the campaing's owner"
    }
    */
    function _getCampaign(bytes32 campaignId)
        internal
        returns (CampaignLibrary.Campaign storage _campaign) {


        return campaigns[campaignId];
    }


    /**
    @notice Add or update a campaign information
     
        Based on a campaign Id (bidId), a campaign can be created (if non existent) or updated.
        This function can only be called by the set of allowed addresses registered earlier.
        An event will be emited during this function's execution, a CampaignCreated event if the 
        campaign does not exist yet or a CampaignUpdated if the campaign id is already registered.

    @param bidId Id of the campaign
    @param price Value to pay for each proof-of-attention
    @param budget Total value avaliable to be spent on the campaign
    @param startDate Start date of the campaign (in miliseconds)
    @param endDate End date of the campaign (in miliseconds)
    @param valid Boolean informing if the campaign is valid
    @param owner Address of the campaing's owner
    */
    function _setCampaign (
        bytes32 bidId,
        uint price,
        uint budget,
        uint startDate,
        uint endDate,
        bool valid,
        address owner
    )
    public
    onlyIfWhitelisted("setCampaign",msg.sender) {

        CampaignLibrary.Campaign storage campaign = campaigns[bidId];
        campaign.setBidId(bidId);
        campaign.setPrice(price);
        campaign.setBudget(budget);
        campaign.setStartDate(startDate);
        campaign.setEndDate(endDate);
        campaign.setValidity(valid);

        bool newCampaign = (campaigns[bidId].getOwner() == 0x0);

        campaign.setOwner(owner);



        if(newCampaign){
            emitCampaignCreated(campaign);
            setLastBidId(bidId);
        } else {
            emitCampaignUpdated(campaign);
        }
    }

    /**
    @notice Constructor function
     
        Initializes contract and updates allowed addresses to interact with contract functions.
    */
    constructor() public {
        addAddressToWhitelist(msg.sender);
    }

      /**
    @notice Get the price of a campaign
     
        Based on the Campaign id, return the value paid for each proof of attention registered.
    @param bidId Campaign id to which the query refers
    @return { "price" : "Reward (in wei) for each proof of attention registered"} 
    */
    function getCampaignPriceById(bytes32 bidId)
        public
        view
        returns (uint price) {
        return campaigns[bidId].getPrice();
    }

    /** 
    @notice Set a new price for a campaign
     
        Based on the Campaign id, updates the value paid for each proof of attention registered.
        This function can only be executed by allowed addresses and emits a CampaingUpdate event.
    @param bidId Campaing id to which the update refers
    @param price New price for each proof of attention
    */
    function setCampaignPriceById(bytes32 bidId, uint price)
        public
        onlyIfWhitelisted("setCampaignPriceById",msg.sender) 
        onlyIfCampaignExists("setCampaignPriceById",bidId)      
        {
        campaigns[bidId].setPrice(price);
        emitCampaignUpdated(campaigns[bidId]);
    }

    /**
    @notice Get the budget avaliable of a campaign
     
        Based on the Campaign id, return the total value avaliable to pay for proofs of attention.
    @param bidId Campaign id to which the query refers
    @return { "budget" : "Total value (in wei) spendable in proof of attention rewards"} 
    */
    function getCampaignBudgetById(bytes32 bidId)
        public
        view
        returns (uint budget) {
        return campaigns[bidId].getBudget();
    }

    /**
    @notice Set a new campaign budget
     
        Based on the Campaign id, updates the total value avaliable for proof of attention 
        registrations. This function can only be executed by allowed addresses and emits a 
        CampaignUpdated event. This function does not transfer any funds as this contract only works
        as a data repository, every logic needed will be processed in the Advertisement contract.
    @param bidId Campaign id to which the query refers
    @param newBudget New value for the total budget of the campaign
    */
    function setCampaignBudgetById(bytes32 bidId, uint newBudget)
        public
        onlyIfCampaignExists("setCampaignBudgetById",bidId)
        onlyIfWhitelisted("setCampaignBudgetById",msg.sender)
        {
        campaigns[bidId].setBudget(newBudget);
        emitCampaignUpdated(campaigns[bidId]);
    }

    /** 
    @notice Get the start date of a campaign
     
        Based on the Campaign id, return the value (in miliseconds) corresponding to the start Date
        of the campaign.
    @param bidId Campaign id to which the query refers
    @return { "startDate" : "Start date (in miliseconds) of the campaign"} 
    */
    function getCampaignStartDateById(bytes32 bidId)
        public
        view
        returns (uint startDate) {
        return campaigns[bidId].getStartDate();
    }

    /**
    @notice Set a new start date for a campaign
     
        Based of the Campaign id, updates the start date of a campaign. This function can only be 
        executed by allowed addresses and emits a CampaignUpdated event.
    @param bidId Campaign id to which the query refers
    @param newStartDate New value (in miliseconds) for the start date of the campaign
    */
    function setCampaignStartDateById(bytes32 bidId, uint newStartDate)
        public
        onlyIfCampaignExists("setCampaignStartDateById",bidId)
        onlyIfWhitelisted("setCampaignStartDateById",msg.sender)
        {
        campaigns[bidId].setStartDate(newStartDate);
        emitCampaignUpdated(campaigns[bidId]);
    }
    
    /** 
    @notice Get the end date of a campaign
     
        Based on the Campaign id, return the value (in miliseconds) corresponding to the end Date
        of the campaign.
    @param bidId Campaign id to which the query refers
    @return { "endDate" : "End date (in miliseconds) of the campaign"} 
    */
    function getCampaignEndDateById(bytes32 bidId)
        public
        view
        returns (uint endDate) {
        return campaigns[bidId].getEndDate();
    }

    /**
    @notice Set a new end date for a campaign
     
        Based of the Campaign id, updates the end date of a campaign. This function can only be 
        executed by allowed addresses and emits a CampaignUpdated event.
    @param bidId Campaign id to which the query refers
    @param newEndDate New value (in miliseconds) for the end date of the campaign
    */
    function setCampaignEndDateById(bytes32 bidId, uint newEndDate)
        public
        onlyIfCampaignExists("setCampaignEndDateById",bidId)
        onlyIfWhitelisted("setCampaignEndDateById",msg.sender)
        {
        campaigns[bidId].setEndDate(newEndDate);
        emitCampaignUpdated(campaigns[bidId]);
    }
    /** 
    @notice Get information regarding validity of a campaign.
     
        Based on the Campaign id, return a boolean which represents a valid campaign if it has 
        the value of True else has the value of False.
    @param bidId Campaign id to which the query refers
    @return { "valid" : "Validity of the campaign"} 
    */
    function getCampaignValidById(bytes32 bidId)
        public
        view
        returns (bool valid) {
        return campaigns[bidId].getValidity();
    }

    /**
    @notice Set a new campaign validity state.
     
        Updates the validity of a campaign based on a campaign Id. This function can only be 
        executed by allowed addresses and emits a CampaignUpdated event.
    @param bidId Campaign id to which the query refers
    @param isValid New value for the campaign validity
    */
    function setCampaignValidById(bytes32 bidId, bool isValid)
        public
        onlyIfCampaignExists("setCampaignValidById",bidId)
        onlyIfWhitelisted("setCampaignValidById",msg.sender)
        {
        campaigns[bidId].setValidity(isValid);
        emitCampaignUpdated(campaigns[bidId]);
    }

    /**
    @notice Get the owner of a campaign 
      
        Based on the Campaign id, return the address of the campaign owner.
    @param bidId Campaign id to which the query refers
    @return { "campOwner" : "Address of the campaign owner" } 
    */
    function getCampaignOwnerById(bytes32 bidId)
        public
        view
        returns (address campOwner) {
        return campaigns[bidId].getOwner();
    }

    /**
    @notice Set a new campaign owner 
     
        Based on the Campaign id, update the owner of the refered campaign. This function can only 
        be executed by allowed addresses and emits a CampaignUpdated event.
    @param bidId Campaign id to which the query refers
    @param newOwner New address to be the owner of the campaign
    */
    function setCampaignOwnerById(bytes32 bidId, address newOwner)
        public
        onlyIfCampaignExists("setCampaignOwnerById",bidId)
        onlyIfWhitelisted("setCampaignOwnerById",msg.sender)
        {
        campaigns[bidId].setOwner(newOwner);
        emitCampaignUpdated(campaigns[bidId]);
    }

    /**
    @notice Function to emit campaign updates
     
        It emits a CampaignUpdated event with the new campaign information. 
    */
    function emitCampaignUpdated(CampaignLibrary.Campaign storage campaign) private {
        emit CampaignUpdated(
            campaign.getBidId(),
            campaign.getPrice(),
            campaign.getBudget(),
            campaign.getStartDate(),
            campaign.getEndDate(),
            campaign.getValidity(),
            campaign.getOwner()
        );
    }

    /**
    @notice Function to emit campaign creations
     
        It emits a CampaignCreated event with the new campaign created. 
    */
    function emitCampaignCreated(CampaignLibrary.Campaign storage campaign) private {
        emit CampaignCreated(
            campaign.getBidId(),
            campaign.getPrice(),
            campaign.getBudget(),
            campaign.getStartDate(),
            campaign.getEndDate(),
            campaign.getValidity(),
            campaign.getOwner()
        );
    }

    /**
    @notice Internal function to set most recent bidId
     
        This value is stored to avoid conflicts between
        Advertisement contract upgrades.
    @param _newBidId Newer bidId
     */
    function setLastBidId(bytes32 _newBidId) internal {    
        lastBidId = _newBidId;
    }

    /**
    @notice Returns the greatest BidId ever registered to the contract
    @return { '_lastBidId' : 'Greatest bidId registered to the contract'}
     */
    function getLastBidId() 
        external 
        returns (bytes32 _lastBidId){
        
        return lastBidId;
    }
}


contract ExtendedAdvertisementStorage is BaseAdvertisementStorage {
    using ExtendedCampaignLibrary for ExtendedCampaignLibrary.ExtendedInfo;

    mapping (bytes32 => ExtendedCampaignLibrary.ExtendedInfo) public extendedCampaignInfo;
    
    event ExtendedCampaignCreated(
        bytes32 bidId,
        string endPoint
    );

    event ExtendedCampaignUpdated(
        bytes32 bidId,
        string endPoint
    );

    /**
    @notice Get a Campaign information
      
        Based on a camapaign Id (bidId), returns all stored information for that campaign.
    @param _campaignId Id of the campaign
    @return {
        "_bidId" : "Id of the campaign",
        "_price" : "Value to pay for each proof-of-attention",
        "_budget" : "Total value avaliable to be spent on the campaign",
        "_startDate" : "Start date of the campaign (in miliseconds)",
        "_endDate" : "End date of the campaign (in miliseconds)"
        "_valid" : "Boolean informing if the campaign is valid",
        "_campOwner" : "Address of the campaing's owner",
    }
    */
    function getCampaign(bytes32 _campaignId)
        public
        view
        returns (
            bytes32 _bidId,
            uint _price,
            uint _budget,
            uint _startDate,
            uint _endDate,
            bool _valid,
            address _campOwner
        ) {

        CampaignLibrary.Campaign storage campaign = _getCampaign(_campaignId);

        return (
            campaign.getBidId(),
            campaign.getPrice(),
            campaign.getBudget(),
            campaign.getStartDate(),
            campaign.getEndDate(),
            campaign.getValidity(),
            campaign.getOwner()
        );
    }

    /**
    @notice Add or update a campaign information
     
        Based on a campaign Id (bidId), a campaign can be created (if non existent) or updated.
        This function can only be called by the set of allowed addresses registered earlier.
        An event will be emited during this function's execution, a CampaignCreated and a 
        ExtendedCampaignEndPointCreated event if the campaign does not exist yet or a 
        CampaignUpdated and a ExtendedCampaignEndPointUpdated event if the campaign id is already 
        registered.

    @param _bidId Id of the campaign
    @param _price Value to pay for each proof-of-attention
    @param _budget Total value avaliable to be spent on the campaign
    @param _startDate Start date of the campaign (in miliseconds)
    @param _endDate End date of the campaign (in miliseconds)
    @param _valid Boolean informing if the campaign is valid
    @param _owner Address of the campaing's owner
    @param _endPoint URL of the signing serivce
    */
    function setCampaign (
        bytes32 _bidId,
        uint _price,
        uint _budget,
        uint _startDate,
        uint _endDate,
        bool _valid,
        address _owner,
        string _endPoint
    )
    public
    onlyIfWhitelisted("setCampaign",msg.sender) {
        
        bool newCampaign = (getCampaignOwnerById(_bidId) == 0x0);
        _setCampaign(_bidId, _price, _budget, _startDate, _endDate, _valid, _owner);
        
        ExtendedCampaignLibrary.ExtendedInfo storage extendedInfo = extendedCampaignInfo[_bidId];
        extendedInfo.setBidId(_bidId);
        extendedInfo.setEndpoint(_endPoint);

        extendedCampaignInfo[_bidId] = extendedInfo;

        if(newCampaign){
            emit ExtendedCampaignCreated(_bidId,_endPoint);
        } else {
            emit ExtendedCampaignUpdated(_bidId,_endPoint);
        }
    }

    /**
    @notice Get campaign signing web service endpoint
     
        Get the end point to which the user should submit the proof of attention to be signed
    @param _bidId Id of the campaign
    @return { "_endPoint": "URL for the signing web service"}
    */

    function getCampaignEndPointById(bytes32 _bidId) 
        public returns (string _endPoint){
        return extendedCampaignInfo[_bidId].getEndpoint();
    }

    /**
    @notice Set campaign signing web service endpoint
     
        Sets the webservice's endpoint to which the user should submit the proof of attention
    @param _bidId Id of the campaign
    @param _endPoint URL for the signing web service
    */
    function setCampaignEndPointById(bytes32 _bidId, string _endPoint) 
        public 
        onlyIfCampaignExists("setCampaignEndPointById",_bidId)
        onlyIfWhitelisted("setCampaignEndPointById",msg.sender) 
        {
        extendedCampaignInfo[_bidId].setEndpoint(_endPoint);
        emit ExtendedCampaignUpdated(_bidId, _endPoint);
    }

}

contract SingleAllowance is Ownable {

    address public allowedAddress;

    modifier onlyAllowed() {
        require(allowedAddress == msg.sender);
        _;
    }

    modifier onlyOwnerOrAllowed() {
        require(owner == msg.sender || allowedAddress == msg.sender);
        _;
    }

    function setAllowedAddress(address _addr) public onlyOwner("setAllowedAddress"){
        allowedAddress = _addr;
    }
}

contract BaseFinance is SingleAllowance {

    mapping (address => uint256) public balanceUsers;
    mapping (address => bool) public userExists;

    address[] public users;

    address public advStorageContract;

    AppCoins public appc;

    /**
    @notice Constructor function
      
        Initializes contract with the AppCoins contract address
    @param _addrAppc Address of the AppCoins (ERC-20) contract
    */
    constructor (address _addrAppc) 
        public {
        appc = AppCoins(_addrAppc);
        advStorageContract = 0x0;
    }


    /**
    @notice Sets the Storage contract address used by the allowed contract
     
        The Storage contract address is mostly used as part of a failsafe mechanism to
        ensure contract upgrades are executed using the same Storage 
        contract. This function returns every value of AppCoins stored in this contract to their 
        owners. This function can only be called by the 
        Finance contract owner or by the allowed contract registered earlier in 
        this contract.
    @param _addrStorage Address of the new Storage contract
    */
    function setAdsStorageAddress (address _addrStorage) external onlyOwnerOrAllowed {
        reset();
        advStorageContract = _addrStorage;
    }

        /**
    @notice Sets the Advertisement contract address to allow calls from Advertisement contract
     
        This function is used for upgrading the Advertisement contract without need to redeploy 
        Advertisement Finance and Advertisement Storage contracts. The function can only be called 
        by this contract's owner. During the update of the Advertisement contract address, the 
        contract for Advertisement Storage used by the new Advertisement contract is checked. 
        This function reverts if the new Advertisement contract does not use the same Advertisement 
        Storage contract earlier registered in this Advertisement Finance contract.
    @param _addr Address of the newly allowed contract 
    */
    function setAllowedAddress (address _addr) public onlyOwner("setAllowedAddress") {
        // Verify if the new Ads contract is using the same storage as before 
        if (allowedAddress != 0x0){
            StorageUser storageUser = StorageUser(_addr);
            address storageContract = storageUser.getStorageAddress();
            require (storageContract == advStorageContract);
        }
        
        //Update contract
        super.setAllowedAddress(_addr);
    }

    /**
    @notice Increases balance of a user
     
        This function can only be called by the registered Advertisement contract and increases the 
        balance of a specific user on this contract. This function does not transfer funds, 
        this step need to be done earlier by the Advertisement contract. This function can only be 
        called by the registered Advertisement contract.
    @param _user Address of the user who will receive a balance increase
    @param _value Value of coins to increase the user's balance
    */
    function increaseBalance(address _user, uint256 _value) 
        public onlyAllowed{

        if(userExists[_user] == false){
            users.push(_user);
            userExists[_user] = true;
        }

        balanceUsers[_user] = SafeMath.add(balanceUsers[_user], _value);
    }

     /**
    @notice Transfers coins from a certain user to a destination address
     
        Used to release a certain value of coins from a certain user to a destination address.
        This function updates the user's balance in the contract. It can only be called by the 
        Advertisement contract registered.
    @param _user Address of the user from which the value will be subtracted
    @param _destination Address receiving the value transfered
    @param _value Value to be transfered in AppCoins
    */
    function pay(address _user, address _destination, uint256 _value) public onlyAllowed;

    /**
    @notice Withdraws a certain value from a user's balance back to the user's account
     
        Can be called from the Advertisement contract registered or by this contract's owner.
    @param _user Address of the user
    @param _value Value to be transfered in AppCoins
    */
    function withdraw(address _user, uint256 _value) public onlyOwnerOrAllowed;


    /**
    @notice Resets this contract and returns every amount deposited to each user registered
     
        This function is used in case a contract reset is needed or the contract needs to be 
        deactivated. Thus returns every fund deposited to it's respective owner.
    */
    function reset() public onlyOwnerOrAllowed {
        for(uint i = 0; i < users.length; i++){
            withdraw(users[i],balanceUsers[users[i]]);
        }
    }
    /**
    @notice Transfers all funds of the contract to a single address
     
        This function is used for finance contract upgrades in order to be more cost efficient.
    @param _destination Address receiving the funds
     */
    function transferAllFunds(address _destination) public onlyAllowed {
        uint256 balance = appc.balanceOf(address(this));
        appc.transfer(_destination,balance);
    }

      /**
    @notice Get balance of coins stored in the contract by a specific user
     
        This function can only be called by the Advertisement contract
    @param _user Developer's address
    @return { '_balance' : 'Balance of coins deposited in the contract by the address' }
    */
    function getUserBalance(address _user) public view onlyAllowed returns(uint256 _balance){
        return balanceUsers[_user];
    }

    /**
    @notice Get list of users with coins stored in the contract 
     
        This function can only be called by the Advertisement contract        
    @return { '_userList' : ' List of users registered in the contract'}
    */
    function getUserList() public view onlyAllowed returns(address[] _userList){
        return users;
    }
}

/**
@title Advertisement Finance contract
@author App Store Foundation
  The Advertisement Finance contract works as part of the user aquisition flow of the
Advertisemnt contract. This contract is responsible for storing all the amount of AppCoins destined
to user aquisition campaigns.
*/
contract ExtendedFinance is BaseFinance {

    mapping ( address => uint256 ) public rewardedBalance;

    constructor(address _appc) public BaseFinance(_appc){

    }


    function pay(address _user, address _destination, uint256 _value)
        public onlyAllowed{

        require(balanceUsers[_user] >= _value);

        balanceUsers[_user] = SafeMath.sub(balanceUsers[_user], _value);
        rewardedBalance[_destination] = SafeMath.add(rewardedBalance[_destination],_value);
    }


    function withdraw(address _user, uint256 _value) public onlyOwnerOrAllowed {

        require(balanceUsers[_user] >= _value);

        balanceUsers[_user] = SafeMath.sub(balanceUsers[_user], _value);
        appc.transfer(_user, _value);

    }

    /**
    @notice Withdraws user's rewards
     
        Function to transfer a certain user's rewards to his address 
    @param _user Address who's rewards will be withdrawn
    @param _value Value of the withdraws which will be transfered to the user 
    */
    function withdrawRewards(address _user, uint256 _value) public onlyOwnerOrAllowed {
        require(rewardedBalance[_user] >= _value);

        rewardedBalance[_user] = SafeMath.sub(rewardedBalance[_user],_value);
        appc.transfer(_user, _value);
    }
    /**
    @notice Get user's rewards balance
     
        Function returning a user's rewards balance not yet withdrawn
    @param _user Address of the user
    @return { "_balance" : "Rewards balance of the user" }
    */
    function getRewardsBalance(address _user) public onlyOwnerOrAllowed returns (uint256 _balance) {
        return rewardedBalance[_user];
    }

}

/**
@title Base Advertisement contract
@author App Store Foundation
  Abstract contract for user aquisition campaign contracts.
 */
contract BaseAdvertisement is StorageUser,Ownable {
    
    AppCoins public appc;
    BaseFinance public advertisementFinance;
    BaseAdvertisementStorage public advertisementStorage;

    mapping( bytes32 => mapping(address => uint256)) public userAttributions;

    bytes32[] public bidIdList;
    bytes32 public lastBidId = 0x0;


    /**
    @notice Constructor function
     
        Initializes contract with default validation rules
    @param _addrAppc Address of the AppCoins (ERC-20) contract
    @param _addrAdverStorage Address of the Advertisement Storage contract to be used
    @param _addrAdverFinance Address of the Advertisement Finance contract to be used
    */
    constructor(address _addrAppc, address _addrAdverStorage, address _addrAdverFinance) public {
        appc = AppCoins(_addrAppc);

        advertisementStorage = BaseAdvertisementStorage(_addrAdverStorage);
        advertisementFinance = BaseFinance(_addrAdverFinance);
        lastBidId = advertisementStorage.getLastBidId();
    }



    /**
    @notice Import existing bidIds
     
        Method to import existing BidId list from an existing BaseAdvertisement contract
        Be careful, this function does not chcek for duplicates.
    @param _addrAdvert Address of the existing Advertisement contract from which the bidIds
     will be imported  
    */

    function importBidIds(address _addrAdvert) public onlyOwner("importBidIds") {

        bytes32[] memory _bidIdsToImport = BaseAdvertisement(_addrAdvert).getBidIdList();
        bytes32 _lastStorageBidId = advertisementStorage.getLastBidId();

        for (uint i = 0; i < _bidIdsToImport.length; i++) {
            bidIdList.push(_bidIdsToImport[i]);
        }
        
        if(lastBidId < _lastStorageBidId) {
            lastBidId = _lastStorageBidId;
        }
    }

    /**
    @notice Upgrade finance contract used by this contract
     
        This function is part of the upgrade mechanism avaliable to the advertisement contracts.
        Using this function it is possible to update to a new Advertisement Finance contract without
        the need to cancel avaliable campaigns.
        Upgrade finance function can only be called by the Advertisement contract owner.
    @param addrAdverFinance Address of the new Advertisement Finance contract
    */
    function upgradeFinance (address addrAdverFinance) public onlyOwner("upgradeFinance") {
        BaseFinance newAdvFinance = BaseFinance(addrAdverFinance);

        address[] memory devList = advertisementFinance.getUserList();
        
        for(uint i = 0; i < devList.length; i++){
            uint balance = advertisementFinance.getUserBalance(devList[i]);
            newAdvFinance.increaseBalance(devList[i],balance);
        }
        
        uint256 initBalance = appc.balanceOf(address(advertisementFinance));
        advertisementFinance.transferAllFunds(address(newAdvFinance));
        uint256 oldBalance = appc.balanceOf(address(advertisementFinance));
        uint256 newBalance = appc.balanceOf(address(newAdvFinance));
        
        require(initBalance == newBalance);
        require(oldBalance == 0);
        advertisementFinance = newAdvFinance;
    }

    /**
    @notice Upgrade storage contract used by this contract
     
        Upgrades Advertisement Storage contract addres with no need to redeploy
        Advertisement contract. However every campaign in the old contract will
        be canceled.
        This function can only be called by the Advertisement contract owner.
    @param addrAdverStorage Address of the new Advertisement Storage contract
    */

    function upgradeStorage (address addrAdverStorage) public onlyOwner("upgradeStorage") {
        for(uint i = 0; i < bidIdList.length; i++) {
            cancelCampaign(bidIdList[i]);
        }
        delete bidIdList;

        lastBidId = advertisementStorage.getLastBidId();
        advertisementFinance.setAdsStorageAddress(addrAdverStorage);
        advertisementStorage = BaseAdvertisementStorage(addrAdverStorage);
    }

    /**
    @notice Get Advertisement Storage Address used by this contract
     
        This function is required to upgrade Advertisement contract address on Advertisement
        Finance contract.
    @return {
        "_storage" : "Address of the Advertisement Storage contract used by this contract"
        }
    */

    function getStorageAddress() external view returns(address _storage) {

        return advertisementStorage;
    }


    /**
    @notice Creates a campaign 
      
        Method to create a campaign of user aquisition for a certain application.
        This method will emit a Campaign Information event with every information 
        provided in the arguments of this method.
    @param packageName Package name of the appication subject to the user aquisition campaign
    @param countries Encoded list of 3 integers intended to include every 
    county where this campaign will be avaliable.
    For more detain on this encoding refer to wiki documentation.
    @param vercodes List of version codes to which the user aquisition campaign is applied.
    @param price Value (in wei) the campaign owner pays for each proof-of-attention.
    @param budget Total budget (in wei) the campaign owner will deposit 
    to pay for the proof-of-attention.
    @param startDate Date (in miliseconds) on which the campaign will start to be 
    avaliable to users.
    @param endDate Date (in miliseconds) on which the campaign will no longer be avaliable to users.
    */

    function _generateCampaign (
        string packageName,
        uint[3] countries,
        uint[] vercodes,
        uint price,
        uint budget,
        uint startDate,
        uint endDate)
        internal returns (CampaignLibrary.Campaign memory) {

        require(budget >= price);
        require(endDate >= startDate);


        //Transfers the budget to contract address
        if(appc.allowance(msg.sender, address(this)) >= budget){
            appc.transferFrom(msg.sender, address(advertisementFinance), budget);

            advertisementFinance.increaseBalance(msg.sender,budget);

            uint newBidId = bytesToUint(lastBidId);
            lastBidId = uintToBytes(++newBidId);
            

            CampaignLibrary.Campaign memory newCampaign;
            newCampaign.price = price;
            newCampaign.startDate = startDate;
            newCampaign.endDate = endDate;
            newCampaign.budget = budget;
            newCampaign.owner = msg.sender;
            newCampaign.valid = true;
            newCampaign.bidId = lastBidId;
        } else {
            emit Error("createCampaign","Not enough allowance");
        }
        
        return newCampaign;
    }

    function _getStorage() internal returns (BaseAdvertisementStorage) {
        return advertisementStorage;
    }

    function _getFinance() internal returns (BaseFinance) {
        return advertisementFinance;
    }

    function _setUserAttribution(bytes32 _bidId,address _user,uint256 _attributions) internal{
        userAttributions[_bidId][_user] = _attributions;
    }


    function getUserAttribution(bytes32 _bidId,address _user) internal returns (uint256) {
        return userAttributions[_bidId][_user];
    }

    /**
    @notice Cancel a campaign and give the remaining budget to the campaign owner
     
        When a campaing owner wants to cancel a campaign, the campaign owner needs
        to call this function. This function can only be called either by the campaign owner or by
        the Advertisement contract owner. This function results in campaign cancelation and
        retreival of the remaining budget to the respective campaign owner.
    @param bidId Campaign id to which the cancelation referes to
     */
    function cancelCampaign (bytes32 bidId) public {
        address campaignOwner = getOwnerOfCampaign(bidId);

		// Only contract owner or campaign owner can cancel a campaign
        require(owner == msg.sender || campaignOwner == msg.sender);
        uint budget = getBudgetOfCampaign(bidId);

        advertisementFinance.withdraw(campaignOwner, budget);

        advertisementStorage.setCampaignBudgetById(bidId, 0);
        advertisementStorage.setCampaignValidById(bidId, false);
    }

     /**
    @notice Get a campaign validity state
    @param bidId Campaign id to which the query refers
    @return { "state" : "Validity of the campaign"}
    */
    function getCampaignValidity(bytes32 bidId) public view returns(bool state){
        return advertisementStorage.getCampaignValidById(bidId);
    }

    /**
    @notice Get the price of a campaign
     
        Based on the Campaign id return the value paid for each proof of attention registered.
    @param bidId Campaign id to which the query refers
    @return { "price" : "Reward (in wei) for each proof of attention registered"}
    */
    function getPriceOfCampaign (bytes32 bidId) public view returns(uint price) {
        return advertisementStorage.getCampaignPriceById(bidId);
    }

    /**
    @notice Get the start date of a campaign
     
        Based on the Campaign id return the value (in miliseconds) corresponding to the start Date
        of the campaign.
    @param bidId Campaign id to which the query refers
    @return { "startDate" : "Start date (in miliseconds) of the campaign"}
    */
    function getStartDateOfCampaign (bytes32 bidId) public view returns(uint startDate) {
        return advertisementStorage.getCampaignStartDateById(bidId);
    }

    /**
    @notice Get the end date of a campaign
     
        Based on the Campaign id return the value (in miliseconds) corresponding to the end Date
        of the campaign.
    @param bidId Campaign id to which the query refers
    @return { "endDate" : "End date (in miliseconds) of the campaign"}
    */
    function getEndDateOfCampaign (bytes32 bidId) public view returns(uint endDate) {
        return advertisementStorage.getCampaignEndDateById(bidId);
    }

    /**
    @notice Get the budget avaliable of a campaign
     
        Based on the Campaign id return the total value avaliable to pay for proofs of attention.
    @param bidId Campaign id to which the query refers
    @return { "budget" : "Total value (in wei) spendable in proof of attention rewards"}
    */
    function getBudgetOfCampaign (bytes32 bidId) public view returns(uint budget) {
        return advertisementStorage.getCampaignBudgetById(bidId);
    }


    /**
    @notice Get the owner of a campaign
     
        Based on the Campaign id return the address of the campaign owner
    @param bidId Campaign id to which the query refers
    @return { "campaignOwner" : "Address of the campaign owner" }
    */
    function getOwnerOfCampaign (bytes32 bidId) public view returns(address campaignOwner) {
        return advertisementStorage.getCampaignOwnerById(bidId);
    }

    /**
    @notice Get the list of Campaign BidIds registered in the contract
     
        Returns the list of BidIds of the campaigns ever registered in the contract
    @return { "bidIds" : "List of BidIds registered in the contract" }
    */
    function getBidIdList() public view returns(bytes32[] bidIds) {
        return bidIdList;
    }

    function _getBidIdList() internal returns(bytes32[] storage bidIds){
        return bidIdList;
    }

    /**
    @notice Check if a certain campaign is still valid
     
        Returns a boolean representing the validity of the campaign
        Has value of True if the campaign is still valid else has value of False
    @param bidId Campaign id to which the query refers
    @return { "valid" : "validity of the campaign" }
    */
    function isCampaignValid(bytes32 bidId) public view returns(bool valid) {
        uint startDate = advertisementStorage.getCampaignStartDateById(bidId);
        uint endDate = advertisementStorage.getCampaignEndDateById(bidId);
        bool validity = advertisementStorage.getCampaignValidById(bidId);

        uint nowInMilliseconds = now * 1000;
        return validity && startDate < nowInMilliseconds && endDate > nowInMilliseconds;
    }

    /**
    @notice Converts a uint256 type variable to a byte32 type variable
     
        Mostly used internaly
    @param i number to be converted
    @return { "b" : "Input number converted to bytes"}
    */
    function uintToBytes (uint256 i) public view returns(bytes32 b) {
        b = bytes32(i);
    }

    function bytesToUint(bytes32 b) public view returns (uint) 
    {
        return uint(b) & 0xfff;
    }

}

contract ExtendedAdvertisement is BaseAdvertisement, Whitelist {

    event BulkPoARegistered(bytes32 _bidId, bytes _rootHash, bytes _signature, uint256 _newHashes, uint256 _effectiveConversions);
    event SinglePoARegistered(bytes32 _bidId, bytes _timestampAndHash, bytes _signature);
    event CampaignInformation
        (
            bytes32 bidId,
            address  owner,
            string ipValidator,
            string packageName,
            uint[3] countries,
            uint[] vercodes
    );
    event ExtendedCampaignInfo
        (
            bytes32 bidId,
            string endPoint
    );

    constructor(address _addrAppc, address _addrAdverStorage, address _addrAdverFinance) public
        BaseAdvertisement(_addrAppc,_addrAdverStorage,_addrAdverFinance) {
        addAddressToWhitelist(msg.sender);
    }


    /**
    @notice Creates an extebded campaign
     
        Method to create an extended campaign of user aquisition for a certain application.
        This method will emit a Campaign Information event with every information
        provided in the arguments of this method.
    @param packageName Package name of the appication subject to the user aquisition campaign
    @param countries Encoded list of 3 integers intended to include every
    county where this campaign will be avaliable.
    For more detain on this encoding refer to wiki documentation.
    @param vercodes List of version codes to which the user aquisition campaign is applied.
    @param price Value (in wei) the campaign owner pays for each proof-of-attention.
    @param budget Total budget (in wei) the campaign owner will deposit
    to pay for the proof-of-attention.
    @param startDate Date (in miliseconds) on which the campaign will start to be
    avaliable to users.
    @param endDate Date (in miliseconds) on which the campaign will no longer be avaliable to users.
    @param endPoint URL of the signing serivce
    */
    function createCampaign (
        string packageName,
        uint[3] countries,
        uint[] vercodes,
        uint price,
        uint budget,
        uint startDate,
        uint endDate,
        string endPoint)
        external
        {

        CampaignLibrary.Campaign memory newCampaign = _generateCampaign(packageName, countries, vercodes, price, budget, startDate, endDate);

        if(newCampaign.owner == 0x0){
            // campaign was not generated correctly (revert)
            return;
        }

        _getBidIdList().push(newCampaign.bidId);

        ExtendedAdvertisementStorage(address(_getStorage())).setCampaign(
            newCampaign.bidId,
            newCampaign.price,
            newCampaign.budget,
            newCampaign.startDate,
            newCampaign.endDate,
            newCampaign.valid,
            newCampaign.owner,
            endPoint);

        emit CampaignInformation(
            newCampaign.bidId,
            newCampaign.owner,
            "", // ipValidator field
            packageName,
            countries,
            vercodes);

        emit ExtendedCampaignInfo(newCampaign.bidId, endPoint);
    }

    /**
    @notice Function to submit in bulk PoAs
     
        This function can only be called by whitelisted addresses and provides a cost efficient
        method to submit a batch of validates PoAs at once. This function emits a PoaRegistered
        event containing the campaign id, root hash, signed root hash, number of new hashes since
        the last submission and the effective number of conversions.

    @param _bidId Campaign id for which the Proof of attention root hash refferes to
    @param _rootHash Root hash of all submitted proof of attention to a given campaign
    @param _signature Root hash signed by the signing service of the campaign
    @param _newHashes Number of new proof of attention hashes since last submission
    */
    function bulkRegisterPoA(bytes32 _bidId, bytes _rootHash, bytes _signature, uint256 _newHashes)
        public
        onlyIfWhitelisted("createCampaign", msg.sender)
        {

        uint price = _getStorage().getCampaignPriceById(_bidId);
        uint budget = _getStorage().getCampaignBudgetById(_bidId);
        address owner = _getStorage().getCampaignOwnerById(_bidId);
        uint maxConversions = SafeMath.div(budget,price);
        uint effectiveConversions;
        uint totalPay;
        uint newBudget;

        if (maxConversions >= _newHashes){
            effectiveConversions = _newHashes;
        } else {
            effectiveConversions = maxConversions;
        }

        totalPay = SafeMath.mul(price,effectiveConversions);
        
        newBudget = SafeMath.sub(budget,totalPay);

        _getFinance().pay(owner, msg.sender, totalPay);
        _getStorage().setCampaignBudgetById(_bidId, newBudget);

        if(newBudget < price){
            _getStorage().setCampaignValidById(_bidId, false);
        }

        emit BulkPoARegistered(_bidId, _rootHash, _signature, _newHashes, effectiveConversions);
    }

    /**
    @notice Function to withdraw PoA convertions
     
        This function is restricted to addresses allowed to submit bulk PoAs and enable those
        addresses to withdraw funds previously collected by bulk PoA submissions
    */

    function withdraw()
        public
        onlyIfWhitelisted("withdraw",msg.sender)
        {
        uint256 balance = ExtendedFinance(address(_getFinance())).getRewardsBalance(msg.sender);
        ExtendedFinance(address(_getFinance())).withdrawRewards(msg.sender,balance);
    }
    /**
    @notice Get user's balance of funds obtainded by rewards
     
        Anyone can call this function and get the rewards balance of a certain user.
    @param _user Address from which the balance refers to
    @return { "_balance" : "" } */
    function getRewardsBalance(address _user) public view returns (uint256 _balance) {
        return ExtendedFinance(address(_getFinance())).getRewardsBalance(_user);
    }

    /**
    @notice Returns the signing Endpoint of a camapign
     
        Function returning the Webservice URL responsible for validating and signing a PoA
    @param bidId Campaign id to which the Endpoint is associated
    @return { "url" : "Validation and signature endpoint"}
    */

    function getEndPointOfCampaign (bytes32 bidId) public view returns (string url){
        return ExtendedAdvertisementStorage(address(_getStorage())).getCampaignEndPointById(bidId);
    }
}

Contract Security Audit

Contract ABI

[{"constant":true,"inputs":[{"name":"bidId","type":"bytes32"}],"name":"getEndPointOfCampaign","outputs":[{"name":"url","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_operator","type":"address"},{"name":"_role","type":"string"}],"name":"checkRole","outputs":[],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"ROLE_WHITELISTED","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"bidId","type":"bytes32"}],"name":"getEndDateOfCampaign","outputs":[{"name":"endDate","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_operator","type":"address"},{"name":"_role","type":"string"}],"name":"hasRole","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_bidId","type":"bytes32"},{"name":"_rootHash","type":"bytes"},{"name":"_signature","type":"bytes"},{"name":"_newHashes","type":"uint256"}],"name":"bulkRegisterPoA","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_operators","type":"address[]"}],"name":"removeAddressesFromWhitelist","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_operator","type":"address"}],"name":"removeAddressFromWhitelist","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"getStorageAddress","outputs":[{"name":"_storage","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"withdraw","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"","type":"bytes32"},{"name":"","type":"address"}],"name":"userAttributions","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"appc","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getBidIdList","outputs":[{"name":"bidIds","type":"bytes32[]"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"bidId","type":"bytes32"}],"name":"getPriceOfCampaign","outputs":[{"name":"price","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"bidId","type":"bytes32"}],"name":"getCampaignValidity","outputs":[{"name":"state","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"addrAdverFinance","type":"address"}],"name":"upgradeFinance","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_addrAdvert","type":"address"}],"name":"importBidIds","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"renounceOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_operator","type":"address"}],"name":"addAddressToWhitelist","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"packageName","type":"string"},{"name":"countries","type":"uint256[3]"},{"name":"vercodes","type":"uint256[]"},{"name":"price","type":"uint256"},{"name":"budget","type":"uint256"},{"name":"startDate","type":"uint256"},{"name":"endDate","type":"uint256"},{"name":"endPoint","type":"string"}],"name":"createCampaign","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"addrAdverStorage","type":"address"}],"name":"upgradeStorage","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"advertisementStorage","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_user","type":"address"}],"name":"getRewardsBalance","outputs":[{"name":"_balance","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"i","type":"uint256"}],"name":"uintToBytes","outputs":[{"name":"b","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_operator","type":"address"}],"name":"whitelist","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"bidId","type":"bytes32"}],"name":"getOwnerOfCampaign","outputs":[{"name":"campaignOwner","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"bidIdList","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"b","type":"bytes32"}],"name":"bytesToUint","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"bidId","type":"bytes32"}],"name":"isCampaignValid","outputs":[{"name":"valid","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"bidId","type":"bytes32"}],"name":"cancelCampaign","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_operators","type":"address[]"}],"name":"addAddressesToWhitelist","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"bidId","type":"bytes32"}],"name":"getStartDateOfCampaign","outputs":[{"name":"startDate","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"bidId","type":"bytes32"}],"name":"getBudgetOfCampaign","outputs":[{"name":"budget","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"lastBidId","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"advertisementFinance","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"inputs":[{"name":"_addrAppc","type":"address"},{"name":"_addrAdverStorage","type":"address"},{"name":"_addrAdverFinance","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"name":"_bidId","type":"bytes32"},{"indexed":false,"name":"_rootHash","type":"bytes"},{"indexed":false,"name":"_signature","type":"bytes"},{"indexed":false,"name":"_newHashes","type":"uint256"},{"indexed":false,"name":"_effectiveConversions","type":"uint256"}],"name":"BulkPoARegistered","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"_bidId","type":"bytes32"},{"indexed":false,"name":"_timestampAndHash","type":"bytes"},{"indexed":false,"name":"_signature","type":"bytes"}],"name":"SinglePoARegistered","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"bidId","type":"bytes32"},{"indexed":false,"name":"owner","type":"address"},{"indexed":false,"name":"ipValidator","type":"string"},{"indexed":false,"name":"packageName","type":"string"},{"indexed":false,"name":"countries","type":"uint256[3]"},{"indexed":false,"name":"vercodes","type":"uint256[]"}],"name":"CampaignInformation","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"bidId","type":"bytes32"},{"indexed":false,"name":"endPoint","type":"string"}],"name":"ExtendedCampaignInfo","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"operator","type":"address"},{"indexed":false,"name":"role","type":"string"}],"name":"RoleAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"operator","type":"address"},{"indexed":false,"name":"role","type":"string"}],"name":"RoleRemoved","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"previousOwner","type":"address"}],"name":"OwnershipRenounced","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"previousOwner","type":"address"},{"indexed":true,"name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"func","type":"string"},{"indexed":false,"name":"message","type":"string"}],"name":"Error","type":"event"}]

608060405260006001026006906000191690553480156200001f57600080fd5b5060405160608062005a5d833981018060405281019080805190602001909291908051906020019092919080519060200190929190505050828282336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555082600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555081600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166360b4a8fd6040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b158015620001e457600080fd5b505af1158015620001f9573d6000803e3d6000fd5b505050506040513d60208110156200021057600080fd5b810190808051906020019092919050505060068160001916905550505050620002483362000251640100000000026401000000009004565b505050620005de565b6040805190810160405280601581526020017f61646441646472657373546f57686974656c69737400000000000000000000008152506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515620003e2577fac283f5b35fa78f7f5e8923cb5db86b4c10c166580c43bb59f1d1d9ae108b70081604051808060200180602001838103835284818151815260200191508051906020019080838360005b838110156200034657808201518184015260208101905062000329565b50505050905090810190601f168015620003745780820380516001836020036101000a031916815260200191505b50838103825260318152602001807f4f7065726174696f6e2063616e206f6e6c7920626520706572666f726d65642081526020017f627920636f6e7472616374206f776e6572000000000000000000000000000000815250604001935050505060405180910390a162000433565b62000432826040805190810160405280600981526020017f77686974656c697374000000000000000000000000000000000000000000000081525062000437640100000000026401000000009004565b5b5050565b620004c6826007836040518082805190602001908083835b6020831015156200047657805182526020820191506020810190506020830392506200044f565b6001836020036101000a0380198251168184511680821785525050505050509050019150509081526020016040518091039020620005806401000000000262005346179091906401000000009004565b8173ffffffffffffffffffffffffffffffffffffffff167fbfec83d64eaa953f2708271a023ab9ee82057f8f3578d548c1a4ba0b5b700489826040518080602001828103825283818151815260200191508051906020019080838360005b838110156200054157808201518184015260208101905062000524565b50505050905090810190601f1680156200056f5780820380516001836020036101000a031916815260200191505b509250505060405180910390a25050565b60018260000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b61546f80620005ee6000396000f3006080604052600436106101cd576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063060b2128146101d25780630988ca8c1461027c57806318b919e9146103055780631f16c8b914610395578063217fe6c6146103da57806322c43af81461047b57806324953eaa14610542578063286dd3f5146105a8578063393a4d34146105eb5780633ccfd60b1461064257806344b7f6b9146106595780634826a69f146106be5780634f51bf461461071557806363735598146107815780636904c104146107c65780636b128b2f1461080f57806370a640aa14610852578063715018a6146108955780637b9417c8146108ac57806382a0ad4d146108ef57806382bfa9f21461098c578063875b40ea146109cf5780638a67f4bf14610a265780638da5cb5b14610a7d57806394e8767d14610ad45780639b19251a14610b1d578063ad36c59314610b78578063adacc54a14610be9578063cfc5a96914610c32578063dd16d98114610c77578063df8bb14014610cc0578063e2ec6ec314610cf1578063e55c6d0714610d57578063e83400f614610d9c578063ef78e28b14610de1578063f2fde38b14610e14578063f5beeaaf14610e57575b600080fd5b3480156101de57600080fd5b506102016004803603810190808035600019169060200190929190505050610eae565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610241578082015181840152602081019050610226565b50505050905090810190601f16801561026e5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561028857600080fd5b50610303600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290505050610fc6565b005b34801561031157600080fd5b5061031a611047565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561035a57808201518184015260208101905061033f565b50505050905090810190601f1680156103875780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156103a157600080fd5b506103c46004803603810190808035600019169060200190929190505050611080565b6040518082815260200191505060405180910390f35b3480156103e657600080fd5b50610461600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919291929050505061115d565b604051808215151515815260200191505060405180910390f35b34801561048757600080fd5b506105406004803603810190808035600019169060200190929190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290803590602001909291905050506111e4565b005b34801561054e57600080fd5b506105a66004803603810190808035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437820191505050505050919291929050505061194e565b005b3480156105b457600080fd5b506105e9600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611b1d565b005b3480156105f757600080fd5b50610600611ced565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561064e57600080fd5b50610657611d17565b005b34801561066557600080fd5b506106a86004803603810190808035600019169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061203c565b6040518082815260200191505060405180910390f35b3480156106ca57600080fd5b506106d3612061565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561072157600080fd5b5061072a612087565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b8381101561076d578082015181840152602081019050610752565b505050509050019250505060405180910390f35b34801561078d57600080fd5b506107b060048036038101908080356000191690602001909291905050506120e3565b6040518082815260200191505060405180910390f35b3480156107d257600080fd5b506107f560048036038101908080356000191690602001909291905050506121c0565b604051808215151515815260200191505060405180910390f35b34801561081b57600080fd5b50610850600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061229d565b005b34801561085e57600080fd5b50610893600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612bc0565b005b3480156108a157600080fd5b506108aa612f95565b005b3480156108b857600080fd5b506108ed600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506131ca565b005b3480156108fb57600080fd5b5061098a600480360381019080803590602001908201803590602001919091929391929390806060019091929192908035906020019082018035906020019190919293919293908035906020019092919080359060200190929190803590602001909291908035906020019092919080359060200190820180359060200191909192939192939050505061339a565b005b34801561099857600080fd5b506109cd600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061372c565b005b3480156109db57600080fd5b506109e4613af0565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b348015610a3257600080fd5b50610a67600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050613b16565b6040518082815260200191505060405180910390f35b348015610a8957600080fd5b50610a92613bfc565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b348015610ae057600080fd5b50610aff60048036038101908080359060200190929190505050613c21565b60405180826000191660001916815260200191505060405180910390f35b348015610b2957600080fd5b50610b5e600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050613c2e565b604051808215151515815260200191505060405180910390f35b348015610b8457600080fd5b50610ba76004803603810190808035600019169060200190929190505050613c76565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b348015610bf557600080fd5b50610c1460048036038101908080359060200190929190505050613d53565b60405180826000191660001916815260200191505060405180910390f35b348015610c3e57600080fd5b50610c616004803603810190808035600019169060200190929190505050613d76565b6040518082815260200191505060405180910390f35b348015610c8357600080fd5b50610ca66004803603810190808035600019169060200190929190505050613d88565b604051808215151515815260200191505060405180910390f35b348015610ccc57600080fd5b50610cef600480360381019080803560001916906020019092919050505061403b565b005b348015610cfd57600080fd5b50610d556004803603810190808035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437820191505050505050919291929050505061433f565b005b348015610d6357600080fd5b50610d86600480360381019080803560001916906020019092919050505061450e565b6040518082815260200191505060405180910390f35b348015610da857600080fd5b50610dcb60048036038101908080356000191690602001909291905050506145eb565b6040518082815260200191505060405180910390f35b348015610ded57600080fd5b50610df66146c8565b60405180826000191660001916815260200191505060405180910390f35b348015610e2057600080fd5b50610e55600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506146ce565b005b348015610e6357600080fd5b50610e6c614868565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6060610eb861488e565b73ffffffffffffffffffffffffffffffffffffffff1663916c99fd836040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808260001916600019168152602001915050600060405180830381600087803b158015610f2e57600080fd5b505af1158015610f42573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052506020811015610f6c57600080fd5b810190808051640100000000811115610f8457600080fd5b82810190506020810184811115610f9a57600080fd5b8151856001820283011164010000000082111715610fb757600080fd5b50509291905050509050919050565b611043826007836040518082805190602001908083835b6020831015156110025780518252602082019150602081019050602083039250610fdd565b6001836020036101000a03801982511681845116808217855250505050505090500191505090815260200160405180910390206148b890919063ffffffff16565b5050565b6040805190810160405280600981526020017f77686974656c697374000000000000000000000000000000000000000000000081525081565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a941ff21836040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808260001916600019168152602001915050602060405180830381600087803b15801561111b57600080fd5b505af115801561112f573d6000803e3d6000fd5b505050506040513d602081101561114557600080fd5b81019080805190602001909291905050509050919050565b60006111dc836007846040518082805190602001908083835b60208310151561119b5780518252602082019150602081019050602083039250611176565b6001836020036101000a03801982511681845116808217855250505050505090500191505090815260200160405180910390206148d190919063ffffffff16565b905092915050565b60008060008060008060006040805190810160405280600e81526020017f63726561746543616d706169676e00000000000000000000000000000000000081525033611265816040805190810160405280600981526020017f77686974656c697374000000000000000000000000000000000000000000000081525061115d565b151561136b577fac283f5b35fa78f7f5e8923cb5db86b4c10c166580c43bb59f1d1d9ae108b70082604051808060200180602001838103835284818151815260200191508051906020019080838360005b838110156112d15780820151818401526020810190506112b6565b50505050905090810190601f1680156112fe5780820380516001836020036101000a031916815260200191505b50838103825260388152602001807f4f7065726174696f6e2063616e206f6e6c7920626520706572666f726d65642081526020017f62792057686974656c6973746564204164647265737365730000000000000000815250604001935050505060405180910390a161193f565b61137361488e565b73ffffffffffffffffffffffffffffffffffffffff1663d55bdc5f8e6040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808260001916600019168152602001915050602060405180830381600087803b1580156113e957600080fd5b505af11580156113fd573d6000803e3d6000fd5b505050506040513d602081101561141357600080fd5b8101908080519060200190929190505050985061142e61488e565b73ffffffffffffffffffffffffffffffffffffffff1663094fb8648e6040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808260001916600019168152602001915050602060405180830381600087803b1580156114a457600080fd5b505af11580156114b8573d6000803e3d6000fd5b505050506040513d60208110156114ce57600080fd5b810190808051906020019092919050505097506114e961488e565b73ffffffffffffffffffffffffffffffffffffffff1663433b77c78e6040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808260001916600019168152602001915050602060405180830381600087803b15801561155f57600080fd5b505af1158015611573573d6000803e3d6000fd5b505050506040513d602081101561158957600080fd5b810190808051906020019092919050505096506115a6888a61492a565b955089861015156115b9578994506115bd565b8594505b6115c78986614940565b93506115d38885614978565b92506115dd614991565b73ffffffffffffffffffffffffffffffffffffffff1663b3d761888833876040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050600060405180830381600087803b1580156116b357600080fd5b505af11580156116c7573d6000803e3d6000fd5b505050506116d361488e565b73ffffffffffffffffffffffffffffffffffffffff1663965acc738e856040518363ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180836000191660001916815260200182815260200192505050600060405180830381600087803b15801561175157600080fd5b505af1158015611765573d6000803e3d6000fd5b50505050888310156118155761177961488e565b73ffffffffffffffffffffffffffffffffffffffff1663745944d58e60006040518363ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018083600019166000191681526020018215151515815260200192505050600060405180830381600087803b1580156117fc57600080fd5b505af1158015611810573d6000803e3d6000fd5b505050505b7fbe5376694fd8cd0f6b3c46ced2162af96d4dbe9eb1deb8a96e51a392c1a95e9e8d8d8d8d896040518086600019166000191681526020018060200180602001858152602001848152602001838103835287818151815260200191508051906020019080838360005b8381101561189957808201518184015260208101905061187e565b50505050905090810190601f1680156118c65780820380516001836020036101000a031916815260200191505b50838103825286818151815260200191508051906020019080838360005b838110156118ff5780820151818401526020810190506118e4565b50505050905090810190601f16801561192c5780820380516001836020036101000a031916815260200191505b5097505050505050505060405180910390a15b50505050505050505050505050565b60006040805190810160405280601c81526020017f72656d6f766541646472657373657346726f6d57686974656c697374000000008152506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611adc577fac283f5b35fa78f7f5e8923cb5db86b4c10c166580c43bb59f1d1d9ae108b70081604051808060200180602001838103835284818151815260200191508051906020019080838360005b83811015611a42578082015181840152602081019050611a27565b50505050905090810190601f168015611a6f5780820380516001836020036101000a031916815260200191505b50838103825260318152602001807f4f7065726174696f6e2063616e206f6e6c7920626520706572666f726d65642081526020017f627920636f6e7472616374206f776e6572000000000000000000000000000000815250604001935050505060405180910390a1611b18565b600091505b8251821015611b1757611b0a8383815181101515611afb57fe5b90602001906020020151611b1d565b8180600101925050611ae1565b5b505050565b6040805190810160405280601a81526020017f72656d6f76654164647265737346726f6d57686974656c6973740000000000008152506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611ca9577fac283f5b35fa78f7f5e8923cb5db86b4c10c166580c43bb59f1d1d9ae108b70081604051808060200180602001838103835284818151815260200191508051906020019080838360005b83811015611c0f578082015181840152602081019050611bf4565b50505050905090810190601f168015611c3c5780820380516001836020036101000a031916815260200191505b50838103825260318152602001807f4f7065726174696f6e2063616e206f6e6c7920626520706572666f726d65642081526020017f627920636f6e7472616374206f776e6572000000000000000000000000000000815250604001935050505060405180910390a1611ce9565b611ce8826040805190810160405280600981526020017f77686974656c69737400000000000000000000000000000000000000000000008152506149bb565b5b5050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60006040805190810160405280600881526020017f776974686472617700000000000000000000000000000000000000000000000081525033611d8f816040805190810160405280600981526020017f77686974656c697374000000000000000000000000000000000000000000000081525061115d565b1515611e95577fac283f5b35fa78f7f5e8923cb5db86b4c10c166580c43bb59f1d1d9ae108b70082604051808060200180602001838103835284818151815260200191508051906020019080838360005b83811015611dfb578082015181840152602081019050611de0565b50505050905090810190601f168015611e285780820380516001836020036101000a031916815260200191505b50838103825260388152602001807f4f7065726174696f6e2063616e206f6e6c7920626520706572666f726d65642081526020017f62792057686974656c6973746564204164647265737365730000000000000000815250604001935050505060405180910390a1612037565b611e9d614991565b73ffffffffffffffffffffffffffffffffffffffff16638a67f4bf336040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b158015611f3757600080fd5b505af1158015611f4b573d6000803e3d6000fd5b505050506040513d6020811015611f6157600080fd5b81019080805190602001909291905050509250611f7c614991565b73ffffffffffffffffffffffffffffffffffffffff1663d6ef7af033856040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050600060405180830381600087803b15801561201e57600080fd5b505af1158015612032573d6000803e3d6000fd5b505050505b505050565b6004602052816000526040600020602052806000526040600020600091509150505481565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b606060058054806020026020016040519081016040528092919081815260200182805480156120d957602002820191906000526020600020905b815460001916815260200190600101908083116120c1575b5050505050905090565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663d55bdc5f836040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808260001916600019168152602001915050602060405180830381600087803b15801561217e57600080fd5b505af1158015612192573d6000803e3d6000fd5b505050506040513d60208110156121a857600080fd5b81019080805190602001909291905050509050919050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166339384126836040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808260001916600019168152602001915050602060405180830381600087803b15801561225b57600080fd5b505af115801561226f573d6000803e3d6000fd5b505050506040513d602081101561228557600080fd5b81019080805190602001909291905050509050919050565b6000606060008060008060006040805190810160405280600e81526020017f7570677261646546696e616e63650000000000000000000000000000000000008152506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515612435577fac283f5b35fa78f7f5e8923cb5db86b4c10c166580c43bb59f1d1d9ae108b70081604051808060200180602001838103835284818151815260200191508051906020019080838360005b8381101561239b578082015181840152602081019050612380565b50505050905090810190601f1680156123c85780820380516001836020036101000a031916815260200191505b50838103825260318152602001807f4f7065726174696f6e2063616e206f6e6c7920626520706572666f726d65642081526020017f627920636f6e7472616374206f776e6572000000000000000000000000000000815250604001935050505060405180910390a1612bb5565b889750600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663b85220436040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401600060405180830381600087803b1580156124be57600080fd5b505af11580156124d2573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f8201168201806040525060208110156124fc57600080fd5b81019080805164010000000081111561251457600080fd5b8281019050602081018481111561252a57600080fd5b815185602082028301116401000000008211171561254757600080fd5b50509291905050509650600095505b865186101561274f57600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16634773489288888151811015156125ab57fe5b906020019060200201516040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b15801561263357600080fd5b505af1158015612647573d6000803e3d6000fd5b505050506040513d602081101561265d57600080fd5b810190808051906020019092919050505094508773ffffffffffffffffffffffffffffffffffffffff16635b86f599888881518110151561269a57fe5b90602001906020020151876040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050600060405180830381600087803b15801561272a57600080fd5b505af115801561273e573d6000803e3d6000fd5b505050508580600101965050612556565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b15801561282e57600080fd5b505af1158015612842573d6000803e3d6000fd5b505050506040513d602081101561285857600080fd5b81019080805190602001909291905050509350600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16633b789750896040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050600060405180830381600087803b15801561292857600080fd5b505af115801561293c573d6000803e3d6000fd5b50505050600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b158015612a1f57600080fd5b505af1158015612a33573d6000803e3d6000fd5b505050506040513d6020811015612a4957600080fd5b81019080805190602001909291905050509250600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231896040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b158015612b1957600080fd5b505af1158015612b2d573d6000803e3d6000fd5b505050506040513d6020811015612b4357600080fd5b810190808051906020019092919050505091508184141515612b6457600080fd5b600083141515612b7357600080fd5b87600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b505050505050505050565b60606000806040805190810160405280600c81526020017f696d706f727442696449647300000000000000000000000000000000000000008152506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515612d51577fac283f5b35fa78f7f5e8923cb5db86b4c10c166580c43bb59f1d1d9ae108b70081604051808060200180602001838103835284818151815260200191508051906020019080838360005b83811015612cb7578082015181840152602081019050612c9c565b50505050905090810190601f168015612ce45780820380516001836020036101000a031916815260200191505b50838103825260318152602001807f4f7065726174696f6e2063616e206f6e6c7920626520706572666f726d65642081526020017f627920636f6e7472616374206f776e6572000000000000000000000000000000815250604001935050505060405180910390a1612f8e565b8473ffffffffffffffffffffffffffffffffffffffff16634f51bf466040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401600060405180830381600087803b158015612db557600080fd5b505af1158015612dc9573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052506020811015612df357600080fd5b810190808051640100000000811115612e0b57600080fd5b82810190506020810184811115612e2157600080fd5b8151856020820283011164010000000082111715612e3e57600080fd5b50509291905050509350600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166360b4a8fd6040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b158015612ece57600080fd5b505af1158015612ee2573d6000803e3d6000fd5b505050506040513d6020811015612ef857600080fd5b81019080805190602001909291905050509250600091505b8351821015612f6f5760058483815181101515612f2957fe5b9060200190602002015190806001815401808255809150509060018203906000526020600020016000909192909190915090600019169055508180600101925050612f10565b8260001916600654600019161015612f8d5782600681600019169055505b5b5050505050565b6040805190810160405280601181526020017f72656e6f756e63654f776e6572736869700000000000000000000000000000008152506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515613121577fac283f5b35fa78f7f5e8923cb5db86b4c10c166580c43bb59f1d1d9ae108b70081604051808060200180602001838103835284818151815260200191508051906020019080838360005b8381101561308757808201518184015260208101905061306c565b50505050905090810190601f1680156130b45780820380516001836020036101000a031916815260200191505b50838103825260318152602001807f4f7065726174696f6e2063616e206f6e6c7920626520706572666f726d65642081526020017f627920636f6e7472616374206f776e6572000000000000000000000000000000815250604001935050505060405180910390a16131c7565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482060405160405180910390a260008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b50565b6040805190810160405280601581526020017f61646441646472657373546f57686974656c69737400000000000000000000008152506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515613356577fac283f5b35fa78f7f5e8923cb5db86b4c10c166580c43bb59f1d1d9ae108b70081604051808060200180602001838103835284818151815260200191508051906020019080838360005b838110156132bc5780820151818401526020810190506132a1565b50505050905090810190601f1680156132e95780820380516001836020036101000a031916815260200191505b50838103825260318152602001807f4f7065726174696f6e2063616e206f6e6c7920626520706572666f726d65642081526020017f627920636f6e7472616374206f776e6572000000000000000000000000000000815250604001935050505060405180910390a1613396565b613395826040805190810160405280600981526020017f77686974656c6973740000000000000000000000000000000000000000000000815250614aef565b5b5050565b6133a26153a4565b6134378c8c8080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050508b600380602002604051908101604052809291908260036020028082843782019150505050508b8b808060200260200160405190810160405280939291908181526020018383602002808284378201915050505050508a8a8a8a614c23565b905060008160c0015173ffffffffffffffffffffffffffffffffffffffff1614156134615761371e565b61346961511f565b816000015190806001815401808255809150509060018203906000526020600020016000909192909190915090600019169055506134a561488e565b73ffffffffffffffffffffffffffffffffffffffff166308901d78826000015183602001518460400151856060015186608001518760a001518860c001518b8b6040518a63ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808a60001916600019168152602001898152602001888152602001878152602001868152602001851515151581526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200180602001828103825284848281815260200192508082843782019150509a5050505050505050505050600060405180830381600087803b1580156135b957600080fd5b505af11580156135cd573d6000803e3d6000fd5b505050507fc1c99ee430869fdd57d9e1401fc7546d001679cea994ca69954d64de8c58bb5581600001518260c001518e8e8e8e8e6040518088600019166000191681526020018773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200180602001806020018660036020028082843782019150508060200184810384526000815260200160200184810383528989828181526020019250808284378201915050848103825286868281815260200192506020028082843782019150509a505050505050505050505060405180910390a17f5c76eb7e9ced2baf82f03a13622263efa23cdcb95051e5b581fb21c5feb883a881600001518484604051808460001916600019168152602001806020018281038252848482818152602001925080828437820191505094505050505060405180910390a15b505050505050505050505050565b60006040805190810160405280600e81526020017f7570677261646553746f726167650000000000000000000000000000000000008152506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156138ba577fac283f5b35fa78f7f5e8923cb5db86b4c10c166580c43bb59f1d1d9ae108b70081604051808060200180602001838103835284818151815260200191508051906020019080838360005b83811015613820578082015181840152602081019050613805565b50505050905090810190601f16801561384d5780820380516001836020036101000a031916815260200191505b50838103825260318152602001807f4f7065726174696f6e2063616e206f6e6c7920626520706572666f726d65642081526020017f627920636f6e7472616374206f776e6572000000000000000000000000000000815250604001935050505060405180910390a1613aeb565b600091505b6005805490508210156138fb576138ee6005838154811015156138de57fe5b906000526020600020015461403b565b81806001019250506138bf565b6005600061390991906153fd565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166360b4a8fd6040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b15801561398f57600080fd5b505af11580156139a3573d6000803e3d6000fd5b505050506040513d60208110156139b957600080fd5b810190808051906020019092919050505060068160001916905550600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663971fff63846040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050600060405180830381600087803b158015613a9157600080fd5b505af1158015613aa5573d6000803e3d6000fd5b5050505082600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b505050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000613b20614991565b73ffffffffffffffffffffffffffffffffffffffff16638a67f4bf836040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b158015613bba57600080fd5b505af1158015613bce573d6000803e3d6000fd5b505050506040513d6020811015613be457600080fd5b81019080805190602001909291905050509050919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000816001029050919050565b6000613c6f826040805190810160405280600981526020017f77686974656c697374000000000000000000000000000000000000000000000081525061115d565b9050919050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663433b77c7836040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808260001916600019168152602001915050602060405180830381600087803b158015613d1157600080fd5b505af1158015613d25573d6000803e3d6000fd5b505050506040513d6020811015613d3b57600080fd5b81019080805190602001909291905050509050919050565b600581815481101515613d6257fe5b906000526020600020016000915090505481565b6000610fff8260019004169050919050565b6000806000806000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166312e6414e876040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808260001916600019168152602001915050602060405180830381600087803b158015613e2957600080fd5b505af1158015613e3d573d6000803e3d6000fd5b505050506040513d6020811015613e5357600080fd5b81019080805190602001909291905050509350600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a941ff21876040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808260001916600019168152602001915050602060405180830381600087803b158015613eff57600080fd5b505af1158015613f13573d6000803e3d6000fd5b505050506040513d6020811015613f2957600080fd5b81019080805190602001909291905050509250600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166339384126876040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808260001916600019168152602001915050602060405180830381600087803b158015613fd557600080fd5b505af1158015613fe9573d6000803e3d6000fd5b505050506040513d6020811015613fff57600080fd5b810190808051906020019092919050505091506103e84202905081801561402557508084105b801561403057508083115b945050505050919050565b60008061404783613c76565b91503373ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614806140cf57503373ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b15156140da57600080fd5b6140e3836145eb565b9050600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f3fef3a383836040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050600060405180830381600087803b1580156141aa57600080fd5b505af11580156141be573d6000803e3d6000fd5b50505050600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663965acc738460006040518363ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180836000191660001916815260200182815260200192505050600060405180830381600087803b15801561426457600080fd5b505af1158015614278573d6000803e3d6000fd5b50505050600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663745944d58460006040518363ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018083600019166000191681526020018215151515815260200192505050600060405180830381600087803b15801561432257600080fd5b505af1158015614336573d6000803e3d6000fd5b50505050505050565b60006040805190810160405280601781526020017f616464416464726573736573546f57686974656c6973740000000000000000008152506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156144cd577fac283f5b35fa78f7f5e8923cb5db86b4c10c166580c43bb59f1d1d9ae108b70081604051808060200180602001838103835284818151815260200191508051906020019080838360005b83811015614433578082015181840152602081019050614418565b50505050905090810190601f1680156144605780820380516001836020036101000a031916815260200191505b50838103825260318152602001807f4f7065726174696f6e2063616e206f6e6c7920626520706572666f726d65642081526020017f627920636f6e7472616374206f776e6572000000000000000000000000000000815250604001935050505060405180910390a1614509565b600091505b8251821015614508576144fb83838151811015156144ec57fe5b906020019060200201516131ca565b81806001019250506144d2565b5b505050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166312e6414e836040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808260001916600019168152602001915050602060405180830381600087803b1580156145a957600080fd5b505af11580156145bd573d6000803e3d6000fd5b505050506040513d60208110156145d357600080fd5b81019080805190602001909291905050509050919050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663094fb864836040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808260001916600019168152602001915050602060405180830381600087803b15801561468657600080fd5b505af115801561469a573d6000803e3d6000fd5b505050506040513d60208110156146b057600080fd5b81019080805190602001909291905050509050919050565b60065481565b6040805190810160405280601181526020017f7472616e736665724f776e6572736869700000000000000000000000000000008152506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561485a577fac283f5b35fa78f7f5e8923cb5db86b4c10c166580c43bb59f1d1d9ae108b70081604051808060200180602001838103835284818151815260200191508051906020019080838360005b838110156147c05780820151818401526020810190506147a5565b50505050905090810190601f1680156147ed5780820380516001836020036101000a031916815260200191505b50838103825260318152602001807f4f7065726174696f6e2063616e206f6e6c7920626520706572666f726d65642081526020017f627920636f6e7472616374206f776e6572000000000000000000000000000000815250604001935050505060405180910390a1614864565b61486382615128565b5b5050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6148c282826148d1565b15156148cd57600080fd5b5050565b60008260000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b6000818381151561493757fe5b04905092915050565b6000808314156149535760009050614972565b818302905081838281151561496457fe5b0414151561496e57fe5b8090505b92915050565b600082821115151561498657fe5b818303905092915050565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b614a38826007836040518082805190602001908083835b6020831015156149f757805182526020820191506020810190506020830392506149d2565b6001836020036101000a03801982511681845116808217855250505050505090500191505090815260200160405180910390206152e890919063ffffffff16565b8173ffffffffffffffffffffffffffffffffffffffff167fd211483f91fc6eff862467f8de606587a30c8fc9981056f051b897a418df803a826040518080602001828103825283818151815260200191508051906020019080838360005b83811015614ab1578082015181840152602081019050614a96565b50505050905090810190601f168015614ade5780820380516001836020036101000a031916815260200191505b509250505060405180910390a25050565b614b6c826007836040518082805190602001908083835b602083101515614b2b5780518252602082019150602081019050602083039250614b06565b6001836020036101000a038019825116818451168082178552505050505050905001915050908152602001604051809103902061534690919063ffffffff16565b8173ffffffffffffffffffffffffffffffffffffffff167fbfec83d64eaa953f2708271a023ab9ee82057f8f3578d548c1a4ba0b5b700489826040518080602001828103825283818151815260200191508051906020019080838360005b83811015614be5578082015181840152602081019050614bca565b50505050905090810190601f168015614c125780820380516001836020036101000a031916815260200191505b509250505060405180910390a25050565b614c2b6153a4565b6000614c356153a4565b868610151515614c4457600080fd5b848410151515614c5357600080fd5b85600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e33306040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200192505050602060405180830381600087803b158015614d4557600080fd5b505af1158015614d59573d6000803e3d6000fd5b505050506040513d6020811015614d6f57600080fd5b810190808051906020019092919050505010151561506d57600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd33600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16896040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b158015614ea257600080fd5b505af1158015614eb6573d6000803e3d6000fd5b505050506040513d6020811015614ecc57600080fd5b810190808051906020019092919050505050600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16635b86f59933886040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050600060405180830381600087803b158015614fa357600080fd5b505af1158015614fb7573d6000803e3d6000fd5b50505050614fc6600654613d76565b9150614fd782600101925082613c21565b6006816000191690555086816020018181525050848160600181815250508381608001818152505085816040018181525050338160c0019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505060018160a00190151590811515815250506006548160000190600019169081600019168152505061510f565b7fac283f5b35fa78f7f5e8923cb5db86b4c10c166580c43bb59f1d1d9ae108b7006040518080602001806020018381038352600e8152602001807f63726561746543616d706169676e000000000000000000000000000000000000815250602001838103825260148152602001807f4e6f7420656e6f75676820616c6c6f77616e63650000000000000000000000008152506020019250505060405180910390a15b8092505050979650505050505050565b60006005905090565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415615229577fac283f5b35fa78f7f5e8923cb5db86b4c10c166580c43bb59f1d1d9ae108b700604051808060200180602001838103835260118152602001807f7472616e736665724f776e657273686970000000000000000000000000000000815250602001838103825260328152602001807f4e6577206f776e657227732061646472657373206e6565647320746f2062652081526020017f646966666572656e74207468616e2030783000000000000000000000000000008152506040019250505060405180910390a16152e5565b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b50565b60008260000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b60018260000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b60e0604051908101604052806000801916815260200160008152602001600081526020016000815260200160008152602001600015158152602001600073ffffffffffffffffffffffffffffffffffffffff1681525090565b508054600082559060005260206000209081019061541b919061541e565b50565b61544091905b8082111561543c576000816000905550600101615424565b5090565b905600a165627a7a723058206fbdf2b841fd4ad34b2811d558f9ab33fa0f1e2a354aebae95957268fb86f77500290000000000000000000000001a7a8bd9106f2b8d977e08582dc7d24c723ab0db000000000000000000000000c18dac9b511bd8f99f5effd7a0d18152f965c39300000000000000000000000063fe92c3817baea5b3e32e416ce2f1aac66f4a8d

Deployed Bytecode

0x6080604052600436106101cd576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063060b2128146101d25780630988ca8c1461027c57806318b919e9146103055780631f16c8b914610395578063217fe6c6146103da57806322c43af81461047b57806324953eaa14610542578063286dd3f5146105a8578063393a4d34146105eb5780633ccfd60b1461064257806344b7f6b9146106595780634826a69f146106be5780634f51bf461461071557806363735598146107815780636904c104146107c65780636b128b2f1461080f57806370a640aa14610852578063715018a6146108955780637b9417c8146108ac57806382a0ad4d146108ef57806382bfa9f21461098c578063875b40ea146109cf5780638a67f4bf14610a265780638da5cb5b14610a7d57806394e8767d14610ad45780639b19251a14610b1d578063ad36c59314610b78578063adacc54a14610be9578063cfc5a96914610c32578063dd16d98114610c77578063df8bb14014610cc0578063e2ec6ec314610cf1578063e55c6d0714610d57578063e83400f614610d9c578063ef78e28b14610de1578063f2fde38b14610e14578063f5beeaaf14610e57575b600080fd5b3480156101de57600080fd5b506102016004803603810190808035600019169060200190929190505050610eae565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610241578082015181840152602081019050610226565b50505050905090810190601f16801561026e5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561028857600080fd5b50610303600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290505050610fc6565b005b34801561031157600080fd5b5061031a611047565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561035a57808201518184015260208101905061033f565b50505050905090810190601f1680156103875780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156103a157600080fd5b506103c46004803603810190808035600019169060200190929190505050611080565b6040518082815260200191505060405180910390f35b3480156103e657600080fd5b50610461600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919291929050505061115d565b604051808215151515815260200191505060405180910390f35b34801561048757600080fd5b506105406004803603810190808035600019169060200190929190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290803590602001909291905050506111e4565b005b34801561054e57600080fd5b506105a66004803603810190808035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437820191505050505050919291929050505061194e565b005b3480156105b457600080fd5b506105e9600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611b1d565b005b3480156105f757600080fd5b50610600611ced565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561064e57600080fd5b50610657611d17565b005b34801561066557600080fd5b506106a86004803603810190808035600019169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061203c565b6040518082815260200191505060405180910390f35b3480156106ca57600080fd5b506106d3612061565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561072157600080fd5b5061072a612087565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b8381101561076d578082015181840152602081019050610752565b505050509050019250505060405180910390f35b34801561078d57600080fd5b506107b060048036038101908080356000191690602001909291905050506120e3565b6040518082815260200191505060405180910390f35b3480156107d257600080fd5b506107f560048036038101908080356000191690602001909291905050506121c0565b604051808215151515815260200191505060405180910390f35b34801561081b57600080fd5b50610850600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061229d565b005b34801561085e57600080fd5b50610893600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612bc0565b005b3480156108a157600080fd5b506108aa612f95565b005b3480156108b857600080fd5b506108ed600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506131ca565b005b3480156108fb57600080fd5b5061098a600480360381019080803590602001908201803590602001919091929391929390806060019091929192908035906020019082018035906020019190919293919293908035906020019092919080359060200190929190803590602001909291908035906020019092919080359060200190820180359060200191909192939192939050505061339a565b005b34801561099857600080fd5b506109cd600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061372c565b005b3480156109db57600080fd5b506109e4613af0565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b348015610a3257600080fd5b50610a67600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050613b16565b6040518082815260200191505060405180910390f35b348015610a8957600080fd5b50610a92613bfc565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b348015610ae057600080fd5b50610aff60048036038101908080359060200190929190505050613c21565b60405180826000191660001916815260200191505060405180910390f35b348015610b2957600080fd5b50610b5e600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050613c2e565b604051808215151515815260200191505060405180910390f35b348015610b8457600080fd5b50610ba76004803603810190808035600019169060200190929190505050613c76565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b348015610bf557600080fd5b50610c1460048036038101908080359060200190929190505050613d53565b60405180826000191660001916815260200191505060405180910390f35b348015610c3e57600080fd5b50610c616004803603810190808035600019169060200190929190505050613d76565b6040518082815260200191505060405180910390f35b348015610c8357600080fd5b50610ca66004803603810190808035600019169060200190929190505050613d88565b604051808215151515815260200191505060405180910390f35b348015610ccc57600080fd5b50610cef600480360381019080803560001916906020019092919050505061403b565b005b348015610cfd57600080fd5b50610d556004803603810190808035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437820191505050505050919291929050505061433f565b005b348015610d6357600080fd5b50610d86600480360381019080803560001916906020019092919050505061450e565b6040518082815260200191505060405180910390f35b348015610da857600080fd5b50610dcb60048036038101908080356000191690602001909291905050506145eb565b6040518082815260200191505060405180910390f35b348015610ded57600080fd5b50610df66146c8565b60405180826000191660001916815260200191505060405180910390f35b348015610e2057600080fd5b50610e55600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506146ce565b005b348015610e6357600080fd5b50610e6c614868565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6060610eb861488e565b73ffffffffffffffffffffffffffffffffffffffff1663916c99fd836040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808260001916600019168152602001915050600060405180830381600087803b158015610f2e57600080fd5b505af1158015610f42573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052506020811015610f6c57600080fd5b810190808051640100000000811115610f8457600080fd5b82810190506020810184811115610f9a57600080fd5b8151856001820283011164010000000082111715610fb757600080fd5b50509291905050509050919050565b611043826007836040518082805190602001908083835b6020831015156110025780518252602082019150602081019050602083039250610fdd565b6001836020036101000a03801982511681845116808217855250505050505090500191505090815260200160405180910390206148b890919063ffffffff16565b5050565b6040805190810160405280600981526020017f77686974656c697374000000000000000000000000000000000000000000000081525081565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a941ff21836040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808260001916600019168152602001915050602060405180830381600087803b15801561111b57600080fd5b505af115801561112f573d6000803e3d6000fd5b505050506040513d602081101561114557600080fd5b81019080805190602001909291905050509050919050565b60006111dc836007846040518082805190602001908083835b60208310151561119b5780518252602082019150602081019050602083039250611176565b6001836020036101000a03801982511681845116808217855250505050505090500191505090815260200160405180910390206148d190919063ffffffff16565b905092915050565b60008060008060008060006040805190810160405280600e81526020017f63726561746543616d706169676e00000000000000000000000000000000000081525033611265816040805190810160405280600981526020017f77686974656c697374000000000000000000000000000000000000000000000081525061115d565b151561136b577fac283f5b35fa78f7f5e8923cb5db86b4c10c166580c43bb59f1d1d9ae108b70082604051808060200180602001838103835284818151815260200191508051906020019080838360005b838110156112d15780820151818401526020810190506112b6565b50505050905090810190601f1680156112fe5780820380516001836020036101000a031916815260200191505b50838103825260388152602001807f4f7065726174696f6e2063616e206f6e6c7920626520706572666f726d65642081526020017f62792057686974656c6973746564204164647265737365730000000000000000815250604001935050505060405180910390a161193f565b61137361488e565b73ffffffffffffffffffffffffffffffffffffffff1663d55bdc5f8e6040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808260001916600019168152602001915050602060405180830381600087803b1580156113e957600080fd5b505af11580156113fd573d6000803e3d6000fd5b505050506040513d602081101561141357600080fd5b8101908080519060200190929190505050985061142e61488e565b73ffffffffffffffffffffffffffffffffffffffff1663094fb8648e6040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808260001916600019168152602001915050602060405180830381600087803b1580156114a457600080fd5b505af11580156114b8573d6000803e3d6000fd5b505050506040513d60208110156114ce57600080fd5b810190808051906020019092919050505097506114e961488e565b73ffffffffffffffffffffffffffffffffffffffff1663433b77c78e6040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808260001916600019168152602001915050602060405180830381600087803b15801561155f57600080fd5b505af1158015611573573d6000803e3d6000fd5b505050506040513d602081101561158957600080fd5b810190808051906020019092919050505096506115a6888a61492a565b955089861015156115b9578994506115bd565b8594505b6115c78986614940565b93506115d38885614978565b92506115dd614991565b73ffffffffffffffffffffffffffffffffffffffff1663b3d761888833876040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050600060405180830381600087803b1580156116b357600080fd5b505af11580156116c7573d6000803e3d6000fd5b505050506116d361488e565b73ffffffffffffffffffffffffffffffffffffffff1663965acc738e856040518363ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180836000191660001916815260200182815260200192505050600060405180830381600087803b15801561175157600080fd5b505af1158015611765573d6000803e3d6000fd5b50505050888310156118155761177961488e565b73ffffffffffffffffffffffffffffffffffffffff1663745944d58e60006040518363ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018083600019166000191681526020018215151515815260200192505050600060405180830381600087803b1580156117fc57600080fd5b505af1158015611810573d6000803e3d6000fd5b505050505b7fbe5376694fd8cd0f6b3c46ced2162af96d4dbe9eb1deb8a96e51a392c1a95e9e8d8d8d8d896040518086600019166000191681526020018060200180602001858152602001848152602001838103835287818151815260200191508051906020019080838360005b8381101561189957808201518184015260208101905061187e565b50505050905090810190601f1680156118c65780820380516001836020036101000a031916815260200191505b50838103825286818151815260200191508051906020019080838360005b838110156118ff5780820151818401526020810190506118e4565b50505050905090810190601f16801561192c5780820380516001836020036101000a031916815260200191505b5097505050505050505060405180910390a15b50505050505050505050505050565b60006040805190810160405280601c81526020017f72656d6f766541646472657373657346726f6d57686974656c697374000000008152506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611adc577fac283f5b35fa78f7f5e8923cb5db86b4c10c166580c43bb59f1d1d9ae108b70081604051808060200180602001838103835284818151815260200191508051906020019080838360005b83811015611a42578082015181840152602081019050611a27565b50505050905090810190601f168015611a6f5780820380516001836020036101000a031916815260200191505b50838103825260318152602001807f4f7065726174696f6e2063616e206f6e6c7920626520706572666f726d65642081526020017f627920636f6e7472616374206f776e6572000000000000000000000000000000815250604001935050505060405180910390a1611b18565b600091505b8251821015611b1757611b0a8383815181101515611afb57fe5b90602001906020020151611b1d565b8180600101925050611ae1565b5b505050565b6040805190810160405280601a81526020017f72656d6f76654164647265737346726f6d57686974656c6973740000000000008152506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611ca9577fac283f5b35fa78f7f5e8923cb5db86b4c10c166580c43bb59f1d1d9ae108b70081604051808060200180602001838103835284818151815260200191508051906020019080838360005b83811015611c0f578082015181840152602081019050611bf4565b50505050905090810190601f168015611c3c5780820380516001836020036101000a031916815260200191505b50838103825260318152602001807f4f7065726174696f6e2063616e206f6e6c7920626520706572666f726d65642081526020017f627920636f6e7472616374206f776e6572000000000000000000000000000000815250604001935050505060405180910390a1611ce9565b611ce8826040805190810160405280600981526020017f77686974656c69737400000000000000000000000000000000000000000000008152506149bb565b5b5050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60006040805190810160405280600881526020017f776974686472617700000000000000000000000000000000000000000000000081525033611d8f816040805190810160405280600981526020017f77686974656c697374000000000000000000000000000000000000000000000081525061115d565b1515611e95577fac283f5b35fa78f7f5e8923cb5db86b4c10c166580c43bb59f1d1d9ae108b70082604051808060200180602001838103835284818151815260200191508051906020019080838360005b83811015611dfb578082015181840152602081019050611de0565b50505050905090810190601f168015611e285780820380516001836020036101000a031916815260200191505b50838103825260388152602001807f4f7065726174696f6e2063616e206f6e6c7920626520706572666f726d65642081526020017f62792057686974656c6973746564204164647265737365730000000000000000815250604001935050505060405180910390a1612037565b611e9d614991565b73ffffffffffffffffffffffffffffffffffffffff16638a67f4bf336040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b158015611f3757600080fd5b505af1158015611f4b573d6000803e3d6000fd5b505050506040513d6020811015611f6157600080fd5b81019080805190602001909291905050509250611f7c614991565b73ffffffffffffffffffffffffffffffffffffffff1663d6ef7af033856040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050600060405180830381600087803b15801561201e57600080fd5b505af1158015612032573d6000803e3d6000fd5b505050505b505050565b6004602052816000526040600020602052806000526040600020600091509150505481565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b606060058054806020026020016040519081016040528092919081815260200182805480156120d957602002820191906000526020600020905b815460001916815260200190600101908083116120c1575b5050505050905090565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663d55bdc5f836040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808260001916600019168152602001915050602060405180830381600087803b15801561217e57600080fd5b505af1158015612192573d6000803e3d6000fd5b505050506040513d60208110156121a857600080fd5b81019080805190602001909291905050509050919050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166339384126836040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808260001916600019168152602001915050602060405180830381600087803b15801561225b57600080fd5b505af115801561226f573d6000803e3d6000fd5b505050506040513d602081101561228557600080fd5b81019080805190602001909291905050509050919050565b6000606060008060008060006040805190810160405280600e81526020017f7570677261646546696e616e63650000000000000000000000000000000000008152506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515612435577fac283f5b35fa78f7f5e8923cb5db86b4c10c166580c43bb59f1d1d9ae108b70081604051808060200180602001838103835284818151815260200191508051906020019080838360005b8381101561239b578082015181840152602081019050612380565b50505050905090810190601f1680156123c85780820380516001836020036101000a031916815260200191505b50838103825260318152602001807f4f7065726174696f6e2063616e206f6e6c7920626520706572666f726d65642081526020017f627920636f6e7472616374206f776e6572000000000000000000000000000000815250604001935050505060405180910390a1612bb5565b889750600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663b85220436040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401600060405180830381600087803b1580156124be57600080fd5b505af11580156124d2573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f8201168201806040525060208110156124fc57600080fd5b81019080805164010000000081111561251457600080fd5b8281019050602081018481111561252a57600080fd5b815185602082028301116401000000008211171561254757600080fd5b50509291905050509650600095505b865186101561274f57600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16634773489288888151811015156125ab57fe5b906020019060200201516040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b15801561263357600080fd5b505af1158015612647573d6000803e3d6000fd5b505050506040513d602081101561265d57600080fd5b810190808051906020019092919050505094508773ffffffffffffffffffffffffffffffffffffffff16635b86f599888881518110151561269a57fe5b90602001906020020151876040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050600060405180830381600087803b15801561272a57600080fd5b505af115801561273e573d6000803e3d6000fd5b505050508580600101965050612556565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b15801561282e57600080fd5b505af1158015612842573d6000803e3d6000fd5b505050506040513d602081101561285857600080fd5b81019080805190602001909291905050509350600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16633b789750896040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050600060405180830381600087803b15801561292857600080fd5b505af115801561293c573d6000803e3d6000fd5b50505050600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b158015612a1f57600080fd5b505af1158015612a33573d6000803e3d6000fd5b505050506040513d6020811015612a4957600080fd5b81019080805190602001909291905050509250600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231896040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b158015612b1957600080fd5b505af1158015612b2d573d6000803e3d6000fd5b505050506040513d6020811015612b4357600080fd5b810190808051906020019092919050505091508184141515612b6457600080fd5b600083141515612b7357600080fd5b87600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b505050505050505050565b60606000806040805190810160405280600c81526020017f696d706f727442696449647300000000000000000000000000000000000000008152506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515612d51577fac283f5b35fa78f7f5e8923cb5db86b4c10c166580c43bb59f1d1d9ae108b70081604051808060200180602001838103835284818151815260200191508051906020019080838360005b83811015612cb7578082015181840152602081019050612c9c565b50505050905090810190601f168015612ce45780820380516001836020036101000a031916815260200191505b50838103825260318152602001807f4f7065726174696f6e2063616e206f6e6c7920626520706572666f726d65642081526020017f627920636f6e7472616374206f776e6572000000000000000000000000000000815250604001935050505060405180910390a1612f8e565b8473ffffffffffffffffffffffffffffffffffffffff16634f51bf466040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401600060405180830381600087803b158015612db557600080fd5b505af1158015612dc9573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052506020811015612df357600080fd5b810190808051640100000000811115612e0b57600080fd5b82810190506020810184811115612e2157600080fd5b8151856020820283011164010000000082111715612e3e57600080fd5b50509291905050509350600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166360b4a8fd6040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b158015612ece57600080fd5b505af1158015612ee2573d6000803e3d6000fd5b505050506040513d6020811015612ef857600080fd5b81019080805190602001909291905050509250600091505b8351821015612f6f5760058483815181101515612f2957fe5b9060200190602002015190806001815401808255809150509060018203906000526020600020016000909192909190915090600019169055508180600101925050612f10565b8260001916600654600019161015612f8d5782600681600019169055505b5b5050505050565b6040805190810160405280601181526020017f72656e6f756e63654f776e6572736869700000000000000000000000000000008152506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515613121577fac283f5b35fa78f7f5e8923cb5db86b4c10c166580c43bb59f1d1d9ae108b70081604051808060200180602001838103835284818151815260200191508051906020019080838360005b8381101561308757808201518184015260208101905061306c565b50505050905090810190601f1680156130b45780820380516001836020036101000a031916815260200191505b50838103825260318152602001807f4f7065726174696f6e2063616e206f6e6c7920626520706572666f726d65642081526020017f627920636f6e7472616374206f776e6572000000000000000000000000000000815250604001935050505060405180910390a16131c7565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482060405160405180910390a260008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b50565b6040805190810160405280601581526020017f61646441646472657373546f57686974656c69737400000000000000000000008152506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515613356577fac283f5b35fa78f7f5e8923cb5db86b4c10c166580c43bb59f1d1d9ae108b70081604051808060200180602001838103835284818151815260200191508051906020019080838360005b838110156132bc5780820151818401526020810190506132a1565b50505050905090810190601f1680156132e95780820380516001836020036101000a031916815260200191505b50838103825260318152602001807f4f7065726174696f6e2063616e206f6e6c7920626520706572666f726d65642081526020017f627920636f6e7472616374206f776e6572000000000000000000000000000000815250604001935050505060405180910390a1613396565b613395826040805190810160405280600981526020017f77686974656c6973740000000000000000000000000000000000000000000000815250614aef565b5b5050565b6133a26153a4565b6134378c8c8080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050508b600380602002604051908101604052809291908260036020028082843782019150505050508b8b808060200260200160405190810160405280939291908181526020018383602002808284378201915050505050508a8a8a8a614c23565b905060008160c0015173ffffffffffffffffffffffffffffffffffffffff1614156134615761371e565b61346961511f565b816000015190806001815401808255809150509060018203906000526020600020016000909192909190915090600019169055506134a561488e565b73ffffffffffffffffffffffffffffffffffffffff166308901d78826000015183602001518460400151856060015186608001518760a001518860c001518b8b6040518a63ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808a60001916600019168152602001898152602001888152602001878152602001868152602001851515151581526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200180602001828103825284848281815260200192508082843782019150509a5050505050505050505050600060405180830381600087803b1580156135b957600080fd5b505af11580156135cd573d6000803e3d6000fd5b505050507fc1c99ee430869fdd57d9e1401fc7546d001679cea994ca69954d64de8c58bb5581600001518260c001518e8e8e8e8e6040518088600019166000191681526020018773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200180602001806020018660036020028082843782019150508060200184810384526000815260200160200184810383528989828181526020019250808284378201915050848103825286868281815260200192506020028082843782019150509a505050505050505050505060405180910390a17f5c76eb7e9ced2baf82f03a13622263efa23cdcb95051e5b581fb21c5feb883a881600001518484604051808460001916600019168152602001806020018281038252848482818152602001925080828437820191505094505050505060405180910390a15b505050505050505050505050565b60006040805190810160405280600e81526020017f7570677261646553746f726167650000000000000000000000000000000000008152506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156138ba577fac283f5b35fa78f7f5e8923cb5db86b4c10c166580c43bb59f1d1d9ae108b70081604051808060200180602001838103835284818151815260200191508051906020019080838360005b83811015613820578082015181840152602081019050613805565b50505050905090810190601f16801561384d5780820380516001836020036101000a031916815260200191505b50838103825260318152602001807f4f7065726174696f6e2063616e206f6e6c7920626520706572666f726d65642081526020017f627920636f6e7472616374206f776e6572000000000000000000000000000000815250604001935050505060405180910390a1613aeb565b600091505b6005805490508210156138fb576138ee6005838154811015156138de57fe5b906000526020600020015461403b565b81806001019250506138bf565b6005600061390991906153fd565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166360b4a8fd6040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b15801561398f57600080fd5b505af11580156139a3573d6000803e3d6000fd5b505050506040513d60208110156139b957600080fd5b810190808051906020019092919050505060068160001916905550600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663971fff63846040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050600060405180830381600087803b158015613a9157600080fd5b505af1158015613aa5573d6000803e3d6000fd5b5050505082600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b505050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000613b20614991565b73ffffffffffffffffffffffffffffffffffffffff16638a67f4bf836040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b158015613bba57600080fd5b505af1158015613bce573d6000803e3d6000fd5b505050506040513d6020811015613be457600080fd5b81019080805190602001909291905050509050919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000816001029050919050565b6000613c6f826040805190810160405280600981526020017f77686974656c697374000000000000000000000000000000000000000000000081525061115d565b9050919050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663433b77c7836040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808260001916600019168152602001915050602060405180830381600087803b158015613d1157600080fd5b505af1158015613d25573d6000803e3d6000fd5b505050506040513d6020811015613d3b57600080fd5b81019080805190602001909291905050509050919050565b600581815481101515613d6257fe5b906000526020600020016000915090505481565b6000610fff8260019004169050919050565b6000806000806000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166312e6414e876040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808260001916600019168152602001915050602060405180830381600087803b158015613e2957600080fd5b505af1158015613e3d573d6000803e3d6000fd5b505050506040513d6020811015613e5357600080fd5b81019080805190602001909291905050509350600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a941ff21876040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808260001916600019168152602001915050602060405180830381600087803b158015613eff57600080fd5b505af1158015613f13573d6000803e3d6000fd5b505050506040513d6020811015613f2957600080fd5b81019080805190602001909291905050509250600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166339384126876040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808260001916600019168152602001915050602060405180830381600087803b158015613fd557600080fd5b505af1158015613fe9573d6000803e3d6000fd5b505050506040513d6020811015613fff57600080fd5b810190808051906020019092919050505091506103e84202905081801561402557508084105b801561403057508083115b945050505050919050565b60008061404783613c76565b91503373ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614806140cf57503373ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b15156140da57600080fd5b6140e3836145eb565b9050600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f3fef3a383836040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050600060405180830381600087803b1580156141aa57600080fd5b505af11580156141be573d6000803e3d6000fd5b50505050600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663965acc738460006040518363ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180836000191660001916815260200182815260200192505050600060405180830381600087803b15801561426457600080fd5b505af1158015614278573d6000803e3d6000fd5b50505050600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663745944d58460006040518363ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018083600019166000191681526020018215151515815260200192505050600060405180830381600087803b15801561432257600080fd5b505af1158015614336573d6000803e3d6000fd5b50505050505050565b60006040805190810160405280601781526020017f616464416464726573736573546f57686974656c6973740000000000000000008152506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156144cd577fac283f5b35fa78f7f5e8923cb5db86b4c10c166580c43bb59f1d1d9ae108b70081604051808060200180602001838103835284818151815260200191508051906020019080838360005b83811015614433578082015181840152602081019050614418565b50505050905090810190601f1680156144605780820380516001836020036101000a031916815260200191505b50838103825260318152602001807f4f7065726174696f6e2063616e206f6e6c7920626520706572666f726d65642081526020017f627920636f6e7472616374206f776e6572000000000000000000000000000000815250604001935050505060405180910390a1614509565b600091505b8251821015614508576144fb83838151811015156144ec57fe5b906020019060200201516131ca565b81806001019250506144d2565b5b505050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166312e6414e836040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808260001916600019168152602001915050602060405180830381600087803b1580156145a957600080fd5b505af11580156145bd573d6000803e3d6000fd5b505050506040513d60208110156145d357600080fd5b81019080805190602001909291905050509050919050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663094fb864836040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808260001916600019168152602001915050602060405180830381600087803b15801561468657600080fd5b505af115801561469a573d6000803e3d6000fd5b505050506040513d60208110156146b057600080fd5b81019080805190602001909291905050509050919050565b60065481565b6040805190810160405280601181526020017f7472616e736665724f776e6572736869700000000000000000000000000000008152506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561485a577fac283f5b35fa78f7f5e8923cb5db86b4c10c166580c43bb59f1d1d9ae108b70081604051808060200180602001838103835284818151815260200191508051906020019080838360005b838110156147c05780820151818401526020810190506147a5565b50505050905090810190601f1680156147ed5780820380516001836020036101000a031916815260200191505b50838103825260318152602001807f4f7065726174696f6e2063616e206f6e6c7920626520706572666f726d65642081526020017f627920636f6e7472616374206f776e6572000000000000000000000000000000815250604001935050505060405180910390a1614864565b61486382615128565b5b5050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6148c282826148d1565b15156148cd57600080fd5b5050565b60008260000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b6000818381151561493757fe5b04905092915050565b6000808314156149535760009050614972565b818302905081838281151561496457fe5b0414151561496e57fe5b8090505b92915050565b600082821115151561498657fe5b818303905092915050565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b614a38826007836040518082805190602001908083835b6020831015156149f757805182526020820191506020810190506020830392506149d2565b6001836020036101000a03801982511681845116808217855250505050505090500191505090815260200160405180910390206152e890919063ffffffff16565b8173ffffffffffffffffffffffffffffffffffffffff167fd211483f91fc6eff862467f8de606587a30c8fc9981056f051b897a418df803a826040518080602001828103825283818151815260200191508051906020019080838360005b83811015614ab1578082015181840152602081019050614a96565b50505050905090810190601f168015614ade5780820380516001836020036101000a031916815260200191505b509250505060405180910390a25050565b614b6c826007836040518082805190602001908083835b602083101515614b2b5780518252602082019150602081019050602083039250614b06565b6001836020036101000a038019825116818451168082178552505050505050905001915050908152602001604051809103902061534690919063ffffffff16565b8173ffffffffffffffffffffffffffffffffffffffff167fbfec83d64eaa953f2708271a023ab9ee82057f8f3578d548c1a4ba0b5b700489826040518080602001828103825283818151815260200191508051906020019080838360005b83811015614be5578082015181840152602081019050614bca565b50505050905090810190601f168015614c125780820380516001836020036101000a031916815260200191505b509250505060405180910390a25050565b614c2b6153a4565b6000614c356153a4565b868610151515614c4457600080fd5b848410151515614c5357600080fd5b85600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e33306040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200192505050602060405180830381600087803b158015614d4557600080fd5b505af1158015614d59573d6000803e3d6000fd5b505050506040513d6020811015614d6f57600080fd5b810190808051906020019092919050505010151561506d57600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd33600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16896040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b158015614ea257600080fd5b505af1158015614eb6573d6000803e3d6000fd5b505050506040513d6020811015614ecc57600080fd5b810190808051906020019092919050505050600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16635b86f59933886040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050600060405180830381600087803b158015614fa357600080fd5b505af1158015614fb7573d6000803e3d6000fd5b50505050614fc6600654613d76565b9150614fd782600101925082613c21565b6006816000191690555086816020018181525050848160600181815250508381608001818152505085816040018181525050338160c0019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505060018160a00190151590811515815250506006548160000190600019169081600019168152505061510f565b7fac283f5b35fa78f7f5e8923cb5db86b4c10c166580c43bb59f1d1d9ae108b7006040518080602001806020018381038352600e8152602001807f63726561746543616d706169676e000000000000000000000000000000000000815250602001838103825260148152602001807f4e6f7420656e6f75676820616c6c6f77616e63650000000000000000000000008152506020019250505060405180910390a15b8092505050979650505050505050565b60006005905090565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415615229577fac283f5b35fa78f7f5e8923cb5db86b4c10c166580c43bb59f1d1d9ae108b700604051808060200180602001838103835260118152602001807f7472616e736665724f776e657273686970000000000000000000000000000000815250602001838103825260328152602001807f4e6577206f776e657227732061646472657373206e6565647320746f2062652081526020017f646966666572656e74207468616e2030783000000000000000000000000000008152506040019250505060405180910390a16152e5565b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b50565b60008260000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b60018260000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b60e0604051908101604052806000801916815260200160008152602001600081526020016000815260200160008152602001600015158152602001600073ffffffffffffffffffffffffffffffffffffffff1681525090565b508054600082559060005260206000209081019061541b919061541e565b50565b61544091905b8082111561543c576000816000905550600101615424565b5090565b905600a165627a7a723058206fbdf2b841fd4ad34b2811d558f9ab33fa0f1e2a354aebae95957268fb86f7750029

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

0000000000000000000000001a7a8bd9106f2b8d977e08582dc7d24c723ab0db000000000000000000000000c18dac9b511bd8f99f5effd7a0d18152f965c39300000000000000000000000063fe92c3817baea5b3e32e416ce2f1aac66f4a8d

-----Decoded View---------------
Arg [0] : _addrAppc (address): 0x1a7a8BD9106F2B8D977E08582DC7d24c723ab0DB
Arg [1] : _addrAdverStorage (address): 0xC18DaC9b511bd8F99F5eFfD7a0d18152f965c393
Arg [2] : _addrAdverFinance (address): 0x63fE92C3817baea5b3e32E416CE2f1aAc66F4A8D

-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 0000000000000000000000001a7a8bd9106f2b8d977e08582dc7d24c723ab0db
Arg [1] : 000000000000000000000000c18dac9b511bd8f99f5effd7a0d18152f965c393
Arg [2] : 00000000000000000000000063fe92c3817baea5b3e32e416ce2f1aac66f4a8d


Swarm Source

bzzr://6fbdf2b841fd4ad34b2811d558f9ab33fa0f1e2a354aebae95957268fb86f775

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading
[ Download: CSV Export  ]

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.