Source Code
Latest 25 from a total of 147 transactions
| Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
|---|---|---|---|---|---|---|---|---|---|
| Swap With Red Sn... | 15861413 | 12 days ago | IN | 0 ETH | 0.00000159 | ||||
| Swap With Red Sn... | 15697752 | 14 days ago | IN | 0.00525891 ETH | 0.00000195 | ||||
| Swap With Red Sn... | 14467099 | 28 days ago | IN | 0 ETH | 0.00000165 | ||||
| Swap With Red Sn... | 14466982 | 28 days ago | IN | 0.00526785 ETH | 0.00000168 | ||||
| Swap With Red Sn... | 14466917 | 28 days ago | IN | 0 ETH | 0.00000158 | ||||
| Swap With Red Sn... | 14466779 | 28 days ago | IN | 0.00263894 ETH | 0.00000158 | ||||
| Swap With Red Sn... | 14466700 | 28 days ago | IN | 0 ETH | 0.00000159 | ||||
| Swap With Red Sn... | 14205644 | 31 days ago | IN | 0.00264301 ETH | 0.00000158 | ||||
| Swap With Red Sn... | 14108593 | 32 days ago | IN | 0 ETH | 0.00000158 | ||||
| Swap With Red Sn... | 13800420 | 36 days ago | IN | 0 ETH | 0.00000159 | ||||
| Swap With Red Sn... | 13798267 | 36 days ago | IN | 0.00263788 ETH | 0.00000161 | ||||
| Swap With Red Sn... | 13775078 | 36 days ago | IN | 0 ETH | 0.00000159 | ||||
| Swap With Red Sn... | 13774991 | 36 days ago | IN | 0 ETH | 0.0000016 | ||||
| Swap With Red Sn... | 13700376 | 37 days ago | IN | 0 ETH | 0.00000166 | ||||
| Swap With Red Sn... | 13603549 | 38 days ago | IN | 0.00277342 ETH | 0.00000158 | ||||
| Swap With Red Sn... | 13601898 | 38 days ago | IN | 0.00184951 ETH | 0.00000168 | ||||
| Swap With Red Sn... | 12500483 | 51 days ago | IN | 0.00246654 ETH | 0.00000159 | ||||
| Swap With Red Sn... | 12500434 | 51 days ago | IN | 0.00109642 ETH | 0.00000159 | ||||
| Swap With Red Sn... | 11868544 | 58 days ago | IN | 0 ETH | 0.00000166 | ||||
| Swap With Red Sn... | 11868513 | 58 days ago | IN | 0 ETH | 0.00000159 | ||||
| Swap With Red Sn... | 11857172 | 58 days ago | IN | 0 ETH | 0.00000158 | ||||
| Swap With Red Sn... | 11857110 | 58 days ago | IN | 0.00254537 ETH | 0.00000168 | ||||
| Swap With Red Sn... | 11857073 | 58 days ago | IN | 0.00254537 ETH | 0.00000158 | ||||
| Set Protocol Fee | 11426162 | 63 days ago | IN | 0 ETH | 0.00000135 | ||||
| Swap With Red Sn... | 11425391 | 63 days ago | IN | 0 ETH | 0.00000165 |
Latest 25 internal transactions (View All)
Advanced mode:
| Parent Transaction Hash | Block | From | To | |||
|---|---|---|---|---|---|---|
| 15861413 | 12 days ago | 0.00588227 ETH | ||||
| 15861413 | 12 days ago | 0.00588345 ETH | ||||
| 15697752 | 14 days ago | 0.00525786 ETH | ||||
| 14467099 | 28 days ago | 0.00525471 ETH | ||||
| 14467099 | 28 days ago | 0.00525576 ETH | ||||
| 14466982 | 28 days ago | 0.00526679 ETH | ||||
| 14466917 | 28 days ago | 0.00262203 ETH | ||||
| 14466917 | 28 days ago | 0.00262255 ETH | ||||
| 14466779 | 28 days ago | 0.00263841 ETH | ||||
| 14466700 | 28 days ago | 0.00262991 ETH | ||||
| 14466700 | 28 days ago | 0.00263043 ETH | ||||
| 14205644 | 31 days ago | 0.00264248 ETH | ||||
| 14108593 | 32 days ago | 0.00018881 ETH | ||||
| 14108593 | 32 days ago | 0.00018885 ETH | ||||
| 13800420 | 36 days ago | 0.00266163 ETH | ||||
| 13800420 | 36 days ago | 0.00266216 ETH | ||||
| 13798267 | 36 days ago | 0.00263735 ETH | ||||
| 13775078 | 36 days ago | 0.00370476 ETH | ||||
| 13775078 | 36 days ago | 0.00370551 ETH | ||||
| 13774991 | 36 days ago | 0.00220315 ETH | ||||
| 13774991 | 36 days ago | 0.00220359 ETH | ||||
| 13700376 | 37 days ago | 0.00187662 ETH | ||||
| 13700376 | 37 days ago | 0.00187699 ETH | ||||
| 13603549 | 38 days ago | 0.00277287 ETH | ||||
| 13601898 | 38 days ago | 0.00184914 ETH |
Cross-Chain Transactions
Loading...
Loading
Contract Source Code Verified (Exact Match)
Contract Name:
RishuRedSnwapper
Compiler Version
v0.8.26+commit.8a97fa7a
Optimization Enabled:
Yes with 200 runs
Other Settings:
cancun EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// 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 "./interfaces/IWETH9.sol";
import "./interfaces/IRedSnwapper.sol";
/// @title RishuRedSnwapper
/// @notice A contract for performing swaps through SushiSwap's RedSnwapper aggregator with protocol fees
/// @dev Handles both ERC20 and native token swaps with fee collection in WMATIC or USDT
contract RishuRedSnwapper is Ownable {
// RedSnwapper contract address - this should be set to the actual RedSnwapper address
address public immutable redSnwapper;
// Wrapped native token address (WETH, WMATIC, WBNB, etc.)
address public immutable WRAPPED_NATIVE;
// Stable token address (USDT, USDC, etc.)
address public immutable STABLE_TOKEN;
// Protocol fee in basis points (e.g., 30 for 0.3%)
uint24 public protocolFeeBps = 30; // 0.3% protocol fee
uint256 public constant BPS_DENOMINATOR = 10_000; // Basis points denominator
// Track protocol fees for each token
mapping(address => uint256) internal protocolFeeBalance;
using SafeERC20 for IERC20;
/// @notice Emitted when a swap is executed
event SwapExecuted(
address indexed account,
address indexed tokenIn,
address indexed tokenOut,
uint256 amountIn,
uint256 amountOut
);
/// @notice Emitted when protocol fees are claimed
event FeesClaimed(address indexed owner, address indexed feeToken, uint256 amount);
/// @notice Contract constructor
/// @param _redSnwapper RedSnwapper contract address
/// @param _owner Address that will receive protocol fees and own the contract
/// @param _wrappedNative Wrapped native token address (WETH, WMATIC, WBNB, etc.)
/// @param _stableToken Stable token address (USDT, USDC, etc.)
constructor(
address _redSnwapper,
address _owner,
address _wrappedNative,
address _stableToken
) Ownable(_owner) {
redSnwapper = _redSnwapper;
WRAPPED_NATIVE = _wrappedNative;
STABLE_TOKEN = _stableToken;
}
/// @notice Allows the contract to receive native token
receive() external payable {}
/// @notice Executes a swap using RedSnwapper aggregator
/// @param tokenIn Address of input token
/// @param tokenOut Address of output token
/// @param amountIn Amount of input tokens
/// @param amountOutMinimum Minimum amount of output tokens to receive
/// @param txData The transaction data prepared by SushiSwap API
/// @return amountOut The amount of tokens received after the swap
function swapWithRedSnwapper(
address tokenIn,
address tokenOut,
uint256 amountIn,
uint256 amountOutMinimum,
bytes calldata txData
) external payable returns (uint256 amountOut) {
address feeToken = determineFeeToken(tokenIn, tokenOut);
bool isInputNativePOL = tokenIn == WRAPPED_NATIVE && msg.value > 0;
require(isInputNativePOL ? msg.value == amountIn : msg.value == 0, "Incorrect POL amount");
uint256 protocolFee = feeToken == tokenIn ? calculateProtocolFee(amountIn) : 0;
uint256 amountInToSwap = amountIn - protocolFee;
// Store initial balances
// uint256 initialTokenInBalance =
// isInputNativePOL ? address(this).balance : IERC20(tokenIn).balanceOf(address(this));
uint256 initialTokenOutBalance = tokenOut == WRAPPED_NATIVE
? address(this).balance
: IERC20(tokenOut).balanceOf(address(this));
if (!isInputNativePOL) {
IERC20(tokenIn).safeTransferFrom(msg.sender, address(this), amountIn);
IERC20(tokenIn).forceApprove(redSnwapper, amountInToSwap);
}
// Execute the swap through RedSnwapper
uint256 ethValue = isInputNativePOL ? amountInToSwap : 0;
(bool success,) = redSnwapper.call{value: ethValue}(txData);
require(success, "RedSnwapper swap failed");
// Calculate actual amount received
uint256 finalTokenOutBalance = tokenOut == WRAPPED_NATIVE
? address(this).balance
: IERC20(tokenOut).balanceOf(address(this));
amountOut = finalTokenOutBalance - initialTokenOutBalance;
require(amountOut >= amountOutMinimum, "Slippage too high");
uint256 amountOutToUser = amountOut;
// Deduct protocol fee from output if fee token is output token
if (feeToken == tokenOut && feeToken != tokenIn) {
protocolFee = calculateProtocolFee(amountOut);
amountOutToUser -= protocolFee;
}
// Update protocol fee balance
protocolFeeBalance[feeToken] += protocolFee;
// Send tokens to user
if (tokenOut == WRAPPED_NATIVE) {
(bool sent,) = msg.sender.call{value: amountOutToUser}("");
require(sent, "Failed to send native token");
} else {
IERC20(tokenOut).safeTransfer(msg.sender, amountOutToUser);
}
emit SwapExecuted(msg.sender, tokenIn, tokenOut, amountIn, amountOutToUser);
return amountOutToUser;
}
/// @notice Claims accumulated protocol fees
/// @param token Address of the token to claim fees for
function claimFees(
address token
) external onlyOwner {
require(token == WRAPPED_NATIVE || token == STABLE_TOKEN, "Invalid fee token");
uint256 amount = protocolFeeBalance[token];
require(amount > 0, "No fees to claim");
protocolFeeBalance[token] = 0;
if (token == WRAPPED_NATIVE) {
// Check if we have enough native balance first
uint256 nativeBalance = address(this).balance;
if (nativeBalance >= amount) {
// Send directly from native balance
(bool sent,) = msg.sender.call{value: amount}("");
require(sent, "Failed to send native token");
} else {
// If not enough native balance, unwrap wrapped native tokens
uint256 wrappedBalance = IERC20(WRAPPED_NATIVE).balanceOf(address(this));
require(wrappedBalance >= amount, "Insufficient wrapped native balance");
IWETH9(WRAPPED_NATIVE).withdraw(amount);
(bool sent,) = msg.sender.call{value: amount}("");
require(sent, "Failed to send native token");
}
} else {
IERC20(token).safeTransfer(msg.sender, amount);
}
emit FeesClaimed(msg.sender, token, amount);
}
/// @notice Determines which token will be used to collect protocol fees
/// @param tokenIn Input token address
/// @param tokenOut Output token address
/// @return Address of the token that will be used to collect fees
function determineFeeToken(address tokenIn, address tokenOut) internal view returns (address) {
if (tokenIn == WRAPPED_NATIVE || tokenIn == STABLE_TOKEN) {
return tokenIn;
} else if (tokenOut == WRAPPED_NATIVE || tokenOut == STABLE_TOKEN) {
return tokenOut;
} else {
revert("Fee token must be wrapped native or stable token");
}
}
/// @notice Calculates protocol fee amount
/// @param amount Amount to calculate fee from
/// @return Protocol fee amount
function calculateProtocolFee(
uint256 amount
) internal view returns (uint256) {
return (amount * protocolFeeBps) / BPS_DENOMINATOR;
}
/// @notice Gets the protocol fee balance for a token
/// @param token Address of the token to check
/// @return Current protocol fee balance
function getProtocolFeeBalance(
address token
) external view returns (uint256) {
return protocolFeeBalance[token];
}
/// @notice Updates the protocol fee percentage
/// @param _protocolFeeBps New protocol fee in basis points
function setProtocolFee(
uint24 _protocolFeeBps
) external onlyOwner {
require(_protocolFeeBps <= BPS_DENOMINATOR, "Protocol fee too high");
protocolFeeBps = _protocolFeeBps;
}
/// @notice Emergency function to recover stuck tokens
/// @param token Address of the token to recover
/// @param amount Amount to recover
function emergencyWithdraw(address token, uint256 amount) external onlyOwner {
if (token == address(0)) {
(bool sent,) = msg.sender.call{value: amount}("");
require(sent, "Failed to send native token");
} else {
IERC20(token).safeTransfer(msg.sender, amount);
}
}
}// 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.1.0) (token/ERC20/IERC20.sol)
pragma solidity ^0.8.20;
/**
* @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: UNLICENSED
pragma solidity ^0.8.26;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
/// @title WETH9 Interface
/// @notice Interface for wrapped native token operations
interface IWETH9 is IERC20 {
/// @notice Deposit native token to get wrapped token
function deposit() external payable;
/// @notice Withdraw native token by burning wrapped token
/// @param wad Amount of wrapped token to burn
function withdraw(
uint256 wad
) external;
}// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.26;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
/// @title IRedSnwapper
/// @notice Interface for SushiSwap's RedSnwapper aggregator contract
/// @dev Based on official SushiSwap documentation
interface IRedSnwapper {
/// @notice Single token swap function
/// @param tokenIn Input token contract
/// @param amountIn Amount of input tokens
/// @param recipient Address to receive output tokens
/// @param tokenOut Output token contract
/// @param amountOutMin Minimum amount of output tokens to receive
/// @param executor Executor contract to handle swap logic
/// @param executorData Data to pass to executor
/// @return amountOut Amount of output tokens received
function snwap(
IERC20 tokenIn,
uint256 amountIn,
address recipient,
IERC20 tokenOut,
uint256 amountOutMin,
address executor,
bytes calldata executorData
) external payable returns (uint256 amountOut);
struct InputToken {
IERC20 token;
uint256 amount;
}
struct OutputToken {
IERC20 token;
uint256 amountMin;
address recipient;
}
struct Executor {
address target;
bytes data;
}
/// @notice Multiple token swap function
/// @param inputTokens Array of input tokens and amounts
/// @param outputTokens Array of output tokens and minimum amounts
/// @param executors Array of executors to handle swap logic
/// @return amountOut Array of output amounts received
function snwapMultiple(
InputToken[] calldata inputTokens,
OutputToken[] calldata outputTokens,
Executor[] calldata executors
) external payable returns (uint256[] memory amountOut);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (interfaces/IERC1363.sol)
pragma solidity ^0.8.20;
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;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC20.sol)
pragma solidity ^0.8.20;
import {IERC20} from "../token/ERC20/IERC20.sol";// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC165.sol)
pragma solidity ^0.8.20;
import {IERC165} from "../utils/introspection/IERC165.sol";// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (utils/introspection/IERC165.sol)
pragma solidity ^0.8.20;
/**
* @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);
}{
"remappings": [
"@openzeppelin/=lib/openzeppelin-contracts/",
"@uniswap/v3-core/=lib/v3-core/",
"@uniswap/v3-periphery/=lib/v3-periphery/",
"@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/",
"v3-core/=lib/v3-core/",
"v3-periphery/=lib/v3-periphery/contracts/"
],
"optimizer": {
"enabled": true,
"runs": 200
},
"metadata": {
"useLiteralContent": false,
"bytecodeHash": "ipfs",
"appendCBOR": true
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"evmVersion": "cancun",
"viaIR": true
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"address","name":"_redSnwapper","type":"address"},{"internalType":"address","name":"_owner","type":"address"},{"internalType":"address","name":"_wrappedNative","type":"address"},{"internalType":"address","name":"_stableToken","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"OwnableInvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"OwnableUnauthorizedAccount","type":"error"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"SafeERC20FailedOperation","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"feeToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"FeesClaimed","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":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"tokenIn","type":"address"},{"indexed":true,"internalType":"address","name":"tokenOut","type":"address"},{"indexed":false,"internalType":"uint256","name":"amountIn","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amountOut","type":"uint256"}],"name":"SwapExecuted","type":"event"},{"inputs":[],"name":"BPS_DENOMINATOR","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"STABLE_TOKEN","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"WRAPPED_NATIVE","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"claimFees","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"emergencyWithdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"getProtocolFeeBalance","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":"protocolFeeBps","outputs":[{"internalType":"uint24","name":"","type":"uint24"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"redSnwapper","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint24","name":"_protocolFeeBps","type":"uint24"}],"name":"setProtocolFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"tokenIn","type":"address"},{"internalType":"address","name":"tokenOut","type":"address"},{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"uint256","name":"amountOutMinimum","type":"uint256"},{"internalType":"bytes","name":"txData","type":"bytes"}],"name":"swapWithRedSnwapper","outputs":[{"internalType":"uint256","name":"amountOut","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]Contract Creation Code
60e03461014357601f61107b38819003918201601f19168301916001600160401b0383118484101761014757808492608094604052833981010312610143576100478161015b565b906100546020820161015b565b9061006d60606100666040840161015b565b920161015b565b6001600160a01b03909216928315610130575f54604051948060018060a01b0383167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a36001600160b81b031990911617600f60a11b175f5560805260a05260c052610f0b90816101708239608051818181610152015281816103060152610559015260a0518181816101b401528181610269015281816109630152610d3b015260c05181818161088501528181610ba501528181610df60152610e290152f35b631e4fbdf760e01b5f525f60045260245ffd5b5f80fd5b634e487b7160e01b5f52604160045260245ffd5b51906001600160a01b03821682036101435756fe6080604052600436101561001a575b3615610018575f80fd5b005b5f803560e01c806315a0ea6a1461093357806335659fb81461090e578063715018a6146108b45780637754f8871461086f5780637cdea7bf146108365780637feedaa1146107a75780638da5cb5b1461078057806395ccea6714610728578063a9b2895b146101e3578063d999984d1461019e578063e1a4521814610181578063f1281c3f1461013c5763f2fde38b146100b4575061000e565b34610139576020366003190112610139576100cd610bd4565b6100d5610ccc565b6001600160a01b031680156101255781546001600160a01b03198116821783556001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08380a380f35b631e4fbdf760e01b82526004829052602482fd5b80fd5b50346101395780600319360112610139576040517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b503461013957806003193601126101395760206040516127108152f35b50346101395780600319360112610139576040517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b5060a0366003190112610139576101f8610bd4565b60243591906001600160a01b03831690818403610724576044356084359367ffffffffffffffff851161013957366023860112156101395784600401359567ffffffffffffffff87116107205736602488880101116107205761025b9084610d30565b6001600160a01b03938416937f000000000000000000000000000000000000000000000000000000000000000016908482149081610716575b811561070f578434145b156106d3576001600160a01b03168581149790919088156106cb57846102c387610e5a565b9a5b6102cf8c89610cab565b958a1495861561064857829360249147965b8c8c821561051e575b50501561051657925b80604051938493018337810184815203917f00000000000000000000000000000000000000000000000000000000000000005af161032f610c20565b50156104d157821561045a576103459047610cab565b60643581106104215780978783149081610418575b506103fa575b5082526001602052604082209687549081018091116103e657602097555f146103d55780808061039c9388335af1610396610c20565b50610c5f565b60405190815283858201527f764f0dc063c06f32d89a3f3af80c0db4be8a090901f589a478b447e0a51f09f160403392a4604051908152f35b506103e1843385610cf2565b61039c565b634e487b7160e01b83526011600452602483fd5b9750955061041161040a88610e5a565b8098610cab565b955f610360565b9050155f61035a565b60405162461bcd60e51b81526020600482015260116024820152700a6d8d2e0e0c2ceca40e8dede40d0d2ced607b1b6044820152606490fd5b6040516370a0823160e01b8152306004820152906020826024818b5afa80156104c657859061048e575b6103459250610cab565b506020823d6020116104be575b816104a860209383610bea565b810103126104ba576103459151610484565b5f80fd5b3d915061049b565b6040513d87823e3d90fd5b60405162461bcd60e51b815260206004820152601760248201527f526564536e7761707065722073776170206661696c65640000000000000000006044820152606490fd5b5083926102f3565b61055791604051916323b872dd60e01b60208401523388840152306044840152606483015260648252610552608483610bea565b610e7d565b7f00000000000000000000000000000000000000000000000000000000000000008d6040519060208981840163095ea7b360e01b81526105c1856105b38a898e840160209093929193604081019460018060a01b031681520152565b03601f198101875286610bea565b84519082855af189513d8261062c575b5050156105e2575b9150508c6102ea565b60405163095ea7b360e01b60208201526001600160a01b039093168784015260448084018a90528352610624926105529061061e606482610bea565b82610e7d565b5f808e6105d9565b9091506106405750803b15155b5f806105d1565b600114610639565b6040516370a0823160e01b8152306004820152919250906020816024818e5afa9081156106c05790889392918491610688575b50936024918495966102e1565b919350506020813d6020116106b8575b816106a560209383610bea565b810103126104ba5751879290602461067b565b3d9150610698565b6040513d8a823e3d90fd5b84809a6102c5565b60405162461bcd60e51b8152602060048201526014602482015273125b98dbdc9c9958dd081413d308185b5bdd5b9d60621b6044820152606490fd5b341561029e565b3415159150610294565b5080fd5b8280fd5b50346101395760403660031901126101395780610743610bd4565b6024359061074f610ccc565b6001600160a01b03168061077457509080808061077194335af1610396610c20565b80f35b61077192503390610cf2565b5034610139578060031936011261013957546040516001600160a01b039091168152602090f35b50346101395760203660031901126101395760043562ffffff811680820361072457612710906107d5610ccc565b116107f957815462ffffff60a01b191660a09190911b62ffffff60a01b1617815580f35b60405162461bcd60e51b81526020600482015260156024820152740a0e4dee8dec6ded840cccaca40e8dede40d0d2ced605b1b6044820152606490fd5b5034610139576020366003190112610139576020906040906001600160a01b0361085e610bd4565b168152600183522054604051908152f35b50346101395780600319360112610139576040517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b50346101395780600319360112610139576108cd610ccc565b80546001600160a01b03198116825581906001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a380f35b503461013957806003193601126101395762ffffff6020915460a01c16604051908152f35b50346104ba5760203660031901126104ba5761094d610bd4565b610955610ccc565b6001600160a01b03908116907f00000000000000000000000000000000000000000000000000000000000000001681811490818015610ba2575b15610b6957825f52600160205260405f2054918215610b31575f8481526001602052604081205515610b2557478211610a0557506109d68380808085335af1610396610c20565b6040519081527ffe3464cd748424446c37877c28ce5b700222c5bc9f90d908afcc4e5cb22707ff60203392a380f35b6040516370a0823160e01b8152306004820152602081602481855afa8015610a945783915f91610af0575b5010610a9f57803b156104ba575f8091602460405180948193632e1a7d4d60e01b83528760048401525af18015610a9457610a7f575b50610a7a8380808085335af1610396610c20565b6109d6565b610a8c9193505f90610bea565b5f915f610a66565b6040513d5f823e3d90fd5b60405162461bcd60e51b815260206004820152602360248201527f496e73756666696369656e742077726170706564206e61746976652062616c616044820152626e636560e81b6064820152608490fd5b9150506020813d602011610b1d575b81610b0c60209383610bea565b810103126104ba578290515f610a30565b3d9150610aff565b50610a7a813384610cf2565b60405162461bcd60e51b815260206004820152601060248201526f4e6f206665657320746f20636c61696d60801b6044820152606490fd5b60405162461bcd60e51b815260206004820152601160248201527024b73b30b634b2103332b2903a37b5b2b760791b6044820152606490fd5b507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316831461098f565b600435906001600160a01b03821682036104ba57565b90601f8019910116810190811067ffffffffffffffff821117610c0c57604052565b634e487b7160e01b5f52604160045260245ffd5b3d15610c5a573d9067ffffffffffffffff8211610c0c5760405191610c4f601f8201601f191660200184610bea565b82523d5f602084013e565b606090565b15610c6657565b60405162461bcd60e51b815260206004820152601b60248201527f4661696c656420746f2073656e64206e617469766520746f6b656e00000000006044820152606490fd5b91908203918211610cb857565b634e487b7160e01b5f52601160045260245ffd5b5f546001600160a01b03163303610cdf57565b63118cdaa760e01b5f523360045260245ffd5b60405163a9059cbb60e01b60208201526001600160a01b03929092166024830152604480830193909352918152610d2e91610552606483610bea565b565b906001600160a01b037f00000000000000000000000000000000000000000000000000000000000000008116908316808214908115610e27575b5015610d7557505090565b9091506001600160a01b038216908114908115610df4575b5015610d965790565b60405162461bcd60e51b815260206004820152603060248201527f46656520746f6b656e206d7573742062652077726170706564206e617469766560448201526f1037b91039ba30b13632903a37b5b2b760811b6064820152608490fd5b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03161490505f610d8d565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03161490505f610d6a565b62ffffff5f5460a01c1690818102918183041490151715610cb857612710900490565b905f602091828151910182855af115610a94575f513d610ecc57506001600160a01b0381163b155b610eac5750565b635274afe760e01b5f9081526001600160a01b0391909116600452602490fd5b60011415610ea556fea26469706673582212200737747c12f2438472c6330d3c020bf72b56f9faa58b85592fe6dba7913280fe64736f6c634300081a0033000000000000000000000000ac4c6e212a361c968f1725b4d055b47e63f80b7500000000000000000000000004fbbbef968a6e0b2df511884a8a421177b9ec05000000000000000000000000ee7d8bcfb72bc1880d0cf19822eb0a2e6577ab620000000000000000000000002dca96907fde857dd3d816880a0df407eeb2d2f2
Deployed Bytecode
0x6080604052600436101561001a575b3615610018575f80fd5b005b5f803560e01c806315a0ea6a1461093357806335659fb81461090e578063715018a6146108b45780637754f8871461086f5780637cdea7bf146108365780637feedaa1146107a75780638da5cb5b1461078057806395ccea6714610728578063a9b2895b146101e3578063d999984d1461019e578063e1a4521814610181578063f1281c3f1461013c5763f2fde38b146100b4575061000e565b34610139576020366003190112610139576100cd610bd4565b6100d5610ccc565b6001600160a01b031680156101255781546001600160a01b03198116821783556001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08380a380f35b631e4fbdf760e01b82526004829052602482fd5b80fd5b50346101395780600319360112610139576040517f000000000000000000000000ac4c6e212a361c968f1725b4d055b47e63f80b756001600160a01b03168152602090f35b503461013957806003193601126101395760206040516127108152f35b50346101395780600319360112610139576040517f000000000000000000000000ee7d8bcfb72bc1880d0cf19822eb0a2e6577ab626001600160a01b03168152602090f35b5060a0366003190112610139576101f8610bd4565b60243591906001600160a01b03831690818403610724576044356084359367ffffffffffffffff851161013957366023860112156101395784600401359567ffffffffffffffff87116107205736602488880101116107205761025b9084610d30565b6001600160a01b03938416937f000000000000000000000000ee7d8bcfb72bc1880d0cf19822eb0a2e6577ab6216908482149081610716575b811561070f578434145b156106d3576001600160a01b03168581149790919088156106cb57846102c387610e5a565b9a5b6102cf8c89610cab565b958a1495861561064857829360249147965b8c8c821561051e575b50501561051657925b80604051938493018337810184815203917f000000000000000000000000ac4c6e212a361c968f1725b4d055b47e63f80b755af161032f610c20565b50156104d157821561045a576103459047610cab565b60643581106104215780978783149081610418575b506103fa575b5082526001602052604082209687549081018091116103e657602097555f146103d55780808061039c9388335af1610396610c20565b50610c5f565b60405190815283858201527f764f0dc063c06f32d89a3f3af80c0db4be8a090901f589a478b447e0a51f09f160403392a4604051908152f35b506103e1843385610cf2565b61039c565b634e487b7160e01b83526011600452602483fd5b9750955061041161040a88610e5a565b8098610cab565b955f610360565b9050155f61035a565b60405162461bcd60e51b81526020600482015260116024820152700a6d8d2e0e0c2ceca40e8dede40d0d2ced607b1b6044820152606490fd5b6040516370a0823160e01b8152306004820152906020826024818b5afa80156104c657859061048e575b6103459250610cab565b506020823d6020116104be575b816104a860209383610bea565b810103126104ba576103459151610484565b5f80fd5b3d915061049b565b6040513d87823e3d90fd5b60405162461bcd60e51b815260206004820152601760248201527f526564536e7761707065722073776170206661696c65640000000000000000006044820152606490fd5b5083926102f3565b61055791604051916323b872dd60e01b60208401523388840152306044840152606483015260648252610552608483610bea565b610e7d565b7f000000000000000000000000ac4c6e212a361c968f1725b4d055b47e63f80b758d6040519060208981840163095ea7b360e01b81526105c1856105b38a898e840160209093929193604081019460018060a01b031681520152565b03601f198101875286610bea565b84519082855af189513d8261062c575b5050156105e2575b9150508c6102ea565b60405163095ea7b360e01b60208201526001600160a01b039093168784015260448084018a90528352610624926105529061061e606482610bea565b82610e7d565b5f808e6105d9565b9091506106405750803b15155b5f806105d1565b600114610639565b6040516370a0823160e01b8152306004820152919250906020816024818e5afa9081156106c05790889392918491610688575b50936024918495966102e1565b919350506020813d6020116106b8575b816106a560209383610bea565b810103126104ba5751879290602461067b565b3d9150610698565b6040513d8a823e3d90fd5b84809a6102c5565b60405162461bcd60e51b8152602060048201526014602482015273125b98dbdc9c9958dd081413d308185b5bdd5b9d60621b6044820152606490fd5b341561029e565b3415159150610294565b5080fd5b8280fd5b50346101395760403660031901126101395780610743610bd4565b6024359061074f610ccc565b6001600160a01b03168061077457509080808061077194335af1610396610c20565b80f35b61077192503390610cf2565b5034610139578060031936011261013957546040516001600160a01b039091168152602090f35b50346101395760203660031901126101395760043562ffffff811680820361072457612710906107d5610ccc565b116107f957815462ffffff60a01b191660a09190911b62ffffff60a01b1617815580f35b60405162461bcd60e51b81526020600482015260156024820152740a0e4dee8dec6ded840cccaca40e8dede40d0d2ced605b1b6044820152606490fd5b5034610139576020366003190112610139576020906040906001600160a01b0361085e610bd4565b168152600183522054604051908152f35b50346101395780600319360112610139576040517f0000000000000000000000002dca96907fde857dd3d816880a0df407eeb2d2f26001600160a01b03168152602090f35b50346101395780600319360112610139576108cd610ccc565b80546001600160a01b03198116825581906001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a380f35b503461013957806003193601126101395762ffffff6020915460a01c16604051908152f35b50346104ba5760203660031901126104ba5761094d610bd4565b610955610ccc565b6001600160a01b03908116907f000000000000000000000000ee7d8bcfb72bc1880d0cf19822eb0a2e6577ab621681811490818015610ba2575b15610b6957825f52600160205260405f2054918215610b31575f8481526001602052604081205515610b2557478211610a0557506109d68380808085335af1610396610c20565b6040519081527ffe3464cd748424446c37877c28ce5b700222c5bc9f90d908afcc4e5cb22707ff60203392a380f35b6040516370a0823160e01b8152306004820152602081602481855afa8015610a945783915f91610af0575b5010610a9f57803b156104ba575f8091602460405180948193632e1a7d4d60e01b83528760048401525af18015610a9457610a7f575b50610a7a8380808085335af1610396610c20565b6109d6565b610a8c9193505f90610bea565b5f915f610a66565b6040513d5f823e3d90fd5b60405162461bcd60e51b815260206004820152602360248201527f496e73756666696369656e742077726170706564206e61746976652062616c616044820152626e636560e81b6064820152608490fd5b9150506020813d602011610b1d575b81610b0c60209383610bea565b810103126104ba578290515f610a30565b3d9150610aff565b50610a7a813384610cf2565b60405162461bcd60e51b815260206004820152601060248201526f4e6f206665657320746f20636c61696d60801b6044820152606490fd5b60405162461bcd60e51b815260206004820152601160248201527024b73b30b634b2103332b2903a37b5b2b760791b6044820152606490fd5b507f0000000000000000000000002dca96907fde857dd3d816880a0df407eeb2d2f26001600160a01b0316831461098f565b600435906001600160a01b03821682036104ba57565b90601f8019910116810190811067ffffffffffffffff821117610c0c57604052565b634e487b7160e01b5f52604160045260245ffd5b3d15610c5a573d9067ffffffffffffffff8211610c0c5760405191610c4f601f8201601f191660200184610bea565b82523d5f602084013e565b606090565b15610c6657565b60405162461bcd60e51b815260206004820152601b60248201527f4661696c656420746f2073656e64206e617469766520746f6b656e00000000006044820152606490fd5b91908203918211610cb857565b634e487b7160e01b5f52601160045260245ffd5b5f546001600160a01b03163303610cdf57565b63118cdaa760e01b5f523360045260245ffd5b60405163a9059cbb60e01b60208201526001600160a01b03929092166024830152604480830193909352918152610d2e91610552606483610bea565b565b906001600160a01b037f000000000000000000000000ee7d8bcfb72bc1880d0cf19822eb0a2e6577ab628116908316808214908115610e27575b5015610d7557505090565b9091506001600160a01b038216908114908115610df4575b5015610d965790565b60405162461bcd60e51b815260206004820152603060248201527f46656520746f6b656e206d7573742062652077726170706564206e617469766560448201526f1037b91039ba30b13632903a37b5b2b760811b6064820152608490fd5b7f0000000000000000000000002dca96907fde857dd3d816880a0df407eeb2d2f26001600160a01b03161490505f610d8d565b7f0000000000000000000000002dca96907fde857dd3d816880a0df407eeb2d2f26001600160a01b03161490505f610d6a565b62ffffff5f5460a01c1690818102918183041490151715610cb857612710900490565b905f602091828151910182855af115610a94575f513d610ecc57506001600160a01b0381163b155b610eac5750565b635274afe760e01b5f9081526001600160a01b0391909116600452602490fd5b60011415610ea556fea26469706673582212200737747c12f2438472c6330d3c020bf72b56f9faa58b85592fe6dba7913280fe64736f6c634300081a0033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000ac4c6e212a361c968f1725b4d055b47e63f80b7500000000000000000000000004fbbbef968a6e0b2df511884a8a421177b9ec05000000000000000000000000ee7d8bcfb72bc1880d0cf19822eb0a2e6577ab620000000000000000000000002dca96907fde857dd3d816880a0df407eeb2d2f2
-----Decoded View---------------
Arg [0] : _redSnwapper (address): 0xAC4c6e212A361c968F1725b4d055b47E63F80b75
Arg [1] : _owner (address): 0x04FbBbef968A6e0b2Df511884a8A421177b9Ec05
Arg [2] : _wrappedNative (address): 0xEE7D8BCFb72bC1880D0Cf19822eB0A2e6577aB62
Arg [3] : _stableToken (address): 0x2DCa96907fde857dd3D816880A0df407eeB2D2F2
-----Encoded View---------------
4 Constructor Arguments found :
Arg [0] : 000000000000000000000000ac4c6e212a361c968f1725b4d055b47e63f80b75
Arg [1] : 00000000000000000000000004fbbbef968a6e0b2df511884a8a421177b9ec05
Arg [2] : 000000000000000000000000ee7d8bcfb72bc1880d0cf19822eb0a2e6577ab62
Arg [3] : 0000000000000000000000002dca96907fde857dd3d816880a0df407eeb2d2f2
Loading...
Loading
Loading...
Loading
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.