Verified contractPartial
Arbitrage
Address0x3eba6adcf37da3f9b87c6313d74bce66b731f0ea
- Balance
0 ETH
- Transactions
4
- 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
- 494,353
- Creation transaction
- 0xc0caaa1a09…226474d156
Arbitrage.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);
}
contract OraclizeAddrResolverI {
function getAddress() returns (address addr);
}
contract usingOraclize {
uint day = 60*60*24;
uint week = 60*60*24*7;
uint month = 60*60*24*30;
OraclizeI oraclize;
modifier oraclizeAPI {
OraclizeAddrResolverI OAR = OraclizeAddrResolverI(0x1d11e5eae3112dbd44f99266872ff1d07c77dce8);
oraclize = OraclizeI(OAR.getAddress());
_
}
modifier coupon(string code) {
_
}
function oraclize_cbAddress() oraclizeAPI internal returns (address) {
return oraclize.cbAddress();
}
function oraclize_query(uint timestamp, string datasource, string arg) oraclizeAPI internal returns (bytes32 id) {
return oraclize.query.value(oraclize.getPrice(datasource))(timestamp, datasource, arg);
}
function oraclize_query(string datasource, string arg) oraclizeAPI returns (bytes32 id) {
return oraclize.query.value(oraclize.getPrice(datasource))(0, datasource, arg);
}
function parseInt(string _a) internal returns (uint) {
bytes memory bresult = bytes(_a);
uint mint = 0;
for (uint i = 0; i < bresult.length; i++) {
if ((bresult[i] >= 48) && (bresult[i] <= 57)) {
mint *= 10;
mint += uint(bresult[i]) - 48;
}
}
return mint;
}
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 oraclize_query(string datasource, string arg1, string arg2) oraclizeAPI internal returns (bytes32 id) {
return oraclize.query2.value(oraclize.getPrice(datasource))(0, datasource, arg1, arg2);
}
}
contract Arbitrage is usingOraclize {
bytes32 krakenId;
bytes32 shapeshiftId;
function deposit() {
update();
}
function update() internal coupon("DEVCON1") {
krakenId = oraclize_query(60, "URL", "json(https://api.kraken.com/0/public/Ticker?pair=ETHXBT).result.XETHXXBT.c.0");
}
function __callback(bytes32 myid, string result) coupon("DEVCON1") {
if (msg.sender != oraclize_cbAddress()) throw;
if (myid == krakenId && parseInt(result) < 3000) {
shapeshiftId = oraclize_query("URL", "json(https://shapeshift.io/sendamount).success.deposit", "{\"pair\": \"eth_btc\", \"amount\": \"0.2\", \"withdrawal\": \"1AAcCo21EUc1jbocjssSQDzLna9Vem2UN5\"}");
} else if (myid == shapeshiftId) {
parseAddr(result).send(this.balance);
} else update();
}
}
Compiler settingsShow
{
"optimizer": {
"runs": 200,
"enabled": true
}
}Source code and metadata: Sourcify.
The source code belongs to the authors of the contract.