# Past Transaction

Your task is to guessSecret() with the proper key.

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.11;

contract PastTransaction {
    bool public ready;
    bool public solved;

    constructor(address _player) payable {
        _player;
    }

    function checkSecret(string memory _key) public returns (bool) {
        return keccak256(abi.encodePacked(_key))
            == 0xe452a6335b77e47ddc116100975277257bf724630637f0fe578c0bd2638184a0;
    }

    function findThisCall(string memory _key) external {
        require(checkSecret(_key));
        ready = true;
    }

    function guessSecret(string memory _key) external {
        require(checkSecret(_key));
        solved = true;
    }
}

You realized that it's likely impossible to revert the hash, but you know what? the blockchain records the entire history and we know findThisCall() was invoked during the creation of this instance.

contract PastTransactionFactory is Level {
    PastTransaction private instance;

    function createInstance(address _player) override public payable returns (address) {
        instance = new PastTransaction(_player);
        instance.findThisCall("<REDACTED>");
        return address(instance);
    }
    ...
}

You might want to find the argument of findThisCall() recorded in the past transaction.

TIP

geth provides a way to trace a transaction via the debug_traceTransaction (opens new window) RPC call. You might want to search the CALL (opens new window) instruction!