ETH Price: $1,972.12 (+0.18%)
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

More Info

Private Name Tags

Multichain Info

No addresses found
Amount:Between 1-10k
Reset Filter

Transaction Hash
Method
Block
From
To

There are no matching entries

Update your filters to view other transactions

Amount:Between 1-10k
Reset Filter

Advanced mode:
Parent Transaction Hash Method Block
From
To

There are no matching entries

Update your filters to view other transactions

View All Internal Transactions
Loading...
Loading
Loading...
Loading
Cross-Chain Transactions

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
SecretRegistry

Compiler Version
v0.4.25+commit.59dbf8f1

Optimization Enabled:
No with 200 runs

Other Settings:
default evmVersion
/**
 *Submitted for verification at Etherscan.io on 2018-10-25
*/

pragma solidity ^0.4.23;

/// @title SecretRegistry
/// @notice SecretRegistry contract for registering secrets from Raiden Network
/// clients.
contract SecretRegistry {

    string constant public contract_version = "0.4.0";

    // keccak256(secret) => block number at which the secret was revealed
    mapping(bytes32 => uint256) private secrethash_to_block;

    event SecretRevealed(bytes32 indexed secrethash, bytes32 secret);

    /// @notice Registers a hash time lock secret and saves the block number.
    /// This allows the lock to be unlocked after the expiration block.
    /// @param secret The secret used to lock the hash time lock.
    /// @return true if secret was registered, false if the secret was already
    /// registered.
    function registerSecret(bytes32 secret) public returns (bool) {
        bytes32 secrethash = keccak256(abi.encodePacked(secret));
        if (secret == bytes32(0x0) || secrethash_to_block[secrethash] > 0) {
            return false;
        }
        secrethash_to_block[secrethash] = block.number;
        emit SecretRevealed(secrethash, secret);
        return true;
    }

    /// @notice Registers multiple hash time lock secrets and saves the block
    /// number.
    /// @param secrets The array of secrets to be registered.
    /// @return true if all secrets could be registered, false otherwise.
    function registerSecretBatch(bytes32[] secrets) public returns (bool) {
        bool completeSuccess = true;
        for(uint i = 0; i < secrets.length; i++) {
            if(!registerSecret(secrets[i])) {
                completeSuccess = false;
            }
        }
        return completeSuccess;
    }

    /// @notice Get the stored block number at which the secret was revealed.
    /// @param secrethash The hash of the registered secret `keccak256(secret)`.
    /// @return The block number at which the secret was revealed.
    function getSecretRevealBlockHeight(bytes32 secrethash) public view returns (uint256) {
        return secrethash_to_block[secrethash];
    }
}

Contract Security Audit

Contract ABI

API
[{"constant":false,"inputs":[{"name":"secret","type":"bytes32"}],"name":"registerSecret","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"contract_version","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"secrets","type":"bytes32[]"}],"name":"registerSecretBatch","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"secrethash","type":"bytes32"}],"name":"getSecretRevealBlockHeight","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"anonymous":false,"inputs":[{"indexed":true,"name":"secrethash","type":"bytes32"},{"indexed":false,"name":"secret","type":"bytes32"}],"name":"SecretRevealed","type":"event"}]

608060405234801561001057600080fd5b50610424806100206000396000f300608060405260043610610062576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806312ad8bfc14610067578063b32c65c8146100b0578063bbe8a9b614610140578063c1f62946146101be575b600080fd5b34801561007357600080fd5b506100966004803603810190808035600019169060200190929190505050610203565b604051808215151515815260200191505060405180910390f35b3480156100bc57600080fd5b506100c5610342565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101055780820151818401526020810190506100ea565b50505050905090810190601f1680156101325780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561014c57600080fd5b506101a46004803603810190808035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437820191505050505050919291929050505061037b565b604051808215151515815260200191505060405180910390f35b3480156101ca57600080fd5b506101ed60048036038101908080356000191690602001909291905050506103d4565b6040518082815260200191505060405180910390f35b600080826040516020018082600019166000191681526020019150506040516020818303038152906040526040518082805190602001908083835b602083101515610263578051825260208201915060208101905060208303925061023e565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405180910390209050600060010260001916836000191614806102c657506000806000836000191660001916815260200190815260200160002054115b156102d4576000915061033c565b4360008083600019166000191681526020019081526020016000208190555080600019167fc8ee7ba45d0c5351df845eda156d523bd6865844a5f2c69df35b757e2f794fa18460405180826000191660001916815260200191505060405180910390a2600191505b50919050565b6040805190810160405280600581526020017f302e342e3000000000000000000000000000000000000000000000000000000081525081565b600080600060019150600090505b83518110156103ca576103b284828151811015156103a357fe5b90602001906020020151610203565b15156103bd57600091505b8080600101915050610389565b8192505050919050565b600080600083600019166000191681526020019081526020016000205490509190505600a165627a7a723058208f5c11e2217f9a41c32d2a7651b27c9b1a96952c7b319db85c679ce3f734901e0029

Deployed Bytecode

0x608060405260043610610062576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806312ad8bfc14610067578063b32c65c8146100b0578063bbe8a9b614610140578063c1f62946146101be575b600080fd5b34801561007357600080fd5b506100966004803603810190808035600019169060200190929190505050610203565b604051808215151515815260200191505060405180910390f35b3480156100bc57600080fd5b506100c5610342565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101055780820151818401526020810190506100ea565b50505050905090810190601f1680156101325780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561014c57600080fd5b506101a46004803603810190808035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437820191505050505050919291929050505061037b565b604051808215151515815260200191505060405180910390f35b3480156101ca57600080fd5b506101ed60048036038101908080356000191690602001909291905050506103d4565b6040518082815260200191505060405180910390f35b600080826040516020018082600019166000191681526020019150506040516020818303038152906040526040518082805190602001908083835b602083101515610263578051825260208201915060208101905060208303925061023e565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405180910390209050600060010260001916836000191614806102c657506000806000836000191660001916815260200190815260200160002054115b156102d4576000915061033c565b4360008083600019166000191681526020019081526020016000208190555080600019167fc8ee7ba45d0c5351df845eda156d523bd6865844a5f2c69df35b757e2f794fa18460405180826000191660001916815260200191505060405180910390a2600191505b50919050565b6040805190810160405280600581526020017f302e342e3000000000000000000000000000000000000000000000000000000081525081565b600080600060019150600090505b83518110156103ca576103b284828151811015156103a357fe5b90602001906020020151610203565b15156103bd57600091505b8080600101915050610389565b8192505050919050565b600080600083600019166000191681526020019081526020016000205490509190505600a165627a7a723058208f5c11e2217f9a41c32d2a7651b27c9b1a96952c7b319db85c679ce3f734901e0029

Swarm Source

bzzr://8f5c11e2217f9a41c32d2a7651b27c9b1a96952c7b319db85c679ce3f734901e

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading
Loading...
Loading

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.