Sponsored Link:   Ambrosus Main-Net Launching: Stake AMB in Masternodes and get regular rewards for maintaining network integrity.
Contract Overview
Balance: 1.10387351399050245 Ether
Ether Value: $510.98 (@ $462.90/ETH)
Transactions: 3 txns
 Latest 3 txns

TxHash Age From To Value [TxFee]
0x6855c68cb9f0558db2e5c7bde4c411fdcd6d7d4e2305a2dc4f797ce01709eb34272 days 5 hrs ago0xdc48c9b99a94ffd60557ed6dc9a4649db0fb2b33  IN   0xdc75eb262b08246ae8a1125e119667fb79540ef30 Ether0.000102509
0x8da3657888ebdc1ad03857d49fd233b6845dc78e7716ec7012002d9d27f7e9cb272 days 5 hrs ago0xdc48c9b99a94ffd60557ed6dc9a4649db0fb2b33  IN   0xdc75eb262b08246ae8a1125e119667fb79540ef30 Ether0.000065964
0xa19f63d90244881cec6f60c3e89f40fc32a699e01b2c3f6f24d84b5a738ca0c1272 days 5 hrs ago0xdc48c9b99a94ffd60557ed6dc9a4649db0fb2b33  IN    Contract Creation0 Ether0.003189026
[ Download CSV Export  ] 
 Internal Transactions as a result of Contract Execution
 Latest 8 Internal Transactions

ParentTxHash Block Age From To Value
0x9ce15987e88a12e2c14bd34a64dc2221739ab1e499e026c8e8bb0f95fc5884a3585277226 days 13 hrs ago0xdc75eb262b08246ae8a1125e119667fb79540ef30xa6e90a2b867e0c4b344eb73caca4bc56e56be17f0.00402667174690816 Ether
0x9ce15987e88a12e2c14bd34a64dc2221739ab1e499e026c8e8bb0f95fc5884a3585277226 days 13 hrs ago0x5f54c1512d036a0dd92744ee0a55ed183dde04840xdc75eb262b08246ae8a1125e119667fb79540ef30.01 Ether
0xb0075b9fb56b4f9388460f2790a6ccb22a6cba9ae1d0d3ffcb93b260f19a40de4451400265 days 19 hrs ago0xdc75eb262b08246ae8a1125e119667fb79540ef30xa6e90a2b867e0c4b344eb73caca4bc56e56be17f0.00403327142086313 Ether
0xb0075b9fb56b4f9388460f2790a6ccb22a6cba9ae1d0d3ffcb93b260f19a40de4451400265 days 19 hrs ago0x22a3d74c363379189b6cc059d8fbd888e98df5ec0xdc75eb262b08246ae8a1125e119667fb79540ef31 Ether
0xb930582e8a6d97b8fc62800f38ef51e45749259981030f763120800796d6c2c34427203269 days 16 hrs ago0xdc75eb262b08246ae8a1125e119667fb79540ef30xa6e90a2b867e0c4b344eb73caca4bc56e56be17f0.00403327142086313 Ether
0xb930582e8a6d97b8fc62800f38ef51e45749259981030f763120800796d6c2c34427203269 days 16 hrs ago0x5f54c1512d036a0dd92744ee0a55ed183dde04840xdc75eb262b08246ae8a1125e119667fb79540ef30.01 Ether
0x673a3196a67d153c2f63882d89b391a2c6911921d9fbd8027785daf534997b584427196269 days 16 hrs ago0xdc75eb262b08246ae8a1125e119667fb79540ef30xa6e90a2b867e0c4b344eb73caca4bc56e56be17f0.00403327142086313 Ether
0x673a3196a67d153c2f63882d89b391a2c6911921d9fbd8027785daf534997b584427196269 days 16 hrs ago0x22a3d74c363379189b6cc059d8fbd888e98df5ec0xdc75eb262b08246ae8a1125e119667fb79540ef30.1 Ether
[ Download CSV Export  ] 
Warning: The compiled contract might be susceptible to ZeroFunctionSelector (very low-severity) Solidity compiler bugs.

Contract Source Code Verified (Similar match)
Note: Displaying similar matching verified source code at contract 0xadb797366e36697dc9742a8c820d3dda931668d2(excluding Constructor Arguments if any)
Contract Name: minter
Compiler Version: v0.4.16+commit.d7661dd9
Optimization Enabled: Yes
Runs (Optimiser):  200



  Contract Source Code   Find Similiar Contracts

pragma solidity ^0.4.16;

/** @title owned. */
contract owned  {
  address owner;
  function owned() {
    owner = msg.sender;
  }
  function changeOwner(address newOwner) onlyOwner {
    owner = newOwner;
  }
  modifier onlyOwner() {
    require(msg.sender==owner); 
    _;
  }
}

/** @title mortal. */
contract mortal is owned() {
  function kill() onlyOwner {
    if (msg.sender == owner) selfdestruct(owner);
  }
}

/** @title DSMath. */
contract DSMath {

	// Copyright (C) 2015, 2016, 2017  DappHub, LLC

	// Licensed under the Apache License, Version 2.0 (the "License").
	// You may not use this file except in compliance with the License.

	// Unless required by applicable law or agreed to in writing, software
	// distributed under the License is distributed on an "AS IS" BASIS,
	// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND (express or implied).
    
	// /*
    // uint128 functions (h is for half)
    //  */

    function hmore(uint128 x, uint128 y) constant internal returns (bool) {
        return x>y;
    }

    function hless(uint128 x, uint128 y) constant internal returns (bool) {
        return x<y;
    }

    function hadd(uint128 x, uint128 y) constant internal returns (uint128 z) {
        require((z = x + y) >= x);
    }

    function hsub(uint128 x, uint128 y) constant internal returns (uint128 z) {
        require((z = x - y) <= x);
    }

    function hmul(uint128 x, uint128 y) constant internal returns (uint128 z) {
        require(y == 0 ||(z = x * y)/ y == x);
    }

    function hdiv(uint128 x, uint128 y) constant internal returns (uint128 z) {
        z = x / y;
    }

    function hmin(uint128 x, uint128 y) constant internal returns (uint128 z) {
        return x <= y ? x : y;
    }

    function hmax(uint128 x, uint128 y) constant internal returns (uint128 z) {
        return x >= y ? x : y;
    }

    // /*
    // int256 functions
    //  */

    /*
    WAD math
     */
    uint64 constant WAD_Dec=18;
    uint128 constant WAD = 10 ** 18;

    function wmore(uint128 x, uint128 y) constant internal returns (bool) {
        return hmore(x, y);
    }

    function wless(uint128 x, uint128 y) constant internal returns (bool) {
        return hless(x, y);
    }

    function wadd(uint128 x, uint128 y) constant  returns (uint128) {
        return hadd(x, y);
    }

    function wsub(uint128 x, uint128 y) constant   returns (uint128) {
        return hsub(x, y);
    }

    function wmul(uint128 x, uint128 y) constant returns (uint128 z) {
        z = cast((uint256(x) * y + WAD / 2) / WAD);
    }

    function wdiv(uint128 x, uint128 y) constant internal  returns (uint128 z) {
        z = cast((uint256(x) * WAD + y / 2) / y);
    }

    function wmin(uint128 x, uint128 y) constant internal  returns (uint128) {
        return hmin(x, y);
    }

    function wmax(uint128 x, uint128 y) constant internal  returns (uint128) {
        return hmax(x, y);
    }

    function cast(uint256 x) constant internal returns (uint128 z) {
        assert((z = uint128(x)) == x);
    }
	
}
 
/** @title I_minter. */
contract I_minter { 
    event EventCreateStatic(address indexed _from, uint128 _value, uint _transactionID, uint _Price); 
    event EventRedeemStatic(address indexed _from, uint128 _value, uint _transactionID, uint _Price); 
    event EventCreateRisk(address indexed _from, uint128 _value, uint _transactionID, uint _Price); 
    event EventRedeemRisk(address indexed _from, uint128 _value, uint _transactionID, uint _Price); 
    event EventBankrupt();

    function Leverage() constant returns (uint128)  {}
    function RiskPrice(uint128 _currentPrice,uint128 _StaticTotal,uint128 _RiskTotal, uint128 _ETHTotal) constant returns (uint128 price)  {}
    function RiskPrice(uint128 _currentPrice) constant returns (uint128 price)  {}     
    function PriceReturn(uint _TransID,uint128 _Price) {}
    function NewStatic() external payable returns (uint _TransID)  {}
    function NewStaticAdr(address _Risk) external payable returns (uint _TransID)  {}
    function NewRisk() external payable returns (uint _TransID)  {}
    function NewRiskAdr(address _Risk) external payable returns (uint _TransID)  {}
    function RetRisk(uint128 _Quantity) external payable returns (uint _TransID)  {}
    function RetStatic(uint128 _Quantity) external payable returns (uint _TransID)  {}
    function Strike() constant returns (uint128)  {}
}

/** @title I_Pricer. */
contract I_Pricer {
    uint128 public lastPrice;
    I_minter public mint;
    string public sURL;
    mapping (bytes32 => uint) RevTransaction;
    function __callback(bytes32 myid, string result) {}
    function queryCost() constant returns (uint128 _value) {}
    function QuickPrice() payable {}
    function requestPrice(uint _actionID) payable returns (uint _TrasID) {}
    function collectFee() returns(bool) {}
    function () {
        //if ether is sent to this address, send it back.
        revert();
    }
}

/** @title I_coin. */
contract I_coin is mortal {

    event EventClear();

	I_minter public mint;
    string public name;                   //fancy name: eg Simon Bucks
    uint8 public decimals=18;                //How many decimals to show. ie. There could 1000 base units with 3 decimals. Meaning 0.980 SBX = 980 base units. It's like comparing 1 wei to 1 ether.
    string public symbol;                 //An identifier: eg SBX
    string public version = '';       //human 0.1 standard. Just an arbitrary versioning scheme.
	
    function mintCoin(address target, uint256 mintedAmount) returns (bool success) {}
    function meltCoin(address target, uint256 meltedAmount) returns (bool success) {}
    function approveAndCall(address _spender, uint256 _value, bytes _extraData){}

    function setMinter(address _minter) {}   
	function increaseApproval (address _spender, uint256 _addedValue) returns (bool success) {}    
	function decreaseApproval (address _spender, uint256 _subtractedValue) 	returns (bool success) {} 

    // @param _owner The address from which the balance will be retrieved
    // @return The balance
    function balanceOf(address _owner) constant returns (uint256 balance) {}    


    // @notice send `_value` token to `_to` from `msg.sender`
    // @param _to The address of the recipient
    // @param _value The amount of token to be transferred
    // @return Whether the transfer was successful or not
    function transfer(address _to, uint256 _value) returns (bool success) {}


    // @notice send `_value` token to `_to` from `_from` on the condition it is approved by `_from`
    // @param _from The address of the sender
    // @param _to The address of the recipient
    // @param _value The amount of token to be transferred
    // @return Whether the transfer was successful or not
    function transferFrom(address _from, address _to, uint256 _value) returns (bool success) {}

    // @notice `msg.sender` approves `_addr` to spend `_value` tokens
    // @param _spender The address of the account able to transfer the tokens
    // @param _value The amount of wei to be approved for transfer
    // @return Whether the approval was successful or not
    function approve(address _spender, uint256 _value) returns (bool success) {}

    event Transfer(address indexed _from, address indexed _to, uint256 _value);
    event Approval(address indexed _owner, address indexed _spender, uint256 _value);
	
	// @param _owner The address of the account owning tokens
    // @param _spender The address of the account able to transfer the tokens
    // @return Amount of remaining tokens allowed to spent
    function allowance(address _owner, address _spender) constant returns (uint256 remaining) {}
	
	mapping (address => uint256) balances;
    mapping (address => mapping (address => uint256)) allowed;

	// @return total amount of tokens
    uint256 public totalSupply;
}

/** @title DSBaseActor. */
contract DSBaseActor {
   /*
   Copyright 2016 Nexus Development, LLC

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
   */

    bool _ds_mutex;
    modifier mutex() {
        assert(!_ds_mutex);
        _ds_mutex = true;
        _;
        _ds_mutex = false;
    }
	
    function tryExec( address target, bytes calldata, uint256 value)
			mutex()
            internal
            returns (bool call_ret)
    {
		/** @dev Requests new StatiCoins be made for a given address
          * @param target where the ETH is sent to.
          * @param calldata
          * @param value
          * @return True if ETH is transfered
        */
        return target.call.value(value)(calldata);
    }
	
    function exec( address target, bytes calldata, uint256 value)
             internal
    {
        assert(tryExec(target, calldata, value));
    }
}

/** @title canFreeze. */
contract canFreeze is owned { 
	//Copyright (c) 2017 GenkiFS
	//Basically a "break glass in case of emergency"
    bool public frozen=false;
    modifier LockIfFrozen() {
        if (!frozen){
            _;
        }
    }
    function Freeze() onlyOwner {
        // fixes the price and allows everyone to redeem their coins at the current value
		// only becomes false when all ETH has been claimed or the pricer contract is changed
        frozen=true;
    }
}

/** @title oneWrite. */
contract oneWrite {  
	//  Adds modifies that allow one function to be called only once
	//Copyright (c) 2017 GenkiFS
  bool written = false;
  function oneWrite() {
	/** @dev Constuctor, make sure written=false initally
	*/
    written = false;
  }
  modifier LockIfUnwritten() {
    if (written){
        _;
    }
  }
  modifier writeOnce() {
    if (!written){
        written=true;
        _;
    }
  }
}

/** @title pricerControl. */
contract pricerControl is canFreeze {
	//  Copyright (c) 2017 GenkiFS
	//  Controls the Pricer contract for minter.  Allows updates to be made in the future by swapping the pricer contract
	//  Although this is not expected, web addresses, API's, new oracles could require adjusments to the pricer contract
	//  A delay of 2 days is implemented to allow coinholders to redeem their coins if they do not agree with the new contract
	//  A new pricer contract unfreezes the minter (allowing a live price to be used)
    I_Pricer public pricer;
    address public future;
    uint256 public releaseTime;
    uint public PRICER_DELAY = 2; // days updated when coins are set
    event EventAddressChange(address indexed _from, address indexed _to, uint _timeChange);

    function setPricer(address newAddress) onlyOwner {
		/** @dev Changes the Pricer contract, after a certain delay
          * @param newAddress Allows coins to be created and sent to other people
          * @return transaction ID which can be viewed in the pending mapping
        */
        releaseTime = now + PRICER_DELAY;
        future = newAddress;
        EventAddressChange(pricer, future, releaseTime);
    }  

    modifier updates() {
        if (now > releaseTime  && pricer != future){
            update();
            //log0('Updating');
        }
        _;
    }

    modifier onlyPricer() {
      require(msg.sender==address(pricer));
      _;
    }

    function update() internal {
        pricer =  I_Pricer(future);
		frozen = false;
    }
}

/** @title minter. */	
contract minter is I_minter, DSBaseActor, oneWrite, pricerControl, DSMath{ //
	// Copyright (c) 2017 GenkiFS
	// This contract is the controller for the StatiCoin contracts.  
	// Users have 4(+2) functions they can call to mint/melt Static/Risk coins which then calls the Pricer contract
	// after a delay the Pricer contract will call back to the PriceReturn() function
	// this will then call one of the functions ActionNewStatic, ActionNewRisk, ActionRetStatic, ActionRetRisk
	// which will then call the Static or Risk ERC20 contracts to mint/melt new tokens
	// Transfer of tokens is handled by the ERC20 contracts, ETH is stored here.  
    enum Action {NewStatic, RetStatic, NewRisk, RetRisk} // Enum of what users can do
    struct Trans { // Struct
        uint128 amount; // Amount sent by the user (Can be either ETH or number of returned coins)
        address holder; // Address of the user
        Action action;  // Type of action requested (mint/melt a Risk/StatiCoin)
		bytes32 pricerID;  // ID for the pricer function
    }
    uint128 public lastPrice; //Storage of the last price returned by the Pricer contract
	uint128 public PendingETH; //Amount of eth to be added to the contract
    uint public TransID=0; // An increasing counter to keep track of transactions requested
	uint public TransCompleted; // Last transaction removed
    string public Currency; // Name of underlying base currency
    I_coin public Static;  // ERC20 token interface for the StatiCoin
    I_coin public Risk;  // ERC20 token interface for the Risk coin
    uint128 public Multiplier;//=15*10**(17); // default ratio for Risk price
    uint128 public levToll=5*10**(18-1);//0.5  // this plus the multiplier defines the maximum leverage
    uint128 public mintFee = 2*10**(18-3); //0.002 Used to pay oricalize and for marketing contract which is in both parties interest.
    mapping (uint => Trans[]) public pending; // A mapping of pending transactions

    event EventCreateStatic(address indexed _from, uint128 _value, uint _transactionID, uint _Price); 
    event EventRedeemStatic(address indexed _from, uint128 _value, uint _transactionID, uint _Price); 
    event EventCreateRisk(address indexed _from, uint128 _value, uint _transactionID, uint _Price); 
    event EventRedeemRisk(address indexed _from, uint128 _value, uint _transactionID, uint _Price); 
    event EventBankrupt();	//Called when no more ETH is in the contract and everything needs to be manually reset.  
	
	function minter(string _currency, uint128 _Multiplier) { //,uint8 _DecimalPlaces
        // CONSTRUCTOR  
        Currency=_currency;
        Multiplier = _Multiplier;
        // can't add new contracts here as it gives out of gas messages.  Too much code.
    }	

	function () {
        //if ETH is just sent to this address then we cannot determine if it's for StatiCoins or RiskCoins, so send it back.
        revert();
    }

	function Bailout() 
			external 
			payable 
			{
        /** @dev Allows extra ETH to be added to the benefit of both types of coin holders
          * @return nothing
        */
    }
		
    function NewStatic() 
			external 
			payable 
			returns (uint _TransID) {
        /** @dev Requests new StatiCoins be made for the sender.  
		  * This cannot be called by a contract.  Only a simple wallet (with 0 codesize).
		  * Contracts must use the Approve, transferFrom pattern and move coins from wallets
          * @return transaction ID which can be viewed in the pending mapping
        */
		_TransID=NewCoinInternal(msg.sender,cast(msg.value),Action.NewStatic);
		//log0('NewStatic');
    }
	
    function NewStaticAdr(address _user) 
			external 
			payable 
			returns (uint _TransID)  {  
        /** @dev Requests new StatiCoins be made for a given address.  
		  * The address cannot be a contract, only a simple wallet (with 0 codesize).
		  * Contracts must use the Approve, transferFrom pattern and move coins from wallets
          * @param _user Allows coins to be created and sent to other people
          * @return transaction ID which can be viewed in the pending mapping
        */
		_TransID=NewCoinInternal(_user,cast(msg.value),Action.NewStatic);
		//log0('NewStatic');
    }
	
    function NewRisk() 
			external 
			payable 
			returns (uint _TransID)  {
        /** @dev Requests new Riskcoins be made for the sender.  
		  * This cannot be called by a contract, only a simple wallet (with 0 codesize).
		  * Contracts must use the Approve, transferFrom pattern and move coins from wallets
          * @return transaction ID which can be viewed in the pending mapping
          */
		_TransID=NewCoinInternal(msg.sender,cast(msg.value),Action.NewRisk);
        //log0('NewRisk');
    }

    function NewRiskAdr(address _user) 
			external 
			payable 
			returns (uint _TransID)  {
        /** @dev Requests new Riskcoins be made for a given address.  
		  * The address cannot be a contract, only a simple wallet (with 0 codesize).
		  * Contracts must use the Approve, transferFrom pattern and move coins from wallets
          * @param _user Allows coins to be created and sent to other people
          * @return transaction ID which can be viewed in the pending mapping
          */
		_TransID=NewCoinInternal(_user,cast(msg.value),Action.NewRisk);
        //log0('NewRisk');
    }

    function RetRisk(uint128 _Quantity) 
			external 
			payable 
			LockIfUnwritten  
			returns (uint _TransID)  {
        /** @dev Returns Riskcoins.  Needs a bit of eth sent to pay the pricer contract and the excess is returned.  
		  * The address cannot be a contract, only a simple wallet (with 0 codesize).
          * @param _Quantity Amount of coins being returned
		  * @return transaction ID which can be viewed in the pending mapping
        */
        if(frozen){
            //Skip the pricer contract
            TransID++;
			ActionRetRisk(Trans(_Quantity,msg.sender,Action.RetRisk,0),TransID,lastPrice);
			_TransID=TransID;
        } else {
            //Only returned when Risk price is positive
			_TransID=RetCoinInternal(_Quantity,cast(msg.value),msg.sender,Action.RetRisk);
        }
		//log0('RetRisk');
    }

    function RetStatic(uint128 _Quantity) 
			external 
			payable 
			LockIfUnwritten  
			returns (uint _TransID)  {
        /** @dev Returns StatiCoins,  Needs a bit of eth sent to pay the pricer contract
          * @param _Quantity Amount of coins being returned
		  * @return transaction ID which can be viewed in the pending mapping
        */
        if(frozen){
            //Skip the pricer contract
			TransID++;
            ActionRetStatic(Trans(_Quantity,msg.sender,Action.RetStatic,0),TransID,lastPrice);
			_TransID=TransID;
        } else {
            //Static can be returned at any time
			_TransID=RetCoinInternal(_Quantity,cast(msg.value),msg.sender,Action.RetStatic);
        }
		//log0('RetStatic');
    }
	
	//****************************//
	// Constant functions (Ones that don't write to the blockchain)

    function StaticEthAvailable() 
			constant 
			returns (uint128)  {
		/** @dev Returns the total amount of eth that can be sent to buy StatiCoins
		  * @return amount of Eth
        */
		return StaticEthAvailable(cast(Risk.totalSupply()), cast(this.balance));
    }

	function StaticEthAvailable(uint128 _RiskTotal, uint128 _TotalETH) 
			constant 
			returns (uint128)  {
		/** @dev Returns the total amount of eth that can be sent to buy StatiCoins allows users to test arbitrary amounts of RiskTotal and ETH contained in the contract
		  * @param _RiskTotal Quantity of riskcoins
          * @param  _TotalETH Total value of ETH in the contract
		  * @return amount of Eth
        */
		// (Multiplier+levToll)*_RiskTotal - _TotalETH
		uint128 temp = wmul(wadd(Multiplier,levToll),_RiskTotal);
		if(wless(_TotalETH,temp)){
			return wsub(temp ,_TotalETH);
		} else {
			return 0;
		}
    }

	function RiskPrice(uint128 _currentPrice,uint128 _StaticTotal,uint128 _RiskTotal, uint128 _ETHTotal) 
			constant 
			returns (uint128 price)  {
	    /** @dev Allows users to query various hypothetical prices of RiskCoins in terms of base currency
          * @param _currentPrice Current price of ETH in Base currency.
          * @param _StaticTotal Total quantity of StatiCoins issued.
          * @param _RiskTotal Total quantity of invetor coins issued.
          * @param _ETHTotal Total quantity of ETH in the contract.
          * @return price of RiskCoins 
        */
        if(_ETHTotal == 0 || _RiskTotal==0){
			//Return the default price of _currentPrice * Multiplier
            return wmul( _currentPrice , Multiplier); 
        } else {
            if(hmore( wmul(_ETHTotal , _currentPrice),_StaticTotal)){ //_ETHTotal*_currentPrice>_StaticTotal
				//Risk price is positive
                return wdiv(wsub(wmul(_ETHTotal , _currentPrice) , _StaticTotal) , _RiskTotal); // (_ETHTotal * _currentPrice) - _StaticTotal) / _RiskTotal
            } else  {
				//RiskPrice is negative
                return 0;
            }
        }       
    }
	
    function RiskPrice(uint128 _currentPrice) 
			constant 
			returns (uint128 price)  {
	    /** @dev Allows users to query price of RiskCoins in terms of base currency, using current quantities of coins
          * @param _currentPrice Current price of ETH in Base currency.
	      * @return price of RiskCoins 
        */
        return RiskPrice(_currentPrice,cast(Static.totalSupply()),cast(Risk.totalSupply()),wsub(cast(this.balance),PendingETH));
    }     

    function LastRiskPrice() 
			constant 
			returns (uint128 price)  {
	    /** @dev Allows users to query the last price of RiskCoins in terms of base currency
        *   @return price of RiskCoins 
        */
        return RiskPrice(lastPrice);
    }     		
	
	function Leverage() public 
			constant 
			returns (uint128)  {
		/** @dev Returns the ratio at which Riskcoin grows in value for the equivalent growth in ETH price
		* @return ratio
        */
        if(Risk.totalSupply()>0){
            return wdiv(cast(this.balance) , cast(Risk.totalSupply())); //  this.balance/Risk.totalSupply
        }else{
            return 0;
        }
    }

    function Strike() public 
			constant 
			returns (uint128)  {
		/** @dev Returns the current price at which the Risk price goes negative
		* @return Risk price in underlying per ETH
        */ 
        if(this.balance>0){
            return wdiv(cast(Static.totalSupply()) , cast(this.balance)); //Static.totalSupply / this.balance
        }else{
            return 0;            
        }
    }

	//****************************//
	// Only owner can access the following functions
    function setFee(uint128 _newFee) 
			onlyOwner {
        /** @dev Allows the minting fee to be changed, only owner can modify
          * @param _newFee Size of new fee
          * return nothing 
        */
        mintFee=_newFee;
    }

    function setCoins(address newRisk,address newStatic) 
			updates 
			onlyOwner 
			writeOnce {
        /** @dev Allows the minting fee to be reduced, only owner can modify once, Triggers the pricer to be updated 
          * @param newRisk Address of Riskcoin contract
          * @param newStatic Address of StatiCoin contract
          * return nothing 
        */
        Risk=I_coin(newRisk);
        Static=I_coin(newStatic);
		PRICER_DELAY = 2 days;
    }
	
	//****************************//	
	// Only Pricer can access the following function
    function PriceReturn(uint _TransID,uint128 _Price) 
			onlyPricer {
	    /** @dev Return function for the Pricer contract only.  Controls melting and minting of new coins.
          * @param _TransID Tranasction ID issued by the minter.
          * @param _Price Quantity of Base currency per ETH delivered by the Pricer contract
          * Nothing returned.  One of 4 functions is implemented
        */
	    Trans memory details=pending[_TransID][0];//Get the details for this transaction. 
        if(0==_Price||frozen){ //If there is an error in pricing or contract is frozen, use the old price
            _Price=lastPrice;
        } else {
			if(Static.totalSupply()>0 && Risk.totalSupply()>0) {// dont update if there are coins missing
				lastPrice=_Price; // otherwise update the last price
			}
        }
		//Mint some new StatiCoins
        if(Action.NewStatic==details.action){
            ActionNewStatic(details,_TransID, _Price);
        }
		//Melt some old StatiCoins
        if(Action.RetStatic==details.action){
            ActionRetStatic(details,_TransID, _Price);
        }
		//Mint some new Risk coins
        if(Action.NewRisk==details.action){
            ActionNewRisk(details,_TransID, _Price);
        }
		//Melt some old Risk coin
        if(Action.RetRisk==details.action){
            ActionRetRisk(details,_TransID, _Price);
        }
		//Remove the transaction from the blockchain (saving some gas)
		TransCompleted=_TransID;
		delete pending[_TransID];
    }
	
	//****************************//
    // Only internal functions now
    function ActionNewStatic(Trans _details, uint _TransID, uint128 _Price) 
			internal {
		/** @dev Internal function to create new StatiCoins based on transaction data in the Pending queue.  If not enough spare StatiCoins are available then ETH is refunded.
          * @param _details Structure holding the amount sent (in ETH), the address of the person to sent to, and the type of request.
          * @param _TransID ID of the transaction (as stored in this contract).
          * @param _Price Current 24 hour average price as returned by the oracle in the pricer contract.
          * @return function returns nothing, but adds StatiCoins to the users address and events are created
        */
		//log0('NewStatic');
            
            //if(Action.NewStatic<>_details.action){revert();}  //already checked
			
			uint128 CurRiskPrice=RiskPrice(_Price);
			uint128 AmountReturn;
			uint128 AmountMint;
			
			//Calculates the amount of ETH that can be added to create StatiCoins (excluding the amount already sent and stored in the contract)
			uint128 StaticAvail = StaticEthAvailable(cast(Risk.totalSupply()), wsub(cast(this.balance),PendingETH)); 
						
			// If the amount sent is less than the Static amount available, everything is fine.  Nothing needs to be returned.  
			if (wless(_details.amount,StaticAvail)) {
				// restrictions do not hamper the creation of a StatiCoin
				AmountMint = _details.amount;
				AmountReturn = 0;
			} else {
				// Amount of Static is less than amount requested.  
				// Take all the StatiCoins available.
				// Maybe there is zero Static available, so all will be returned.
				AmountMint = StaticAvail;
				AmountReturn = wsub(_details.amount , StaticAvail) ;
			}	
			
			if(0 == CurRiskPrice){
				// return all the ETH
				AmountReturn = _details.amount;
				//AmountMint = 0; //not required as Risk price = 0
			}
			
			//Static can be added when Risk price is positive and leverage is below the limit
            if(CurRiskPrice > 0  && StaticAvail>0 ){
                // Dont create if CurRiskPrice is 0 or there is no Static available (leverage is too high)
				//log0('leverageOK');
                Static.mintCoin(_details.holder, uint256(wmul(AmountMint , _Price))); //request coins from the Static creator contract
                EventCreateStatic(_details.holder, wmul(AmountMint , _Price), _TransID, _Price); // Event giving the holder address, coins created, transaction id, and price 
				PendingETH=wsub(PendingETH,AmountMint);
            } 

			if (AmountReturn>0) {
                // return some money because not enough StatiCoins are available
				bytes memory calldata; // define a blank `bytes`
                exec(_details.holder,calldata, AmountReturn);  //Refund ETH from this contract
				PendingETH=wsub(PendingETH,AmountReturn);
			}	
    }

    function ActionNewRisk(Trans _details, uint _TransID,uint128 _Price) 
			internal {
		/** @dev Internal function to create new Risk coins based on transaction data in the Pending queue.  Risk coins can only be created if the price is above zero
          * @param _details Structure holding the amount sent (in ETH), the address of the person to sent to, and the type of request.
          * @param _TransID ID of the transaction (as stored in this contract).
          * @param _Price Current 24 hour average price as returned by the oracle in the pricer contract.
          * @return function returns nothing, but adds Riskcoins to the users address and events are created
        */
        //log0('NewRisk');
        //if(Action.NewRisk<>_details.action){revert();}  //already checked
		// Get the Risk price using the amount of ETH in the contract before this transaction existed
		uint128 CurRiskPrice;
		if(wless(cast(this.balance),PendingETH)){
			CurRiskPrice=0;
		} else {
			CurRiskPrice=RiskPrice(_Price,cast(Static.totalSupply()),cast(Risk.totalSupply()),wsub(cast(this.balance),PendingETH));
		}
        if(CurRiskPrice>0){
            uint128 quantity=wdiv(wmul(_details.amount , _Price),CurRiskPrice);  // No of Riskcoins =  _details.amount * _Price / CurRiskPrice
            Risk.mintCoin(_details.holder, uint256(quantity) );  //request coins from the Riskcoin creator contract
            EventCreateRisk(_details.holder, quantity, _TransID, _Price); // Event giving the holder address, coins created, transaction id, and price 
        } else {
            // Don't create if CurRiskPrice is 0, Return all the ETH originally sent
            bytes memory calldata; // define a blank `bytes`
            exec(_details.holder,calldata, _details.amount);
        }
		PendingETH=wsub(PendingETH,_details.amount);
    }

    function ActionRetStatic(Trans _details, uint _TransID,uint128 _Price) 
			internal {
		/** @dev Internal function to Return StatiCoins based on transaction data in the Pending queue.  Static can be returned at any time.
          * @param _details Structure holding the amount sent (in ETH), the address of the person to sent to, and the type of request.
          * @param _TransID ID of the transaction (as stored in this contract).
          * @param _Price Current 24 hour average price as returned by the oracle in the pricer contract.
          * @return function returns nothing, but removes StatiCoins from the user's address, sends ETH and events are created
        */
		//if(Action.RetStatic<>_details.action){revert();}  //already checked
		//log0('RetStatic');
		uint128 _ETHReturned;
		if(0==Risk.totalSupply()){_Price=lastPrice;} //No Risk coins for balance so use fixed price
        _ETHReturned = wdiv(_details.amount , _Price); //_details.amount / _Price
        if (Static.meltCoin(_details.holder,_details.amount)){
            // deducted first, will add back if Returning ETH goes wrong.
            EventRedeemStatic(_details.holder,_details.amount ,_TransID, _Price);
            if (wless(cast(this.balance),_ETHReturned)) {
                 _ETHReturned=cast(this.balance);//Not enough ETH available.  Return all Eth in the contract
            }
			bytes memory calldata; // define a blank `bytes`
            if (tryExec(_details.holder, calldata, _ETHReturned)) { 
				//ETH returned successfully
			} else {
				// there was an error, so add back the amount previously deducted
				Static.mintCoin(_details.holder,_details.amount); //Add back the amount requested
				EventCreateStatic(_details.holder,_details.amount ,_TransID, _Price);  //redo the creation event
			}
			if ( 0==this.balance) {
				Bankrupt();
			}
        }        
    }

    function ActionRetRisk(Trans _details, uint _TransID,uint128 _Price) 
			internal {
		/** @dev Internal function to Return Riskcoins based on transaction data in the Pending queue.  Riskcoins can be returned so long as the Risk price is greater than 0.
          * @param _details Structure holding the amount sent (in ETH), the address of the person to sent to, and the type of request.
          * @param _TransID ID of the transaction (as stored in this contract).
          * @param _Price Current 24 hour average price as returned by the oracle in the Pricer contract.
          * @return function returns nothing, but removes StatiCoins from the users address, sends ETH and events are created
        */        
		//if(Action.RetRisk<>_details.action){revert();}  //already checked
		//log0('RetRisk');
        uint128 _ETHReturned;
		uint128 CurRiskPrice;
		//if(0==Static.totalSupply()){_Price=lastPrice};// no StatiCoins, so all Risk coins are worth the same.  // _ETHReturned = _details.amount / _RiskTotal * _ETHTotal
		CurRiskPrice=RiskPrice(_Price);
        if(CurRiskPrice>0){
            _ETHReturned = wdiv( wmul(_details.amount , CurRiskPrice) , _Price); // _details.amount * CurRiskPrice / _Price
            if (Risk.meltCoin(_details.holder,_details.amount )){
                // Coins are deducted first, will add back if returning ETH goes wrong.
                EventRedeemRisk(_details.holder,_details.amount ,_TransID, _Price);
                if ( wless(cast(this.balance),_ETHReturned)) { // should never happen, but just in case
                     _ETHReturned=cast(this.balance);
                }
				bytes memory calldata; // define a blank `bytes`
                if (tryExec(_details.holder, calldata, _ETHReturned)) { 
					//Returning ETH went ok.  
                } else {
                    // there was an error, so add back the amount previously deducted from the Riskcoin contract
                    Risk.mintCoin(_details.holder,_details.amount);
                    EventCreateRisk(_details.holder,_details.amount ,_TransID, _Price);
                }
            } 
        }  else {
            // Risk price is zero so can't do anything.  Call back and delete the transaction from the contract
        }
    }

	function IsWallet(address _address) 
			internal 
			returns(bool){
		/**
		* @dev checks that _address is not a contract.  
		* @param _address to check 
		* @return True if not a contract, 
		*/		
		uint codeLength;
		assembly {
            // Retrieve the size of the code on target address, this needs assembly .
            codeLength := extcodesize(_address)
        }
		return(0==codeLength);		
    } 

	function RetCoinInternal(uint128 _Quantity, uint128 _AmountETH, address _user, Action _action) 
			internal 
			updates 
			returns (uint _TransID)  {
        /** @dev Requests coins be melted and ETH returned
		  * @param _Quantity of Static or Risk coins to be melted0
		  * @param _AmountETH Amount of eth sent to this contract to cover oracle fee.  Excess is returned.
          * @param _user Address to whom the returned ETH will be sent.
		  * @param _action Allows Static or Risk coins to be returned
		  * @return transaction ID which can be viewed in the Pending mapping
        */
		require(IsWallet(_user));
		uint128 refund;
        uint128 Fee=pricer.queryCost();  //Get the cost of querying the pricer contract
		if(wless(_AmountETH,Fee)){
			revert();  //log0('Not enough ETH to mint');
			} else {
			refund=wsub(_AmountETH,Fee);//Returning coins has had too much ETH sent, so return it.
		}
		if(0==_Quantity){revert();}// quantity has to be non zero
		TransID++;
        
        uint PricerID = pricer.requestPrice.value(uint256(Fee))(TransID);  //Ask the pricer to get the price.  The Fee also cover calling the function PriceReturn at a later time.
		pending[TransID].push(Trans(_Quantity,_user,_action,bytes32(PricerID)));  //Add a transaction to the Pending queue.
        _TransID=TransID;  //return the transaction ID to the user 
        _user.transfer(uint256(refund)); //Return ETH if too much has been sent to cover the pricer
    }
		
	function NewCoinInternal(address _user, uint128 _amount, Action _action) 
			internal 
			updates 
			LockIfUnwritten 
			LockIfFrozen  
			returns (uint _TransID)  {
		/** @dev Requests new coins be made
          * @param _user Address for whom the coins are to be created
          * @param _amount Amount of eth sent to this contract
		  * @param _action Allows Static or Risk coins to be minted
		  * @return transaction ID which can be viewed in the pending mapping
        */
		require(IsWallet(_user));
		uint128 toCredit;
        uint128 Fee=wmax(wmul(_amount,mintFee),pricer.queryCost()); // fee is the maxium of the pricer query cost and a mintFee% of value sent
        if(wless(_amount,Fee)) revert(); //log0('Not enough ETH to mint');
		TransID++;
        uint PricerID = pricer.requestPrice.value(uint256(Fee))(TransID); //Ask the pricer to return the price
		toCredit=wsub(_amount,Fee);
		pending[TransID].push(Trans(toCredit,_user,_action,bytes32(PricerID))); //Store the transaction ID and data ready for later recall
		PendingETH=wadd(PendingETH,toCredit);
        _TransID=TransID;//return the transaction ID for this contract to the user 		
	} 

    function Bankrupt() 
			internal {
			EventBankrupt();
			// Reset the contract
			Static.kill();  //delete all current Static tokens
			Risk.kill();  //delete all current Risk tokens
			//need to create new coins externally, too much gas is used if done here.  
			frozen=false;
			written=false;  // Reset the writeOnce and LockIfUnwritten modifiers
    }
}

    Contract ABI  
[{"constant":true,"inputs":[{"name":"_currentPrice","type":"uint128"},{"name":"_StaticTotal","type":"uint128"},{"name":"_RiskTotal","type":"uint128"},{"name":"_ETHTotal","type":"uint128"}],"name":"RiskPrice","outputs":[{"name":"price","type":"uint128"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"lastPrice","outputs":[{"name":"","type":"uint128"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"frozen","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"mintFee","outputs":[{"name":"","type":"uint128"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"NewRisk","outputs":[{"name":"_TransID","type":"uint256"}],"payable":true,"stateMutability":"payable","type":"function"},{"constant":true,"inputs":[],"name":"TransCompleted","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"newAddress","type":"address"}],"name":"setPricer","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"Static","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_newFee","type":"uint128"}],"name":"setFee","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_Quantity","type":"uint128"}],"name":"RetStatic","outputs":[{"name":"_TransID","type":"uint256"}],"payable":true,"stateMutability":"payable","type":"function"},{"constant":false,"inputs":[],"name":"Bailout","outputs":[],"payable":true,"stateMutability":"payable","type":"function"},{"constant":true,"inputs":[],"name":"Leverage","outputs":[{"name":"","type":"uint128"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_Quantity","type":"uint128"}],"name":"RetRisk","outputs":[{"name":"_TransID","type":"uint256"}],"payable":true,"stateMutability":"payable","type":"function"},{"constant":false,"inputs":[{"name":"newRisk","type":"address"},{"name":"newStatic","type":"address"}],"name":"setCoins","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_currentPrice","type":"uint128"}],"name":"RiskPrice","outputs":[{"name":"price","type":"uint128"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"x","type":"uint128"},{"name":"y","type":"uint128"}],"name":"wsub","outputs":[{"name":"","type":"uint128"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"Risk","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"Freeze","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"Currency","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"x","type":"uint128"},{"name":"y","type":"uint128"}],"name":"wadd","outputs":[{"name":"","type":"uint128"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"NewStatic","outputs":[{"name":"_TransID","type":"uint256"}],"payable":true,"stateMutability":"payable","type":"function"},{"constant":false,"inputs":[{"name":"_user","type":"address"}],"name":"NewRiskAdr","outputs":[{"name":"_TransID","type":"uint256"}],"payable":true,"stateMutability":"payable","type":"function"},{"constant":true,"inputs":[],"name":"Strike","outputs":[{"name":"","type":"uint128"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"x","type":"uint128"},{"name":"y","type":"uint128"}],"name":"wmul","outputs":[{"name":"z","type":"uint128"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"TransID","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_user","type":"address"}],"name":"NewStaticAdr","outputs":[{"name":"_TransID","type":"uint256"}],"payable":true,"stateMutability":"payable","type":"function"},{"constant":true,"inputs":[],"name":"future","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint256"},{"name":"","type":"uint256"}],"name":"pending","outputs":[{"name":"amount","type":"uint128"},{"name":"holder","type":"address"},{"name":"action","type":"uint8"},{"name":"pricerID","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"pricer","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"newOwner","type":"address"}],"name":"changeOwner","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"LastRiskPrice","outputs":[{"name":"price","type":"uint128"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"levToll","outputs":[{"name":"","type":"uint128"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"releaseTime","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_TransID","type":"uint256"},{"name":"_Price","type":"uint128"}],"name":"PriceReturn","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"StaticEthAvailable","outputs":[{"name":"","type":"uint128"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"PRICER_DELAY","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_RiskTotal","type":"uint128"},{"name":"_TotalETH","type":"uint128"}],"name":"StaticEthAvailable","outputs":[{"name":"","type":"uint128"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"PendingETH","outputs":[{"name":"","type":"uint128"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"Multiplier","outputs":[{"name":"","type":"uint128"}],"payable":false,"stateMutability":"view","type":"function"},{"inputs":[{"name":"_currency","type":"string"},{"name":"_Multiplier","type":"uint128"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"payable":false,"stateMutability":"nonpayable","type":"fallback"},{"anonymous":false,"inputs":[{"indexed":true,"name":"_from","type":"address"},{"indexed":false,"name":"_value","type":"uint128"},{"indexed":false,"name":"_transactionID","type":"uint256"},{"indexed":false,"name":"_Price","type":"uint256"}],"name":"EventCreateStatic","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"_from","type":"address"},{"indexed":false,"name":"_value","type":"uint128"},{"indexed":false,"name":"_transactionID","type":"uint256"},{"indexed":false,"name":"_Price","type":"uint256"}],"name":"EventRedeemStatic","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"_from","type":"address"},{"indexed":false,"name":"_value","type":"uint128"},{"indexed":false,"name":"_transactionID","type":"uint256"},{"indexed":false,"name":"_Price","type":"uint256"}],"name":"EventCreateRisk","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"_from","type":"address"},{"indexed":false,"name":"_value","type":"uint128"},{"indexed":false,"name":"_transactionID","type":"uint256"},{"indexed":false,"name":"_Price","type":"uint256"}],"name":"EventRedeemRisk","type":"event"},{"anonymous":false,"inputs":[],"name":"EventBankrupt","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"_from","type":"address"},{"indexed":true,"name":"_to","type":"address"},{"indexed":false,"name":"_timeChange","type":"uint256"}],"name":"EventAddressChange","type":"event"}]

  Contract Creation Code Switch To Opcodes View
60606040526000805461ff0060b060020a60ff0201191681556002600455600655600b80547706f05b59d3b20000000000000000000000000000000000006001608060020a03909116179055600c80546001608060020a03191666071afd498d000017905534156200007057600080fd5b60405162002d9138038062002d91833981016040528080518201919060200180519150505b5b5b6000805461ff00191690555b600080546201000060b060020a0319166201000033600160a060020a0316021790555b6008828051620000db92916020019062000100565b50600b80546001608060020a0319166001608060020a0383161790555b5050620001aa565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106200014357805160ff191683800117855562000173565b8280016001018555821562000173579182015b828111156200017357825182559160200191906001019062000156565b5b506200018292915062000186565b5090565b620001a791905b808211156200018257600081556001016200018d565b5090565b90565b612bd780620001ba6000396000f300606060405236156101c65763ffffffff60e060020a6000350416626f91d281146101d9578063053f14da14610226578063054f7d9c1461025557806313966db51461027c578063199f4045146102ab5780631c67a7aa146102c557806329390370146102ea57806331b8b1001461030b5780633687f24a1461033a5780633cad71cf1461035b57806343acd7bc1461038157806343e0dfdd1461038b578063450b6079146103ba5780634863ed97146103e05780635040012814610407578063523d897e146104425780635f429ba514610483578063615acbae146104b25780636942eac7146104c757806369a046f2146105525780637af0ed7e146105935780637e7388b1146105ad57806381531c64146105d35780638f1eda371461060257806399eb975c14610643578063a046c5f614610668578063a2ec258f1461068e578063a30a7171146106bd578063a6138ed914610723578063a6f9dae114610752578063aa4ee73014610773578063abbc5d2a146107a2578063b91d4001146107d1578063e5d02cd0146107f6578063ec4baa831461081a578063ed6b40c014610849578063f1914dc51461086e578063fd2e9caf146108af578063fd9b8763146108de575b34156101d157600080fd5b5b600080fd5b005b34156101e457600080fd5b61020a6001608060020a036004358116906024358116906044358116906064351661090d565b6040516001608060020a03909116815260200160405180910390f35b341561023157600080fd5b61020a610998565b6040516001608060020a03909116815260200160405180910390f35b341561026057600080fd5b6102686109a7565b604051901515815260200160405180910390f35b341561028757600080fd5b61020a6109b7565b6040516001608060020a03909116815260200160405180910390f35b6102b36109c6565b60405190815260200160405180910390f35b34156102d057600080fd5b6102b36109e2565b60405190815260200160405180910390f35b34156102f557600080fd5b6101d7600160a060020a03600435166109e8565b005b341561031657600080fd5b61031e610a83565b604051600160a060020a03909116815260200160405180910390f35b341561034557600080fd5b6101d76001608060020a0360043516610a92565b005b6102b36001608060020a0360043516610adc565b60405190815260200160405180910390f35b6101d7610b7f565b005b341561039657600080fd5b61020a610b82565b6040516001608060020a03909116815260200160405180910390f35b6102b36001608060020a0360043516610c89565b60405190815260200160405180910390f35b34156103eb57600080fd5b6101d7600160a060020a0360043581169060243516610d2c565b005b341561041257600080fd5b61020a6001608060020a0360043516610dea565b6040516001608060020a03909116815260200160405180910390f35b341561044d57600080fd5b61020a6001608060020a0360043581169060243516610f05565b6040516001608060020a03909116815260200160405180910390f35b341561048e57600080fd5b61031e610f1a565b604051600160a060020a03909116815260200160405180910390f35b34156104bd57600080fd5b6101d7610f29565b005b34156104d257600080fd5b6104da610f74565b60405160208082528190810183818151815260200191508051906020019080838360005b838110156105175780820151818401525b6020016104fe565b50505050905090810190601f1680156105445780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561055d57600080fd5b61020a6001608060020a0360043581169060243516611012565b6040516001608060020a03909116815260200160405180910390f35b6102b3611027565b60405190815260200160405180910390f35b6102b3600160a060020a0360043516611043565b60405190815260200160405180910390f35b34156105de57600080fd5b61020a611061565b6040516001608060020a03909116815260200160405180910390f35b341561060d57600080fd5b61020a6001608060020a0360043581169060243516611110565b6040516001608060020a03909116815260200160405180910390f35b341561064e57600080fd5b6102b361115a565b60405190815260200160405180910390f35b6102b3600160a060020a0360043516611160565b60405190815260200160405180910390f35b341561069957600080fd5b61031e61117e565b604051600160a060020a03909116815260200160405180910390f35b34156106c857600080fd5b6106d660043560243561118d565b6040516001608060020a0385168152600160a060020a03841660208201526040810183600381111561070457fe5b60ff168152602081019290925250604090810193509150505180910390f35b341561072e57600080fd5b61031e6111ef565b604051600160a060020a03909116815260200160405180910390f35b341561075d57600080fd5b6101d7600160a060020a03600435166111fe565b005b341561077e57600080fd5b61020a611253565b6040516001608060020a03909116815260200160405180910390f35b34156107ad57600080fd5b61020a611271565b6040516001608060020a03909116815260200160405180910390f35b34156107dc57600080fd5b6102b3611287565b60405190815260200160405180910390f35b341561080157600080fd5b6101d76004356001608060020a036024351661128d565b005b341561082557600080fd5b61020a611530565b6040516001608060020a03909116815260200160405180910390f35b341561085457600080fd5b6102b36115c0565b60405190815260200160405180910390f35b341561087957600080fd5b61020a6001608060020a03600435811690602435166115c6565b6040516001608060020a03909116815260200160405180910390f35b34156108ba57600080fd5b61020a611624565b6040516001608060020a03909116815260200160405180910390f35b34156108e957600080fd5b61020a61163a565b6040516001608060020a03909116815260200160405180910390f35b60006001608060020a038216158061092c57506001608060020a038316155b1561094f57600b546109489086906001608060020a0316611110565b905061098e565b61096261095c8387611110565b85611649565b1561098a5761094861097d6109778488611110565b86610f05565b8461165f565b905061098e565b5060005b5b5b949350505050565b6005546001608060020a031681565b60005460b060020a900460ff1681565b600c546001608060020a031681565b60006109dc336109d5346116b2565b60026116cb565b90505b90565b60075481565b60005433600160a060020a03908116620100009092041614610a0957600080fd5b600454420160038190556002805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a038481169190911791829055600154918116929116907f72511fb4cdbe5b0188562edd69ff06f12e0966e9246eefc6754e67ba0de954a69060405190815260200160405180910390a35b5b50565b600954600160a060020a031681565b60005433600160a060020a03908116620100009092041614610ab357600080fd5b600c80546fffffffffffffffffffffffffffffffff19166001608060020a0383161790555b5b50565b60008054610100900460ff1615610b775760005460b060020a900460ff1615610b5f57600680546001019055610b56608060405190810160409081526001608060020a0385168252600160a060020a0333166020830152810160015b815260006020909101526006546005546001608060020a03166119c7565b50600654610b77565b610b7482610b6c346116b2565b336001611ccb565b90505b5b5b5b919050565b5b565b600a546000908190600160a060020a03166318160ddd82604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b1515610bce57600080fd5b6102c65a03f11515610bdf57600080fd5b505050604051805190501115610c7d57610c76610c0530600160a060020a0316316116b2565b600a54610c7190600160a060020a03166318160ddd6000604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b1515610c5157600080fd5b6102c65a03f11515610c6257600080fd5b505050604051805190506116b2565b61165f565b90506109df565b5060006109df565b5b90565b60008054610100900460ff1615610b775760005460b060020a900460ff1615610d0c57600680546001019055610b56608060405190810160409081526001608060020a0385168252600160a060020a0333166020830152810160035b815260006020909101526006546005546001608060020a0316611f96565b50600654610b77565b610b7482610d19346116b2565b336003611ccb565b90505b5b5b5b919050565b60035442118015610d4e5750600254600154600160a060020a03908116911614155b15610d5b57610d5b612232565b5b60005433600160a060020a03908116620100009092041614610d7d57600080fd5b600054610100900460ff161515610de2576000805461ff001916610100179055600a8054600160a060020a0380851673ffffffffffffffffffffffffffffffffffffffff199283161790925560098054928416929091169190911790556202a3006004555b5b5b5b5b5050565b600954600090610b74908390610e5e90600160a060020a03166318160ddd85604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b1515610c5157600080fd5b6102c65a03f11515610c6257600080fd5b505050604051805190506116b2565b600a54610eca90600160a060020a03166318160ddd6000604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b1515610c5157600080fd5b6102c65a03f11515610c6257600080fd5b505050604051805190506116b2565b610ef8610ee030600160a060020a0316316116b2565b600554608060020a90046001608060020a0316610f05565b61090d565b90505b919050565b6000610f118383612284565b90505b92915050565b600a54600160a060020a031681565b60005433600160a060020a03908116620100009092041614610f4a57600080fd5b6000805476ff00000000000000000000000000000000000000000000191660b060020a1790555b5b565b60088054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561100a5780601f10610fdf5761010080835404028352916020019161100a565b820191906000526020600020905b815481529060010190602001808311610fed57829003601f168201915b505050505081565b6000610f1183836122a7565b90505b92915050565b60006109dc33611036346116b2565b60006116cb565b90505b90565b6000610b74826109d5346116b2565b60026116cb565b90505b919050565b60008030600160a060020a0316311115610c7d57600954610c76906110e590600160a060020a03166318160ddd6000604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b1515610c5157600080fd5b6102c65a03f11515610c6257600080fd5b505050604051805190506116b2565b610c7130600160a060020a0316316116b2565b61165f565b90506109df565b5060006109df565b5b90565b6000610f11670de0b6b3a76400006002815b046001608060020a0316846001608060020a0316866001608060020a0316020181151561114b57fe5b046116b2565b90505b92915050565b60065481565b6000610b7482611036346116b2565b60006116cb565b90505b919050565b600254600160a060020a031681565b600d602052816000526040600020818154811015156111a857fe5b906000526020600020906003020160005b50805460018201546002909201546001608060020a039091169350600160a060020a038216925060a060020a90910460ff169084565b600154600160a060020a031681565b60005433600160a060020a0390811662010000909204161461121f57600080fd5b6000805475ffffffffffffffffffffffffffffffffffffffff0000191662010000600160a060020a038416021790555b5b50565b6005546000906109dc906001608060020a0316610dea565b90505b90565b600b54608060020a90046001608060020a031681565b60035481565b611295612abc565b60015433600160a060020a039081169116146112b057600080fd5b6000838152600d60205260408120805490919081106112cb57fe5b906000526020600020906003020160005b506080604051908101604090815282546001608060020a031682526001830154600160a060020a03811660208401529192919083019060a060020a900460ff16600381111561132757fe5b600381111561133257fe5b81526002919091015460209091015290506001608060020a0382161580611362575060005460b060020a900460ff165b1561137a576005546001608060020a03169150611478565b600954600090600160a060020a03166318160ddd82604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b15156113c457600080fd5b6102c65a03f115156113d557600080fd5b5050506040518051905011801561144e5750600a54600090600160a060020a03166318160ddd82604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b151561143157600080fd5b6102c65a03f1151561144257600080fd5b50505060405180519050115b1561147857600580546fffffffffffffffffffffffffffffffff19166001608060020a0384161790555b5b8060400151600381111561148957fe5b60005b141561149d5761149d8184846122ca565b5b806040015160038111156114ae57fe5b60015b14156114c2576114c28184846119c7565b5b806040015160038111156114d357fe5b60025b14156114e7576114e78184846125aa565b5b806040015160038111156114f857fe5b60035b141561150c5761150c818484611f96565b5b60078390556000838152600d6020526040812061152991612ae7565b5b5b505050565b600a546000906109dc906115a290600160a060020a03166318160ddd84604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b1515610c5157600080fd5b6102c65a03f11515610c6257600080fd5b505050604051805190506116b2565b6115b530600160a060020a0316316116b2565b6115c6565b90505b90565b60045481565b600b5460009081906115f5906115ef906001608060020a0380821691608060020a900416611012565b85611110565b90506116018382612888565b15611617576116108184610f05565b915061161c565b600091505b5b5092915050565b600554608060020a90046001608060020a031681565b600b546001608060020a031681565b6001608060020a03808216908316115b92915050565b6000610f116001608060020a0383166002815b046001608060020a0316670de0b6b3a76400006001608060020a0316866001608060020a0316020181151561114b57fe5b046116b2565b90505b92915050565b806001608060020a0381168114610b7757fe5b5b919050565b600080600080600354421180156116f35750600254600154600160a060020a03908116911614155b1561170057611700612232565b5b600054610100900460ff16156119b85760005460b060020a900460ff1615156119b85761172d8761289d565b151561173857600080fd5b600c546117bb906117539088906001608060020a0316611110565b600154600160a060020a031663fd557d396000604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b151561179b57600080fd5b6102c65a03f115156117ac57600080fd5b505050604051805190506128a9565b91506117c78683612888565b156117d157600080fd5b6006805460019081019182905554600160a060020a03169063cd7c92e3906001608060020a0385169060006040516020015260405160e060020a63ffffffff851602815260048101919091526024016020604051808303818588803b151561183857600080fd5b6125ee5a03f1151561184957600080fd5b505050506040518051905090506118608683610f05565b6006546000908152600d60205260409020805491945090600181016118858382612b0c565b916000526020600020906003020160005b608060405190810160405280876001608060020a031681526020018b600160a060020a031681526020018960038111156118cc57fe5b8152602001859052919050815181546fffffffffffffffffffffffffffffffff19166001608060020a0391909116178155602082015160018201805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055604082015160018201805474ff0000000000000000000000000000000000000000191660a060020a83600381111561196557fe5b021790555060608201516002909101555050600554611995906001608060020a03608060020a9091041684611012565b600580546001608060020a03928316608060020a02921691909117905560065493505b5b5b5b5b5b5050509392505050565b60006119d1612b3e565b600a54600160a060020a03166318160ddd6000604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b1515611a1957600080fd5b6102c65a03f11515611a2a57600080fd5b505050604051805115159050611a49576005546001608060020a031692505b611a5485518461165f565b600954909250600160a060020a0316633188da5f6020870151875160006040516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526001608060020a03166024820152604401602060405180830381600087803b1515611ac457600080fd5b6102c65a03f11515611ad557600080fd5b5050506040518051905015611cc1578460200151600160a060020a03167f6fd7c035b051359dd43c2afdd6a7cd91e94ff855b47178226114ae6ad62019158651868660405180846001608060020a03166001608060020a03168152602001838152602001826001608060020a03168152602001935050505060405180910390a2611b71611b6b30600160a060020a0316316116b2565b83612888565b15611b8c57611b8930600160a060020a0316316116b2565b91505b611ba4856020015182846001608060020a03166128be565b15611bae57611ca8565b600954600160a060020a031663ec1553d16020870151875160006040516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526001608060020a03166024820152604401602060405180830381600087803b1515611c1b57600080fd5b6102c65a03f11515611c2c57600080fd5b505050604051805150506020850151600160a060020a03167fb0acd745b723702a9bfc3ecc8b4646c5ac97f4e1e23159ef5d4f1d9e4a5bc20d8651868660405180846001608060020a03166001608060020a03168152602001838152602001826001608060020a03168152602001935050505060405180910390a25b600160a060020a033016311515611cc157611cc161296a565b5b5b5b5050505050565b60008060008060035442118015611cf35750600254600154600160a060020a03908116911614155b15611d0057611d00612232565b5b611d0a8661289d565b1515611d1557600080fd5b600154600160a060020a031663fd557d396000604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b1515611d5d57600080fd5b6102c65a03f11515611d6e57600080fd5b505050604051805190509150611d848783612888565b15611d8e57600080fd5b611d988783610f05565b92505b6001608060020a0388161515611db057600080fd5b6006805460019081019182905554600160a060020a03169063cd7c92e3906001608060020a0385169060006040516020015260405160e060020a63ffffffff851602815260048101919091526024016020604051808303818588803b1515611e1757600080fd5b6125ee5a03f11515611e2857600080fd5b5050505060405180516006546000908152600d602052604090208054919350915060018101611e578382612b0c565b916000526020600020906003020160005b6080604051908101604052808c6001608060020a031681526020018a600160a060020a03168152602001896003811115611e9e57fe5b8152602001859052919050815181546fffffffffffffffffffffffffffffffff19166001608060020a0391909116178155602082015160018201805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055604082015160018201805474ff0000000000000000000000000000000000000000191660a060020a836003811115611f3757fe5b0217905550606082015160029091015550506006549350600160a060020a0386166001608060020a03841680156108fc0290604051600060405180830381858888f193505050501515611f8957600080fd5b5b5b505050949350505050565b600080611fa1612b3e565b611faa84610dea565b91506000826001608060020a0316111561222657611fd2611fcc875184611110565b8561165f565b600a54909350600160a060020a0316633188da5f6020880151885160006040516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526001608060020a03166024820152604401602060405180830381600087803b151561204257600080fd5b6102c65a03f1151561205357600080fd5b5050506040518051905015612226578560200151600160a060020a03167f2bf29ddb760902da82c4a7d4c99ea87ebe386522729cd506a4132616a2d31d498751878760405180846001608060020a03166001608060020a03168152602001838152602001826001608060020a03168152602001935050505060405180910390a26120ef6120e930600160a060020a0316316116b2565b84612888565b1561210a5761210730600160a060020a0316316116b2565b92505b612122866020015182856001608060020a03166128be565b1561212c57612226565b600a54600160a060020a031663ec1553d16020880151885160006040516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526001608060020a03166024820152604401602060405180830381600087803b151561219957600080fd5b6102c65a03f115156121aa57600080fd5b505050604051805150506020860151600160a060020a03167f4767d305988b74d0d1c7ee0df66fa1609b9c4602fda0a1bf8a62525e4a8712878751878760405180846001608060020a03166001608060020a03168152602001838152602001826001608060020a03168152602001935050505060405180910390a25b5b5b5b5b505050505050565b6002546001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a039092169190911790556000805476ff00000000000000000000000000000000000000000000191690555b565b8082036001608060020a038084169082161115610f1457600080fd5b5b92915050565b8082016001608060020a038084169082161015610f1457600080fd5b5b92915050565b6000806000806122d8612b3e565b6122e186610dea565b600a549095506123879061235490600160a060020a03166318160ddd6000604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b1515610c5157600080fd5b6102c65a03f11515610c6257600080fd5b505050604051805190506116b2565b6115b5610ee030600160a060020a0316316116b2565b600554608060020a90046001608060020a0316610f05565b6115c6565b9150612394885183612888565b156123a65787519250600093506123ba565b8192506123b7886000015183610f05565b93505b6001608060020a03851615156123cf57875193505b6000856001608060020a03161180156123f157506000826001608060020a0316115b1561253a57600954600160a060020a031663ec1553d160208a0151612416868a611110565b6001608060020a031660006040516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b151561246b57600080fd5b6102c65a03f1151561247c57600080fd5b505050604051805150506020880151600160a060020a03167fb0acd745b723702a9bfc3ecc8b4646c5ac97f4e1e23159ef5d4f1d9e4a5bc20d6124bf8589611110565b898960405180846001608060020a03166001608060020a03168152602001838152602001826001608060020a03168152602001935050505060405180910390a260055461251c90608060020a90046001608060020a031684610f05565b600580546001608060020a03928316608060020a0292169190911790555b6000846001608060020a0316111561259f57612564886020015182866001608060020a0316612a60565b60055461258190608060020a90046001608060020a031685610f05565b600580546001608060020a03928316608060020a0292169190911790555b5b5050505050505050565b6000806125b5612b3e565b6125e36125cb30600160a060020a0316316116b2565b600554608060020a90046001608060020a0316612888565b156125f15760009250612705565b600954612702908590610e5e90600160a060020a03166318160ddd6000604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b1515610c5157600080fd5b6102c65a03f11515610c6257600080fd5b505050604051805190506116b2565b600a54610eca90600160a060020a03166318160ddd6000604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b1515610c5157600080fd5b6102c65a03f11515610c6257600080fd5b505050604051805190506116b2565b610ef8610ee030600160a060020a0316316116b2565b600554608060020a90046001608060020a0316610f05565b61090d565b92505b6000836001608060020a0316111561282a5761272b61097d875186611110565b8461165f565b600a54909250600160a060020a031663ec1553d16020880151846001608060020a031660006040516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b151561279a57600080fd5b6102c65a03f115156127ab57600080fd5b505050604051805150506020860151600160a060020a03167f4767d305988b74d0d1c7ee0df66fa1609b9c4602fda0a1bf8a62525e4a87128783878760405180846001608060020a03166001608060020a03168152602001838152602001826001608060020a03168152602001935050505060405180910390a2612843565b61284386602001518288516001608060020a0316612a60565b5b60055461286290608060020a90046001608060020a03168751610f05565b600580546001608060020a03928316608060020a0292169190911790555b505050505050565b6000610f118383612a79565b90505b92915050565b803b8015905b50919050565b6000610f118383612a8f565b90505b92915050565b6000805460ff16156128cc57fe5b6000805460ff19166001179055600160a060020a038416828460405180828051906020019080838360005b838110156129105780820151818401525b6020016128f7565b50505050905090810190601f16801561293d5780820380516001836020036101000a031916815260200191505b5091505060006040518083038185876187965a03f193505050505b6000805460ff191690555b9392505050565b7f1e8b0d0312f1460e51ac6b837afad37961ea4017b27d965346bda0e1df6c78c260405160405180910390a1600954600160a060020a03166341c0e1b56040518163ffffffff1660e060020a028152600401600060405180830381600087803b15156129d557600080fd5b6102c65a03f115156129e657600080fd5b5050600a54600160a060020a031690506341c0e1b56040518163ffffffff1660e060020a028152600401600060405180830381600087803b1515612a2957600080fd5b6102c65a03f11515612a3a57600080fd5b50506000805476ff0000000000000000000000000000000000000000ff0019169055505b565b612a6b8383836128be565b151561152957fe5b5b505050565b6001608060020a03808216908316105b92915050565b6000816001608060020a0316836001608060020a03161015612ab15781610f11565b825b90505b92915050565b60806040519081016040908152600080835260208301819052908201905b8152600060209091015290565b5080546000825560030290600052602060002090810190610a7f9190612b50565b5b50565b815481835581811511611529576003028160030283600052602060002091820191016115299190612b50565b5b505050565b60206040519081016040526000815290565b6109df91905b80821115612ba45780546fffffffffffffffffffffffffffffffff1916815560018101805474ffffffffffffffffffffffffffffffffffffffffff1916905560006002820155600301612b56565b5090565b905600a165627a7a72305820a52654792a417bc00b891c054b85980aae6520c677cb8c0bcdab9de49f4ace740029000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000014d1120d7b160000000000000000000000000000000000000000000000000000000000000000000d455448555344204d696e74657200000000000000000000000000000000000000

   Swarm Source:
bzzr://a52654792a417bc00b891c054b85980aae6520c677cb8c0bcdab9de49f4ace74

 

View All
Block Age txn Difficulty GasUsed Reward
View All
Block Age UncleNumber Difficulty GasUsed Reward
Make sure to use the "downvote" button for any spammy posts, and the "upvote" for interesting conversations.