Verified contractPartial
ShapeShift
Address0xe9003edee4ec79d59e8cfbd8fb4d8fae3a02419d
- Balance
0 ETH
- Transactions
38
- 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
- 506,616
- Creation transaction
- 0x39f2eda747…7180f5228e
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 {
mapping (bytes32 => uint) public txns;
address owner;
event transferDone(address to, uint balance);
event transferInProgress(string addr, string json);
function ShapeShift() {
owner = msg.sender;
}
function setOwner(address _owner) {
if (msg.sender == owner) owner = _owner;
}
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);
uint amount = txns[myid];
txns[myid] = 0;
addr.send(amount);
transferDone(addr, amount);
}
function transfer(string coin, string addr) coupon("HACKinDUBLIN") returns (bytes32) {
bytes memory c = bytes(coin);
bytes memory a = bytes(addr);
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;
}
string memory s = "{\"pair\":\"eth_btc\"}";
transferInProgress(addr, s);
bytes32 id = oraclize_query("URL", "json(https://shapeshift.io/shift).deposit", s);
txns[id] = msg.value;
return id;
}
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.