Contract 0x93c7be34522fbe61b07d47887ed106883586a62d

Contract Overview

Balance:
0 Ether
TxHash Block Age From To Value [TxFee]
0x48d1888634dc08c208c9f5ae80d7326cf5b73e3dacbb2e38bae4deeee546590c484948359 days 23 hrs ago0xc82d8a761ed3b580d649b569b764be6f6067544b IN  0x93c7be34522fbe61b07d47887ed106883586a62d0.005525 Ether0.000102814
0x5bb80c6f0eeba8fa61a01abec2caa9c60a7dbf37ca50b57df31701bfbe0968d7484924859 days 23 hrs ago0x669724233d3128b60c7801c6e6ade2d4f57e00c2 IN  0x93c7be34522fbe61b07d47887ed106883586a62d0.005525 Ether0.000080172
0xf1c3cc9d53a3a3f37734d2b5b4f69a79330c980bd19afae1043c391ed2cb43ed484923360 days 2 mins ago0x02daa070dc53a72f0bff4af578eb32d07d947d38 IN  0x93c7be34522fbe61b07d47887ed106883586a62d0.005525 Ether0.000102814
0x0b665309a4e7ebe352d36c4c9a60cccb09eb3bdb5fc7a6828a9938b15f186c33484515760 days 17 hrs ago0x1763fedd7cc59e6bff351a2dad82a055e15bfcc9 IN  0x93c7be34522fbe61b07d47887ed106883586a62d0.005525 Ether0.000080172
0x8e4799591791999e294d48ab91f68df9f13e4b414f53c02c1a95ddc2dd48735c484514660 days 17 hrs ago0x3fe243a3ad8e050e47c6286cc2bcc32dcb4d9c95 IN  0x93c7be34522fbe61b07d47887ed106883586a62d0.005525 Ether0.000102814
0x294d56daf8c8c88915622482b7d7727258e219090ed22d17352769cf8d26eee4484511560 days 17 hrs ago0x223ad269d83b18c6a00647ca9b9255f127cdf650 IN  0x93c7be34522fbe61b07d47887ed106883586a62d0.005525 Ether0.000080172
0x3c6241594ae15cb3c170bbfdbdf44b9beefff22e3e60faeccf6c8263f3d3f8e4484510460 days 17 hrs ago0xd6fc43e3c164dc35219a126ebddcee1a51ebd7c0 IN  0x93c7be34522fbe61b07d47887ed106883586a62d0.005525 Ether0.000080172
0x3cc4aceae928e2d61769edb783777bd8f8ce6971db1aef34f2be09879b4d41b8484508960 days 17 hrs ago0x11106e05601efe0b2c41c5f26eba3f0533e5c10f IN  0x93c7be34522fbe61b07d47887ed106883586a62d0.005525 Ether0.000102814
0x46c3bee151f07fc70fd0a100dafc2d2849fdcf86023791d66a865b9198125ab3484506760 days 17 hrs ago0x6418f26d94f2e5dd1c92fbffbca6f41897b292d1 IN  0x93c7be34522fbe61b07d47887ed106883586a62d0.005529 Ether0.000080172
0x73e70533f7ee0d65d23d9b14ecd72b6cace2dcadf2bec5ca7b58a12f63e55051484505660 days 18 hrs ago0x32da942ecbd080056d94ea4ed36af28fe334868a IN  0x93c7be34522fbe61b07d47887ed106883586a62d0.005529 Ether0.000102814
0xef4d9887f3d34a55286e2e068aa706fcbdacade41ccbe030841e7a3e8ac6c5ee484504560 days 18 hrs ago0x82a3487ccc2488f8adb11c6e122bf96b8764c759 IN  0x93c7be34522fbe61b07d47887ed106883586a62d0.005529 Ether0.000080172
0x4cb4c7a409029344edd8f5cd97f7ef2b6b2cf7bc038a06be5296982c18df6e0b484471360 days 19 hrs ago0xcf7259164bd6e9f0fc06ffd57dcf2a8b886c39ce IN  0x93c7be34522fbe61b07d47887ed106883586a62d0.005529 Ether0.000102814
0xe280c27e9413f450735a6d1b93e7091d6d371815abd24db3590f4c3ebecd5f38484459160 days 19 hrs ago0xa046547e48cb860b58a0d2b32a087a7c67f427f8 IN  0x93c7be34522fbe61b07d47887ed106883586a62d0.005529 Ether0.000080172
0x59d894895b341385cabc88b0eeaa149fe14d65535edbd4eba7703388b957efeb484458060 days 19 hrs ago0x7927867bb1e00e1020b21ad360464442a949499d IN  0x93c7be34522fbe61b07d47887ed106883586a62d0.005529 Ether0.000080172
0xe5b91e76f4fa64096dda18494d0a8d1e01e2a6fdffd033cb6cacec9c2762801c484457160 days 19 hrs ago0x2b136f28c3354f2fbf65af7653668ad4fb60ce0a IN  0x93c7be34522fbe61b07d47887ed106883586a62d0.005529 Ether0.000102814
0x5e60b9dbbf55acf0a097f2b507edde00f8c388d34aadeb50997740ba39b6fb20484455560 days 20 hrs ago0x9d02ffbb4a632b90702ac011c3941dc0e9b96e90 IN  0x93c7be34522fbe61b07d47887ed106883586a62d0.005529 Ether0.000102814
0x470681971b038a1da3f8ddab13d8b91947b995b9383422a8a9a1de2e7cf61f69484447960 days 20 hrs ago0x7c7a098405a91b1c1ac36ca9186174a701a81a1f IN  0x93c7be34522fbe61b07d47887ed106883586a62d0 Ether0.000061809
0x5c00d7f8b2722a7b6f1512cfdf96538e47ca484d85abdc35468312373485b14c484437860 days 20 hrs ago0x3bb4fd883cad584883b83ebea63b74ad5ebe28e1 IN  0x93c7be34522fbe61b07d47887ed106883586a62d0 Ether0.000057025
0x3f0ee2099bccf7aa959f9e2cd53b62151644b16f50244a3a16d3a9c992f9b79d484432860 days 21 hrs ago0xe1ce6ec224067a426072eb9778fa744f90b0e4dc IN  0x93c7be34522fbe61b07d47887ed106883586a62d0.005529 Ether0.000102814
0x2faa37269075e8e86f644805fd95c7f55ff7620ebb7fbe6c6e3f5be3231b3054484430060 days 21 hrs ago0x0d5d93518910fce6debd60d2368f67759531d69b IN  0x93c7be34522fbe61b07d47887ed106883586a62d0.000056 Ether0.00010275
0xd5d45353f9577736067b576f0e971a05461df6e7afc06912e4148d1fc0dddee0484323961 days 1 hr ago0x23666d1b556c8efc91cb5094265c3e5cd63538d8 IN  0x93c7be34522fbe61b07d47887ed106883586a62d0.005525 Ether0.000102814
0x8499b98fdc6877a8775928c9a2d2cda05a93cf0c10c20906a206ffc4e96d3ee6484319161 days 1 hr ago0xdef27d6d8c2cb891d953ca48ae73a2fd0a33bc58 IN  0x93c7be34522fbe61b07d47887ed106883586a62d0.005525 Ether0.000102814
0xe4a062771707cfd82e734fc5ecdb446a9c3e2082086e725c087977d5e2749f18483838961 days 18 hrs ago0x7d82f7af6be376598de9b81da1a1aa1fc05b29b9 IN  0x93c7be34522fbe61b07d47887ed106883586a62d0.005535 Ether0.000102814
0x318627e1133c85654132fb26b789f01f8a59a008cc52bb392bdf993551c82530483834661 days 18 hrs ago0x1475ce85c797f694bc3d93c5fe389c5e0abc9b80 IN  0x93c7be34522fbe61b07d47887ed106883586a62d0.005535 Ether0.000102814
0x1e864c755862dee5526ac4092261dc809dbf78f90d477e08fd5b2d55a59d01d2483832361 days 18 hrs ago0xf1e230ebcdc973caa7f45d7bae0bd3126bc2aa1b IN  0x93c7be34522fbe61b07d47887ed106883586a62d0.005535 Ether0.000102814
[ Download CSV Export 

Latest 25 internal transaction, Click here to view more Internal Transactions as a result of Contract Execution

Parent TxHash Block Age From To Value
0x48d1888634dc08c208c9f5ae80d7326cf5b73e3dacbb2e38bae4deeee546590c484948359 days 23 hrs ago0x93c7be34522fbe61b07d47887ed106883586a62d0x4c40f17413b9fa0b74c3e0d5df5012f6dcb1f18f0.005525 Ether
0x48d1888634dc08c208c9f5ae80d7326cf5b73e3dacbb2e38bae4deeee546590c484948359 days 23 hrs ago0x93c7be34522fbe61b07d47887ed106883586a62d0x53df7d0c61d9b32fa6d5a1fb1024d1bfb78c4c330 Ether
0x5bb80c6f0eeba8fa61a01abec2caa9c60a7dbf37ca50b57df31701bfbe0968d7484924859 days 23 hrs ago0x93c7be34522fbe61b07d47887ed106883586a62d0x4c40f17413b9fa0b74c3e0d5df5012f6dcb1f18f0.005525 Ether
0x5bb80c6f0eeba8fa61a01abec2caa9c60a7dbf37ca50b57df31701bfbe0968d7484924859 days 23 hrs ago0x93c7be34522fbe61b07d47887ed106883586a62d0x53df7d0c61d9b32fa6d5a1fb1024d1bfb78c4c330 Ether
0xf1c3cc9d53a3a3f37734d2b5b4f69a79330c980bd19afae1043c391ed2cb43ed484923360 days 2 mins ago0x93c7be34522fbe61b07d47887ed106883586a62d0x4c40f17413b9fa0b74c3e0d5df5012f6dcb1f18f0.005525 Ether
0xf1c3cc9d53a3a3f37734d2b5b4f69a79330c980bd19afae1043c391ed2cb43ed484923360 days 2 mins ago0x93c7be34522fbe61b07d47887ed106883586a62d0x53df7d0c61d9b32fa6d5a1fb1024d1bfb78c4c330 Ether
0x0b665309a4e7ebe352d36c4c9a60cccb09eb3bdb5fc7a6828a9938b15f186c33484515760 days 17 hrs ago0x93c7be34522fbe61b07d47887ed106883586a62d0x4c40f17413b9fa0b74c3e0d5df5012f6dcb1f18f0.005525 Ether
0x0b665309a4e7ebe352d36c4c9a60cccb09eb3bdb5fc7a6828a9938b15f186c33484515760 days 17 hrs ago0x93c7be34522fbe61b07d47887ed106883586a62d0x53df7d0c61d9b32fa6d5a1fb1024d1bfb78c4c330 Ether
0x8e4799591791999e294d48ab91f68df9f13e4b414f53c02c1a95ddc2dd48735c484514660 days 17 hrs ago0x93c7be34522fbe61b07d47887ed106883586a62d0x4c40f17413b9fa0b74c3e0d5df5012f6dcb1f18f0.005525 Ether
0x8e4799591791999e294d48ab91f68df9f13e4b414f53c02c1a95ddc2dd48735c484514660 days 17 hrs ago0x93c7be34522fbe61b07d47887ed106883586a62d0x53df7d0c61d9b32fa6d5a1fb1024d1bfb78c4c330 Ether
0x294d56daf8c8c88915622482b7d7727258e219090ed22d17352769cf8d26eee4484511560 days 17 hrs ago0x93c7be34522fbe61b07d47887ed106883586a62d0x4c40f17413b9fa0b74c3e0d5df5012f6dcb1f18f0.005525 Ether
0x294d56daf8c8c88915622482b7d7727258e219090ed22d17352769cf8d26eee4484511560 days 17 hrs ago0x93c7be34522fbe61b07d47887ed106883586a62d0x53df7d0c61d9b32fa6d5a1fb1024d1bfb78c4c330 Ether
0x3c6241594ae15cb3c170bbfdbdf44b9beefff22e3e60faeccf6c8263f3d3f8e4484510460 days 17 hrs ago0x93c7be34522fbe61b07d47887ed106883586a62d0x4c40f17413b9fa0b74c3e0d5df5012f6dcb1f18f0.005525 Ether
0x3c6241594ae15cb3c170bbfdbdf44b9beefff22e3e60faeccf6c8263f3d3f8e4484510460 days 17 hrs ago0x93c7be34522fbe61b07d47887ed106883586a62d0x53df7d0c61d9b32fa6d5a1fb1024d1bfb78c4c330 Ether
0x3cc4aceae928e2d61769edb783777bd8f8ce6971db1aef34f2be09879b4d41b8484508960 days 17 hrs ago0x93c7be34522fbe61b07d47887ed106883586a62d0x4c40f17413b9fa0b74c3e0d5df5012f6dcb1f18f0.005525 Ether
0x3cc4aceae928e2d61769edb783777bd8f8ce6971db1aef34f2be09879b4d41b8484508960 days 17 hrs ago0x93c7be34522fbe61b07d47887ed106883586a62d0x53df7d0c61d9b32fa6d5a1fb1024d1bfb78c4c330 Ether
0x46c3bee151f07fc70fd0a100dafc2d2849fdcf86023791d66a865b9198125ab3484506760 days 17 hrs ago0x93c7be34522fbe61b07d47887ed106883586a62d0x4c40f17413b9fa0b74c3e0d5df5012f6dcb1f18f0.005529 Ether
0x46c3bee151f07fc70fd0a100dafc2d2849fdcf86023791d66a865b9198125ab3484506760 days 17 hrs ago0x93c7be34522fbe61b07d47887ed106883586a62d0x53df7d0c61d9b32fa6d5a1fb1024d1bfb78c4c330 Ether
0x73e70533f7ee0d65d23d9b14ecd72b6cace2dcadf2bec5ca7b58a12f63e55051484505660 days 18 hrs ago0x93c7be34522fbe61b07d47887ed106883586a62d0x4c40f17413b9fa0b74c3e0d5df5012f6dcb1f18f0.005529 Ether
0x73e70533f7ee0d65d23d9b14ecd72b6cace2dcadf2bec5ca7b58a12f63e55051484505660 days 18 hrs ago0x93c7be34522fbe61b07d47887ed106883586a62d0x53df7d0c61d9b32fa6d5a1fb1024d1bfb78c4c330 Ether
0xef4d9887f3d34a55286e2e068aa706fcbdacade41ccbe030841e7a3e8ac6c5ee484504560 days 18 hrs ago0x93c7be34522fbe61b07d47887ed106883586a62d0x4c40f17413b9fa0b74c3e0d5df5012f6dcb1f18f0.005529 Ether
0xef4d9887f3d34a55286e2e068aa706fcbdacade41ccbe030841e7a3e8ac6c5ee484504560 days 18 hrs ago0x93c7be34522fbe61b07d47887ed106883586a62d0x53df7d0c61d9b32fa6d5a1fb1024d1bfb78c4c330 Ether
0x4cb4c7a409029344edd8f5cd97f7ef2b6b2cf7bc038a06be5296982c18df6e0b484471360 days 19 hrs ago0x93c7be34522fbe61b07d47887ed106883586a62d0x4c40f17413b9fa0b74c3e0d5df5012f6dcb1f18f0.005529 Ether
0x4cb4c7a409029344edd8f5cd97f7ef2b6b2cf7bc038a06be5296982c18df6e0b484471360 days 19 hrs ago0x93c7be34522fbe61b07d47887ed106883586a62d0x53df7d0c61d9b32fa6d5a1fb1024d1bfb78c4c330 Ether
0xe280c27e9413f450735a6d1b93e7091d6d371815abd24db3590f4c3ebecd5f38484459160 days 19 hrs ago0x93c7be34522fbe61b07d47887ed106883586a62d0x4c40f17413b9fa0b74c3e0d5df5012f6dcb1f18f0.005529 Ether
[ Download CSV Export 
Contract Source Code Verified (Similar Match)
Note: This contract matches the deployed ByteCode of the Verified Source Code for Contract 0xc5bedb88fb3b78ffd6b1bf32488dfee4fb9b58d6
Contract Name: PrivatePaymentProcessor
Compiler Version: v0.4.25+commit.59dbf8f1
Optimization Enabled: Yes
Runs (Optimizer):  200


Contract Source Code
pragma solidity ^0.4.24;

// File: openzeppelin-solidity/contracts/math/SafeMath.sol

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

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

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

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

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

// File: openzeppelin-solidity/contracts/ownership/Ownable.sol

/**
 * @title Ownable
 * @dev The Ownable contract has an owner address, and provides basic authorization control
 * functions, this simplifies the implementation of "user permissions".
 */
contract Ownable {
  address public owner;


  event OwnershipRenounced(address indexed previousOwner);
  event OwnershipTransferred(
    address indexed previousOwner,
    address indexed newOwner
  );


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

  /**
   * @dev Throws if called by any account other than the owner.
   */
  modifier onlyOwner() {
    require(msg.sender == owner);
    _;
  }

  /**
   * @dev 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 {
    emit OwnershipRenounced(owner);
    owner = address(0);
  }

  /**
   * @dev 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(_newOwner);
  }

  /**
   * @dev Transfers control of the contract to a newOwner.
   * @param _newOwner The address to transfer ownership to.
   */
  function _transferOwnership(address _newOwner) internal {
    require(_newOwner != address(0));
    emit OwnershipTransferred(owner, _newOwner);
    owner = _newOwner;
  }
}

// File: openzeppelin-solidity/contracts/lifecycle/Pausable.sol

/**
 * @title Pausable
 * @dev Base contract which allows children to implement an emergency stop mechanism.
 */
contract Pausable is Ownable {
  event Pause();
  event Unpause();

  bool public paused = false;


  /**
   * @dev Modifier to make a function callable only when the contract is not paused.
   */
  modifier whenNotPaused() {
    require(!paused);
    _;
  }

  /**
   * @dev Modifier to make a function callable only when the contract is paused.
   */
  modifier whenPaused() {
    require(paused);
    _;
  }

  /**
   * @dev called by the owner to pause, triggers stopped state
   */
  function pause() public onlyOwner whenNotPaused {
    paused = true;
    emit Pause();
  }

  /**
   * @dev called by the owner to unpause, returns to normal state
   */
  function unpause() public onlyOwner whenPaused {
    paused = false;
    emit Unpause();
  }
}

// File: openzeppelin-solidity/contracts/lifecycle/Destructible.sol

/**
 * @title Destructible
 * @dev Base contract that can be destroyed by owner. All funds in contract will be sent to the owner.
 */
contract Destructible is Ownable {
  /**
   * @dev Transfers the current balance to the owner and terminates the contract.
   */
  function destroy() public onlyOwner {
    selfdestruct(owner);
  }

  function destroyAndSend(address _recipient) public onlyOwner {
    selfdestruct(_recipient);
  }
}

// File: openzeppelin-solidity/contracts/ownership/Contactable.sol

/**
 * @title Contactable token
 * @dev Basic version of a contactable contract, allowing the owner to provide a string with their
 * contact information.
 */
contract Contactable is Ownable {

  string public contactInformation;

  /**
    * @dev Allows the owner to set a string with their contact information.
    * @param _info The contact information to attach to the contract.
    */
  function setContactInformation(string _info) public onlyOwner {
    contactInformation = _info;
  }
}

// File: contracts/Restricted.sol

/** @title Restricted
 *  Exposes onlyMonetha modifier
 */
contract Restricted is Ownable {

    //MonethaAddress set event
    event MonethaAddressSet(
        address _address,
        bool _isMonethaAddress
    );

    mapping (address => bool) public isMonethaAddress;

    /**
     *  Restrict methods in such way, that they can be invoked only by monethaAddress account.
     */
    modifier onlyMonetha() {
        require(isMonethaAddress[msg.sender]);
        _;
    }

    /**
     *  Allows owner to set new monetha address
     */
    function setMonethaAddress(address _address, bool _isMonethaAddress) onlyOwner public {
        isMonethaAddress[_address] = _isMonethaAddress;

        emit MonethaAddressSet(_address, _isMonethaAddress);
    }
}

// File: contracts/GenericERC20.sol

/**
* @title GenericERC20 interface
*/
contract GenericERC20 {
    function totalSupply() public view returns (uint256);

    function decimals() public view returns(uint256);

    function balanceOf(address _who) public view returns (uint256);

    function allowance(address _owner, address _spender)
        public view returns (uint256);
        
    // Return type not defined intentionally since not all ERC20 tokens return proper result type
    function transfer(address _to, uint256 _value) public;

    function approve(address _spender, uint256 _value)
        public returns (bool);

    function transferFrom(address _from, address _to, uint256 _value)
        public returns (bool);

    event Transfer(
        address indexed from,
        address indexed to,
        uint256 value
    );

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

// File: contracts/IMonethaVoucher.sol

interface IMonethaVoucher {
    /**
    * @dev Total number of vouchers in shared pool
    */
    function totalInSharedPool() external view returns (uint256);

    /**
     * @dev Converts vouchers to equivalent amount of wei.
     * @param _value amount of vouchers (vouchers) to convert to amount of wei
     * @return A uint256 specifying the amount of wei.
     */
    function toWei(uint256 _value) external view returns (uint256);

    /**
     * @dev Converts amount of wei to equivalent amount of vouchers.
     * @param _value amount of wei to convert to vouchers (vouchers)
     * @return A uint256 specifying the amount of vouchers.
     */
    function fromWei(uint256 _value) external view returns (uint256);

    /**
     * @dev Applies discount for address by returning vouchers to shared pool and transferring funds (in wei). May be called only by Monetha.
     * @param _for address to apply discount for
     * @param _vouchers amount of vouchers to return to shared pool
     * @return Actual number of vouchers returned to shared pool and amount of funds (in wei) transferred.
     */
    function applyDiscount(address _for, uint256 _vouchers) external returns (uint256 amountVouchers, uint256 amountWei);

    /**
     * @dev Applies payback by transferring vouchers from the shared pool to the user.
     * The amount of transferred vouchers is equivalent to the amount of Ether in the `_amountWei` parameter.
     * @param _for address to apply payback for
     * @param _amountWei amount of Ether to estimate the amount of vouchers
     * @return The number of vouchers added
     */
    function applyPayback(address _for, uint256 _amountWei) external returns (uint256 amountVouchers);

    /**
     * @dev Function to buy vouchers by transferring equivalent amount in Ether to contract. May be called only by Monetha.
     * After the vouchers are purchased, they can be sold or released to another user. Purchased vouchers are stored in
     * a separate pool and may not be expired.
     * @param _vouchers The amount of vouchers to buy. The caller must also transfer an equivalent amount of Ether.
     */
    function buyVouchers(uint256 _vouchers) external payable;

    /**
     * @dev The function allows Monetha account to sell previously purchased vouchers and get Ether from the sale.
     * The equivalent amount of Ether will be transferred to the caller. May be called only by Monetha.
     * @param _vouchers The amount of vouchers to sell.
     * @return A uint256 specifying the amount of Ether (in wei) transferred to the caller.
     */
    function sellVouchers(uint256 _vouchers) external returns(uint256 weis);

    /**
     * @dev Function allows Monetha account to release the purchased vouchers to any address.
     * The released voucher acquires an expiration property and should be used in Monetha ecosystem within 6 months, otherwise
     * it will be returned to shared pool. May be called only by Monetha.
     * @param _to address to release vouchers to.
     * @param _value the amount of vouchers to release.
     */
    function releasePurchasedTo(address _to, uint256 _value) external returns (bool);

    /**
     * @dev Function to check the amount of vouchers that an owner (Monetha account) allowed to sell or release to some user.
     * @param owner The address which owns the funds.
     * @return A uint256 specifying the amount of vouchers still available for the owner.
     */
    function purchasedBy(address owner) external view returns (uint256);
}

// File: contracts/MonethaGateway.sol

/**
 *  @title MonethaGateway
 *
 *  MonethaGateway forward funds from order payment to merchant's wallet and collects Monetha fee.
 */
contract MonethaGateway is Pausable, Contactable, Destructible, Restricted {

    using SafeMath for uint256;

    string constant VERSION = "0.6";

    /**
     *  Fee permille of Monetha fee.
     *  1 permille (‰) = 0.1 percent (%)
     *  15‰ = 1.5%
     */
    uint public constant FEE_PERMILLE = 15;


    uint public constant PERMILLE_COEFFICIENT = 1000;

    /**
     *  Address of Monetha Vault for fee collection
     */
    address public monethaVault;

    /**
     *  Account for permissions managing
     */
    address public admin;

    /**
     * Monetha voucher contract
     */
    IMonethaVoucher public monethaVoucher;

    /**
     *  Max. discount permille.
     *  10 permille = 1 %
     */
    uint public MaxDiscountPermille;

    event PaymentProcessedEther(address merchantWallet, uint merchantIncome, uint monethaIncome);
    event PaymentProcessedToken(address tokenAddress, address merchantWallet, uint merchantIncome, uint monethaIncome);
    event MonethaVoucherChanged(
        address indexed previousMonethaVoucher,
        address indexed newMonethaVoucher
    );
    event MaxDiscountPermilleChanged(uint prevPermilleValue, uint newPermilleValue);

    /**
     *  @param _monethaVault Address of Monetha Vault
     */
    constructor(address _monethaVault, address _admin, IMonethaVoucher _monethaVoucher) public {
        require(_monethaVault != 0x0);
        monethaVault = _monethaVault;

        setAdmin(_admin);
        setMonethaVoucher(_monethaVoucher);
        setMaxDiscountPermille(700); // 70%
    }

    /**
     *  acceptPayment accept payment from PaymentAcceptor, forwards it to merchant's wallet
     *      and collects Monetha fee.
     *  @param _merchantWallet address of merchant's wallet for fund transfer
     *  @param _monethaFee is a fee collected by Monetha
     */
    function acceptPayment(address _merchantWallet,
        uint _monethaFee,
        address _customerAddress,
        uint _vouchersApply,
        uint _paybackPermille)
    external payable onlyMonetha whenNotPaused returns (uint discountWei){
        require(_merchantWallet != 0x0);
        uint price = msg.value;
        // Monetha fee cannot be greater than 1.5% of payment
        require(_monethaFee >= 0 && _monethaFee <= FEE_PERMILLE.mul(price).div(1000));

        discountWei = 0;
        if (monethaVoucher != address(0) && _vouchersApply > 0) {
            if (MaxDiscountPermille > 0) {
                uint maxDiscountWei = price.mul(MaxDiscountPermille).div(PERMILLE_COEFFICIENT);
                uint maxVouchers = monethaVoucher.fromWei(maxDiscountWei);
                // limit vouchers to apply
                uint vouchersApply = _vouchersApply;
                if (vouchersApply > maxVouchers) {
                    vouchersApply = maxVouchers;
                }

                (, discountWei) = monethaVoucher.applyDiscount(_customerAddress, vouchersApply);
            }

            if (_paybackPermille > 0) {
                uint paybackWei = price.sub(discountWei).mul(_paybackPermille).div(PERMILLE_COEFFICIENT);
                if (paybackWei > 0) {
                    monethaVoucher.applyPayback(_customerAddress, paybackWei);
                }
            }
        }

        uint merchantIncome = price.sub(_monethaFee);

        _merchantWallet.transfer(merchantIncome);
        monethaVault.transfer(_monethaFee);

        emit PaymentProcessedEther(_merchantWallet, merchantIncome, _monethaFee);
    }

    /**
     *  acceptTokenPayment accept token payment from PaymentAcceptor, forwards it to merchant's wallet
     *      and collects Monetha fee.
     *  @param _merchantWallet address of merchant's wallet for fund transfer
     *  @param _monethaFee is a fee collected by Monetha
     *  @param _tokenAddress is the token address
     *  @param _value is the order value
     */
    function acceptTokenPayment(
        address _merchantWallet,
        uint _monethaFee,
        address _tokenAddress,
        uint _value
    )
    external onlyMonetha whenNotPaused
    {
        require(_merchantWallet != 0x0);

        // Monetha fee cannot be greater than 1.5% of payment
        require(_monethaFee >= 0 && _monethaFee <= FEE_PERMILLE.mul(_value).div(1000));

        uint merchantIncome = _value.sub(_monethaFee);

        GenericERC20(_tokenAddress).transfer(_merchantWallet, merchantIncome);
        GenericERC20(_tokenAddress).transfer(monethaVault, _monethaFee);

        emit PaymentProcessedToken(_tokenAddress, _merchantWallet, merchantIncome, _monethaFee);
    }

    /**
     *  changeMonethaVault allows owner to change address of Monetha Vault.
     *  @param newVault New address of Monetha Vault
     */
    function changeMonethaVault(address newVault) external onlyOwner whenNotPaused {
        monethaVault = newVault;
    }

    /**
     *  Allows other monetha account or contract to set new monetha address
     */
    function setMonethaAddress(address _address, bool _isMonethaAddress) public {
        require(msg.sender == admin || msg.sender == owner);

        isMonethaAddress[_address] = _isMonethaAddress;

        emit MonethaAddressSet(_address, _isMonethaAddress);
    }

    /**
     *  setAdmin allows owner to change address of admin.
     *  @param _admin New address of admin
     */
    function setAdmin(address _admin) public onlyOwner {
        require(_admin != address(0));
        admin = _admin;
    }

    /**
     *  setAdmin allows owner to change address of Monetha voucher contract. If set to 0x0 address, discounts and paybacks are disabled.
     *  @param _monethaVoucher New address of Monetha voucher contract
     */
    function setMonethaVoucher(IMonethaVoucher _monethaVoucher) public onlyOwner {
        if (monethaVoucher != _monethaVoucher) {
            emit MonethaVoucherChanged(monethaVoucher, _monethaVoucher);
            monethaVoucher = _monethaVoucher;
        }
    }

    /**
     *  setMaxDiscountPermille allows Monetha to change max.discount percentage
     *  @param _maxDiscountPermille New value of max.discount (in permille)
     */
    function setMaxDiscountPermille(uint _maxDiscountPermille) public onlyOwner {
        require(_maxDiscountPermille <= PERMILLE_COEFFICIENT);
        emit MaxDiscountPermilleChanged(MaxDiscountPermille, _maxDiscountPermille);
        MaxDiscountPermille = _maxDiscountPermille;
    }
}

// File: contracts/SafeDestructible.sol

/**
 * @title SafeDestructible
 * Base contract that can be destroyed by owner.
 * Can be destructed if there are no funds on contract balance.
 */
contract SafeDestructible is Ownable {
    function destroy() onlyOwner public {
        require(address(this).balance == 0);
        selfdestruct(owner);
    }
}

// File: contracts/MerchantWallet.sol

/**
 *  @title MerchantWallet
 *  Serves as a public Merchant profile with merchant profile info,
 *      payment settings and latest reputation value.
 *  Also MerchantWallet accepts payments for orders.
 */

contract MerchantWallet is Pausable, SafeDestructible, Contactable, Restricted {

    string constant VERSION = "0.5";

    /// Address of merchant's account, that can withdraw from wallet
    address public merchantAccount;

    /// Address of merchant's fund address.
    address public merchantFundAddress;

    /// Unique Merchant identifier hash
    bytes32 public merchantIdHash;

    /// profileMap stores general information about the merchant
    mapping (string=>string) profileMap;

    /// paymentSettingsMap stores payment and order settings for the merchant
    mapping (string=>string) paymentSettingsMap;

    /// compositeReputationMap stores composite reputation, that compraises from several metrics
    mapping (string=>uint32) compositeReputationMap;

    /// number of last digits in compositeReputation for fractional part
    uint8 public constant REPUTATION_DECIMALS = 4;

    /**
     *  Restrict methods in such way, that they can be invoked only by merchant account.
     */
    modifier onlyMerchant() {
        require(msg.sender == merchantAccount);
        _;
    }

    /**
     *  Fund Address should always be Externally Owned Account and not a contract.
     */
    modifier isEOA(address _fundAddress) {
        uint256 _codeLength;
        assembly {_codeLength := extcodesize(_fundAddress)}
        require(_codeLength == 0, "sorry humans only");
        _;
    }

    /**
     *  Restrict methods in such way, that they can be invoked only by merchant account or by monethaAddress account.
     */
    modifier onlyMerchantOrMonetha() {
        require(msg.sender == merchantAccount || isMonethaAddress[msg.sender]);
        _;
    }

    /**
     *  @param _merchantAccount Address of merchant's account, that can withdraw from wallet
     *  @param _merchantId Merchant identifier
     *  @param _fundAddress Merchant's fund address, where amount will be transferred.
     */
    constructor(address _merchantAccount, string _merchantId, address _fundAddress) public isEOA(_fundAddress) {
        require(_merchantAccount != 0x0);
        require(bytes(_merchantId).length > 0);

        merchantAccount = _merchantAccount;
        merchantIdHash = keccak256(abi.encodePacked(_merchantId));

        merchantFundAddress = _fundAddress;
    }

    /**
     *  Accept payment from MonethaGateway
     */
    function () external payable {
    }

    /**
     *  @return profile info by string key
     */
    function profile(string key) external constant returns (string) {
        return profileMap[key];
    }

    /**
     *  @return payment setting by string key
     */
    function paymentSettings(string key) external constant returns (string) {
        return paymentSettingsMap[key];
    }

    /**
     *  @return composite reputation value by string key
     */
    function compositeReputation(string key) external constant returns (uint32) {
        return compositeReputationMap[key];
    }

    /**
     *  Set profile info by string key
     */
    function setProfile(
        string profileKey,
        string profileValue,
        string repKey,
        uint32 repValue
    )
        external onlyOwner
    {
        profileMap[profileKey] = profileValue;

        if (bytes(repKey).length != 0) {
            compositeReputationMap[repKey] = repValue;
        }
    }

    /**
     *  Set payment setting by string key
     */
    function setPaymentSettings(string key, string value) external onlyOwner {
        paymentSettingsMap[key] = value;
    }

    /**
     *  Set composite reputation value by string key
     */
    function setCompositeReputation(string key, uint32 value) external onlyMonetha {
        compositeReputationMap[key] = value;
    }

    /**
     *  Allows withdrawal of funds to beneficiary address
     */
    function doWithdrawal(address beneficiary, uint amount) private {
        require(beneficiary != 0x0);
        beneficiary.transfer(amount);
    }

    /**
     *  Allows merchant to withdraw funds to beneficiary address
     */
    function withdrawTo(address beneficiary, uint amount) public onlyMerchant whenNotPaused {
        doWithdrawal(beneficiary, amount);
    }

    /**
     *  Allows merchant to withdraw funds to it's own account
     */
    function withdraw(uint amount) external onlyMerchant {
        withdrawTo(msg.sender, amount);
    }

    /**
     *  Allows merchant or Monetha to initiate exchange of funds by withdrawing funds to deposit address of the exchange
     */
    function withdrawToExchange(address depositAccount, uint amount) external onlyMerchantOrMonetha whenNotPaused {
        doWithdrawal(depositAccount, amount);
    }

    /**
     *  Allows merchant or Monetha to initiate exchange of funds by withdrawing all funds to deposit address of the exchange
     */
    function withdrawAllToExchange(address depositAccount, uint min_amount) external onlyMerchantOrMonetha whenNotPaused {
        require (address(this).balance >= min_amount);
        doWithdrawal(depositAccount, address(this).balance);
    }

    /**
     *  Allows merchant or Monetha to initiate exchange of tokens by withdrawing all tokens to deposit address of the exchange
     */
    function withdrawAllTokensToExchange(address _tokenAddress, address _depositAccount, uint _minAmount) external onlyMerchantOrMonetha whenNotPaused {
        require(_tokenAddress != address(0));
        
        uint balance = GenericERC20(_tokenAddress).balanceOf(address(this));
        
        require(balance >= _minAmount);
        
        GenericERC20(_tokenAddress).transfer(_depositAccount, balance);
    }

    /**
     *  Allows merchant to change it's account address
     */
    function changeMerchantAccount(address newAccount) external onlyMerchant whenNotPaused {
        merchantAccount = newAccount;
    }

    /**
     *  Allows merchant to change it's fund address.
     */
    function changeFundAddress(address newFundAddress) external onlyMerchant isEOA(newFundAddress) {
        merchantFundAddress = newFundAddress;
    }
}

// File: contracts/PrivatePaymentProcessor.sol

contract PrivatePaymentProcessor is Pausable, Destructible, Contactable, Restricted {

    using SafeMath for uint256;

    string constant VERSION = "0.6";

    /**
      *  Payback permille.
      *  1 permille = 0.1 %
      */
    uint public constant PAYBACK_PERMILLE = 2; // 0.2%

    // Order paid event
    event OrderPaidInEther(
        uint indexed _orderId,
        address indexed _originAddress,
        uint _price,
        uint _monethaFee,
        uint _discount
    );

    event OrderPaidInToken(
        uint indexed _orderId,
        address indexed _originAddress,
        address indexed _tokenAddress,
        uint _price,
        uint _monethaFee
    );

    // Payments have been processed event
    event PaymentsProcessed(
        address indexed _merchantAddress,
        uint _amount,
        uint _fee
    );

    // PaymentRefunding is an event when refunding initialized
    event PaymentRefunding(
        uint indexed _orderId,
        address indexed _clientAddress,
        uint _amount,
        string _refundReason
    );

    // PaymentWithdrawn event is fired when payment is withdrawn
    event PaymentWithdrawn(
        uint indexed _orderId,
        address indexed _clientAddress,
        uint amount
    );

    /// MonethaGateway contract for payment processing
    MonethaGateway public monethaGateway;

    /// Address of MerchantWallet, where merchant reputation and funds are stored
    MerchantWallet public merchantWallet;

    /// Merchant identifier hash, that associates with the acceptor
    bytes32 public merchantIdHash;

    enum WithdrawState {Null, Pending, Withdrawn}

    struct Withdraw {
        WithdrawState state;
        uint amount;
        address clientAddress;
    }

    mapping(uint => Withdraw) public withdrawals;

    /**
     *  Private Payment Processor sets Monetha Gateway and Merchant Wallet.
     *  @param _merchantId Merchant of the acceptor
     *  @param _monethaGateway Address of MonethaGateway contract for payment processing
     *  @param _merchantWallet Address of MerchantWallet, where merchant reputation and funds are stored
     */
    constructor(
        string _merchantId,
        MonethaGateway _monethaGateway,
        MerchantWallet _merchantWallet
    )
    public
    {
        require(bytes(_merchantId).length > 0);

        merchantIdHash = keccak256(abi.encodePacked(_merchantId));

        setMonethaGateway(_monethaGateway);
        setMerchantWallet(_merchantWallet);
    }

    /**
     *  payForOrder is used by order wallet/client to pay for the order
     *  @param _orderId Identifier of the order
     *  @param _originAddress buyer address
     *  @param _monethaFee is fee collected by Monetha
     */
    function payForOrder(
        uint _orderId,
        address _originAddress,
        uint _monethaFee,
        uint _vouchersApply
    )
    external payable whenNotPaused
    {
        require(_orderId > 0);
        require(_originAddress != 0x0);
        require(msg.value > 0);

        address fundAddress;
        fundAddress = merchantWallet.merchantFundAddress();

        uint discountWei = 0;
        if (fundAddress != address(0)) {
            discountWei = monethaGateway.acceptPayment.value(msg.value)(
                fundAddress,
                _monethaFee,
                _originAddress,
                _vouchersApply,
                PAYBACK_PERMILLE);
        } else {
            discountWei = monethaGateway.acceptPayment.value(msg.value)(
                merchantWallet,
                _monethaFee,
                _originAddress,
                _vouchersApply,
                PAYBACK_PERMILLE);
        }

        // log payment event
        emit OrderPaidInEther(_orderId, _originAddress, msg.value, _monethaFee, discountWei);
    }

    /**
     *  payForOrderInTokens is used by order wallet/client to pay for the order
     *  This call requires that token's approve method has been called prior to this.
     *  @param _orderId Identifier of the order
     *  @param _originAddress buyer address
     *  @param _monethaFee is fee collected by Monetha
     *  @param _tokenAddress is tokens address
     *  @param _orderValue is order amount
     */
    function payForOrderInTokens(
        uint _orderId,
        address _originAddress,
        uint _monethaFee,
        address _tokenAddress,
        uint _orderValue
    )
    external whenNotPaused
    {
        require(_orderId > 0);
        require(_originAddress != 0x0);
        require(_orderValue > 0);
        require(_tokenAddress != address(0));

        address fundAddress;
        fundAddress = merchantWallet.merchantFundAddress();

        GenericERC20(_tokenAddress).transferFrom(msg.sender, address(this), _orderValue);

        GenericERC20(_tokenAddress).transfer(address(monethaGateway), _orderValue);

        if (fundAddress != address(0)) {
            monethaGateway.acceptTokenPayment(fundAddress, _monethaFee, _tokenAddress, _orderValue);
        } else {
            monethaGateway.acceptTokenPayment(merchantWallet, _monethaFee, _tokenAddress, _orderValue);
        }

        // log payment event
        emit OrderPaidInToken(_orderId, _originAddress, _tokenAddress, _orderValue, _monethaFee);
    }

    /**
     *  refundPayment used in case order cannot be processed and funds need to be returned
     *  This function initiate process of funds refunding to the client.
     *  @param _orderId Identifier of the order
     *  @param _clientAddress is an address of client
     *  @param _refundReason Order refund reason
     */
    function refundPayment(
        uint _orderId,
        address _clientAddress,
        string _refundReason
    )
    external payable onlyMonetha whenNotPaused
    {
        require(_orderId > 0);
        require(_clientAddress != 0x0);
        require(msg.value > 0);
        require(WithdrawState.Null == withdrawals[_orderId].state);

        // create withdraw
        withdrawals[_orderId] = Withdraw({
            state : WithdrawState.Pending,
            amount : msg.value,
            clientAddress : _clientAddress
            });

        // log refunding
        emit PaymentRefunding(_orderId, _clientAddress, msg.value, _refundReason);
    }

    /**
     *  refundTokenPayment used in case order cannot be processed and tokens need to be returned
     *  This call requires that token's approve method has been called prior to this.
     *  This function initiate process of refunding tokens to the client.
     *  @param _orderId Identifier of the order
     *  @param _clientAddress is an address of client
     *  @param _refundReason Order refund reason
     *  @param _tokenAddress is tokens address
     *  @param _orderValue is order amount
     */
    function refundTokenPayment(
        uint _orderId,
        address _clientAddress,
        string _refundReason,
        uint _orderValue,
        address _tokenAddress
    )
    external onlyMonetha whenNotPaused
    {
        require(_orderId > 0);
        require(_clientAddress != 0x0);
        require(_orderValue > 0);
        require(_tokenAddress != address(0));
        require(WithdrawState.Null == withdrawals[_orderId].state);

        GenericERC20(_tokenAddress).transferFrom(msg.sender, address(this), _orderValue);

        // create withdraw
        withdrawals[_orderId] = Withdraw({
            state : WithdrawState.Pending,
            amount : _orderValue,
            clientAddress : _clientAddress
            });

        // log refunding
        emit PaymentRefunding(_orderId, _clientAddress, _orderValue, _refundReason);
    }

    /**
     *  withdrawRefund performs fund transfer to the client's account.
     *  @param _orderId Identifier of the order
     */
    function withdrawRefund(uint _orderId)
    external whenNotPaused
    {
        Withdraw storage withdraw = withdrawals[_orderId];
        require(WithdrawState.Pending == withdraw.state);

        address clientAddress = withdraw.clientAddress;
        uint amount = withdraw.amount;

        // changing withdraw state before transfer
        withdraw.state = WithdrawState.Withdrawn;

        // transfer fund to clients account
        clientAddress.transfer(amount);

        // log withdrawn
        emit PaymentWithdrawn(_orderId, clientAddress, amount);
    }

    /**
     *  withdrawTokenRefund performs token transfer to the client's account.
     *  @param _orderId Identifier of the order
     *  @param _tokenAddress token address
     */
    function withdrawTokenRefund(uint _orderId, address _tokenAddress)
    external whenNotPaused
    {
        require(_tokenAddress != address(0));

        Withdraw storage withdraw = withdrawals[_orderId];
        require(WithdrawState.Pending == withdraw.state);

        address clientAddress = withdraw.clientAddress;
        uint amount = withdraw.amount;

        // changing withdraw state before transfer
        withdraw.state = WithdrawState.Withdrawn;

        // transfer fund to clients account
        GenericERC20(_tokenAddress).transfer(clientAddress, amount);

        // log withdrawn
        emit PaymentWithdrawn(_orderId, clientAddress, amount);
    }

    /**
     *  setMonethaGateway allows owner to change address of MonethaGateway.
     *  @param _newGateway Address of new MonethaGateway contract
     */
    function setMonethaGateway(MonethaGateway _newGateway) public onlyOwner {
        require(address(_newGateway) != 0x0);

        monethaGateway = _newGateway;
    }

    /**
     *  setMerchantWallet allows owner to change address of MerchantWallet.
     *  @param _newWallet Address of new MerchantWallet contract
     */
    function setMerchantWallet(MerchantWallet _newWallet) public onlyOwner {
        require(address(_newWallet) != 0x0);
        require(_newWallet.merchantIdHash() == merchantIdHash);

        merchantWallet = _newWallet;
    }
}

Contract ABI
[{"constant":false,"inputs":[{"name":"_orderId","type":"uint256"},{"name":"_originAddress","type":"address"},{"name":"_monethaFee","type":"uint256"},{"name":"_vouchersApply","type":"uint256"}],"name":"payForOrder","outputs":[],"payable":true,"stateMutability":"payable","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"isMonethaAddress","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_orderId","type":"uint256"},{"name":"_clientAddress","type":"address"},{"name":"_refundReason","type":"string"}],"name":"refundPayment","outputs":[],"payable":true,"stateMutability":"payable","type":"function"},{"constant":true,"inputs":[],"name":"contactInformation","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"unpause","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"PAYBACK_PERMILLE","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"paused","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"withdrawals","outputs":[{"name":"state","type":"uint8"},{"name":"amount","type":"uint256"},{"name":"clientAddress","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"monethaGateway","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"renounceOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"destroy","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"pause","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_orderId","type":"uint256"},{"name":"_clientAddress","type":"address"},{"name":"_refundReason","type":"string"},{"name":"_orderValue","type":"uint256"},{"name":"_tokenAddress","type":"address"}],"name":"refundTokenPayment","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_orderId","type":"uint256"}],"name":"withdrawRefund","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_orderId","type":"uint256"},{"name":"_originAddress","type":"address"},{"name":"_monethaFee","type":"uint256"},{"name":"_tokenAddress","type":"address"},{"name":"_orderValue","type":"uint256"}],"name":"payForOrderInTokens","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_newGateway","type":"address"}],"name":"setMonethaGateway","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_info","type":"string"}],"name":"setContactInformation","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"merchantWallet","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_address","type":"address"},{"name":"_isMonethaAddress","type":"bool"}],"name":"setMonethaAddress","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_orderId","type":"uint256"},{"name":"_tokenAddress","type":"address"}],"name":"withdrawTokenRefund","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_newWallet","type":"address"}],"name":"setMerchantWallet","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"merchantIdHash","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":false,"inputs":[{"name":"_recipient","type":"address"}],"name":"destroyAndSend","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"inputs":[{"name":"_merchantId","type":"string"},{"name":"_monethaGateway","type":"address"},{"name":"_merchantWallet","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"name":"_orderId","type":"uint256"},{"indexed":true,"name":"_originAddress","type":"address"},{"indexed":false,"name":"_price","type":"uint256"},{"indexed":false,"name":"_monethaFee","type":"uint256"},{"indexed":false,"name":"_discount","type":"uint256"}],"name":"OrderPaidInEther","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"_orderId","type":"uint256"},{"indexed":true,"name":"_originAddress","type":"address"},{"indexed":true,"name":"_tokenAddress","type":"address"},{"indexed":false,"name":"_price","type":"uint256"},{"indexed":false,"name":"_monethaFee","type":"uint256"}],"name":"OrderPaidInToken","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"_merchantAddress","type":"address"},{"indexed":false,"name":"_amount","type":"uint256"},{"indexed":false,"name":"_fee","type":"uint256"}],"name":"PaymentsProcessed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"_orderId","type":"uint256"},{"indexed":true,"name":"_clientAddress","type":"address"},{"indexed":false,"name":"_amount","type":"uint256"},{"indexed":false,"name":"_refundReason","type":"string"}],"name":"PaymentRefunding","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"_orderId","type":"uint256"},{"indexed":true,"name":"_clientAddress","type":"address"},{"indexed":false,"name":"amount","type":"uint256"}],"name":"PaymentWithdrawn","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"_address","type":"address"},{"indexed":false,"name":"_isMonethaAddress","type":"bool"}],"name":"MonethaAddressSet","type":"event"},{"anonymous":false,"inputs":[],"name":"Pause","type":"event"},{"anonymous":false,"inputs":[],"name":"Unpause","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"}]

Contract Creation Code
60806040526000805460a060020a60ff02191690553480156200002157600080fd5b5060405162001a4038038062001a40833981016040908152815160208301519183015160008054600160a060020a03191633178155919093018051909391106200006a57600080fd5b826040516020018082805190602001908083835b602083106200009f5780518252601f1990920191602091820191016200007e565b6001836020036101000a0380198251168184511680821785525050505050509050019150506040516020818303038152906040526040518082805190602001908083835b60208310620001045780518252601f199092019160209182019101620000e3565b5181516020939093036101000a600019018019909116921691909117905260405192018290039091206005555062000149915083905064010000000062000166810204565b6200015d81640100000000620001b6810204565b5050506200029e565b600054600160a060020a031633146200017e57600080fd5b600160a060020a03811615156200019457600080fd5b60038054600160a060020a031916600160a060020a0392909216919091179055565b600054600160a060020a03163314620001ce57600080fd5b600160a060020a0381161515620001e457600080fd5b6005546000191681600160a060020a031663f0daba016040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b1580156200024357600080fd5b505af115801562000258573d6000803e3d6000fd5b505050506040513d60208110156200026f57600080fd5b5051146200027c57600080fd5b60048054600160a060020a031916600160a060020a0392909216919091179055565b61179280620002ae6000396000f3006080604052600436106101485763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416631ee37896811461014d57806331d413251461016c57806331d4fad4146101a157806336f7ab5e146101c55780633f4ba83a1461024f5780634baf43e4146102645780635c975abb1461028b5780635cc07076146102a05780636137412c146102fc578063715018a61461032d57806383197ef0146103425780638456cb59146103575780638da5cb5b1461036c5780639600f294146103815780639d153495146103bd5780639da30467146103d5578063b440bf3914610406578063b967a52e14610427578063bc85e06414610480578063c07e339114610495578063cee749bc146104bb578063ddda66db146104df578063f0daba0114610500578063f2fde38b14610515578063f5074f4114610536575b600080fd5b61016a600435600160a060020a0360243516604435606435610557565b005b34801561017857600080fd5b5061018d600160a060020a0360043516610807565b604080519115158252519081900360200190f35b61016a600480359060248035600160a060020a03169160443591820191013561081c565b3480156101d157600080fd5b506101da610997565b6040805160208082528351818301528351919283929083019185019080838360005b838110156102145781810151838201526020016101fc565b50505050905090810190601f1680156102415780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561025b57600080fd5b5061016a610a24565b34801561027057600080fd5b50610279610a9a565b60408051918252519081900360200190f35b34801561029757600080fd5b5061018d610a9f565b3480156102ac57600080fd5b506102b8600435610aaf565b604051808460028111156102c857fe5b60ff16815260200183815260200182600160a060020a0316600160a060020a03168152602001935050505060405180910390f35b34801561030857600080fd5b50610311610add565b60408051600160a060020a039092168252519081900360200190f35b34801561033957600080fd5b5061016a610aec565b34801561034e57600080fd5b5061016a610b58565b34801561036357600080fd5b5061016a610b7d565b34801561037857600080fd5b50610311610bf8565b34801561038d57600080fd5b5061016a6004803590600160a060020a036024803582169260443591820192910135906064359060843516610c07565b3480156103c957600080fd5b5061016a600435610e32565b3480156103e157600080fd5b5061016a600435600160a060020a036024358116906044359060643516608435610f14565b34801561041257600080fd5b5061016a600160a060020a03600435166112bc565b34801561043357600080fd5b506040805160206004803580820135601f810184900484028501840190955284845261016a9436949293602493928401919081908401838280828437509497506113179650505050505050565b34801561048c57600080fd5b50610311611345565b3480156104a157600080fd5b5061016a600160a060020a03600435166024351515611354565b3480156104c757600080fd5b5061016a600435600160a060020a03602435166113cf565b3480156104eb57600080fd5b5061016a600160a060020a0360043516611513565b34801561050c57600080fd5b50610279611602565b34801561052157600080fd5b5061016a600160a060020a0360043516611608565b34801561054257600080fd5b5061016a600160a060020a036004351661162b565b60008054819060a060020a900460ff161561057157600080fd5b6000861161057e57600080fd5b600160a060020a038516151561059357600080fd5b600034116105a057600080fd5b60048054604080517f969596d60000000000000000000000000000000000000000000000000000000081529051600160a060020a039092169263969596d69282820192602092908290030181600087803b1580156105fd57600080fd5b505af1158015610611573d6000803e3d6000fd5b505050506040513d602081101561062757600080fd5b5051915060009050600160a060020a038216156106f957600354604080517fd21c39a1000000000000000000000000000000000000000000000000000000008152600160a060020a03858116600483015260248201889052888116604483015260648201879052600260848301529151919092169163d21c39a191349160a48082019260209290919082900301818588803b1580156106c557600080fd5b505af11580156106d9573d6000803e3d6000fd5b50505050506040513d60208110156106f057600080fd5b505190506107b2565b60035460048054604080517fd21c39a1000000000000000000000000000000000000000000000000000000008152600160a060020a039283169381019390935260248301889052888216604484015260648301879052600260848401525192169163d21c39a191349160a480830192602092919082900301818588803b15801561078257600080fd5b505af1158015610796573d6000803e3d6000fd5b50505050506040513d60208110156107ad57600080fd5b505190505b60408051348152602081018690528082018390529051600160a060020a0387169188917ffb3b61c9f30df0c105c673af85f07796032c77c3bf21f256bce83ba0853f630f9181900360600190a3505050505050565b60026020526000908152604090205460ff1681565b3360009081526002602052604090205460ff16151561083a57600080fd5b60005460a060020a900460ff161561085157600080fd5b6000841161085e57600080fd5b600160a060020a038316151561087357600080fd5b6000341161088057600080fd5b60008481526006602052604090205460ff16600281111561089d57fe5b156108a757600080fd5b6040805160608101909152806001815234602080830191909152600160a060020a038616604092830152600087815260069091522081518154829060ff191660018360028111156108f457fe5b021790555060208281015160018301556040928301516002909201805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a039384161790558251348082529181018481529381018590529186169287927f26e77179a69c2db5e1f39af4e228bc8c2205384ba14b8c1e3339049db4ee42c5929187918791606082018484808284376040519201829003965090945050505050a350505050565b60018054604080516020600284861615610100026000190190941693909304601f81018490048402820184019092528181529291830182828015610a1c5780601f106109f157610100808354040283529160200191610a1c565b820191906000526020600020905b8154815290600101906020018083116109ff57829003601f168201915b505050505081565b600054600160a060020a03163314610a3b57600080fd5b60005460a060020a900460ff161515610a5357600080fd5b6000805474ff0000000000000000000000000000000000000000191681556040517f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b339190a1565b600281565b60005460a060020a900460ff1681565b60066020526000908152604090208054600182015460029092015460ff9091169190600160a060020a031683565b600354600160a060020a031681565b600054600160a060020a03163314610b0357600080fd5b60008054604051600160a060020a03909116917ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482091a26000805473ffffffffffffffffffffffffffffffffffffffff19169055565b600054600160a060020a03163314610b6f57600080fd5b600054600160a060020a0316ff5b600054600160a060020a03163314610b9457600080fd5b60005460a060020a900460ff1615610bab57600080fd5b6000805474ff0000000000000000000000000000000000000000191660a060020a1781556040517f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff6259190a1565b600054600160a060020a031681565b3360009081526002602052604090205460ff161515610c2557600080fd5b60005460a060020a900460ff1615610c3c57600080fd5b60008611610c4957600080fd5b600160a060020a0385161515610c5e57600080fd5b60008211610c6b57600080fd5b600160a060020a0381161515610c8057600080fd5b60008681526006602052604090205460ff166002811115610c9d57fe5b15610ca757600080fd5b604080517f23b872dd000000000000000000000000000000000000000000000000000000008152336004820152306024820152604481018490529051600160a060020a038316916323b872dd9160648083019260209291908290030181600087803b158015610d1557600080fd5b505af1158015610d29573d6000803e3d6000fd5b505050506040513d6020811015610d3f57600080fd5b5050604080516060810190915280600181526020808201859052600160a060020a038816604092830152600089815260069091522081518154829060ff19166001836002811115610d8c57fe5b021790555060208281015160018301556040928301516002909201805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0393841617905582518581529081018381529281018690529087169188917f26e77179a69c2db5e1f39af4e228bc8c2205384ba14b8c1e3339049db4ee42c59186918991899190606082018484808284376040519201829003965090945050505050a3505050505050565b600080548190819060a060020a900460ff1615610e4e57600080fd5b6000848152600660205260409020805490935060ff166002811115610e6f57fe5b600114610e7b57600080fd5b50506002818101546001830154835460ff19169092178355604051600160a060020a03909116919082906108fc8315029083906000818181858888f19350505050158015610ecd573d6000803e3d6000fd5b50604080518281529051600160a060020a0384169186917fbe85bf3b0a1e335a22c461f84cf759dfe589ec1539caf4dce60f999d72dd8e239181900360200190a350505050565b6000805460a060020a900460ff1615610f2c57600080fd5b60008611610f3957600080fd5b600160a060020a0385161515610f4e57600080fd5b60008211610f5b57600080fd5b600160a060020a0383161515610f7057600080fd5b60048054604080517f969596d60000000000000000000000000000000000000000000000000000000081529051600160a060020a039092169263969596d69282820192602092908290030181600087803b158015610fcd57600080fd5b505af1158015610fe1573d6000803e3d6000fd5b505050506040513d6020811015610ff757600080fd5b5051604080517f23b872dd000000000000000000000000000000000000000000000000000000008152336004820152306024820152604481018590529051919250600160a060020a038516916323b872dd916064808201926020929091908290030181600087803b15801561106b57600080fd5b505af115801561107f573d6000803e3d6000fd5b505050506040513d602081101561109557600080fd5b5050600354604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152600160a060020a0392831660048201526024810185905290519185169163a9059cbb9160448082019260009290919082900301818387803b15801561110557600080fd5b505af1158015611119573d6000803e3d6000fd5b50505050600160a060020a038116156111c657600354604080517fcc4fbc43000000000000000000000000000000000000000000000000000000008152600160a060020a038481166004830152602482018890528681166044830152606482018690529151919092169163cc4fbc4391608480830192600092919082900301818387803b1580156111a957600080fd5b505af11580156111bd573d6000803e3d6000fd5b50505050611260565b60035460048054604080517fcc4fbc43000000000000000000000000000000000000000000000000000000008152600160a060020a0392831693810193909352602483018890528682166044840152606483018690525192169163cc4fbc439160848082019260009290919082900301818387803b15801561124757600080fd5b505af115801561125b573d6000803e3d6000fd5b505050505b82600160a060020a031685600160a060020a0316877fd6dc98331ad06baebe39c90f4fd554341ad121d55e4384bd046def391501a00f8588604051808381526020018281526020019250505060405180910390a4505050505050565b600054600160a060020a031633146112d357600080fd5b600160a060020a03811615156112e857600080fd5b6003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600054600160a060020a0316331461132e57600080fd5b80516113419060019060208401906116cb565b5050565b600454600160a060020a031681565b600054600160a060020a0316331461136b57600080fd5b600160a060020a038216600081815260026020908152604091829020805460ff191685151590811790915582519384529083015280517fa551de8741dbb2092ce6bc142fd0ff3af5dfbf87d0aa594619fccddb0141e6929281900390910190a15050565b600080548190819060a060020a900460ff16156113eb57600080fd5b600160a060020a038416151561140057600080fd5b6000858152600660205260409020805490935060ff16600281111561142157fe5b60011461142d57600080fd5b50506002818101546001830154835460ff19169092178355604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152600160a060020a039283166004820181905260248201859052915191939286169163a9059cbb9160448082019260009290919082900301818387803b1580156114b457600080fd5b505af11580156114c8573d6000803e3d6000fd5b5050604080518481529051600160a060020a03861693508892507fbe85bf3b0a1e335a22c461f84cf759dfe589ec1539caf4dce60f999d72dd8e239181900360200190a35050505050565b600054600160a060020a0316331461152a57600080fd5b600160a060020a038116151561153f57600080fd5b6005546000191681600160a060020a031663f0daba016040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b15801561159d57600080fd5b505af11580156115b1573d6000803e3d6000fd5b505050506040513d60208110156115c757600080fd5b5051146115d357600080fd5b6004805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60055481565b600054600160a060020a0316331461161f57600080fd5b6116288161164e565b50565b600054600160a060020a0316331461164257600080fd5b80600160a060020a0316ff5b600160a060020a038116151561166357600080fd5b60008054604051600160a060020a03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061170c57805160ff1916838001178555611739565b82800160010185558215611739579182015b8281111561173957825182559160200191906001019061171e565b50611745929150611749565b5090565b61176391905b80821115611745576000815560010161174f565b905600a165627a7a72305820b119fe828187e6dbcd36bc53a7bad5226e51a33cc12c3c5e45faa0b8d644d2ed00290000000000000000000000000000000000000000000000000000000000000060000000000000000000000000d89cd1472ae498cf89a93a011b2767f0037cfbb0000000000000000000000000cb7d03ae858545e6fd491976de6f20a44c14d810000000000000000000000000000000000000000000000000000000000000001f4669727374206d65726368616e74206576657220696e2073746167696e672100


   Swarm Source:
bzzr://b119fe828187e6dbcd36bc53a7bad5226e51a33cc12c3c5e45faa0b8d644d2ed
Block Age Transaction Difficulty GasUsed Reward
Block Age Uncle Number Difficulty GasUsed Reward