<commit_before>/**
* This contract will call some arbitrary contract's methods
* if and only if the signer has signed off on the order to
**/

contract SignatureProxy {
    address signer;
    // Destination is the address of the contract that method calls are sent to
    address destination;
    
    // Ensures that the signer has signed all the hashes
    modifier onlySigner(
        bytes32[] hashes, 
        uint8[] v, 
        bytes32[] r, 
        bytes32[] s
    ) {
        if (hashes.length != v.length || v.length != r.length || v.length != s.length) throw;
        for (uint i = hashes.length - 1; i >= 0; --i) {
            if (ecrecover(hashes[i], v[i], r[i], s[i]) != signer) throw;
        }
        _
    }
    
    function SignatureProxy(address _signer, address _destination) {
        signer = _signer;
        destination = _destination;
    }
    
    // Returns true upon success and false upon failure
    function forward(
        bytes32[] hashes, 
        uint8[] v, 
        bytes32[] r, 
        bytes32[] s,
        string methodSignature,
        bytes32[] callData
    )
    onlySigner(hashes, v, r, s) returns (bool) {
        return destination.call(bytes4(sha3(methodSignature)), callData);
    }
}<commit_msg>figured out what my hashes meant<commit_after>/**
* This contract will call some arbitrary contract's methods
* if and only if the signer has signed off on the order to
**/

contract SignatureProxy {
    address signer;
    // Destination is the address of the contract that method calls are sent to
    address destination;
    
    // Ensures that the signer has signed all the hashes
    modifier onlySigner(
        bytes32[] hashes, 
        uint8[] v, 
        bytes32[] r, 
        bytes32[] s
    ) {
        if (hashes.length != v.length || v.length != r.length || v.length != s.length) throw;
        for (uint i = hashes.length - 1; i >= 0; --i) {
            if (ecrecover(hashes[i], v[i], r[i], s[i]) != signer) throw;
        }
        _
    }
    
    function SignatureProxy(address _signer, address _destination) {
        signer = _signer;
        destination = _destination;
    }
    
    // Returns true upon success and false upon failure
    function forward(
        // hashes are the method signatures
        bytes32[] hashes, 
        uint8[] v, 
        bytes32[] r, 
        bytes32[] s,
        bytes32[] callData
    )
    onlySigner(hashes, v, r, s) returns (bool) {
        uint length = hashes.length;
        for (uint i = 0; i < length; ++i) {
                if (destination.call(bytes4(hashes[i]), callData)) {
                return false;
            }
        }
        return true;
    }
}
{'fraction_non_alphanumeric': 0.10485074626865672, 'fraction_numerical': 0.014925373134328358, 'mean_word_length': 1.9921875, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '747516', 'n_tokens_mistral': 829, 'n_tokens_neox': 787, 'n_words': 268}