Skip to content
Verified contractPartial

StopLoss

Address0xdb292b3df18d09a9aa2c456eb2d9dd24847db73c
Balance

0 ETH

 

Transactions

2

 

Compiler

solc 0.1.6

 

Same code

1 more contract

 

Details

Compiler
solc 0.1.6+commit.d41f8b7c
Language
solidity
Optimization
No
License
Not stated
Match
Partialcreation code: no, runtime code: yes
Verified on Sourcify
Created in block
433,387
Creation transaction
0xc31c5c4d49…852c64236f

StopLoss.sol

// Submitted by EthereumHistory (ethereumhistory.com)
contract OraclizeI {
    function query(uint _timestamp, string _datasource, string _arg1, string _arg2) returns (bytes32 _id);
    function getPrice(string _datasource) returns (uint _dsprice);
    function cb_address() returns (address _cbAddress);
}
contract OraclizeAddrResolverI {
    function getAddress() returns (address _addr);
}
contract usingOraclize {
    address OAR = 0x1d11e5eae3112dbd44f99266872ff1d07c77dce8;
    OraclizeI oraclize = OraclizeI(OraclizeAddrResolverI(OAR).getAddress());
}

contract StopLoss is usingOraclize {
    address public shapeshift_address;

    function StopLoss() {
    }

    function __callback(bytes32 myid, string result) {
        if (msg.sender != oraclize.cb_address()) throw;
        bytes memory tmp = bytes(result);
        uint160 ishapeshift = 0;
        uint160 b1;
        uint160 b2;
        for (uint i=2; i<2+2*20; i+=2){
            ishapeshift *= 256;
            b1 = uint160(tmp[i]);
            b2 = uint160(tmp[i+1]);
            if ((b1 >= 97)&&(b1 <= 102)) b1 -= 87;
            else if ((b1 >= 48)&&(b1 <= 57)) b1 -= 48;
            if ((b2 >= 97)&&(b2 <= 102)) b2 -= 87;
            else if ((b2 >= 48)&&(b2 <= 57)) b2 -= 48;
            ishapeshift += (b1*16+b2);
        }
        shapeshift_address = address(ishapeshift);
    }

    function update() {
        oraclize.query(0, "URL", "json(https://shapeshift.io/sendamount).success.deposit", '{"pair": "eth_btc", "amount": "0.2", "withdrawal": "1AAcCo21EUc1jbocjssSQDzLna9Vem2UN5"}');
    }

    function kill(){
        suicide(msg.sender);
    }
}
Compiler settingsShow
{
  "libraries": {},
  "optimizer": {
    "runs": 200,
    "enabled": false
  }
}

Source code and metadata: Sourcify.

The source code belongs to the authors of the contract.