Feature Tip: Add private address tag to any address under My Name Tag !
Source Code
Overview
ETH Balance
0 ETH
Eth Value
$0.00| Transaction Hash |
Method
|
Block
|
From
|
|
To
|
||||
|---|---|---|---|---|---|---|---|---|---|
Latest 15 internal transactions
Advanced mode:
| Parent Transaction Hash | Method | Block |
From
|
|
To
|
||
|---|---|---|---|---|---|---|---|
| Swap | 17811876 | 972 days ago | 0.00067273 ETH | ||||
| Deposit | 17811876 | 972 days ago | 0.01 ETH | ||||
| Adapter Bridge | 17811876 | 972 days ago | 0.01067273 ETH | ||||
| Swap | 17785400 | 976 days ago | 0.001117 ETH | ||||
| Adapter Bridge | 17785400 | 976 days ago | 0.001117 ETH | ||||
| Swap | 17777888 | 977 days ago | 0.00094622 ETH | ||||
| Adapter Bridge | 17777888 | 977 days ago | 0.00094622 ETH | ||||
| Swap | 17776850 | 977 days ago | 0.00081497 ETH | ||||
| Adapter Bridge | 17776850 | 977 days ago | 0.00081497 ETH | ||||
| Swap | 17776773 | 977 days ago | 0.00076264 ETH | ||||
| Adapter Bridge | 17776773 | 977 days ago | 0.00076264 ETH | ||||
| Swap | 17776668 | 977 days ago | 0.00075326 ETH | ||||
| Adapter Bridge | 17776668 | 977 days ago | 0.00075326 ETH | ||||
| Swap | 17776554 | 977 days ago | 0.00075326 ETH | ||||
| Adapter Bridge | 17776554 | 977 days ago | 0.00075326 ETH |
Loading...
Loading
Loading...
Loading
Cross-Chain Transactions
Loading...
Loading
Contract Name:
StargateAdapter
Compiler Version
v0.8.10+commit.fc410830
Optimization Enabled:
Yes with 999999 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.8.10;
import "../interfaces/IRouteProcessor.sol";
import "../interfaces/IWETH.sol";
import "openzeppelin-contracts/contracts/token/ERC20/utils/SafeERC20.sol";
import "../interfaces/ISushiXSwapV2Adapter.sol";
import "../interfaces/stargate/IStargateRouter.sol";
import "../interfaces/stargate/IStargateReceiver.sol";
import "../interfaces/stargate/IStargateWidget.sol";
import "../interfaces/stargate/IStargateEthVault.sol";
contract StargateAdapter is ISushiXSwapV2Adapter, IStargateReceiver {
using SafeERC20 for IERC20;
IStargateRouter public immutable stargateRouter;
IStargateWidget public immutable stargateWidget;
address public immutable sgeth;
IRouteProcessor public immutable rp;
IWETH public immutable weth;
address constant NATIVE_ADDRESS =
0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;
struct StargateTeleportParams {
uint16 dstChainId; // stargate dst chain id
address token; // token getting bridged
uint256 srcPoolId; // stargate src pool id
uint256 dstPoolId; // stargate dst pool id
uint256 amount; // amount to bridge
uint256 amountMin; // amount to bridge minimum
uint256 dustAmount; // native token to be received on dst chain
address receiver;
address to;
uint256 gas; // extra gas to be sent for dst chain operations
}
error InsufficientGas();
error NotStargateRouter();
error RpSentNativeIn();
constructor(
address _stargateRouter,
address _stargateWidget,
address _sgeth,
address _rp,
address _weth
) {
stargateRouter = IStargateRouter(_stargateRouter);
stargateWidget = IStargateWidget(_stargateWidget);
sgeth = _sgeth;
rp = IRouteProcessor(_rp);
weth = IWETH(_weth);
}
function swap(
uint256 _amountBridged,
bytes calldata _swapData,
address _token,
bytes calldata _payloadData
) external payable override {
IRouteProcessor.RouteProcessorData memory rpd = abi.decode(
_swapData,
(IRouteProcessor.RouteProcessorData)
);
if (_token == sgeth) {
weth.deposit{value: _amountBridged}();
}
// increase token approval to RP
IERC20(rpd.tokenIn).safeIncreaseAllowance(address(rp), _amountBridged);
rp.processRoute(
rpd.tokenIn,
_amountBridged != 0 ? _amountBridged: rpd.amountIn,
rpd.tokenOut,
rpd.amountOutMin,
rpd.to,
rpd.route
);
// tokens should be sent via rp
if (_payloadData.length > 0) {
PayloadData memory pd = abi.decode(_payloadData, (PayloadData));
try
IPayloadExecutor(pd.target).onPayloadReceive(pd.targetData)
{} catch (bytes memory) {
revert();
}
}
}
/// @notice Get the fees to be paid in native token for the swap
/// @param _dstChainId stargate dst chainId
/// @param _functionType stargate Function type 1 for swap.
/// See more at https://stargateprotocol.gitbook.io/stargate/developers/function-types
/// @param _receiver receiver on the dst chain
/// @param _gas extra gas being sent
/// @param _dustAmount dust amount to be received at the dst chain
/// @param _payload payload being sent at the dst chain
function getFee(
uint16 _dstChainId,
uint8 _functionType,
address _receiver,
uint256 _gas,
uint256 _dustAmount,
bytes memory _payload
) external view returns (uint256 a, uint256 b) {
(a, b) = stargateRouter.quoteLayerZeroFee(
_dstChainId,
_functionType,
abi.encodePacked(_receiver),
abi.encode(_payload),
IStargateRouter.lzTxObj(
_gas,
_dustAmount,
abi.encodePacked(_receiver)
)
);
}
function adapterBridge(
bytes calldata _adapterData,
bytes calldata _swapData,
bytes calldata _payloadData
) external payable override {
StargateTeleportParams memory params = abi.decode(
_adapterData,
(StargateTeleportParams)
);
if (params.token == NATIVE_ADDRESS) {
// RP should not send native in, since we won't know the amount from dust
if (params.amount == 0) revert RpSentNativeIn();
IStargateEthVault(sgeth).deposit{value: params.amount}();
params.token = sgeth;
} else if (params.token == address(weth)) {
// this case is for when rp sends weth in
if (params.amount == 0) params.amount = weth.balanceOf(address(this));
weth.withdraw(params.amount);
IStargateEthVault(sgeth).deposit{value: params.amount}();
params.token = sgeth;
}
IERC20(params.token).safeApprove(
address(stargateRouter),
params.amount != 0
? params.amount
: IERC20(params.token).balanceOf(address(this))
);
bytes memory payload = bytes("");
if (_swapData.length > 0 || _payloadData.length > 0) {
/// @dev dst gas should be more than 100k
if (params.gas < 100000) revert InsufficientGas();
payload = abi.encode(params.to, _swapData, _payloadData);
}
stargateRouter.swap{value: address(this).balance}(
params.dstChainId,
params.srcPoolId,
params.dstPoolId,
payable(tx.origin), // refund address
params.amount != 0
? params.amount
: IERC20(params.token).balanceOf(address(this)),
params.amountMin,
IStargateRouter.lzTxObj(
params.gas,
params.dustAmount,
abi.encodePacked(params.receiver)
),
abi.encodePacked(params.receiver),
payload
);
stargateWidget.partnerSwap(0x0001);
}
/// @notice Receiver function on dst chain
/// @param _token bridge token received
/// @param amountLD amount received
/// @param payload ABI-Encoded data received from src chain
function sgReceive(
uint16,
bytes memory,
uint256,
address _token,
uint256 amountLD,
bytes memory payload
) external {
if (msg.sender != address(stargateRouter)) revert NotStargateRouter();
(address to, bytes memory _swapData, bytes memory _payloadData) = abi
.decode(payload, (address, bytes, bytes));
uint256 reserveGas = 100000;
bool failed;
if (gasleft() < reserveGas || _swapData.length == 0) {
if (_token != sgeth) {
IERC20(_token).safeTransfer(to, amountLD);
}
/// @dev transfer any native token received as dust to the to address
if (address(this).balance > 0)
to.call{value: (address(this).balance)}("");
failed = true;
return;
}
// 100000 -> exit gas
uint256 limit = gasleft() - reserveGas;
//todo: what if you had payload data for another adapter, but no swapData?
if (_swapData.length > 0) {
try
ISushiXSwapV2Adapter(address(this)).swap{gas: limit}(
amountLD,
_swapData,
_token,
_payloadData
)
{} catch (bytes memory) {
if (_token != sgeth) {
IERC20(_token).safeTransfer(to, amountLD);
}
failed = true;
}
}
/// @dev transfer any native token received as dust to the to address
if (address(this).balance > 0)
to.call{value: (address(this).balance)}("");
}
function sendMessage(bytes calldata _adapterData) external {
(_adapterData);
revert();
}
receive() external payable {}
}// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.8.10;
interface IRouteProcessor {
struct RouteProcessorData {
address tokenIn;
uint256 amountIn;
address tokenOut;
uint256 amountOutMin;
address to;
bytes route;
}
function processRoute(
address tokenIn,
uint256 amountIn,
address tokenOut,
uint256 amountOutMin,
address to,
bytes memory route
) external payable returns (uint256 amountOut);
}// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.8.10;
interface IWETH {
function deposit() external payable;
function transfer(address to, uint256 value) external returns (bool);
function withdraw(uint256) external;
function balanceOf(address account) external view returns (uint256);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/utils/SafeERC20.sol)
pragma solidity ^0.8.0;
import "../IERC20.sol";
import "../extensions/draft-IERC20Permit.sol";
import "../../../utils/Address.sol";
/**
* @title SafeERC20
* @dev Wrappers around ERC20 operations that throw on failure (when the token
* contract returns false). Tokens that return no value (and instead revert or
* throw on failure) are also supported, non-reverting calls are assumed to be
* successful.
* To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
* which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
*/
library SafeERC20 {
using Address for address;
function safeTransfer(
IERC20 token,
address to,
uint256 value
) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
}
function safeTransferFrom(
IERC20 token,
address from,
address to,
uint256 value
) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
}
/**
* @dev Deprecated. This function has issues similar to the ones found in
* {IERC20-approve}, and its usage is discouraged.
*
* Whenever possible, use {safeIncreaseAllowance} and
* {safeDecreaseAllowance} instead.
*/
function safeApprove(
IERC20 token,
address spender,
uint256 value
) internal {
// safeApprove should only be called when setting an initial allowance,
// or when resetting it to zero. To increase and decrease it, use
// 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
require(
(value == 0) || (token.allowance(address(this), spender) == 0),
"SafeERC20: approve from non-zero to non-zero allowance"
);
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
}
function safeIncreaseAllowance(
IERC20 token,
address spender,
uint256 value
) internal {
uint256 newAllowance = token.allowance(address(this), spender) + value;
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
function safeDecreaseAllowance(
IERC20 token,
address spender,
uint256 value
) internal {
unchecked {
uint256 oldAllowance = token.allowance(address(this), spender);
require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
uint256 newAllowance = oldAllowance - value;
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
}
function safePermit(
IERC20Permit token,
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) internal {
uint256 nonceBefore = token.nonces(owner);
token.permit(owner, spender, value, deadline, v, r, s);
uint256 nonceAfter = token.nonces(owner);
require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed");
}
/**
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
* on the return value: the return value is optional (but if data is returned, it must not be false).
* @param token The token targeted by the call.
* @param data The call data (encoded using abi.encode or one of its variants).
*/
function _callOptionalReturn(IERC20 token, bytes memory data) private {
// We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
// we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that
// the target address contains contract code and also asserts for success in the low-level call.
bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
if (returndata.length > 0) {
// Return data is optional
require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
}
}
}// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.8.10;
import "./IPayloadExecutor.sol";
interface ISushiXSwapV2Adapter {
struct BridgeParamsAdapter {
address tokenIn;
uint256 amountIn;
address to;
bytes adapterData;
}
struct PayloadData {
address target;
uint256 gasLimit;
bytes targetData;
}
function swap(
uint256 _amountBridged,
bytes calldata _swapData,
address _token,
bytes calldata _payloadData
) external payable;
function adapterBridge(
bytes calldata _adapterData,
bytes calldata _swapDataPayload,
bytes calldata _payloadData
) external payable;
function sendMessage(bytes calldata _adapterData) external;
}// SPDX-License-Identifier: GPL-3.0
pragma solidity 0.8.10;
interface IStargateRouter {
struct lzTxObj {
uint256 dstGasForCall;
uint256 dstNativeAmount;
bytes dstNativeAddr;
}
function swap(
uint16 _dstChainId,
uint256 _srcPoolId,
uint256 _dstPoolId,
address payable _refundAddress,
uint256 _amountLD,
uint256 _minAmountLD,
lzTxObj memory _lzTxParams,
bytes calldata _to,
bytes calldata _payload
) external payable;
function quoteLayerZeroFee(
uint16 _dstChainId,
uint8 _functionType,
bytes calldata _toAddress,
bytes calldata _transferAndCallPayload,
lzTxObj memory _lzTxParams
) external view returns (uint256, uint256);
}// SPDX-License-Identifier: GPL-3.0
pragma solidity 0.8.10;
interface IStargateReceiver {
function sgReceive(
uint16 _chainId,
bytes memory _srcAddress,
uint256 _nonce,
address _token,
uint256 amountLD,
bytes memory payload
) external;
}// SPDX-License-Identifier: GPL-3.0
pragma solidity 0.8.10;
interface IStargateWidget {
function partnerSwap(bytes2 _partnerId) external;
}// SPDX-License-Identifier: GPL-3.0
pragma solidity 0.8.10;
interface IStargateEthVault {
function deposit() external payable;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `to`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address to, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `from` to `to` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(
address from,
address to,
uint256 amount
) external returns (bool);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
* https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
*
* Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
* presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't
* need to send a transaction, and thus is not required to hold Ether at all.
*/
interface IERC20Permit {
/**
* @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,
* given ``owner``'s signed approval.
*
* IMPORTANT: The same issues {IERC20-approve} has related to transaction
* ordering also apply here.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `deadline` must be a timestamp in the future.
* - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`
* over the EIP712-formatted function arguments.
* - the signature must use ``owner``'s current nonce (see {nonces}).
*
* For more information on the signature format, see the
* https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP
* section].
*/
function permit(
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) external;
/**
* @dev Returns the current nonce for `owner`. This value must be
* included whenever a signature is generated for {permit}.
*
* Every successful call to {permit} increases ``owner``'s nonce by one. This
* prevents a signature from being used multiple times.
*/
function nonces(address owner) external view returns (uint256);
/**
* @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.
*/
// solhint-disable-next-line func-name-mixedcase
function DOMAIN_SEPARATOR() external view returns (bytes32);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)
pragma solidity ^0.8.1;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*
* [IMPORTANT]
* ====
* You shouldn't rely on `isContract` to protect against flash loan attacks!
*
* Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
* like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
* constructor.
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize/address.code.length, which returns 0
// for contracts in construction, since the code is only stored at the end
// of the constructor execution.
return account.code.length > 0;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{value: amount}("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain `call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, "Address: low-level call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value
) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value,
string memory errorMessage
) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(
address target,
bytes memory data,
string memory errorMessage
) internal view returns (bytes memory) {
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
return functionDelegateCall(target, data, "Address: low-level delegate call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling
* the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.
*
* _Available since v4.8._
*/
function verifyCallResultFromTarget(
address target,
bool success,
bytes memory returndata,
string memory errorMessage
) internal view returns (bytes memory) {
if (success) {
if (returndata.length == 0) {
// only check isContract if the call was successful and the return data is empty
// otherwise we already know that it was a contract
require(isContract(target), "Address: call to non-contract");
}
return returndata;
} else {
_revert(returndata, errorMessage);
}
}
/**
* @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the
* revert reason or using the provided one.
*
* _Available since v4.3._
*/
function verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) internal pure returns (bytes memory) {
if (success) {
return returndata;
} else {
_revert(returndata, errorMessage);
}
}
function _revert(bytes memory returndata, string memory errorMessage) private pure {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
/// @solidity memory-safe-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.8.10;
interface IPayloadExecutor {
function onPayloadReceive(bytes memory _data) external;
}{
"remappings": [
"ds-test/=lib/forge-std/lib/ds-test/src/",
"forge-std/=lib/forge-std/src/",
"openzeppelin-contracts/=lib/openzeppelin-contracts/"
],
"optimizer": {
"enabled": true,
"runs": 999999
},
"metadata": {
"bytecodeHash": "ipfs"
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"evmVersion": "london",
"libraries": {}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"address","name":"_stargateRouter","type":"address"},{"internalType":"address","name":"_stargateWidget","type":"address"},{"internalType":"address","name":"_sgeth","type":"address"},{"internalType":"address","name":"_rp","type":"address"},{"internalType":"address","name":"_weth","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"InsufficientGas","type":"error"},{"inputs":[],"name":"NotStargateRouter","type":"error"},{"inputs":[],"name":"RpSentNativeIn","type":"error"},{"inputs":[{"internalType":"bytes","name":"_adapterData","type":"bytes"},{"internalType":"bytes","name":"_swapData","type":"bytes"},{"internalType":"bytes","name":"_payloadData","type":"bytes"}],"name":"adapterBridge","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_dstChainId","type":"uint16"},{"internalType":"uint8","name":"_functionType","type":"uint8"},{"internalType":"address","name":"_receiver","type":"address"},{"internalType":"uint256","name":"_gas","type":"uint256"},{"internalType":"uint256","name":"_dustAmount","type":"uint256"},{"internalType":"bytes","name":"_payload","type":"bytes"}],"name":"getFee","outputs":[{"internalType":"uint256","name":"a","type":"uint256"},{"internalType":"uint256","name":"b","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rp","outputs":[{"internalType":"contract IRouteProcessor","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes","name":"_adapterData","type":"bytes"}],"name":"sendMessage","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"","type":"uint16"},{"internalType":"bytes","name":"","type":"bytes"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"address","name":"_token","type":"address"},{"internalType":"uint256","name":"amountLD","type":"uint256"},{"internalType":"bytes","name":"payload","type":"bytes"}],"name":"sgReceive","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"sgeth","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"stargateRouter","outputs":[{"internalType":"contract IStargateRouter","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"stargateWidget","outputs":[{"internalType":"contract IStargateWidget","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amountBridged","type":"uint256"},{"internalType":"bytes","name":"_swapData","type":"bytes"},{"internalType":"address","name":"_token","type":"address"},{"internalType":"bytes","name":"_payloadData","type":"bytes"}],"name":"swap","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"weth","outputs":[{"internalType":"contract IWETH","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"stateMutability":"payable","type":"receive"}]Contract Creation Code
6101206040523480156200001257600080fd5b50604051620025493803806200254983398101604081905262000035916200007c565b6001600160a01b0394851660805292841660a05290831660c052821660e0521661010052620000ec565b80516001600160a01b03811681146200007757600080fd5b919050565b600080600080600060a086880312156200009557600080fd5b620000a0866200005f565b9450620000b0602087016200005f565b9350620000c0604087016200005f565b9250620000d0606087016200005f565b9150620000e0608087016200005f565b90509295509295909350565b60805160a05160c05160e0516101005161239b620001ae6000396000818160d3015281816102ed01528181610b7201528181610bff0152610cba0152600081816101ca0152818161038b01526103c90152600081816101fe015281816102990152818161079b0152818161093b01528181610aab01528181610b4301528181610d2d0152610dc501526000818161017b01526111d2015260008181610232015281816105770152818161070a01528181610df20152610f74015261239b6000f3fe6080604052600436106100b55760003560e01c8063904c1e1f11610069578063a9e56f3c1161004e578063a9e56f3c14610220578063ab8236f314610254578063d09544f61461027457600080fd5b8063904c1e1f146101b8578063a761f5f0146101ec57600080fd5b80636ce4fe031161009a5780636ce4fe03146101345780636f435ac21461016957806382646a581461019d57600080fd5b80633fc8cef3146100c1578063693437a21461011f57600080fd5b366100bc57005b600080fd5b3480156100cd57600080fd5b506100f57f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b61013261012d36600461193d565b610287565b005b34801561014057600080fd5b5061015461014f366004611b44565b610572565b60408051928352602083019190915201610116565b34801561017557600080fd5b506100f57f000000000000000000000000000000000000000000000000000000000000000081565b3480156101a957600080fd5b506101326100bc366004611bcf565b3480156101c457600080fd5b506100f57f000000000000000000000000000000000000000000000000000000000000000081565b3480156101f857600080fd5b506100f57f000000000000000000000000000000000000000000000000000000000000000081565b34801561022c57600080fd5b506100f57f000000000000000000000000000000000000000000000000000000000000000081565b34801561026057600080fd5b5061013261026f366004611c11565b6106f2565b610132610282366004611c9f565b610a27565b600061029585870187611d1a565b90507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16141561036d577f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663d0e30db0886040518263ffffffff1660e01b81526004016000604051808303818588803b15801561035357600080fd5b505af1158015610367573d6000803e3d6000fd5b50505050505b80516103b09073ffffffffffffffffffffffffffffffffffffffff167f000000000000000000000000000000000000000000000000000000000000000089611243565b805173ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001690632646478b90896103ff578360200151610401565b895b6040808601516060870151608088015160a089015193517fffffffff0000000000000000000000000000000000000000000000000000000060e089901b16815261045096959490600401611e4a565b6020604051808303816000875af115801561046f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104939190611ea3565b5081156105695760006104a883850185611ebc565b805160408083015190517fa6ac3db600000000000000000000000000000000000000000000000000000000815292935073ffffffffffffffffffffffffffffffffffffffff9091169163a6ac3db69161050391600401611f5c565b600060405180830381600087803b15801561051d57600080fd5b505af192505050801561052e575060015b610567573d80801561055c576040519150601f19603f3d011682016040523d82523d6000602084013e610561565b606091505b50600080fd5b505b50505050505050565b6000807f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16630a5123698989896040516020016105ef919060609190911b7fffffffffffffffffffffffffffffffffffffffff00000000000000000000000016815260140190565b6040516020818303038152906040528760405160200161060f9190611f5c565b60405160208183030381529060405260405180606001604052808c81526020018b81526020018d604051602001610671919060609190911b7fffffffffffffffffffffffffffffffffffffffff00000000000000000000000016815260140190565b6040516020818303038152906040528152506040518663ffffffff1660e01b81526004016106a3959493929190611f9f565b6040805180830381865afa1580156106bf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106e39190611feb565b90999098509650505050505050565b3373ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001614610761576040517f8c66bf5600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008060008380602001905181019061077a9190612054565b91945092509050620186a06000815a108061079457508351155b1561087d577f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff161461080d5761080d73ffffffffffffffffffffffffffffffffffffffff891686896113c5565b47156108725760405173ffffffffffffffffffffffffffffffffffffffff8616904790600081818185875af1925050503d8060008114610869576040519150601f19603f3d011682016040523d82523d6000602084013e61086e565b606091505b5050505b50610a1f9350505050565b6000825a61088b91906120fa565b8551909150156109b3576040517f693437a2000000000000000000000000000000000000000000000000000000008152309063693437a29083906108d9908c908a908f908b90600401612111565b600060405180830381600088803b1580156108f357600080fd5b5087f193505050508015610905575060015b6109b3573d808015610933576040519150601f19603f3d011682016040523d82523d6000602084013e610938565b606091505b507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff168a73ffffffffffffffffffffffffffffffffffffffff16146109ad576109ad73ffffffffffffffffffffffffffffffffffffffff8b16888b6113c5565b60019250505b4715610a185760405173ffffffffffffffffffffffffffffffffffffffff8716904790600081818185875af1925050503d8060008114610a0f576040519150601f19603f3d011682016040523d82523d6000602084013e610a14565b606091505b5050505b5050505050505b505050505050565b6000610a3586880188612158565b602081015190915073ffffffffffffffffffffffffffffffffffffffff1673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee1415610b70576080810151610aa9576040517fc260024f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663d0e30db082608001516040518263ffffffff1660e01b81526004016000604051808303818588803b158015610b1557600080fd5b505af1158015610b29573d6000803e3d6000fd5b50505073ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016602084015250610ded9050565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16816020015173ffffffffffffffffffffffffffffffffffffffff161415610ded576080810151610c85576040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16906370a0823190602401602060405180830381865afa158015610c5b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c7f9190611ea3565b60808201525b60808101516040517f2e1a7d4d00000000000000000000000000000000000000000000000000000000815260048101919091527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1690632e1a7d4d90602401600060405180830381600087803b158015610d1357600080fd5b505af1158015610d27573d6000803e3d6000fd5b505050507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663d0e30db082608001516040518263ffffffff1660e01b81526004016000604051808303818588803b158015610d9757600080fd5b505af1158015610dab573d6000803e3d6000fd5b50505073ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016602084015250505b610edf7f0000000000000000000000000000000000000000000000000000000000000000826080015160001415610eb75760208301516040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff909116906370a0823190602401602060405180830381865afa158015610e8e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610eb29190611ea3565b610ebd565b82608001515b602084015173ffffffffffffffffffffffffffffffffffffffff169190611420565b60408051602081019091526000815284151580610efb57508215155b15610f7257620186a08261012001511015610f42576040517f1c26714c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b81610100015186868686604051602001610f60959493929190612241565b60405160208183030381529060405290505b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16639fbf10fc47846000015185604001518660600151328860800151600014156110655760208901516040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff909116906370a0823190602401602060405180830381865afa15801561103c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110609190611ea3565b61106b565b88608001515b8960a0015160405180606001604052808c610120015181526020018c60c0015181526020018c60e001516040516020016110d0919060609190911b7fffffffffffffffffffffffffffffffffffffffff00000000000000000000000016815260140190565b6040516020818303038152906040528152508b60e00151604051602001611122919060609190911b7fffffffffffffffffffffffffffffffffffffffff00000000000000000000000016815260140190565b6040516020818303038152906040528b6040518b63ffffffff1660e01b815260040161115699989796959493929190612284565b6000604051808303818588803b15801561116f57600080fd5b505af1158015611183573d6000803e3d6000fd5b50506040517fa87376e90000000000000000000000000000000000000000000000000000000081527e0100000000000000000000000000000000000000000000000000000000000060048201527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16935063a87376e992506024019050600060405180830381600087803b15801561122f57600080fd5b505af1158015610a18573d6000803e3d6000fd5b6040517fdd62ed3e00000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff8381166024830152600091839186169063dd62ed3e90604401602060405180830381865afa1580156112ba573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112de9190611ea3565b6112e8919061230f565b60405173ffffffffffffffffffffffffffffffffffffffff85166024820152604481018290529091506113bf9085907f095ea7b300000000000000000000000000000000000000000000000000000000906064015b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff00000000000000000000000000000000000000000000000000000000909316929092179091526115a7565b50505050565b60405173ffffffffffffffffffffffffffffffffffffffff831660248201526044810182905261141b9084907fa9059cbb000000000000000000000000000000000000000000000000000000009060640161133d565b505050565b8015806114c057506040517fdd62ed3e00000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff838116602483015284169063dd62ed3e90604401602060405180830381865afa15801561149a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114be9190611ea3565b155b611551576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527f20746f206e6f6e2d7a65726f20616c6c6f77616e63650000000000000000000060648201526084015b60405180910390fd5b60405173ffffffffffffffffffffffffffffffffffffffff831660248201526044810182905261141b9084907f095ea7b3000000000000000000000000000000000000000000000000000000009060640161133d565b6000611609826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff166116b39092919063ffffffff16565b80519091501561141b57808060200190518101906116279190612327565b61141b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152608401611548565b60606116c284846000856116ca565b949350505050565b60608247101561175c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c00000000000000000000000000000000000000000000000000006064820152608401611548565b6000808673ffffffffffffffffffffffffffffffffffffffff1685876040516117859190612349565b60006040518083038185875af1925050503d80600081146117c2576040519150601f19603f3d011682016040523d82523d6000602084013e6117c7565b606091505b50915091506117d8878383876117e3565b979650505050505050565b6060831561187657825161186f5773ffffffffffffffffffffffffffffffffffffffff85163b61186f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401611548565b50816116c2565b6116c2838381511561188b5781518083602001fd5b806040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115489190611f5c565b60008083601f8401126118d157600080fd5b50813567ffffffffffffffff8111156118e957600080fd5b60208301915083602082850101111561190157600080fd5b9250929050565b73ffffffffffffffffffffffffffffffffffffffff8116811461192a57600080fd5b50565b803561193881611908565b919050565b6000806000806000806080878903121561195657600080fd5b86359550602087013567ffffffffffffffff8082111561197557600080fd5b6119818a838b016118bf565b90975095506040890135915061199682611908565b909350606088013590808211156119ac57600080fd5b506119b989828a016118bf565b979a9699509497509295939492505050565b803561ffff8116811461193857600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60405160c0810167ffffffffffffffff81118282101715611a2f57611a2f6119dd565b60405290565b604051610140810167ffffffffffffffff81118282101715611a2f57611a2f6119dd565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff81118282101715611aa057611aa06119dd565b604052919050565b600067ffffffffffffffff821115611ac257611ac26119dd565b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01660200190565b600082601f830112611aff57600080fd5b8135611b12611b0d82611aa8565b611a59565b818152846020838601011115611b2757600080fd5b816020850160208301376000918101602001919091529392505050565b60008060008060008060c08789031215611b5d57600080fd5b611b66876119cb565b9550602087013560ff81168114611b7c57600080fd5b94506040870135611b8c81611908565b9350606087013592506080870135915060a087013567ffffffffffffffff811115611bb657600080fd5b611bc289828a01611aee565b9150509295509295509295565b60008060208385031215611be257600080fd5b823567ffffffffffffffff811115611bf957600080fd5b611c05858286016118bf565b90969095509350505050565b60008060008060008060c08789031215611c2a57600080fd5b611c33876119cb565b9550602087013567ffffffffffffffff80821115611c5057600080fd5b611c5c8a838b01611aee565b96506040890135955060608901359150611c7582611908565b9093506080880135925060a08801359080821115611c9257600080fd5b50611bc289828a01611aee565b60008060008060008060608789031215611cb857600080fd5b863567ffffffffffffffff80821115611cd057600080fd5b611cdc8a838b016118bf565b90985096506020890135915080821115611cf557600080fd5b611d018a838b016118bf565b909650945060408901359150808211156119ac57600080fd5b600060208284031215611d2c57600080fd5b813567ffffffffffffffff80821115611d4457600080fd5b9083019060c08286031215611d5857600080fd5b611d60611a0c565b8235611d6b81611908565b8152602083810135908201526040830135611d8581611908565b6040820152606083810135908201526080830135611da281611908565b608082015260a083013582811115611db957600080fd5b611dc587828601611aee565b60a08301525095945050505050565b60005b83811015611def578181015183820152602001611dd7565b838111156113bf5750506000910152565b60008151808452611e18816020860160208601611dd4565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b600073ffffffffffffffffffffffffffffffffffffffff8089168352876020840152808716604084015285606084015280851660808401525060c060a0830152611e9760c0830184611e00565b98975050505050505050565b600060208284031215611eb557600080fd5b5051919050565b600060208284031215611ece57600080fd5b813567ffffffffffffffff80821115611ee657600080fd5b9083019060608286031215611efa57600080fd5b604051606081018181108382111715611f1557611f156119dd565b6040528235611f2381611908565b815260208381013590820152604083013582811115611f4157600080fd5b611f4d87828601611aee565b60408301525095945050505050565b602081526000611f6f6020830184611e00565b9392505050565b805182526020810151602083015260006040820151606060408501526116c26060850182611e00565b61ffff8616815260ff8516602082015260a060408201526000611fc560a0830186611e00565b8281036060840152611fd78186611e00565b90508281036080840152611e978185611f76565b60008060408385031215611ffe57600080fd5b505080516020909101519092909150565b600082601f83011261202057600080fd5b815161202e611b0d82611aa8565b81815284602083860101111561204357600080fd5b6116c2826020830160208701611dd4565b60008060006060848603121561206957600080fd5b835161207481611908565b602085015190935067ffffffffffffffff8082111561209257600080fd5b61209e8783880161200f565b935060408601519150808211156120b457600080fd5b506120c18682870161200f565b9150509250925092565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60008282101561210c5761210c6120cb565b500390565b84815260806020820152600061212a6080830186611e00565b73ffffffffffffffffffffffffffffffffffffffff8516604084015282810360608401526117d88185611e00565b6000610140828403121561216b57600080fd5b612173611a35565b61217c836119cb565b815261218a6020840161192d565b602082015260408301356040820152606083013560608201526080830135608082015260a083013560a082015260c083013560c08201526121cd60e0840161192d565b60e08201526101006121e081850161192d565b90820152610120928301359281019290925250919050565b8183528181602085013750600060208284010152600060207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116840101905092915050565b73ffffffffffffffffffffffffffffffffffffffff861681526060602082015260006122716060830186886121f8565b8281036040840152611e978185876121f8565b600061012061ffff8c1683528a602084015289604084015273ffffffffffffffffffffffffffffffffffffffff891660608401528760808401528660a08401528060c08401526122d681840187611f76565b905082810360e08401526122ea8186611e00565b90508281036101008401526122ff8185611e00565b9c9b505050505050505050505050565b60008219821115612322576123226120cb565b500190565b60006020828403121561233957600080fd5b81518015158114611f6f57600080fd5b6000825161235b818460208701611dd4565b919091019291505056fea264697066735822122080476ab429c1dabb4210e807a79dd8e0752536fbadfb04c81945cd98fb47a7f864736f6c634300080a00330000000000000000000000008731d54e9d02c286767d56ac03e8037c07e01e9800000000000000000000000076d4d68966728894961aa3ddc1d5b0e45668a5a600000000000000000000000072e2f4830b9e45d52f80ac08cb2bec0fef72ed9c000000000000000000000000827179dd56d07a7eea32e3873493835da2866976000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2
Deployed Bytecode
0x6080604052600436106100b55760003560e01c8063904c1e1f11610069578063a9e56f3c1161004e578063a9e56f3c14610220578063ab8236f314610254578063d09544f61461027457600080fd5b8063904c1e1f146101b8578063a761f5f0146101ec57600080fd5b80636ce4fe031161009a5780636ce4fe03146101345780636f435ac21461016957806382646a581461019d57600080fd5b80633fc8cef3146100c1578063693437a21461011f57600080fd5b366100bc57005b600080fd5b3480156100cd57600080fd5b506100f57f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc281565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b61013261012d36600461193d565b610287565b005b34801561014057600080fd5b5061015461014f366004611b44565b610572565b60408051928352602083019190915201610116565b34801561017557600080fd5b506100f57f00000000000000000000000076d4d68966728894961aa3ddc1d5b0e45668a5a681565b3480156101a957600080fd5b506101326100bc366004611bcf565b3480156101c457600080fd5b506100f57f000000000000000000000000827179dd56d07a7eea32e3873493835da286697681565b3480156101f857600080fd5b506100f57f00000000000000000000000072e2f4830b9e45d52f80ac08cb2bec0fef72ed9c81565b34801561022c57600080fd5b506100f57f0000000000000000000000008731d54e9d02c286767d56ac03e8037c07e01e9881565b34801561026057600080fd5b5061013261026f366004611c11565b6106f2565b610132610282366004611c9f565b610a27565b600061029585870187611d1a565b90507f00000000000000000000000072e2f4830b9e45d52f80ac08cb2bec0fef72ed9c73ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16141561036d577f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc273ffffffffffffffffffffffffffffffffffffffff1663d0e30db0886040518263ffffffff1660e01b81526004016000604051808303818588803b15801561035357600080fd5b505af1158015610367573d6000803e3d6000fd5b50505050505b80516103b09073ffffffffffffffffffffffffffffffffffffffff167f000000000000000000000000827179dd56d07a7eea32e3873493835da286697689611243565b805173ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000827179dd56d07a7eea32e3873493835da28669761690632646478b90896103ff578360200151610401565b895b6040808601516060870151608088015160a089015193517fffffffff0000000000000000000000000000000000000000000000000000000060e089901b16815261045096959490600401611e4a565b6020604051808303816000875af115801561046f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104939190611ea3565b5081156105695760006104a883850185611ebc565b805160408083015190517fa6ac3db600000000000000000000000000000000000000000000000000000000815292935073ffffffffffffffffffffffffffffffffffffffff9091169163a6ac3db69161050391600401611f5c565b600060405180830381600087803b15801561051d57600080fd5b505af192505050801561052e575060015b610567573d80801561055c576040519150601f19603f3d011682016040523d82523d6000602084013e610561565b606091505b50600080fd5b505b50505050505050565b6000807f0000000000000000000000008731d54e9d02c286767d56ac03e8037c07e01e9873ffffffffffffffffffffffffffffffffffffffff16630a5123698989896040516020016105ef919060609190911b7fffffffffffffffffffffffffffffffffffffffff00000000000000000000000016815260140190565b6040516020818303038152906040528760405160200161060f9190611f5c565b60405160208183030381529060405260405180606001604052808c81526020018b81526020018d604051602001610671919060609190911b7fffffffffffffffffffffffffffffffffffffffff00000000000000000000000016815260140190565b6040516020818303038152906040528152506040518663ffffffff1660e01b81526004016106a3959493929190611f9f565b6040805180830381865afa1580156106bf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106e39190611feb565b90999098509650505050505050565b3373ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000008731d54e9d02c286767d56ac03e8037c07e01e981614610761576040517f8c66bf5600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008060008380602001905181019061077a9190612054565b91945092509050620186a06000815a108061079457508351155b1561087d577f00000000000000000000000072e2f4830b9e45d52f80ac08cb2bec0fef72ed9c73ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff161461080d5761080d73ffffffffffffffffffffffffffffffffffffffff891686896113c5565b47156108725760405173ffffffffffffffffffffffffffffffffffffffff8616904790600081818185875af1925050503d8060008114610869576040519150601f19603f3d011682016040523d82523d6000602084013e61086e565b606091505b5050505b50610a1f9350505050565b6000825a61088b91906120fa565b8551909150156109b3576040517f693437a2000000000000000000000000000000000000000000000000000000008152309063693437a29083906108d9908c908a908f908b90600401612111565b600060405180830381600088803b1580156108f357600080fd5b5087f193505050508015610905575060015b6109b3573d808015610933576040519150601f19603f3d011682016040523d82523d6000602084013e610938565b606091505b507f00000000000000000000000072e2f4830b9e45d52f80ac08cb2bec0fef72ed9c73ffffffffffffffffffffffffffffffffffffffff168a73ffffffffffffffffffffffffffffffffffffffff16146109ad576109ad73ffffffffffffffffffffffffffffffffffffffff8b16888b6113c5565b60019250505b4715610a185760405173ffffffffffffffffffffffffffffffffffffffff8716904790600081818185875af1925050503d8060008114610a0f576040519150601f19603f3d011682016040523d82523d6000602084013e610a14565b606091505b5050505b5050505050505b505050505050565b6000610a3586880188612158565b602081015190915073ffffffffffffffffffffffffffffffffffffffff1673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee1415610b70576080810151610aa9576040517fc260024f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7f00000000000000000000000072e2f4830b9e45d52f80ac08cb2bec0fef72ed9c73ffffffffffffffffffffffffffffffffffffffff1663d0e30db082608001516040518263ffffffff1660e01b81526004016000604051808303818588803b158015610b1557600080fd5b505af1158015610b29573d6000803e3d6000fd5b50505073ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000072e2f4830b9e45d52f80ac08cb2bec0fef72ed9c16602084015250610ded9050565b7f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc273ffffffffffffffffffffffffffffffffffffffff16816020015173ffffffffffffffffffffffffffffffffffffffff161415610ded576080810151610c85576040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201527f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc273ffffffffffffffffffffffffffffffffffffffff16906370a0823190602401602060405180830381865afa158015610c5b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c7f9190611ea3565b60808201525b60808101516040517f2e1a7d4d00000000000000000000000000000000000000000000000000000000815260048101919091527f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc273ffffffffffffffffffffffffffffffffffffffff1690632e1a7d4d90602401600060405180830381600087803b158015610d1357600080fd5b505af1158015610d27573d6000803e3d6000fd5b505050507f00000000000000000000000072e2f4830b9e45d52f80ac08cb2bec0fef72ed9c73ffffffffffffffffffffffffffffffffffffffff1663d0e30db082608001516040518263ffffffff1660e01b81526004016000604051808303818588803b158015610d9757600080fd5b505af1158015610dab573d6000803e3d6000fd5b50505073ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000072e2f4830b9e45d52f80ac08cb2bec0fef72ed9c16602084015250505b610edf7f0000000000000000000000008731d54e9d02c286767d56ac03e8037c07e01e98826080015160001415610eb75760208301516040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff909116906370a0823190602401602060405180830381865afa158015610e8e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610eb29190611ea3565b610ebd565b82608001515b602084015173ffffffffffffffffffffffffffffffffffffffff169190611420565b60408051602081019091526000815284151580610efb57508215155b15610f7257620186a08261012001511015610f42576040517f1c26714c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b81610100015186868686604051602001610f60959493929190612241565b60405160208183030381529060405290505b7f0000000000000000000000008731d54e9d02c286767d56ac03e8037c07e01e9873ffffffffffffffffffffffffffffffffffffffff16639fbf10fc47846000015185604001518660600151328860800151600014156110655760208901516040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff909116906370a0823190602401602060405180830381865afa15801561103c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110609190611ea3565b61106b565b88608001515b8960a0015160405180606001604052808c610120015181526020018c60c0015181526020018c60e001516040516020016110d0919060609190911b7fffffffffffffffffffffffffffffffffffffffff00000000000000000000000016815260140190565b6040516020818303038152906040528152508b60e00151604051602001611122919060609190911b7fffffffffffffffffffffffffffffffffffffffff00000000000000000000000016815260140190565b6040516020818303038152906040528b6040518b63ffffffff1660e01b815260040161115699989796959493929190612284565b6000604051808303818588803b15801561116f57600080fd5b505af1158015611183573d6000803e3d6000fd5b50506040517fa87376e90000000000000000000000000000000000000000000000000000000081527e0100000000000000000000000000000000000000000000000000000000000060048201527f00000000000000000000000076d4d68966728894961aa3ddc1d5b0e45668a5a673ffffffffffffffffffffffffffffffffffffffff16935063a87376e992506024019050600060405180830381600087803b15801561122f57600080fd5b505af1158015610a18573d6000803e3d6000fd5b6040517fdd62ed3e00000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff8381166024830152600091839186169063dd62ed3e90604401602060405180830381865afa1580156112ba573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112de9190611ea3565b6112e8919061230f565b60405173ffffffffffffffffffffffffffffffffffffffff85166024820152604481018290529091506113bf9085907f095ea7b300000000000000000000000000000000000000000000000000000000906064015b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff00000000000000000000000000000000000000000000000000000000909316929092179091526115a7565b50505050565b60405173ffffffffffffffffffffffffffffffffffffffff831660248201526044810182905261141b9084907fa9059cbb000000000000000000000000000000000000000000000000000000009060640161133d565b505050565b8015806114c057506040517fdd62ed3e00000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff838116602483015284169063dd62ed3e90604401602060405180830381865afa15801561149a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114be9190611ea3565b155b611551576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527f20746f206e6f6e2d7a65726f20616c6c6f77616e63650000000000000000000060648201526084015b60405180910390fd5b60405173ffffffffffffffffffffffffffffffffffffffff831660248201526044810182905261141b9084907f095ea7b3000000000000000000000000000000000000000000000000000000009060640161133d565b6000611609826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff166116b39092919063ffffffff16565b80519091501561141b57808060200190518101906116279190612327565b61141b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152608401611548565b60606116c284846000856116ca565b949350505050565b60608247101561175c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c00000000000000000000000000000000000000000000000000006064820152608401611548565b6000808673ffffffffffffffffffffffffffffffffffffffff1685876040516117859190612349565b60006040518083038185875af1925050503d80600081146117c2576040519150601f19603f3d011682016040523d82523d6000602084013e6117c7565b606091505b50915091506117d8878383876117e3565b979650505050505050565b6060831561187657825161186f5773ffffffffffffffffffffffffffffffffffffffff85163b61186f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401611548565b50816116c2565b6116c2838381511561188b5781518083602001fd5b806040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115489190611f5c565b60008083601f8401126118d157600080fd5b50813567ffffffffffffffff8111156118e957600080fd5b60208301915083602082850101111561190157600080fd5b9250929050565b73ffffffffffffffffffffffffffffffffffffffff8116811461192a57600080fd5b50565b803561193881611908565b919050565b6000806000806000806080878903121561195657600080fd5b86359550602087013567ffffffffffffffff8082111561197557600080fd5b6119818a838b016118bf565b90975095506040890135915061199682611908565b909350606088013590808211156119ac57600080fd5b506119b989828a016118bf565b979a9699509497509295939492505050565b803561ffff8116811461193857600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60405160c0810167ffffffffffffffff81118282101715611a2f57611a2f6119dd565b60405290565b604051610140810167ffffffffffffffff81118282101715611a2f57611a2f6119dd565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff81118282101715611aa057611aa06119dd565b604052919050565b600067ffffffffffffffff821115611ac257611ac26119dd565b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01660200190565b600082601f830112611aff57600080fd5b8135611b12611b0d82611aa8565b611a59565b818152846020838601011115611b2757600080fd5b816020850160208301376000918101602001919091529392505050565b60008060008060008060c08789031215611b5d57600080fd5b611b66876119cb565b9550602087013560ff81168114611b7c57600080fd5b94506040870135611b8c81611908565b9350606087013592506080870135915060a087013567ffffffffffffffff811115611bb657600080fd5b611bc289828a01611aee565b9150509295509295509295565b60008060208385031215611be257600080fd5b823567ffffffffffffffff811115611bf957600080fd5b611c05858286016118bf565b90969095509350505050565b60008060008060008060c08789031215611c2a57600080fd5b611c33876119cb565b9550602087013567ffffffffffffffff80821115611c5057600080fd5b611c5c8a838b01611aee565b96506040890135955060608901359150611c7582611908565b9093506080880135925060a08801359080821115611c9257600080fd5b50611bc289828a01611aee565b60008060008060008060608789031215611cb857600080fd5b863567ffffffffffffffff80821115611cd057600080fd5b611cdc8a838b016118bf565b90985096506020890135915080821115611cf557600080fd5b611d018a838b016118bf565b909650945060408901359150808211156119ac57600080fd5b600060208284031215611d2c57600080fd5b813567ffffffffffffffff80821115611d4457600080fd5b9083019060c08286031215611d5857600080fd5b611d60611a0c565b8235611d6b81611908565b8152602083810135908201526040830135611d8581611908565b6040820152606083810135908201526080830135611da281611908565b608082015260a083013582811115611db957600080fd5b611dc587828601611aee565b60a08301525095945050505050565b60005b83811015611def578181015183820152602001611dd7565b838111156113bf5750506000910152565b60008151808452611e18816020860160208601611dd4565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b600073ffffffffffffffffffffffffffffffffffffffff8089168352876020840152808716604084015285606084015280851660808401525060c060a0830152611e9760c0830184611e00565b98975050505050505050565b600060208284031215611eb557600080fd5b5051919050565b600060208284031215611ece57600080fd5b813567ffffffffffffffff80821115611ee657600080fd5b9083019060608286031215611efa57600080fd5b604051606081018181108382111715611f1557611f156119dd565b6040528235611f2381611908565b815260208381013590820152604083013582811115611f4157600080fd5b611f4d87828601611aee565b60408301525095945050505050565b602081526000611f6f6020830184611e00565b9392505050565b805182526020810151602083015260006040820151606060408501526116c26060850182611e00565b61ffff8616815260ff8516602082015260a060408201526000611fc560a0830186611e00565b8281036060840152611fd78186611e00565b90508281036080840152611e978185611f76565b60008060408385031215611ffe57600080fd5b505080516020909101519092909150565b600082601f83011261202057600080fd5b815161202e611b0d82611aa8565b81815284602083860101111561204357600080fd5b6116c2826020830160208701611dd4565b60008060006060848603121561206957600080fd5b835161207481611908565b602085015190935067ffffffffffffffff8082111561209257600080fd5b61209e8783880161200f565b935060408601519150808211156120b457600080fd5b506120c18682870161200f565b9150509250925092565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60008282101561210c5761210c6120cb565b500390565b84815260806020820152600061212a6080830186611e00565b73ffffffffffffffffffffffffffffffffffffffff8516604084015282810360608401526117d88185611e00565b6000610140828403121561216b57600080fd5b612173611a35565b61217c836119cb565b815261218a6020840161192d565b602082015260408301356040820152606083013560608201526080830135608082015260a083013560a082015260c083013560c08201526121cd60e0840161192d565b60e08201526101006121e081850161192d565b90820152610120928301359281019290925250919050565b8183528181602085013750600060208284010152600060207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116840101905092915050565b73ffffffffffffffffffffffffffffffffffffffff861681526060602082015260006122716060830186886121f8565b8281036040840152611e978185876121f8565b600061012061ffff8c1683528a602084015289604084015273ffffffffffffffffffffffffffffffffffffffff891660608401528760808401528660a08401528060c08401526122d681840187611f76565b905082810360e08401526122ea8186611e00565b90508281036101008401526122ff8185611e00565b9c9b505050505050505050505050565b60008219821115612322576123226120cb565b500190565b60006020828403121561233957600080fd5b81518015158114611f6f57600080fd5b6000825161235b818460208701611dd4565b919091019291505056fea264697066735822122080476ab429c1dabb4210e807a79dd8e0752536fbadfb04c81945cd98fb47a7f864736f6c634300080a0033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000008731d54e9d02c286767d56ac03e8037c07e01e9800000000000000000000000076d4d68966728894961aa3ddc1d5b0e45668a5a600000000000000000000000072e2f4830b9e45d52f80ac08cb2bec0fef72ed9c000000000000000000000000827179dd56d07a7eea32e3873493835da2866976000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2
-----Decoded View---------------
Arg [0] : _stargateRouter (address): 0x8731d54E9D02c286767d56ac03e8037C07e01e98
Arg [1] : _stargateWidget (address): 0x76d4d68966728894961AA3DDC1d5B0e45668a5A6
Arg [2] : _sgeth (address): 0x72E2F4830b9E45d52F80aC08CB2bEC0FeF72eD9c
Arg [3] : _rp (address): 0x827179dD56d07A7eeA32e3873493835da2866976
Arg [4] : _weth (address): 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2
-----Encoded View---------------
5 Constructor Arguments found :
Arg [0] : 0000000000000000000000008731d54e9d02c286767d56ac03e8037c07e01e98
Arg [1] : 00000000000000000000000076d4d68966728894961aa3ddc1d5b0e45668a5a6
Arg [2] : 00000000000000000000000072e2f4830b9e45d52f80ac08cb2bec0fef72ed9c
Arg [3] : 000000000000000000000000827179dd56d07a7eea32e3873493835da2866976
Arg [4] : 000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2
Loading...
Loading
Loading...
Loading
Net Worth in USD
$92.43
Net Worth in ETH
0.045917
Token Allocations
USDC.E
100.00%
Multichain Portfolio | 33 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|---|---|---|---|---|
| ARB | 100.00% | $0.999781 | 92.4507 | $92.43 |
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.