Skip to content
Verified contractPartial

Obama

Address0x09f0579143a5503dacbcb4845ef0bed9706f969a
Balance

0 ETH

 

Transactions

3

 

Compiler

solc 0.1.6

 

Same code

Only this contract

 

Details

Compiler
solc 0.1.6+commit.d41f8b7c
Language
solidity
Optimization
No
License
Not stated
Match
Partialcreation code: yes, runtime code: yes
Verified on Sourcify
Created in block
422,423
Creation transaction
0x1463d245ea…c983b8bcd3

Obama.sol

// Recovered by EthereumHistory (ethereumhistory.com) -sw
contract OraclizeI {
    function query(uint timestamp, string datasource, string arg) returns (bytes32 id);
}

contract Obama {
    bool isPresident = false;

    function() {
        if (msg.sender == address(0xd4cb3eb955e03ac64644678fd3d6a7f3104ee70d)) callback();
    }

    function indexOf(string _haystack, string _needle) returns (int)
    {
    	bytes memory h = bytes(_haystack);
    	bytes memory n = bytes(_needle);
    	if(h.length < 1 || n.length < 1 || (n.length > h.length)) 
    		return -1;
    	else if(h.length > (2**128 -1))
    		return -1;									
    	else
    	{
    		uint subindex = 0;
    		for (uint i = 0; i < h.length; i ++)
    		{
    			if (h[i] == n[0])
    			{
    				subindex = 1;
    				while(subindex < n.length && (i + subindex) < h.length && h[i + subindex] == n[subindex])
    				{
    					subindex++;
    				}	
    				if(subindex == n.length)
    					return int(i);
    			}
    		}
    		return -1;
    	}	
    }

    function main() {
        OraclizeI oraclize = OraclizeI(0xd4cb3eb955e03ac64644678fd3d6a7f3104ee70d);
        oraclize.query(0, "WolframAlpha", "president of the United States");
    }

    function callback() {
        if (indexOf(string(msg.data), "Obama") > -1) isPresident = true;
    }
}
Compiler settingsShow
{
  "optimizer": {
    "runs": 200,
    "enabled": false
  }
}

Source code and metadata: Sourcify.

The source code belongs to the authors of the contract.