ETH Price: $3,282.93 (+0.20%)
Gas: 2.87 Gwei

Contract

0x6Ac6c25338758973799472f7dDf15980F2970525
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Pause181066132023-09-10 14:36:47490 days ago1694356607IN
0x6Ac6c253...0F2970525
0 ETH0.000442915.67095159
Withdraw Assets181066122023-09-10 14:36:35490 days ago1694356595IN
0x6Ac6c253...0F2970525
0 ETH0.000959414
Exchange180306432023-08-30 23:19:59500 days ago1693437599IN
0x6Ac6c253...0F2970525
0 ETH0.0017408918.68857084
Exchange180306052023-08-30 23:12:11500 days ago1693437131IN
0x6Ac6c253...0F2970525
0 ETH0.0016495217.70543842
Exchange180305122023-08-30 22:53:11500 days ago1693435991IN
0x6Ac6c253...0F2970525
0 ETH0.0013014917.11300607
Exchange180304952023-08-30 22:49:47500 days ago1693435787IN
0x6Ac6c253...0F2970525
0 ETH0.0017467517.83696189
Exchange179379692023-08-18 0:00:23513 days ago1692316823IN
0x6Ac6c253...0F2970525
0 ETH0.0037349240.08936894
Exchange179377252023-08-17 23:11:23513 days ago1692313883IN
0x6Ac6c253...0F2970525
0 ETH0.0072922895.86907658
Exchange178583702023-08-06 20:43:11524 days ago1691354591IN
0x6Ac6c253...0F2970525
0 ETH0.0020216521.70257359
Exchange178422412023-08-04 14:33:59527 days ago1691159639IN
0x6Ac6c253...0F2970525
0 ETH0.0027602236.10356021
Exchange178422292023-08-04 14:31:35527 days ago1691159495IN
0x6Ac6c253...0F2970525
0 ETH0.0033876144.31677307
Exchange178422192023-08-04 14:29:11527 days ago1691159351IN
0x6Ac6c253...0F2970525
0 ETH0.0039739940.42019465
Exchange178404142023-08-04 8:25:11527 days ago1691137511IN
0x6Ac6c253...0F2970525
0 ETH0.0014294818.70055448
Exchange178363902023-08-03 18:55:23528 days ago1691088923IN
0x6Ac6c253...0F2970525
0 ETH0.0034768637.31944734
Exchange178111882023-07-31 6:25:59531 days ago1690784759IN
0x6Ac6c253...0F2970525
0 ETH0.0010690713.98337772
Exchange178095242023-07-31 0:50:47531 days ago1690764647IN
0x6Ac6c253...0F2970525
0 ETH0.0014774219.32460152
Exchange177780442023-07-26 15:07:47536 days ago1690384067IN
0x6Ac6c253...0F2970525
0 ETH0.0030435739.80969593
Exchange177775692023-07-26 13:32:11536 days ago1690378331IN
0x6Ac6c253...0F2970525
0 ETH0.0028397937.1560157
Exchange177739012023-07-26 1:12:47536 days ago1690333967IN
0x6Ac6c253...0F2970525
0 ETH0.0020916222.35763639
Exchange177732432023-07-25 23:00:47536 days ago1690326047IN
0x6Ac6c253...0F2970525
0 ETH0.0023576230.83751329
Exchange177664422023-07-25 0:08:59537 days ago1690243739IN
0x6Ac6c253...0F2970525
0 ETH0.0016797622.0867077
Exchange177589892023-07-23 23:07:23538 days ago1690153643IN
0x6Ac6c253...0F2970525
0 ETH0.001631921.46419148
Exchange177557082023-07-23 12:06:23539 days ago1690113983IN
0x6Ac6c253...0F2970525
0 ETH0.0014450118.90075753
Exchange177461472023-07-22 4:00:47540 days ago1689998447IN
0x6Ac6c253...0F2970525
0 ETH0.0017511522.90492467
Exchange177461302023-07-22 3:57:23540 days ago1689998243IN
0x6Ac6c253...0F2970525
0 ETH0.0017066422.3227793
View all transactions

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Similar Match Source Code
This contract matches the deployed Bytecode of the Source Code for Contract 0xc66dE32b...4fc11D514
The constructor portion of the code might be different and could alter the actual behaviour of the contract

Contract Name:
ExchangepROOK

Compiler Version
v0.8.19+commit.7dd6d404

Optimization Enabled:
No with 200 runs

Other Settings:
default evmVersion
File 1 of 8 : exchangepROOK.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.19;

import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/security/Pausable.sol";

/// @title Exchange contract from pROOK to USDC
/// @author IANAL
contract ExchangepROOK is Ownable, Pausable {
	using SafeERC20 for IERC20;

	/// @notice pROOK
	IERC20 public immutable tokenPROOK;

	/// @notice USDC
	IERC20 public immutable tokenUSDC;

	/// @notice Exchange Rate
	uint256 public exchangeRate;

	/// @notice emitted when exchange pROOK to USDC
	event Exchange(address indexed user, uint256 amount, uint256 value);
	event ExchangeRateSet(uint256 exchangeRate);

	//
	// @notice constructor
	// @param _tokenPROOK pROOK token address
	// @param _tokenUSDC USDC token address
	// @param _exchangeRate exchange rate of USDC per pROOK value with 4 decimals
	//
	constructor(IERC20 _tokenPROOK, IERC20 _tokenUSDC, uint256 _exchangeRate) Ownable() {
		tokenPROOK = _tokenPROOK;
		tokenUSDC = _tokenUSDC;
		exchangeRate = _exchangeRate;
		_pause();
	}

	function pause() external onlyOwner {
		_pause();
	}

	function unpause() external onlyOwner {
		_unpause();
	}

	/**
	 * @notice Exchange rate value with 4 decimals, example 455000 = $45.50
	 * @param _exchangeRate amount of USDC per pROOK (USD / pROOK)
	 */
	function setExchangeRate(uint256 _exchangeRate) external onlyOwner {
		exchangeRate = _exchangeRate;
		emit ExchangeRateSet(_exchangeRate);
	}

	/**
	 * @notice Withdraw IERC20 token
	 * @param _token address for withdraw
	 * @param _amount to withdraw
	 */
	function withdrawAssets(IERC20 _token, uint256 _amount) external onlyOwner {
		_token.safeTransfer(owner(), _amount);
	}

	/**
	 * @notice Exchange from pROOK to USDC
	 * @param _amount of pROOK exchanged
	 */
	function exchange(uint256 _amount) external whenNotPaused {
		tokenPROOK.safeTransferFrom(_msgSender(), address(this), _amount);
		uint256 _value = _amount * exchangeRate / 1e16; // @note 1e18 * 1e4 / 1e16 = 1e6
		tokenUSDC.safeTransfer(_msgSender(), _value);

		emit Exchange(_msgSender(), _amount, _value);
	}
}

File 2 of 8 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.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 anymore. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby removing 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 3 of 8 : 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 4 of 8 : draft-IERC20Permit.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol)

pragma solidity ^0.8.0;

/**
 * @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.
 */
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].
     */
    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 5 of 8 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.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 6 of 8 : SafeERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.0;

import "../IERC20.sol";
import "../extensions/draft-IERC20Permit.sol";
import "../../../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;

    function safeTransfer(
        IERC20 token,
        address to,
        uint256 value
    ) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
    }

    function safeTransferFrom(
        IERC20 token,
        address from,
        address to,
        uint256 value
    ) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
    }

    /**
     * @dev Deprecated. This function has issues similar to the ones found in
     * {IERC20-approve}, and its usage is discouraged.
     *
     * Whenever possible, use {safeIncreaseAllowance} and
     * {safeDecreaseAllowance} instead.
     */
    function safeApprove(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        // safeApprove should only be called when setting an initial allowance,
        // or when resetting it to zero. To increase and decrease it, use
        // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
        require(
            (value == 0) || (token.allowance(address(this), spender) == 0),
            "SafeERC20: approve from non-zero to non-zero allowance"
        );
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
    }

    function safeIncreaseAllowance(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        uint256 newAllowance = token.allowance(address(this), spender) + value;
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
    }

    function safeDecreaseAllowance(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        unchecked {
            uint256 oldAllowance = token.allowance(address(this), spender);
            require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
            uint256 newAllowance = oldAllowance - value;
            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
        }
    }

    function safePermit(
        IERC20Permit token,
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal {
        uint256 nonceBefore = token.nonces(owner);
        token.permit(owner, spender, value, deadline, v, r, s);
        uint256 nonceAfter = token.nonces(owner);
        require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed");
    }

    /**
     * @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, "SafeERC20: low-level call failed");
        if (returndata.length > 0) {
            // Return data is optional
            require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
        }
    }
}

File 7 of 8 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)

pragma solidity ^0.8.1;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     *
     * [IMPORTANT]
     * ====
     * You shouldn't rely on `isContract` to protect against flash loan attacks!
     *
     * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
     * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
     * constructor.
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize/address.code.length, which returns 0
        // for contracts in construction, since the code is only stored at the end
        // of the constructor execution.

        return account.code.length > 0;
    }

    /**
     * @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://diligence.consensys.net/posts/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.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        require(address(this).balance >= amount, "Address: insufficient balance");

        (bool success, ) = recipient.call{value: amount}("");
        require(success, "Address: unable to send value, recipient may have reverted");
    }

    /**
     * @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, it is bubbled up by this
     * function (like regular Solidity function calls).
     *
     * 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.
     *
     * _Available since v3.1._
     */
    function functionCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0, "Address: low-level call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
     * `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0, errorMessage);
    }

    /**
     * @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`.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
    }

    /**
     * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
     * with `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value,
        string memory errorMessage
    ) internal returns (bytes memory) {
        require(address(this).balance >= value, "Address: insufficient balance for call");
        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
        return functionStaticCall(target, data, "Address: low-level static call failed");
    }

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

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionDelegateCall(target, data, "Address: low-level delegate call failed");
    }

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

    /**
     * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling
     * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.
     *
     * _Available since v4.8._
     */
    function verifyCallResultFromTarget(
        address target,
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        if (success) {
            if (returndata.length == 0) {
                // only check isContract if the call was successful and the return data is empty
                // otherwise we already know that it was a contract
                require(isContract(target), "Address: call to non-contract");
            }
            return returndata;
        } else {
            _revert(returndata, errorMessage);
        }
    }

    /**
     * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason or using the provided one.
     *
     * _Available since v4.3._
     */
    function verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal pure returns (bytes memory) {
        if (success) {
            return returndata;
        } else {
            _revert(returndata, errorMessage);
        }
    }

    function _revert(bytes memory returndata, string memory errorMessage) 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(errorMessage);
        }
    }
}

File 8 of 8 : 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
{
  "optimizer": {
    "enabled": false,
    "runs": 200
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"contract IERC20","name":"_tokenPROOK","type":"address"},{"internalType":"contract IERC20","name":"_tokenUSDC","type":"address"},{"internalType":"uint256","name":"_exchangeRate","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Exchange","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"exchangeRate","type":"uint256"}],"name":"ExchangeRateSet","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"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"exchange","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"exchangeRate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"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":"_exchangeRate","type":"uint256"}],"name":"setExchangeRate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"tokenPROOK","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tokenUSDC","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","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":[{"internalType":"contract IERC20","name":"_token","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"withdrawAssets","outputs":[],"stateMutability":"nonpayable","type":"function"}]

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106100b45760003560e01c80638da5cb5b116100715780638da5cb5b1461012f578063c86d40401461014d578063db068e0e1461016b578063efb65e8914610187578063f2fde38b146101a3578063f75cec60146101bf576100b4565b80633ba0b9a9146100b95780633f4ba83a146100d757806353556559146100e15780635c975abb146100fd578063715018a61461011b5780638456cb5914610125575b600080fd5b6100c16101dd565b6040516100ce9190610b37565b60405180910390f35b6100df6101e3565b005b6100fb60048036038101906100f69190610b83565b6101f5565b005b610105610322565b6040516101129190610bcb565b60405180910390f35b610123610338565b005b61012d61034c565b005b61013761035e565b6040516101449190610c27565b60405180910390f35b610155610387565b6040516101629190610ca1565b60405180910390f35b61018560048036038101906101809190610b83565b6103ab565b005b6101a1600480360381019061019c9190610cfa565b6103f4565b005b6101bd60048036038101906101b89190610d66565b610432565b005b6101c76104b5565b6040516101d49190610ca1565b60405180910390f35b60015481565b6101eb6104d9565b6101f3610557565b565b6101fd6105b9565b610251610208610603565b30837f00000000000000000000000004656bae6d7434b643e317d0f18b01cbd601b4fa73ffffffffffffffffffffffffffffffffffffffff1661060b909392919063ffffffff16565b6000662386f26fc10000600154836102699190610dc2565b6102739190610e33565b90506102c7610280610603565b827f000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4873ffffffffffffffffffffffffffffffffffffffff166106949092919063ffffffff16565b6102cf610603565b73ffffffffffffffffffffffffffffffffffffffff167f26981b9aefbb0f732b0264bd34c255e831001eb50b06bc85b32cc39e143897218383604051610316929190610e64565b60405180910390a25050565b60008060149054906101000a900460ff16905090565b6103406104d9565b61034a600061071a565b565b6103546104d9565b61035c6107de565b565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b7f000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4881565b6103b36104d9565b806001819055507f972aba470577c14606bbf4bbdec1fed4925f242fcef40b4a8d242983365d0291816040516103e99190610b37565b60405180910390a150565b6103fc6104d9565b61042e61040761035e565b828473ffffffffffffffffffffffffffffffffffffffff166106949092919063ffffffff16565b5050565b61043a6104d9565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036104a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104a090610f10565b60405180910390fd5b6104b28161071a565b50565b7f00000000000000000000000004656bae6d7434b643e317d0f18b01cbd601b4fa81565b6104e1610603565b73ffffffffffffffffffffffffffffffffffffffff166104ff61035e565b73ffffffffffffffffffffffffffffffffffffffff1614610555576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161054c90610f7c565b60405180910390fd5b565b61055f610841565b60008060146101000a81548160ff0219169083151502179055507f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa6105a2610603565b6040516105af9190610c27565b60405180910390a1565b6105c1610322565b15610601576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f890610fe8565b60405180910390fd5b565b600033905090565b61068e846323b872dd60e01b85858560405160240161062c93929190611008565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505061088a565b50505050565b6107158363a9059cbb60e01b84846040516024016106b392919061103f565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505061088a565b505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b6107e66105b9565b6001600060146101000a81548160ff0219169083151502179055507f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25861082a610603565b6040516108379190610c27565b60405180910390a1565b610849610322565b610888576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161087f906110b4565b60405180910390fd5b565b60006108ec826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff166109519092919063ffffffff16565b905060008151111561094c578080602001905181019061090c9190611100565b61094b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109429061119f565b60405180910390fd5b5b505050565b60606109608484600085610969565b90509392505050565b6060824710156109ae576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109a590611231565b60405180910390fd5b6000808673ffffffffffffffffffffffffffffffffffffffff1685876040516109d791906112c2565b60006040518083038185875af1925050503d8060008114610a14576040519150601f19603f3d011682016040523d82523d6000602084013e610a19565b606091505b5091509150610a2a87838387610a36565b92505050949350505050565b60608315610a98576000835103610a9057610a5085610aab565b610a8f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a8690611325565b60405180910390fd5b5b829050610aa3565b610aa28383610ace565b5b949350505050565b6000808273ffffffffffffffffffffffffffffffffffffffff163b119050919050565b600082511115610ae15781518083602001fd5b806040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b15919061139a565b60405180910390fd5b6000819050919050565b610b3181610b1e565b82525050565b6000602082019050610b4c6000830184610b28565b92915050565b600080fd5b610b6081610b1e565b8114610b6b57600080fd5b50565b600081359050610b7d81610b57565b92915050565b600060208284031215610b9957610b98610b52565b5b6000610ba784828501610b6e565b91505092915050565b60008115159050919050565b610bc581610bb0565b82525050565b6000602082019050610be06000830184610bbc565b92915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000610c1182610be6565b9050919050565b610c2181610c06565b82525050565b6000602082019050610c3c6000830184610c18565b92915050565b6000819050919050565b6000610c67610c62610c5d84610be6565b610c42565b610be6565b9050919050565b6000610c7982610c4c565b9050919050565b6000610c8b82610c6e565b9050919050565b610c9b81610c80565b82525050565b6000602082019050610cb66000830184610c92565b92915050565b6000610cc782610c06565b9050919050565b610cd781610cbc565b8114610ce257600080fd5b50565b600081359050610cf481610cce565b92915050565b60008060408385031215610d1157610d10610b52565b5b6000610d1f85828601610ce5565b9250506020610d3085828601610b6e565b9150509250929050565b610d4381610c06565b8114610d4e57600080fd5b50565b600081359050610d6081610d3a565b92915050565b600060208284031215610d7c57610d7b610b52565b5b6000610d8a84828501610d51565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000610dcd82610b1e565b9150610dd883610b1e565b9250828202610de681610b1e565b91508282048414831517610dfd57610dfc610d93565b5b5092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000610e3e82610b1e565b9150610e4983610b1e565b925082610e5957610e58610e04565b5b828204905092915050565b6000604082019050610e796000830185610b28565b610e866020830184610b28565b9392505050565b600082825260208201905092915050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b6000610efa602683610e8d565b9150610f0582610e9e565b604082019050919050565b60006020820190508181036000830152610f2981610eed565b9050919050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000610f66602083610e8d565b9150610f7182610f30565b602082019050919050565b60006020820190508181036000830152610f9581610f59565b9050919050565b7f5061757361626c653a2070617573656400000000000000000000000000000000600082015250565b6000610fd2601083610e8d565b9150610fdd82610f9c565b602082019050919050565b6000602082019050818103600083015261100181610fc5565b9050919050565b600060608201905061101d6000830186610c18565b61102a6020830185610c18565b6110376040830184610b28565b949350505050565b60006040820190506110546000830185610c18565b6110616020830184610b28565b9392505050565b7f5061757361626c653a206e6f7420706175736564000000000000000000000000600082015250565b600061109e601483610e8d565b91506110a982611068565b602082019050919050565b600060208201905081810360008301526110cd81611091565b9050919050565b6110dd81610bb0565b81146110e857600080fd5b50565b6000815190506110fa816110d4565b92915050565b60006020828403121561111657611115610b52565b5b6000611124848285016110eb565b91505092915050565b7f5361666545524332303a204552433230206f7065726174696f6e20646964206e60008201527f6f74207375636365656400000000000000000000000000000000000000000000602082015250565b6000611189602a83610e8d565b91506111948261112d565b604082019050919050565b600060208201905081810360008301526111b88161117c565b9050919050565b7f416464726573733a20696e73756666696369656e742062616c616e636520666f60008201527f722063616c6c0000000000000000000000000000000000000000000000000000602082015250565b600061121b602683610e8d565b9150611226826111bf565b604082019050919050565b6000602082019050818103600083015261124a8161120e565b9050919050565b600081519050919050565b600081905092915050565b60005b8381101561128557808201518184015260208101905061126a565b60008484015250505050565b600061129c82611251565b6112a6818561125c565b93506112b6818560208601611267565b80840191505092915050565b60006112ce8284611291565b915081905092915050565b7f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000600082015250565b600061130f601d83610e8d565b915061131a826112d9565b602082019050919050565b6000602082019050818103600083015261133e81611302565b9050919050565b600081519050919050565b6000601f19601f8301169050919050565b600061136c82611345565b6113768185610e8d565b9350611386818560208601611267565b61138f81611350565b840191505092915050565b600060208201905081810360008301526113b48184611361565b90509291505056fea2646970667358221220c4820689db3dc8e732818d6c040df50832cf8925caf491ae170068c7d037b36264736f6c63430008130033

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.