Skip to content
Verified contractPartial

Matcher

Address0x13737dcd1de32ad22d43d01d98e7849b737122fc
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
505,160
Creation transaction
0x5c81acb361…f05eab88ae

Matcher.sol

// Recovered by EthereumHistory (ethereumhistory.com) -sw
contract Matcher {
    bool public _match;

    event Log_uint(uint u);

    function() {
        uint len;
        byte[32] memory a;
        byte[32] memory b;
        byte y;
        uint z;
        uint i;
        uint j;
        byte[64] memory c;
        Log_uint(uint(msg.data[1]));
        Log_uint(0);
        len = uint(msg.data[0]);
        y = 1;
        z = 0;
        Log_uint(1);
        if (false) {} // ours: a no-op that ends the optimizer block here (the original had some statement with this effect)
        for (i = 0; i < 32; i++) {
            a[i] = msg.data[i + 1];
            b[i] = msg.data[i + 1];
        }
        Log_uint(2);
        for (j = 0; j < len; j++) {
            Log_uint(j + 200);
            if (msg.data[(j + 1) * 33] == y) {
                Log_uint(50);
                for (i = 0; i < 64; i++) {
                    if (i < 32) c[i] = a[i];
                    else c[i] = b[i - 32];
                }
                Log_uint(60);
                b = bytes32_to_bytes(sha256(sha256(c)));
                Log_uint(70);
                for (i = 0; i < 32; i++)
                    a[i] = msg.data[(j + 1) * 33 + i];
            } else {
                Log_uint(51);
                for (i = 0; i < 64; i++) {
                    if (i < 32) c[i] = b[i];
                    else c[i] = a[i - 32];
                }
                Log_uint(60);
                a = bytes32_to_bytes(sha256(sha256(c)));
                Log_uint(70);
                for (i = 0; i < 32; i++)
                    b[i] = msg.data[(j + 1) * 33 + i];
            }
        }
        for (i = 0; i < 32; i++)
            if (a[i] != msg.data[len * 33 + i]) {
                Log_uint(99);
                return;
            }
        _match = true;
        Log_uint(100);
    }

    function bytes32_to_bytes(bytes32 b) returns (byte[32] s) {
        for (uint i = 0; i < 32; i++) {
            s[31 - i] = byte(uint(b) / (2 ** (8 * i)));
        }
    }
}
Compiler settingsShow
{
  "optimizer": {
    "runs": 200,
    "enabled": true
  }
}

Source code and metadata: Sourcify.

The source code belongs to the authors of the contract.