ETH Price: $2,868.46 (+0.81%)

Contract

0xBe2fE377CdE29a765652797134D62Fc1c9162921

Overview

ETH Balance

0.000006373593352324 ETH

ETH Value

$0.02 (@ $2,868.46/ETH)

Token Holdings

More Info

Private Name Tags

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Withdraw All Ref...159970962025-11-10 1:58:2715 days ago1762739907IN
0xBe2fE377...1c9162921
0 ETH0.00000140.00100026
Withdraw All Ref...148054292025-10-27 6:57:2029 days ago1761548240IN
0xBe2fE377...1c9162921
0 ETH0.000001390.00100026

Latest 10 internal transactions

Advanced mode:
Parent Transaction Hash Block From To
161168602025-11-11 11:14:3114 days ago1762859671
0xBe2fE377...1c9162921
0.00000034 ETH
161168322025-11-11 11:14:0314 days ago1762859643
0xBe2fE377...1c9162921
0.00000054 ETH
159985732025-11-10 2:23:0415 days ago1762741384
0xBe2fE377...1c9162921
0.000002 ETH
159981272025-11-10 2:15:3815 days ago1762740938
0xBe2fE377...1c9162921
0.00000209 ETH
159977902025-11-10 2:10:0115 days ago1762740601
0xBe2fE377...1c9162921
0.00000139 ETH
159970962025-11-10 1:58:2715 days ago1762739907
0xBe2fE377...1c9162921
0.00002853 ETH
159403082025-11-09 10:11:5916 days ago1762683119
0xBe2fE377...1c9162921
0.00000692 ETH
159402582025-11-09 10:11:0916 days ago1762683069
0xBe2fE377...1c9162921
0.00000725 ETH
159399312025-11-09 10:05:4216 days ago1762682742
0xBe2fE377...1c9162921
0.000007 ETH
159398662025-11-09 10:04:3716 days ago1762682677
0xBe2fE377...1c9162921
0.00000735 ETH

Cross-Chain Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
RishuReferralTreasury

Compiler Version
v0.8.30+commit.73712a01

Optimization Enabled:
Yes with 200 runs

Other Settings:
prague EvmVersion
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.26;

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

import "./interfaces/IRishuSwap.sol";
import "./interfaces/IRishuReferralTreasury.sol";

/// @title RishuReferralTreasury
/// @notice Manages referral rewards distribution for the RishuSwap protocol
/// @custom:security-contact [email protected]
contract RishuReferralTreasury is
    Ownable,
    ReentrancyGuard,
    Pausable,
    IRishuReferralTreasury
{
    // Swap contract address
    address public SWAP_CONTRACT;

    // Referral address token balance
    mapping(address => mapping(address => uint256))
        public referralAddressTokenBalance;

    using SafeERC20 for IERC20;

    // Emitted when referral rewards are withdrawn
    event ReferralRewardsWithdrawn(
        address indexed referralAddress,
        address indexed token,
        uint256 amount
    );

    // Emitted when user tries to withdraw but has no rewards
    event NoRewardsToWithdraw(address indexed referralAddress);

    modifier onlySwapContract() {
        require(
            msg.sender == SWAP_CONTRACT,
            "Only Swap contract can call this function"
        );
        _;
    }

    /// @notice Constructor
    /// @param _owner Owner address
    /// @param _swapContract Swap contract address
    constructor(address _owner, address _swapContract) Ownable(_owner) {
        require(_owner != address(0), "Invalid owner address");
        require(_swapContract != address(0), "Invalid swap contract address");
        SWAP_CONTRACT = _swapContract;
    }

    /// @notice Allows the contract to receive native token
    receive() external payable {}

    /// @notice Function to set swap contract
    /// @param _swapContract Swap contract address
    function setSwapContract(address _swapContract) external onlyOwner {
        SWAP_CONTRACT = _swapContract;
    }

    /// @notice Function set referral rewards after swap called by RishuSwap
    /// @param token Token address
    /// @param amount Amount of token
    /// @param referralAddress Referral address
    function addRewardsAfterSwap(
        address token,
        uint256 amount,
        address referralAddress
    ) external onlySwapContract {
        require(token != address(0), "Invalid token address");
        require(amount > 0, "Amount must be greater than 0");
        require(referralAddress != address(0), "Invalid referral address");

        referralAddressTokenBalance[referralAddress][token] += amount;
    }

    /// @notice Function to get referral address token balance
    /// @param referralAddress Referral address
    /// @param token Token address
    function getReferralAddressTokenBalance(
        address referralAddress,
        address token
    ) external view returns (uint256) {
        return referralAddressTokenBalance[referralAddress][token];
    }

    /// @notice Function to withdraw all referral rewards
    /// @dev CRITICAL: Reverts on transfer failure to prevent fund loss
    function withdrawAllReferralRewards() external nonReentrant whenNotPaused {
        IRishuSwap rishuSwap = IRishuSwap(SWAP_CONTRACT);
        address[] memory stableTokens = rishuSwap.getStableTokens();
        address wrappedNative = rishuSwap.WRAPPED_NATIVE();

        // Create array with wrapped native + stable tokens
        address[] memory allTokens = new address[](stableTokens.length + 1);
        allTokens[0] = wrappedNative;
        for (uint256 i = 0; i < stableTokens.length; i++) {
            allTokens[i + 1] = stableTokens[i];
        }

        bool hasWithdrawn = false;
        for (uint256 i = 0; i < allTokens.length; i++) {
            uint256 amount = referralAddressTokenBalance[msg.sender][
                allTokens[i]
            ];
            if (amount > 0) {
                // CRITICAL: Update state BEFORE external calls (reentrancy protection)
                referralAddressTokenBalance[msg.sender][allTokens[i]] = 0;

                if (allTokens[i] == wrappedNative) {
                    (bool sent, ) = msg.sender.call{value: amount}("");
                    require(sent, "Failed to send native token");
                } else {
                    IERC20(allTokens[i]).safeTransfer(msg.sender, amount);
                }

                emit ReferralRewardsWithdrawn(msg.sender, allTokens[i], amount);
                hasWithdrawn = true;
            }
        }

        // Emit event if no rewards were withdrawn instead of reverting
        if (!hasWithdrawn) {
            emit NoRewardsToWithdraw(msg.sender);
        }
    }

    /// @notice Pauses the contract
    function pause() external onlyOwner {
        _pause();
    }

    /// @notice Unpauses the contract
    function unpause() external onlyOwner {
        _unpause();
    }

    /// @notice Emergency function - REMOVED for security
    /// @dev This function has been removed to prevent potential rug pulls
    /// @dev User referral rewards cannot be withdrawn by owner
    /// @dev If there are truly stuck tokens not belonging to any referral address,
    /// @dev contact the protocol governance for proper handling
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.3.0) (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.20;

import {IERC20} from "../IERC20.sol";
import {IERC1363} from "../../../interfaces/IERC1363.sol";

/**
 * @title SafeERC20
 * @dev Wrappers around ERC-20 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 {
    /**
     * @dev An operation with an ERC-20 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 Variant of {safeTransfer} that returns a bool instead of reverting if the operation is not successful.
     */
    function trySafeTransfer(IERC20 token, address to, uint256 value) internal returns (bool) {
        return _callOptionalReturnBool(token, abi.encodeCall(token.transfer, (to, value)));
    }

    /**
     * @dev Variant of {safeTransferFrom} that returns a bool instead of reverting if the operation is not successful.
     */
    function trySafeTransferFrom(IERC20 token, address from, address to, uint256 value) internal returns (bool) {
        return _callOptionalReturnBool(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.
     *
     * IMPORTANT: If the token implements ERC-7674 (ERC-20 with temporary allowance), and if the "client"
     * smart contract uses ERC-7674 to set temporary allowances, then the "client" smart contract should avoid using
     * this function. Performing a {safeIncreaseAllowance} or {safeDecreaseAllowance} operation on a token contract
     * that has a non-zero temporary allowance (for that particular owner-spender) will result in unexpected behavior.
     */
    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.
     *
     * IMPORTANT: If the token implements ERC-7674 (ERC-20 with temporary allowance), and if the "client"
     * smart contract uses ERC-7674 to set temporary allowances, then the "client" smart contract should avoid using
     * this function. Performing a {safeIncreaseAllowance} or {safeDecreaseAllowance} operation on a token contract
     * that has a non-zero temporary allowance (for that particular owner-spender) will result in unexpected behavior.
     */
    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.
     *
     * NOTE: If the token implements ERC-7674, this function will not modify any temporary allowance. This function
     * only sets the "standard" allowance. Any temporary allowance will remain active, in addition to the value being
     * set here.
     */
    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 Performs an {ERC1363} transferAndCall, with a fallback to the simple {ERC20} transfer if the target has no
     * code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when
     * targeting contracts.
     *
     * Reverts if the returned value is other than `true`.
     */
    function transferAndCallRelaxed(IERC1363 token, address to, uint256 value, bytes memory data) internal {
        if (to.code.length == 0) {
            safeTransfer(token, to, value);
        } else if (!token.transferAndCall(to, value, data)) {
            revert SafeERC20FailedOperation(address(token));
        }
    }

    /**
     * @dev Performs an {ERC1363} transferFromAndCall, with a fallback to the simple {ERC20} transferFrom if the target
     * has no code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when
     * targeting contracts.
     *
     * Reverts if the returned value is other than `true`.
     */
    function transferFromAndCallRelaxed(
        IERC1363 token,
        address from,
        address to,
        uint256 value,
        bytes memory data
    ) internal {
        if (to.code.length == 0) {
            safeTransferFrom(token, from, to, value);
        } else if (!token.transferFromAndCall(from, to, value, data)) {
            revert SafeERC20FailedOperation(address(token));
        }
    }

    /**
     * @dev Performs an {ERC1363} approveAndCall, with a fallback to the simple {ERC20} approve if the target has no
     * code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when
     * targeting contracts.
     *
     * NOTE: When the recipient address (`to`) has no code (i.e. is an EOA), this function behaves as {forceApprove}.
     * Opposedly, when the recipient address (`to`) has code, this function only attempts to call {ERC1363-approveAndCall}
     * once without retrying, and relies on the returned value to be true.
     *
     * Reverts if the returned value is other than `true`.
     */
    function approveAndCallRelaxed(IERC1363 token, address to, uint256 value, bytes memory data) internal {
        if (to.code.length == 0) {
            forceApprove(token, to, value);
        } else if (!token.approveAndCall(to, value, data)) {
            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 {_callOptionalReturnBool} that reverts if call fails to meet the requirements.
     */
    function _callOptionalReturn(IERC20 token, bytes memory data) private {
        uint256 returnSize;
        uint256 returnValue;
        assembly ("memory-safe") {
            let success := call(gas(), token, 0, add(data, 0x20), mload(data), 0, 0x20)
            // bubble errors
            if iszero(success) {
                let ptr := mload(0x40)
                returndatacopy(ptr, 0, returndatasize())
                revert(ptr, returndatasize())
            }
            returnSize := returndatasize()
            returnValue := mload(0)
        }

        if (returnSize == 0 ? address(token).code.length == 0 : returnValue != 1) {
            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 silently catches all reverts and returns a bool instead.
     */
    function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {
        bool success;
        uint256 returnSize;
        uint256 returnValue;
        assembly ("memory-safe") {
            success := call(gas(), token, 0, add(data, 0x20), mload(data), 0, 0x20)
            returnSize := returndatasize()
            returnValue := mload(0)
        }
        return success && (returnSize == 0 ? address(token).code.length > 0 : returnValue == 1);
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.4.0) (token/ERC20/IERC20.sol)

pragma solidity >=0.4.16;

/**
 * @dev Interface of the ERC-20 standard as defined in the ERC.
 */
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);
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)

pragma solidity ^0.8.20;

import {Context} from "../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.
 *
 * The initial owner is set to the address provided by the deployer. 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;

    /**
     * @dev The caller account is not authorized to perform an operation.
     */
    error OwnableUnauthorizedAccount(address account);

    /**
     * @dev The owner is not a valid owner account. (eg. `address(0)`)
     */
    error OwnableInvalidOwner(address owner);

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

    /**
     * @dev Initializes the contract setting the address provided by the deployer as the initial owner.
     */
    constructor(address initialOwner) {
        if (initialOwner == address(0)) {
            revert OwnableInvalidOwner(address(0));
        }
        _transferOwnership(initialOwner);
    }

    /**
     * @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 {
        if (owner() != _msgSender()) {
            revert OwnableUnauthorizedAccount(_msgSender());
        }
    }

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

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        if (newOwner == address(0)) {
            revert OwnableInvalidOwner(address(0));
        }
        _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);
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (utils/ReentrancyGuard.sol)

pragma solidity ^0.8.20;

/**
 * @dev Contract module that helps prevent reentrant calls to a function.
 *
 * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
 * available, which can be applied to functions to make sure there are no nested
 * (reentrant) calls to them.
 *
 * Note that because there is a single `nonReentrant` guard, functions marked as
 * `nonReentrant` may not call one another. This can be worked around by making
 * those functions `private`, and then adding `external` `nonReentrant` entry
 * points to them.
 *
 * TIP: If EIP-1153 (transient storage) is available on the chain you're deploying at,
 * consider using {ReentrancyGuardTransient} instead.
 *
 * TIP: If you would like to learn more about reentrancy and alternative ways
 * to protect against it, check out our blog post
 * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
 */
abstract contract ReentrancyGuard {
    // Booleans are more expensive than uint256 or any type that takes up a full
    // word because each write operation emits an extra SLOAD to first read the
    // slot's contents, replace the bits taken up by the boolean, and then write
    // back. This is the compiler's defense against contract upgrades and
    // pointer aliasing, and it cannot be disabled.

    // The values being non-zero value makes deployment a bit more expensive,
    // but in exchange the refund on every call to nonReentrant will be lower in
    // amount. Since refunds are capped to a percentage of the total
    // transaction's gas, it is best to keep them low in cases like this one, to
    // increase the likelihood of the full refund coming into effect.
    uint256 private constant NOT_ENTERED = 1;
    uint256 private constant ENTERED = 2;

    uint256 private _status;

    /**
     * @dev Unauthorized reentrant call.
     */
    error ReentrancyGuardReentrantCall();

    constructor() {
        _status = NOT_ENTERED;
    }

    /**
     * @dev Prevents a contract from calling itself, directly or indirectly.
     * Calling a `nonReentrant` function from another `nonReentrant`
     * function is not supported. It is possible to prevent this from happening
     * by making the `nonReentrant` function external, and making it call a
     * `private` function that does the actual work.
     */
    modifier nonReentrant() {
        _nonReentrantBefore();
        _;
        _nonReentrantAfter();
    }

    function _nonReentrantBefore() private {
        // On the first call to nonReentrant, _status will be NOT_ENTERED
        if (_status == ENTERED) {
            revert ReentrancyGuardReentrantCall();
        }

        // Any calls to nonReentrant after this point will fail
        _status = ENTERED;
    }

    function _nonReentrantAfter() private {
        // By storing the original value once again, a refund is triggered (see
        // https://eips.ethereum.org/EIPS/eip-2200)
        _status = NOT_ENTERED;
    }

    /**
     * @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a
     * `nonReentrant` function in the call stack.
     */
    function _reentrancyGuardEntered() internal view returns (bool) {
        return _status == ENTERED;
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.3.0) (utils/Pausable.sol)

pragma solidity ^0.8.20;

import {Context} from "../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 {
    bool private _paused;

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

    /**
     * @dev The operation failed because the contract is paused.
     */
    error EnforcedPause();

    /**
     * @dev The operation failed because the contract is not paused.
     */
    error ExpectedPause();

    /**
     * @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 {
        if (paused()) {
            revert EnforcedPause();
        }
    }

    /**
     * @dev Throws if the contract is not paused.
     */
    function _requirePaused() internal view virtual {
        if (!paused()) {
            revert ExpectedPause();
        }
    }

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

// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.26;

interface IRishuSwap {
    function WRAPPED_NATIVE() external view returns (address);
    function getStableTokens() external view returns (address[] memory);
}

File 8 of 13 : IRishuReferralTreasury.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.26;

interface IRishuReferralTreasury {
    function addRewardsAfterSwap(
        address token,
        uint256 amount,
        address referralAddress
    ) external;
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.4.0) (interfaces/IERC1363.sol)

pragma solidity >=0.6.2;

import {IERC20} from "./IERC20.sol";
import {IERC165} from "./IERC165.sol";

/**
 * @title IERC1363
 * @dev Interface of the ERC-1363 standard as defined in the https://eips.ethereum.org/EIPS/eip-1363[ERC-1363].
 *
 * Defines an extension interface for ERC-20 tokens that supports executing code on a recipient contract
 * after `transfer` or `transferFrom`, or code on a spender contract after `approve`, in a single transaction.
 */
interface IERC1363 is IERC20, IERC165 {
    /*
     * Note: the ERC-165 identifier for this interface is 0xb0202a11.
     * 0xb0202a11 ===
     *   bytes4(keccak256('transferAndCall(address,uint256)')) ^
     *   bytes4(keccak256('transferAndCall(address,uint256,bytes)')) ^
     *   bytes4(keccak256('transferFromAndCall(address,address,uint256)')) ^
     *   bytes4(keccak256('transferFromAndCall(address,address,uint256,bytes)')) ^
     *   bytes4(keccak256('approveAndCall(address,uint256)')) ^
     *   bytes4(keccak256('approveAndCall(address,uint256,bytes)'))
     */

    /**
     * @dev Moves a `value` amount of tokens from the caller's account to `to`
     * and then calls {IERC1363Receiver-onTransferReceived} on `to`.
     * @param to The address which you want to transfer to.
     * @param value The amount of tokens to be transferred.
     * @return A boolean value indicating whether the operation succeeded unless throwing.
     */
    function transferAndCall(address to, uint256 value) external returns (bool);

    /**
     * @dev Moves a `value` amount of tokens from the caller's account to `to`
     * and then calls {IERC1363Receiver-onTransferReceived} on `to`.
     * @param to The address which you want to transfer to.
     * @param value The amount of tokens to be transferred.
     * @param data Additional data with no specified format, sent in call to `to`.
     * @return A boolean value indicating whether the operation succeeded unless throwing.
     */
    function transferAndCall(address to, uint256 value, bytes calldata data) external returns (bool);

    /**
     * @dev Moves a `value` amount of tokens from `from` to `to` using the allowance mechanism
     * and then calls {IERC1363Receiver-onTransferReceived} on `to`.
     * @param from The address which you want to send tokens from.
     * @param to The address which you want to transfer to.
     * @param value The amount of tokens to be transferred.
     * @return A boolean value indicating whether the operation succeeded unless throwing.
     */
    function transferFromAndCall(address from, address to, uint256 value) external returns (bool);

    /**
     * @dev Moves a `value` amount of tokens from `from` to `to` using the allowance mechanism
     * and then calls {IERC1363Receiver-onTransferReceived} on `to`.
     * @param from The address which you want to send tokens from.
     * @param to The address which you want to transfer to.
     * @param value The amount of tokens to be transferred.
     * @param data Additional data with no specified format, sent in call to `to`.
     * @return A boolean value indicating whether the operation succeeded unless throwing.
     */
    function transferFromAndCall(address from, address to, uint256 value, bytes calldata data) external returns (bool);

    /**
     * @dev Sets a `value` amount of tokens as the allowance of `spender` over the
     * caller's tokens and then calls {IERC1363Spender-onApprovalReceived} on `spender`.
     * @param spender The address which will spend the funds.
     * @param value The amount of tokens to be spent.
     * @return A boolean value indicating whether the operation succeeded unless throwing.
     */
    function approveAndCall(address spender, uint256 value) external returns (bool);

    /**
     * @dev Sets a `value` amount of tokens as the allowance of `spender` over the
     * caller's tokens and then calls {IERC1363Spender-onApprovalReceived} on `spender`.
     * @param spender The address which will spend the funds.
     * @param value The amount of tokens to be spent.
     * @param data Additional data with no specified format, sent in call to `spender`.
     * @return A boolean value indicating whether the operation succeeded unless throwing.
     */
    function approveAndCall(address spender, uint256 value, bytes calldata data) external returns (bool);
}

// 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 11 of 13 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.4.0) (interfaces/IERC20.sol)

pragma solidity >=0.4.16;

import {IERC20} from "../token/ERC20/IERC20.sol";

File 12 of 13 : IERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.4.0) (interfaces/IERC165.sol)

pragma solidity >=0.4.16;

import {IERC165} from "../utils/introspection/IERC165.sol";

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.4.0) (utils/introspection/IERC165.sol)

pragma solidity >=0.4.16;

/**
 * @dev Interface of the ERC-165 standard, as defined in the
 * https://eips.ethereum.org/EIPS/eip-165[ERC].
 *
 * Implementers can declare support of contract interfaces, which can then be
 * queried by others ({ERC165Checker}).
 *
 * For an implementation, see {ERC165}.
 */
interface IERC165 {
    /**
     * @dev Returns true if this contract implements the interface defined by
     * `interfaceId`. See the corresponding
     * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[ERC section]
     * to learn more about how these ids are created.
     *
     * This function call must use less than 30 000 gas.
     */
    function supportsInterface(bytes4 interfaceId) external view returns (bool);
}

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

Contract Security Audit

Contract ABI

API
[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"address","name":"_swapContract","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"EnforcedPause","type":"error"},{"inputs":[],"name":"ExpectedPause","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"OwnableInvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"OwnableUnauthorizedAccount","type":"error"},{"inputs":[],"name":"ReentrancyGuardReentrantCall","type":"error"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"SafeERC20FailedOperation","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"referralAddress","type":"address"}],"name":"NoRewardsToWithdraw","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":true,"internalType":"address","name":"referralAddress","type":"address"},{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"ReferralRewardsWithdrawn","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"inputs":[],"name":"SWAP_CONTRACT","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address","name":"referralAddress","type":"address"}],"name":"addRewardsAfterSwap","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"referralAddress","type":"address"},{"internalType":"address","name":"token","type":"address"}],"name":"getReferralAddressTokenBalance","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":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"}],"name":"referralAddressTokenBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_swapContract","type":"address"}],"name":"setSwapContract","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdrawAllReferralRewards","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]

60803461014157601f610be238819003918201601f19168301916001600160401b0383118484101761014557808492604094855283398101031261014157610052602061004b83610159565b9201610159565b906001600160a01b0316801561012e575f80546001600160a01b03198116831782556001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09080a3600180556001600160a01b038116156100e95760028054610100600160a81b03191660089290921b610100600160a81b0316919091179055604051610a74908161016e8239f35b60405162461bcd60e51b815260206004820152601d60248201527f496e76616c6964207377617020636f6e747261637420616464726573730000006044820152606490fd5b631e4fbdf760e01b5f525f60045260245ffd5b5f80fd5b634e487b7160e01b5f52604160045260245ffd5b51906001600160a01b03821682036101415756fe6080604052600436101561001a575b3615610018575f80fd5b005b5f3560e01c806335fc43d2146108b95780633f4ba83a146109095780634b7f4389146108b95780635c975abb14610897578063715018a6146108405780638456cb59146107e75780638d7ce9cf1461063b5780638da5cb5b14610614578063cf3afa51146105e8578063d259ab42146105a0578063dc93921c1461012b5763f2fde38b0361000e5734610127576020366003190112610127576100bb61096f565b6100c36109fd565b6001600160a01b03168015610114575f80546001600160a01b03198116831782556001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09080a3005b631e4fbdf760e01b5f525f60045260245ffd5b5f80fd5b34610127575f36600319011261012757600260015414610591576002600155610152610a23565b60025460405163a195c25360e01b81529060081c6001600160a01b03165f82600481845afa918215610462575f926104f2575b5060206004916040519283809263d999984d60e01b82525afa908115610462575f916104b8575b508151916001830180931161023d576101dd6101c7846109bd565b936101d5604051958661099b565b8085526109bd565b602084019290601f19013684378351156104a4576001600160a01b0316918290525f5b8151811015610251576001600160a01b0361021b82846109e9565b511690600181019182821161023d57610236600193876109e9565b5201610200565b634e487b7160e01b5f52601160045260245ffd5b50505f905f5b835181101561046d57335f9081526003602052604090206001600160a01b0361028083876109e9565b511660018060a01b03165f5260205260405f2054806102a3575b50600101610257565b335f908152600360205260409020919350906001600160a01b036102c785876109e9565b511660018060a01b03165f526020525f60408120558160018060a01b036102ee85876109e9565b5116036103e3575f80808084335af13d156103de573d67ffffffffffffffff81116103ca576040519061032b601f8201601f19166020018361099b565b81525f60203d92013e5b15610385575b6001600160a01b0361034d84866109e9565b5116906040519081527f81bc9f01660cd5e477540fbe13993fac0d6ffe72a891cff27694b882e43fbd1d60203392a36001918261029a565b60405162461bcd60e51b815260206004820152601b60248201527f4661696c656420746f2073656e64206e617469766520746f6b656e00000000006044820152606490fd5b634e487b7160e01b5f52604160045260245ffd5b610335565b6001600160a01b036103f584866109e9565b511660205f6040518281019063a9059cbb60e01b82523360248201528560448201526044815261042660648261099b565b519082855af115610462575f513d6104595750803b155b610447575061033b565b635274afe760e01b5f5260045260245ffd5b6001141561043d565b6040513d5f823e3d90fd5b821561047a575b60018055005b337fd0147b7b0cedb66f85a116d346a1c7e982d5c5a3995d9919ff91a72bbcbd73aa5f80a2610474565b634e487b7160e01b5f52603260045260245ffd5b90506020813d6020116104ea575b816104d36020938361099b565b81010312610127576104e4906109d5565b826101ac565b3d91506104c6565b9091503d805f833e610504818361099b565b8101906020818303126101275780519067ffffffffffffffff821161012757019080601f8301121561012757815161053b816109bd565b92610549604051948561099b565b81845260208085019260051b82010192831161012757602001905b82821061057957509192915060209050610185565b60208091610586846109d5565b815201910190610564565b633ee5aeb560e01b5f5260045ffd5b34610127576020366003190112610127576105b961096f565b6105c16109fd565b60028054610100600160a81b03191660089290921b610100600160a81b0316919091179055005b34610127575f3660031901126101275760025460405160089190911c6001600160a01b03168152602090f35b34610127575f366003190112610127575f546040516001600160a01b039091168152602090f35b346101275760603660031901126101275761065461096f565b602435906044356001600160a01b038116908190036101275760025460081c6001600160a01b03163303610790576001600160a01b0382161561075357821561070e5780156106c9575f52600360205260405f209060018060a01b03165f5260205260405f20805491820180921161023d5755005b60405162461bcd60e51b815260206004820152601860248201527f496e76616c696420726566657272616c206164647265737300000000000000006044820152606490fd5b60405162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e20300000006044820152606490fd5b60405162461bcd60e51b8152602060048201526015602482015274496e76616c696420746f6b656e206164647265737360581b6044820152606490fd5b60405162461bcd60e51b815260206004820152602960248201527f4f6e6c79205377617020636f6e74726163742063616e2063616c6c207468697360448201526810333ab731ba34b7b760b91b6064820152608490fd5b34610127575f366003190112610127576107ff6109fd565b610807610a23565b600160ff1960025416176002557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586020604051338152a1005b34610127575f366003190112610127576108586109fd565b5f80546001600160a01b0319811682556001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a3005b34610127575f36600319011261012757602060ff600254166040519015158152f35b34610127576040366003190112610127576108d261096f565b6108da610985565b6001600160a01b039182165f908152600360209081526040808320949093168252928352819020549051908152f35b34610127575f366003190112610127576109216109fd565b60025460ff8116156109605760ff19166002557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa6020604051338152a1005b638dfc202b60e01b5f5260045ffd5b600435906001600160a01b038216820361012757565b602435906001600160a01b038216820361012757565b90601f8019910116810190811067ffffffffffffffff8211176103ca57604052565b67ffffffffffffffff81116103ca5760051b60200190565b51906001600160a01b038216820361012757565b80518210156104a45760209160051b010190565b5f546001600160a01b03163303610a1057565b63118cdaa760e01b5f523360045260245ffd5b60ff60025416610a2f57565b63d93c066560e01b5f5260045ffdfea264697066735822122003f3633cfe676f5d3c85def0862ffc16ace646ce3123b15d816e047ac6bd2a6e64736f6c634300081e0033000000000000000000000000c272fa7d73e8ed66e65a6281570d3788bea5e7a400000000000000000000000000f63050920f4772aba2fd93a3138367eb8a283c

Deployed Bytecode

0x6080604052600436101561001a575b3615610018575f80fd5b005b5f3560e01c806335fc43d2146108b95780633f4ba83a146109095780634b7f4389146108b95780635c975abb14610897578063715018a6146108405780638456cb59146107e75780638d7ce9cf1461063b5780638da5cb5b14610614578063cf3afa51146105e8578063d259ab42146105a0578063dc93921c1461012b5763f2fde38b0361000e5734610127576020366003190112610127576100bb61096f565b6100c36109fd565b6001600160a01b03168015610114575f80546001600160a01b03198116831782556001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09080a3005b631e4fbdf760e01b5f525f60045260245ffd5b5f80fd5b34610127575f36600319011261012757600260015414610591576002600155610152610a23565b60025460405163a195c25360e01b81529060081c6001600160a01b03165f82600481845afa918215610462575f926104f2575b5060206004916040519283809263d999984d60e01b82525afa908115610462575f916104b8575b508151916001830180931161023d576101dd6101c7846109bd565b936101d5604051958661099b565b8085526109bd565b602084019290601f19013684378351156104a4576001600160a01b0316918290525f5b8151811015610251576001600160a01b0361021b82846109e9565b511690600181019182821161023d57610236600193876109e9565b5201610200565b634e487b7160e01b5f52601160045260245ffd5b50505f905f5b835181101561046d57335f9081526003602052604090206001600160a01b0361028083876109e9565b511660018060a01b03165f5260205260405f2054806102a3575b50600101610257565b335f908152600360205260409020919350906001600160a01b036102c785876109e9565b511660018060a01b03165f526020525f60408120558160018060a01b036102ee85876109e9565b5116036103e3575f80808084335af13d156103de573d67ffffffffffffffff81116103ca576040519061032b601f8201601f19166020018361099b565b81525f60203d92013e5b15610385575b6001600160a01b0361034d84866109e9565b5116906040519081527f81bc9f01660cd5e477540fbe13993fac0d6ffe72a891cff27694b882e43fbd1d60203392a36001918261029a565b60405162461bcd60e51b815260206004820152601b60248201527f4661696c656420746f2073656e64206e617469766520746f6b656e00000000006044820152606490fd5b634e487b7160e01b5f52604160045260245ffd5b610335565b6001600160a01b036103f584866109e9565b511660205f6040518281019063a9059cbb60e01b82523360248201528560448201526044815261042660648261099b565b519082855af115610462575f513d6104595750803b155b610447575061033b565b635274afe760e01b5f5260045260245ffd5b6001141561043d565b6040513d5f823e3d90fd5b821561047a575b60018055005b337fd0147b7b0cedb66f85a116d346a1c7e982d5c5a3995d9919ff91a72bbcbd73aa5f80a2610474565b634e487b7160e01b5f52603260045260245ffd5b90506020813d6020116104ea575b816104d36020938361099b565b81010312610127576104e4906109d5565b826101ac565b3d91506104c6565b9091503d805f833e610504818361099b565b8101906020818303126101275780519067ffffffffffffffff821161012757019080601f8301121561012757815161053b816109bd565b92610549604051948561099b565b81845260208085019260051b82010192831161012757602001905b82821061057957509192915060209050610185565b60208091610586846109d5565b815201910190610564565b633ee5aeb560e01b5f5260045ffd5b34610127576020366003190112610127576105b961096f565b6105c16109fd565b60028054610100600160a81b03191660089290921b610100600160a81b0316919091179055005b34610127575f3660031901126101275760025460405160089190911c6001600160a01b03168152602090f35b34610127575f366003190112610127575f546040516001600160a01b039091168152602090f35b346101275760603660031901126101275761065461096f565b602435906044356001600160a01b038116908190036101275760025460081c6001600160a01b03163303610790576001600160a01b0382161561075357821561070e5780156106c9575f52600360205260405f209060018060a01b03165f5260205260405f20805491820180921161023d5755005b60405162461bcd60e51b815260206004820152601860248201527f496e76616c696420726566657272616c206164647265737300000000000000006044820152606490fd5b60405162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e20300000006044820152606490fd5b60405162461bcd60e51b8152602060048201526015602482015274496e76616c696420746f6b656e206164647265737360581b6044820152606490fd5b60405162461bcd60e51b815260206004820152602960248201527f4f6e6c79205377617020636f6e74726163742063616e2063616c6c207468697360448201526810333ab731ba34b7b760b91b6064820152608490fd5b34610127575f366003190112610127576107ff6109fd565b610807610a23565b600160ff1960025416176002557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586020604051338152a1005b34610127575f366003190112610127576108586109fd565b5f80546001600160a01b0319811682556001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a3005b34610127575f36600319011261012757602060ff600254166040519015158152f35b34610127576040366003190112610127576108d261096f565b6108da610985565b6001600160a01b039182165f908152600360209081526040808320949093168252928352819020549051908152f35b34610127575f366003190112610127576109216109fd565b60025460ff8116156109605760ff19166002557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa6020604051338152a1005b638dfc202b60e01b5f5260045ffd5b600435906001600160a01b038216820361012757565b602435906001600160a01b038216820361012757565b90601f8019910116810190811067ffffffffffffffff8211176103ca57604052565b67ffffffffffffffff81116103ca5760051b60200190565b51906001600160a01b038216820361012757565b80518210156104a45760209160051b010190565b5f546001600160a01b03163303610a1057565b63118cdaa760e01b5f523360045260245ffd5b60ff60025416610a2f57565b63d93c066560e01b5f5260045ffdfea264697066735822122003f3633cfe676f5d3c85def0862ffc16ace646ce3123b15d816e047ac6bd2a6e64736f6c634300081e0033

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

000000000000000000000000c272fa7d73e8ed66e65a6281570d3788bea5e7a400000000000000000000000000f63050920f4772aba2fd93a3138367eb8a283c

-----Decoded View---------------
Arg [0] : _owner (address): 0xC272Fa7D73e8ed66E65a6281570D3788BEA5E7A4
Arg [1] : _swapContract (address): 0x00f63050920F4772aba2Fd93A3138367EB8A283C

-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 000000000000000000000000c272fa7d73e8ed66e65a6281570d3788bea5e7a4
Arg [1] : 00000000000000000000000000f63050920f4772aba2fd93a3138367eb8a283c


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  ]
[ 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.