Sepolia Testnet

Contract

0xE4793Ef0efFF43976b0Bd368B02680F96598e237

Overview

ETH Balance

244.149744883418440273 ETH

Token Holdings

Multichain Info

N/A
Transaction Hash
Method
Block
From
To
Value
Deposit56051292024-04-01 9:05:2453 days ago1711962324IN
0xE4793Ef0...96598e237
0.01 ETH0.000359671.50017823
Deposit51452282024-01-24 11:30:24121 days ago1706095824IN
0xE4793Ef0...96598e237
0.1 ETH0.0150138762.61782939
Deposit51337032024-01-22 15:31:48122 days ago1705937508IN
0xE4793Ef0...96598e237
0.0002 ETH0.017151883.4402
Deposit51334962024-01-22 14:41:24122 days ago1705934484IN
0xE4793Ef0...96598e237
0.00002 ETH0.0130732154.5267
Deposit51334872024-01-22 14:39:00122 days ago1705934340IN
0xE4793Ef0...96598e237
0.000001 ETH0.0130725554.5267
Deposit51328812024-01-22 12:15:12123 days ago1705925712IN
0xE4793Ef0...96598e237
0.1 ETH0.0060297529.33190606
Deposit51315012024-01-22 6:55:00123 days ago1705906500IN
0xE4793Ef0...96598e237
0.002 ETH0.000387951.6180983
Deposit51301202024-01-22 1:43:00123 days ago1705887780IN
0xE4793Ef0...96598e237
0.1 ETH0.000426051.77695022
Deposit51297512024-01-22 0:18:36123 days ago1705882716IN
0xE4793Ef0...96598e237
0.01 ETH0.00050682.11380974
Deposit51284612024-01-21 19:20:00123 days ago1705864800IN
0xE4793Ef0...96598e237
0.000001 ETH0.000492342.39530925
Deposit51284432024-01-21 19:16:00123 days ago1705864560IN
0xE4793Ef0...96598e237
0.00001 ETH0.000480912.00585422
Deposit51269642024-01-21 13:37:24123 days ago1705844244IN
0xE4793Ef0...96598e237
0.1 ETH0.000341051.65908337
Deposit51260642024-01-21 10:14:36124 days ago1705832076IN
0xE4793Ef0...96598e237
10 ETH0.000392251.63597577
Deposit51257702024-01-21 9:05:12124 days ago1705827912IN
0xE4793Ef0...96598e237
0.01 ETH0.000383831.86728986
Deposit51229812024-01-20 22:20:36124 days ago1705789236IN
0xE4793Ef0...96598e237
0.1 ETH0.000040650.16953918
Deposit51226102024-01-20 20:54:36124 days ago1705784076IN
0xE4793Ef0...96598e237
0.02 ETH0.000388241.61931787
Deposit51226032024-01-20 20:53:00124 days ago1705783980IN
0xE4793Ef0...96598e237
0.05 ETH0.000331171.61112298
Deposit51202352024-01-20 11:41:48125 days ago1705750908IN
0xE4793Ef0...96598e237
0.1 ETH0.003718718.08971331
Deposit51137142024-01-19 10:13:48126 days ago1705659228IN
0xE4793Ef0...96598e237
0.1 ETH0.0155564475.67467125
Deposit51121192024-01-19 4:00:00126 days ago1705636800IN
0xE4793Ef0...96598e237
0.03 ETH0.000281389.67912544
Deposit51121192024-01-19 4:00:00126 days ago1705636800IN
0xE4793Ef0...96598e237
0.03 ETH0.000281389.67912544
Deposit51121192024-01-19 4:00:00126 days ago1705636800IN
0xE4793Ef0...96598e237
0.03 ETH0.001989629.67912544
Deposit51121132024-01-19 3:58:12126 days ago1705636692IN
0xE4793Ef0...96598e237
0.02 ETH0.001995389.70717939
Deposit51086192024-01-18 14:31:00126 days ago1705588260IN
0xE4793Ef0...96598e237
0.3 ETH0.0130562763.51254086
Deposit51086162024-01-18 14:30:12126 days ago1705588212IN
0xE4793Ef0...96598e237
0.001 ETH0.0152554463.62534364
View all transactions

Latest 25 internal transactions (View All)

Advanced mode:
Parent Transaction Hash Block From To Value
50468012024-01-08 13:22:12136 days ago1704720132
0xE4793Ef0...96598e237
0.0001 ETH
50467862024-01-08 13:18:48136 days ago1704719928
0xE4793Ef0...96598e237
0.0001 ETH
50452812024-01-08 7:51:12137 days ago1704700272
0xE4793Ef0...96598e237
1 ETH
50444132024-01-08 4:38:48137 days ago1704688728
0xE4793Ef0...96598e237
0.01 ETH
50350152024-01-06 18:37:12138 days ago1704566232
0xE4793Ef0...96598e237
0.05 ETH
50349502024-01-06 18:23:12138 days ago1704565392
0xE4793Ef0...96598e237
0.1 ETH
50349502024-01-06 18:23:12138 days ago1704565392
0xE4793Ef0...96598e237
0.1 ETH
50349332024-01-06 18:19:24138 days ago1704565164
0xE4793Ef0...96598e237
0.1 ETH
50349332024-01-06 18:19:24138 days ago1704565164
0xE4793Ef0...96598e237
0.1 ETH
50349332024-01-06 18:19:24138 days ago1704565164
0xE4793Ef0...96598e237
0.1 ETH
50349332024-01-06 18:19:24138 days ago1704565164
0xE4793Ef0...96598e237
0.1 ETH
50349072024-01-06 18:13:48138 days ago1704564828
0xE4793Ef0...96598e237
0.1 ETH
50349072024-01-06 18:13:48138 days ago1704564828
0xE4793Ef0...96598e237
0.1 ETH
50349072024-01-06 18:13:48138 days ago1704564828
0xE4793Ef0...96598e237
0.1 ETH
50349072024-01-06 18:13:48138 days ago1704564828
0xE4793Ef0...96598e237
0.1 ETH
50348782024-01-06 18:07:36138 days ago1704564456
0xE4793Ef0...96598e237
0.1 ETH
50348782024-01-06 18:07:36138 days ago1704564456
0xE4793Ef0...96598e237
0.1 ETH
50348782024-01-06 18:07:36138 days ago1704564456
0xE4793Ef0...96598e237
0.1 ETH
50348782024-01-06 18:07:36138 days ago1704564456
0xE4793Ef0...96598e237
0.1 ETH
50348422024-01-06 18:00:12138 days ago1704564012
0xE4793Ef0...96598e237
0.1 ETH
50348422024-01-06 18:00:12138 days ago1704564012
0xE4793Ef0...96598e237
0.1 ETH
50348422024-01-06 18:00:12138 days ago1704564012
0xE4793Ef0...96598e237
0.1 ETH
50348222024-01-06 17:56:12138 days ago1704563772
0xE4793Ef0...96598e237
0.1 ETH
50348222024-01-06 17:56:12138 days ago1704563772
0xE4793Ef0...96598e237
0.1 ETH
50348222024-01-06 17:56:12138 days ago1704563772
0xE4793Ef0...96598e237
0.1 ETH
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
ZRP

Compiler Version
v0.8.21+commit.d9974bed

Optimization Enabled:
Yes with 200 runs

Other Settings:
paris EvmVersion

Contract Source Code (Solidity Standard Json-Input format)

File 1 of 7 : ZRP.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.21;

import {IERC20} from "openzeppelin/token/ERC20/IERC20.sol";
import {Ownable} from "openzeppelin/access/Ownable.sol";
import {Pausable} from "openzeppelin/security/Pausable.sol";
import {IRiscZeroVerifier} from "./risczero/IRiscZeroVerifier.sol";
import {Errors, Events, Types} from "./ZRPLibs.sol";

/**
 * @title ZRP Contract
 * @author RISC Zero
 * @dev A contract for managing deposits, claims, and clawbacks.
 * It also manages the verification of proofs and handles token and ether transfers.
 */
contract ZRP is Ownable, Pausable {

    bytes32 public imageId;
    uint256 public claimFee;
    IRiscZeroVerifier public verifier;

    Types.Deposit[] private deposits;

    mapping(bytes32 => uint256) public claimBalance;
    mapping(bytes32 => uint256) public depositBalance;

    mapping(bytes32 => bool) private depositExists;
    mapping(bytes32 => uint256) private lastClaimIndex;
    mapping(bytes32 => uint256[]) private claimDepositIndices;

    /**
     * @dev Constructor initializes the contract with a verifier and imageId.
     * @param initVerifier The address of the initial verifier contract.
     * @param initImgId The initial image id.
     */
    constructor(IRiscZeroVerifier initVerifier, bytes32 initImgId) {
        verifier = initVerifier;
        imageId = initImgId;
    }

    /**
     * @dev Allows a user to deposit tokens or Ether.
     * @param id An identifier for the deposit.
     * @param token The address of the token contract, or zero-address for Ether.
     * @param amount The amount to deposit.
     * @param salt A unique value to avoid deposit id collisions.
     */
    function deposit(bytes memory id, address token, uint256 amount, uint256 salt) external payable whenNotPaused {
        bytes32 depositId = getDepositId(msg.sender, id, token, salt);

        if (depositExists[depositId]) {
            revert Errors.DepositAlreadyExists(depositId);
        }

        bytes32 claimId = getClaimId(id, token);

        Types.Deposit memory dep = Types.Deposit({
            state: Types.DepositState.Waiting,
            depositId: depositId,
            claimId: claimId,
            amount: amount,
            token: token,
            salt: salt
        });

        deposits.push(dep);

        depositExists[depositId] = true;

        claimDepositIndices[claimId].push(deposits.length - 1);

        if (token == address(0)) {
            if (msg.value != amount) {
                revert Errors.DepositFailed(claimId);
            }
            depositBalance[depositId] += msg.value;
            claimBalance[claimId] += msg.value;
        } else {
            if (!IERC20(token).transferFrom(msg.sender, address(this), amount)) {
                revert Errors.DepositFailed(claimId);
            }
            depositBalance[depositId] += amount;
            claimBalance[claimId] += amount;
        }
        emit Events.Deposited(id, msg.sender, amount);
    }

    /**
     * @dev Allows a user to claim deposits.
     * @param data The proof data.
     * @param token The address of the token contract, or zero-address for Ether.
     */
    function claim(bytes memory data, address token) external whenNotPaused {
        Types.Proof memory proof = abi.decode(data, (Types.Proof));

        if (!verifier.verify(proof.seal, imageId, proof.postStateDigest, proof.journal)) {
            revert Errors.InvalidProof(proof);
        }

        (address beneficiary, bytes memory id) = abi.decode(proof.journal, (address, bytes));

        if (beneficiary != msg.sender) {
            revert Errors.InvalidProof(proof);
        }

        bytes32 claimId = getClaimId(id, token);
        claimBalance[claimId] = 0;

        uint256 depositCount = claimDepositIndices[claimId].length;

        uint256 amount = 0;

        for (uint256 i = lastClaimIndex[claimId]; i < depositCount; ++i) {
            uint256 index = claimDepositIndices[claimId][i];
            Types.Deposit storage dep = deposits[index];

            if (dep.state == Types.DepositState.Waiting && dep.token == token) {
                depositBalance[dep.depositId] = 0;
                dep.state = Types.DepositState.Claimed;
                amount += dep.amount;
            }
        }

        lastClaimIndex[claimId] = depositCount;

        amount -= calculateFee(amount);

        if (token == address(0)) {
            payable(beneficiary).transfer(amount);
        } else {
            if (!IERC20(token).transfer(beneficiary, amount)) {
                revert Errors.ClaimFailed(claimId);
            }
        }
        emit Events.Claimed(id, beneficiary, amount);
    }

    /**
     * @dev Allows a user to clawback deposits.
     * @param id An identifier for the deposit.
     * @param token The address of the token contract, or zero-address for Ether.
     * @param salt The salt used when the deposit was made.
     */
    function withdrawDeposit(bytes memory id, address token, uint256 salt) external whenNotPaused {
        bytes32 depositId = getDepositId(msg.sender, id, token, salt);

        if (!depositExists[depositId]) {
            revert Errors.WithdrawFailed(depositId);
        }

        bytes32 claimId = getClaimId(id, token);

        uint256 depositCount = claimDepositIndices[claimId].length;

        uint256 amount = 0;

        for (uint256 i = 0; i < depositCount; ++i) {
            uint256 index = claimDepositIndices[claimId][i];
            Types.Deposit storage dep = deposits[index];

            if (dep.depositId == depositId && dep.token == token) {
                if (dep.state != Types.DepositState.Waiting) {
                    revert Errors.InvalidDepositState(depositId);
                }

                dep.state = Types.DepositState.Withdrawn;
                amount += dep.amount;
            }
        }

        depositBalance[depositId] = 0;
        claimBalance[claimId] -= amount;

        if (token == address(0)) {
            payable(msg.sender).transfer(amount);
        } else {
            if (!IERC20(token).transfer(msg.sender, amount)) {
                revert Errors.WithdrawFailed(claimId);
            }
        }
        emit Events.Withdrawn(id, msg.sender, amount);
    }

    /**
     * @dev Pause the contract.
     */
    function pause() external onlyOwner {
        _pause();
    }

    /**
     * @dev Unpause the contract.
     */
    function unpause() external onlyOwner {
        _unpause();
    }

    /**
     * @dev Set the fee percentage.
     * @param feePercentage The new fee percentage.
     */
    function setFee(uint256 feePercentage) external onlyOwner {
        if (feePercentage >= 100) {
            revert Errors.InvalidFee();
        }
        claimFee = feePercentage;
    }

    /**
     * @dev Set a new verifier.
     * @param newVerifier The address of the new verifier contract.
     */

    function setVerifier(IRiscZeroVerifier newVerifier) external onlyOwner {
        verifier = newVerifier;
    }

    /**
     * @dev Set a new image id.
     * @param newImageId The new image id.
     */

    function setImageId(bytes32 newImageId) external onlyOwner {
        imageId = newImageId;
    }

    /**
     * @dev Withdraw the contract balance.
     * @param to The address to withdraw to.
     * @param token The address of the token to withdraw, or zero-address for Ether.
     */
    function withdrawContract(address to, address token) external onlyOwner {
        if (token == address(0)) {
            payable(to).transfer(address(this).balance);
        } else {
            if (!IERC20(token).transfer(to, IERC20(token).balanceOf(address(this)))) {
                revert Errors.WithdrawFailed(bytes32("contract"));
            }
        }
        emit Events.Withdrawn("contract", to, address(this).balance);
    }

    /**
     * @dev Get claim id
     * @param id The claimer identifier.
     * @param token The address of the token for the claim.
     */
    function getClaimId(bytes memory id, address token) public pure returns (bytes32) {
        return _getKey(address(0), "claim", id, token, 0);
    }

    /**
     * @dev Get deposit id
     * @param depositor The depositor address.
     * @param id The deposit identifier.
     * @param token The address of the token for the deposit.
     * @param salt The salt used when the deposit was made.
     */
    function getDepositId(address depositor, bytes memory id, address token, uint256 salt)
        public
        pure
        returns (bytes32)
    {
        return _getKey(depositor, "deposit", id, token, salt);
    }

    /**
     * @dev Calculate the fee for a given amount.
     * @param amount The amount to calculate the fee for.
     */
    function calculateFee(uint256 amount) public view returns (uint256) {
        return (amount * claimFee) / 100;
    }

    /**
     * @dev Internal function to generate a key based on the given parameters.
     * @param about An address value.
     * @param key A string value.
     * @param id An identifier.
     * @param token The address of the token contract, or zero-address for Ether.
     * @param salt A unique value.
     * @return The generated key.
     */
    function _getKey(address about, string memory key, bytes memory id, address token, uint256 salt)
        internal
        pure
        returns (bytes32)
    {
        return keccak256(abi.encodePacked(about, key, id, token, salt));
    }
}

File 3 of 7 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

    /**
     * @dev Emitted when the allowance of a `spender` for an `owner` is set by
     * a call to {approve}. `value` is the new allowance.
     */
    event Approval(address indexed owner, address indexed spender, uint256 value);

    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns the amount of tokens owned by `account`.
     */
    function balanceOf(address account) external view returns (uint256);

    /**
     * @dev Moves `amount` tokens from the caller's account to `to`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address to, uint256 amount) external returns (bool);

    /**
     * @dev Returns the remaining number of tokens that `spender` will be
     * allowed to spend on behalf of `owner` through {transferFrom}. This is
     * zero by default.
     *
     * This value changes when {approve} or {transferFrom} are called.
     */
    function allowance(address owner, address spender) external view returns (uint256);

    /**
     * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * IMPORTANT: Beware that changing an allowance with this method brings the risk
     * that someone may use both the old and the new allowance by unfortunate
     * transaction ordering. One possible solution to mitigate this race
     * condition is to first reduce the spender's allowance to 0 and set the
     * desired value afterwards:
     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
     *
     * Emits an {Approval} event.
     */
    function approve(address spender, uint256 amount) external returns (bool);

    /**
     * @dev Moves `amount` tokens from `from` to `to` using the
     * allowance mechanism. `amount` is then deducted from the caller's
     * allowance.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(address from, address to, uint256 amount) external returns (bool);
}

File 4 of 7 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)

pragma solidity ^0.8.0;

import "../utils/Context.sol";

/**
 * @dev Contract module which provides a basic access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * By default, the owner account will be the one that deploys the contract. This
 * can later be changed with {transferOwnership}.
 *
 * This module is used through inheritance. It will make available the modifier
 * `onlyOwner`, which can be applied to your functions to restrict their use to
 * the owner.
 */
abstract contract Ownable is Context {
    address private _owner;

    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor() {
        _transferOwnership(_msgSender());
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        _checkOwner();
        _;
    }

    /**
     * @dev Returns the address of the current owner.
     */
    function owner() public view virtual returns (address) {
        return _owner;
    }

    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby disabling any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        _transferOwnership(address(0));
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        _transferOwnership(newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}

File 5 of 7 : Pausable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (security/Pausable.sol)

pragma solidity ^0.8.0;

import "../utils/Context.sol";

/**
 * @dev Contract module which allows children to implement an emergency stop
 * mechanism that can be triggered by an authorized account.
 *
 * This module is used through inheritance. It will make available the
 * modifiers `whenNotPaused` and `whenPaused`, which can be applied to
 * the functions of your contract. Note that they will not be pausable by
 * simply including this module, only once the modifiers are put in place.
 */
abstract contract Pausable is Context {
    /**
     * @dev Emitted when the pause is triggered by `account`.
     */
    event Paused(address account);

    /**
     * @dev Emitted when the pause is lifted by `account`.
     */
    event Unpaused(address account);

    bool private _paused;

    /**
     * @dev Initializes the contract in unpaused state.
     */
    constructor() {
        _paused = false;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is not paused.
     *
     * Requirements:
     *
     * - The contract must not be paused.
     */
    modifier whenNotPaused() {
        _requireNotPaused();
        _;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is paused.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    modifier whenPaused() {
        _requirePaused();
        _;
    }

    /**
     * @dev Returns true if the contract is paused, and false otherwise.
     */
    function paused() public view virtual returns (bool) {
        return _paused;
    }

    /**
     * @dev Throws if the contract is paused.
     */
    function _requireNotPaused() internal view virtual {
        require(!paused(), "Pausable: paused");
    }

    /**
     * @dev Throws if the contract is not paused.
     */
    function _requirePaused() internal view virtual {
        require(paused(), "Pausable: not paused");
    }

    /**
     * @dev Triggers stopped state.
     *
     * Requirements:
     *
     * - The contract must not be paused.
     */
    function _pause() internal virtual whenNotPaused {
        _paused = true;
        emit Paused(_msgSender());
    }

    /**
     * @dev Returns to normal state.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    function _unpause() internal virtual whenPaused {
        _paused = false;
        emit Unpaused(_msgSender());
    }
}

File 6 of 7 : IRiscZeroVerifier.sol
// Copyright 2023 RISC Zero, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// SPDX-License-Identifier: Apache-2.0

pragma solidity ^0.8.21;

/// @notice Indicator for the overall system at the end of execution covered by this proof.
enum SystemExitCode {
    Halted,
    Paused,
    SystemSplit
}

/// @notice Combination of system and user exit codes.
/// @dev If system exit code is SystemSplit, the user exit code must be zero.
struct ExitCode {
    SystemExitCode system;
    uint8 user;
}

/// @notice Data associated with a receipt which is used for both input and
/// output of global state.
struct ReceiptMetadata {
    /// Digest of the SystemState of a segment just before execution has begun.
    bytes32 preStateDigest;
    /// Digest of the SystemState of a segment just after execution has completed.
    bytes32 postStateDigest;
    /// The exit code for a segment
    ExitCode exitCode;
    /// A digest of the input, from the viewpoint of the guest.
    bytes32 input;
    /// A digest of the journal, from the viewpoint of the guest.
    bytes32 output;
}

library ReceiptMetadataLib {
    bytes32 constant TAG_DIGEST = sha256("risc0.ReceiptMeta");

    function digest(ReceiptMetadata memory meta) internal pure returns (bytes32) {
        return sha256(
            abi.encodePacked(
                TAG_DIGEST,
                // down
                meta.input,
                meta.preStateDigest,
                meta.postStateDigest,
                meta.output,
                // data
                uint32(meta.exitCode.system) << 24,
                uint32(meta.exitCode.user) << 24,
                // down.length
                uint16(4) << 8
            )
        );
    }
}

struct Receipt {
    bytes seal;
    ReceiptMetadata meta;
}

interface IRiscZeroVerifier {
    /// @notice verify that the given receipt is a valid Groth16 RISC Zero recursion receipt.
    /// @return true if the receipt passes the verification checks.
    function verify(Receipt calldata receipt) external view returns (bool);

    /// @notice verifies that the given seal is a valid Groth16 RISC Zero proof of execution over the
    ///     given image ID, post-state digest, and journal. Asserts that the input hash
    //      is all-zeros (i.e. no committed input) and the exit code is (Halted, 0).
    /// @return true if the receipt passes the verification checks.
    function verify(bytes calldata seal, bytes32 imageId, bytes32 postStateDigest, bytes32 journalHash)
        external
        view
        returns (bool);

    /// @notice verifies that the given seal is a valid Groth16 RISC Zero proof of execution over the
    ///     given image ID, post-state digest, and full journal. Asserts that the input hash
    //      is all-zeros (i.e. no committed input) and the exit code is (Halted, 0).
    /// @return true if the receipt passes the verification checks.
    function verify(bytes memory seal, bytes32 imageId, bytes32 postStateDigest, bytes calldata journal)
        external
        view
        returns (bool);
}

File 7 of 7 : ZRPLibs.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.21;

library Types {
    enum DepositState {
        Waiting,
        Claimed,
        Withdrawn
    }

    struct Deposit {
        DepositState state;
        uint256 salt;
        address token;
        uint256 amount;
        bytes32 claimId;
        bytes32 depositId;
    }

    struct Proof {
        bytes seal;
        bytes32 postStateDigest;
        bytes journal;
    }
}

library Errors {
    error DepositFailed(bytes32 id);
    error ClaimFailed(bytes32 id);
    error WithdrawFailed(bytes32 id);
    error DepositAlreadyExists(bytes32 id);
    error DepositDoesNotExist(bytes32 id);
    error InvalidProof(Types.Proof proof);
    error InvalidDepositState(bytes32 id);
    error InvalidFee();
}

library Events {
    /**
     * @dev Emitted when a claim is made.
     * @param id An identifier for the claim.
     * @param account The address of the claimant.
     * @param amount The amount claimed.
     */
    event Claimed(bytes indexed id, address indexed account, uint256 amount);

    /**
     * @dev Emitted when a deposit is made.
     * @param id An identifier for the deposit.
     * @param account The address of the depositor.
     * @param amount The amount deposited.
     */
    event Deposited(bytes indexed id, address indexed account, uint256 amount);

    /**
     * @dev Emitted when funds are withdrawn from a deposit.
     * @param id An identifier for the deposit.
     * @param account The address of the account withdrawing funds.
     * @param amount The amount withdrawn.
     */
    event Withdrawn(bytes indexed id, address indexed account, uint256 amount);
}

File 8 of 7 : Context.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)

pragma solidity ^0.8.0;

/**
 * @dev Provides information about the current execution context, including the
 * sender of the transaction and its data. While these are generally available
 * via msg.sender and msg.data, they should not be accessed in such a direct
 * manner, since when dealing with meta-transactions the account sending and
 * paying for execution may not be the actual sender (as far as an application
 * is concerned).
 *
 * This contract is only required for intermediate, library-like contracts.
 */
abstract contract Context {
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes calldata) {
        return msg.data;
    }
}

Settings
{
  "remappings": [
    "ds-test/=lib/forge-std/lib/ds-test/src/",
    "erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/",
    "forge-std/=lib/forge-std/src/",
    "openzeppelin-contracts/=lib/openzeppelin-contracts/",
    "openzeppelin/=lib/openzeppelin-contracts/contracts/"
  ],
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "metadata": {
    "useLiteralContent": false,
    "bytecodeHash": "ipfs",
    "appendCBOR": true
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "evmVersion": "paris",
  "libraries": {}
}

Contract ABI

[{"inputs":[{"internalType":"contract IRiscZeroVerifier","name":"initVerifier","type":"address"},{"internalType":"bytes32","name":"initImgId","type":"bytes32"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"bytes32","name":"id","type":"bytes32"}],"name":"ClaimFailed","type":"error"},{"inputs":[{"internalType":"bytes32","name":"id","type":"bytes32"}],"name":"DepositAlreadyExists","type":"error"},{"inputs":[{"internalType":"bytes32","name":"id","type":"bytes32"}],"name":"DepositFailed","type":"error"},{"inputs":[{"internalType":"bytes32","name":"id","type":"bytes32"}],"name":"InvalidDepositState","type":"error"},{"inputs":[],"name":"InvalidFee","type":"error"},{"inputs":[{"components":[{"internalType":"bytes","name":"seal","type":"bytes"},{"internalType":"bytes32","name":"postStateDigest","type":"bytes32"},{"internalType":"bytes","name":"journal","type":"bytes"}],"internalType":"struct Types.Proof","name":"proof","type":"tuple"}],"name":"InvalidProof","type":"error"},{"inputs":[{"internalType":"bytes32","name":"id","type":"bytes32"}],"name":"WithdrawFailed","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes","name":"id","type":"bytes"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Claimed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes","name":"id","type":"bytes"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Deposited","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes","name":"id","type":"bytes"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Withdrawn","type":"event"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"calculateFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes","name":"data","type":"bytes"},{"internalType":"address","name":"token","type":"address"}],"name":"claim","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"claimBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claimFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes","name":"id","type":"bytes"},{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"salt","type":"uint256"}],"name":"deposit","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"depositBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes","name":"id","type":"bytes"},{"internalType":"address","name":"token","type":"address"}],"name":"getClaimId","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"depositor","type":"address"},{"internalType":"bytes","name":"id","type":"bytes"},{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"salt","type":"uint256"}],"name":"getDepositId","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"imageId","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"feePercentage","type":"uint256"}],"name":"setFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"newImageId","type":"bytes32"}],"name":"setImageId","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IRiscZeroVerifier","name":"newVerifier","type":"address"}],"name":"setVerifier","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"verifier","outputs":[{"internalType":"contract IRiscZeroVerifier","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"address","name":"token","type":"address"}],"name":"withdrawContract","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes","name":"id","type":"bytes"},{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"salt","type":"uint256"}],"name":"withdrawDeposit","outputs":[],"stateMutability":"nonpayable","type":"function"}]

608060405234801561001057600080fd5b50604051611a50380380611a5083398101604081905261002f916100be565b6100383361006e565b6000805460ff60a01b19169055600380546001600160a01b0319166001600160a01b0393909316929092179091556001556100f8565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600080604083850312156100d157600080fd5b82516001600160a01b03811681146100e857600080fd5b6020939093015192949293505050565b611949806101076000396000f3fe60806040526004361061012a5760003560e01c806376ba6fb0116100ab57806399a5d7471161006f57806399a5d7471461033057806399d32fc414610350578063e80f57ef14610366578063ef3f7dd514610393578063f2fde38b146103a9578063f876cbcc146103c957600080fd5b806376ba6fb0146102905780637f28eee5146102bd5780638456cb59146102dd5780638da5cb5b146102f2578063901129c21461031057600080fd5b80635c975abb116100f25780635c975abb146101f15780635f7101b51461021b57806363a87cad1461023b57806369fe0e2d1461025b578063715018a61461027b57600080fd5b80632b7ac3f31461012f5780633f4ba83a1461016c578063415b1f901461018357806341fcb612146101b15780635437988d146101d1575b600080fd5b34801561013b57600080fd5b5060035461014f906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561017857600080fd5b506101816103dc565b005b34801561018f57600080fd5b506101a361019e36600461139d565b6103ee565b604051908152602001610163565b3480156101bd57600080fd5b506101816101cc366004611407565b610425565b3480156101dd57600080fd5b506101816101ec366004611459565b6107a4565b3480156101fd57600080fd5b50600054600160a01b900460ff166040519015158152602001610163565b34801561022757600080fd5b506101a3610236366004611407565b6107ce565b34801561024757600080fd5b5061018161025636600461147d565b610805565b34801561026757600080fd5b506101816102763660046114ab565b6109be565b34801561028757600080fd5b506101816109ec565b34801561029c57600080fd5b506101a36102ab3660046114ab565b60066020526000908152604090205481565b3480156102c957600080fd5b506101816102d83660046114c4565b6109fe565b3480156102e957600080fd5b50610181610cad565b3480156102fe57600080fd5b506000546001600160a01b031661014f565b34801561031c57600080fd5b5061018161032b3660046114ab565b610cbd565b34801561033c57600080fd5b506101a361034b3660046114ab565b610cca565b34801561035c57600080fd5b506101a360025481565b34801561037257600080fd5b506101a36103813660046114ab565b60056020526000908152604090205481565b34801561039f57600080fd5b506101a360015481565b3480156103b557600080fd5b506101816103c4366004611459565b610ce6565b6101816103d736600461151e565b610d5f565b6103e46110a8565b6103ec611102565b565b600061041c856040518060400160405280600781526020016619195c1bdcda5d60ca1b815250868686611157565b95945050505050565b61042d611193565b60008280602001905181019061044391906115ee565b600354815160015460208401516040808601519051631a36ed7560e01b81529596506001600160a01b0390941694631a36ed7594610486949392916004016116cb565b602060405180830381865afa1580156104a3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104c79190611707565b6104ef57806040516335a9267d60e11b81526004016104e69190611729565b60405180910390fd5b600080826040015180602001905181019061050a919061176c565b90925090506001600160a01b038216331461053a57826040516335a9267d60e11b81526004016104e69190611729565b600061054682866107ce565b600081815260056020908152604080832083905560098252808320546008909252822054929350915b82811015610645576000848152600960205260408120805483908110610597576105976117bd565b906000526020600020015490506000600482815481106105b9576105b96117bd565b6000918252602082206006909102019150815460ff1660028111156105e0576105e06117d3565b1480156105fc575060028101546001600160a01b038b81169116145b15610632576005810154600090815260066020526040812055805460ff19166001178155600381015461062f90856117ff565b93505b50508061063e90611812565b905061056f565b50600083815260086020526040902082905561066081610cca565b61066a908261182b565b90506001600160a01b0387166106b6576040516001600160a01b0386169082156108fc029083906000818181858888f193505050501580156106b0573d6000803e3d6000fd5b50610748565b60405163a9059cbb60e01b81526001600160a01b0386811660048301526024820183905288169063a9059cbb906044016020604051808303816000875af1158015610705573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107299190611707565b61074857604051629c0e8960e71b8152600481018490526024016104e6565b846001600160a01b031684604051610760919061183e565b604051908190038120838252907f97685423965df1732c67ed60f69fbd53f2eafca81dddd0bcfe905b1a76b32d319060200160405180910390a35050505050505050565b6107ac6110a8565b600380546001600160a01b0319166001600160a01b0392909216919091179055565b60006107fc600060405180604001604052806005815260200164636c61696d60d81b81525085856000611157565b90505b92915050565b61080d6110a8565b6001600160a01b038116610856576040516001600160a01b038316904780156108fc02916000818181858888f19350505050158015610850573d6000803e3d6000fd5b50610961565b6040516370a0823160e01b81523060048201526001600160a01b0382169063a9059cbb90849083906370a0823190602401602060405180830381865afa1580156108a4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108c8919061185a565b6040516001600160e01b031960e085901b1681526001600160a01b03909216600483015260248201526044016020604051808303816000875af1158015610913573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109379190611707565b6109615760405163750a3f5960e11b81526718dbdb9d1c9858dd60c21b60048201526024016104e6565b6040516718dbdb9d1c9858dd60c21b81526001600160a01b03831690600801604051908190038120478252907f7d4141f03fecf4bb26cb9fd7464e19b32fcf0aaa3937d846a6fa981c82087f029060200160405180910390a35050565b6109c66110a8565b606481106109e7576040516358d620b360e01b815260040160405180910390fd5b600255565b6109f46110a8565b6103ec60006111e0565b610a06611193565b6000610a14338585856103ee565b60008181526007602052604090205490915060ff16610a495760405163750a3f5960e11b8152600481018290526024016104e6565b6000610a5585856107ce565b600081815260096020526040812054919250805b82811015610b53576000848152600960205260408120805483908110610a9157610a916117bd565b90600052602060002001549050600060048281548110610ab357610ab36117bd565b90600052602060002090600602019050868160050154148015610ae5575060028101546001600160a01b038a81169116145b15610b40576000815460ff166002811115610b0257610b026117d3565b14610b2357604051636270a58b60e11b8152600481018890526024016104e6565b805460ff191660021781556003810154610b3d90856117ff565b93505b505080610b4c90611812565b9050610a69565b506000848152600660209081526040808320839055858352600590915281208054839290610b8290849061182b565b90915550506001600160a01b038616610bc857604051339082156108fc029083906000818181858888f19350505050158015610bc2573d6000803e3d6000fd5b50610c59565b60405163a9059cbb60e01b8152336004820152602481018290526001600160a01b0387169063a9059cbb906044016020604051808303816000875af1158015610c15573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c399190611707565b610c595760405163750a3f5960e11b8152600481018490526024016104e6565b6040513390610c6990899061183e565b604051908190038120838252907f7d4141f03fecf4bb26cb9fd7464e19b32fcf0aaa3937d846a6fa981c82087f02906020015b60405180910390a350505050505050565b610cb56110a8565b6103ec611230565b610cc56110a8565b600155565b6000606460025483610cdc9190611873565b6107ff919061188a565b610cee6110a8565b6001600160a01b038116610d535760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016104e6565b610d5c816111e0565b50565b610d67611193565b6000610d75338686856103ee565b60008181526007602052604090205490915060ff1615610dab57604051633a233a5760e11b8152600481018290526024016104e6565b6000610db786866107ce565b905060006040518060c0016040528060006002811115610dd957610dd96117d3565b8152602081018690526001600160a01b0388166040820152606081018790526080810184905260a0018490526004805460018181018355600092909252825160069091027f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b01805493945084939092839160ff191690836002811115610e6157610e616117d3565b02179055506020828101516001838101919091556040808501516002850180546001600160a01b0319166001600160a01b0390921691909117905560608501516003850155608085015160048086019190915560a090950151600590940193909355600087815260078352838120805460ff19168317905586815260099092529190209154610ef0919061182b565b815460018101835560009283526020909220909101556001600160a01b038616610f8357843414610f3757604051634d98a88760e11b8152600481018390526024016104e6565b60008381526006602052604081208054349290610f559084906117ff565b909155505060008281526005602052604081208054349290610f789084906117ff565b909155506110619050565b6040516323b872dd60e01b8152336004820152306024820152604481018690526001600160a01b038716906323b872dd906064016020604051808303816000875af1158015610fd6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ffa9190611707565b61101a57604051634d98a88760e11b8152600481018390526024016104e6565b600083815260066020526040812080548792906110389084906117ff565b90915550506000828152600560205260408120805487929061105b9084906117ff565b90915550505b604051339061107190899061183e565b604051908190038120878252907f4af1fa071b9000a5158e59801a6779410006d4df8be38cc6dd395bc05eb9387d90602001610c9c565b6000546001600160a01b031633146103ec5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016104e6565b61110a611273565b6000805460ff60a01b191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b600085858585856040516020016111729594939291906118ac565b60405160208183030381529060405280519060200120905095945050505050565b600054600160a01b900460ff16156103ec5760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b60448201526064016104e6565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b611238611193565b6000805460ff60a01b1916600160a01b1790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25861113a3390565b600054600160a01b900460ff166103ec5760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b60448201526064016104e6565b6001600160a01b0381168114610d5c57600080fd5b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715611317576113176112d8565b604052919050565b600067ffffffffffffffff821115611339576113396112d8565b50601f01601f191660200190565b600082601f83011261135857600080fd5b813561136b6113668261131f565b6112ee565b81815284602083860101111561138057600080fd5b816020850160208301376000918101602001919091529392505050565b600080600080608085870312156113b357600080fd5b84356113be816112c3565b9350602085013567ffffffffffffffff8111156113da57600080fd5b6113e687828801611347565b93505060408501356113f7816112c3565b9396929550929360600135925050565b6000806040838503121561141a57600080fd5b823567ffffffffffffffff81111561143157600080fd5b61143d85828601611347565b925050602083013561144e816112c3565b809150509250929050565b60006020828403121561146b57600080fd5b8135611476816112c3565b9392505050565b6000806040838503121561149057600080fd5b823561149b816112c3565b9150602083013561144e816112c3565b6000602082840312156114bd57600080fd5b5035919050565b6000806000606084860312156114d957600080fd5b833567ffffffffffffffff8111156114f057600080fd5b6114fc86828701611347565b935050602084013561150d816112c3565b929592945050506040919091013590565b6000806000806080858703121561153457600080fd5b843567ffffffffffffffff81111561154b57600080fd5b61155787828801611347565b9450506020850135611568816112c3565b93969395505050506040820135916060013590565b60005b83811015611598578181015183820152602001611580565b50506000910152565b600082601f8301126115b257600080fd5b81516115c06113668261131f565b8181528460208386010111156115d557600080fd5b6115e682602083016020870161157d565b949350505050565b60006020828403121561160057600080fd5b815167ffffffffffffffff8082111561161857600080fd5b908301906060828603121561162c57600080fd5b604051606081018181108382111715611647576116476112d8565b60405282518281111561165957600080fd5b611665878286016115a1565b8252506020830151602082015260408301518281111561168457600080fd5b611690878286016115a1565b60408301525095945050505050565b600081518084526116b781602086016020860161157d565b601f01601f19169290920160200192915050565b6080815260006116de608083018761169f565b85602084015284604084015282810360608401526116fc818561169f565b979650505050505050565b60006020828403121561171957600080fd5b8151801515811461147657600080fd5b602081526000825160606020840152611745608084018261169f565b9050602084015160408401526040840151601f1984830301606085015261041c828261169f565b6000806040838503121561177f57600080fd5b825161178a816112c3565b602084015190925067ffffffffffffffff8111156117a757600080fd5b6117b3858286016115a1565b9150509250929050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052601160045260246000fd5b808201808211156107ff576107ff6117e9565b600060018201611824576118246117e9565b5060010190565b818103818111156107ff576107ff6117e9565b6000825161185081846020870161157d565b9190910192915050565b60006020828403121561186c57600080fd5b5051919050565b80820281158282048414176107ff576107ff6117e9565b6000826118a757634e487b7160e01b600052601260045260246000fd5b500490565b60006bffffffffffffffffffffffff19808860601b16835286516118d7816014860160208b0161157d565b8651908401906118ee816014840160208b0161157d565b60609690961b919091169401601481019490945250506028820152604801939250505056fea2646970667358221220416c92937a72d454d4b22461614b498e9027beedbff9b6a82fc023b85149471f64736f6c634300081500330000000000000000000000000cbc65909efe3d6fe589dfffb2ac86350b25fcc86f50f38d71230bc1da1593cbedc1433f12a671cb69571a08d39bfafd2e21c5ce

Deployed Bytecode

0x60806040526004361061012a5760003560e01c806376ba6fb0116100ab57806399a5d7471161006f57806399a5d7471461033057806399d32fc414610350578063e80f57ef14610366578063ef3f7dd514610393578063f2fde38b146103a9578063f876cbcc146103c957600080fd5b806376ba6fb0146102905780637f28eee5146102bd5780638456cb59146102dd5780638da5cb5b146102f2578063901129c21461031057600080fd5b80635c975abb116100f25780635c975abb146101f15780635f7101b51461021b57806363a87cad1461023b57806369fe0e2d1461025b578063715018a61461027b57600080fd5b80632b7ac3f31461012f5780633f4ba83a1461016c578063415b1f901461018357806341fcb612146101b15780635437988d146101d1575b600080fd5b34801561013b57600080fd5b5060035461014f906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561017857600080fd5b506101816103dc565b005b34801561018f57600080fd5b506101a361019e36600461139d565b6103ee565b604051908152602001610163565b3480156101bd57600080fd5b506101816101cc366004611407565b610425565b3480156101dd57600080fd5b506101816101ec366004611459565b6107a4565b3480156101fd57600080fd5b50600054600160a01b900460ff166040519015158152602001610163565b34801561022757600080fd5b506101a3610236366004611407565b6107ce565b34801561024757600080fd5b5061018161025636600461147d565b610805565b34801561026757600080fd5b506101816102763660046114ab565b6109be565b34801561028757600080fd5b506101816109ec565b34801561029c57600080fd5b506101a36102ab3660046114ab565b60066020526000908152604090205481565b3480156102c957600080fd5b506101816102d83660046114c4565b6109fe565b3480156102e957600080fd5b50610181610cad565b3480156102fe57600080fd5b506000546001600160a01b031661014f565b34801561031c57600080fd5b5061018161032b3660046114ab565b610cbd565b34801561033c57600080fd5b506101a361034b3660046114ab565b610cca565b34801561035c57600080fd5b506101a360025481565b34801561037257600080fd5b506101a36103813660046114ab565b60056020526000908152604090205481565b34801561039f57600080fd5b506101a360015481565b3480156103b557600080fd5b506101816103c4366004611459565b610ce6565b6101816103d736600461151e565b610d5f565b6103e46110a8565b6103ec611102565b565b600061041c856040518060400160405280600781526020016619195c1bdcda5d60ca1b815250868686611157565b95945050505050565b61042d611193565b60008280602001905181019061044391906115ee565b600354815160015460208401516040808601519051631a36ed7560e01b81529596506001600160a01b0390941694631a36ed7594610486949392916004016116cb565b602060405180830381865afa1580156104a3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104c79190611707565b6104ef57806040516335a9267d60e11b81526004016104e69190611729565b60405180910390fd5b600080826040015180602001905181019061050a919061176c565b90925090506001600160a01b038216331461053a57826040516335a9267d60e11b81526004016104e69190611729565b600061054682866107ce565b600081815260056020908152604080832083905560098252808320546008909252822054929350915b82811015610645576000848152600960205260408120805483908110610597576105976117bd565b906000526020600020015490506000600482815481106105b9576105b96117bd565b6000918252602082206006909102019150815460ff1660028111156105e0576105e06117d3565b1480156105fc575060028101546001600160a01b038b81169116145b15610632576005810154600090815260066020526040812055805460ff19166001178155600381015461062f90856117ff565b93505b50508061063e90611812565b905061056f565b50600083815260086020526040902082905561066081610cca565b61066a908261182b565b90506001600160a01b0387166106b6576040516001600160a01b0386169082156108fc029083906000818181858888f193505050501580156106b0573d6000803e3d6000fd5b50610748565b60405163a9059cbb60e01b81526001600160a01b0386811660048301526024820183905288169063a9059cbb906044016020604051808303816000875af1158015610705573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107299190611707565b61074857604051629c0e8960e71b8152600481018490526024016104e6565b846001600160a01b031684604051610760919061183e565b604051908190038120838252907f97685423965df1732c67ed60f69fbd53f2eafca81dddd0bcfe905b1a76b32d319060200160405180910390a35050505050505050565b6107ac6110a8565b600380546001600160a01b0319166001600160a01b0392909216919091179055565b60006107fc600060405180604001604052806005815260200164636c61696d60d81b81525085856000611157565b90505b92915050565b61080d6110a8565b6001600160a01b038116610856576040516001600160a01b038316904780156108fc02916000818181858888f19350505050158015610850573d6000803e3d6000fd5b50610961565b6040516370a0823160e01b81523060048201526001600160a01b0382169063a9059cbb90849083906370a0823190602401602060405180830381865afa1580156108a4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108c8919061185a565b6040516001600160e01b031960e085901b1681526001600160a01b03909216600483015260248201526044016020604051808303816000875af1158015610913573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109379190611707565b6109615760405163750a3f5960e11b81526718dbdb9d1c9858dd60c21b60048201526024016104e6565b6040516718dbdb9d1c9858dd60c21b81526001600160a01b03831690600801604051908190038120478252907f7d4141f03fecf4bb26cb9fd7464e19b32fcf0aaa3937d846a6fa981c82087f029060200160405180910390a35050565b6109c66110a8565b606481106109e7576040516358d620b360e01b815260040160405180910390fd5b600255565b6109f46110a8565b6103ec60006111e0565b610a06611193565b6000610a14338585856103ee565b60008181526007602052604090205490915060ff16610a495760405163750a3f5960e11b8152600481018290526024016104e6565b6000610a5585856107ce565b600081815260096020526040812054919250805b82811015610b53576000848152600960205260408120805483908110610a9157610a916117bd565b90600052602060002001549050600060048281548110610ab357610ab36117bd565b90600052602060002090600602019050868160050154148015610ae5575060028101546001600160a01b038a81169116145b15610b40576000815460ff166002811115610b0257610b026117d3565b14610b2357604051636270a58b60e11b8152600481018890526024016104e6565b805460ff191660021781556003810154610b3d90856117ff565b93505b505080610b4c90611812565b9050610a69565b506000848152600660209081526040808320839055858352600590915281208054839290610b8290849061182b565b90915550506001600160a01b038616610bc857604051339082156108fc029083906000818181858888f19350505050158015610bc2573d6000803e3d6000fd5b50610c59565b60405163a9059cbb60e01b8152336004820152602481018290526001600160a01b0387169063a9059cbb906044016020604051808303816000875af1158015610c15573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c399190611707565b610c595760405163750a3f5960e11b8152600481018490526024016104e6565b6040513390610c6990899061183e565b604051908190038120838252907f7d4141f03fecf4bb26cb9fd7464e19b32fcf0aaa3937d846a6fa981c82087f02906020015b60405180910390a350505050505050565b610cb56110a8565b6103ec611230565b610cc56110a8565b600155565b6000606460025483610cdc9190611873565b6107ff919061188a565b610cee6110a8565b6001600160a01b038116610d535760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016104e6565b610d5c816111e0565b50565b610d67611193565b6000610d75338686856103ee565b60008181526007602052604090205490915060ff1615610dab57604051633a233a5760e11b8152600481018290526024016104e6565b6000610db786866107ce565b905060006040518060c0016040528060006002811115610dd957610dd96117d3565b8152602081018690526001600160a01b0388166040820152606081018790526080810184905260a0018490526004805460018181018355600092909252825160069091027f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b01805493945084939092839160ff191690836002811115610e6157610e616117d3565b02179055506020828101516001838101919091556040808501516002850180546001600160a01b0319166001600160a01b0390921691909117905560608501516003850155608085015160048086019190915560a090950151600590940193909355600087815260078352838120805460ff19168317905586815260099092529190209154610ef0919061182b565b815460018101835560009283526020909220909101556001600160a01b038616610f8357843414610f3757604051634d98a88760e11b8152600481018390526024016104e6565b60008381526006602052604081208054349290610f559084906117ff565b909155505060008281526005602052604081208054349290610f789084906117ff565b909155506110619050565b6040516323b872dd60e01b8152336004820152306024820152604481018690526001600160a01b038716906323b872dd906064016020604051808303816000875af1158015610fd6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ffa9190611707565b61101a57604051634d98a88760e11b8152600481018390526024016104e6565b600083815260066020526040812080548792906110389084906117ff565b90915550506000828152600560205260408120805487929061105b9084906117ff565b90915550505b604051339061107190899061183e565b604051908190038120878252907f4af1fa071b9000a5158e59801a6779410006d4df8be38cc6dd395bc05eb9387d90602001610c9c565b6000546001600160a01b031633146103ec5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016104e6565b61110a611273565b6000805460ff60a01b191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b600085858585856040516020016111729594939291906118ac565b60405160208183030381529060405280519060200120905095945050505050565b600054600160a01b900460ff16156103ec5760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b60448201526064016104e6565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b611238611193565b6000805460ff60a01b1916600160a01b1790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25861113a3390565b600054600160a01b900460ff166103ec5760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b60448201526064016104e6565b6001600160a01b0381168114610d5c57600080fd5b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715611317576113176112d8565b604052919050565b600067ffffffffffffffff821115611339576113396112d8565b50601f01601f191660200190565b600082601f83011261135857600080fd5b813561136b6113668261131f565b6112ee565b81815284602083860101111561138057600080fd5b816020850160208301376000918101602001919091529392505050565b600080600080608085870312156113b357600080fd5b84356113be816112c3565b9350602085013567ffffffffffffffff8111156113da57600080fd5b6113e687828801611347565b93505060408501356113f7816112c3565b9396929550929360600135925050565b6000806040838503121561141a57600080fd5b823567ffffffffffffffff81111561143157600080fd5b61143d85828601611347565b925050602083013561144e816112c3565b809150509250929050565b60006020828403121561146b57600080fd5b8135611476816112c3565b9392505050565b6000806040838503121561149057600080fd5b823561149b816112c3565b9150602083013561144e816112c3565b6000602082840312156114bd57600080fd5b5035919050565b6000806000606084860312156114d957600080fd5b833567ffffffffffffffff8111156114f057600080fd5b6114fc86828701611347565b935050602084013561150d816112c3565b929592945050506040919091013590565b6000806000806080858703121561153457600080fd5b843567ffffffffffffffff81111561154b57600080fd5b61155787828801611347565b9450506020850135611568816112c3565b93969395505050506040820135916060013590565b60005b83811015611598578181015183820152602001611580565b50506000910152565b600082601f8301126115b257600080fd5b81516115c06113668261131f565b8181528460208386010111156115d557600080fd5b6115e682602083016020870161157d565b949350505050565b60006020828403121561160057600080fd5b815167ffffffffffffffff8082111561161857600080fd5b908301906060828603121561162c57600080fd5b604051606081018181108382111715611647576116476112d8565b60405282518281111561165957600080fd5b611665878286016115a1565b8252506020830151602082015260408301518281111561168457600080fd5b611690878286016115a1565b60408301525095945050505050565b600081518084526116b781602086016020860161157d565b601f01601f19169290920160200192915050565b6080815260006116de608083018761169f565b85602084015284604084015282810360608401526116fc818561169f565b979650505050505050565b60006020828403121561171957600080fd5b8151801515811461147657600080fd5b602081526000825160606020840152611745608084018261169f565b9050602084015160408401526040840151601f1984830301606085015261041c828261169f565b6000806040838503121561177f57600080fd5b825161178a816112c3565b602084015190925067ffffffffffffffff8111156117a757600080fd5b6117b3858286016115a1565b9150509250929050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052601160045260246000fd5b808201808211156107ff576107ff6117e9565b600060018201611824576118246117e9565b5060010190565b818103818111156107ff576107ff6117e9565b6000825161185081846020870161157d565b9190910192915050565b60006020828403121561186c57600080fd5b5051919050565b80820281158282048414176107ff576107ff6117e9565b6000826118a757634e487b7160e01b600052601260045260246000fd5b500490565b60006bffffffffffffffffffffffff19808860601b16835286516118d7816014860160208b0161157d565b8651908401906118ee816014840160208b0161157d565b60609690961b919091169401601481019490945250506028820152604801939250505056fea2646970667358221220416c92937a72d454d4b22461614b498e9027beedbff9b6a82fc023b85149471f64736f6c63430008150033

Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)

0000000000000000000000000cbc65909efe3d6fe589dfffb2ac86350b25fcc86f50f38d71230bc1da1593cbedc1433f12a671cb69571a08d39bfafd2e21c5ce

-----Decoded View---------------
Arg [0] : initVerifier (address): 0x0cbC65909eFE3d6fE589DfFFb2aC86350b25Fcc8
Arg [1] : initImgId (bytes32): 0x6f50f38d71230bc1da1593cbedc1433f12a671cb69571a08d39bfafd2e21c5ce

-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 0000000000000000000000000cbc65909efe3d6fe589dfffb2ac86350b25fcc8
Arg [1] : 6f50f38d71230bc1da1593cbedc1433f12a671cb69571a08d39bfafd2e21c5ce


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
[ Download: CSV Export  ]
[ Download: CSV Export  ]

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.