Feature Tip: Add private address tag to any address under My Name Tag !
Overview
ETH Balance
0.00133267524298066 ETH
Eth Value
$2.43 (@ $1,823.09/ETH)Latest 25 from a total of 297 transactions
| Transaction Hash |
Method
|
Block
|
From
|
|
To
|
||||
|---|---|---|---|---|---|---|---|---|---|
| __callback | 9499123 | 2199 days ago | IN | 0 ETH | 0.0005687 | ||||
| __callback | 9495900 | 2199 days ago | IN | 0 ETH | 0.0008804 | ||||
| __callback | 9492515 | 2200 days ago | IN | 0 ETH | 0.00087448 | ||||
| __callback | 9489322 | 2200 days ago | IN | 0 ETH | 0.0008804 | ||||
| __callback | 9486042 | 2201 days ago | IN | 0 ETH | 0.00087457 | ||||
| __callback | 9482801 | 2201 days ago | IN | 0 ETH | 0.0008804 | ||||
| __callback | 9479604 | 2202 days ago | IN | 0 ETH | 0.0008804 | ||||
| __callback | 9476337 | 2202 days ago | IN | 0 ETH | 0.0008804 | ||||
| __callback | 9473074 | 2203 days ago | IN | 0 ETH | 0.0008804 | ||||
| __callback | 9469839 | 2203 days ago | IN | 0 ETH | 0.0008804 | ||||
| __callback | 9466602 | 2204 days ago | IN | 0 ETH | 0.0008804 | ||||
| __callback | 9463360 | 2204 days ago | IN | 0 ETH | 0.00086382 | ||||
| __callback | 9460089 | 2205 days ago | IN | 0 ETH | 0.0008804 | ||||
| __callback | 9456825 | 2205 days ago | IN | 0 ETH | 0.0008804 | ||||
| __callback | 9453498 | 2206 days ago | IN | 0 ETH | 0.0008804 | ||||
| __callback | 9450241 | 2206 days ago | IN | 0 ETH | 0.0008804 | ||||
| __callback | 9446988 | 2207 days ago | IN | 0 ETH | 0.00087457 | ||||
| __callback | 9443747 | 2207 days ago | IN | 0 ETH | 0.0008804 | ||||
| __callback | 9440517 | 2208 days ago | IN | 0 ETH | 0.00087457 | ||||
| __callback | 9437215 | 2208 days ago | IN | 0 ETH | 0.0008804 | ||||
| __callback | 9433997 | 2209 days ago | IN | 0 ETH | 0.0008804 | ||||
| __callback | 9430757 | 2209 days ago | IN | 0 ETH | 0.0008804 | ||||
| __callback | 9427503 | 2210 days ago | IN | 0 ETH | 0.00088032 | ||||
| __callback | 9424247 | 2210 days ago | IN | 0 ETH | 0.00088032 | ||||
| __callback | 9421005 | 2211 days ago | IN | 0 ETH | 0.0008804 |
Latest 25 internal transactions (View All)
Advanced mode:
| Parent Transaction Hash | Method | Block |
From
|
|
To
|
||
|---|---|---|---|---|---|---|---|
| - | 9495900 | 2199 days ago | 0.00102372 ETH | ||||
| - | 9492515 | 2200 days ago | 0.00102372 ETH | ||||
| - | 9489322 | 2200 days ago | 0.00102372 ETH | ||||
| - | 9486042 | 2201 days ago | 0.00102372 ETH | ||||
| - | 9482801 | 2201 days ago | 0.00102372 ETH | ||||
| - | 9479604 | 2202 days ago | 0.00102372 ETH | ||||
| - | 9476337 | 2202 days ago | 0.00102372 ETH | ||||
| - | 9473074 | 2203 days ago | 0.00102372 ETH | ||||
| - | 9469839 | 2203 days ago | 0.00102372 ETH | ||||
| - | 9466602 | 2204 days ago | 0.00102372 ETH | ||||
| - | 9463360 | 2204 days ago | 0.00102372 ETH | ||||
| - | 9460089 | 2205 days ago | 0.00102372 ETH | ||||
| - | 9456825 | 2205 days ago | 0.00102372 ETH | ||||
| - | 9453498 | 2206 days ago | 0.00102372 ETH | ||||
| - | 9450241 | 2206 days ago | 0.00102372 ETH | ||||
| - | 9446988 | 2207 days ago | 0.0010403 ETH | ||||
| - | 9443747 | 2207 days ago | 0.0010403 ETH | ||||
| - | 9440517 | 2208 days ago | 0.0010403 ETH | ||||
| - | 9437215 | 2208 days ago | 0.0010403 ETH | ||||
| - | 9433997 | 2209 days ago | 0.0010403 ETH | ||||
| - | 9430757 | 2209 days ago | 0.0010403 ETH | ||||
| - | 9427503 | 2210 days ago | 0.0010403 ETH | ||||
| - | 9424247 | 2210 days ago | 0.0010403 ETH | ||||
| - | 9421005 | 2211 days ago | 0.0010403 ETH | ||||
| - | 9417780 | 2211 days ago | 0.0010403 ETH |
Loading...
Loading
Loading...
Loading
Cross-Chain Transactions
Loading...
Loading
Contract Name:
MDAPPSale
Compiler Version
v0.4.25+commit.59dbf8f1
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity)
/**
*Submitted for verification at Etherscan.io on 2018-10-10
*/
pragma solidity ^0.4.24;
/**
* @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;
}
}
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* See https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address _who) public view returns (uint256);
function transfer(address _to, uint256 _value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @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;
}
}
library SafeMath16 {
function mul(uint16 a, uint16 b) internal pure returns (uint16) {
if (a == 0) {
return 0;
}
uint16 c = a * b;
assert(c / a == b);
return c;
}
function div(uint16 a, uint16 b) internal pure returns (uint16) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint16 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn’t hold
return c;
}
function sub(uint16 a, uint16 b) internal pure returns (uint16) {
assert(b <= a);
return a - b;
}
function add(uint16 a, uint16 b) internal pure returns (uint16) {
uint16 c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address _owner, address _spender)
public view returns (uint256);
function transferFrom(address _from, address _to, uint256 _value)
public returns (bool);
function approve(address _spender, uint256 _value) public returns (bool);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
/**
* @title SafeERC20
* @dev Wrappers around ERC20 operations that throw on failure.
* To use this library you can add a `using SafeERC20 for ERC20;` statement to your contract,
* which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
*/
library SafeERC20 {
function safeTransfer(
ERC20Basic _token,
address _to,
uint256 _value
)
internal
{
require(_token.transfer(_to, _value));
}
function safeTransferFrom(
ERC20 _token,
address _from,
address _to,
uint256 _value
)
internal
{
require(_token.transferFrom(_from, _to, _value));
}
function safeApprove(
ERC20 _token,
address _spender,
uint256 _value
)
internal
{
require(_token.approve(_spender, _value));
}
}
/**
* @title Escrow
* @dev Base escrow contract, holds funds destinated to a payee until they
* withdraw them. The contract that uses the escrow as its payment method
* should be its owner, and provide public methods redirecting to the escrow's
* deposit and withdraw.
*/
contract Escrow is Ownable {
using SafeMath for uint256;
event Deposited(address indexed payee, uint256 weiAmount);
event Withdrawn(address indexed payee, uint256 weiAmount);
mapping(address => uint256) private deposits;
function depositsOf(address _payee) public view returns (uint256) {
return deposits[_payee];
}
/**
* @dev Stores the sent amount as credit to be withdrawn.
* @param _payee The destination address of the funds.
*/
function deposit(address _payee) public onlyOwner payable {
uint256 amount = msg.value;
deposits[_payee] = deposits[_payee].add(amount);
emit Deposited(_payee, amount);
}
/**
* @dev Withdraw accumulated balance for a payee.
* @param _payee The address whose funds will be withdrawn and transferred to.
*/
function withdraw(address _payee) public onlyOwner {
uint256 payment = deposits[_payee];
assert(address(this).balance >= payment);
deposits[_payee] = 0;
_payee.transfer(payment);
emit Withdrawn(_payee, payment);
}
}
/**
* @title PullPayment
* @dev Base contract supporting async send for pull payments. Inherit from this
* contract and use asyncTransfer instead of send or transfer.
*/
contract PullPayment {
Escrow private escrow;
constructor() public {
escrow = new Escrow();
}
/**
* @dev Withdraw accumulated balance, called by payee.
*/
function withdrawPayments() public {
address payee = msg.sender;
escrow.withdraw(payee);
}
/**
* @dev Returns the credit owed to an address.
* @param _dest The creditor's address.
*/
function payments(address _dest) public view returns (uint256) {
return escrow.depositsOf(_dest);
}
/**
* @dev Called by the payer to store the sent amount as credit to be pulled.
* @param _dest The destination address of the funds.
* @param _amount The amount to transfer.
*/
function asyncTransfer(address _dest, uint256 _amount) internal {
escrow.deposit.value(_amount)(_dest);
}
}
/***************************************************************
* Modified Crowdsale.sol from the zeppelin-solidity framework *
* to support zero decimal token. The end time has been *
* removed. *
* https://github.com/OpenZeppelin/zeppelin-solidity *
***************************************************************/
/*****************************************************************
* Core contract of the Million Dollar Decentralized Application *
*****************************************************************/
/**
* @title Contracts that should not own Ether
* @author Remco Bloemen <remco@2π.com>
* @dev This tries to block incoming ether to prevent accidental loss of Ether. Should Ether end up
* in the contract, it will allow the owner to reclaim this Ether.
* @notice Ether can still be sent to this contract by:
* calling functions labeled `payable`
* `selfdestruct(contract_address)`
* mining directly to the contract address
*/
contract HasNoEther is Ownable {
/**
* @dev Constructor that rejects incoming Ether
* The `payable` flag is added so we can access `msg.value` without compiler warning. If we
* leave out payable, then Solidity will allow inheriting contracts to implement a payable
* constructor. By doing it this way we prevent a payable constructor from working. Alternatively
* we could use assembly to access msg.value.
*/
constructor() public payable {
require(msg.value == 0);
}
/**
* @dev Disallows direct send by setting a default function without the `payable` flag.
*/
function() external {
}
/**
* @dev Transfer all Ether held by the contract to the owner.
*/
function reclaimEther() external onlyOwner {
owner.transfer(address(this).balance);
}
}
/**
* @title Contracts that should be able to recover tokens
* @author SylTi
* @dev This allow a contract to recover any ERC20 token received in a contract by transferring the balance to the contract owner.
* This will prevent any accidental loss of tokens.
*/
contract CanReclaimToken is Ownable {
using SafeERC20 for ERC20Basic;
/**
* @dev Reclaim all ERC20Basic compatible tokens
* @param _token ERC20Basic The address of the token contract
*/
function reclaimToken(ERC20Basic _token) external onlyOwner {
uint256 balance = _token.balanceOf(this);
_token.safeTransfer(owner, balance);
}
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) internal balances;
uint256 internal totalSupply_;
/**
* @dev Total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
/**
* @dev Transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
require(_value <= balances[msg.sender]);
require(_to != address(0));
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256) {
return balances[_owner];
}
}
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* https://github.com/ethereum/EIPs/issues/20
* Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(
address _from,
address _to,
uint256 _value
)
public
returns (bool)
{
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
require(_to != address(0));
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
emit Transfer(_from, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(
address _owner,
address _spender
)
public
view
returns (uint256)
{
return allowed[_owner][_spender];
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _addedValue The amount of tokens to increase the allowance by.
*/
function increaseApproval(
address _spender,
uint256 _addedValue
)
public
returns (bool)
{
allowed[msg.sender][_spender] = (
allowed[msg.sender][_spender].add(_addedValue));
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
* approve should be called when allowed[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseApproval(
address _spender,
uint256 _subtractedValue
)
public
returns (bool)
{
uint256 oldValue = allowed[msg.sender][_spender];
if (_subtractedValue >= oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
/**
* @title Mintable token
* @dev Simple ERC20 Token example, with mintable token creation
* Based on code by TokenMarketNet: https://github.com/TokenMarketNet/ico/blob/master/contracts/MintableToken.sol
*/
contract MintableToken is StandardToken, Ownable {
event Mint(address indexed to, uint256 amount);
event MintFinished();
bool public mintingFinished = false;
modifier canMint() {
require(!mintingFinished);
_;
}
modifier hasMintPermission() {
require(msg.sender == owner);
_;
}
/**
* @dev Function to mint tokens
* @param _to The address that will receive the minted tokens.
* @param _amount The amount of tokens to mint.
* @return A boolean that indicates if the operation was successful.
*/
function mint(
address _to,
uint256 _amount
)
public
hasMintPermission
canMint
returns (bool)
{
totalSupply_ = totalSupply_.add(_amount);
balances[_to] = balances[_to].add(_amount);
emit Mint(_to, _amount);
emit Transfer(address(0), _to, _amount);
return true;
}
/**
* @dev Function to stop minting new tokens.
* @return True if the operation was successful.
*/
function finishMinting() public onlyOwner canMint returns (bool) {
mintingFinished = true;
emit MintFinished();
return true;
}
}
/**
* @title MDAPPToken
* @dev Token for the Million Dollar Decentralized Application (MDAPP).
* Once a holder uses it to claim pixels the appropriate tokens are burned (1 Token <=> 10x10 pixel).
* If one releases his pixels new tokens are generated and credited to ones balance. Therefore, supply will
* vary between 0 and 10,000 tokens.
* Tokens are transferable once minting has finished.
* @dev Owned by MDAPP.sol
*/
contract MDAPPToken is MintableToken {
using SafeMath16 for uint16;
using SafeMath for uint256;
string public constant name = "MillionDollarDapp";
string public constant symbol = "MDAPP";
uint8 public constant decimals = 0;
mapping (address => uint16) locked;
bool public forceTransferEnable = false;
/*********************************************************
* *
* Events *
* *
*********************************************************/
// Emitted when owner force-allows transfers of tokens.
event AllowTransfer();
/*********************************************************
* *
* Modifiers *
* *
*********************************************************/
modifier hasLocked(address _account, uint16 _value) {
require(_value <= locked[_account], "Not enough locked tokens available.");
_;
}
modifier hasUnlocked(address _account, uint16 _value) {
require(balanceOf(_account).sub(uint256(locked[_account])) >= _value, "Not enough unlocked tokens available.");
_;
}
/**
* @dev Checks whether it can transfer or otherwise throws.
*/
modifier canTransfer(address _sender, uint256 _value) {
require(_value <= transferableTokensOf(_sender), "Not enough unlocked tokens available.");
_;
}
/*********************************************************
* *
* Limited Transfer Logic *
* Taken from openzeppelin 1.3.0 *
* *
*********************************************************/
function lockToken(address _account, uint16 _value) onlyOwner hasUnlocked(_account, _value) public {
locked[_account] = locked[_account].add(_value);
}
function unlockToken(address _account, uint16 _value) onlyOwner hasLocked(_account, _value) public {
locked[_account] = locked[_account].sub(_value);
}
/**
* @dev Checks modifier and allows transfer if tokens are not locked.
* @param _to The address that will receive the tokens.
* @param _value The amount of tokens to be transferred.
*/
function transfer(address _to, uint256 _value) canTransfer(msg.sender, _value) public returns (bool) {
return super.transfer(_to, _value);
}
/**
* @dev Checks modifier and allows transfer if tokens are not locked.
* @param _from The address that will send the tokens.
* @param _to The address that will receive the tokens.
* @param _value The amount of tokens to be transferred.
*/
function transferFrom(address _from, address _to, uint256 _value) canTransfer(_from, _value) public returns (bool) {
return super.transferFrom(_from, _to, _value);
}
/**
* @dev Allow the holder to transfer his tokens only if every token in
* existence has already been distributed / minting is finished.
* Tokens which are locked for a claimed space cannot be transferred.
*/
function transferableTokensOf(address _holder) public view returns (uint16) {
if (!mintingFinished && !forceTransferEnable) return 0;
return uint16(balanceOf(_holder)).sub(locked[_holder]);
}
/**
* @dev Get the number of pixel-locked tokens.
*/
function lockedTokensOf(address _holder) public view returns (uint16) {
return locked[_holder];
}
/**
* @dev Get the number of unlocked tokens usable for claiming pixels.
*/
function unlockedTokensOf(address _holder) public view returns (uint256) {
return balanceOf(_holder).sub(uint256(locked[_holder]));
}
// Allow transfer of tokens even if minting is not yet finished.
function allowTransfer() onlyOwner public {
require(forceTransferEnable == false, 'Transfer already force-allowed.');
forceTransferEnable = true;
emit AllowTransfer();
}
}
/**
* @title MDAPP
*/
contract MDAPP is Ownable, HasNoEther, CanReclaimToken {
using SafeMath for uint256;
using SafeMath16 for uint16;
// The tokens contract.
MDAPPToken public token;
// The sales contracts address. Only it is allowed to to call the public mint function.
address public sale;
// When are presale participants allowed to place ads?
uint256 public presaleAdStart;
// When are all token owners allowed to place ads?
uint256 public allAdStart;
// Quantity of tokens bought during presale.
mapping (address => uint16) presales;
// Indicates whether a 10x10px block is claimed or not.
bool[80][125] grid;
// Struct that represents an ad.
struct Ad {
address owner;
Rect rect;
}
// Struct describing an rectangle area.
struct Rect {
uint16 x;
uint16 y;
uint16 width;
uint16 height;
}
// Don't store ad details on blockchain. Use events as storage as they are significantly cheaper.
// ads are stored in an array, the id of an ad is its index in this array.
Ad[] ads;
// The following holds a list of currently active ads (without holes between the indexes)
uint256[] adIds;
// Holds the mapping from adID to its index in the above adIds array. If an ad gets released, we know which index to
// delete and being filled with the last element instead.
mapping (uint256 => uint256) adIdToIndex;
/*********************************************************
* *
* Events *
* *
*********************************************************/
/*
* Event for claiming pixel blocks.
* @param id ID of the new ad
* @param owner Who owns the used tokens
* @param x Upper left corner x coordinate
* @param y Upper left corner y coordinate
* @param width Width of the claimed area
* @param height Height of the claimed area
*/
event Claim(uint256 indexed id, address indexed owner, uint16 x, uint16 y, uint16 width, uint16 height);
/*
* Event for releasing pixel blocks.
* @param id ID the fading ad
* @param owner Who owns the claimed blocks
*/
event Release(uint256 indexed id, address indexed owner);
/*
* Event for editing an ad.
* @param id ID of the ad
* @param owner Who owns the ad
* @param link A link
* @param title Title of the ad
* @param text Description of the ad
* @param NSFW Whether the ad is safe for work
* @param digest IPFS hash digest
* @param hashFunction IPFS hash function
* @param size IPFS length of digest
* @param storageEngine e.g. ipfs or swrm (swarm)
*/
event EditAd(uint256 indexed id, address indexed owner, string link, string title, string text, string contact, bool NSFW, bytes32 indexed digest, bytes2 hashFunction, uint8 size, bytes4 storageEngine);
event ForceNSFW(uint256 indexed id);
/*********************************************************
* *
* Modifiers *
* *
*********************************************************/
modifier coordsValid(uint16 _x, uint16 _y, uint16 _width, uint16 _height) {
require((_x + _width - 1) < 125, "Invalid coordinates.");
require((_y + _height - 1) < 80, "Invalid coordinates.");
_;
}
modifier onlyAdOwner(uint256 _id) {
require(ads[_id].owner == msg.sender, "Access denied.");
_;
}
modifier enoughTokens(uint16 _width, uint16 _height) {
require(uint16(token.unlockedTokensOf(msg.sender)) >= _width.mul(_height), "Not enough unlocked tokens available.");
_;
}
modifier claimAllowed(uint16 _width, uint16 _height) {
require(_width > 0 &&_width <= 125 && _height > 0 && _height <= 80, "Invalid dimensions.");
require(now >= presaleAdStart, "Claim period not yet started.");
if (now < allAdStart) {
// Sender needs enough presale tokens to claim at this point.
uint16 tokens = _width.mul(_height);
require(presales[msg.sender] >= tokens, "Not enough unlocked presale tokens available.");
presales[msg.sender] = presales[msg.sender].sub(tokens);
}
_;
}
modifier onlySale() {
require(msg.sender == sale);
_;
}
modifier adExists(uint256 _id) {
uint256 index = adIdToIndex[_id];
require(adIds[index] == _id, "Ad does not exist.");
_;
}
/*********************************************************
* *
* Initialization *
* *
*********************************************************/
constructor(uint256 _presaleAdStart, uint256 _allAdStart, address _token) public {
require(_presaleAdStart >= now);
require(_allAdStart > _presaleAdStart);
presaleAdStart = _presaleAdStart;
allAdStart = _allAdStart;
token = MDAPPToken(_token);
}
function setMDAPPSale(address _mdappSale) onlyOwner external {
require(sale == address(0));
sale = _mdappSale;
}
/*********************************************************
* *
* Logic *
* *
*********************************************************/
// Proxy function to pass minting from sale contract to token contract.
function mint(address _beneficiary, uint256 _tokenAmount, bool isPresale) onlySale external {
if (isPresale) {
presales[_beneficiary] = presales[_beneficiary].add(uint16(_tokenAmount));
}
token.mint(_beneficiary, _tokenAmount);
}
// Proxy function to pass finishMinting() from sale contract to token contract.
function finishMinting() onlySale external {
token.finishMinting();
}
// Public function proxy to forward single parameters as a struct.
function claim(uint16 _x, uint16 _y, uint16 _width, uint16 _height)
claimAllowed(_width, _height)
coordsValid(_x, _y, _width, _height)
external returns (uint)
{
Rect memory rect = Rect(_x, _y, _width, _height);
return claimShortParams(rect);
}
// Claims pixels and requires to have the sender enough unlocked tokens.
// Has a modifier to take some of the "stack burden" from the proxy function.
function claimShortParams(Rect _rect)
enoughTokens(_rect.width, _rect.height)
internal returns (uint id)
{
token.lockToken(msg.sender, _rect.width.mul(_rect.height));
// Check affected pixelblocks.
for (uint16 i = 0; i < _rect.width; i++) {
for (uint16 j = 0; j < _rect.height; j++) {
uint16 x = _rect.x.add(i);
uint16 y = _rect.y.add(j);
if (grid[x][y]) {
revert("Already claimed.");
}
// Mark block as claimed.
grid[x][y] = true;
}
}
// Create placeholder ad.
id = createPlaceholderAd(_rect);
emit Claim(id, msg.sender, _rect.x, _rect.y, _rect.width, _rect.height);
return id;
}
// Delete an ad, unclaim pixelblocks and unlock tokens.
function release(uint256 _id) adExists(_id) onlyAdOwner(_id) external {
uint16 tokens = ads[_id].rect.width.mul(ads[_id].rect.height);
// Mark blocks as unclaimed.
for (uint16 i = 0; i < ads[_id].rect.width; i++) {
for (uint16 j = 0; j < ads[_id].rect.height; j++) {
uint16 x = ads[_id].rect.x.add(i);
uint16 y = ads[_id].rect.y.add(j);
// Mark block as unclaimed.
grid[x][y] = false;
}
}
// Delete ad
delete ads[_id];
// Reorganize index array and map
uint256 key = adIdToIndex[_id];
// Fill gap with last element of adIds
adIds[key] = adIds[adIds.length - 1];
// Update adIdToIndex
adIdToIndex[adIds[key]] = key;
// Decrease length of adIds array by 1
adIds.length--;
// Unlock tokens
if (now < allAdStart) {
// The ad must have locked presale tokens.
presales[msg.sender] = presales[msg.sender].add(tokens);
}
token.unlockToken(msg.sender, tokens);
emit Release(_id, msg.sender);
}
// The image must be an URL either of bzz, ipfs or http(s).
function editAd(uint _id, string _link, string _title, string _text, string _contact, bool _NSFW, bytes32 _digest, bytes2 _hashFunction, uint8 _size, bytes4 _storageEnginge) adExists(_id) onlyAdOwner(_id) public {
emit EditAd(_id, msg.sender, _link, _title, _text, _contact, _NSFW, _digest, _hashFunction, _size, _storageEnginge);
}
// Allows contract owner to set the NSFW flag for a given ad.
function forceNSFW(uint256 _id) onlyOwner adExists(_id) external {
emit ForceNSFW(_id);
}
// Helper function for claim() to avoid a deep stack.
function createPlaceholderAd(Rect _rect) internal returns (uint id) {
Ad memory ad = Ad(msg.sender, _rect);
id = ads.push(ad) - 1;
uint256 key = adIds.push(id) - 1;
adIdToIndex[id] = key;
return id;
}
// Returns remaining balance of tokens purchased during presale period qualifying for earlier claims.
function presaleBalanceOf(address _holder) public view returns (uint16) {
return presales[_holder];
}
// Returns all currently active adIds.
function getAdIds() external view returns (uint256[]) {
return adIds;
}
/*********************************************************
* *
* Other *
* *
*********************************************************/
// Allow transfer of tokens even if minting is not yet finished.
function allowTransfer() onlyOwner external {
token.allowTransfer();
}
}
// <ORACLIZE_API>
/*
Copyright (c) 2015-2016 Oraclize SRL
Copyright (c) 2016 Oraclize LTD
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
// This api is currently targeted at 0.4.18, please import oraclizeAPI_pre0.4.sol or oraclizeAPI_0.4 where necessary
contract OraclizeI {
address public cbAddress;
function query(uint _timestamp, string _datasource, string _arg) external payable returns (bytes32 _id);
function query_withGasLimit(uint _timestamp, string _datasource, string _arg, uint _gaslimit) external payable returns (bytes32 _id);
function query2(uint _timestamp, string _datasource, string _arg1, string _arg2) public payable returns (bytes32 _id);
function query2_withGasLimit(uint _timestamp, string _datasource, string _arg1, string _arg2, uint _gaslimit) external payable returns (bytes32 _id);
function queryN(uint _timestamp, string _datasource, bytes _argN) public payable returns (bytes32 _id);
function queryN_withGasLimit(uint _timestamp, string _datasource, bytes _argN, uint _gaslimit) external payable returns (bytes32 _id);
function getPrice(string _datasource) public returns (uint _dsprice);
function getPrice(string _datasource, uint gaslimit) public returns (uint _dsprice);
function setProofType(byte _proofType) external;
function setCustomGasPrice(uint _gasPrice) external;
function randomDS_getSessionPubKeyHash() external constant returns(bytes32);
}
contract OraclizeAddrResolverI {
function getAddress() public returns (address _addr);
}
contract usingOraclize {
uint constant day = 60*60*24;
uint constant week = 60*60*24*7;
uint constant month = 60*60*24*30;
byte constant proofType_NONE = 0x00;
byte constant proofType_TLSNotary = 0x10;
byte constant proofType_Android = 0x20;
byte constant proofType_Ledger = 0x30;
byte constant proofType_Native = 0xF0;
byte constant proofStorage_IPFS = 0x01;
uint8 constant networkID_auto = 0;
uint8 constant networkID_mainnet = 1;
uint8 constant networkID_testnet = 2;
uint8 constant networkID_morden = 2;
uint8 constant networkID_consensys = 161;
OraclizeAddrResolverI OAR;
OraclizeI oraclize;
modifier oraclizeAPI {
if((address(OAR)==0)||(getCodeSize(address(OAR))==0))
oraclize_setNetwork(networkID_auto);
if(address(oraclize) != OAR.getAddress())
oraclize = OraclizeI(OAR.getAddress());
_;
}
modifier coupon(string code){
oraclize = OraclizeI(OAR.getAddress());
_;
}
function oraclize_setNetwork(uint8 networkID) internal returns(bool){
return oraclize_setNetwork();
networkID; // silence the warning and remain backwards compatible
}
function oraclize_setNetwork() internal returns(bool){
if (getCodeSize(0x1d3B2638a7cC9f2CB3D298A3DA7a90B67E5506ed)>0){ //mainnet
OAR = OraclizeAddrResolverI(0x1d3B2638a7cC9f2CB3D298A3DA7a90B67E5506ed);
oraclize_setNetworkName("eth_mainnet");
return true;
}
if (getCodeSize(0xc03A2615D5efaf5F49F60B7BB6583eaec212fdf1)>0){ //ropsten testnet
OAR = OraclizeAddrResolverI(0xc03A2615D5efaf5F49F60B7BB6583eaec212fdf1);
oraclize_setNetworkName("eth_ropsten3");
return true;
}
if (getCodeSize(0xB7A07BcF2Ba2f2703b24C0691b5278999C59AC7e)>0){ //kovan testnet
OAR = OraclizeAddrResolverI(0xB7A07BcF2Ba2f2703b24C0691b5278999C59AC7e);
oraclize_setNetworkName("eth_kovan");
return true;
}
if (getCodeSize(0x146500cfd35B22E4A392Fe0aDc06De1a1368Ed48)>0){ //rinkeby testnet
OAR = OraclizeAddrResolverI(0x146500cfd35B22E4A392Fe0aDc06De1a1368Ed48);
oraclize_setNetworkName("eth_rinkeby");
return true;
}
if (getCodeSize(0x6f485C8BF6fc43eA212E93BBF8ce046C7f1cb475)>0){ //ethereum-bridge
OAR = OraclizeAddrResolverI(0x6f485C8BF6fc43eA212E93BBF8ce046C7f1cb475);
return true;
}
if (getCodeSize(0x20e12A1F859B3FeaE5Fb2A0A32C18F5a65555bBF)>0){ //ether.camp ide
OAR = OraclizeAddrResolverI(0x20e12A1F859B3FeaE5Fb2A0A32C18F5a65555bBF);
return true;
}
if (getCodeSize(0x51efaF4c8B3C9AfBD5aB9F4bbC82784Ab6ef8fAA)>0){ //browser-solidity
OAR = OraclizeAddrResolverI(0x51efaF4c8B3C9AfBD5aB9F4bbC82784Ab6ef8fAA);
return true;
}
return false;
}
function __callback(bytes32 myid, string result) public {
__callback(myid, result, new bytes(0));
}
function __callback(bytes32 myid, string result, bytes proof) public {
return;
myid; result; proof; // Silence compiler warnings
}
function oraclize_getPrice(string datasource) oraclizeAPI internal returns (uint){
return oraclize.getPrice(datasource);
}
function oraclize_getPrice(string datasource, uint gaslimit) oraclizeAPI internal returns (uint){
return oraclize.getPrice(datasource, gaslimit);
}
function oraclize_query(string datasource, string arg) oraclizeAPI internal returns (bytes32 id){
uint price = oraclize.getPrice(datasource);
if (price > 1 ether + tx.gasprice*200000) return 0; // unexpectedly high price
return oraclize.query.value(price)(0, datasource, arg);
}
function oraclize_query(uint timestamp, string datasource, string arg) oraclizeAPI internal returns (bytes32 id){
uint price = oraclize.getPrice(datasource);
if (price > 1 ether + tx.gasprice*200000) return 0; // unexpectedly high price
return oraclize.query.value(price)(timestamp, datasource, arg);
}
function oraclize_query(uint timestamp, string datasource, string arg, uint gaslimit) oraclizeAPI internal returns (bytes32 id){
uint price = oraclize.getPrice(datasource, gaslimit);
if (price > 1 ether + tx.gasprice*gaslimit) return 0; // unexpectedly high price
return oraclize.query_withGasLimit.value(price)(timestamp, datasource, arg, gaslimit);
}
function oraclize_query(string datasource, string arg, uint gaslimit) oraclizeAPI internal returns (bytes32 id){
uint price = oraclize.getPrice(datasource, gaslimit);
if (price > 1 ether + tx.gasprice*gaslimit) return 0; // unexpectedly high price
return oraclize.query_withGasLimit.value(price)(0, datasource, arg, gaslimit);
}
function oraclize_query(string datasource, string arg1, string arg2) oraclizeAPI internal returns (bytes32 id){
uint price = oraclize.getPrice(datasource);
if (price > 1 ether + tx.gasprice*200000) return 0; // unexpectedly high price
return oraclize.query2.value(price)(0, datasource, arg1, arg2);
}
function oraclize_query(uint timestamp, string datasource, string arg1, string arg2) oraclizeAPI internal returns (bytes32 id){
uint price = oraclize.getPrice(datasource);
if (price > 1 ether + tx.gasprice*200000) return 0; // unexpectedly high price
return oraclize.query2.value(price)(timestamp, datasource, arg1, arg2);
}
function oraclize_query(uint timestamp, string datasource, string arg1, string arg2, uint gaslimit) oraclizeAPI internal returns (bytes32 id){
uint price = oraclize.getPrice(datasource, gaslimit);
if (price > 1 ether + tx.gasprice*gaslimit) return 0; // unexpectedly high price
return oraclize.query2_withGasLimit.value(price)(timestamp, datasource, arg1, arg2, gaslimit);
}
function oraclize_query(string datasource, string arg1, string arg2, uint gaslimit) oraclizeAPI internal returns (bytes32 id){
uint price = oraclize.getPrice(datasource, gaslimit);
if (price > 1 ether + tx.gasprice*gaslimit) return 0; // unexpectedly high price
return oraclize.query2_withGasLimit.value(price)(0, datasource, arg1, arg2, gaslimit);
}
function oraclize_query(string datasource, string[] argN) oraclizeAPI internal returns (bytes32 id){
uint price = oraclize.getPrice(datasource);
if (price > 1 ether + tx.gasprice*200000) return 0; // unexpectedly high price
bytes memory args = stra2cbor(argN);
return oraclize.queryN.value(price)(0, datasource, args);
}
function oraclize_query(uint timestamp, string datasource, string[] argN) oraclizeAPI internal returns (bytes32 id){
uint price = oraclize.getPrice(datasource);
if (price > 1 ether + tx.gasprice*200000) return 0; // unexpectedly high price
bytes memory args = stra2cbor(argN);
return oraclize.queryN.value(price)(timestamp, datasource, args);
}
function oraclize_query(uint timestamp, string datasource, string[] argN, uint gaslimit) oraclizeAPI internal returns (bytes32 id){
uint price = oraclize.getPrice(datasource, gaslimit);
if (price > 1 ether + tx.gasprice*gaslimit) return 0; // unexpectedly high price
bytes memory args = stra2cbor(argN);
return oraclize.queryN_withGasLimit.value(price)(timestamp, datasource, args, gaslimit);
}
function oraclize_query(string datasource, string[] argN, uint gaslimit) oraclizeAPI internal returns (bytes32 id){
uint price = oraclize.getPrice(datasource, gaslimit);
if (price > 1 ether + tx.gasprice*gaslimit) return 0; // unexpectedly high price
bytes memory args = stra2cbor(argN);
return oraclize.queryN_withGasLimit.value(price)(0, datasource, args, gaslimit);
}
function oraclize_query(string datasource, string[1] args) oraclizeAPI internal returns (bytes32 id) {
string[] memory dynargs = new string[](1);
dynargs[0] = args[0];
return oraclize_query(datasource, dynargs);
}
function oraclize_query(uint timestamp, string datasource, string[1] args) oraclizeAPI internal returns (bytes32 id) {
string[] memory dynargs = new string[](1);
dynargs[0] = args[0];
return oraclize_query(timestamp, datasource, dynargs);
}
function oraclize_query(uint timestamp, string datasource, string[1] args, uint gaslimit) oraclizeAPI internal returns (bytes32 id) {
string[] memory dynargs = new string[](1);
dynargs[0] = args[0];
return oraclize_query(timestamp, datasource, dynargs, gaslimit);
}
function oraclize_query(string datasource, string[1] args, uint gaslimit) oraclizeAPI internal returns (bytes32 id) {
string[] memory dynargs = new string[](1);
dynargs[0] = args[0];
return oraclize_query(datasource, dynargs, gaslimit);
}
function oraclize_query(string datasource, string[2] args) oraclizeAPI internal returns (bytes32 id) {
string[] memory dynargs = new string[](2);
dynargs[0] = args[0];
dynargs[1] = args[1];
return oraclize_query(datasource, dynargs);
}
function oraclize_query(uint timestamp, string datasource, string[2] args) oraclizeAPI internal returns (bytes32 id) {
string[] memory dynargs = new string[](2);
dynargs[0] = args[0];
dynargs[1] = args[1];
return oraclize_query(timestamp, datasource, dynargs);
}
function oraclize_query(uint timestamp, string datasource, string[2] args, uint gaslimit) oraclizeAPI internal returns (bytes32 id) {
string[] memory dynargs = new string[](2);
dynargs[0] = args[0];
dynargs[1] = args[1];
return oraclize_query(timestamp, datasource, dynargs, gaslimit);
}
function oraclize_query(string datasource, string[2] args, uint gaslimit) oraclizeAPI internal returns (bytes32 id) {
string[] memory dynargs = new string[](2);
dynargs[0] = args[0];
dynargs[1] = args[1];
return oraclize_query(datasource, dynargs, gaslimit);
}
function oraclize_query(string datasource, string[3] args) oraclizeAPI internal returns (bytes32 id) {
string[] memory dynargs = new string[](3);
dynargs[0] = args[0];
dynargs[1] = args[1];
dynargs[2] = args[2];
return oraclize_query(datasource, dynargs);
}
function oraclize_query(uint timestamp, string datasource, string[3] args) oraclizeAPI internal returns (bytes32 id) {
string[] memory dynargs = new string[](3);
dynargs[0] = args[0];
dynargs[1] = args[1];
dynargs[2] = args[2];
return oraclize_query(timestamp, datasource, dynargs);
}
function oraclize_query(uint timestamp, string datasource, string[3] args, uint gaslimit) oraclizeAPI internal returns (bytes32 id) {
string[] memory dynargs = new string[](3);
dynargs[0] = args[0];
dynargs[1] = args[1];
dynargs[2] = args[2];
return oraclize_query(timestamp, datasource, dynargs, gaslimit);
}
function oraclize_query(string datasource, string[3] args, uint gaslimit) oraclizeAPI internal returns (bytes32 id) {
string[] memory dynargs = new string[](3);
dynargs[0] = args[0];
dynargs[1] = args[1];
dynargs[2] = args[2];
return oraclize_query(datasource, dynargs, gaslimit);
}
function oraclize_query(string datasource, string[4] args) oraclizeAPI internal returns (bytes32 id) {
string[] memory dynargs = new string[](4);
dynargs[0] = args[0];
dynargs[1] = args[1];
dynargs[2] = args[2];
dynargs[3] = args[3];
return oraclize_query(datasource, dynargs);
}
function oraclize_query(uint timestamp, string datasource, string[4] args) oraclizeAPI internal returns (bytes32 id) {
string[] memory dynargs = new string[](4);
dynargs[0] = args[0];
dynargs[1] = args[1];
dynargs[2] = args[2];
dynargs[3] = args[3];
return oraclize_query(timestamp, datasource, dynargs);
}
function oraclize_query(uint timestamp, string datasource, string[4] args, uint gaslimit) oraclizeAPI internal returns (bytes32 id) {
string[] memory dynargs = new string[](4);
dynargs[0] = args[0];
dynargs[1] = args[1];
dynargs[2] = args[2];
dynargs[3] = args[3];
return oraclize_query(timestamp, datasource, dynargs, gaslimit);
}
function oraclize_query(string datasource, string[4] args, uint gaslimit) oraclizeAPI internal returns (bytes32 id) {
string[] memory dynargs = new string[](4);
dynargs[0] = args[0];
dynargs[1] = args[1];
dynargs[2] = args[2];
dynargs[3] = args[3];
return oraclize_query(datasource, dynargs, gaslimit);
}
function oraclize_query(string datasource, string[5] args) oraclizeAPI internal returns (bytes32 id) {
string[] memory dynargs = new string[](5);
dynargs[0] = args[0];
dynargs[1] = args[1];
dynargs[2] = args[2];
dynargs[3] = args[3];
dynargs[4] = args[4];
return oraclize_query(datasource, dynargs);
}
function oraclize_query(uint timestamp, string datasource, string[5] args) oraclizeAPI internal returns (bytes32 id) {
string[] memory dynargs = new string[](5);
dynargs[0] = args[0];
dynargs[1] = args[1];
dynargs[2] = args[2];
dynargs[3] = args[3];
dynargs[4] = args[4];
return oraclize_query(timestamp, datasource, dynargs);
}
function oraclize_query(uint timestamp, string datasource, string[5] args, uint gaslimit) oraclizeAPI internal returns (bytes32 id) {
string[] memory dynargs = new string[](5);
dynargs[0] = args[0];
dynargs[1] = args[1];
dynargs[2] = args[2];
dynargs[3] = args[3];
dynargs[4] = args[4];
return oraclize_query(timestamp, datasource, dynargs, gaslimit);
}
function oraclize_query(string datasource, string[5] args, uint gaslimit) oraclizeAPI internal returns (bytes32 id) {
string[] memory dynargs = new string[](5);
dynargs[0] = args[0];
dynargs[1] = args[1];
dynargs[2] = args[2];
dynargs[3] = args[3];
dynargs[4] = args[4];
return oraclize_query(datasource, dynargs, gaslimit);
}
function oraclize_query(string datasource, bytes[] argN) oraclizeAPI internal returns (bytes32 id){
uint price = oraclize.getPrice(datasource);
if (price > 1 ether + tx.gasprice*200000) return 0; // unexpectedly high price
bytes memory args = ba2cbor(argN);
return oraclize.queryN.value(price)(0, datasource, args);
}
function oraclize_query(uint timestamp, string datasource, bytes[] argN) oraclizeAPI internal returns (bytes32 id){
uint price = oraclize.getPrice(datasource);
if (price > 1 ether + tx.gasprice*200000) return 0; // unexpectedly high price
bytes memory args = ba2cbor(argN);
return oraclize.queryN.value(price)(timestamp, datasource, args);
}
function oraclize_query(uint timestamp, string datasource, bytes[] argN, uint gaslimit) oraclizeAPI internal returns (bytes32 id){
uint price = oraclize.getPrice(datasource, gaslimit);
if (price > 1 ether + tx.gasprice*gaslimit) return 0; // unexpectedly high price
bytes memory args = ba2cbor(argN);
return oraclize.queryN_withGasLimit.value(price)(timestamp, datasource, args, gaslimit);
}
function oraclize_query(string datasource, bytes[] argN, uint gaslimit) oraclizeAPI internal returns (bytes32 id){
uint price = oraclize.getPrice(datasource, gaslimit);
if (price > 1 ether + tx.gasprice*gaslimit) return 0; // unexpectedly high price
bytes memory args = ba2cbor(argN);
return oraclize.queryN_withGasLimit.value(price)(0, datasource, args, gaslimit);
}
function oraclize_query(string datasource, bytes[1] args) oraclizeAPI internal returns (bytes32 id) {
bytes[] memory dynargs = new bytes[](1);
dynargs[0] = args[0];
return oraclize_query(datasource, dynargs);
}
function oraclize_query(uint timestamp, string datasource, bytes[1] args) oraclizeAPI internal returns (bytes32 id) {
bytes[] memory dynargs = new bytes[](1);
dynargs[0] = args[0];
return oraclize_query(timestamp, datasource, dynargs);
}
function oraclize_query(uint timestamp, string datasource, bytes[1] args, uint gaslimit) oraclizeAPI internal returns (bytes32 id) {
bytes[] memory dynargs = new bytes[](1);
dynargs[0] = args[0];
return oraclize_query(timestamp, datasource, dynargs, gaslimit);
}
function oraclize_query(string datasource, bytes[1] args, uint gaslimit) oraclizeAPI internal returns (bytes32 id) {
bytes[] memory dynargs = new bytes[](1);
dynargs[0] = args[0];
return oraclize_query(datasource, dynargs, gaslimit);
}
function oraclize_query(string datasource, bytes[2] args) oraclizeAPI internal returns (bytes32 id) {
bytes[] memory dynargs = new bytes[](2);
dynargs[0] = args[0];
dynargs[1] = args[1];
return oraclize_query(datasource, dynargs);
}
function oraclize_query(uint timestamp, string datasource, bytes[2] args) oraclizeAPI internal returns (bytes32 id) {
bytes[] memory dynargs = new bytes[](2);
dynargs[0] = args[0];
dynargs[1] = args[1];
return oraclize_query(timestamp, datasource, dynargs);
}
function oraclize_query(uint timestamp, string datasource, bytes[2] args, uint gaslimit) oraclizeAPI internal returns (bytes32 id) {
bytes[] memory dynargs = new bytes[](2);
dynargs[0] = args[0];
dynargs[1] = args[1];
return oraclize_query(timestamp, datasource, dynargs, gaslimit);
}
function oraclize_query(string datasource, bytes[2] args, uint gaslimit) oraclizeAPI internal returns (bytes32 id) {
bytes[] memory dynargs = new bytes[](2);
dynargs[0] = args[0];
dynargs[1] = args[1];
return oraclize_query(datasource, dynargs, gaslimit);
}
function oraclize_query(string datasource, bytes[3] args) oraclizeAPI internal returns (bytes32 id) {
bytes[] memory dynargs = new bytes[](3);
dynargs[0] = args[0];
dynargs[1] = args[1];
dynargs[2] = args[2];
return oraclize_query(datasource, dynargs);
}
function oraclize_query(uint timestamp, string datasource, bytes[3] args) oraclizeAPI internal returns (bytes32 id) {
bytes[] memory dynargs = new bytes[](3);
dynargs[0] = args[0];
dynargs[1] = args[1];
dynargs[2] = args[2];
return oraclize_query(timestamp, datasource, dynargs);
}
function oraclize_query(uint timestamp, string datasource, bytes[3] args, uint gaslimit) oraclizeAPI internal returns (bytes32 id) {
bytes[] memory dynargs = new bytes[](3);
dynargs[0] = args[0];
dynargs[1] = args[1];
dynargs[2] = args[2];
return oraclize_query(timestamp, datasource, dynargs, gaslimit);
}
function oraclize_query(string datasource, bytes[3] args, uint gaslimit) oraclizeAPI internal returns (bytes32 id) {
bytes[] memory dynargs = new bytes[](3);
dynargs[0] = args[0];
dynargs[1] = args[1];
dynargs[2] = args[2];
return oraclize_query(datasource, dynargs, gaslimit);
}
function oraclize_query(string datasource, bytes[4] args) oraclizeAPI internal returns (bytes32 id) {
bytes[] memory dynargs = new bytes[](4);
dynargs[0] = args[0];
dynargs[1] = args[1];
dynargs[2] = args[2];
dynargs[3] = args[3];
return oraclize_query(datasource, dynargs);
}
function oraclize_query(uint timestamp, string datasource, bytes[4] args) oraclizeAPI internal returns (bytes32 id) {
bytes[] memory dynargs = new bytes[](4);
dynargs[0] = args[0];
dynargs[1] = args[1];
dynargs[2] = args[2];
dynargs[3] = args[3];
return oraclize_query(timestamp, datasource, dynargs);
}
function oraclize_query(uint timestamp, string datasource, bytes[4] args, uint gaslimit) oraclizeAPI internal returns (bytes32 id) {
bytes[] memory dynargs = new bytes[](4);
dynargs[0] = args[0];
dynargs[1] = args[1];
dynargs[2] = args[2];
dynargs[3] = args[3];
return oraclize_query(timestamp, datasource, dynargs, gaslimit);
}
function oraclize_query(string datasource, bytes[4] args, uint gaslimit) oraclizeAPI internal returns (bytes32 id) {
bytes[] memory dynargs = new bytes[](4);
dynargs[0] = args[0];
dynargs[1] = args[1];
dynargs[2] = args[2];
dynargs[3] = args[3];
return oraclize_query(datasource, dynargs, gaslimit);
}
function oraclize_query(string datasource, bytes[5] args) oraclizeAPI internal returns (bytes32 id) {
bytes[] memory dynargs = new bytes[](5);
dynargs[0] = args[0];
dynargs[1] = args[1];
dynargs[2] = args[2];
dynargs[3] = args[3];
dynargs[4] = args[4];
return oraclize_query(datasource, dynargs);
}
function oraclize_query(uint timestamp, string datasource, bytes[5] args) oraclizeAPI internal returns (bytes32 id) {
bytes[] memory dynargs = new bytes[](5);
dynargs[0] = args[0];
dynargs[1] = args[1];
dynargs[2] = args[2];
dynargs[3] = args[3];
dynargs[4] = args[4];
return oraclize_query(timestamp, datasource, dynargs);
}
function oraclize_query(uint timestamp, string datasource, bytes[5] args, uint gaslimit) oraclizeAPI internal returns (bytes32 id) {
bytes[] memory dynargs = new bytes[](5);
dynargs[0] = args[0];
dynargs[1] = args[1];
dynargs[2] = args[2];
dynargs[3] = args[3];
dynargs[4] = args[4];
return oraclize_query(timestamp, datasource, dynargs, gaslimit);
}
function oraclize_query(string datasource, bytes[5] args, uint gaslimit) oraclizeAPI internal returns (bytes32 id) {
bytes[] memory dynargs = new bytes[](5);
dynargs[0] = args[0];
dynargs[1] = args[1];
dynargs[2] = args[2];
dynargs[3] = args[3];
dynargs[4] = args[4];
return oraclize_query(datasource, dynargs, gaslimit);
}
function oraclize_cbAddress() oraclizeAPI internal returns (address){
return oraclize.cbAddress();
}
function oraclize_setProof(byte proofP) oraclizeAPI internal {
return oraclize.setProofType(proofP);
}
function oraclize_setCustomGasPrice(uint gasPrice) oraclizeAPI internal {
return oraclize.setCustomGasPrice(gasPrice);
}
function oraclize_randomDS_getSessionPubKeyHash() oraclizeAPI internal returns (bytes32){
return oraclize.randomDS_getSessionPubKeyHash();
}
function getCodeSize(address _addr) constant internal returns(uint _size) {
assembly {
_size := extcodesize(_addr)
}
}
function parseAddr(string _a) internal pure returns (address){
bytes memory tmp = bytes(_a);
uint160 iaddr = 0;
uint160 b1;
uint160 b2;
for (uint i=2; i<2+2*20; i+=2){
iaddr *= 256;
b1 = uint160(tmp[i]);
b2 = uint160(tmp[i+1]);
if ((b1 >= 97)&&(b1 <= 102)) b1 -= 87;
else if ((b1 >= 65)&&(b1 <= 70)) b1 -= 55;
else if ((b1 >= 48)&&(b1 <= 57)) b1 -= 48;
if ((b2 >= 97)&&(b2 <= 102)) b2 -= 87;
else if ((b2 >= 65)&&(b2 <= 70)) b2 -= 55;
else if ((b2 >= 48)&&(b2 <= 57)) b2 -= 48;
iaddr += (b1*16+b2);
}
return address(iaddr);
}
function strCompare(string _a, string _b) internal pure returns (int) {
bytes memory a = bytes(_a);
bytes memory b = bytes(_b);
uint minLength = a.length;
if (b.length < minLength) minLength = b.length;
for (uint i = 0; i < minLength; i ++)
if (a[i] < b[i])
return -1;
else if (a[i] > b[i])
return 1;
if (a.length < b.length)
return -1;
else if (a.length > b.length)
return 1;
else
return 0;
}
function indexOf(string _haystack, string _needle) internal pure returns (int) {
bytes memory h = bytes(_haystack);
bytes memory n = bytes(_needle);
if(h.length < 1 || n.length < 1 || (n.length > h.length))
return -1;
else if(h.length > (2**128 -1))
return -1;
else
{
uint subindex = 0;
for (uint i = 0; i < h.length; i ++)
{
if (h[i] == n[0])
{
subindex = 1;
while(subindex < n.length && (i + subindex) < h.length && h[i + subindex] == n[subindex])
{
subindex++;
}
if(subindex == n.length)
return int(i);
}
}
return -1;
}
}
function strConcat(string _a, string _b, string _c, string _d, string _e) internal pure returns (string) {
bytes memory _ba = bytes(_a);
bytes memory _bb = bytes(_b);
bytes memory _bc = bytes(_c);
bytes memory _bd = bytes(_d);
bytes memory _be = bytes(_e);
string memory abcde = new string(_ba.length + _bb.length + _bc.length + _bd.length + _be.length);
bytes memory babcde = bytes(abcde);
uint k = 0;
for (uint i = 0; i < _ba.length; i++) babcde[k++] = _ba[i];
for (i = 0; i < _bb.length; i++) babcde[k++] = _bb[i];
for (i = 0; i < _bc.length; i++) babcde[k++] = _bc[i];
for (i = 0; i < _bd.length; i++) babcde[k++] = _bd[i];
for (i = 0; i < _be.length; i++) babcde[k++] = _be[i];
return string(babcde);
}
function strConcat(string _a, string _b, string _c, string _d) internal pure returns (string) {
return strConcat(_a, _b, _c, _d, "");
}
function strConcat(string _a, string _b, string _c) internal pure returns (string) {
return strConcat(_a, _b, _c, "", "");
}
function strConcat(string _a, string _b) internal pure returns (string) {
return strConcat(_a, _b, "", "", "");
}
// parseInt
function parseInt(string _a) internal pure returns (uint) {
return parseInt(_a, 0);
}
// parseInt(parseFloat*10^_b)
function parseInt(string _a, uint _b) internal pure returns (uint) {
bytes memory bresult = bytes(_a);
uint mint = 0;
bool decimals = false;
for (uint i=0; i<bresult.length; i++){
if ((bresult[i] >= 48)&&(bresult[i] <= 57)){
if (decimals){
if (_b == 0) break;
else _b--;
}
mint *= 10;
mint += uint(bresult[i]) - 48;
} else if (bresult[i] == 46) decimals = true;
}
if (_b > 0) mint *= 10**_b;
return mint;
}
function uint2str(uint i) internal pure returns (string){
if (i == 0) return "0";
uint j = i;
uint len;
while (j != 0){
len++;
j /= 10;
}
bytes memory bstr = new bytes(len);
uint k = len - 1;
while (i != 0){
bstr[k--] = byte(48 + i % 10);
i /= 10;
}
return string(bstr);
}
function stra2cbor(string[] arr) internal pure returns (bytes) {
uint arrlen = arr.length;
// get correct cbor output length
uint outputlen = 0;
bytes[] memory elemArray = new bytes[](arrlen);
for (uint i = 0; i < arrlen; i++) {
elemArray[i] = (bytes(arr[i]));
outputlen += elemArray[i].length + (elemArray[i].length - 1)/23 + 3; //+3 accounts for paired identifier types
}
uint ctr = 0;
uint cborlen = arrlen + 0x80;
outputlen += byte(cborlen).length;
bytes memory res = new bytes(outputlen);
while (byte(cborlen).length > ctr) {
res[ctr] = byte(cborlen)[ctr];
ctr++;
}
for (i = 0; i < arrlen; i++) {
res[ctr] = 0x5F;
ctr++;
for (uint x = 0; x < elemArray[i].length; x++) {
// if there's a bug with larger strings, this may be the culprit
if (x % 23 == 0) {
uint elemcborlen = elemArray[i].length - x >= 24 ? 23 : elemArray[i].length - x;
elemcborlen += 0x40;
uint lctr = ctr;
while (byte(elemcborlen).length > ctr - lctr) {
res[ctr] = byte(elemcborlen)[ctr - lctr];
ctr++;
}
}
res[ctr] = elemArray[i][x];
ctr++;
}
res[ctr] = 0xFF;
ctr++;
}
return res;
}
function ba2cbor(bytes[] arr) internal pure returns (bytes) {
uint arrlen = arr.length;
// get correct cbor output length
uint outputlen = 0;
bytes[] memory elemArray = new bytes[](arrlen);
for (uint i = 0; i < arrlen; i++) {
elemArray[i] = (bytes(arr[i]));
outputlen += elemArray[i].length + (elemArray[i].length - 1)/23 + 3; //+3 accounts for paired identifier types
}
uint ctr = 0;
uint cborlen = arrlen + 0x80;
outputlen += byte(cborlen).length;
bytes memory res = new bytes(outputlen);
while (byte(cborlen).length > ctr) {
res[ctr] = byte(cborlen)[ctr];
ctr++;
}
for (i = 0; i < arrlen; i++) {
res[ctr] = 0x5F;
ctr++;
for (uint x = 0; x < elemArray[i].length; x++) {
// if there's a bug with larger strings, this may be the culprit
if (x % 23 == 0) {
uint elemcborlen = elemArray[i].length - x >= 24 ? 23 : elemArray[i].length - x;
elemcborlen += 0x40;
uint lctr = ctr;
while (byte(elemcborlen).length > ctr - lctr) {
res[ctr] = byte(elemcborlen)[ctr - lctr];
ctr++;
}
}
res[ctr] = elemArray[i][x];
ctr++;
}
res[ctr] = 0xFF;
ctr++;
}
return res;
}
string oraclize_network_name;
function oraclize_setNetworkName(string _network_name) internal {
oraclize_network_name = _network_name;
}
function oraclize_getNetworkName() internal view returns (string) {
return oraclize_network_name;
}
function oraclize_newRandomDSQuery(uint _delay, uint _nbytes, uint _customGasLimit) internal returns (bytes32){
require((_nbytes > 0) && (_nbytes <= 32));
// Convert from seconds to ledger timer ticks
_delay *= 10;
bytes memory nbytes = new bytes(1);
nbytes[0] = byte(_nbytes);
bytes memory unonce = new bytes(32);
bytes memory sessionKeyHash = new bytes(32);
bytes32 sessionKeyHash_bytes32 = oraclize_randomDS_getSessionPubKeyHash();
assembly {
mstore(unonce, 0x20)
mstore(add(unonce, 0x20), xor(blockhash(sub(number, 1)), xor(coinbase, timestamp)))
mstore(sessionKeyHash, 0x20)
mstore(add(sessionKeyHash, 0x20), sessionKeyHash_bytes32)
}
bytes memory delay = new bytes(32);
assembly {
mstore(add(delay, 0x20), _delay)
}
bytes memory delay_bytes8 = new bytes(8);
copyBytes(delay, 24, 8, delay_bytes8, 0);
bytes[4] memory args = [unonce, nbytes, sessionKeyHash, delay];
bytes32 queryId = oraclize_query("random", args, _customGasLimit);
bytes memory delay_bytes8_left = new bytes(8);
assembly {
let x := mload(add(delay_bytes8, 0x20))
mstore8(add(delay_bytes8_left, 0x27), div(x, 0x100000000000000000000000000000000000000000000000000000000000000))
mstore8(add(delay_bytes8_left, 0x26), div(x, 0x1000000000000000000000000000000000000000000000000000000000000))
mstore8(add(delay_bytes8_left, 0x25), div(x, 0x10000000000000000000000000000000000000000000000000000000000))
mstore8(add(delay_bytes8_left, 0x24), div(x, 0x100000000000000000000000000000000000000000000000000000000))
mstore8(add(delay_bytes8_left, 0x23), div(x, 0x1000000000000000000000000000000000000000000000000000000))
mstore8(add(delay_bytes8_left, 0x22), div(x, 0x10000000000000000000000000000000000000000000000000000))
mstore8(add(delay_bytes8_left, 0x21), div(x, 0x100000000000000000000000000000000000000000000000000))
mstore8(add(delay_bytes8_left, 0x20), div(x, 0x1000000000000000000000000000000000000000000000000))
}
oraclize_randomDS_setCommitment(queryId, keccak256(delay_bytes8_left, args[1], sha256(args[0]), args[2]));
return queryId;
}
function oraclize_randomDS_setCommitment(bytes32 queryId, bytes32 commitment) internal {
oraclize_randomDS_args[queryId] = commitment;
}
mapping(bytes32=>bytes32) oraclize_randomDS_args;
mapping(bytes32=>bool) oraclize_randomDS_sessionKeysHashVerified;
function verifySig(bytes32 tosignh, bytes dersig, bytes pubkey) internal returns (bool){
bool sigok;
address signer;
bytes32 sigr;
bytes32 sigs;
bytes memory sigr_ = new bytes(32);
uint offset = 4+(uint(dersig[3]) - 0x20);
sigr_ = copyBytes(dersig, offset, 32, sigr_, 0);
bytes memory sigs_ = new bytes(32);
offset += 32 + 2;
sigs_ = copyBytes(dersig, offset+(uint(dersig[offset-1]) - 0x20), 32, sigs_, 0);
assembly {
sigr := mload(add(sigr_, 32))
sigs := mload(add(sigs_, 32))
}
(sigok, signer) = safer_ecrecover(tosignh, 27, sigr, sigs);
if (address(keccak256(pubkey)) == signer) return true;
else {
(sigok, signer) = safer_ecrecover(tosignh, 28, sigr, sigs);
return (address(keccak256(pubkey)) == signer);
}
}
function oraclize_randomDS_proofVerify__sessionKeyValidity(bytes proof, uint sig2offset) internal returns (bool) {
bool sigok;
// Step 6: verify the attestation signature, APPKEY1 must sign the sessionKey from the correct ledger app (CODEHASH)
bytes memory sig2 = new bytes(uint(proof[sig2offset+1])+2);
copyBytes(proof, sig2offset, sig2.length, sig2, 0);
bytes memory appkey1_pubkey = new bytes(64);
copyBytes(proof, 3+1, 64, appkey1_pubkey, 0);
bytes memory tosign2 = new bytes(1+65+32);
tosign2[0] = byte(1); //role
copyBytes(proof, sig2offset-65, 65, tosign2, 1);
bytes memory CODEHASH = hex"fd94fa71bc0ba10d39d464d0d8f465efeef0a2764e3887fcc9df41ded20f505c";
copyBytes(CODEHASH, 0, 32, tosign2, 1+65);
sigok = verifySig(sha256(tosign2), sig2, appkey1_pubkey);
if (sigok == false) return false;
// Step 7: verify the APPKEY1 provenance (must be signed by Ledger)
bytes memory LEDGERKEY = hex"7fb956469c5c9b89840d55b43537e66a98dd4811ea0a27224272c2e5622911e8537a2f8e86a46baec82864e98dd01e9ccc2f8bc5dfc9cbe5a91a290498dd96e4";
bytes memory tosign3 = new bytes(1+65);
tosign3[0] = 0xFE;
copyBytes(proof, 3, 65, tosign3, 1);
bytes memory sig3 = new bytes(uint(proof[3+65+1])+2);
copyBytes(proof, 3+65, sig3.length, sig3, 0);
sigok = verifySig(sha256(tosign3), sig3, LEDGERKEY);
return sigok;
}
modifier oraclize_randomDS_proofVerify(bytes32 _queryId, string _result, bytes _proof) {
// Step 1: the prefix has to match 'LP\x01' (Ledger Proof version 1)
require((_proof[0] == "L") && (_proof[1] == "P") && (_proof[2] == 1));
bool proofVerified = oraclize_randomDS_proofVerify__main(_proof, _queryId, bytes(_result), oraclize_getNetworkName());
require(proofVerified);
_;
}
function oraclize_randomDS_proofVerify__returnCode(bytes32 _queryId, string _result, bytes _proof) internal returns (uint8){
// Step 1: the prefix has to match 'LP\x01' (Ledger Proof version 1)
if ((_proof[0] != "L")||(_proof[1] != "P")||(_proof[2] != 1)) return 1;
bool proofVerified = oraclize_randomDS_proofVerify__main(_proof, _queryId, bytes(_result), oraclize_getNetworkName());
if (proofVerified == false) return 2;
return 0;
}
function matchBytes32Prefix(bytes32 content, bytes prefix, uint n_random_bytes) internal pure returns (bool){
bool match_ = true;
require(prefix.length == n_random_bytes);
for (uint256 i=0; i< n_random_bytes; i++) {
if (content[i] != prefix[i]) match_ = false;
}
return match_;
}
function oraclize_randomDS_proofVerify__main(bytes proof, bytes32 queryId, bytes result, string context_name) internal returns (bool){
// Step 2: the unique keyhash has to match with the sha256 of (context name + queryId)
uint ledgerProofLength = 3+65+(uint(proof[3+65+1])+2)+32;
bytes memory keyhash = new bytes(32);
copyBytes(proof, ledgerProofLength, 32, keyhash, 0);
if (!(keccak256(keyhash) == keccak256(sha256(context_name, queryId)))) return false;
bytes memory sig1 = new bytes(uint(proof[ledgerProofLength+(32+8+1+32)+1])+2);
copyBytes(proof, ledgerProofLength+(32+8+1+32), sig1.length, sig1, 0);
// Step 3: we assume sig1 is valid (it will be verified during step 5) and we verify if 'result' is the prefix of sha256(sig1)
if (!matchBytes32Prefix(sha256(sig1), result, uint(proof[ledgerProofLength+32+8]))) return false;
// Step 4: commitment match verification, keccak256(delay, nbytes, unonce, sessionKeyHash) == commitment in storage.
// This is to verify that the computed args match with the ones specified in the query.
bytes memory commitmentSlice1 = new bytes(8+1+32);
copyBytes(proof, ledgerProofLength+32, 8+1+32, commitmentSlice1, 0);
bytes memory sessionPubkey = new bytes(64);
uint sig2offset = ledgerProofLength+32+(8+1+32)+sig1.length+65;
copyBytes(proof, sig2offset-64, 64, sessionPubkey, 0);
bytes32 sessionPubkeyHash = sha256(sessionPubkey);
if (oraclize_randomDS_args[queryId] == keccak256(commitmentSlice1, sessionPubkeyHash)){ //unonce, nbytes and sessionKeyHash match
delete oraclize_randomDS_args[queryId];
} else return false;
// Step 5: validity verification for sig1 (keyhash and args signed with the sessionKey)
bytes memory tosign1 = new bytes(32+8+1+32);
copyBytes(proof, ledgerProofLength, 32+8+1+32, tosign1, 0);
if (!verifySig(sha256(tosign1), sig1, sessionPubkey)) return false;
// verify if sessionPubkeyHash was verified already, if not.. let's do it!
if (oraclize_randomDS_sessionKeysHashVerified[sessionPubkeyHash] == false){
oraclize_randomDS_sessionKeysHashVerified[sessionPubkeyHash] = oraclize_randomDS_proofVerify__sessionKeyValidity(proof, sig2offset);
}
return oraclize_randomDS_sessionKeysHashVerified[sessionPubkeyHash];
}
// the following function has been written by Alex Beregszaszi (@axic), use it under the terms of the MIT license
function copyBytes(bytes from, uint fromOffset, uint length, bytes to, uint toOffset) internal pure returns (bytes) {
uint minLength = length + toOffset;
// Buffer too small
require(to.length >= minLength); // Should be a better way?
// NOTE: the offset 32 is added to skip the `size` field of both bytes variables
uint i = 32 + fromOffset;
uint j = 32 + toOffset;
while (i < (32 + fromOffset + length)) {
assembly {
let tmp := mload(add(from, i))
mstore(add(to, j), tmp)
}
i += 32;
j += 32;
}
return to;
}
// the following function has been written by Alex Beregszaszi (@axic), use it under the terms of the MIT license
// Duplicate Solidity's ecrecover, but catching the CALL return value
function safer_ecrecover(bytes32 hash, uint8 v, bytes32 r, bytes32 s) internal returns (bool, address) {
// We do our own memory management here. Solidity uses memory offset
// 0x40 to store the current end of memory. We write past it (as
// writes are memory extensions), but don't update the offset so
// Solidity will reuse it. The memory used here is only needed for
// this context.
// FIXME: inline assembly can't access return values
bool ret;
address addr;
assembly {
let size := mload(0x40)
mstore(size, hash)
mstore(add(size, 32), v)
mstore(add(size, 64), r)
mstore(add(size, 96), s)
// NOTE: we can reuse the request memory because we deal with
// the return code
ret := call(3000, 1, 0, size, 128, size, 32)
addr := mload(size)
}
return (ret, addr);
}
// the following function has been written by Alex Beregszaszi (@axic), use it under the terms of the MIT license
function ecrecovery(bytes32 hash, bytes sig) internal returns (bool, address) {
bytes32 r;
bytes32 s;
uint8 v;
if (sig.length != 65)
return (false, 0);
// The signature format is a compact form of:
// {bytes32 r}{bytes32 s}{uint8 v}
// Compact means, uint8 is not padded to 32 bytes.
assembly {
r := mload(add(sig, 32))
s := mload(add(sig, 64))
// Here we are loading the last 32 bytes. We exploit the fact that
// 'mload' will pad with zeroes if we overread.
// There is no 'mload8' to do this, but that would be nicer.
v := byte(0, mload(add(sig, 96)))
// Alternative solution:
// 'byte' is not working due to the Solidity parser, so lets
// use the second best option, 'and'
// v := and(mload(add(sig, 65)), 255)
}
// albeit non-transactional signatures are not specified by the YP, one would expect it
// to match the YP range of [27, 28]
//
// geth uses [0, 1] and some clients have followed. This might change, see:
// https://github.com/ethereum/go-ethereum/issues/2053
if (v < 27)
v += 27;
if (v != 27 && v != 28)
return (false, 0);
return safer_ecrecover(hash, v, r, s);
}
}
// </ORACLIZE_API>
/*
* @title MDAPPSale
* @dev MDAPPSale is a base contract for managing the token sale.
* MDAPPSale has got a start timestamp, from where buyers can make
* token purchases and the contract will assign them tokens based
* on a ETH per token rate. Funds collected are forwarded to a wallet
* as they arrive.
*/
contract MDAPPSale is Ownable, PullPayment, usingOraclize {
//contract MDAPPSale is Ownable, PullPayment {
using SafeMath for uint256;
using SafeMath16 for uint16;
// The MDAPP core contract
MDAPP public mdapp;
// Start timestamp for presale (inclusive)
uint256 public startTimePresale;
// End timestamp for presale
uint256 public endTimePresale;
// Start timestamp sale
uint256 public startTimeSale;
// Address where funds are collected
address public wallet;
// Amount of raised money in wei. Only for stats. Don't use for calculations.
uint256 public weiRaised;
// Sold out / sale active?
bool public soldOut = false;
// Max supply
uint16 public constant maxSupply = 10000;
// Initial supply
uint16 public supply = 0;
// Oracle active?
bool public oracleActive = false;
// Delay between autonomous oraclize requests
uint256 public oracleInterval;
// Gas price for oraclize callback transaction
uint256 public oracleGasPrice = 7000000000;
// Gas limit for oraclize callback transaction
// Unused gas is returned to oraclize.
uint256 public oracleGasLimit = 105000;
// When was the ethusd rate updated the last time?
uint256 public oracleLastUpdate = 1;
// Alternative: json(https://api.kraken.com/0/public/Ticker?pair=ETHUSD).result.XETHZUSD.c.0
string public oracleQueryString = 'json(https://api.gdax.com/products/ETH-USD/ticker).price';
// USD Cent value of 1 ether
uint256 public ethusd;
uint256 ethusdLast;
/*********************************************************
* *
* Events *
* *
*********************************************************/
/*
* Event for token purchase logging.
* @param purchaser who paid for the tokens
* @param beneficiary who got the tokens
* @param value weis paid for purchase
* @param tokens amount of tokens purchased
*/
event TokenPurchase(address indexed purchaser, address indexed beneficiary, uint256 value, uint16 tokens);
event Recruited(address indexed purchaser, address indexed beneficiary, address indexed recruiter, uint256 value, uint256 share, uint16 tokens);
// Received ETH via fallback function
event Receive(address sender, uint256 value);
event BountyGranted(address indexed beneficiary, uint16 tokens, string reason);
event LogPriceUpdated(uint256 price);
event OracleFundsWithdraw(uint256 value);
event OracleGasPriceChange(uint256 value);
event OracleGasLimitChange(uint256 value);
event OracleIntervalChange(uint256 value);
event OracleQueryStringChange(string value);
event ETHUSDSet(uint256 value);
/*********************************************************
* *
* Initial deployment *
* *
*********************************************************/
constructor(uint256 _startTimePre, uint256 _endTimePre, uint256 _startTimeSale, address _wallet, uint256 _ethusd, uint _oracleInterval, address _mdapp) public {
require(_startTimePre >= now);
require(_endTimePre > _startTimePre);
require(_startTimeSale >= _endTimePre);
require(_wallet != 0x0);
require(_ethusd > 0);
require(_mdapp != 0x0);
ethusd = _ethusd;
ethusdLast = ethusd;
oracleInterval = _oracleInterval;
startTimePresale = _startTimePre;
endTimePresale = _endTimePre;
startTimeSale = _startTimeSale;
wallet = _wallet;
mdapp = MDAPP(_mdapp);
oraclize_setCustomGasPrice(oracleGasPrice);
}
/*********************************************************
* *
* Price calculation and oracle handling *
* *
*********************************************************/
/**
* @dev Request ETHUSD rate from oraclize
* @param _delay in seconds when the request should be scheduled from now on
*/
function requestEthUsd(uint _delay) internal { // Internal call:
if (oracleActive && !soldOut) {
if (oraclize_getPrice("URL") > address(this).balance) {
oracleActive = false;
} else {
if (_delay == 0) {
oraclize_query("URL", oracleQueryString, oracleGasLimit);
} else {
oraclize_query(_delay, "URL", oracleQueryString, oracleGasLimit);
}
}
}
}
/**
* @dev Called by oraclize.
*/
function __callback(bytes32 myid, string result) public {
if (msg.sender != oraclize_cbAddress()) revert();
ethusdLast = ethusd;
ethusd = parseInt(result, 2);
oracleLastUpdate = now;
emit LogPriceUpdated(ethusd);
requestEthUsd(oracleInterval);
}
// Activate ethusd oracle
function activateOracle() onlyOwner external payable {
oracleActive = true;
requestEthUsd(0);
}
function setOracleGasPrice(uint256 _gasPrice) onlyOwner external {
require(_gasPrice > 0, "Gas price must be a positive number.");
oraclize_setCustomGasPrice(_gasPrice);
oracleGasPrice = _gasPrice;
emit OracleGasPriceChange(_gasPrice);
}
function setOracleGasLimit(uint256 _gasLimit) onlyOwner external {
require(_gasLimit > 0, "Gas limit must be a positive number.");
oracleGasLimit = _gasLimit;
emit OracleGasLimitChange(_gasLimit);
}
function setOracleInterval(uint256 _interval) onlyOwner external {
require(_interval > 0, "Interval must be > 0");
oracleInterval = _interval;
emit OracleIntervalChange(_interval);
}
function setOracleQueryString(string _queryString) onlyOwner external {
oracleQueryString = _queryString;
emit OracleQueryStringChange(_queryString);
}
/**
* Only needed to be independent from Oraclize - just for the worst case they stop their service.
*/
function setEthUsd(uint256 _ethusd) onlyOwner external {
require(_ethusd > 0, "ETHUSD must be > 0");
ethusd = _ethusd;
emit ETHUSDSet(_ethusd);
}
/**
* @dev Withdraw remaining oracle funds.
*/
function withdrawOracleFunds() onlyOwner external {
oracleActive = false;
emit OracleFundsWithdraw(address(this).balance);
owner.transfer(address(this).balance);
}
/*********************************************************
* *
* Token and pixel purchase *
* *
*********************************************************/
// Primary token purchase function.
function buyTokens(address _beneficiary, uint16 _tokenAmount, address _recruiter) external payable {
require(_beneficiary != address(0), "Invalid beneficiary.");
require(_tokenAmount > 0, "Token amount bust be a positive integer.");
require(validPurchase(), "Either no active sale or zero ETH sent.");
require(_recruiter != _beneficiary && _recruiter != msg.sender, "Recruiter must not be purchaser or beneficiary.");
assert(ethusd > 0);
// Each pixel costs $1 and 1 token represents 10x10 pixel => x100. ETHUSD comes in Cent => x100 once more
// 10**18 * 10**2 * 10**2 = 10**22
uint256 rate = uint256(10 ** 22).div(ethusd);
// Calculate how much the tokens cost.
// Overpayed purchases don't receive a return.
uint256 cost = uint256(_tokenAmount).mul(rate);
// Accept previous exchange rate if it changed within the last 2 minutes to improve UX during high network load.
if (cost > msg.value) {
if (now - oracleLastUpdate <= 120) {
assert(ethusdLast > 0);
rate = uint256(10 ** 22).div(ethusdLast);
cost = uint256(_tokenAmount).mul(rate);
}
}
require(msg.value >= cost, "Not enough ETH sent.");
// Update supply.
supply += _tokenAmount;
require(supply <= maxSupply, "Not enough tokens available.");
if (_recruiter == address(0)) {
weiRaised = weiRaised.add(msg.value);
asyncTransfer(wallet, msg.value);
} else {
// Purchaser has been recruited. Grant the recruiter 10%.
uint256 tenPercent = msg.value.div(10);
uint256 ninetyPercent = msg.value.sub(tenPercent);
weiRaised = weiRaised.add(ninetyPercent);
asyncTransfer(wallet, ninetyPercent);
asyncTransfer(_recruiter, tenPercent);
emit Recruited(msg.sender, _beneficiary, _recruiter, msg.value, tenPercent, _tokenAmount);
}
// Mint tokens.
bool isPresale = endTimePresale >= now ? true : false;
mdapp.mint(_beneficiary, _tokenAmount, isPresale);
emit TokenPurchase(msg.sender, _beneficiary, msg.value, _tokenAmount);
// Stop minting once we reach max supply.
if (supply == maxSupply) {
soldOut = true;
mdapp.finishMinting();
}
}
function grantBounty(address _beneficiary, uint16 _tokenAmount, string _reason) onlyOwner external {
require(_beneficiary != address(0), "Invalid beneficiary.");
require(_tokenAmount > 0, "Token amount bust be a positive integer.");
// Update supply.
supply += _tokenAmount;
require(supply <= maxSupply, "Not enough tokens available.");
// Mint tokens.
bool isPresale = endTimePresale >= now ? true : false;
mdapp.mint(_beneficiary, _tokenAmount, isPresale);
// Stop minting once we reach max supply.
if (supply == maxSupply) {
soldOut = true;
mdapp.finishMinting();
}
emit BountyGranted(_beneficiary, _tokenAmount, _reason);
}
// Fallback function. Load contract with ETH to use oraclize.
function() public payable {
emit Receive(msg.sender, msg.value);
}
/*********************************************************
* *
* Helpers *
* *
*********************************************************/
// @return true if the transaction can buy tokens
function validPurchase() internal view returns (bool) {
bool withinPeriod = (now >= startTimeSale) || ((now >= startTimePresale) && (now < endTimePresale));
bool nonZeroPurchase = msg.value > 0;
return withinPeriod && nonZeroPurchase && !soldOut;
}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"constant":true,"inputs":[],"name":"supply","outputs":[{"name":"","type":"uint16"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"oracleGasLimit","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_gasLimit","type":"uint256"}],"name":"setOracleGasLimit","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"activateOracle","outputs":[],"payable":true,"stateMutability":"payable","type":"function"},{"constant":false,"inputs":[{"name":"_gasPrice","type":"uint256"}],"name":"setOracleGasPrice","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"endTimePresale","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"myid","type":"bytes32"},{"name":"result","type":"string"}],"name":"__callback","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"oracleLastUpdate","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"oracleGasPrice","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"myid","type":"bytes32"},{"name":"result","type":"string"},{"name":"proof","type":"bytes"}],"name":"__callback","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"weiRaised","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"wallet","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"withdrawPayments","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"ethusd","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"mdapp","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"oracleQueryString","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_beneficiary","type":"address"},{"name":"_tokenAmount","type":"uint16"},{"name":"_recruiter","type":"address"}],"name":"buyTokens","outputs":[],"payable":true,"stateMutability":"payable","type":"function"},{"constant":false,"inputs":[],"name":"renounceOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_beneficiary","type":"address"},{"name":"_tokenAmount","type":"uint16"},{"name":"_reason","type":"string"}],"name":"grantBounty","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_ethusd","type":"uint256"}],"name":"setEthUsd","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"oracleActive","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"soldOut","outputs":[{"name":"","type":"bool"}],"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":"startTimeSale","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"oracleInterval","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"startTimePresale","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"withdrawOracleFunds","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"maxSupply","outputs":[{"name":"","type":"uint16"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_queryString","type":"string"}],"name":"setOracleQueryString","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_dest","type":"address"}],"name":"payments","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_interval","type":"uint256"}],"name":"setOracleInterval","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"inputs":[{"name":"_startTimePre","type":"uint256"},{"name":"_endTimePre","type":"uint256"},{"name":"_startTimeSale","type":"uint256"},{"name":"_wallet","type":"address"},{"name":"_ethusd","type":"uint256"},{"name":"_oracleInterval","type":"uint256"},{"name":"_mdapp","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"payable":true,"stateMutability":"payable","type":"fallback"},{"anonymous":false,"inputs":[{"indexed":true,"name":"purchaser","type":"address"},{"indexed":true,"name":"beneficiary","type":"address"},{"indexed":false,"name":"value","type":"uint256"},{"indexed":false,"name":"tokens","type":"uint16"}],"name":"TokenPurchase","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"purchaser","type":"address"},{"indexed":true,"name":"beneficiary","type":"address"},{"indexed":true,"name":"recruiter","type":"address"},{"indexed":false,"name":"value","type":"uint256"},{"indexed":false,"name":"share","type":"uint256"},{"indexed":false,"name":"tokens","type":"uint16"}],"name":"Recruited","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"sender","type":"address"},{"indexed":false,"name":"value","type":"uint256"}],"name":"Receive","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"beneficiary","type":"address"},{"indexed":false,"name":"tokens","type":"uint16"},{"indexed":false,"name":"reason","type":"string"}],"name":"BountyGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"price","type":"uint256"}],"name":"LogPriceUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"value","type":"uint256"}],"name":"OracleFundsWithdraw","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"value","type":"uint256"}],"name":"OracleGasPriceChange","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"value","type":"uint256"}],"name":"OracleGasLimitChange","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"value","type":"uint256"}],"name":"OracleIntervalChange","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"value","type":"string"}],"name":"OracleQueryStringChange","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"value","type":"uint256"}],"name":"ETHUSDSet","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
600d805463ffffffff191690556401a13b8600600f5562019a28601055600160115560e0604052603860808190527f6a736f6e2868747470733a2f2f6170692e676461782e636f6d2f70726f64756360a09081527f74732f4554482d5553442f7469636b6572292e7072696365000000000000000060c05262000086916012919062000826565b503480156200009457600080fd5b5060405160e08062003c3083398101604090815281516020830151918301516060840151608085015160a086015160c09096015160008054600160a060020a031916331790559395929391929091620000ec620008ab565b604051809103906000f08015801562000109573d6000803e3d6000fd5b5060018054600160a060020a031916600160a060020a0392909216919091179055428710156200013857600080fd5b8686116200014557600080fd5b858510156200015357600080fd5b600160a060020a03841615156200016957600080fd5b600083116200017757600080fd5b600160a060020a03811615156200018d57600080fd5b60138390556014839055600e82905560088790556009869055600a859055600b8054600160a060020a03808716600160a060020a0319928316179092556007805492841692909116919091179055600f54620001f290640100000000620001ff810204565b50505050505050620008d9565b600254600160a060020a031615806200023557506002546200023390600160a060020a031664010000000062000441810204565b155b15620002525762000250600064010000000062000445810204565b505b600260009054906101000a9004600160a060020a0316600160a060020a03166338cc48316040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b158015620002bf57600080fd5b505af1158015620002d4573d6000803e3d6000fd5b505050506040513d6020811015620002eb57600080fd5b5051600354600160a060020a03908116911614620003be57600260009054906101000a9004600160a060020a0316600160a060020a03166338cc48316040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b1580156200037057600080fd5b505af115801562000385573d6000803e3d6000fd5b505050506040513d60208110156200039c57600080fd5b505160038054600160a060020a031916600160a060020a039092169190911790555b600354604080517fca6ad1e4000000000000000000000000000000000000000000000000000000008152600481018490529051600160a060020a039092169163ca6ad1e49160248082019260009290919082900301818387803b1580156200042557600080fd5b505af11580156200043a573d6000803e3d6000fd5b5050505050565b3b90565b60006200045a64010000000062000460810204565b92915050565b6000806200048b731d3b2638a7cc9f2cb3d298a3da7a90b67e5506ed64010000000062000441810204565b1115620005095760028054600160a060020a031916731d3b2638a7cc9f2cb3d298a3da7a90b67e5506ed17905560408051808201909152600b81527f6574685f6d61696e6e6574000000000000000000000000000000000000000000602082015262000500906401000000006200080d810204565b5060016200080a565b60006200053373c03a2615d5efaf5f49f60b7bb6583eaec212fdf164010000000062000441810204565b1115620005a85760028054600160a060020a03191673c03a2615d5efaf5f49f60b7bb6583eaec212fdf117905560408051808201909152600c81527f6574685f726f707374656e330000000000000000000000000000000000000000602082015262000500906401000000006200080d810204565b6000620005d273b7a07bcf2ba2f2703b24c0691b5278999c59ac7e64010000000062000441810204565b1115620006475760028054600160a060020a03191673b7a07bcf2ba2f2703b24c0691b5278999c59ac7e17905560408051808201909152600981527f6574685f6b6f76616e0000000000000000000000000000000000000000000000602082015262000500906401000000006200080d810204565b60006200067173146500cfd35b22e4a392fe0adc06de1a1368ed4864010000000062000441810204565b1115620006e65760028054600160a060020a03191673146500cfd35b22e4a392fe0adc06de1a1368ed4817905560408051808201909152600b81527f6574685f72696e6b656279000000000000000000000000000000000000000000602082015262000500906401000000006200080d810204565b600062000710736f485c8bf6fc43ea212e93bbf8ce046c7f1cb47564010000000062000441810204565b111562000746575060028054600160a060020a031916736f485c8bf6fc43ea212e93bbf8ce046c7f1cb47517905560016200080a565b6000620007707320e12a1f859b3feae5fb2a0a32c18f5a65555bbf64010000000062000441810204565b1115620007a6575060028054600160a060020a0319167320e12a1f859b3feae5fb2a0a32c18f5a65555bbf17905560016200080a565b6000620007d07351efaf4c8b3c9afbd5ab9f4bbc82784ab6ef8faa64010000000062000441810204565b111562000806575060028054600160a060020a0319167351efaf4c8b3c9afbd5ab9f4bbc82784ab6ef8faa17905560016200080a565b5060005b90565b80516200082290600490602084019062000826565b5050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106200086957805160ff191683800117855562000899565b8280016001018555821562000899579182015b82811115620008995782518255916020019190600101906200087c565b50620008a7929150620008bc565b5090565b60405161044680620037ea83390190565b6200080a91905b80821115620008a75760008155600101620008c3565b612f0180620008e96000396000f30060806040526004361061017c5763ffffffff60e060020a600035041663047fc9aa81146101b857806305121bd3146101e457806309c922e61461020b5780630acb4c281461022557806318f889c21461022d5780632263180d1461024557806327dc297e1461025a57806333ec3337146102b857806334ea0395146102cd57806338bbfa50146102e25780634042b66f1461037e578063521eb273146103935780636103d70b146103c457806361150aae146103d9578063686f998c146103ee5780636ace354c146104035780636ff8a27e1461048d578063715018a6146104af5780637b94ffb5146104c45780637e029bde146104f957806386f23a3514610511578063893da6c91461053a5780638da5cb5b1461054f5780638da7878c14610564578063a46d8c0e14610579578063ac0660731461058e578063d4bc0942146105a3578063d5abeb01146105b8578063d7de9c6e146105cd578063e2982c21146105ed578063e59d49121461060e578063f2fde38b14610626575b6040805133815234602082015281517fd6717f327e0cb88b4a97a7f67a453e9258252c34937ccbdd86de7cb840e7def3929181900390910190a1005b3480156101c457600080fd5b506101cd610647565b6040805161ffff9092168252519081900360200190f35b3480156101f057600080fd5b506101f9610656565b60408051918252519081900360200190f35b34801561021757600080fd5b5061022360043561065c565b005b61022361072b565b34801561023957600080fd5b50610223600435610761565b34801561025157600080fd5b506101f9610839565b34801561026657600080fd5b5060408051602060046024803582810135601f810185900485028601850190965285855261022395833595369560449491939091019190819084018382808284375094975061083f9650505050505050565b3480156102c457600080fd5b506101f96108b6565b3480156102d957600080fd5b506101f96108bc565b3480156102ee57600080fd5b5060408051602060046024803582810135601f810185900485028601850190965285855261022395833595369560449491939091019190819084018382808284375050604080516020601f89358b018035918201839004830284018301909452808352979a9998810197919650918201945092508291508401838280828437509497506108c29650505050505050565b34801561038a57600080fd5b506101f96108c7565b34801561039f57600080fd5b506103a86108cd565b60408051600160a060020a039092168252519081900360200190f35b3480156103d057600080fd5b506102236108dc565b3480156103e557600080fd5b506101f961095e565b3480156103fa57600080fd5b506103a8610964565b34801561040f57600080fd5b50610418610973565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561045257818101518382015260200161043a565b50505050905090810190601f16801561047f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610223600160a060020a0360043581169061ffff602435169060443516610a01565b3480156104bb57600080fd5b50610223611016565b3480156104d057600080fd5b5061022360048035600160a060020a0316906024803561ffff1691604435918201910135611075565b34801561050557600080fd5b506102236004356113a8565b34801561051d57600080fd5b50610526611452565b604080519115158252519081900360200190f35b34801561054657600080fd5b50610526611462565b34801561055b57600080fd5b506103a861146b565b34801561057057600080fd5b506101f961147a565b34801561058557600080fd5b506101f9611480565b34801561059a57600080fd5b506101f9611486565b3480156105af57600080fd5b5061022361148c565b3480156105c457600080fd5b506101cd611522565b3480156105d957600080fd5b506102236004803560248101910135611528565b3480156105f957600080fd5b506101f9600160a060020a03600435166115a0565b34801561061a57600080fd5b5061022360043561163d565b34801561063257600080fd5b50610223600160a060020a03600435166116e7565b600d54610100900461ffff1681565b60105481565b600054600160a060020a0316331461067357600080fd5b600081116106f0576040805160e560020a62461bcd028152602060048201526024808201527f476173206c696d6974206d757374206265206120706f736974697665206e756d60448201527f6265722e00000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b60108190556040805182815290517f14a13d743714da6bcc185b116304898863fca12cc836c2c861f35467f0fe18219181900360200190a150565b600054600160a060020a0316331461074257600080fd5b600d805463ff0000001916630100000017905561075f6000611707565b565b600054600160a060020a0316331461077857600080fd5b600081116107f5576040805160e560020a62461bcd028152602060048201526024808201527f476173207072696365206d757374206265206120706f736974697665206e756d60448201527f6265722e00000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b6107fe81611925565b600f8190556040805182815290517fed0a769fe42e24510f9a2d734369394443a31ab746c848c7b8534851b4fc17609181900360200190a150565b60095481565b610847611af9565b600160a060020a0316331461085b57600080fd5b60135460145561086c816002611cef565b60138190554260115560408051918252517ff382320ca3328eca73b923efa9b8df7bd6ea405d6d4fa855a00db3ee406361c99181900360200190a16108b2600e54611707565b5050565b60115481565b600f5481565b505050565b600c5481565b600b54600160a060020a031681565b600154604080517f51cff8d9000000000000000000000000000000000000000000000000000000008152336004820181905291519192600160a060020a0316916351cff8d99160248082019260009290919082900301818387803b15801561094357600080fd5b505af1158015610957573d6000803e3d6000fd5b5050505050565b60135481565b600754600160a060020a031681565b6012805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156109f95780601f106109ce576101008083540402835291602001916109f9565b820191906000526020600020905b8154815290600101906020018083116109dc57829003601f168201915b505050505081565b600080808080600160a060020a0388161515610a67576040805160e560020a62461bcd02815260206004820152601460248201527f496e76616c69642062656e65666963696172792e000000000000000000000000604482015290519081900360640190fd5b600061ffff881611610ae9576040805160e560020a62461bcd02815260206004820152602860248201527f546f6b656e20616d6f756e742062757374206265206120706f7369746976652060448201527f696e74656765722e000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b610af1611ea9565b1515610b6d576040805160e560020a62461bcd02815260206004820152602760248201527f456974686572206e6f206163746976652073616c65206f72207a65726f20455460448201527f482073656e742e00000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b87600160a060020a031686600160a060020a031614158015610b985750600160a060020a0386163314155b1515610c14576040805160e560020a62461bcd02815260206004820152602f60248201527f526563727569746572206d757374206e6f74206265207075726368617365722060448201527f6f722062656e65666963696172792e0000000000000000000000000000000000606482015290519081900360840190fd5b601354600010610c2057fe5b601354610c3e9069021e19e0c9bab24000009063ffffffff611ef416565b9450610c5461ffff88168663ffffffff611f0b16565b935034841115610caf5760786011544203111515610caf57601454600010610c7857fe5b601454610c969069021e19e0c9bab24000009063ffffffff611ef416565b9450610cac61ffff88168663ffffffff611f0b16565b93505b34841115610d07576040805160e560020a62461bcd02815260206004820152601460248201527f4e6f7420656e6f756768204554482073656e742e000000000000000000000000604482015290519081900360640190fd5b600d805461ffff61010080830482168b018216810262ffff00199093169290921792839055612710919092049091161115610d8c576040805160e560020a62461bcd02815260206004820152601c60248201527f4e6f7420656e6f75676820746f6b656e7320617661696c61626c652e00000000604482015290519081900360640190fd5b600160a060020a0386161515610dcd57600c54610daf903463ffffffff611f3416565b600c55600b54610dc890600160a060020a031634611f41565b610e80565b610dde34600a63ffffffff611ef416565b9250610df0348463ffffffff611fc816565b600c54909250610e06908363ffffffff611f3416565b600c55600b54610e1f90600160a060020a031683611f41565b610e298684611f41565b604080513481526020810185905261ffff8916818301529051600160a060020a0380891692908b169133917f84b0d742efb91a8602bc82aa6fbbdb336613b533fd40f980a0a1d942075e72af919081900360600190a45b426009541015610e91576000610e94565b60015b600754604080517fd1a1beb4000000000000000000000000000000000000000000000000000000008152600160a060020a038c8116600483015261ffff8c1660248301528415156044830152915193945091169163d1a1beb49160648082019260009290919082900301818387803b158015610f0f57600080fd5b505af1158015610f23573d6000803e3d6000fd5b50506040805134815261ffff8b1660208201528151600160a060020a038d1694503393507f5008303500a3c0505c2352bb3eaaf7174c7014ae890cd04c6a2d67f75e5624a5929181900390910190a3600d54610100900461ffff16612710141561100c57600d805460ff19166001179055600754604080517f7d64bcb40000000000000000000000000000000000000000000000000000000081529051600160a060020a0390921691637d64bcb49160048082019260009290919082900301818387803b158015610ff357600080fd5b505af1158015611007573d6000803e3d6000fd5b505050505b5050505050505050565b600054600160a060020a0316331461102d57600080fd5b60008054604051600160a060020a03909116917ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482091a260008054600160a060020a0319169055565b60008054600160a060020a0316331461108d57600080fd5b600160a060020a03851615156110ed576040805160e560020a62461bcd02815260206004820152601460248201527f496e76616c69642062656e65666963696172792e000000000000000000000000604482015290519081900360640190fd5b600061ffff85161161116f576040805160e560020a62461bcd02815260206004820152602860248201527f546f6b656e20616d6f756e742062757374206265206120706f7369746976652060448201527f696e74656765722e000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b600d805461ffff610100808304821688018216810262ffff001990931692909217928390556127109190920490911611156111f4576040805160e560020a62461bcd02815260206004820152601c60248201527f4e6f7420656e6f75676820746f6b656e7320617661696c61626c652e00000000604482015290519081900360640190fd5b426009541015611205576000611208565b60015b600754604080517fd1a1beb4000000000000000000000000000000000000000000000000000000008152600160a060020a03898116600483015261ffff891660248301528415156044830152915193945091169163d1a1beb49160648082019260009290919082900301818387803b15801561128357600080fd5b505af1158015611297573d6000803e3d6000fd5b5050600d54610100900461ffff1661271014159150611337905057600d805460ff19166001179055600754604080517f7d64bcb40000000000000000000000000000000000000000000000000000000081529051600160a060020a0390921691637d64bcb49160048082019260009290919082900301818387803b15801561131e57600080fd5b505af1158015611332573d6000803e3d6000fd5b505050505b84600160a060020a03167fe1d703f6919ec30272fc0c2872b4eda4cd8951cd37fb78a371074dde9eb2716d858585604051808461ffff1661ffff1681526020018060200182810382528484828181526020019250808284376040519201829003965090945050505050a25050505050565b600054600160a060020a031633146113bf57600080fd5b60008111611417576040805160e560020a62461bcd02815260206004820152601260248201527f455448555344206d757374206265203e20300000000000000000000000000000604482015290519081900360640190fd5b60138190556040805182815290517f67a34903a3a1a5180c0a698c76518696ac3ce01a401b1fbc232f658d34668a699181900360200190a150565b600d546301000000900460ff1681565b600d5460ff1681565b600054600160a060020a031681565b600a5481565b600e5481565b60085481565b600054600160a060020a031633146114a357600080fd5b600d805463ff00000019169055604080513031815290517f90ca46d6ed29ace867de12658061a05b159e2858ff1e3cd90e5b74b8e25a8db29181900360200190a160008054604051600160a060020a0390911691303180156108fc02929091818181858888f1935050505015801561151f573d6000803e3d6000fd5b50565b61271081565b600054600160a060020a0316331461153f57600080fd5b61154b60128383612dcf565b507f7e2a98122445acbfeb24e15229bccfe808bf695a8521ba40c1379bd19070953e82826040518080602001828103825284848281815260200192508082843760405192018290039550909350505050a15050565b600154604080517fe3a9db1a000000000000000000000000000000000000000000000000000000008152600160a060020a0384811660048301529151600093929092169163e3a9db1a9160248082019260209290919082900301818787803b15801561160b57600080fd5b505af115801561161f573d6000803e3d6000fd5b505050506040513d602081101561163557600080fd5b505192915050565b600054600160a060020a0316331461165457600080fd5b600081116116ac576040805160e560020a62461bcd02815260206004820152601460248201527f496e74657276616c206d757374206265203e2030000000000000000000000000604482015290519081900360640190fd5b600e8190556040805182815290517f8414899d1463bf96631193383ccbc65245950b354296f9dd096e8a15e131e8be9181900360200190a150565b600054600160a060020a031633146116fe57600080fd5b61151f81611fda565b600d546301000000900460ff1680156117235750600d5460ff16155b1561151f5760408051808201909152600381527f55524c000000000000000000000000000000000000000000000000000000000060208201523031906117689061204a565b111561178057600d805463ff0000001916905561151f565b80151561185757604080518082018252600381527f55524c0000000000000000000000000000000000000000000000000000000000602080830191909152601280548451601f6002600019610100600186161502019093169290920491820184900484028101840190955280855261185194928301828280156118445780601f1061181957610100808354040283529160200191611844565b820191906000526020600020905b81548152906001019060200180831161182757829003601f168201915b5050505050601054612280565b5061151f565b604080518082018252600381527f55524c000000000000000000000000000000000000000000000000000000000060208083019190915260128054845160026001831615610100026000190190921691909104601f81018490048402820184019095528481526108b2948694939192918301828280156119185780601f106118ed57610100808354040283529160200191611918565b820191906000526020600020905b8154815290600101906020018083116118fb57829003601f168201915b5050505050601054612685565b600254600160a060020a0316158061194f575060025461194d90600160a060020a0316612a8b565b155b156119605761195e6000612a8f565b505b600260009054906101000a9004600160a060020a0316600160a060020a03166338cc48316040518163ffffffff1660e060020a028152600401602060405180830381600087803b1580156119b357600080fd5b505af11580156119c7573d6000803e3d6000fd5b505050506040513d60208110156119dd57600080fd5b5051600354600160a060020a03908116911614611a9357600260009054906101000a9004600160a060020a0316600160a060020a03166338cc48316040518163ffffffff1660e060020a028152600401602060405180830381600087803b158015611a4757600080fd5b505af1158015611a5b573d6000803e3d6000fd5b505050506040513d6020811015611a7157600080fd5b505160038054600160a060020a031916600160a060020a039092169190911790555b600354604080517fca6ad1e4000000000000000000000000000000000000000000000000000000008152600481018490529051600160a060020a039092169163ca6ad1e49160248082019260009290919082900301818387803b15801561094357600080fd5b600254600090600160a060020a03161580611b265750600254611b2490600160a060020a0316612a8b565b155b15611b3757611b356000612a8f565b505b600260009054906101000a9004600160a060020a0316600160a060020a03166338cc48316040518163ffffffff1660e060020a028152600401602060405180830381600087803b158015611b8a57600080fd5b505af1158015611b9e573d6000803e3d6000fd5b505050506040513d6020811015611bb457600080fd5b5051600354600160a060020a03908116911614611c6a57600260009054906101000a9004600160a060020a0316600160a060020a03166338cc48316040518163ffffffff1660e060020a028152600401602060405180830381600087803b158015611c1e57600080fd5b505af1158015611c32573d6000803e3d6000fd5b505050506040513d6020811015611c4857600080fd5b505160038054600160a060020a031916600160a060020a039092169190911790555b600360009054906101000a9004600160a060020a0316600160a060020a031663c281d19e6040518163ffffffff1660e060020a028152600401602060405180830381600087803b158015611cbd57600080fd5b505af1158015611cd1573d6000803e3d6000fd5b505050506040513d6020811015611ce757600080fd5b505190505b90565b6000828180805b8351811015611e8c5783517f300000000000000000000000000000000000000000000000000000000000000090859083908110611d2f57fe5b90602001015160f860020a900460f860020a027effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191610158015611dd5575083517f390000000000000000000000000000000000000000000000000000000000000090859083908110611d9d57fe5b90602001015160f860020a900460f860020a027effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191611155b15611e2e578115611df457851515611dec57611e8c565b600019909501945b600a8302925060308482815181101515611e0a57fe5b90602001015160f860020a900460f860020a0260f860020a90040383019250611e84565b8381815181101515611e3c57fe5b90602001015160f860020a900460f860020a027effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916602e60f860020a021415611e8457600191505b600101611cf6565b6000861115611e9e5785600a0a830292505b509095945050505050565b6000806000600a5442101580611ecd57506008544210158015611ecd575060095442105b91505060003411818015611ede5750805b8015611eed5750600d5460ff16155b9250505090565b60008183811515611f0157fe5b0490505b92915050565b6000821515611f1c57506000611f05565b50818102818382811515611f2c57fe5b0414611f0557fe5b81810182811015611f0557fe5b600154604080517ff340fa01000000000000000000000000000000000000000000000000000000008152600160a060020a0385811660048301529151919092169163f340fa0191849160248082019260009290919082900301818588803b158015611fab57600080fd5b505af1158015611fbf573d6000803e3d6000fd5b50505050505050565b600082821115611fd457fe5b50900390565b600160a060020a0381161515611fef57600080fd5b60008054604051600160a060020a03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a360008054600160a060020a031916600160a060020a0392909216919091179055565b600254600090600160a060020a03161580612077575060025461207590600160a060020a0316612a8b565b155b15612088576120866000612a8f565b505b600260009054906101000a9004600160a060020a0316600160a060020a03166338cc48316040518163ffffffff1660e060020a028152600401602060405180830381600087803b1580156120db57600080fd5b505af11580156120ef573d6000803e3d6000fd5b505050506040513d602081101561210557600080fd5b5051600354600160a060020a039081169116146121bb57600260009054906101000a9004600160a060020a0316600160a060020a03166338cc48316040518163ffffffff1660e060020a028152600401602060405180830381600087803b15801561216f57600080fd5b505af1158015612183573d6000803e3d6000fd5b505050506040513d602081101561219957600080fd5b505160038054600160a060020a031916600160a060020a039092169190911790555b6003546040517f524f3889000000000000000000000000000000000000000000000000000000008152602060048201818152855160248401528551600160a060020a039094169363524f388993879383926044909201919085019080838360005b8381101561223457818101518382015260200161221c565b50505050905090810190601f1680156122615780820380516001836020036101000a031916815260200191505b5092505050602060405180830381600087803b15801561160b57600080fd5b6002546000908190600160a060020a031615806122af57506002546122ad90600160a060020a0316612a8b565b155b156122c0576122be6000612a8f565b505b600260009054906101000a9004600160a060020a0316600160a060020a03166338cc48316040518163ffffffff1660e060020a028152600401602060405180830381600087803b15801561231357600080fd5b505af1158015612327573d6000803e3d6000fd5b505050506040513d602081101561233d57600080fd5b5051600354600160a060020a039081169116146123f357600260009054906101000a9004600160a060020a0316600160a060020a03166338cc48316040518163ffffffff1660e060020a028152600401602060405180830381600087803b1580156123a757600080fd5b505af11580156123bb573d6000803e3d6000fd5b505050506040513d60208110156123d157600080fd5b505160038054600160a060020a031916600160a060020a039092169190911790555b600354604080517f2ef3accc0000000000000000000000000000000000000000000000000000000081526024810186905260048101918252875160448201528751600160a060020a0390931692632ef3accc9289928892829160640190602086019080838360005b8381101561247357818101518382015260200161245b565b50505050905090810190601f1680156124a05780820380516001836020036101000a031916815260200191505b509350505050602060405180830381600087803b1580156124c057600080fd5b505af11580156124d4573d6000803e3d6000fd5b505050506040513d60208110156124ea57600080fd5b50519050670de0b6b3a76400003a84020181111561250b576000915061267d565b6003546040517fc51be90f00000000000000000000000000000000000000000000000000000000815260006004820181815260648301879052608060248401908152895160848501528951600160a060020a039095169463c51be90f948794938c938c938c93604481019160a49091019060208801908083838c5b8381101561259e578181015183820152602001612586565b50505050905090810190601f1680156125cb5780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b838110156125fe5781810151838201526020016125e6565b50505050905090810190601f16801561262b5780820380516001836020036101000a031916815260200191505b5096505050505050506020604051808303818588803b15801561264d57600080fd5b505af1158015612661573d6000803e3d6000fd5b50505050506040513d602081101561267857600080fd5b505191505b509392505050565b6002546000908190600160a060020a031615806126b457506002546126b290600160a060020a0316612a8b565b155b156126c5576126c36000612a8f565b505b600260009054906101000a9004600160a060020a0316600160a060020a03166338cc48316040518163ffffffff1660e060020a028152600401602060405180830381600087803b15801561271857600080fd5b505af115801561272c573d6000803e3d6000fd5b505050506040513d602081101561274257600080fd5b5051600354600160a060020a039081169116146127f857600260009054906101000a9004600160a060020a0316600160a060020a03166338cc48316040518163ffffffff1660e060020a028152600401602060405180830381600087803b1580156127ac57600080fd5b505af11580156127c0573d6000803e3d6000fd5b505050506040513d60208110156127d657600080fd5b505160038054600160a060020a031916600160a060020a039092169190911790555b600354604080517f2ef3accc0000000000000000000000000000000000000000000000000000000081526024810186905260048101918252875160448201528751600160a060020a0390931692632ef3accc9289928892829160640190602086019080838360005b83811015612878578181015183820152602001612860565b50505050905090810190601f1680156128a55780820380516001836020036101000a031916815260200191505b509350505050602060405180830381600087803b1580156128c557600080fd5b505af11580156128d9573d6000803e3d6000fd5b505050506040513d60208110156128ef57600080fd5b50519050670de0b6b3a76400003a8402018111156129105760009150612a82565b6003546040517fc51be90f0000000000000000000000000000000000000000000000000000000081526004810188815260648201869052608060248301908152885160848401528851600160a060020a039094169363c51be90f9386938c938c938c938c939291604482019160a40190602088019080838360005b838110156129a357818101518382015260200161298b565b50505050905090810190601f1680156129d05780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b83811015612a035781810151838201526020016129eb565b50505050905090810190601f168015612a305780820380516001836020036101000a031916815260200191505b5096505050505050506020604051808303818588803b158015612a5257600080fd5b505af1158015612a66573d6000803e3d6000fd5b50505050506040513d6020811015612a7d57600080fd5b505191505b50949350505050565b3b90565b6000611f05600080612ab4731d3b2638a7cc9f2cb3d298a3da7a90b67e5506ed612a8b565b1115612b255760028054600160a060020a031916731d3b2638a7cc9f2cb3d298a3da7a90b67e5506ed17905560408051808201909152600b81527f6574685f6d61696e6e65740000000000000000000000000000000000000000006020820152612b1d90612dbc565b506001611cec565b6000612b4473c03a2615d5efaf5f49f60b7bb6583eaec212fdf1612a8b565b1115612bad5760028054600160a060020a03191673c03a2615d5efaf5f49f60b7bb6583eaec212fdf117905560408051808201909152600c81527f6574685f726f707374656e3300000000000000000000000000000000000000006020820152612b1d90612dbc565b6000612bcc73b7a07bcf2ba2f2703b24c0691b5278999c59ac7e612a8b565b1115612c355760028054600160a060020a03191673b7a07bcf2ba2f2703b24c0691b5278999c59ac7e17905560408051808201909152600981527f6574685f6b6f76616e00000000000000000000000000000000000000000000006020820152612b1d90612dbc565b6000612c5473146500cfd35b22e4a392fe0adc06de1a1368ed48612a8b565b1115612cbd5760028054600160a060020a03191673146500cfd35b22e4a392fe0adc06de1a1368ed4817905560408051808201909152600b81527f6574685f72696e6b6562790000000000000000000000000000000000000000006020820152612b1d90612dbc565b6000612cdc736f485c8bf6fc43ea212e93bbf8ce046c7f1cb475612a8b565b1115612d10575060028054600160a060020a031916736f485c8bf6fc43ea212e93bbf8ce046c7f1cb4751790556001611cec565b6000612d2f7320e12a1f859b3feae5fb2a0a32c18f5a65555bbf612a8b565b1115612d63575060028054600160a060020a0319167320e12a1f859b3feae5fb2a0a32c18f5a65555bbf1790556001611cec565b6000612d827351efaf4c8b3c9afbd5ab9f4bbc82784ab6ef8faa612a8b565b1115612db6575060028054600160a060020a0319167351efaf4c8b3c9afbd5ab9f4bbc82784ab6ef8faa1790556001611cec565b50600090565b80516108b2906004906020840190612e4d565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10612e105782800160ff19823516178555612e3d565b82800160010185558215612e3d579182015b82811115612e3d578235825591602001919060010190612e22565b50612e49929150612ebb565b5090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10612e8e57805160ff1916838001178555612e3d565b82800160010185558215612e3d579182015b82811115612e3d578251825591602001919060010190612ea0565b611cec91905b80821115612e495760008155600101612ec15600a165627a7a723058205555e298d74f08bdaf2ca23d7f48b0288f08567b0cd4ca724d515ae4e32ba27b0029608060405260008054600160a060020a03191633179055610421806100256000396000f3006080604052600436106100775763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166351cff8d9811461007c578063715018a61461009f5780638da5cb5b146100b4578063e3a9db1a146100e5578063f2fde38b14610118578063f340fa0114610139575b600080fd5b34801561008857600080fd5b5061009d600160a060020a036004351661014d565b005b3480156100ab57600080fd5b5061009d610212565b3480156100c057600080fd5b506100c961027e565b60408051600160a060020a039092168252519081900360200190f35b3480156100f157600080fd5b50610106600160a060020a036004351661028d565b60408051918252519081900360200190f35b34801561012457600080fd5b5061009d600160a060020a03600435166102a8565b61009d600160a060020a03600435166102cb565b60008054600160a060020a0316331461016557600080fd5b50600160a060020a038116600090815260016020526040902054303181111561018a57fe5b600160a060020a0382166000818152600160205260408082208290555183156108fc0291849190818181858888f193505050501580156101ce573d6000803e3d6000fd5b50604080518281529051600160a060020a038416917f7084f5476618d8e60b11ef0d7d3f06914655adb8793e28ff7f018d4c76d505d5919081900360200190a25050565b600054600160a060020a0316331461022957600080fd5b60008054604051600160a060020a03909116917ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482091a26000805473ffffffffffffffffffffffffffffffffffffffff19169055565b600054600160a060020a031681565b600160a060020a031660009081526001602052604090205490565b600054600160a060020a031633146102bf57600080fd5b6102c881610365565b50565b60008054600160a060020a031633146102e357600080fd5b50600160a060020a038116600090815260016020526040902054349061030f908263ffffffff6103e216565b600160a060020a038316600081815260016020908152604091829020939093558051848152905191927f2da466a7b24304f47e87fa2e1e5a81b9831ce54fec19055ce277ca2f39ba42c492918290030190a25050565b600160a060020a038116151561037a57600080fd5b60008054604051600160a060020a03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b818101828110156103ef57fe5b929150505600a165627a7a72305820bafedb90d4f5fb321712e0c6f004ef0a1b13a8d72a0f9656c40435ea5a57effd0029000000000000000000000000000000000000000000000000000000005bbe9280000000000000000000000000000000000000000000000000000000005bc7ccff000000000000000000000000000000000000000000000000000000005bc7cd000000000000000000000000004eebb592fb011f470ae45894f5eaa28248fef8750000000000000000000000000000000000000000000000000000000000004e200000000000000000000000000000000000000000000000000000000000005460000000000000000000000000ac4fd2d9ce342bc6fdc7e0ce539f365e4ec1fe4a
Deployed Bytecode
0x60806040526004361061017c5763ffffffff60e060020a600035041663047fc9aa81146101b857806305121bd3146101e457806309c922e61461020b5780630acb4c281461022557806318f889c21461022d5780632263180d1461024557806327dc297e1461025a57806333ec3337146102b857806334ea0395146102cd57806338bbfa50146102e25780634042b66f1461037e578063521eb273146103935780636103d70b146103c457806361150aae146103d9578063686f998c146103ee5780636ace354c146104035780636ff8a27e1461048d578063715018a6146104af5780637b94ffb5146104c45780637e029bde146104f957806386f23a3514610511578063893da6c91461053a5780638da5cb5b1461054f5780638da7878c14610564578063a46d8c0e14610579578063ac0660731461058e578063d4bc0942146105a3578063d5abeb01146105b8578063d7de9c6e146105cd578063e2982c21146105ed578063e59d49121461060e578063f2fde38b14610626575b6040805133815234602082015281517fd6717f327e0cb88b4a97a7f67a453e9258252c34937ccbdd86de7cb840e7def3929181900390910190a1005b3480156101c457600080fd5b506101cd610647565b6040805161ffff9092168252519081900360200190f35b3480156101f057600080fd5b506101f9610656565b60408051918252519081900360200190f35b34801561021757600080fd5b5061022360043561065c565b005b61022361072b565b34801561023957600080fd5b50610223600435610761565b34801561025157600080fd5b506101f9610839565b34801561026657600080fd5b5060408051602060046024803582810135601f810185900485028601850190965285855261022395833595369560449491939091019190819084018382808284375094975061083f9650505050505050565b3480156102c457600080fd5b506101f96108b6565b3480156102d957600080fd5b506101f96108bc565b3480156102ee57600080fd5b5060408051602060046024803582810135601f810185900485028601850190965285855261022395833595369560449491939091019190819084018382808284375050604080516020601f89358b018035918201839004830284018301909452808352979a9998810197919650918201945092508291508401838280828437509497506108c29650505050505050565b34801561038a57600080fd5b506101f96108c7565b34801561039f57600080fd5b506103a86108cd565b60408051600160a060020a039092168252519081900360200190f35b3480156103d057600080fd5b506102236108dc565b3480156103e557600080fd5b506101f961095e565b3480156103fa57600080fd5b506103a8610964565b34801561040f57600080fd5b50610418610973565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561045257818101518382015260200161043a565b50505050905090810190601f16801561047f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610223600160a060020a0360043581169061ffff602435169060443516610a01565b3480156104bb57600080fd5b50610223611016565b3480156104d057600080fd5b5061022360048035600160a060020a0316906024803561ffff1691604435918201910135611075565b34801561050557600080fd5b506102236004356113a8565b34801561051d57600080fd5b50610526611452565b604080519115158252519081900360200190f35b34801561054657600080fd5b50610526611462565b34801561055b57600080fd5b506103a861146b565b34801561057057600080fd5b506101f961147a565b34801561058557600080fd5b506101f9611480565b34801561059a57600080fd5b506101f9611486565b3480156105af57600080fd5b5061022361148c565b3480156105c457600080fd5b506101cd611522565b3480156105d957600080fd5b506102236004803560248101910135611528565b3480156105f957600080fd5b506101f9600160a060020a03600435166115a0565b34801561061a57600080fd5b5061022360043561163d565b34801561063257600080fd5b50610223600160a060020a03600435166116e7565b600d54610100900461ffff1681565b60105481565b600054600160a060020a0316331461067357600080fd5b600081116106f0576040805160e560020a62461bcd028152602060048201526024808201527f476173206c696d6974206d757374206265206120706f736974697665206e756d60448201527f6265722e00000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b60108190556040805182815290517f14a13d743714da6bcc185b116304898863fca12cc836c2c861f35467f0fe18219181900360200190a150565b600054600160a060020a0316331461074257600080fd5b600d805463ff0000001916630100000017905561075f6000611707565b565b600054600160a060020a0316331461077857600080fd5b600081116107f5576040805160e560020a62461bcd028152602060048201526024808201527f476173207072696365206d757374206265206120706f736974697665206e756d60448201527f6265722e00000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b6107fe81611925565b600f8190556040805182815290517fed0a769fe42e24510f9a2d734369394443a31ab746c848c7b8534851b4fc17609181900360200190a150565b60095481565b610847611af9565b600160a060020a0316331461085b57600080fd5b60135460145561086c816002611cef565b60138190554260115560408051918252517ff382320ca3328eca73b923efa9b8df7bd6ea405d6d4fa855a00db3ee406361c99181900360200190a16108b2600e54611707565b5050565b60115481565b600f5481565b505050565b600c5481565b600b54600160a060020a031681565b600154604080517f51cff8d9000000000000000000000000000000000000000000000000000000008152336004820181905291519192600160a060020a0316916351cff8d99160248082019260009290919082900301818387803b15801561094357600080fd5b505af1158015610957573d6000803e3d6000fd5b5050505050565b60135481565b600754600160a060020a031681565b6012805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156109f95780601f106109ce576101008083540402835291602001916109f9565b820191906000526020600020905b8154815290600101906020018083116109dc57829003601f168201915b505050505081565b600080808080600160a060020a0388161515610a67576040805160e560020a62461bcd02815260206004820152601460248201527f496e76616c69642062656e65666963696172792e000000000000000000000000604482015290519081900360640190fd5b600061ffff881611610ae9576040805160e560020a62461bcd02815260206004820152602860248201527f546f6b656e20616d6f756e742062757374206265206120706f7369746976652060448201527f696e74656765722e000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b610af1611ea9565b1515610b6d576040805160e560020a62461bcd02815260206004820152602760248201527f456974686572206e6f206163746976652073616c65206f72207a65726f20455460448201527f482073656e742e00000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b87600160a060020a031686600160a060020a031614158015610b985750600160a060020a0386163314155b1515610c14576040805160e560020a62461bcd02815260206004820152602f60248201527f526563727569746572206d757374206e6f74206265207075726368617365722060448201527f6f722062656e65666963696172792e0000000000000000000000000000000000606482015290519081900360840190fd5b601354600010610c2057fe5b601354610c3e9069021e19e0c9bab24000009063ffffffff611ef416565b9450610c5461ffff88168663ffffffff611f0b16565b935034841115610caf5760786011544203111515610caf57601454600010610c7857fe5b601454610c969069021e19e0c9bab24000009063ffffffff611ef416565b9450610cac61ffff88168663ffffffff611f0b16565b93505b34841115610d07576040805160e560020a62461bcd02815260206004820152601460248201527f4e6f7420656e6f756768204554482073656e742e000000000000000000000000604482015290519081900360640190fd5b600d805461ffff61010080830482168b018216810262ffff00199093169290921792839055612710919092049091161115610d8c576040805160e560020a62461bcd02815260206004820152601c60248201527f4e6f7420656e6f75676820746f6b656e7320617661696c61626c652e00000000604482015290519081900360640190fd5b600160a060020a0386161515610dcd57600c54610daf903463ffffffff611f3416565b600c55600b54610dc890600160a060020a031634611f41565b610e80565b610dde34600a63ffffffff611ef416565b9250610df0348463ffffffff611fc816565b600c54909250610e06908363ffffffff611f3416565b600c55600b54610e1f90600160a060020a031683611f41565b610e298684611f41565b604080513481526020810185905261ffff8916818301529051600160a060020a0380891692908b169133917f84b0d742efb91a8602bc82aa6fbbdb336613b533fd40f980a0a1d942075e72af919081900360600190a45b426009541015610e91576000610e94565b60015b600754604080517fd1a1beb4000000000000000000000000000000000000000000000000000000008152600160a060020a038c8116600483015261ffff8c1660248301528415156044830152915193945091169163d1a1beb49160648082019260009290919082900301818387803b158015610f0f57600080fd5b505af1158015610f23573d6000803e3d6000fd5b50506040805134815261ffff8b1660208201528151600160a060020a038d1694503393507f5008303500a3c0505c2352bb3eaaf7174c7014ae890cd04c6a2d67f75e5624a5929181900390910190a3600d54610100900461ffff16612710141561100c57600d805460ff19166001179055600754604080517f7d64bcb40000000000000000000000000000000000000000000000000000000081529051600160a060020a0390921691637d64bcb49160048082019260009290919082900301818387803b158015610ff357600080fd5b505af1158015611007573d6000803e3d6000fd5b505050505b5050505050505050565b600054600160a060020a0316331461102d57600080fd5b60008054604051600160a060020a03909116917ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482091a260008054600160a060020a0319169055565b60008054600160a060020a0316331461108d57600080fd5b600160a060020a03851615156110ed576040805160e560020a62461bcd02815260206004820152601460248201527f496e76616c69642062656e65666963696172792e000000000000000000000000604482015290519081900360640190fd5b600061ffff85161161116f576040805160e560020a62461bcd02815260206004820152602860248201527f546f6b656e20616d6f756e742062757374206265206120706f7369746976652060448201527f696e74656765722e000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b600d805461ffff610100808304821688018216810262ffff001990931692909217928390556127109190920490911611156111f4576040805160e560020a62461bcd02815260206004820152601c60248201527f4e6f7420656e6f75676820746f6b656e7320617661696c61626c652e00000000604482015290519081900360640190fd5b426009541015611205576000611208565b60015b600754604080517fd1a1beb4000000000000000000000000000000000000000000000000000000008152600160a060020a03898116600483015261ffff891660248301528415156044830152915193945091169163d1a1beb49160648082019260009290919082900301818387803b15801561128357600080fd5b505af1158015611297573d6000803e3d6000fd5b5050600d54610100900461ffff1661271014159150611337905057600d805460ff19166001179055600754604080517f7d64bcb40000000000000000000000000000000000000000000000000000000081529051600160a060020a0390921691637d64bcb49160048082019260009290919082900301818387803b15801561131e57600080fd5b505af1158015611332573d6000803e3d6000fd5b505050505b84600160a060020a03167fe1d703f6919ec30272fc0c2872b4eda4cd8951cd37fb78a371074dde9eb2716d858585604051808461ffff1661ffff1681526020018060200182810382528484828181526020019250808284376040519201829003965090945050505050a25050505050565b600054600160a060020a031633146113bf57600080fd5b60008111611417576040805160e560020a62461bcd02815260206004820152601260248201527f455448555344206d757374206265203e20300000000000000000000000000000604482015290519081900360640190fd5b60138190556040805182815290517f67a34903a3a1a5180c0a698c76518696ac3ce01a401b1fbc232f658d34668a699181900360200190a150565b600d546301000000900460ff1681565b600d5460ff1681565b600054600160a060020a031681565b600a5481565b600e5481565b60085481565b600054600160a060020a031633146114a357600080fd5b600d805463ff00000019169055604080513031815290517f90ca46d6ed29ace867de12658061a05b159e2858ff1e3cd90e5b74b8e25a8db29181900360200190a160008054604051600160a060020a0390911691303180156108fc02929091818181858888f1935050505015801561151f573d6000803e3d6000fd5b50565b61271081565b600054600160a060020a0316331461153f57600080fd5b61154b60128383612dcf565b507f7e2a98122445acbfeb24e15229bccfe808bf695a8521ba40c1379bd19070953e82826040518080602001828103825284848281815260200192508082843760405192018290039550909350505050a15050565b600154604080517fe3a9db1a000000000000000000000000000000000000000000000000000000008152600160a060020a0384811660048301529151600093929092169163e3a9db1a9160248082019260209290919082900301818787803b15801561160b57600080fd5b505af115801561161f573d6000803e3d6000fd5b505050506040513d602081101561163557600080fd5b505192915050565b600054600160a060020a0316331461165457600080fd5b600081116116ac576040805160e560020a62461bcd02815260206004820152601460248201527f496e74657276616c206d757374206265203e2030000000000000000000000000604482015290519081900360640190fd5b600e8190556040805182815290517f8414899d1463bf96631193383ccbc65245950b354296f9dd096e8a15e131e8be9181900360200190a150565b600054600160a060020a031633146116fe57600080fd5b61151f81611fda565b600d546301000000900460ff1680156117235750600d5460ff16155b1561151f5760408051808201909152600381527f55524c000000000000000000000000000000000000000000000000000000000060208201523031906117689061204a565b111561178057600d805463ff0000001916905561151f565b80151561185757604080518082018252600381527f55524c0000000000000000000000000000000000000000000000000000000000602080830191909152601280548451601f6002600019610100600186161502019093169290920491820184900484028101840190955280855261185194928301828280156118445780601f1061181957610100808354040283529160200191611844565b820191906000526020600020905b81548152906001019060200180831161182757829003601f168201915b5050505050601054612280565b5061151f565b604080518082018252600381527f55524c000000000000000000000000000000000000000000000000000000000060208083019190915260128054845160026001831615610100026000190190921691909104601f81018490048402820184019095528481526108b2948694939192918301828280156119185780601f106118ed57610100808354040283529160200191611918565b820191906000526020600020905b8154815290600101906020018083116118fb57829003601f168201915b5050505050601054612685565b600254600160a060020a0316158061194f575060025461194d90600160a060020a0316612a8b565b155b156119605761195e6000612a8f565b505b600260009054906101000a9004600160a060020a0316600160a060020a03166338cc48316040518163ffffffff1660e060020a028152600401602060405180830381600087803b1580156119b357600080fd5b505af11580156119c7573d6000803e3d6000fd5b505050506040513d60208110156119dd57600080fd5b5051600354600160a060020a03908116911614611a9357600260009054906101000a9004600160a060020a0316600160a060020a03166338cc48316040518163ffffffff1660e060020a028152600401602060405180830381600087803b158015611a4757600080fd5b505af1158015611a5b573d6000803e3d6000fd5b505050506040513d6020811015611a7157600080fd5b505160038054600160a060020a031916600160a060020a039092169190911790555b600354604080517fca6ad1e4000000000000000000000000000000000000000000000000000000008152600481018490529051600160a060020a039092169163ca6ad1e49160248082019260009290919082900301818387803b15801561094357600080fd5b600254600090600160a060020a03161580611b265750600254611b2490600160a060020a0316612a8b565b155b15611b3757611b356000612a8f565b505b600260009054906101000a9004600160a060020a0316600160a060020a03166338cc48316040518163ffffffff1660e060020a028152600401602060405180830381600087803b158015611b8a57600080fd5b505af1158015611b9e573d6000803e3d6000fd5b505050506040513d6020811015611bb457600080fd5b5051600354600160a060020a03908116911614611c6a57600260009054906101000a9004600160a060020a0316600160a060020a03166338cc48316040518163ffffffff1660e060020a028152600401602060405180830381600087803b158015611c1e57600080fd5b505af1158015611c32573d6000803e3d6000fd5b505050506040513d6020811015611c4857600080fd5b505160038054600160a060020a031916600160a060020a039092169190911790555b600360009054906101000a9004600160a060020a0316600160a060020a031663c281d19e6040518163ffffffff1660e060020a028152600401602060405180830381600087803b158015611cbd57600080fd5b505af1158015611cd1573d6000803e3d6000fd5b505050506040513d6020811015611ce757600080fd5b505190505b90565b6000828180805b8351811015611e8c5783517f300000000000000000000000000000000000000000000000000000000000000090859083908110611d2f57fe5b90602001015160f860020a900460f860020a027effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191610158015611dd5575083517f390000000000000000000000000000000000000000000000000000000000000090859083908110611d9d57fe5b90602001015160f860020a900460f860020a027effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191611155b15611e2e578115611df457851515611dec57611e8c565b600019909501945b600a8302925060308482815181101515611e0a57fe5b90602001015160f860020a900460f860020a0260f860020a90040383019250611e84565b8381815181101515611e3c57fe5b90602001015160f860020a900460f860020a027effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916602e60f860020a021415611e8457600191505b600101611cf6565b6000861115611e9e5785600a0a830292505b509095945050505050565b6000806000600a5442101580611ecd57506008544210158015611ecd575060095442105b91505060003411818015611ede5750805b8015611eed5750600d5460ff16155b9250505090565b60008183811515611f0157fe5b0490505b92915050565b6000821515611f1c57506000611f05565b50818102818382811515611f2c57fe5b0414611f0557fe5b81810182811015611f0557fe5b600154604080517ff340fa01000000000000000000000000000000000000000000000000000000008152600160a060020a0385811660048301529151919092169163f340fa0191849160248082019260009290919082900301818588803b158015611fab57600080fd5b505af1158015611fbf573d6000803e3d6000fd5b50505050505050565b600082821115611fd457fe5b50900390565b600160a060020a0381161515611fef57600080fd5b60008054604051600160a060020a03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a360008054600160a060020a031916600160a060020a0392909216919091179055565b600254600090600160a060020a03161580612077575060025461207590600160a060020a0316612a8b565b155b15612088576120866000612a8f565b505b600260009054906101000a9004600160a060020a0316600160a060020a03166338cc48316040518163ffffffff1660e060020a028152600401602060405180830381600087803b1580156120db57600080fd5b505af11580156120ef573d6000803e3d6000fd5b505050506040513d602081101561210557600080fd5b5051600354600160a060020a039081169116146121bb57600260009054906101000a9004600160a060020a0316600160a060020a03166338cc48316040518163ffffffff1660e060020a028152600401602060405180830381600087803b15801561216f57600080fd5b505af1158015612183573d6000803e3d6000fd5b505050506040513d602081101561219957600080fd5b505160038054600160a060020a031916600160a060020a039092169190911790555b6003546040517f524f3889000000000000000000000000000000000000000000000000000000008152602060048201818152855160248401528551600160a060020a039094169363524f388993879383926044909201919085019080838360005b8381101561223457818101518382015260200161221c565b50505050905090810190601f1680156122615780820380516001836020036101000a031916815260200191505b5092505050602060405180830381600087803b15801561160b57600080fd5b6002546000908190600160a060020a031615806122af57506002546122ad90600160a060020a0316612a8b565b155b156122c0576122be6000612a8f565b505b600260009054906101000a9004600160a060020a0316600160a060020a03166338cc48316040518163ffffffff1660e060020a028152600401602060405180830381600087803b15801561231357600080fd5b505af1158015612327573d6000803e3d6000fd5b505050506040513d602081101561233d57600080fd5b5051600354600160a060020a039081169116146123f357600260009054906101000a9004600160a060020a0316600160a060020a03166338cc48316040518163ffffffff1660e060020a028152600401602060405180830381600087803b1580156123a757600080fd5b505af11580156123bb573d6000803e3d6000fd5b505050506040513d60208110156123d157600080fd5b505160038054600160a060020a031916600160a060020a039092169190911790555b600354604080517f2ef3accc0000000000000000000000000000000000000000000000000000000081526024810186905260048101918252875160448201528751600160a060020a0390931692632ef3accc9289928892829160640190602086019080838360005b8381101561247357818101518382015260200161245b565b50505050905090810190601f1680156124a05780820380516001836020036101000a031916815260200191505b509350505050602060405180830381600087803b1580156124c057600080fd5b505af11580156124d4573d6000803e3d6000fd5b505050506040513d60208110156124ea57600080fd5b50519050670de0b6b3a76400003a84020181111561250b576000915061267d565b6003546040517fc51be90f00000000000000000000000000000000000000000000000000000000815260006004820181815260648301879052608060248401908152895160848501528951600160a060020a039095169463c51be90f948794938c938c938c93604481019160a49091019060208801908083838c5b8381101561259e578181015183820152602001612586565b50505050905090810190601f1680156125cb5780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b838110156125fe5781810151838201526020016125e6565b50505050905090810190601f16801561262b5780820380516001836020036101000a031916815260200191505b5096505050505050506020604051808303818588803b15801561264d57600080fd5b505af1158015612661573d6000803e3d6000fd5b50505050506040513d602081101561267857600080fd5b505191505b509392505050565b6002546000908190600160a060020a031615806126b457506002546126b290600160a060020a0316612a8b565b155b156126c5576126c36000612a8f565b505b600260009054906101000a9004600160a060020a0316600160a060020a03166338cc48316040518163ffffffff1660e060020a028152600401602060405180830381600087803b15801561271857600080fd5b505af115801561272c573d6000803e3d6000fd5b505050506040513d602081101561274257600080fd5b5051600354600160a060020a039081169116146127f857600260009054906101000a9004600160a060020a0316600160a060020a03166338cc48316040518163ffffffff1660e060020a028152600401602060405180830381600087803b1580156127ac57600080fd5b505af11580156127c0573d6000803e3d6000fd5b505050506040513d60208110156127d657600080fd5b505160038054600160a060020a031916600160a060020a039092169190911790555b600354604080517f2ef3accc0000000000000000000000000000000000000000000000000000000081526024810186905260048101918252875160448201528751600160a060020a0390931692632ef3accc9289928892829160640190602086019080838360005b83811015612878578181015183820152602001612860565b50505050905090810190601f1680156128a55780820380516001836020036101000a031916815260200191505b509350505050602060405180830381600087803b1580156128c557600080fd5b505af11580156128d9573d6000803e3d6000fd5b505050506040513d60208110156128ef57600080fd5b50519050670de0b6b3a76400003a8402018111156129105760009150612a82565b6003546040517fc51be90f0000000000000000000000000000000000000000000000000000000081526004810188815260648201869052608060248301908152885160848401528851600160a060020a039094169363c51be90f9386938c938c938c938c939291604482019160a40190602088019080838360005b838110156129a357818101518382015260200161298b565b50505050905090810190601f1680156129d05780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b83811015612a035781810151838201526020016129eb565b50505050905090810190601f168015612a305780820380516001836020036101000a031916815260200191505b5096505050505050506020604051808303818588803b158015612a5257600080fd5b505af1158015612a66573d6000803e3d6000fd5b50505050506040513d6020811015612a7d57600080fd5b505191505b50949350505050565b3b90565b6000611f05600080612ab4731d3b2638a7cc9f2cb3d298a3da7a90b67e5506ed612a8b565b1115612b255760028054600160a060020a031916731d3b2638a7cc9f2cb3d298a3da7a90b67e5506ed17905560408051808201909152600b81527f6574685f6d61696e6e65740000000000000000000000000000000000000000006020820152612b1d90612dbc565b506001611cec565b6000612b4473c03a2615d5efaf5f49f60b7bb6583eaec212fdf1612a8b565b1115612bad5760028054600160a060020a03191673c03a2615d5efaf5f49f60b7bb6583eaec212fdf117905560408051808201909152600c81527f6574685f726f707374656e3300000000000000000000000000000000000000006020820152612b1d90612dbc565b6000612bcc73b7a07bcf2ba2f2703b24c0691b5278999c59ac7e612a8b565b1115612c355760028054600160a060020a03191673b7a07bcf2ba2f2703b24c0691b5278999c59ac7e17905560408051808201909152600981527f6574685f6b6f76616e00000000000000000000000000000000000000000000006020820152612b1d90612dbc565b6000612c5473146500cfd35b22e4a392fe0adc06de1a1368ed48612a8b565b1115612cbd5760028054600160a060020a03191673146500cfd35b22e4a392fe0adc06de1a1368ed4817905560408051808201909152600b81527f6574685f72696e6b6562790000000000000000000000000000000000000000006020820152612b1d90612dbc565b6000612cdc736f485c8bf6fc43ea212e93bbf8ce046c7f1cb475612a8b565b1115612d10575060028054600160a060020a031916736f485c8bf6fc43ea212e93bbf8ce046c7f1cb4751790556001611cec565b6000612d2f7320e12a1f859b3feae5fb2a0a32c18f5a65555bbf612a8b565b1115612d63575060028054600160a060020a0319167320e12a1f859b3feae5fb2a0a32c18f5a65555bbf1790556001611cec565b6000612d827351efaf4c8b3c9afbd5ab9f4bbc82784ab6ef8faa612a8b565b1115612db6575060028054600160a060020a0319167351efaf4c8b3c9afbd5ab9f4bbc82784ab6ef8faa1790556001611cec565b50600090565b80516108b2906004906020840190612e4d565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10612e105782800160ff19823516178555612e3d565b82800160010185558215612e3d579182015b82811115612e3d578235825591602001919060010190612e22565b50612e49929150612ebb565b5090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10612e8e57805160ff1916838001178555612e3d565b82800160010185558215612e3d579182015b82811115612e3d578251825591602001919060010190612ea0565b611cec91905b80821115612e495760008155600101612ec15600a165627a7a723058205555e298d74f08bdaf2ca23d7f48b0288f08567b0cd4ca724d515ae4e32ba27b0029
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000000000000000000000000000000000005bbe9280000000000000000000000000000000000000000000000000000000005bc7ccff000000000000000000000000000000000000000000000000000000005bc7cd000000000000000000000000004eebb592fb011f470ae45894f5eaa28248fef8750000000000000000000000000000000000000000000000000000000000004e200000000000000000000000000000000000000000000000000000000000005460000000000000000000000000ac4fd2d9ce342bc6fdc7e0ce539f365e4ec1fe4a
-----Decoded View---------------
Arg [0] : _startTimePre (uint256): 1539216000
Arg [1] : _endTimePre (uint256): 1539820799
Arg [2] : _startTimeSale (uint256): 1539820800
Arg [3] : _wallet (address): 0x4EEBB592Fb011F470ae45894F5eAa28248fef875
Arg [4] : _ethusd (uint256): 20000
Arg [5] : _oracleInterval (uint256): 21600
Arg [6] : _mdapp (address): 0xAC4fd2D9cE342bc6fdc7E0Ce539f365E4Ec1Fe4a
-----Encoded View---------------
7 Constructor Arguments found :
Arg [0] : 000000000000000000000000000000000000000000000000000000005bbe9280
Arg [1] : 000000000000000000000000000000000000000000000000000000005bc7ccff
Arg [2] : 000000000000000000000000000000000000000000000000000000005bc7cd00
Arg [3] : 0000000000000000000000004eebb592fb011f470ae45894f5eaa28248fef875
Arg [4] : 0000000000000000000000000000000000000000000000000000000000004e20
Arg [5] : 0000000000000000000000000000000000000000000000000000000000005460
Arg [6] : 000000000000000000000000ac4fd2d9ce342bc6fdc7e0ce539f365e4ec1fe4a
Swarm Source
bzzr://bafedb90d4f5fb321712e0c6f004ef0a1b13a8d72a0f9656c40435ea5a57effd
Loading...
Loading
Loading...
Loading
Net Worth in USD
$2.43
Net Worth in ETH
0.001333
Token Allocations
ETH
100.00%
Multichain Portfolio | 34 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|---|---|---|---|---|
| ETH | 100.00% | $1,823.09 | 0.00133268 | $2.43 |
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
[ 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.