Skip to content
Verified contractPartial

KrakenPriceTicker

Address0x76fb95301a2e6e84845bdaf1ab4abb9f01d8fa5b
Balance

0 ETH

 

Transactions

2

 

Compiler

solc 0.1.7

 

Same code

Only this contract

 

Details

Compiler
solc 0.1.7+commit.b4e666cc
Language
solidity
Optimization
Yes, 200 runs
License
Not stated
Match
Partialcreation code: yes, runtime code: yes
Verified on Sourcify
Created in block
574,632
Creation transaction
0xee04fba8fa…d296441a7e

KrakenPriceTicker.sol

// Recovered by EthereumHistory (ethereumhistory.com) -sw
contract OraclizeI {
    address public cbAddress;
    function query(uint _timestamp, string _datasource, string _arg) returns (bytes32 _id);
    function query_withGasLimit(uint _timestamp, string _datasource, string _arg, uint _gaslimit) returns (bytes32 _id);
    function getPrice(string _datasource) returns (uint _dsprice);
    function getPrice(string _datasource, uint gaslimit) returns (uint _dsprice);
    function useCoupon(string _coupon);
    function setProofType(byte _proofType);
}

contract OraclizeAddrResolverI {
    function getAddress() returns (address _addr);
}

contract usingOraclize {
    OraclizeI oraclize;

    modifier oraclizeAPI {
        OraclizeAddrResolverI OAR = OraclizeAddrResolverI(0x1d11e5eae3112dbd44f99266872ff1d07c77dce8);
        oraclize = OraclizeI(OAR.getAddress());
        _
    }

    modifier coupon(string code) {
        OraclizeAddrResolverI OAR = OraclizeAddrResolverI(0x1d11e5eae3112dbd44f99266872ff1d07c77dce8);
        oraclize = OraclizeI(OAR.getAddress());
        oraclize.useCoupon(code);
        _
    }

    function oraclize_query(uint timestamp, string datasource, string arg, uint gaslimit) oraclizeAPI internal returns (bytes32 id) {
        return oraclize.query_withGasLimit.value(oraclize.getPrice(datasource, gaslimit))(timestamp, datasource, arg, gaslimit);
    }

    function oraclize_cbAddress() oraclizeAPI internal returns (address) {
        return oraclize.cbAddress();
    }

    function oraclize_setProof(byte proofP) oraclizeAPI {
        return oraclize.setProofType(proofP);
    }
}

contract KrakenPriceTicker is usingOraclize {
    address owner;
    string public ETHXBT;
    uint n = 0;

    function KrakenPriceTicker() {
        owner = msg.sender;
        update();
    }

    function __callback(bytes32 myid, string result) {
        if (msg.sender != oraclize_cbAddress()) throw;
        ETHXBT = result;
    }

    function update() coupon("DEVCON1") {
        oraclize_query(0, "URL", "json(https://api.kraken.com/0/public/Ticker?pair=ETHXBT).result.XETHXXBT.c.0", 500000);
    }
    function kill() {
        if (msg.sender == owner) suicide(msg.sender);
    }

}
Compiler settingsShow
{
  "optimizer": {
    "runs": 200,
    "enabled": true
  }
}

Source code and metadata: Sourcify.

The source code belongs to the authors of the contract.