ETH Price: $2,781.35 (+5.40%)
Gas: 1.06 Gwei
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Token Holdings

Transaction Hash
Method
Block
From
To
Withdraw Deposit...217824132025-02-05 19:34:111 hr ago1738784051IN
0x4a3826bD...e0d825238
0 ETH0.000206122.5306827
Withdraw Deposit...217820142025-02-05 18:14:233 hrs ago1738779263IN
0x4a3826bD...e0d825238
0 ETH0.000307453.77417783
Extend Deposit217820092025-02-05 18:13:233 hrs ago1738779203IN
0x4a3826bD...e0d825238
0 ETH0.000131083.2160611
Withdraw Deposit...217818732025-02-05 17:46:113 hrs ago1738777571IN
0x4a3826bD...e0d825238
0 ETH0.000183852.25694353
Withdraw Deposit...217818302025-02-05 17:37:353 hrs ago1738777055IN
0x4a3826bD...e0d825238
0 ETH0.000290253.56304236
Withdraw Deposit...217817692025-02-05 17:25:234 hrs ago1738776323IN
0x4a3826bD...e0d825238
0 ETH0.000262312.66144421
Extend Deposit217813002025-02-05 15:50:475 hrs ago1738770647IN
0x4a3826bD...e0d825238
0 ETH0.000104352.56031805
Extend Deposit217812892025-02-05 15:48:355 hrs ago1738770515IN
0x4a3826bD...e0d825238
0 ETH0.000113632.7879849
Extend Deposit217811572025-02-05 15:22:116 hrs ago1738768931IN
0x4a3826bD...e0d825238
0 ETH0.000138623.4
Extend Deposit217811492025-02-05 15:20:356 hrs ago1738768835IN
0x4a3826bD...e0d825238
0 ETH0.000132823.25784824
Withdraw Deposit...217810962025-02-05 15:09:596 hrs ago1738768199IN
0x4a3826bD...e0d825238
0 ETH0.00029062.94882716
Extend Deposit217808522025-02-05 14:20:597 hrs ago1738765259IN
0x4a3826bD...e0d825238
0 ETH0.000076081.86655825
Withdraw Deposit...217807742025-02-05 14:05:237 hrs ago1738764323IN
0x4a3826bD...e0d825238
0 ETH0.000162361.99307917
Extend Deposit217806932025-02-05 13:49:117 hrs ago1738763351IN
0x4a3826bD...e0d825238
0 ETH0.000073461.81348702
Extend Deposit217805412025-02-05 13:18:358 hrs ago1738761515IN
0x4a3826bD...e0d825238
0 ETH0.000067561.65721721
Withdraw Deposit...217799212025-02-05 11:13:2310 hrs ago1738754003IN
0x4a3826bD...e0d825238
0 ETH0.000186782.29316808
Withdraw Deposit...217797932025-02-05 10:47:3510 hrs ago1738752455IN
0x4a3826bD...e0d825238
0 ETH0.000160541.97101069
Withdraw Deposit...217795762025-02-05 10:03:5911 hrs ago1738749839IN
0x4a3826bD...e0d825238
0 ETH0.00015041.84624307
Withdraw Deposit...217795602025-02-05 10:00:4711 hrs ago1738749647IN
0x4a3826bD...e0d825238
0 ETH0.000148371.82139966
Withdraw Deposit...217794932025-02-05 9:47:1111 hrs ago1738748831IN
0x4a3826bD...e0d825238
0 ETH0.000168191.70649093
Withdraw Deposit...217794152025-02-05 9:31:3512 hrs ago1738747895IN
0x4a3826bD...e0d825238
0 ETH0.000149691.83764039
Withdraw Deposit...217790972025-02-05 8:27:5913 hrs ago1738744079IN
0x4a3826bD...e0d825238
0 ETH0.000139071.70742605
Withdraw Deposit...217789112025-02-05 7:50:3513 hrs ago1738741835IN
0x4a3826bD...e0d825238
0 ETH0.000136871.68018246
Withdraw Deposit...217787932025-02-05 7:26:5914 hrs ago1738740419IN
0x4a3826bD...e0d825238
0 ETH0.000136551.38559479
Withdraw Deposit...217785482025-02-05 6:37:1114 hrs ago1738737431IN
0x4a3826bD...e0d825238
0 ETH0.000184261.4
View all transactions

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
PrimeCaching

Compiler Version
v0.8.20+commit.a1b79de6

Optimization Enabled:
No with 200 runs

Other Settings:
paris EvmVersion
File 1 of 8 : PrimeCaching.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.20;

import {Context} from "@openzeppelin/contracts/utils/Context.sol";
import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";

import {IPrimeCaching, Deposit} from "./interfaces/IPrimeCaching.sol";
import {IInvokeEchelonHandler} from "./interfaces/IInvokeEchelonHandler.sol";

/**
 * @title PrimeCaching
 * @notice Contract for caching PRIME tokens
 */
contract PrimeCaching is Context, IPrimeCaching, IInvokeEchelonHandler {
    using SafeERC20 for IERC20;

    /// @notice Deposit mapping for each user
    mapping(address => Deposit[]) public deposits;

    /// @notice Prime token
    IERC20 public primeToken;

    /// @notice Final timestamp for lock duration
    uint256 public immutable MAX_LOCK_TIMESTAMP;

    /// @notice Maximum lock duration, 3 years
    uint256 public constant MAX_LOCK_DURATION = 1095 days;

    constructor(address primeTokenAddress, uint256 maxLockTimestamp) {
        primeToken = IERC20(primeTokenAddress);
        MAX_LOCK_TIMESTAMP = maxLockTimestamp;
    }

    /**
     * @notice Function invoked by the prime token contract to handle totalCardCount increase and emit payment event
     * @param from The address of the original msg.sender
     * @param primeAmount The amount of prime that was sent from the prime token contract
     * @param data Catch-all param to allow the caller to pass additional data to the handler,
     *      includes the lock duration of the deposit
     */
    function handleInvokeEchelon(
        address from,
        address,
        address,
        uint256,
        uint256,
        uint256 primeAmount,
        bytes memory data
    ) external payable {
        require(_msgSender() == address(primeToken), "Invalid invoker");

        require(primeAmount > 1 ether, "Amount must be greater than one");

        uint256 lockDuration = abi.decode(data, (uint256));

        uint256 endTimestamp = _getEndTimestamp(
            lockDuration,
            block.timestamp,
            block.timestamp
        );

        deposits[from].push(
            Deposit(
                primeAmount,
                endTimestamp,
                block.timestamp,
                block.timestamp,
                false
            )
        );

        emit DepositCreated(
            from,
            deposits[from].length - 1,
            primeAmount,
            endTimestamp,
            block.timestamp
        );
    }

    /**
     * @notice Extends the lock duration of a deposit
     * @param depositIndex Index of the deposit to extend
     * @param lockDuration Duration in seconds to extend the lock
     *      Use type(uint256).max for infinite lock duration
     */
    function extendDeposit(
        uint256 depositIndex,
        uint256 lockDuration
    ) external {
        require(
            depositIndex < deposits[_msgSender()].length,
            "Invalid deposit index"
        );

        Deposit storage deposit = deposits[_msgSender()][depositIndex];
        require(
            block.timestamp < deposit.endTimestamp,
            "Deposit has already ended"
        );

        deposit.endTimestamp = _getEndTimestamp(
            lockDuration,
            deposit.endTimestamp,
            deposit.createdTimestamp
        );

        deposit.updatedTimestamp = block.timestamp;

        emit DepositExtended(
            _msgSender(),
            depositIndex,
            deposit.endTimestamp,
            deposit.createdTimestamp,
            deposit.updatedTimestamp
        );
    }

    /**
     * @notice Gets the number of deposits for a user
     * @param user The address of the user
     */
    function getDepositCount(address user) external view returns (uint256) {
        return deposits[user].length;
    }

    /**
     * Returns list of deposits for a user
     * @param user The address of the user
     * @param fromIndex The starting index of the deposits
     * @param toIndex The ending index of the deposits
     * @return depositList List deposit info
     */
    function getDeposits(
        address user,
        uint256 fromIndex,
        uint256 toIndex
    ) external view returns (Deposit[] memory depositList) {
        require(fromIndex <= toIndex, "Invalid index inputs");
        require(toIndex < deposits[user].length, "Invalid index range");

        uint256 numDeposits = toIndex - fromIndex + 1;
        depositList = new Deposit[](numDeposits);

        for (uint256 i = 0; i < numDeposits; i++) {
            depositList[i] = deposits[user][fromIndex + i];
        }
    }

    /**
     * @notice Withdraws list of deposits
     * @param depositIndexes Indexes of deposits to withdraw
     */
    function withdrawDeposits(uint256[] calldata depositIndexes) external {
        uint256 totalAmount = 0;

        for (uint256 i = 0; i < depositIndexes.length; i++) {
            require(
                depositIndexes[i] < deposits[_msgSender()].length,
                "Invalid deposit index"
            );

            Deposit storage deposit = deposits[_msgSender()][depositIndexes[i]];
            require(
                block.timestamp >= deposit.endTimestamp,
                "Deposit has not ended yet"
            );
            require(!deposit.isWithdrawn, "Deposit has already been withdrawn");

            deposit.isWithdrawn = true;
            deposit.updatedTimestamp = block.timestamp;
            totalAmount += deposit.amount;
        }

        primeToken.safeTransfer(_msgSender(), totalAmount);

        emit DepositsWithdrawn(
            _msgSender(),
            depositIndexes,
            totalAmount,
            block.timestamp
        );
    }

    /**
     * @notice Gets the end timestamp of a deposit
     * @param lockDuration Duration in seconds to extend the lock
     * @param endTimestamp End timestamp of the deposit
     * @param createdTimestamp Created timestamp of the deposit
     */
    function _getEndTimestamp(
        uint256 lockDuration,
        uint256 endTimestamp,
        uint256 createdTimestamp
    ) internal view returns (uint256) {
        require(
            lockDuration >= 21 days,
            "Lock duration must be at least 21 days"
        );

        if (lockDuration == type(uint256).max) {
            if (createdTimestamp + MAX_LOCK_DURATION > MAX_LOCK_TIMESTAMP) {
                return MAX_LOCK_TIMESTAMP;
            } else {
                return createdTimestamp + MAX_LOCK_DURATION;
            }
        } else {
            if (
                lockDuration > MAX_LOCK_DURATION ||
                lockDuration + endTimestamp > MAX_LOCK_TIMESTAMP ||
                endTimestamp - createdTimestamp + lockDuration >
                MAX_LOCK_DURATION
            ) {
                revert("Total lock duration must be less than 1095 days");
            }

            return endTimestamp + lockDuration;
        }
    }
}

File 2 of 8 : IERC20Permit.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/extensions/IERC20Permit.sol)

pragma solidity ^0.8.20;

/**
 * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
 * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
 *
 * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
 * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't
 * need to send a transaction, and thus is not required to hold Ether at all.
 *
 * ==== Security Considerations
 *
 * There are two important considerations concerning the use of `permit`. The first is that a valid permit signature
 * expresses an allowance, and it should not be assumed to convey additional meaning. In particular, it should not be
 * considered as an intention to spend the allowance in any specific way. The second is that because permits have
 * built-in replay protection and can be submitted by anyone, they can be frontrun. A protocol that uses permits should
 * take this into consideration and allow a `permit` call to fail. Combining these two aspects, a pattern that may be
 * generally recommended is:
 *
 * ```solidity
 * function doThingWithPermit(..., uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public {
 *     try token.permit(msg.sender, address(this), value, deadline, v, r, s) {} catch {}
 *     doThing(..., value);
 * }
 *
 * function doThing(..., uint256 value) public {
 *     token.safeTransferFrom(msg.sender, address(this), value);
 *     ...
 * }
 * ```
 *
 * Observe that: 1) `msg.sender` is used as the owner, leaving no ambiguity as to the signer intent, and 2) the use of
 * `try/catch` allows the permit to fail and makes the code tolerant to frontrunning. (See also
 * {SafeERC20-safeTransferFrom}).
 *
 * Additionally, note that smart contract wallets (such as Argent or Safe) are not able to produce permit signatures, so
 * contracts should have entry points that don't rely on permit.
 */
interface IERC20Permit {
    /**
     * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,
     * given ``owner``'s signed approval.
     *
     * IMPORTANT: The same issues {IERC20-approve} has related to transaction
     * ordering also apply here.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `deadline` must be a timestamp in the future.
     * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`
     * over the EIP712-formatted function arguments.
     * - the signature must use ``owner``'s current nonce (see {nonces}).
     *
     * For more information on the signature format, see the
     * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP
     * section].
     *
     * CAUTION: See Security Considerations above.
     */
    function permit(
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external;

    /**
     * @dev Returns the current nonce for `owner`. This value must be
     * included whenever a signature is generated for {permit}.
     *
     * Every successful call to {permit} increases ``owner``'s nonce by one. This
     * prevents a signature from being used multiple times.
     */
    function nonces(address owner) external view returns (uint256);

    /**
     * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.
     */
    // solhint-disable-next-line func-name-mixedcase
    function DOMAIN_SEPARATOR() external view returns (bytes32);
}

File 3 of 8 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.20;

/**
 * @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 value of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

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

    /**
     * @dev Moves a `value` amount of 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 value) 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 a `value` amount of tokens 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 value) external returns (bool);

    /**
     * @dev Moves a `value` amount of tokens from `from` to `to` using the
     * allowance mechanism. `value` 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 value) external returns (bool);
}

File 4 of 8 : SafeERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.20;

import {IERC20} from "../IERC20.sol";
import {IERC20Permit} from "../extensions/IERC20Permit.sol";
import {Address} from "../../../utils/Address.sol";

/**
 * @title SafeERC20
 * @dev Wrappers around ERC20 operations that throw on failure (when the token
 * contract returns false). Tokens that return no value (and instead revert or
 * throw on failure) are also supported, non-reverting calls are assumed to be
 * successful.
 * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
 * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
 */
library SafeERC20 {
    using Address for address;

    /**
     * @dev An operation with an ERC20 token failed.
     */
    error SafeERC20FailedOperation(address token);

    /**
     * @dev Indicates a failed `decreaseAllowance` request.
     */
    error SafeERC20FailedDecreaseAllowance(address spender, uint256 currentAllowance, uint256 requestedDecrease);

    /**
     * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     */
    function safeTransfer(IERC20 token, address to, uint256 value) internal {
        _callOptionalReturn(token, abi.encodeCall(token.transfer, (to, value)));
    }

    /**
     * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the
     * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.
     */
    function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
        _callOptionalReturn(token, abi.encodeCall(token.transferFrom, (from, to, value)));
    }

    /**
     * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     */
    function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
        uint256 oldAllowance = token.allowance(address(this), spender);
        forceApprove(token, spender, oldAllowance + value);
    }

    /**
     * @dev Decrease the calling contract's allowance toward `spender` by `requestedDecrease`. If `token` returns no
     * value, non-reverting calls are assumed to be successful.
     */
    function safeDecreaseAllowance(IERC20 token, address spender, uint256 requestedDecrease) internal {
        unchecked {
            uint256 currentAllowance = token.allowance(address(this), spender);
            if (currentAllowance < requestedDecrease) {
                revert SafeERC20FailedDecreaseAllowance(spender, currentAllowance, requestedDecrease);
            }
            forceApprove(token, spender, currentAllowance - requestedDecrease);
        }
    }

    /**
     * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval
     * to be set to zero before setting it to a non-zero value, such as USDT.
     */
    function forceApprove(IERC20 token, address spender, uint256 value) internal {
        bytes memory approvalCall = abi.encodeCall(token.approve, (spender, value));

        if (!_callOptionalReturnBool(token, approvalCall)) {
            _callOptionalReturn(token, abi.encodeCall(token.approve, (spender, 0)));
            _callOptionalReturn(token, approvalCall);
        }
    }

    /**
     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
     * on the return value: the return value is optional (but if data is returned, it must not be false).
     * @param token The token targeted by the call.
     * @param data The call data (encoded using abi.encode or one of its variants).
     */
    function _callOptionalReturn(IERC20 token, bytes memory data) private {
        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
        // we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that
        // the target address contains contract code and also asserts for success in the low-level call.

        bytes memory returndata = address(token).functionCall(data);
        if (returndata.length != 0 && !abi.decode(returndata, (bool))) {
            revert SafeERC20FailedOperation(address(token));
        }
    }

    /**
     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
     * on the return value: the return value is optional (but if data is returned, it must not be false).
     * @param token The token targeted by the call.
     * @param data The call data (encoded using abi.encode or one of its variants).
     *
     * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.
     */
    function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {
        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
        // we're implementing it ourselves. We cannot use {Address-functionCall} here since this should return false
        // and not revert is the subcall reverts.

        (bool success, bytes memory returndata) = address(token).call(data);
        return success && (returndata.length == 0 || abi.decode(returndata, (bool))) && address(token).code.length > 0;
    }
}

File 5 of 8 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/Address.sol)

pragma solidity ^0.8.20;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev The ETH balance of the account is not enough to perform the operation.
     */
    error AddressInsufficientBalance(address account);

    /**
     * @dev There's no code at `target` (it is not a contract).
     */
    error AddressEmptyCode(address target);

    /**
     * @dev A call to an address target failed. The target may have reverted.
     */
    error FailedInnerCall();

    /**
     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to
     * `recipient`, forwarding all available gas and reverting on errors.
     *
     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
     * of certain opcodes, possibly making contracts go over the 2300 gas limit
     * imposed by `transfer`, making them unable to receive funds via
     * `transfer`. {sendValue} removes this limitation.
     *
     * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].
     *
     * IMPORTANT: because control is transferred to `recipient`, care must be
     * taken to not create reentrancy vulnerabilities. Consider using
     * {ReentrancyGuard} or the
     * https://solidity.readthedocs.io/en/v0.8.20/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        if (address(this).balance < amount) {
            revert AddressInsufficientBalance(address(this));
        }

        (bool success, ) = recipient.call{value: amount}("");
        if (!success) {
            revert FailedInnerCall();
        }
    }

    /**
     * @dev Performs a Solidity function call using a low level `call`. A
     * plain `call` is an unsafe replacement for a function call: use this
     * function instead.
     *
     * If `target` reverts with a revert reason or custom error, it is bubbled
     * up by this function (like regular Solidity function calls). However, if
     * the call reverted with no returned reason, this function reverts with a
     * {FailedInnerCall} error.
     *
     * Returns the raw returned data. To convert to the expected return value,
     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
     *
     * Requirements:
     *
     * - `target` must be a contract.
     * - calling `target` with `data` must not revert.
     */
    function functionCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but also transferring `value` wei to `target`.
     *
     * Requirements:
     *
     * - the calling contract must have an ETH balance of at least `value`.
     * - the called Solidity function must be `payable`.
     */
    function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
        if (address(this).balance < value) {
            revert AddressInsufficientBalance(address(this));
        }
        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResultFromTarget(target, success, returndata);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a static call.
     */
    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResultFromTarget(target, success, returndata);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a delegate call.
     */
    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResultFromTarget(target, success, returndata);
    }

    /**
     * @dev Tool to verify that a low level call to smart-contract was successful, and reverts if the target
     * was not a contract or bubbling up the revert reason (falling back to {FailedInnerCall}) in case of an
     * unsuccessful call.
     */
    function verifyCallResultFromTarget(
        address target,
        bool success,
        bytes memory returndata
    ) internal view returns (bytes memory) {
        if (!success) {
            _revert(returndata);
        } else {
            // only check if target is a contract if the call was successful and the return data is empty
            // otherwise we already know that it was a contract
            if (returndata.length == 0 && target.code.length == 0) {
                revert AddressEmptyCode(target);
            }
            return returndata;
        }
    }

    /**
     * @dev Tool to verify that a low level call was successful, and reverts if it wasn't, either by bubbling the
     * revert reason or with a default {FailedInnerCall} error.
     */
    function verifyCallResult(bool success, bytes memory returndata) internal pure returns (bytes memory) {
        if (!success) {
            _revert(returndata);
        } else {
            return returndata;
        }
    }

    /**
     * @dev Reverts with returndata if present. Otherwise reverts with {FailedInnerCall}.
     */
    function _revert(bytes memory returndata) private pure {
        // Look for revert reason and bubble it up if present
        if (returndata.length > 0) {
            // The easiest way to bubble the revert reason is using memory via assembly
            /// @solidity memory-safe-assembly
            assembly {
                let returndata_size := mload(returndata)
                revert(add(32, returndata), returndata_size)
            }
        } else {
            revert FailedInnerCall();
        }
    }
}

File 6 of 8 : Context.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)

pragma solidity ^0.8.20;

/**
 * @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;
    }

    function _contextSuffixLength() internal view virtual returns (uint256) {
        return 0;
    }
}

File 7 of 8 : IInvokeEchelonHandler.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.20;

interface IInvokeEchelonHandler {
    // Invoked by the Prime Token contract to handle arbitrary functionalities by the given gateway
    function handleInvokeEchelon(
        address from,
        address ethDestination,
        address primeDestination,
        uint256 id,
        uint256 ethValue,
        uint256 primeValue,
        bytes calldata data
    ) external payable;
}

File 8 of 8 : IPrimeCaching.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.20;

struct Deposit {
    uint256 amount;
    uint256 endTimestamp;
    uint256 createdTimestamp;
    uint256 updatedTimestamp;
    bool isWithdrawn;
}

interface IPrimeCaching {
    event DepositCreated(
        address indexed user,
        uint256 depositIndex,
        uint256 amount,
        uint256 endTimestamp,
        uint256 createdTimestamp
    );
    event DepositExtended(
        address indexed user,
        uint256 depositIndex,
        uint256 endTimestamp,
        uint256 createdTimestamp,
        uint256 updatedTimestamp
    );
    event DepositsWithdrawn(
        address indexed user,
        uint256[] depositIndexes,
        uint256 totalAmount,
        uint256 updatedTimestamp
    );

    function extendDeposit(uint256 depositIndex, uint256 lockDuration) external;

    function getDepositCount(address user) external view returns (uint256);

    function getDeposits(
        address user,
        uint256 fromIndex,
        uint256 toIndex
    ) external view returns (Deposit[] memory);

    function withdrawDeposits(uint256[] calldata depositIndexes) external;
}

Settings
{
  "evmVersion": "paris",
  "optimizer": {
    "enabled": false,
    "runs": 200
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"primeTokenAddress","type":"address"},{"internalType":"uint256","name":"maxLockTimestamp","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"target","type":"address"}],"name":"AddressEmptyCode","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"AddressInsufficientBalance","type":"error"},{"inputs":[],"name":"FailedInnerCall","type":"error"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"SafeERC20FailedOperation","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"depositIndex","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"endTimestamp","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"createdTimestamp","type":"uint256"}],"name":"DepositCreated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"depositIndex","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"endTimestamp","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"createdTimestamp","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"updatedTimestamp","type":"uint256"}],"name":"DepositExtended","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256[]","name":"depositIndexes","type":"uint256[]"},{"indexed":false,"internalType":"uint256","name":"totalAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"updatedTimestamp","type":"uint256"}],"name":"DepositsWithdrawn","type":"event"},{"inputs":[],"name":"MAX_LOCK_DURATION","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_LOCK_TIMESTAMP","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"deposits","outputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"endTimestamp","type":"uint256"},{"internalType":"uint256","name":"createdTimestamp","type":"uint256"},{"internalType":"uint256","name":"updatedTimestamp","type":"uint256"},{"internalType":"bool","name":"isWithdrawn","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"depositIndex","type":"uint256"},{"internalType":"uint256","name":"lockDuration","type":"uint256"}],"name":"extendDeposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"getDepositCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint256","name":"fromIndex","type":"uint256"},{"internalType":"uint256","name":"toIndex","type":"uint256"}],"name":"getDeposits","outputs":[{"components":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"endTimestamp","type":"uint256"},{"internalType":"uint256","name":"createdTimestamp","type":"uint256"},{"internalType":"uint256","name":"updatedTimestamp","type":"uint256"},{"internalType":"bool","name":"isWithdrawn","type":"bool"}],"internalType":"struct Deposit[]","name":"depositList","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"primeAmount","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"handleInvokeEchelon","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"primeToken","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"depositIndexes","type":"uint256[]"}],"name":"withdrawDeposits","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60a06040523480156200001157600080fd5b506040516200220b3803806200220b83398181016040528101906200003791906200012d565b81600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508060808181525050505062000174565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000620000ba826200008d565b9050919050565b620000cc81620000ad565b8114620000d857600080fd5b50565b600081519050620000ec81620000c1565b92915050565b6000819050919050565b6200010781620000f2565b81146200011357600080fd5b50565b6000815190506200012781620000fc565b92915050565b6000806040838503121562000147576200014662000088565b5b60006200015785828601620000db565b92505060206200016a8582860162000116565b9150509250929050565b608051612066620001a56000396000818161023701528181610d8601528181610dbd0152610e0901526120666000f3fe6080604052600436106100865760003560e01c80634f1bfc9e116100595780634f1bfc9e14610138578063b1adef7914610163578063d6d681771461018c578063e1584a2a146101cd578063fe5a451a1461020a57610086565b8063096d3b891461008b57806313fcaf54146100b6578063427a0a17146100f35780634ceb6dfe1461011c575b600080fd5b34801561009757600080fd5b506100a0610235565b6040516100ad9190611148565b60405180910390f35b3480156100c257600080fd5b506100dd60048036038101906100d891906111d5565b610259565b6040516100ea9190611148565b60405180910390f35b3480156100ff57600080fd5b5061011a60048036038101906101159190611267565b6102a4565b005b61013660048036038101906101319190611421565b610572565b005b34801561014457600080fd5b5061014d610801565b60405161015a9190611148565b60405180910390f35b34801561016f57600080fd5b5061018a600480360381019061018591906114df565b610809565b005b34801561019857600080fd5b506101b360048036038101906101ae919061151f565b6109d2565b6040516101c495949392919061157a565b60405180910390f35b3480156101d957600080fd5b506101f460048036038101906101ef91906115cd565b610a32565b6040516102019190611755565b60405180910390f35b34801561021657600080fd5b5061021f610c68565b60405161022c91906117d6565b60405180910390f35b7f000000000000000000000000000000000000000000000000000000000000000081565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805490509050919050565b6000805b838390508110156104bd576000806102be610c8e565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208054905084848381811061030f5761030e6117f1565b5b9050602002013510610356576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161034d9061187d565b60405180910390fd5b6000806000610363610c8e565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208585848181106103b0576103af6117f1565b5b90506020020135815481106103c8576103c76117f1565b5b90600052602060002090600502019050806001015442101561041f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610416906118e9565b60405180910390fd5b8060040160009054906101000a900460ff1615610471576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104689061197b565b60405180910390fd5b60018160040160006101000a81548160ff0219169083151502179055504281600301819055508060000154836104a791906119ca565b92505080806104b5906119fe565b9150506102a8565b506105126104c9610c8e565b82600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610c969092919063ffffffff16565b61051a610c8e565b73ffffffffffffffffffffffffffffffffffffffff167f895945fd510ab8b9524cccfcc9841758f68c28fc806b2138f32ebb5cbce58787848484426040516105659493929190611ac1565b60405180910390a2505050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166105b3610c8e565b73ffffffffffffffffffffffffffffffffffffffff1614610609576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161060090611b4d565b60405180910390fd5b670de0b6b3a76400008211610653576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161064a90611bb9565b60405180910390fd5b6000818060200190518101906106699190611bee565b90506000610678824242610d15565b90506000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206040518060a001604052808681526020018381526020014281526020014281526020016000151581525090806001815401808255809150506001900390600052602060002090600502016000909190919091506000820151816000015560208201518160010155604082015181600201556060820151816003015560808201518160040160006101000a81548160ff02191690831515021790555050508873ffffffffffffffffffffffffffffffffffffffff167f554f20505671494900b631b0e443e9e7a59743ec9889b05e28d8ac9ea158266b60016000808d73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805490506107db9190611c1b565b8684426040516107ee9493929190611c4f565b60405180910390a2505050505050505050565b6305a39a8081565b600080610814610c8e565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805490508210610893576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161088a9061187d565b60405180910390fd5b60008060006108a0610c8e565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002083815481106108ec576108eb6117f1565b5b9060005260206000209060050201905080600101544210610942576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161093990611ce0565b60405180910390fd5b6109558282600101548360020154610d15565b816001018190555042816003018190555061096e610c8e565b73ffffffffffffffffffffffffffffffffffffffff167f431443e9d10bd3a688b8f8554f4c479262ae505022d7b37c3d6849f8ef7324f6848360010154846002015485600301546040516109c59493929190611c4f565b60405180910390a2505050565b600060205281600052604060002081815481106109ee57600080fd5b9060005260206000209060050201600091509150508060000154908060010154908060020154908060030154908060040160009054906101000a900460ff16905085565b606081831115610a77576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a6e90611d4c565b60405180910390fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805490508210610afa576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610af190611db8565b60405180910390fd5b600060018484610b0a9190611c1b565b610b1491906119ca565b90508067ffffffffffffffff811115610b3057610b2f6112f6565b5b604051908082528060200260200182016040528015610b6957816020015b610b566110fe565b815260200190600190039081610b4e5790505b50915060005b81811015610c5f576000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208186610bc191906119ca565b81548110610bd257610bd16117f1565b5b90600052602060002090600502016040518060a0016040529081600082015481526020016001820154815260200160028201548152602001600382015481526020016004820160009054906101000a900460ff161515151581525050838281518110610c4157610c406117f1565b5b60200260200101819052508080610c57906119fe565b915050610b6f565b50509392505050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600033905090565b610d10838473ffffffffffffffffffffffffffffffffffffffff1663a9059cbb8585604051602401610cc9929190611de7565b604051602081830303815290604052915060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050610eb0565b505050565b6000621baf80841015610d5d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d5490611e82565b60405180910390fd5b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8403610dfa577f00000000000000000000000000000000000000000000000000000000000000006305a39a8083610db591906119ca565b1115610de3577f00000000000000000000000000000000000000000000000000000000000000009050610ea9565b6305a39a8082610df391906119ca565b9050610ea9565b6305a39a80841180610e3657507f00000000000000000000000000000000000000000000000000000000000000008385610e3491906119ca565b115b80610e5a57506305a39a80848385610e4e9190611c1b565b610e5891906119ca565b115b15610e9a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e9190611f14565b60405180910390fd5b8383610ea691906119ca565b90505b9392505050565b6000610edb828473ffffffffffffffffffffffffffffffffffffffff16610f4790919063ffffffff16565b90506000815114158015610f00575080806020019051810190610efe9190611f60565b155b15610f4257826040517f5274afe7000000000000000000000000000000000000000000000000000000008152600401610f399190611f8d565b60405180910390fd5b505050565b6060610f5583836000610f5d565b905092915050565b606081471015610fa457306040517fcd786059000000000000000000000000000000000000000000000000000000008152600401610f9b9190611f8d565b60405180910390fd5b6000808573ffffffffffffffffffffffffffffffffffffffff168486604051610fcd9190612019565b60006040518083038185875af1925050503d806000811461100a576040519150601f19603f3d011682016040523d82523d6000602084013e61100f565b606091505b509150915061101f86838361102a565b925050509392505050565b60608261103f5761103a826110b9565b6110b1565b60008251148015611067575060008473ffffffffffffffffffffffffffffffffffffffff163b145b156110a957836040517f9996b3150000000000000000000000000000000000000000000000000000000081526004016110a09190611f8d565b60405180910390fd5b8190506110b2565b5b9392505050565b6000815111156110cc5780518082602001fd5b6040517f1425ea4200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040518060a00160405280600081526020016000815260200160008152602001600081526020016000151581525090565b6000819050919050565b6111428161112f565b82525050565b600060208201905061115d6000830184611139565b92915050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006111a282611177565b9050919050565b6111b281611197565b81146111bd57600080fd5b50565b6000813590506111cf816111a9565b92915050565b6000602082840312156111eb576111ea61116d565b5b60006111f9848285016111c0565b91505092915050565b600080fd5b600080fd5b600080fd5b60008083601f84011261122757611226611202565b5b8235905067ffffffffffffffff81111561124457611243611207565b5b6020830191508360208202830111156112605761125f61120c565b5b9250929050565b6000806020838503121561127e5761127d61116d565b5b600083013567ffffffffffffffff81111561129c5761129b611172565b5b6112a885828601611211565b92509250509250929050565b6112bd8161112f565b81146112c857600080fd5b50565b6000813590506112da816112b4565b92915050565b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b61132e826112e5565b810181811067ffffffffffffffff8211171561134d5761134c6112f6565b5b80604052505050565b6000611360611163565b905061136c8282611325565b919050565b600067ffffffffffffffff82111561138c5761138b6112f6565b5b611395826112e5565b9050602081019050919050565b82818337600083830152505050565b60006113c46113bf84611371565b611356565b9050828152602081018484840111156113e0576113df6112e0565b5b6113eb8482856113a2565b509392505050565b600082601f83011261140857611407611202565b5b81356114188482602086016113b1565b91505092915050565b600080600080600080600060e0888a0312156114405761143f61116d565b5b600061144e8a828b016111c0565b975050602061145f8a828b016111c0565b96505060406114708a828b016111c0565b95505060606114818a828b016112cb565b94505060806114928a828b016112cb565b93505060a06114a38a828b016112cb565b92505060c088013567ffffffffffffffff8111156114c4576114c3611172565b5b6114d08a828b016113f3565b91505092959891949750929550565b600080604083850312156114f6576114f561116d565b5b6000611504858286016112cb565b9250506020611515858286016112cb565b9150509250929050565b600080604083850312156115365761153561116d565b5b6000611544858286016111c0565b9250506020611555858286016112cb565b9150509250929050565b60008115159050919050565b6115748161155f565b82525050565b600060a08201905061158f6000830188611139565b61159c6020830187611139565b6115a96040830186611139565b6115b66060830185611139565b6115c3608083018461156b565b9695505050505050565b6000806000606084860312156115e6576115e561116d565b5b60006115f4868287016111c0565b9350506020611605868287016112cb565b9250506040611616868287016112cb565b9150509250925092565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b6116558161112f565b82525050565b6116648161155f565b82525050565b60a082016000820151611680600085018261164c565b506020820151611693602085018261164c565b5060408201516116a6604085018261164c565b5060608201516116b9606085018261164c565b5060808201516116cc608085018261165b565b50505050565b60006116de838361166a565b60a08301905092915050565b6000602082019050919050565b600061170282611620565b61170c818561162b565b93506117178361163c565b8060005b8381101561174857815161172f88826116d2565b975061173a836116ea565b92505060018101905061171b565b5085935050505092915050565b6000602082019050818103600083015261176f81846116f7565b905092915050565b6000819050919050565b600061179c61179761179284611177565b611777565b611177565b9050919050565b60006117ae82611781565b9050919050565b60006117c0826117a3565b9050919050565b6117d0816117b5565b82525050565b60006020820190506117eb60008301846117c7565b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600082825260208201905092915050565b7f496e76616c6964206465706f73697420696e6465780000000000000000000000600082015250565b6000611867601583611820565b915061187282611831565b602082019050919050565b600060208201905081810360008301526118968161185a565b9050919050565b7f4465706f73697420686173206e6f7420656e6465642079657400000000000000600082015250565b60006118d3601983611820565b91506118de8261189d565b602082019050919050565b60006020820190508181036000830152611902816118c6565b9050919050565b7f4465706f7369742068617320616c7265616479206265656e207769746864726160008201527f776e000000000000000000000000000000000000000000000000000000000000602082015250565b6000611965602283611820565b915061197082611909565b604082019050919050565b6000602082019050818103600083015261199481611958565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006119d58261112f565b91506119e08361112f565b92508282019050808211156119f8576119f761199b565b5b92915050565b6000611a098261112f565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203611a3b57611a3a61199b565b5b600182019050919050565b600082825260208201905092915050565b600080fd5b82818337505050565b6000611a718385611a46565b93507f07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff831115611aa457611aa3611a57565b5b602083029250611ab5838584611a5c565b82840190509392505050565b60006060820190508181036000830152611adc818688611a65565b9050611aeb6020830185611139565b611af86040830184611139565b95945050505050565b7f496e76616c696420696e766f6b65720000000000000000000000000000000000600082015250565b6000611b37600f83611820565b9150611b4282611b01565b602082019050919050565b60006020820190508181036000830152611b6681611b2a565b9050919050565b7f416d6f756e74206d7573742062652067726561746572207468616e206f6e6500600082015250565b6000611ba3601f83611820565b9150611bae82611b6d565b602082019050919050565b60006020820190508181036000830152611bd281611b96565b9050919050565b600081519050611be8816112b4565b92915050565b600060208284031215611c0457611c0361116d565b5b6000611c1284828501611bd9565b91505092915050565b6000611c268261112f565b9150611c318361112f565b9250828203905081811115611c4957611c4861199b565b5b92915050565b6000608082019050611c646000830187611139565b611c716020830186611139565b611c7e6040830185611139565b611c8b6060830184611139565b95945050505050565b7f4465706f7369742068617320616c726561647920656e64656400000000000000600082015250565b6000611cca601983611820565b9150611cd582611c94565b602082019050919050565b60006020820190508181036000830152611cf981611cbd565b9050919050565b7f496e76616c696420696e64657820696e70757473000000000000000000000000600082015250565b6000611d36601483611820565b9150611d4182611d00565b602082019050919050565b60006020820190508181036000830152611d6581611d29565b9050919050565b7f496e76616c696420696e6465782072616e676500000000000000000000000000600082015250565b6000611da2601383611820565b9150611dad82611d6c565b602082019050919050565b60006020820190508181036000830152611dd181611d95565b9050919050565b611de181611197565b82525050565b6000604082019050611dfc6000830185611dd8565b611e096020830184611139565b9392505050565b7f4c6f636b206475726174696f6e206d757374206265206174206c65617374203260008201527f3120646179730000000000000000000000000000000000000000000000000000602082015250565b6000611e6c602683611820565b9150611e7782611e10565b604082019050919050565b60006020820190508181036000830152611e9b81611e5f565b9050919050565b7f546f74616c206c6f636b206475726174696f6e206d757374206265206c65737360008201527f207468616e203130393520646179730000000000000000000000000000000000602082015250565b6000611efe602f83611820565b9150611f0982611ea2565b604082019050919050565b60006020820190508181036000830152611f2d81611ef1565b9050919050565b611f3d8161155f565b8114611f4857600080fd5b50565b600081519050611f5a81611f34565b92915050565b600060208284031215611f7657611f7561116d565b5b6000611f8484828501611f4b565b91505092915050565b6000602082019050611fa26000830184611dd8565b92915050565b600081519050919050565b600081905092915050565b60005b83811015611fdc578082015181840152602081019050611fc1565b60008484015250505050565b6000611ff382611fa8565b611ffd8185611fb3565b935061200d818560208601611fbe565b80840191505092915050565b60006120258284611fe8565b91508190509291505056fea2646970667358221220b5f009e68c832ab8dc295790cf3640911c34ffbe53f98173a4e63f51e9e6d6b464736f6c63430008140033000000000000000000000000b23d80f5fefcddaa212212f028021b41ded428cf000000000000000000000000000000000000000000000000000000006c169b00

Deployed Bytecode

0x6080604052600436106100865760003560e01c80634f1bfc9e116100595780634f1bfc9e14610138578063b1adef7914610163578063d6d681771461018c578063e1584a2a146101cd578063fe5a451a1461020a57610086565b8063096d3b891461008b57806313fcaf54146100b6578063427a0a17146100f35780634ceb6dfe1461011c575b600080fd5b34801561009757600080fd5b506100a0610235565b6040516100ad9190611148565b60405180910390f35b3480156100c257600080fd5b506100dd60048036038101906100d891906111d5565b610259565b6040516100ea9190611148565b60405180910390f35b3480156100ff57600080fd5b5061011a60048036038101906101159190611267565b6102a4565b005b61013660048036038101906101319190611421565b610572565b005b34801561014457600080fd5b5061014d610801565b60405161015a9190611148565b60405180910390f35b34801561016f57600080fd5b5061018a600480360381019061018591906114df565b610809565b005b34801561019857600080fd5b506101b360048036038101906101ae919061151f565b6109d2565b6040516101c495949392919061157a565b60405180910390f35b3480156101d957600080fd5b506101f460048036038101906101ef91906115cd565b610a32565b6040516102019190611755565b60405180910390f35b34801561021657600080fd5b5061021f610c68565b60405161022c91906117d6565b60405180910390f35b7f000000000000000000000000000000000000000000000000000000006c169b0081565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805490509050919050565b6000805b838390508110156104bd576000806102be610c8e565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208054905084848381811061030f5761030e6117f1565b5b9050602002013510610356576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161034d9061187d565b60405180910390fd5b6000806000610363610c8e565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208585848181106103b0576103af6117f1565b5b90506020020135815481106103c8576103c76117f1565b5b90600052602060002090600502019050806001015442101561041f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610416906118e9565b60405180910390fd5b8060040160009054906101000a900460ff1615610471576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104689061197b565b60405180910390fd5b60018160040160006101000a81548160ff0219169083151502179055504281600301819055508060000154836104a791906119ca565b92505080806104b5906119fe565b9150506102a8565b506105126104c9610c8e565b82600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610c969092919063ffffffff16565b61051a610c8e565b73ffffffffffffffffffffffffffffffffffffffff167f895945fd510ab8b9524cccfcc9841758f68c28fc806b2138f32ebb5cbce58787848484426040516105659493929190611ac1565b60405180910390a2505050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166105b3610c8e565b73ffffffffffffffffffffffffffffffffffffffff1614610609576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161060090611b4d565b60405180910390fd5b670de0b6b3a76400008211610653576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161064a90611bb9565b60405180910390fd5b6000818060200190518101906106699190611bee565b90506000610678824242610d15565b90506000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206040518060a001604052808681526020018381526020014281526020014281526020016000151581525090806001815401808255809150506001900390600052602060002090600502016000909190919091506000820151816000015560208201518160010155604082015181600201556060820151816003015560808201518160040160006101000a81548160ff02191690831515021790555050508873ffffffffffffffffffffffffffffffffffffffff167f554f20505671494900b631b0e443e9e7a59743ec9889b05e28d8ac9ea158266b60016000808d73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805490506107db9190611c1b565b8684426040516107ee9493929190611c4f565b60405180910390a2505050505050505050565b6305a39a8081565b600080610814610c8e565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805490508210610893576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161088a9061187d565b60405180910390fd5b60008060006108a0610c8e565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002083815481106108ec576108eb6117f1565b5b9060005260206000209060050201905080600101544210610942576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161093990611ce0565b60405180910390fd5b6109558282600101548360020154610d15565b816001018190555042816003018190555061096e610c8e565b73ffffffffffffffffffffffffffffffffffffffff167f431443e9d10bd3a688b8f8554f4c479262ae505022d7b37c3d6849f8ef7324f6848360010154846002015485600301546040516109c59493929190611c4f565b60405180910390a2505050565b600060205281600052604060002081815481106109ee57600080fd5b9060005260206000209060050201600091509150508060000154908060010154908060020154908060030154908060040160009054906101000a900460ff16905085565b606081831115610a77576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a6e90611d4c565b60405180910390fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805490508210610afa576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610af190611db8565b60405180910390fd5b600060018484610b0a9190611c1b565b610b1491906119ca565b90508067ffffffffffffffff811115610b3057610b2f6112f6565b5b604051908082528060200260200182016040528015610b6957816020015b610b566110fe565b815260200190600190039081610b4e5790505b50915060005b81811015610c5f576000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208186610bc191906119ca565b81548110610bd257610bd16117f1565b5b90600052602060002090600502016040518060a0016040529081600082015481526020016001820154815260200160028201548152602001600382015481526020016004820160009054906101000a900460ff161515151581525050838281518110610c4157610c406117f1565b5b60200260200101819052508080610c57906119fe565b915050610b6f565b50509392505050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600033905090565b610d10838473ffffffffffffffffffffffffffffffffffffffff1663a9059cbb8585604051602401610cc9929190611de7565b604051602081830303815290604052915060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050610eb0565b505050565b6000621baf80841015610d5d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d5490611e82565b60405180910390fd5b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8403610dfa577f000000000000000000000000000000000000000000000000000000006c169b006305a39a8083610db591906119ca565b1115610de3577f000000000000000000000000000000000000000000000000000000006c169b009050610ea9565b6305a39a8082610df391906119ca565b9050610ea9565b6305a39a80841180610e3657507f000000000000000000000000000000000000000000000000000000006c169b008385610e3491906119ca565b115b80610e5a57506305a39a80848385610e4e9190611c1b565b610e5891906119ca565b115b15610e9a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e9190611f14565b60405180910390fd5b8383610ea691906119ca565b90505b9392505050565b6000610edb828473ffffffffffffffffffffffffffffffffffffffff16610f4790919063ffffffff16565b90506000815114158015610f00575080806020019051810190610efe9190611f60565b155b15610f4257826040517f5274afe7000000000000000000000000000000000000000000000000000000008152600401610f399190611f8d565b60405180910390fd5b505050565b6060610f5583836000610f5d565b905092915050565b606081471015610fa457306040517fcd786059000000000000000000000000000000000000000000000000000000008152600401610f9b9190611f8d565b60405180910390fd5b6000808573ffffffffffffffffffffffffffffffffffffffff168486604051610fcd9190612019565b60006040518083038185875af1925050503d806000811461100a576040519150601f19603f3d011682016040523d82523d6000602084013e61100f565b606091505b509150915061101f86838361102a565b925050509392505050565b60608261103f5761103a826110b9565b6110b1565b60008251148015611067575060008473ffffffffffffffffffffffffffffffffffffffff163b145b156110a957836040517f9996b3150000000000000000000000000000000000000000000000000000000081526004016110a09190611f8d565b60405180910390fd5b8190506110b2565b5b9392505050565b6000815111156110cc5780518082602001fd5b6040517f1425ea4200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040518060a00160405280600081526020016000815260200160008152602001600081526020016000151581525090565b6000819050919050565b6111428161112f565b82525050565b600060208201905061115d6000830184611139565b92915050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006111a282611177565b9050919050565b6111b281611197565b81146111bd57600080fd5b50565b6000813590506111cf816111a9565b92915050565b6000602082840312156111eb576111ea61116d565b5b60006111f9848285016111c0565b91505092915050565b600080fd5b600080fd5b600080fd5b60008083601f84011261122757611226611202565b5b8235905067ffffffffffffffff81111561124457611243611207565b5b6020830191508360208202830111156112605761125f61120c565b5b9250929050565b6000806020838503121561127e5761127d61116d565b5b600083013567ffffffffffffffff81111561129c5761129b611172565b5b6112a885828601611211565b92509250509250929050565b6112bd8161112f565b81146112c857600080fd5b50565b6000813590506112da816112b4565b92915050565b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b61132e826112e5565b810181811067ffffffffffffffff8211171561134d5761134c6112f6565b5b80604052505050565b6000611360611163565b905061136c8282611325565b919050565b600067ffffffffffffffff82111561138c5761138b6112f6565b5b611395826112e5565b9050602081019050919050565b82818337600083830152505050565b60006113c46113bf84611371565b611356565b9050828152602081018484840111156113e0576113df6112e0565b5b6113eb8482856113a2565b509392505050565b600082601f83011261140857611407611202565b5b81356114188482602086016113b1565b91505092915050565b600080600080600080600060e0888a0312156114405761143f61116d565b5b600061144e8a828b016111c0565b975050602061145f8a828b016111c0565b96505060406114708a828b016111c0565b95505060606114818a828b016112cb565b94505060806114928a828b016112cb565b93505060a06114a38a828b016112cb565b92505060c088013567ffffffffffffffff8111156114c4576114c3611172565b5b6114d08a828b016113f3565b91505092959891949750929550565b600080604083850312156114f6576114f561116d565b5b6000611504858286016112cb565b9250506020611515858286016112cb565b9150509250929050565b600080604083850312156115365761153561116d565b5b6000611544858286016111c0565b9250506020611555858286016112cb565b9150509250929050565b60008115159050919050565b6115748161155f565b82525050565b600060a08201905061158f6000830188611139565b61159c6020830187611139565b6115a96040830186611139565b6115b66060830185611139565b6115c3608083018461156b565b9695505050505050565b6000806000606084860312156115e6576115e561116d565b5b60006115f4868287016111c0565b9350506020611605868287016112cb565b9250506040611616868287016112cb565b9150509250925092565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b6116558161112f565b82525050565b6116648161155f565b82525050565b60a082016000820151611680600085018261164c565b506020820151611693602085018261164c565b5060408201516116a6604085018261164c565b5060608201516116b9606085018261164c565b5060808201516116cc608085018261165b565b50505050565b60006116de838361166a565b60a08301905092915050565b6000602082019050919050565b600061170282611620565b61170c818561162b565b93506117178361163c565b8060005b8381101561174857815161172f88826116d2565b975061173a836116ea565b92505060018101905061171b565b5085935050505092915050565b6000602082019050818103600083015261176f81846116f7565b905092915050565b6000819050919050565b600061179c61179761179284611177565b611777565b611177565b9050919050565b60006117ae82611781565b9050919050565b60006117c0826117a3565b9050919050565b6117d0816117b5565b82525050565b60006020820190506117eb60008301846117c7565b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600082825260208201905092915050565b7f496e76616c6964206465706f73697420696e6465780000000000000000000000600082015250565b6000611867601583611820565b915061187282611831565b602082019050919050565b600060208201905081810360008301526118968161185a565b9050919050565b7f4465706f73697420686173206e6f7420656e6465642079657400000000000000600082015250565b60006118d3601983611820565b91506118de8261189d565b602082019050919050565b60006020820190508181036000830152611902816118c6565b9050919050565b7f4465706f7369742068617320616c7265616479206265656e207769746864726160008201527f776e000000000000000000000000000000000000000000000000000000000000602082015250565b6000611965602283611820565b915061197082611909565b604082019050919050565b6000602082019050818103600083015261199481611958565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006119d58261112f565b91506119e08361112f565b92508282019050808211156119f8576119f761199b565b5b92915050565b6000611a098261112f565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203611a3b57611a3a61199b565b5b600182019050919050565b600082825260208201905092915050565b600080fd5b82818337505050565b6000611a718385611a46565b93507f07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff831115611aa457611aa3611a57565b5b602083029250611ab5838584611a5c565b82840190509392505050565b60006060820190508181036000830152611adc818688611a65565b9050611aeb6020830185611139565b611af86040830184611139565b95945050505050565b7f496e76616c696420696e766f6b65720000000000000000000000000000000000600082015250565b6000611b37600f83611820565b9150611b4282611b01565b602082019050919050565b60006020820190508181036000830152611b6681611b2a565b9050919050565b7f416d6f756e74206d7573742062652067726561746572207468616e206f6e6500600082015250565b6000611ba3601f83611820565b9150611bae82611b6d565b602082019050919050565b60006020820190508181036000830152611bd281611b96565b9050919050565b600081519050611be8816112b4565b92915050565b600060208284031215611c0457611c0361116d565b5b6000611c1284828501611bd9565b91505092915050565b6000611c268261112f565b9150611c318361112f565b9250828203905081811115611c4957611c4861199b565b5b92915050565b6000608082019050611c646000830187611139565b611c716020830186611139565b611c7e6040830185611139565b611c8b6060830184611139565b95945050505050565b7f4465706f7369742068617320616c726561647920656e64656400000000000000600082015250565b6000611cca601983611820565b9150611cd582611c94565b602082019050919050565b60006020820190508181036000830152611cf981611cbd565b9050919050565b7f496e76616c696420696e64657820696e70757473000000000000000000000000600082015250565b6000611d36601483611820565b9150611d4182611d00565b602082019050919050565b60006020820190508181036000830152611d6581611d29565b9050919050565b7f496e76616c696420696e6465782072616e676500000000000000000000000000600082015250565b6000611da2601383611820565b9150611dad82611d6c565b602082019050919050565b60006020820190508181036000830152611dd181611d95565b9050919050565b611de181611197565b82525050565b6000604082019050611dfc6000830185611dd8565b611e096020830184611139565b9392505050565b7f4c6f636b206475726174696f6e206d757374206265206174206c65617374203260008201527f3120646179730000000000000000000000000000000000000000000000000000602082015250565b6000611e6c602683611820565b9150611e7782611e10565b604082019050919050565b60006020820190508181036000830152611e9b81611e5f565b9050919050565b7f546f74616c206c6f636b206475726174696f6e206d757374206265206c65737360008201527f207468616e203130393520646179730000000000000000000000000000000000602082015250565b6000611efe602f83611820565b9150611f0982611ea2565b604082019050919050565b60006020820190508181036000830152611f2d81611ef1565b9050919050565b611f3d8161155f565b8114611f4857600080fd5b50565b600081519050611f5a81611f34565b92915050565b600060208284031215611f7657611f7561116d565b5b6000611f8484828501611f4b565b91505092915050565b6000602082019050611fa26000830184611dd8565b92915050565b600081519050919050565b600081905092915050565b60005b83811015611fdc578082015181840152602081019050611fc1565b60008484015250505050565b6000611ff382611fa8565b611ffd8185611fb3565b935061200d818560208601611fbe565b80840191505092915050565b60006120258284611fe8565b91508190509291505056fea2646970667358221220b5f009e68c832ab8dc295790cf3640911c34ffbe53f98173a4e63f51e9e6d6b464736f6c63430008140033

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

000000000000000000000000b23d80f5fefcddaa212212f028021b41ded428cf000000000000000000000000000000000000000000000000000000006c169b00

-----Decoded View---------------
Arg [0] : primeTokenAddress (address): 0xb23d80f5FefcDDaa212212F028021B41DEd428CF
Arg [1] : maxLockTimestamp (uint256): 1813420800

-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 000000000000000000000000b23d80f5fefcddaa212212f028021b41ded428cf
Arg [1] : 000000000000000000000000000000000000000000000000000000006c169b00


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading
[ 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.