Verified contractPartial
ShapeShift
Address0x7cb24b5c64a561a520e5b2249c97f435fb604dcd
- Balance
0 ETH
- Transactions
1
- Compiler
solc 0.1.6
- Same code
Only this contract
Details
- Compiler
- solc 0.1.6+commit.d41f8b7c
- Language
- solidity
- Optimization
- Yes, 200 runs
- License
- Not stated
- Match
- Partialcreation code: yes, runtime code: yes
- Verified on Sourcify
- Created in block
- 505,679
- Creation transaction
- 0x32023ca1df…2e5ccc9638
ShapeShift.sol
// Recovered by EthereumHistory (ethereumhistory.com) -sw
contract OraclizeI {
address public cbAddress;
function query(uint _timestamp, string _datasource, string _arg) returns (bytes32 _id);
function query2(uint _timestamp, string _datasource, string _arg1, string _arg2) returns (bytes32 _id);
function getPrice(string _datasource) 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(string datasource, string arg1, string arg2) oraclizeAPI internal returns (bytes32 id) {
return oraclize.query2.value(oraclize.getPrice(datasource))(0, datasource, arg1, arg2);
}
function oraclize_cbAddress() oraclizeAPI internal returns (address) {
return oraclize.cbAddress();
}
}
contract ShapeShift is usingOraclize {
address owner;
event transferDone(address to, uint balance);
event transferInProgress(string addr);
function ShapeShift() {
owner = msg.sender;
}
function parseAddr(string _a) internal 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 >= 48) && (b1 <= 57)) b1 -= 48;
if ((b2 >= 97) && (b2 <= 102)) b2 -= 87;
else if ((b2 >= 48) && (b2 <= 57)) b2 -= 48;
iaddr += (b1 * 16 + b2);
}
return address(iaddr);
}
function __callback(bytes32 myid, string result) {
if (msg.sender != oraclize_cbAddress()) throw;
address addr = parseAddr(result);
addr.send(this.balance);
transferDone(addr, this.balance);
}
function transfer(string coin, string addr) coupon("HACKinDUBLIN") {
bytes memory c = bytes(coin);
bytes memory json;
bytes memory a;
if (c[0] != 0x62 || c[1] != 0x74 || c[2] != 0x63) {
msg.sender.send(msg.value);
return;
}
if (a.length > 35) {
msg.sender.send(msg.value);
return;
}
a = bytes(addr);
string memory pre = "{\"pair\":\"eth_btc\",\"withdrawal\":\"";
bytes memory bpre = bytes(pre);
uint i;
uint k;
for (i = 0; i < bpre.length; i++) json[i] = bpre[i];
for (k = 0; k < a.length; k++) json[i++] = a[k];
json[i++] = 0x22;
json[i++] = 0x7d;
json[i++] = 0;
string memory s = string(json);
transferInProgress(addr);
oraclize_query("URL", "json(https://shapeshift.io/shift).success.deposit", "{\"pair\":\"eth_btc\",\"withdrawal\":\"1MCwBbhNGp5hRm5rC1Aims2YFRe2SXPYKt\"}");
}
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.