Source Code
Overview
S Balance
S Value
$0.00| Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
|---|---|---|---|---|---|---|---|---|---|
Latest 1 internal transaction
Advanced mode:
| Parent Transaction Hash | Block | From | To | |||
|---|---|---|---|---|---|---|
| 45374253 | 68 days ago | Contract Creation | 0 S |
Cross-Chain Transactions
Loading...
Loading
Similar Match Source Code This contract matches the deployed Bytecode of the Source Code for Contract 0x77cC6AF1...f98c8a36B The constructor portion of the code might be different and could alter the actual behaviour of the contract
Contract Name:
HybridCurveShadowExchange
Compiler Version
v0.8.24+commit.e11b9ed9
Optimization Enabled:
Yes with 200 runs
Other Settings:
cancun EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;
import "openzeppelin-contracts/contracts/token/ERC20/utils/SafeERC20.sol";
import "../../../Interfaces/IWETH.sol";
import "../../LeftoversSweep.sol";
// Curve
import "../Exchanges/Curve/ICurveStableswapNGPool.sol";
// UniV3
import "../Exchanges/UniswapV3/ISwapRouter.sol";
import "../../Interfaces/IExchange.sol";
import "src/Sonata/ERC20StandardizedWrapper.sol";
// @dev: Main difference: Shadow uses tickspace instead of fee for pathing
contract HybridCurveShadowExchange is LeftoversSweep, IExchange {
using SafeERC20 for IERC20;
using SafeERC20 for ERC20StandardizedWrapper;
// branches
IERC20 public immutable collToken;
IOneToken public immutable oneToken;
ERC20StandardizedWrapper private immutable STANDARDIZED_WRAPPER;
IERC20 public immutable USDC;
IWETH public immutable WETH;
// Curve
ICurveStableswapNGPool public immutable curvePool;
uint128 public immutable USDC_INDEX;
uint128 public immutable ONE_TOKEN_INDEX;
// Uniswap
ISwapRouter public immutable uniV3Router;
bytes public COLLATERAL_TO_USDC_PATH;
bytes public USDC_TO_COLLATERAL_PATH;
constructor(
IERC20 _collToken,
IOneToken _oneToken,
IERC20 _usdc,
IWETH _weth,
// Curve
ICurveStableswapNGPool _curvePool,
uint128 _usdcIndex,
uint128 _oneIndex,
// UniV3
ISwapRouter _uniV3Router,
bytes memory _collateralToOnePath,
bytes memory _USDCToCollateralPath
) LeftoversSweep(_usdc) {
collToken = _collToken;
oneToken = _oneToken;
USDC = _usdc;
WETH = _weth;
// Curve
curvePool = _curvePool;
USDC_INDEX = _usdcIndex;
ONE_TOKEN_INDEX = _oneIndex;
// Uniswap
uniV3Router = _uniV3Router;
COLLATERAL_TO_USDC_PATH = _collateralToOnePath;
USDC_TO_COLLATERAL_PATH = _USDCToCollateralPath;
try ERC20StandardizedWrapper(address(collToken)).isStandardized() returns (bool) {
STANDARDIZED_WRAPPER = ERC20StandardizedWrapper(address(collToken));
collToken = STANDARDIZED_WRAPPER.INPUT_TOKEN();
} catch { }
}
// One -> USDC on Curve; then USDC -> WETH, and optionally WETH -> Coll, on UniV3
function swapFromOne(uint256 _oneAmount, uint256 _minCollAmount) external {
InitialBalances memory initialBalances;
_setHybridExchangeInitialBalances(initialBalances);
if (address(STANDARDIZED_WRAPPER) != address(0)) {
_minCollAmount = STANDARDIZED_WRAPPER.etherToTokenDecimals(_minCollAmount);
}
// Curve
oneToken.transferFrom(msg.sender, address(this), _oneAmount);
oneToken.approve(address(curvePool), _oneAmount);
uint256 curveUsdcAmount =
curvePool.exchange(int128(ONE_TOKEN_INDEX), int128(USDC_INDEX), _oneAmount, 0);
// Uniswap
USDC.approve(address(uniV3Router), curveUsdcAmount);
ISwapRouter.ExactInputParams memory params = ISwapRouter.ExactInputParams({
path: USDC_TO_COLLATERAL_PATH,
recipient: msg.sender,
deadline: block.timestamp,
amountIn: curveUsdcAmount,
amountOutMinimum: _minCollAmount
});
// Executes the swap.
uniV3Router.exactInput(params);
// return leftovers to user
_returnLeftovers(initialBalances);
}
// Optionally Coll -> WETH, and WETH -> USDC on UniV3; then USDC -> One on Curve
function swapToOne(uint256 _collAmount, uint256 _minOneAmount)
external
returns (uint256)
{
InitialBalances memory initialBalances;
_setHybridExchangeInitialBalances(initialBalances);
if (address(STANDARDIZED_WRAPPER) != address(0)) {
STANDARDIZED_WRAPPER.safeTransferFrom(msg.sender, address(this), _collAmount);
_collAmount = STANDARDIZED_WRAPPER.unwrap(_collAmount);
} else {
collToken.safeTransferFrom(msg.sender, address(this), _collAmount);
}
// Uniswap
collToken.approve(address(uniV3Router), 0);
collToken.approve(address(uniV3Router), _collAmount);
ISwapRouter.ExactInputParams memory params = ISwapRouter.ExactInputParams({
path: COLLATERAL_TO_USDC_PATH,
recipient: address(this),
deadline: block.timestamp,
amountIn: _collAmount,
amountOutMinimum: 0
});
// Executes the swap.
uint256 uniV3UsdcAmount = uniV3Router.exactInput(params);
// Curve
USDC.approve(address(curvePool), uniV3UsdcAmount);
uint256 oneAmount = curvePool.exchange(
int128(USDC_INDEX), int128(ONE_TOKEN_INDEX), uniV3UsdcAmount, _minOneAmount
);
oneToken.transfer(msg.sender, oneAmount);
// return leftovers to user
_returnLeftovers(initialBalances);
return oneAmount;
}
function _setHybridExchangeInitialBalances(InitialBalances memory initialBalances)
internal
view
{
initialBalances.tokens[0] = oneToken;
initialBalances.tokens[1] = USDC;
initialBalances.tokens[2] = WETH;
if (address(WETH) != address(collToken)) {
initialBalances.tokens[3] = collToken;
}
_setInitialBalances(initialBalances);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.3) (token/ERC20/utils/SafeERC20.sol)
pragma solidity ^0.8.0;
import "../IERC20.sol";
import "../extensions/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;
/**
* @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.encodeWithSelector(token.transfer.selector, 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.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));
}
/**
* @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
* non-reverting calls are assumed to be successful.
*/
function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
uint256 oldAllowance = token.allowance(address(this), spender);
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance + value));
}
/**
* @dev Decrease the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
* non-reverting calls are assumed to be successful.
*/
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");
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance - value));
}
}
/**
* @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,
* non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval
* to be set to zero before setting it to a non-zero value, such as USDT.
*/
function forceApprove(IERC20 token, address spender, uint256 value) internal {
bytes memory approvalCall = abi.encodeWithSelector(token.approve.selector, spender, value);
if (!_callOptionalReturnBool(token, approvalCall)) {
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, 0));
_callOptionalReturn(token, approvalCall);
}
}
/**
* @dev Use a ERC-2612 signature to set the `owner` approval toward `spender` on `token`.
* Revert on invalid signature.
*/
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");
require(returndata.length == 0 || abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation 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).
*
* This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.
*/
function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {
// We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
// we're implementing it ourselves. We cannot use {Address-functionCall} here since this should return false
// and not revert is the subcall reverts.
(bool success, bytes memory returndata) = address(token).call(data);
return
success && (returndata.length == 0 || abi.decode(returndata, (bool))) && Address.isContract(address(token));
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "openzeppelin-contracts/contracts/token/ERC20/extensions/IERC20Metadata.sol";
interface IWETH is IERC20Metadata {
function deposit() external payable;
function withdraw(uint256 wad) external;
}// SPDX-License-Identifier: MIT
pragma solidity 0.8.24;
import "openzeppelin-contracts/contracts/token/ERC20/IERC20.sol";
import "openzeppelin-contracts/contracts/token/ERC20/utils/SafeERC20.sol";
import { ERC20StandardizedWrapper } from "../Sonata/ERC20StandardizedWrapper.sol";
import "../Interfaces/IOneToken.sol";
contract LeftoversSweep {
using SafeERC20 for IERC20;
IERC20 private immutable USDC;
constructor(IERC20 _usdc) {
USDC = _usdc;
}
struct InitialBalances {
IERC20[4] tokens; // paving the way for completely dynamic routes
uint256[4] balances;
bool[4] isStandardized;
address receiver;
}
function _setInitialTokensAndBalances(
IERC20 _collToken,
IOneToken _oneToken,
InitialBalances memory _initialBalances
) internal view {
_setInitialTokensBalancesAndReceiver(
_collToken, _oneToken, _initialBalances, msg.sender
);
}
function _setInitialTokensBalancesAndReceiver(
IERC20 _collToken,
IOneToken _oneToken,
InitialBalances memory _initialBalances,
address _receiver
) internal view virtual {
_initialBalances.tokens[0] = _collToken;
_initialBalances.tokens[1] = _oneToken;
_initialBalances.tokens[2] = USDC;
_setInitialBalancesAndReceiver(_initialBalances, _receiver);
}
function _setInitialBalances(InitialBalances memory _initialBalances) internal view {
_setInitialBalancesAndReceiver(_initialBalances, msg.sender);
}
function _setInitialBalancesAndReceiver(
InitialBalances memory _initialBalances,
address _receiver
) internal view {
for (uint256 i = 0; i < _initialBalances.tokens.length; i++) {
if (address(_initialBalances.tokens[i]) == address(0)) break;
_initialBalances.balances[i] = _initialBalances.tokens[i].balanceOf(address(this));
}
_initialBalances.receiver = _receiver;
}
function _returnLeftovers(InitialBalances memory _initialBalances) internal {
IERC20 token;
for (uint256 i = 0; i < _initialBalances.tokens.length; i++) {
token = _initialBalances.tokens[i];
if (address(token) == address(0)) break;
uint256 currentBalance = token.balanceOf(address(this));
if (currentBalance <= _initialBalances.balances[i]) continue;
if (_initialBalances.isStandardized[i]) {
ERC20StandardizedWrapper(address(token)).unwrapTo(
_initialBalances.receiver, currentBalance - _initialBalances.balances[i]
);
} else {
token.safeTransfer(
_initialBalances.receiver, currentBalance - _initialBalances.balances[i]
);
}
}
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
interface ICurveStableswapNGPool {
function add_liquidity(uint256[] memory amounts, uint256 min_mint_amount)
external
returns (uint256);
function exchange(int128 i, int128 j, uint256 dx, uint256 min_dy)
external
returns (uint256 output);
function get_dx(int128 i, int128 j, uint256 dy) external view returns (uint256 dx);
function get_dy(int128 i, int128 j, uint256 dx) external view returns (uint256 dy);
}// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.7.5;
pragma abicoder v2;
/// @title Router token swapping functionality
/// @notice Functions for swapping tokens via Uniswap V3
interface ISwapRouter {
struct ExactInputSingleParams {
address tokenIn;
address tokenOut;
uint24 fee;
address recipient;
uint256 deadline;
uint256 amountIn;
uint256 amountOutMinimum;
uint160 sqrtPriceLimitX96;
}
/// @notice Swaps `amountIn` of one token for as much as possible of another token
/// @param params The parameters necessary for the swap, encoded as
/// `ExactInputSingleParams` in calldata
/// @return amountOut The amount of the received token
function exactInputSingle(ExactInputSingleParams calldata params)
external
payable
returns (uint256 amountOut);
struct ExactInputParams {
bytes path;
address recipient;
uint256 deadline;
uint256 amountIn;
uint256 amountOutMinimum;
}
/// @notice Swaps `amountIn` of one token for as much as possible of another along the
/// specified path
/// @param params The parameters necessary for the multi-hop swap, encoded as
/// `ExactInputParams` in calldata
/// @return amountOut The amount of the received token
function exactInput(ExactInputParams calldata params)
external
payable
returns (uint256 amountOut);
struct ExactOutputSingleParams {
address tokenIn;
address tokenOut;
uint24 fee;
address recipient;
uint256 deadline;
uint256 amountOut;
uint256 amountInMaximum;
uint160 sqrtPriceLimitX96;
}
/// @notice Swaps as little as possible of one token for `amountOut` of another token
/// @param params The parameters necessary for the swap, encoded as
/// `ExactOutputSingleParams` in calldata
/// @return amountIn The amount of the input token
function exactOutputSingle(ExactOutputSingleParams calldata params)
external
payable
returns (uint256 amountIn);
struct ExactOutputParams {
bytes path;
address recipient;
uint256 deadline;
uint256 amountOut;
uint256 amountInMaximum;
}
/// @notice Swaps as little as possible of one token for `amountOut` of another along
/// the specified path (reversed)
/// @param params The parameters necessary for the multi-hop swap, encoded as
/// `ExactOutputParams` in calldata
/// @return amountIn The amount of the input token
function exactOutput(ExactOutputParams calldata params)
external
payable
returns (uint256 amountIn);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
interface IExchange {
function swapFromOne(uint256 _oneAmount, uint256 _minCollAmount) external;
function swapToOne(uint256 _collAmount, uint256 _minOneAmount)
external
returns (uint256);
}// SPDX-License-Identifier: MIT
pragma solidity 0.8.24;
import { ERC20 } from "openzeppelin-contracts/contracts/token/ERC20/ERC20.sol";
import {
SafeERC20,
IERC20
} from "openzeppelin-contracts/contracts/token/ERC20/utils/SafeERC20.sol";
contract ERC20StandardizedWrapper is ERC20 {
using SafeERC20 for IERC20;
IERC20 public immutable INPUT_TOKEN;
uint256 public immutable DECIMALS_SCALE;
constructor(address _inputToken)
ERC20(
string.concat("Sonata Standardized ", ERC20(_inputToken).name()),
string.concat("WSTA-", ERC20(_inputToken).symbol())
)
{
INPUT_TOKEN = IERC20(_inputToken);
uint8 inputTokenDecimals = ERC20(_inputToken).decimals();
require(
inputTokenDecimals < 18,
"ERC20StandardizedWrapper: Input token decimals must be less than 18"
);
DECIMALS_SCALE = 10 ** (18 - inputTokenDecimals);
}
// @dev We use ether format to keep a standard on the implementation.
function wrap(uint256 _etherAmount) external returns (uint256 received_) {
uint256 scaleToTokenInputDecimals = _etherAmount / DECIMALS_SCALE;
INPUT_TOKEN.safeTransferFrom(msg.sender, address(this), scaleToTokenInputDecimals);
received_ = scaleToTokenInputDecimals * DECIMALS_SCALE;
// @dev We scale it back, to avoid input manipulation.
_mint(msg.sender, received_);
return received_;
}
function unwrap(uint256 _etherAmount) external returns (uint256) {
return _unwrap(msg.sender, _etherAmount);
}
function unwrapTo(address _receiver, uint256 _etherAmount) external returns (uint256) {
return _unwrap(_receiver, _etherAmount);
}
function _unwrap(address _receiver, uint256 _etherAmount)
internal
returns (uint256 received_)
{
_burn(msg.sender, _etherAmount / DECIMALS_SCALE * DECIMALS_SCALE);
received_ = _etherAmount / DECIMALS_SCALE;
INPUT_TOKEN.safeTransfer(_receiver, received_);
return received_;
}
function etherToTokenDecimals(uint256 _etherAmount) external view returns (uint256) {
return _etherAmount / DECIMALS_SCALE;
}
function removeDustOnAmount(uint256 _wad) external view returns (uint256) {
return _wad / DECIMALS_SCALE * DECIMALS_SCALE;
}
function tokenDecimalsToEther(uint256 _tokenDecimals) external view returns (uint256) {
return _tokenDecimals * DECIMALS_SCALE;
}
function isStandardized() external pure returns (bool) {
return true;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.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 (last updated v4.9.4) (token/ERC20/extensions/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.
*
* ==== Security Considerations
*
* There are two important considerations concerning the use of `permit`. The first is that a valid permit signature
* expresses an allowance, and it should not be assumed to convey additional meaning. In particular, it should not be
* considered as an intention to spend the allowance in any specific way. The second is that because permits have
* built-in replay protection and can be submitted by anyone, they can be frontrun. A protocol that uses permits should
* take this into consideration and allow a `permit` call to fail. Combining these two aspects, a pattern that may be
* generally recommended is:
*
* ```solidity
* function doThingWithPermit(..., uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public {
* try token.permit(msg.sender, address(this), value, deadline, v, r, s) {} catch {}
* doThing(..., value);
* }
*
* function doThing(..., uint256 value) public {
* token.safeTransferFrom(msg.sender, address(this), value);
* ...
* }
* ```
*
* Observe that: 1) `msg.sender` is used as the owner, leaving no ambiguity as to the signer intent, and 2) the use of
* `try/catch` allows the permit to fail and makes the code tolerant to frontrunning. (See also
* {SafeERC20-safeTransferFrom}).
*
* Additionally, note that smart contract wallets (such as Argent or Safe) are not able to produce permit signatures, so
* contracts should have entry points that don't rely on permit.
*/
interface IERC20Permit {
/**
* @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,
* given ``owner``'s signed approval.
*
* IMPORTANT: The same issues {IERC20-approve} has related to transaction
* ordering also apply here.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `deadline` must be a timestamp in the future.
* - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`
* over the EIP712-formatted function arguments.
* - the signature must use ``owner``'s current nonce (see {nonces}).
*
* For more information on the signature format, see the
* https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP
* section].
*
* CAUTION: See Security Considerations above.
*/
function permit(
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) external;
/**
* @dev Returns the current nonce for `owner`. This value must be
* included whenever a signature is generated for {permit}.
*
* Every successful call to {permit} increases ``owner``'s nonce by one. This
* prevents a signature from being used multiple times.
*/
function nonces(address owner) external view returns (uint256);
/**
* @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.
*/
// solhint-disable-next-line func-name-mixedcase
function DOMAIN_SEPARATOR() external view returns (bytes32);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.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
*
* Furthermore, `isContract` will also return true if the target contract within
* the same transaction is already scheduled for destruction by `SELFDESTRUCT`,
* which only has an effect at the end of a transaction.
* ====
*
* [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://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.8.0/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: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)
pragma solidity ^0.8.0;
import "../IERC20.sol";
/**
* @dev Interface for the optional metadata functions from the ERC20 standard.
*
* _Available since v4.1._
*/
interface IERC20Metadata is IERC20 {
/**
* @dev Returns the name of the token.
*/
function name() external view returns (string memory);
/**
* @dev Returns the symbol of the token.
*/
function symbol() external view returns (string memory);
/**
* @dev Returns the decimals places of the token.
*/
function decimals() external view returns (uint8);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import { IERC20Metadata } from
"openzeppelin-contracts/contracts/token/ERC20/extensions/IERC20Metadata.sol";
import { IERC20Permit } from
"openzeppelin-contracts/contracts/token/ERC20/extensions/IERC20Permit.sol";
import { IERC5267 } from "openzeppelin-contracts/contracts/interfaces/IERC5267.sol";
interface IOneToken is IERC20Metadata, IERC20Permit, IERC5267 {
function setBranchAddresses(
address _troveManagerAddress,
address _stabilityPoolAddress,
address _borrowerOperationsAddress,
address _activePoolAddress
) external;
function setCollateralRegistry(address _collateralRegistryAddress) external;
function mint(address _account, uint256 _amount) external;
function burn(address _account, uint256 _amount) external;
function sendToPool(address _sender, address poolAddress, uint256 _amount) external;
function returnFromPool(address poolAddress, address user, uint256 _amount) external;
function setDebtCapPerBranch(address _borrowerOperationAddress, uint256 _capOneDebt)
external;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/ERC20.sol)
pragma solidity ^0.8.0;
import "./IERC20.sol";
import "./extensions/IERC20Metadata.sol";
import "../../utils/Context.sol";
/**
* @dev Implementation of the {IERC20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using {_mint}.
* For a generic mechanism see {ERC20PresetMinterPauser}.
*
* TIP: For a detailed writeup see our guide
* https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How
* to implement supply mechanisms].
*
* The default value of {decimals} is 18. To change this, you should override
* this function so it returns a different value.
*
* We have followed general OpenZeppelin Contracts guidelines: functions revert
* instead returning `false` on failure. This behavior is nonetheless
* conventional and does not conflict with the expectations of ERC20
* applications.
*
* Additionally, an {Approval} event is emitted on calls to {transferFrom}.
* This allows applications to reconstruct the allowance for all accounts just
* by listening to said events. Other implementations of the EIP may not emit
* these events, as it isn't required by the specification.
*
* Finally, the non-standard {decreaseAllowance} and {increaseAllowance}
* functions have been added to mitigate the well-known issues around setting
* allowances. See {IERC20-approve}.
*/
contract ERC20 is Context, IERC20, IERC20Metadata {
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
/**
* @dev Sets the values for {name} and {symbol}.
*
* All two of these values are immutable: they can only be set once during
* construction.
*/
constructor(string memory name_, string memory symbol_) {
_name = name_;
_symbol = symbol_;
}
/**
* @dev Returns the name of the token.
*/
function name() public view virtual override returns (string memory) {
return _name;
}
/**
* @dev Returns the symbol of the token, usually a shorter version of the
* name.
*/
function symbol() public view virtual override returns (string memory) {
return _symbol;
}
/**
* @dev Returns the number of decimals used to get its user representation.
* For example, if `decimals` equals `2`, a balance of `505` tokens should
* be displayed to a user as `5.05` (`505 / 10 ** 2`).
*
* Tokens usually opt for a value of 18, imitating the relationship between
* Ether and Wei. This is the default value returned by this function, unless
* it's overridden.
*
* NOTE: This information is only used for _display_ purposes: it in
* no way affects any of the arithmetic of the contract, including
* {IERC20-balanceOf} and {IERC20-transfer}.
*/
function decimals() public view virtual override returns (uint8) {
return 18;
}
/**
* @dev See {IERC20-totalSupply}.
*/
function totalSupply() public view virtual override returns (uint256) {
return _totalSupply;
}
/**
* @dev See {IERC20-balanceOf}.
*/
function balanceOf(address account) public view virtual override returns (uint256) {
return _balances[account];
}
/**
* @dev See {IERC20-transfer}.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - the caller must have a balance of at least `amount`.
*/
function transfer(address to, uint256 amount) public virtual override returns (bool) {
address owner = _msgSender();
_transfer(owner, to, amount);
return true;
}
/**
* @dev See {IERC20-allowance}.
*/
function allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
/**
* @dev See {IERC20-approve}.
*
* NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on
* `transferFrom`. This is semantically equivalent to an infinite approval.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function approve(address spender, uint256 amount) public virtual override returns (bool) {
address owner = _msgSender();
_approve(owner, spender, amount);
return true;
}
/**
* @dev See {IERC20-transferFrom}.
*
* Emits an {Approval} event indicating the updated allowance. This is not
* required by the EIP. See the note at the beginning of {ERC20}.
*
* NOTE: Does not update the allowance if the current allowance
* is the maximum `uint256`.
*
* Requirements:
*
* - `from` and `to` cannot be the zero address.
* - `from` must have a balance of at least `amount`.
* - the caller must have allowance for ``from``'s tokens of at least
* `amount`.
*/
function transferFrom(address from, address to, uint256 amount) public virtual override returns (bool) {
address spender = _msgSender();
_spendAllowance(from, spender, amount);
_transfer(from, to, amount);
return true;
}
/**
* @dev Atomically increases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
address owner = _msgSender();
_approve(owner, spender, allowance(owner, spender) + addedValue);
return true;
}
/**
* @dev Atomically decreases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `spender` must have allowance for the caller of at least
* `subtractedValue`.
*/
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
address owner = _msgSender();
uint256 currentAllowance = allowance(owner, spender);
require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
unchecked {
_approve(owner, spender, currentAllowance - subtractedValue);
}
return true;
}
/**
* @dev Moves `amount` of tokens from `from` to `to`.
*
* This internal function is equivalent to {transfer}, and can be used to
* e.g. implement automatic token fees, slashing mechanisms, etc.
*
* Emits a {Transfer} event.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `from` must have a balance of at least `amount`.
*/
function _transfer(address from, address to, uint256 amount) internal virtual {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(from, to, amount);
uint256 fromBalance = _balances[from];
require(fromBalance >= amount, "ERC20: transfer amount exceeds balance");
unchecked {
_balances[from] = fromBalance - amount;
// Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by
// decrementing then incrementing.
_balances[to] += amount;
}
emit Transfer(from, to, amount);
_afterTokenTransfer(from, to, amount);
}
/** @dev Creates `amount` tokens and assigns them to `account`, increasing
* the total supply.
*
* Emits a {Transfer} event with `from` set to the zero address.
*
* Requirements:
*
* - `account` cannot be the zero address.
*/
function _mint(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: mint to the zero address");
_beforeTokenTransfer(address(0), account, amount);
_totalSupply += amount;
unchecked {
// Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above.
_balances[account] += amount;
}
emit Transfer(address(0), account, amount);
_afterTokenTransfer(address(0), account, amount);
}
/**
* @dev Destroys `amount` tokens from `account`, reducing the
* total supply.
*
* Emits a {Transfer} event with `to` set to the zero address.
*
* Requirements:
*
* - `account` cannot be the zero address.
* - `account` must have at least `amount` tokens.
*/
function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
_beforeTokenTransfer(account, address(0), amount);
uint256 accountBalance = _balances[account];
require(accountBalance >= amount, "ERC20: burn amount exceeds balance");
unchecked {
_balances[account] = accountBalance - amount;
// Overflow not possible: amount <= accountBalance <= totalSupply.
_totalSupply -= amount;
}
emit Transfer(account, address(0), amount);
_afterTokenTransfer(account, address(0), amount);
}
/**
* @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.
*
* This internal function is equivalent to `approve`, and can be used to
* e.g. set automatic allowances for certain subsystems, etc.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `owner` cannot be the zero address.
* - `spender` cannot be the zero address.
*/
function _approve(address owner, address spender, uint256 amount) internal virtual {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
/**
* @dev Updates `owner` s allowance for `spender` based on spent `amount`.
*
* Does not update the allowance amount in case of infinite allowance.
* Revert if not enough allowance is available.
*
* Might emit an {Approval} event.
*/
function _spendAllowance(address owner, address spender, uint256 amount) internal virtual {
uint256 currentAllowance = allowance(owner, spender);
if (currentAllowance != type(uint256).max) {
require(currentAllowance >= amount, "ERC20: insufficient allowance");
unchecked {
_approve(owner, spender, currentAllowance - amount);
}
}
}
/**
* @dev Hook that is called before any transfer of tokens. This includes
* minting and burning.
*
* Calling conditions:
*
* - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
* will be transferred to `to`.
* - when `from` is zero, `amount` tokens will be minted for `to`.
* - when `to` is zero, `amount` of ``from``'s tokens will be burned.
* - `from` and `to` are never both zero.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual {}
/**
* @dev Hook that is called after any transfer of tokens. This includes
* minting and burning.
*
* Calling conditions:
*
* - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
* has been transferred to `to`.
* - when `from` is zero, `amount` tokens have been minted for `to`.
* - when `to` is zero, `amount` of ``from``'s tokens have been burned.
* - `from` and `to` are never both zero.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _afterTokenTransfer(address from, address to, uint256 amount) internal virtual {}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (interfaces/IERC5267.sol)
pragma solidity ^0.8.0;
interface IERC5267 {
/**
* @dev MAY be emitted to signal that the domain could have changed.
*/
event EIP712DomainChanged();
/**
* @dev returns the fields and values that describe the domain separator used by this contract for EIP-712
* signature.
*/
function eip712Domain()
external
view
returns (
bytes1 fields,
string memory name,
string memory version,
uint256 chainId,
address verifyingContract,
bytes32 salt,
uint256[] memory extensions
);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.4) (utils/Context.sol)
pragma solidity ^0.8.0;
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
function _contextSuffixLength() internal view virtual returns (uint256) {
return 0;
}
}{
"remappings": [
"@chimera/=lib/V2-gov/lib/chimera/src/",
"@openzeppelin/contracts/=lib/V2-gov/lib/openzeppelin-contracts/contracts/",
"Solady/=lib/Solady/src/",
"V2-gov/=lib/V2-gov/src/",
"chimera/=lib/V2-gov/lib/chimera/src/",
"ds-test/=lib/openzeppelin-contracts/lib/forge-std/lib/ds-test/src/",
"erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/",
"forge-std/=lib/forge-std/src/",
"openzeppelin-contracts/=lib/openzeppelin-contracts/",
"openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/",
"v4-core/=lib/V2-gov/lib/v4-core/",
"halmos-cheatcodes/=lib/openzeppelin-contracts/lib/halmos-cheatcodes/src/"
],
"optimizer": {
"enabled": true,
"runs": 200
},
"metadata": {
"useLiteralContent": false,
"bytecodeHash": "ipfs",
"appendCBOR": true
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"evmVersion": "cancun",
"viaIR": false,
"libraries": {}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"contract IERC20","name":"_collToken","type":"address"},{"internalType":"contract IOneToken","name":"_oneToken","type":"address"},{"internalType":"contract IERC20","name":"_usdc","type":"address"},{"internalType":"contract IWETH","name":"_weth","type":"address"},{"internalType":"contract ICurveStableswapNGPool","name":"_curvePool","type":"address"},{"internalType":"uint128","name":"_usdcIndex","type":"uint128"},{"internalType":"uint128","name":"_oneIndex","type":"uint128"},{"internalType":"contract ISwapRouter","name":"_uniV3Router","type":"address"},{"internalType":"bytes","name":"_collateralToOnePath","type":"bytes"},{"internalType":"bytes","name":"_USDCToCollateralPath","type":"bytes"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"COLLATERAL_TO_USDC_PATH","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ONE_TOKEN_INDEX","outputs":[{"internalType":"uint128","name":"","type":"uint128"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"USDC","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"USDC_INDEX","outputs":[{"internalType":"uint128","name":"","type":"uint128"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"USDC_TO_COLLATERAL_PATH","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"WETH","outputs":[{"internalType":"contract IWETH","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"collToken","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"curvePool","outputs":[{"internalType":"contract ICurveStableswapNGPool","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"oneToken","outputs":[{"internalType":"contract IOneToken","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_oneAmount","type":"uint256"},{"internalType":"uint256","name":"_minCollAmount","type":"uint256"}],"name":"swapFromOne","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_collAmount","type":"uint256"},{"internalType":"uint256","name":"_minOneAmount","type":"uint256"}],"name":"swapToOne","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"uniV3Router","outputs":[{"internalType":"contract ISwapRouter","name":"","type":"address"}],"stateMutability":"view","type":"function"}]Contract Creation Code
0x6101c060405234801562000011575f80fd5b5060405162001d8738038062001d87833981016040819052620000349162000290565b6001600160a01b0380891660808190528b821660a0528a821660c0526101005287811661012052868116610140526001600160801b038087166101605285166101805283166101a0525f6200008a838262000414565b50600162000099828262000414565b5060a0516001600160a01b031663b9a708eb6040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015620000f9575060408051601f3d908101601f19168201909252620000f691810190620004e0565b60015b156200017e5760a0516001600160a01b031660e08190526040805163f3835afb60e01b8152905163f3835afb916004808201926020929091908290030181865afa1580156200014a573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019062000170919062000508565b6001600160a01b031660a052505b5050505050505050505062000526565b6001600160a01b0381168114620001a3575f80fd5b50565b8051620001b3816200018e565b919050565b80516001600160801b0381168114620001b3575f80fd5b634e487b7160e01b5f52604160045260245ffd5b5f82601f830112620001f3575f80fd5b81516001600160401b0380821115620002105762000210620001cf565b604051601f8301601f19908116603f011681019082821181831017156200023b576200023b620001cf565b816040528381526020925086602085880101111562000258575f80fd5b5f91505b838210156200027b57858201830151818301840152908201906200025c565b5f602085830101528094505050505092915050565b5f805f805f805f805f806101408b8d031215620002ab575f80fd5b620002b68b620001a6565b9950620002c660208c01620001a6565b9850620002d660408c01620001a6565b9750620002e660608c01620001a6565b9650620002f660808c01620001a6565b95506200030660a08c01620001b8565b94506200031660c08c01620001b8565b93506200032660e08c01620001a6565b6101008c01519093506001600160401b038082111562000344575f80fd5b620003528e838f01620001e3565b93506101208d015191508082111562000369575f80fd5b50620003788d828e01620001e3565b9150509295989b9194979a5092959850565b600181811c908216806200039f57607f821691505b602082108103620003be57634e487b7160e01b5f52602260045260245ffd5b50919050565b601f8211156200040f57805f5260205f20601f840160051c81016020851015620003eb5750805b601f840160051c820191505b818110156200040c575f8155600101620003f7565b50505b505050565b81516001600160401b03811115620004305762000430620001cf565b62000448816200044184546200038a565b84620003c4565b602080601f8311600181146200047e575f8415620004665750858301515b5f19600386901b1c1916600185901b178555620004d8565b5f85815260208120601f198616915b82811015620004ae578886015182559484019460019091019084016200048d565b5085821015620004cc57878501515f19600388901b60f8161c191681555b505060018460011b0185555b505050505050565b5f60208284031215620004f1575f80fd5b8151801515811462000501575f80fd5b9392505050565b5f6020828403121562000519575f80fd5b815162000501816200018e565b60805160a05160c05160e05161010051610120516101405161016051610180516101a051611724620006635f395f818161019f01528181610589015281816106e50152818161096901528181610a190152610b7001525f818161014f0152818161049d0152610cea01525f818161023b015281816104c80152610cbf01525f818160ba015281816103f40152818161050001528181610c110152610d2201525f81816102140152610e9b01525f81816101c6015281816105bb01528181610c430152610e6f01525f8181610291015281816102d40152818161082c0152818161086601526108a401525f81816101ed0152818161036a0152818161042301528181610db30152610e4701525f818160fe0152818161092a0152818161099701528181610a4801528181610ec60152610ef901525f50506117245ff3fe608060405234801561000f575f80fd5b50600436106100b1575f3560e01c80635fafa5891161006e5780635fafa5891461019a57806389a30271146101c1578063a27eccc1146101e8578063ad5c46481461020f578063c38cff9a14610236578063ddbf7b751461025d575f80fd5b8063218751b2146100b557806331b8c946146100f957806342d9e56d1461012057806348e78c3d146101355780634d7c14201461014a57806358dad2f414610192575b5f80fd5b6100dc7f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020015b60405180910390f35b6100dc7f000000000000000000000000000000000000000000000000000000000000000081565b61013361012e366004611555565b61027e565b005b61013d610780565b6040516100f091906115c2565b6101717f000000000000000000000000000000000000000000000000000000000000000081565b6040516fffffffffffffffffffffffffffffffff90911681526020016100f0565b61013d61080b565b6100dc7f000000000000000000000000000000000000000000000000000000000000000081565b6100dc7f000000000000000000000000000000000000000000000000000000000000000081565b6100dc7f000000000000000000000000000000000000000000000000000000000000000081565b6100dc7f000000000000000000000000000000000000000000000000000000000000000081565b6101717f000000000000000000000000000000000000000000000000000000000000000081565b61027061026b366004611555565b610818565b6040519081526020016100f0565b6102866114fe565b61028f81610e3b565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03161561034857604051630134fc1160e71b8152600481018390527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690639a7e088090602401602060405180830381865afa158015610321573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061034591906115db565b91505b6040516323b872dd60e01b8152336004820152306024820152604481018490527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906323b872dd906064016020604051808303815f875af11580156103b8573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906103dc91906115f2565b5060405163095ea7b360e01b81526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000081166004830152602482018590527f0000000000000000000000000000000000000000000000000000000000000000169063095ea7b3906044016020604051808303815f875af1158015610469573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061048d91906115f2565b50604051630f7c084960e21b81527f0000000000000000000000000000000000000000000000000000000000000000600f90810b60048301527f0000000000000000000000000000000000000000000000000000000000000000900b6024820152604481018490525f60648201819052907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690633df02124906084016020604051808303815f875af115801561054e573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061057291906115db565b60405163095ea7b360e01b81526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000081166004830152602482018390529192507f00000000000000000000000000000000000000000000000000000000000000009091169063095ea7b3906044016020604051808303815f875af1158015610603573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061062791906115f2565b505f6040518060a001604052806001805461064190611611565b80601f016020809104026020016040519081016040528092919081815260200182805461066d90611611565b80156106b85780601f1061068f576101008083540402835291602001916106b8565b820191905f5260205f20905b81548152906001019060200180831161069b57829003601f168201915b50505050508152602001336001600160a01b031681526020014281526020018381526020018581525090507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663c04b8d59826040518263ffffffff1660e01b815260040161072f9190611649565b6020604051808303815f875af115801561074b573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061076f91906115db565b5061077983610f2c565b5050505050565b5f805461078c90611611565b80601f01602080910402602001604051908101604052809291908181526020018280546107b890611611565b80156108035780601f106107da57610100808354040283529160200191610803565b820191905f5260205f20905b8154815290600101906020018083116107e657829003601f168201915b505050505081565b6001805461078c90611611565b5f6108216114fe565b61082a81610e3b565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03161561091d5761088e6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001633308761110a565b604051636f074d1f60e11b8152600481018590527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063de0e9a3e906024016020604051808303815f875af11580156108f2573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061091691906115db565b9350610952565b6109526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001633308761110a565b60405163095ea7b360e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000811660048301525f60248301527f0000000000000000000000000000000000000000000000000000000000000000169063095ea7b3906044016020604051808303815f875af11580156109dd573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610a0191906115f2565b5060405163095ea7b360e01b81526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000081166004830152602482018690527f0000000000000000000000000000000000000000000000000000000000000000169063095ea7b3906044016020604051808303815f875af1158015610a8e573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610ab291906115f2565b505f6040518060a001604052805f8054610acb90611611565b80601f0160208091040260200160405190810160405280929190818152602001828054610af790611611565b8015610b425780601f10610b1957610100808354040283529160200191610b42565b820191905f5260205f20905b815481529060010190602001808311610b2557829003601f168201915b50505050508152602001306001600160a01b031681526020014281526020018681526020015f81525090505f7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663c04b8d59836040518263ffffffff1660e01b8152600401610bba9190611649565b6020604051808303815f875af1158015610bd6573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610bfa91906115db565b60405163095ea7b360e01b81526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000081166004830152602482018390529192507f00000000000000000000000000000000000000000000000000000000000000009091169063095ea7b3906044016020604051808303815f875af1158015610c8b573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610caf91906115f2565b50604051630f7c084960e21b81527f0000000000000000000000000000000000000000000000000000000000000000600f90810b60048301527f0000000000000000000000000000000000000000000000000000000000000000900b602482015260448101829052606481018690525f907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690633df02124906084016020604051808303815f875af1158015610d70573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610d9491906115db565b60405163a9059cbb60e01b8152336004820152602481018290529091507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063a9059cbb906044016020604051808303815f875af1158015610e01573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610e2591906115f2565b50610e2f84610f2c565b93505050505b92915050565b80516001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000811690915281517f000000000000000000000000000000000000000000000000000000000000000082166020919091015281517f0000000000000000000000000000000000000000000000000000000000000000821660409091018190527f000000000000000000000000000000000000000000000000000000000000000090911614610f205780516001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000166060909101525b610f298161117b565b50565b5f805b60048110156111055782518160048110610f4b57610f4b6116a0565b602002015191506001600160a01b03821615611105576040516370a0823160e01b81523060048201525f906001600160a01b038416906370a0823190602401602060405180830381865afa158015610fa5573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610fc991906115db565b905083602001518260048110610fe157610fe16116a0565b60200201518111610ff257506110fd565b83604001518260048110611008576110086116a0565b6020020151156110bd57826001600160a01b031663c12ea3ca85606001518660200151856004811061103c5761103c6116a0565b602002015161104b90856116b4565b6040516001600160e01b031960e085901b1681526001600160a01b03909216600483015260248201526044016020604051808303815f875af1158015611093573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906110b791906115db565b506110fb565b6110fb8460600151856020015184600481106110db576110db6116a0565b60200201516110ea90846116b4565b6001600160a01b0386169190611185565b505b600101610f2f565b505050565b6040516001600160a01b03808516602483015283166044820152606481018290526111759085906323b872dd60e01b906084015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b0319909316929092179091526111b5565b50505050565b610f29813361128d565b6040516001600160a01b03831660248201526044810182905261110590849063a9059cbb60e01b9060640161113e565b5f611209826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166113749092919063ffffffff16565b905080515f148061122957508080602001905181019061122991906115f2565b6111055760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084015b60405180910390fd5b5f5b60048110156113625782515f9082600481106112ad576112ad6116a0565b60200201516001600160a01b03161461136257825181600481106112d3576112d36116a0565b60200201516040516370a0823160e01b81523060048201526001600160a01b03909116906370a0823190602401602060405180830381865afa15801561131b573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061133f91906115db565b83602001518260048110611355576113556116a0565b602002015260010161128f565b506001600160a01b0316606090910152565b606061138284845f8561138a565b949350505050565b6060824710156113eb5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401611284565b5f80866001600160a01b0316858760405161140691906116d3565b5f6040518083038185875af1925050503d805f8114611440576040519150601f19603f3d011682016040523d82523d5f602084013e611445565b606091505b509150915061145687838387611461565b979650505050505050565b606083156114cf5782515f036114c8576001600160a01b0385163b6114c85760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401611284565b5081611382565b61138283838151156114e45781518083602001fd5b8060405162461bcd60e51b815260040161128491906115c2565b6040518060800160405280611511611537565b815260200161151e611537565b815260200161152b611537565b81525f60209091015290565b60405180608001604052806004906020820280368337509192915050565b5f8060408385031215611566575f80fd5b50508035926020909101359150565b5f5b8381101561158f578181015183820152602001611577565b50505f910152565b5f81518084526115ae816020860160208601611575565b601f01601f19169290920160200192915050565b602081525f6115d46020830184611597565b9392505050565b5f602082840312156115eb575f80fd5b5051919050565b5f60208284031215611602575f80fd5b815180151581146115d4575f80fd5b600181811c9082168061162557607f821691505b60208210810361164357634e487b7160e01b5f52602260045260245ffd5b50919050565b602081525f825160a0602084015261166460c0840182611597565b905060018060a01b0360208501511660408401526040840151606084015260608401516080840152608084015160a08401528091505092915050565b634e487b7160e01b5f52603260045260245ffd5b81810381811115610e3557634e487b7160e01b5f52601160045260245ffd5b5f82516116e4818460208701611575565b919091019291505056fea2646970667358221220682c16f00602bfca37c0e3df744014bbe08745523d019d480d040a7fb083dd7764736f6c63430008180033000000000000000000000000039e2fb66102314ce7b64ce5ce3e5183bc94ad380000000000000000000000004871c910877c4e89f72ec355ff709b2543c0037500000000000000000000000029219dd400f2bf60e5a23d13be72b486d4038894000000000000000000000000039e2fb66102314ce7b64ce5ce3e5183bc94ad3800000000000000000000000087ecea4467457e1b854f87b63dd865ffc8652d27000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000005543c6176feb9b4b179078205d7c29eea2e2d695000000000000000000000000000000000000000000000000000000000000014000000000000000000000000000000000000000000000000000000000000001a0000000000000000000000000000000000000000000000000000000000000002b039e2fb66102314ce7b64ce5ce3e5183bc94ad3800003229219dd400f2bf60e5a23d13be72b486d4038894000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002b29219dd400f2bf60e5a23d13be72b486d4038894000032039e2fb66102314ce7b64ce5ce3e5183bc94ad38000000000000000000000000000000000000000000
Deployed Bytecode
0x608060405234801561000f575f80fd5b50600436106100b1575f3560e01c80635fafa5891161006e5780635fafa5891461019a57806389a30271146101c1578063a27eccc1146101e8578063ad5c46481461020f578063c38cff9a14610236578063ddbf7b751461025d575f80fd5b8063218751b2146100b557806331b8c946146100f957806342d9e56d1461012057806348e78c3d146101355780634d7c14201461014a57806358dad2f414610192575b5f80fd5b6100dc7f00000000000000000000000087ecea4467457e1b854f87b63dd865ffc8652d2781565b6040516001600160a01b0390911681526020015b60405180910390f35b6100dc7f000000000000000000000000039e2fb66102314ce7b64ce5ce3e5183bc94ad3881565b61013361012e366004611555565b61027e565b005b61013d610780565b6040516100f091906115c2565b6101717f000000000000000000000000000000000000000000000000000000000000000081565b6040516fffffffffffffffffffffffffffffffff90911681526020016100f0565b61013d61080b565b6100dc7f0000000000000000000000005543c6176feb9b4b179078205d7c29eea2e2d69581565b6100dc7f00000000000000000000000029219dd400f2bf60e5a23d13be72b486d403889481565b6100dc7f0000000000000000000000004871c910877c4e89f72ec355ff709b2543c0037581565b6100dc7f000000000000000000000000039e2fb66102314ce7b64ce5ce3e5183bc94ad3881565b6101717f000000000000000000000000000000000000000000000000000000000000000181565b61027061026b366004611555565b610818565b6040519081526020016100f0565b6102866114fe565b61028f81610e3b565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03161561034857604051630134fc1160e71b8152600481018390527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690639a7e088090602401602060405180830381865afa158015610321573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061034591906115db565b91505b6040516323b872dd60e01b8152336004820152306024820152604481018490527f0000000000000000000000004871c910877c4e89f72ec355ff709b2543c003756001600160a01b0316906323b872dd906064016020604051808303815f875af11580156103b8573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906103dc91906115f2565b5060405163095ea7b360e01b81526001600160a01b037f00000000000000000000000087ecea4467457e1b854f87b63dd865ffc8652d2781166004830152602482018590527f0000000000000000000000004871c910877c4e89f72ec355ff709b2543c00375169063095ea7b3906044016020604051808303815f875af1158015610469573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061048d91906115f2565b50604051630f7c084960e21b81527f0000000000000000000000000000000000000000000000000000000000000000600f90810b60048301527f0000000000000000000000000000000000000000000000000000000000000001900b6024820152604481018490525f60648201819052907f00000000000000000000000087ecea4467457e1b854f87b63dd865ffc8652d276001600160a01b031690633df02124906084016020604051808303815f875af115801561054e573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061057291906115db565b60405163095ea7b360e01b81526001600160a01b037f0000000000000000000000005543c6176feb9b4b179078205d7c29eea2e2d69581166004830152602482018390529192507f00000000000000000000000029219dd400f2bf60e5a23d13be72b486d40388949091169063095ea7b3906044016020604051808303815f875af1158015610603573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061062791906115f2565b505f6040518060a001604052806001805461064190611611565b80601f016020809104026020016040519081016040528092919081815260200182805461066d90611611565b80156106b85780601f1061068f576101008083540402835291602001916106b8565b820191905f5260205f20905b81548152906001019060200180831161069b57829003601f168201915b50505050508152602001336001600160a01b031681526020014281526020018381526020018581525090507f0000000000000000000000005543c6176feb9b4b179078205d7c29eea2e2d6956001600160a01b031663c04b8d59826040518263ffffffff1660e01b815260040161072f9190611649565b6020604051808303815f875af115801561074b573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061076f91906115db565b5061077983610f2c565b5050505050565b5f805461078c90611611565b80601f01602080910402602001604051908101604052809291908181526020018280546107b890611611565b80156108035780601f106107da57610100808354040283529160200191610803565b820191905f5260205f20905b8154815290600101906020018083116107e657829003601f168201915b505050505081565b6001805461078c90611611565b5f6108216114fe565b61082a81610e3b565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03161561091d5761088e6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001633308761110a565b604051636f074d1f60e11b8152600481018590527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063de0e9a3e906024016020604051808303815f875af11580156108f2573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061091691906115db565b9350610952565b6109526001600160a01b037f000000000000000000000000039e2fb66102314ce7b64ce5ce3e5183bc94ad381633308761110a565b60405163095ea7b360e01b81526001600160a01b037f0000000000000000000000005543c6176feb9b4b179078205d7c29eea2e2d695811660048301525f60248301527f000000000000000000000000039e2fb66102314ce7b64ce5ce3e5183bc94ad38169063095ea7b3906044016020604051808303815f875af11580156109dd573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610a0191906115f2565b5060405163095ea7b360e01b81526001600160a01b037f0000000000000000000000005543c6176feb9b4b179078205d7c29eea2e2d69581166004830152602482018690527f000000000000000000000000039e2fb66102314ce7b64ce5ce3e5183bc94ad38169063095ea7b3906044016020604051808303815f875af1158015610a8e573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610ab291906115f2565b505f6040518060a001604052805f8054610acb90611611565b80601f0160208091040260200160405190810160405280929190818152602001828054610af790611611565b8015610b425780601f10610b1957610100808354040283529160200191610b42565b820191905f5260205f20905b815481529060010190602001808311610b2557829003601f168201915b50505050508152602001306001600160a01b031681526020014281526020018681526020015f81525090505f7f0000000000000000000000005543c6176feb9b4b179078205d7c29eea2e2d6956001600160a01b031663c04b8d59836040518263ffffffff1660e01b8152600401610bba9190611649565b6020604051808303815f875af1158015610bd6573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610bfa91906115db565b60405163095ea7b360e01b81526001600160a01b037f00000000000000000000000087ecea4467457e1b854f87b63dd865ffc8652d2781166004830152602482018390529192507f00000000000000000000000029219dd400f2bf60e5a23d13be72b486d40388949091169063095ea7b3906044016020604051808303815f875af1158015610c8b573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610caf91906115f2565b50604051630f7c084960e21b81527f0000000000000000000000000000000000000000000000000000000000000001600f90810b60048301527f0000000000000000000000000000000000000000000000000000000000000000900b602482015260448101829052606481018690525f907f00000000000000000000000087ecea4467457e1b854f87b63dd865ffc8652d276001600160a01b031690633df02124906084016020604051808303815f875af1158015610d70573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610d9491906115db565b60405163a9059cbb60e01b8152336004820152602481018290529091507f0000000000000000000000004871c910877c4e89f72ec355ff709b2543c003756001600160a01b03169063a9059cbb906044016020604051808303815f875af1158015610e01573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610e2591906115f2565b50610e2f84610f2c565b93505050505b92915050565b80516001600160a01b037f0000000000000000000000004871c910877c4e89f72ec355ff709b2543c00375811690915281517f00000000000000000000000029219dd400f2bf60e5a23d13be72b486d403889482166020919091015281517f000000000000000000000000039e2fb66102314ce7b64ce5ce3e5183bc94ad38821660409091018190527f000000000000000000000000039e2fb66102314ce7b64ce5ce3e5183bc94ad3890911614610f205780516001600160a01b037f000000000000000000000000039e2fb66102314ce7b64ce5ce3e5183bc94ad38166060909101525b610f298161117b565b50565b5f805b60048110156111055782518160048110610f4b57610f4b6116a0565b602002015191506001600160a01b03821615611105576040516370a0823160e01b81523060048201525f906001600160a01b038416906370a0823190602401602060405180830381865afa158015610fa5573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610fc991906115db565b905083602001518260048110610fe157610fe16116a0565b60200201518111610ff257506110fd565b83604001518260048110611008576110086116a0565b6020020151156110bd57826001600160a01b031663c12ea3ca85606001518660200151856004811061103c5761103c6116a0565b602002015161104b90856116b4565b6040516001600160e01b031960e085901b1681526001600160a01b03909216600483015260248201526044016020604051808303815f875af1158015611093573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906110b791906115db565b506110fb565b6110fb8460600151856020015184600481106110db576110db6116a0565b60200201516110ea90846116b4565b6001600160a01b0386169190611185565b505b600101610f2f565b505050565b6040516001600160a01b03808516602483015283166044820152606481018290526111759085906323b872dd60e01b906084015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b0319909316929092179091526111b5565b50505050565b610f29813361128d565b6040516001600160a01b03831660248201526044810182905261110590849063a9059cbb60e01b9060640161113e565b5f611209826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166113749092919063ffffffff16565b905080515f148061122957508080602001905181019061122991906115f2565b6111055760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084015b60405180910390fd5b5f5b60048110156113625782515f9082600481106112ad576112ad6116a0565b60200201516001600160a01b03161461136257825181600481106112d3576112d36116a0565b60200201516040516370a0823160e01b81523060048201526001600160a01b03909116906370a0823190602401602060405180830381865afa15801561131b573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061133f91906115db565b83602001518260048110611355576113556116a0565b602002015260010161128f565b506001600160a01b0316606090910152565b606061138284845f8561138a565b949350505050565b6060824710156113eb5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401611284565b5f80866001600160a01b0316858760405161140691906116d3565b5f6040518083038185875af1925050503d805f8114611440576040519150601f19603f3d011682016040523d82523d5f602084013e611445565b606091505b509150915061145687838387611461565b979650505050505050565b606083156114cf5782515f036114c8576001600160a01b0385163b6114c85760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401611284565b5081611382565b61138283838151156114e45781518083602001fd5b8060405162461bcd60e51b815260040161128491906115c2565b6040518060800160405280611511611537565b815260200161151e611537565b815260200161152b611537565b81525f60209091015290565b60405180608001604052806004906020820280368337509192915050565b5f8060408385031215611566575f80fd5b50508035926020909101359150565b5f5b8381101561158f578181015183820152602001611577565b50505f910152565b5f81518084526115ae816020860160208601611575565b601f01601f19169290920160200192915050565b602081525f6115d46020830184611597565b9392505050565b5f602082840312156115eb575f80fd5b5051919050565b5f60208284031215611602575f80fd5b815180151581146115d4575f80fd5b600181811c9082168061162557607f821691505b60208210810361164357634e487b7160e01b5f52602260045260245ffd5b50919050565b602081525f825160a0602084015261166460c0840182611597565b905060018060a01b0360208501511660408401526040840151606084015260608401516080840152608084015160a08401528091505092915050565b634e487b7160e01b5f52603260045260245ffd5b81810381811115610e3557634e487b7160e01b5f52601160045260245ffd5b5f82516116e4818460208701611575565b919091019291505056fea2646970667358221220682c16f00602bfca37c0e3df744014bbe08745523d019d480d040a7fb083dd7764736f6c63430008180033
Loading...
Loading
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 34 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
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.