Source Code
Latest 25 from a total of 35 transactions
| Transaction Hash |
Method
|
Block
|
From
|
|
To
|
||||
|---|---|---|---|---|---|---|---|---|---|
| Zap In Manual | 24534110 | 9 days ago | IN | 0 ETH | 0.00211067 | ||||
| Zap In Manual | 24534069 | 9 days ago | IN | 0 ETH | 0.00210362 | ||||
| Zap In Manual | 24526125 | 11 days ago | IN | 0 ETH | 0.00179854 | ||||
| Zap In Manual | 24526115 | 11 days ago | IN | 0 ETH | 0.00191866 | ||||
| Zap In Manual | 24520265 | 11 days ago | IN | 0 ETH | 0.00010357 | ||||
| Zap In Manual | 24520238 | 11 days ago | IN | 0 ETH | 0.00021664 | ||||
| Zap In Manual | 24520216 | 11 days ago | IN | 0 ETH | 0.0009711 | ||||
| Zap In Manual | 24490017 | 16 days ago | IN | 0 ETH | 0.0009192 | ||||
| Zap In Manual | 24490013 | 16 days ago | IN | 0 ETH | 0.00049377 | ||||
| Zap In Manual | 24490009 | 16 days ago | IN | 0 ETH | 0.00050492 | ||||
| Zap In Manual | 24490003 | 16 days ago | IN | 0 ETH | 0.00051061 | ||||
| Zap In Manual | 24485067 | 16 days ago | IN | 0 ETH | 0.0005298 | ||||
| Zap In Manual | 24485060 | 16 days ago | IN | 0 ETH | 0.00054819 | ||||
| Zap In Manual | 24483821 | 16 days ago | IN | 0 ETH | 0.00003952 | ||||
| Zap In Manual | 24482905 | 17 days ago | IN | 0 ETH | 0.00046967 | ||||
| Zap In Manual | 24482625 | 17 days ago | IN | 0 ETH | 0.00049567 | ||||
| Zap In Manual | 24482601 | 17 days ago | IN | 0 ETH | 0.00047485 | ||||
| Zap In Manual | 24482552 | 17 days ago | IN | 0 ETH | 0.0005128 | ||||
| Zap In Manual | 24482512 | 17 days ago | IN | 0 ETH | 0.00048692 | ||||
| Zap In Manual | 24482438 | 17 days ago | IN | 0 ETH | 0.00048209 | ||||
| Zap In Manual | 24482356 | 17 days ago | IN | 0 ETH | 0.00012251 | ||||
| Zap In Manual | 24481978 | 17 days ago | IN | 0 ETH | 0.00002998 | ||||
| Zap In Manual | 24480977 | 17 days ago | IN | 0 ETH | 0.0000292 | ||||
| Zap In Manual | 24478677 | 17 days ago | IN | 0 ETH | 0.00009749 | ||||
| Zap In Manual | 24478660 | 17 days ago | IN | 0 ETH | 0.00009883 |
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Loading...
Loading
Cross-Chain Transactions
Loading...
Loading
Similar Match Source Code This contract matches the deployed Bytecode of the Source Code for Contract 0xF4C100DF...fF7753eb3 The constructor portion of the code might be different and could alter the actual behaviour of the contract
Contract Name:
StoneZapInManual
Compiler Version
v0.8.27+commit.40a35a09
Optimization Enabled:
Yes with 200 runs
Other Settings:
prague EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT
pragma solidity 0.8.27;
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import {
SafeERC20
} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import {StoneZapIn} from "./StoneZapIn.sol";
import {
ILightPsm,
ICurve3Pool,
ICurveLusd,
ICurveNg
} from "./interfaces/ICurve.sol";
/// @title StoneZapInManual
/// @notice Extends StoneZapIn with zapInManual: same flow but user supplies path split (pathAmounts) instead of fixed 1/3.
/// Use when frontend has optimized the split to minimize output variance (DAI, LUSD, crvUSD).
contract StoneZapInManual is StoneZapIn {
using SafeERC20 for IERC20;
uint256 private constant MIN_PATH_BPS = 2833; // 28.33% — lower bound per path
uint256 private constant MAX_PATH_BPS = 3833; // 38.33% — upper bound per path
uint256 private constant MAX_LOSS_BPS = 50; // 0.5% — max total swap loss vs 1:1 peg
error InvalidPathAmounts();
error PathImbalanceTooHigh(); // Each path must be within 5% of 33.33% (i.e., 28.33% - 38.33%)
error ExcessiveSwapLoss(); // Total swap output < 99.5% of input (peg-adjusted)
event ZapInManual(
address indexed user,
address indexed tokenIn,
uint256 amountIn,
uint256 sharesOut,
uint256 amountDai,
uint256 amountLusd,
uint256 amountCrvUsd
);
constructor(
address _vault,
address _dai,
address _lusd,
address _crvusd,
address _usdc,
address _usdt,
address _lightPsm,
address _curve3Pool,
address _curveLusdPool,
address _curveCrvUsdUsdc,
address _curveCrvUsdUsdt
)
StoneZapIn(
_vault,
_dai,
_lusd,
_crvusd,
_usdc,
_usdt,
_lightPsm,
_curve3Pool,
_curveLusdPool,
_curveCrvUsdUsdc,
_curveCrvUsdUsdt
)
{}
/// @notice Zap in with a single token using user-supplied path split.
/// @param inputToken One of DAI, USDC, USDT, LUSD, CRVUSD.
/// @param amount Amount of input token (must equal pathAmounts[0]+pathAmounts[1]+pathAmounts[2]).
/// @param pathAmounts [amount for path->DAI, path->LUSD, path->crvUSD] in input token units.
/// All three values MUST be > 0; zero amounts cause Curve pool reverts.
/// @param receiver Gets minted SVT.
/// @param minSharesOut Minimum SVT (slippage).
/// @param slippageBps Slippage for each swap in basis points (e.g. 50 = 0.5%, max 500 = 5%).
/// @param deadline Unix timestamp after which the transaction will revert.
/// @param dustThreshold Per-token dust threshold (18 decimals). If 0, all dust is returned.
/// If > 0, leftover below this amount per token stays on the contract (owner can sweep).
/// Example: 0.5e18 = 0.5 tokens — dust below 0.5 DAI/LUSD/crvUSD won't be refunded.
function zapInManual(
address inputToken,
uint256 amount,
uint256[3] calldata pathAmounts,
address receiver,
uint256 minSharesOut,
uint256 slippageBps,
uint256 deadline,
uint256 dustThreshold
) external nonReentrant returns (uint256 sharesOut) {
if (block.timestamp > deadline) revert DeadlineExpired();
if (slippageBps > 500) revert SlippageTooHigh(); // 5% max, same as StoneZapIn
if (amount == 0) revert ZeroAmount();
if (receiver == address(0)) revert ZeroReceiver();
if (pathAmounts[0] + pathAmounts[1] + pathAmounts[2] != amount) {
revert InvalidPathAmounts();
}
// Check path balance: each path must be within 5% of 33.33% (28.33% - 38.33%)
uint256 minPath = (amount * MIN_PATH_BPS) / 10000;
uint256 maxPath = (amount * MAX_PATH_BPS) / 10000;
if (
pathAmounts[0] < minPath || pathAmounts[0] > maxPath ||
pathAmounts[1] < minPath || pathAmounts[1] > maxPath ||
pathAmounts[2] < minPath || pathAmounts[2] > maxPath
) {
revert PathImbalanceTooHigh();
}
// L-2: Validate inputToken BEFORE transferring to save gas on invalid token
bool isValidToken = inputToken == address(USDC)
|| inputToken == address(USDT)
|| inputToken == address(DAI)
|| inputToken == address(LUSD)
|| inputToken == address(CRVUSD);
if (!isValidToken) revert InvalidInputToken();
IERC20(inputToken).safeTransferFrom(msg.sender, address(this), amount);
uint256[3] memory amounts;
if (inputToken == address(USDC)) {
amounts = _zapInUSDCManual(
pathAmounts[0],
pathAmounts[1],
pathAmounts[2],
slippageBps
);
} else if (inputToken == address(USDT)) {
amounts = _zapInUSDTManual(
pathAmounts[0],
pathAmounts[1],
pathAmounts[2],
slippageBps
);
} else if (inputToken == address(DAI)) {
amounts = _zapInDAIManual(
pathAmounts[0],
pathAmounts[1],
pathAmounts[2],
slippageBps
);
} else if (inputToken == address(LUSD)) {
amounts = _zapInLUSDManual(
pathAmounts[0],
pathAmounts[1],
pathAmounts[2],
slippageBps
);
} else {
// Must be CRVUSD (already validated above)
amounts = _zapInCRVUSDManual(
pathAmounts[0],
pathAmounts[1],
pathAmounts[2],
slippageBps
);
}
// Fool-proof check: total swap output must be within 0.5% of input at 1:1 peg.
// All three output tokens (DAI, LUSD, crvUSD) are 18-decimal stablecoins ≈ $1.
// For 6-decimal inputs (USDC/USDT), scale up to 18 decimals for comparison.
{
uint256 totalOut = amounts[0] + amounts[1] + amounts[2];
uint256 fairValue = (inputToken == address(USDC) || inputToken == address(USDT))
? amount * 1e12
: amount;
if (totalOut < (fairValue * (10000 - MAX_LOSS_BPS)) / 10000) {
revert ExcessiveSwapLoss();
}
}
sharesOut = _depositToVault(amounts, minSharesOut, receiver, dustThreshold);
emit ZapInManual(msg.sender, inputToken, amount, sharesOut, amounts[0], amounts[1], amounts[2]);
return sharesOut;
}
// ---------- Manual path versions (t1->DAI, t2->LUSD, t3->crvUSD) ----------
function _zapInUSDCManual(
uint256 t1,
uint256 t2,
uint256 t3,
uint256 slippageBps
) internal returns (uint256[3] memory amounts) {
uint256 daiBefore = DAI.balanceOf(address(this));
USDC.forceApprove(lightPsm, t1);
ILightPsm(lightPsm).sellGem(address(this), t1);
uint256 daiReceived = DAI.balanceOf(address(this)) - daiBefore;
uint256 lusdBefore = LUSD.balanceOf(address(this));
USDC.forceApprove(curveLusdPool, t2);
ICurveLusd(curveLusdPool).exchange_underlying(
2,
0,
t2,
_pegMinOut(t2, 6, 18, slippageBps)
);
uint256 lusdReceived = LUSD.balanceOf(address(this)) - lusdBefore;
uint256 crvBefore = CRVUSD.balanceOf(address(this));
USDC.forceApprove(curveCrvUsdUsdc, t3);
ICurveNg(curveCrvUsdUsdc).exchange(
0,
1,
t3,
_pegMinOut(t3, 6, 18, slippageBps)
);
uint256 crvReceived = CRVUSD.balanceOf(address(this)) - crvBefore;
amounts[0] = daiReceived;
amounts[1] = lusdReceived;
amounts[2] = crvReceived;
return amounts;
}
function _zapInUSDTManual(
uint256 t1,
uint256 t2,
uint256 t3,
uint256 slippageBps
) internal returns (uint256[3] memory amounts) {
uint256 daiBefore = DAI.balanceOf(address(this));
USDT.forceApprove(curve3Pool, t1);
ICurve3Pool(curve3Pool).exchange(
2,
0,
t1,
_pegMinOut(t1, 6, 18, slippageBps)
);
uint256 daiReceived = DAI.balanceOf(address(this)) - daiBefore;
uint256 lusdBefore = LUSD.balanceOf(address(this));
USDT.forceApprove(curveLusdPool, t2);
ICurveLusd(curveLusdPool).exchange_underlying(
3,
0,
t2,
_pegMinOut(t2, 6, 18, slippageBps)
);
uint256 lusdReceived = LUSD.balanceOf(address(this)) - lusdBefore;
uint256 crvBefore = CRVUSD.balanceOf(address(this));
USDT.forceApprove(curveCrvUsdUsdt, t3);
ICurveNg(curveCrvUsdUsdt).exchange(
0,
1,
t3,
_pegMinOut(t3, 6, 18, slippageBps)
);
uint256 crvReceived = CRVUSD.balanceOf(address(this)) - crvBefore;
amounts[0] = daiReceived;
amounts[1] = lusdReceived;
amounts[2] = crvReceived;
return amounts;
}
function _zapInDAIManual(
uint256 t1,
uint256 t2,
uint256 t3,
uint256 slippageBps
) internal returns (uint256[3] memory amounts) {
uint256 lusdBefore = LUSD.balanceOf(address(this));
DAI.forceApprove(curveLusdPool, t2);
ICurveLusd(curveLusdPool).exchange_underlying(
1,
0,
t2,
_pegMinOut(t2, 18, 18, slippageBps)
);
uint256 lusdReceived = LUSD.balanceOf(address(this)) - lusdBefore;
// DAI -> USDC via PSM (1:1, zero fee) instead of 3pool
uint256 usdcBefore = USDC.balanceOf(address(this));
uint256 usdcWanted = t3 / 1e12;
DAI.forceApprove(lightPsm, t3);
ILightPsm(lightPsm).buyGem(address(this), usdcWanted);
uint256 usdcReceived = USDC.balanceOf(address(this)) - usdcBefore;
uint256 crvBefore = CRVUSD.balanceOf(address(this));
USDC.forceApprove(curveCrvUsdUsdc, usdcReceived);
ICurveNg(curveCrvUsdUsdc).exchange(
0,
1,
usdcReceived,
_pegMinOut(usdcReceived, 6, 18, slippageBps)
);
uint256 crvReceived = CRVUSD.balanceOf(address(this)) - crvBefore;
amounts[0] = t1;
amounts[1] = lusdReceived;
amounts[2] = crvReceived;
return amounts;
}
/// @dev LUSD Manual: t1 -> swap LUSD->DAI, t2 -> keep LUSD, t3 -> swap LUSD->USDC->crvUSD
function _zapInLUSDManual(
uint256 t1,
uint256 t2,
uint256 t3,
uint256 slippageBps
) internal returns (uint256[3] memory amounts) {
// t1: LUSD -> DAI (via Curve LUSD pool: index 0=LUSD, index 1=DAI underlying)
uint256 daiBefore = DAI.balanceOf(address(this));
LUSD.forceApprove(curveLusdPool, t1);
ICurveLusd(curveLusdPool).exchange_underlying(
0,
1,
t1,
_pegMinOut(t1, 18, 18, slippageBps)
);
uint256 daiReceived = DAI.balanceOf(address(this)) - daiBefore;
// t3: LUSD -> USDC -> crvUSD
uint256 usdcBefore = USDC.balanceOf(address(this));
LUSD.forceApprove(curveLusdPool, t3);
ICurveLusd(curveLusdPool).exchange_underlying(
0,
2,
t3,
_pegMinOut(t3, 18, 6, slippageBps)
);
uint256 usdcReceived = USDC.balanceOf(address(this)) - usdcBefore;
uint256 crvBefore = CRVUSD.balanceOf(address(this));
USDC.forceApprove(curveCrvUsdUsdc, usdcReceived);
ICurveNg(curveCrvUsdUsdc).exchange(
0,
1,
usdcReceived,
_pegMinOut(usdcReceived, 6, 18, slippageBps)
);
uint256 crvReceived = CRVUSD.balanceOf(address(this)) - crvBefore;
// t2: keep as LUSD (no swap needed)
amounts[0] = daiReceived; // pathAmounts[0] -> DAI
amounts[1] = t2; // pathAmounts[1] -> LUSD (kept)
amounts[2] = crvReceived; // pathAmounts[2] -> crvUSD
return amounts;
}
function _zapInCRVUSDManual(
uint256 t1,
uint256 t2,
uint256 t3,
uint256 slippageBps
) internal returns (uint256[3] memory amounts) {
uint256 usdcBefore1 = USDC.balanceOf(address(this));
CRVUSD.forceApprove(curveCrvUsdUsdc, t1);
ICurveNg(curveCrvUsdUsdc).exchange(
1,
0,
t1,
_pegMinOut(t1, 18, 6, slippageBps)
);
uint256 usdcForDai = USDC.balanceOf(address(this)) - usdcBefore1;
uint256 daiBefore = DAI.balanceOf(address(this));
USDC.forceApprove(lightPsm, usdcForDai);
ILightPsm(lightPsm).sellGem(address(this), usdcForDai);
uint256 daiReceived = DAI.balanceOf(address(this)) - daiBefore;
uint256 usdcBefore2 = USDC.balanceOf(address(this));
CRVUSD.forceApprove(curveCrvUsdUsdc, t2);
ICurveNg(curveCrvUsdUsdc).exchange(
1,
0,
t2,
_pegMinOut(t2, 18, 6, slippageBps)
);
uint256 usdcForLusd = USDC.balanceOf(address(this)) - usdcBefore2;
uint256 lusdBefore = LUSD.balanceOf(address(this));
USDC.forceApprove(curveLusdPool, usdcForLusd);
ICurveLusd(curveLusdPool).exchange_underlying(
2,
0,
usdcForLusd,
_pegMinOut(usdcForLusd, 6, 18, slippageBps)
);
uint256 lusdReceived = LUSD.balanceOf(address(this)) - lusdBefore;
amounts[0] = daiReceived;
amounts[1] = lusdReceived;
amounts[2] = t3;
return amounts;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.4.0) (token/ERC20/IERC20.sol)
pragma solidity >=0.4.16;
/**
* @dev Interface of the ERC-20 standard as defined in the ERC.
*/
interface IERC20 {
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
/**
* @dev Returns the value of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the value of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves a `value` amount of tokens from the caller's account to `to`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address to, uint256 value) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets a `value` amount of tokens as the allowance of `spender` over the
* caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 value) external returns (bool);
/**
* @dev Moves a `value` amount of tokens from `from` to `to` using the
* allowance mechanism. `value` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address from, address to, uint256 value) external returns (bool);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.5.0) (token/ERC20/utils/SafeERC20.sol)
pragma solidity ^0.8.20;
import {IERC20} from "../IERC20.sol";
import {IERC1363} from "../../../interfaces/IERC1363.sol";
/**
* @title SafeERC20
* @dev Wrappers around ERC-20 operations that throw on failure (when the token
* contract returns false). Tokens that return no value (and instead revert or
* throw on failure) are also supported, non-reverting calls are assumed to be
* successful.
* To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
* which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
*/
library SafeERC20 {
/**
* @dev An operation with an ERC-20 token failed.
*/
error SafeERC20FailedOperation(address token);
/**
* @dev Indicates a failed `decreaseAllowance` request.
*/
error SafeERC20FailedDecreaseAllowance(address spender, uint256 currentAllowance, uint256 requestedDecrease);
/**
* @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,
* non-reverting calls are assumed to be successful.
*/
function safeTransfer(IERC20 token, address to, uint256 value) internal {
if (!_safeTransfer(token, to, value, true)) {
revert SafeERC20FailedOperation(address(token));
}
}
/**
* @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 {
if (!_safeTransferFrom(token, from, to, value, true)) {
revert SafeERC20FailedOperation(address(token));
}
}
/**
* @dev Variant of {safeTransfer} that returns a bool instead of reverting if the operation is not successful.
*/
function trySafeTransfer(IERC20 token, address to, uint256 value) internal returns (bool) {
return _safeTransfer(token, to, value, false);
}
/**
* @dev Variant of {safeTransferFrom} that returns a bool instead of reverting if the operation is not successful.
*/
function trySafeTransferFrom(IERC20 token, address from, address to, uint256 value) internal returns (bool) {
return _safeTransferFrom(token, from, to, value, false);
}
/**
* @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
* non-reverting calls are assumed to be successful.
*
* IMPORTANT: If the token implements ERC-7674 (ERC-20 with temporary allowance), and if the "client"
* smart contract uses ERC-7674 to set temporary allowances, then the "client" smart contract should avoid using
* this function. Performing a {safeIncreaseAllowance} or {safeDecreaseAllowance} operation on a token contract
* that has a non-zero temporary allowance (for that particular owner-spender) will result in unexpected behavior.
*/
function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
uint256 oldAllowance = token.allowance(address(this), spender);
forceApprove(token, spender, oldAllowance + value);
}
/**
* @dev Decrease the calling contract's allowance toward `spender` by `requestedDecrease`. If `token` returns no
* value, non-reverting calls are assumed to be successful.
*
* IMPORTANT: If the token implements ERC-7674 (ERC-20 with temporary allowance), and if the "client"
* smart contract uses ERC-7674 to set temporary allowances, then the "client" smart contract should avoid using
* this function. Performing a {safeIncreaseAllowance} or {safeDecreaseAllowance} operation on a token contract
* that has a non-zero temporary allowance (for that particular owner-spender) will result in unexpected behavior.
*/
function safeDecreaseAllowance(IERC20 token, address spender, uint256 requestedDecrease) internal {
unchecked {
uint256 currentAllowance = token.allowance(address(this), spender);
if (currentAllowance < requestedDecrease) {
revert SafeERC20FailedDecreaseAllowance(spender, currentAllowance, requestedDecrease);
}
forceApprove(token, spender, currentAllowance - requestedDecrease);
}
}
/**
* @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,
* non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval
* to be set to zero before setting it to a non-zero value, such as USDT.
*
* NOTE: If the token implements ERC-7674, this function will not modify any temporary allowance. This function
* only sets the "standard" allowance. Any temporary allowance will remain active, in addition to the value being
* set here.
*/
function forceApprove(IERC20 token, address spender, uint256 value) internal {
if (!_safeApprove(token, spender, value, false)) {
if (!_safeApprove(token, spender, 0, true)) revert SafeERC20FailedOperation(address(token));
if (!_safeApprove(token, spender, value, true)) revert SafeERC20FailedOperation(address(token));
}
}
/**
* @dev Performs an {ERC1363} transferAndCall, with a fallback to the simple {ERC20} transfer if the target has no
* code. This can be used to implement an {ERC721}-like safe transfer that relies on {ERC1363} checks when
* targeting contracts.
*
* Reverts if the returned value is other than `true`.
*/
function transferAndCallRelaxed(IERC1363 token, address to, uint256 value, bytes memory data) internal {
if (to.code.length == 0) {
safeTransfer(token, to, value);
} else if (!token.transferAndCall(to, value, data)) {
revert SafeERC20FailedOperation(address(token));
}
}
/**
* @dev Performs an {ERC1363} transferFromAndCall, with a fallback to the simple {ERC20} transferFrom if the target
* has no code. This can be used to implement an {ERC721}-like safe transfer that relies on {ERC1363} checks when
* targeting contracts.
*
* Reverts if the returned value is other than `true`.
*/
function transferFromAndCallRelaxed(
IERC1363 token,
address from,
address to,
uint256 value,
bytes memory data
) internal {
if (to.code.length == 0) {
safeTransferFrom(token, from, to, value);
} else if (!token.transferFromAndCall(from, to, value, data)) {
revert SafeERC20FailedOperation(address(token));
}
}
/**
* @dev Performs an {ERC1363} approveAndCall, with a fallback to the simple {ERC20} approve if the target has no
* code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when
* targeting contracts.
*
* NOTE: When the recipient address (`to`) has no code (i.e. is an EOA), this function behaves as {forceApprove}.
* Oppositely, when the recipient address (`to`) has code, this function only attempts to call {ERC1363-approveAndCall}
* once without retrying, and relies on the returned value to be true.
*
* Reverts if the returned value is other than `true`.
*/
function approveAndCallRelaxed(IERC1363 token, address to, uint256 value, bytes memory data) internal {
if (to.code.length == 0) {
forceApprove(token, to, value);
} else if (!token.approveAndCall(to, value, data)) {
revert SafeERC20FailedOperation(address(token));
}
}
/**
* @dev Imitates a Solidity `token.transfer(to, value)` call, 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 to The recipient of the tokens
* @param value The amount of token to transfer
* @param bubble Behavior switch if the transfer call reverts: bubble the revert reason or return a false boolean.
*/
function _safeTransfer(IERC20 token, address to, uint256 value, bool bubble) private returns (bool success) {
bytes4 selector = IERC20.transfer.selector;
assembly ("memory-safe") {
let fmp := mload(0x40)
mstore(0x00, selector)
mstore(0x04, and(to, shr(96, not(0))))
mstore(0x24, value)
success := call(gas(), token, 0, 0x00, 0x44, 0x00, 0x20)
// if call success and return is true, all is good.
// otherwise (not success or return is not true), we need to perform further checks
if iszero(and(success, eq(mload(0x00), 1))) {
// if the call was a failure and bubble is enabled, bubble the error
if and(iszero(success), bubble) {
returndatacopy(fmp, 0x00, returndatasize())
revert(fmp, returndatasize())
}
// if the return value is not true, then the call is only successful if:
// - the token address has code
// - the returndata is empty
success := and(success, and(iszero(returndatasize()), gt(extcodesize(token), 0)))
}
mstore(0x40, fmp)
}
}
/**
* @dev Imitates a Solidity `token.transferFrom(from, to, value)` call, 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 from The sender of the tokens
* @param to The recipient of the tokens
* @param value The amount of token to transfer
* @param bubble Behavior switch if the transfer call reverts: bubble the revert reason or return a false boolean.
*/
function _safeTransferFrom(
IERC20 token,
address from,
address to,
uint256 value,
bool bubble
) private returns (bool success) {
bytes4 selector = IERC20.transferFrom.selector;
assembly ("memory-safe") {
let fmp := mload(0x40)
mstore(0x00, selector)
mstore(0x04, and(from, shr(96, not(0))))
mstore(0x24, and(to, shr(96, not(0))))
mstore(0x44, value)
success := call(gas(), token, 0, 0x00, 0x64, 0x00, 0x20)
// if call success and return is true, all is good.
// otherwise (not success or return is not true), we need to perform further checks
if iszero(and(success, eq(mload(0x00), 1))) {
// if the call was a failure and bubble is enabled, bubble the error
if and(iszero(success), bubble) {
returndatacopy(fmp, 0x00, returndatasize())
revert(fmp, returndatasize())
}
// if the return value is not true, then the call is only successful if:
// - the token address has code
// - the returndata is empty
success := and(success, and(iszero(returndatasize()), gt(extcodesize(token), 0)))
}
mstore(0x40, fmp)
mstore(0x60, 0)
}
}
/**
* @dev Imitates a Solidity `token.approve(spender, value)` call, 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 spender The spender of the tokens
* @param value The amount of token to transfer
* @param bubble Behavior switch if the transfer call reverts: bubble the revert reason or return a false boolean.
*/
function _safeApprove(IERC20 token, address spender, uint256 value, bool bubble) private returns (bool success) {
bytes4 selector = IERC20.approve.selector;
assembly ("memory-safe") {
let fmp := mload(0x40)
mstore(0x00, selector)
mstore(0x04, and(spender, shr(96, not(0))))
mstore(0x24, value)
success := call(gas(), token, 0, 0x00, 0x44, 0x00, 0x20)
// if call success and return is true, all is good.
// otherwise (not success or return is not true), we need to perform further checks
if iszero(and(success, eq(mload(0x00), 1))) {
// if the call was a failure and bubble is enabled, bubble the error
if and(iszero(success), bubble) {
returndatacopy(fmp, 0x00, returndatasize())
revert(fmp, returndatasize())
}
// if the return value is not true, then the call is only successful if:
// - the token address has code
// - the returndata is empty
success := and(success, and(iszero(returndatasize()), gt(extcodesize(token), 0)))
}
mstore(0x40, fmp)
}
}
}// SPDX-License-Identifier: MIT
pragma solidity 0.8.27;
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import {
SafeERC20
} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";
import {Ownable2Step} from "@openzeppelin/contracts/access/Ownable2Step.sol";
import {
ReentrancyGuard
} from "@openzeppelin/contracts/utils/ReentrancyGuard.sol";
import {
ILightPsm,
ICurve3Pool,
ICurveLusd,
ICurveNg
} from "./interfaces/ICurve.sol";
/// @title StoneZapIn
/// @notice Zap into Stone Vault with a single token (DAI, USDC, USDT, LUSD, crvUSD).
/// Splits/swaps to DAI + LUSD + crvUSD and deposits in one tx. Owner can sweep dust only.
contract StoneZapIn is Ownable2Step, ReentrancyGuard {
using SafeERC20 for IERC20;
uint256 private constant BPS_DENOMINATOR = 10000;
uint256 private constant MAX_SLIPPAGE_BPS = 500; // 5% maximum slippage
IERC20 public immutable vaultToken;
IERC20 public immutable DAI;
IERC20 public immutable LUSD;
IERC20 public immutable CRVUSD;
IERC20 public immutable USDC;
IERC20 public immutable USDT;
address public immutable vault;
address public immutable lightPsm;
address public immutable curve3Pool;
address public immutable curveLusdPool;
address public immutable curveCrvUsdUsdc;
address public immutable curveCrvUsdUsdt;
error InvalidInputToken();
error ZeroAmount();
error ZeroReceiver();
error DeadlineExpired();
error SlippageTooHigh();
error ZeroAddress();
event ZapIn(
address indexed user,
address indexed tokenIn,
uint256 amountIn,
uint256 sharesOut
);
constructor(
address _vault,
address _dai,
address _lusd,
address _crvusd,
address _usdc,
address _usdt,
address _lightPsm,
address _curve3Pool,
address _curveLusdPool,
address _curveCrvUsdUsdc,
address _curveCrvUsdUsdt
) Ownable(msg.sender) {
// Validate all addresses to prevent deployment with zero addresses
if (_vault == address(0)) revert ZeroAddress();
if (_dai == address(0)) revert ZeroAddress();
if (_lusd == address(0)) revert ZeroAddress();
if (_crvusd == address(0)) revert ZeroAddress();
if (_usdc == address(0)) revert ZeroAddress();
if (_usdt == address(0)) revert ZeroAddress();
if (_lightPsm == address(0)) revert ZeroAddress();
if (_curve3Pool == address(0)) revert ZeroAddress();
if (_curveLusdPool == address(0)) revert ZeroAddress();
if (_curveCrvUsdUsdc == address(0)) revert ZeroAddress();
if (_curveCrvUsdUsdt == address(0)) revert ZeroAddress();
vault = _vault;
vaultToken = IERC20(_vault);
DAI = IERC20(_dai);
LUSD = IERC20(_lusd);
CRVUSD = IERC20(_crvusd);
USDC = IERC20(_usdc);
USDT = IERC20(_usdt);
lightPsm = _lightPsm;
curve3Pool = _curve3Pool;
curveLusdPool = _curveLusdPool;
curveCrvUsdUsdc = _curveCrvUsdUsdc;
curveCrvUsdUsdt = _curveCrvUsdUsdt;
DAI.forceApprove(_vault, type(uint256).max);
LUSD.forceApprove(_vault, type(uint256).max);
CRVUSD.forceApprove(_vault, type(uint256).max);
}
/// @notice Zap in with a single token; receive SVT on receiver.
/// @param inputToken One of DAI, USDC, USDT, LUSD, CRVUSD.
/// @param amount Amount of input token (in its decimals).
/// @param receiver Gets minted SVT.
/// @param minSharesOut Minimum SVT (slippage).
/// @param slippageBps Slippage for each swap in basis points (e.g. 50 = 0.5%, max 500 = 5%).
/// @param deadline Unix timestamp after which the transaction will revert.
/// @param dustThreshold Per-token dust threshold (18 decimals). If 0, all dust is returned.
/// If > 0, leftover below this amount per token stays on the contract (owner can sweep).
/// Example: 0.5e18 = 0.5 tokens — dust below 0.5 DAI/LUSD/crvUSD won't be refunded.
function zapIn(
address inputToken,
uint256 amount,
address receiver,
uint256 minSharesOut,
uint256 slippageBps,
uint256 deadline,
uint256 dustThreshold
) external nonReentrant returns (uint256 sharesOut) {
// Validate deadline to prevent stale transactions
if (block.timestamp > deadline) revert DeadlineExpired();
// Validate slippage parameter to prevent user error
if (slippageBps > MAX_SLIPPAGE_BPS) revert SlippageTooHigh();
if (amount == 0) revert ZeroAmount();
if (receiver == address(0)) revert ZeroReceiver();
IERC20(inputToken).safeTransferFrom(msg.sender, address(this), amount);
uint256[3] memory amounts;
if (inputToken == address(USDC)) {
amounts = _zapInUSDC(amount, slippageBps);
} else if (inputToken == address(USDT)) {
amounts = _zapInUSDT(amount, slippageBps);
} else if (inputToken == address(DAI)) {
amounts = _zapInDAI(amount, slippageBps);
} else if (inputToken == address(LUSD)) {
amounts = _zapInLUSD(amount, slippageBps);
} else if (inputToken == address(CRVUSD)) {
amounts = _zapInCRVUSD(amount, slippageBps);
} else {
revert InvalidInputToken();
}
sharesOut = _depositToVault(amounts, minSharesOut, receiver, dustThreshold);
emit ZapIn(msg.sender, inputToken, amount, sharesOut);
return sharesOut;
}
/// @notice Sweeps token balance to owner. Admin cannot interleave into user transactions
/// (protocol-level atomicity); this is for dust and mistakenly sent tokens only.
/// @param token ERC20 token to sweep.
function sweep(address token) external onlyOwner {
uint256 bal = IERC20(token).balanceOf(address(this));
if (bal > 0) {
IERC20(token).safeTransfer(owner(), bal);
}
}
function _depositToVault(
uint256[3] memory amounts,
uint256 minSharesOut,
address receiver,
uint256 dustThreshold
) internal returns (uint256 sharesOut) {
(bool ok, bytes memory data) = vault.call(
abi.encodeWithSignature(
"deposit(uint256[3],uint256,address)",
amounts,
minSharesOut,
receiver
)
);
if (!ok) _revert(data);
sharesOut = abi.decode(data, (uint256));
// Return any unused tokens to the receiver
// Vault only takes min(amounts[0], amounts[1], amounts[2]) per token
_returnUnusedTokens(receiver, dustThreshold);
return sharesOut;
}
/// @dev Returns remaining DAI/LUSD/CRVUSD to receiver after vault deposit.
/// If dustThreshold > 0, only transfers tokens whose balance >= dustThreshold.
/// Dust below the threshold stays on the contract for later owner sweep.
function _returnUnusedTokens(address receiver, uint256 dustThreshold) internal {
uint256 daiBalance = DAI.balanceOf(address(this));
uint256 lusdBalance = LUSD.balanceOf(address(this));
uint256 crvusdBalance = CRVUSD.balanceOf(address(this));
if (daiBalance > 0 && (dustThreshold == 0 || daiBalance >= dustThreshold)) {
DAI.safeTransfer(receiver, daiBalance);
}
if (lusdBalance > 0 && (dustThreshold == 0 || lusdBalance >= dustThreshold)) {
LUSD.safeTransfer(receiver, lusdBalance);
}
if (crvusdBalance > 0 && (dustThreshold == 0 || crvusdBalance >= dustThreshold)) {
CRVUSD.safeTransfer(receiver, crvusdBalance);
}
}
function _revert(bytes memory data) internal pure {
if (data.length >= 4) {
assembly {
revert(add(data, 32), mload(data))
}
}
revert("ZapIn: vault call failed");
}
function _third(
uint256 amount
) internal pure returns (uint256 t1, uint256 t2, uint256 t3) {
t1 = amount / 3;
t2 = amount / 3;
t3 = amount - t1 - t2;
}
/// @dev Calculates minimum output based on 1:1 stablecoin peg (MEV-resistant).
/// Uses the known peg ratio instead of on-chain get_dy() which can be manipulated.
/// @param amountIn Input amount in source token decimals
/// @param fromDec Source token decimals (6 or 18)
/// @param toDec Destination token decimals (6 or 18)
/// @param bps Slippage tolerance in basis points
function _pegMinOut(
uint256 amountIn,
uint8 fromDec,
uint8 toDec,
uint256 bps
) internal pure returns (uint256) {
uint256 fairQuote;
if (fromDec <= toDec) {
fairQuote = amountIn * 10 ** (toDec - fromDec);
} else {
fairQuote = amountIn / 10 ** (fromDec - toDec);
}
return (fairQuote * (BPS_DENOMINATOR - bps)) / BPS_DENOMINATOR;
}
// ---------- USDC: 1/3 -> DAI (PSM), 1/3 -> LUSD (Curve LUSD), 1/3 -> crvUSD (Curve crvUSD/USDC) ----------
function _zapInUSDC(
uint256 amount,
uint256 slippageBps
) internal returns (uint256[3] memory amounts) {
(uint256 t1, uint256 t2, uint256 t3) = _third(amount);
// 1/3 USDC -> DAI via PSM
uint256 daiBefore = DAI.balanceOf(address(this));
USDC.forceApprove(lightPsm, t1);
ILightPsm(lightPsm).sellGem(address(this), t1);
uint256 daiReceived = DAI.balanceOf(address(this)) - daiBefore;
// 1/3 USDC -> LUSD via Curve
uint256 lusdBefore = LUSD.balanceOf(address(this));
USDC.forceApprove(curveLusdPool, t2);
ICurveLusd(curveLusdPool).exchange_underlying(
2,
0,
t2,
_pegMinOut(t2, 6, 18, slippageBps)
);
uint256 lusdReceived = LUSD.balanceOf(address(this)) - lusdBefore;
// 1/3 USDC -> crvUSD via Curve NG
uint256 crvBefore = CRVUSD.balanceOf(address(this));
USDC.forceApprove(curveCrvUsdUsdc, t3);
ICurveNg(curveCrvUsdUsdc).exchange(
0,
1,
t3,
_pegMinOut(t3, 6, 18, slippageBps)
);
uint256 crvReceived = CRVUSD.balanceOf(address(this)) - crvBefore;
amounts[0] = daiReceived;
amounts[1] = lusdReceived;
amounts[2] = crvReceived;
return amounts;
}
// ---------- USDT: 1/3 -> DAI (3pool), 1/3 -> LUSD (LUSD pool), 1/3 -> crvUSD (crvUSD/USDT) ----------
function _zapInUSDT(
uint256 amount,
uint256 slippageBps
) internal returns (uint256[3] memory amounts) {
(uint256 t1, uint256 t2, uint256 t3) = _third(amount);
// 1/3 USDT -> DAI via 3pool
uint256 daiBefore = DAI.balanceOf(address(this));
USDT.forceApprove(curve3Pool, t1);
ICurve3Pool(curve3Pool).exchange(
2,
0,
t1,
_pegMinOut(t1, 6, 18, slippageBps)
);
uint256 daiReceived = DAI.balanceOf(address(this)) - daiBefore;
// 1/3 USDT -> LUSD via LUSD pool
uint256 lusdBefore = LUSD.balanceOf(address(this));
USDT.forceApprove(curveLusdPool, t2);
ICurveLusd(curveLusdPool).exchange_underlying(
3,
0,
t2,
_pegMinOut(t2, 6, 18, slippageBps)
);
uint256 lusdReceived = LUSD.balanceOf(address(this)) - lusdBefore;
// 1/3 USDT -> crvUSD via crvUSD/USDT pool
uint256 crvBefore = CRVUSD.balanceOf(address(this));
USDT.forceApprove(curveCrvUsdUsdt, t3);
ICurveNg(curveCrvUsdUsdt).exchange(
0,
1,
t3,
_pegMinOut(t3, 6, 18, slippageBps)
);
uint256 crvReceived = CRVUSD.balanceOf(address(this)) - crvBefore;
amounts[0] = daiReceived;
amounts[1] = lusdReceived;
amounts[2] = crvReceived;
return amounts;
}
// ---------- DAI: 1/3 keep, 1/3 -> LUSD (LUSD pool), 1/3 -> USDC (3pool) -> crvUSD ----------
function _zapInDAI(
uint256 amount,
uint256 slippageBps
) internal returns (uint256[3] memory amounts) {
(uint256 t1, uint256 t2, uint256 t3) = _third(amount);
// 1/3 DAI -> LUSD via LUSD pool
uint256 lusdBefore = LUSD.balanceOf(address(this));
DAI.forceApprove(curveLusdPool, t2);
ICurveLusd(curveLusdPool).exchange_underlying(
1,
0,
t2,
_pegMinOut(t2, 18, 18, slippageBps)
);
uint256 lusdReceived = LUSD.balanceOf(address(this)) - lusdBefore;
// 1/3 DAI -> USDC via PSM (1:1, zero fee)
uint256 usdcBefore = USDC.balanceOf(address(this));
uint256 usdcWanted = t3 / 1e12;
DAI.forceApprove(lightPsm, t3);
ILightPsm(lightPsm).buyGem(address(this), usdcWanted);
uint256 usdcReceived = USDC.balanceOf(address(this)) - usdcBefore;
// USDC -> crvUSD via crvUSD/USDC pool
uint256 crvBefore = CRVUSD.balanceOf(address(this));
USDC.forceApprove(curveCrvUsdUsdc, usdcReceived);
ICurveNg(curveCrvUsdUsdc).exchange(
0,
1,
usdcReceived,
_pegMinOut(usdcReceived, 6, 18, slippageBps)
);
uint256 crvReceived = CRVUSD.balanceOf(address(this)) - crvBefore;
amounts[0] = t1; // DAI kept as is
amounts[1] = lusdReceived;
amounts[2] = crvReceived;
return amounts;
}
// ---------- LUSD: 1/3 keep, 1/3 -> DAI (LUSD pool), 1/3 -> USDC (LUSD pool) -> crvUSD ----------
function _zapInLUSD(
uint256 amount,
uint256 slippageBps
) internal returns (uint256[3] memory amounts) {
(uint256 t1, uint256 t2, uint256 t3) = _third(amount);
// 1/3 LUSD -> DAI via LUSD pool
uint256 daiBefore = DAI.balanceOf(address(this));
LUSD.forceApprove(curveLusdPool, t2);
ICurveLusd(curveLusdPool).exchange_underlying(
0,
1,
t2,
_pegMinOut(t2, 18, 18, slippageBps)
);
uint256 daiReceived = DAI.balanceOf(address(this)) - daiBefore;
// 1/3 LUSD -> USDC via LUSD pool
uint256 usdcBefore = USDC.balanceOf(address(this));
LUSD.forceApprove(curveLusdPool, t3);
ICurveLusd(curveLusdPool).exchange_underlying(
0,
2,
t3,
_pegMinOut(t3, 18, 6, slippageBps)
);
uint256 usdcReceived = USDC.balanceOf(address(this)) - usdcBefore;
// USDC -> crvUSD via crvUSD/USDC pool
uint256 crvBefore = CRVUSD.balanceOf(address(this));
USDC.forceApprove(curveCrvUsdUsdc, usdcReceived);
ICurveNg(curveCrvUsdUsdc).exchange(
0,
1,
usdcReceived,
_pegMinOut(usdcReceived, 6, 18, slippageBps)
);
uint256 crvReceived = CRVUSD.balanceOf(address(this)) - crvBefore;
amounts[0] = daiReceived;
amounts[1] = t1; // LUSD kept as is
amounts[2] = crvReceived;
return amounts;
}
// ---------- crvUSD: 1/3 keep, 1/3 -> USDC (crvUSD/USDC) -> DAI (PSM), 1/3 -> USDC -> LUSD ----------
function _zapInCRVUSD(
uint256 amount,
uint256 slippageBps
) internal returns (uint256[3] memory amounts) {
(uint256 t1, uint256 t2, uint256 t3) = _third(amount);
// 1/3 crvUSD -> USDC via crvUSD/USDC pool
uint256 usdcBefore1 = USDC.balanceOf(address(this));
CRVUSD.forceApprove(curveCrvUsdUsdc, t1);
ICurveNg(curveCrvUsdUsdc).exchange(
1,
0,
t1,
_pegMinOut(t1, 18, 6, slippageBps)
);
uint256 usdcForDai = USDC.balanceOf(address(this)) - usdcBefore1;
// USDC -> DAI via PSM
uint256 daiBefore = DAI.balanceOf(address(this));
USDC.forceApprove(lightPsm, usdcForDai);
ILightPsm(lightPsm).sellGem(address(this), usdcForDai);
uint256 daiReceived = DAI.balanceOf(address(this)) - daiBefore;
// 1/3 crvUSD -> USDC via crvUSD/USDC pool
uint256 usdcBefore2 = USDC.balanceOf(address(this));
CRVUSD.forceApprove(curveCrvUsdUsdc, t2);
ICurveNg(curveCrvUsdUsdc).exchange(
1,
0,
t2,
_pegMinOut(t2, 18, 6, slippageBps)
);
uint256 usdcForLusd = USDC.balanceOf(address(this)) - usdcBefore2;
// USDC -> LUSD via LUSD pool
uint256 lusdBefore = LUSD.balanceOf(address(this));
USDC.forceApprove(curveLusdPool, usdcForLusd);
ICurveLusd(curveLusdPool).exchange_underlying(
2,
0,
usdcForLusd,
_pegMinOut(usdcForLusd, 6, 18, slippageBps)
);
uint256 lusdReceived = LUSD.balanceOf(address(this)) - lusdBefore;
amounts[0] = daiReceived;
amounts[1] = lusdReceived;
amounts[2] = t3; // crvUSD kept as is
return amounts;
}
}// SPDX-License-Identifier: MIT
pragma solidity 0.8.27;
/// @title ICurve - Unified Curve Finance interfaces
/// @notice Contains interfaces for all Curve pools used in Stone Vault
interface ILightPsm {
/// @notice Sell gem (USDC/USDT) to receive DAI
/// @param usr Recipient address
/// @param gemAmt Amount of gem tokens to sell
/// @return Amount of DAI received
function sellGem(address usr, uint256 gemAmt) external returns (uint256);
/// @notice Buy gem (USDC/USDT) by paying DAI
/// @param usr Recipient address
/// @param gemAmt Amount of gem tokens to buy
/// @return Amount of DAI paid
function buyGem(address usr, uint256 gemAmt) external returns (uint256);
}
interface ICurve3Pool {
/// @notice Exchange tokens in the 3pool (DAI/USDC/USDT)
/// @param i Index of input token
/// @param j Index of output token
/// @param dx Amount of input token
/// @param min_dy Minimum amount of output token to receive
function exchange(int128 i, int128 j, uint256 dx, uint256 min_dy) external;
/// @notice Get expected output amount for exchange
/// @param i Index of input token
/// @param j Index of output token
/// @param dx Amount of input token
/// @return Expected output amount
function get_dy(
int128 i,
int128 j,
uint256 dx
) external view returns (uint256);
}
interface ICurveLusd {
/// @notice Exchange underlying tokens in LUSD pool
/// @param i Index of input token
/// @param j Index of output token
/// @param dx Amount of input token
/// @param min_dy Minimum amount of output token to receive
/// @return Actual amount received
function exchange_underlying(
int128 i,
int128 j,
uint256 dx,
uint256 min_dy
) external returns (uint256);
/// @notice Get expected output amount for underlying exchange
/// @param i Index of input token
/// @param j Index of output token
/// @param dx Amount of input token
/// @return Expected output amount
function get_dy_underlying(
int128 i,
int128 j,
uint256 dx
) external view returns (uint256);
}
interface ICurveNg {
/// @notice Exchange tokens in Curve NG pools (crvUSD/USDC, crvUSD/USDT)
/// @param i Index of input token
/// @param j Index of output token
/// @param dx Amount of input token
/// @param min_dy Minimum amount of output token to receive
/// @return Actual amount received
function exchange(
int128 i,
int128 j,
uint256 dx,
uint256 min_dy
) external returns (uint256);
/// @notice Get expected output amount for exchange
/// @param i Index of input token
/// @param j Index of output token
/// @param dx Amount of input token
/// @return Expected output amount
function get_dy(
int128 i,
int128 j,
uint256 dx
) external view returns (uint256);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.4.0) (interfaces/IERC1363.sol)
pragma solidity >=0.6.2;
import {IERC20} from "./IERC20.sol";
import {IERC165} from "./IERC165.sol";
/**
* @title IERC1363
* @dev Interface of the ERC-1363 standard as defined in the https://eips.ethereum.org/EIPS/eip-1363[ERC-1363].
*
* Defines an extension interface for ERC-20 tokens that supports executing code on a recipient contract
* after `transfer` or `transferFrom`, or code on a spender contract after `approve`, in a single transaction.
*/
interface IERC1363 is IERC20, IERC165 {
/*
* Note: the ERC-165 identifier for this interface is 0xb0202a11.
* 0xb0202a11 ===
* bytes4(keccak256('transferAndCall(address,uint256)')) ^
* bytes4(keccak256('transferAndCall(address,uint256,bytes)')) ^
* bytes4(keccak256('transferFromAndCall(address,address,uint256)')) ^
* bytes4(keccak256('transferFromAndCall(address,address,uint256,bytes)')) ^
* bytes4(keccak256('approveAndCall(address,uint256)')) ^
* bytes4(keccak256('approveAndCall(address,uint256,bytes)'))
*/
/**
* @dev Moves a `value` amount of tokens from the caller's account to `to`
* and then calls {IERC1363Receiver-onTransferReceived} on `to`.
* @param to The address which you want to transfer to.
* @param value The amount of tokens to be transferred.
* @return A boolean value indicating whether the operation succeeded unless throwing.
*/
function transferAndCall(address to, uint256 value) external returns (bool);
/**
* @dev Moves a `value` amount of tokens from the caller's account to `to`
* and then calls {IERC1363Receiver-onTransferReceived} on `to`.
* @param to The address which you want to transfer to.
* @param value The amount of tokens to be transferred.
* @param data Additional data with no specified format, sent in call to `to`.
* @return A boolean value indicating whether the operation succeeded unless throwing.
*/
function transferAndCall(address to, uint256 value, bytes calldata data) external returns (bool);
/**
* @dev Moves a `value` amount of tokens from `from` to `to` using the allowance mechanism
* and then calls {IERC1363Receiver-onTransferReceived} on `to`.
* @param from The address which you want to send tokens from.
* @param to The address which you want to transfer to.
* @param value The amount of tokens to be transferred.
* @return A boolean value indicating whether the operation succeeded unless throwing.
*/
function transferFromAndCall(address from, address to, uint256 value) external returns (bool);
/**
* @dev Moves a `value` amount of tokens from `from` to `to` using the allowance mechanism
* and then calls {IERC1363Receiver-onTransferReceived} on `to`.
* @param from The address which you want to send tokens from.
* @param to The address which you want to transfer to.
* @param value The amount of tokens to be transferred.
* @param data Additional data with no specified format, sent in call to `to`.
* @return A boolean value indicating whether the operation succeeded unless throwing.
*/
function transferFromAndCall(address from, address to, uint256 value, bytes calldata data) external returns (bool);
/**
* @dev Sets a `value` amount of tokens as the allowance of `spender` over the
* caller's tokens and then calls {IERC1363Spender-onApprovalReceived} on `spender`.
* @param spender The address which will spend the funds.
* @param value The amount of tokens to be spent.
* @return A boolean value indicating whether the operation succeeded unless throwing.
*/
function approveAndCall(address spender, uint256 value) external returns (bool);
/**
* @dev Sets a `value` amount of tokens as the allowance of `spender` over the
* caller's tokens and then calls {IERC1363Spender-onApprovalReceived} on `spender`.
* @param spender The address which will spend the funds.
* @param value The amount of tokens to be spent.
* @param data Additional data with no specified format, sent in call to `spender`.
* @return A boolean value indicating whether the operation succeeded unless throwing.
*/
function approveAndCall(address spender, uint256 value, bytes calldata data) external returns (bool);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)
pragma solidity ^0.8.20;
import {Context} from "../utils/Context.sol";
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* The initial owner is set to the address provided by the deployer. This can
* later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
/**
* @dev The caller account is not authorized to perform an operation.
*/
error OwnableUnauthorizedAccount(address account);
/**
* @dev The owner is not a valid owner account. (eg. `address(0)`)
*/
error OwnableInvalidOwner(address owner);
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the address provided by the deployer as the initial owner.
*/
constructor(address initialOwner) {
if (initialOwner == address(0)) {
revert OwnableInvalidOwner(address(0));
}
_transferOwnership(initialOwner);
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
_checkOwner();
_;
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if the sender is not the owner.
*/
function _checkOwner() internal view virtual {
if (owner() != _msgSender()) {
revert OwnableUnauthorizedAccount(_msgSender());
}
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby disabling any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
if (newOwner == address(0)) {
revert OwnableInvalidOwner(address(0));
}
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (access/Ownable2Step.sol)
pragma solidity ^0.8.20;
import {Ownable} from "./Ownable.sol";
/**
* @dev Contract module which provides access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* This extension of the {Ownable} contract includes a two-step mechanism to transfer
* ownership, where the new owner must call {acceptOwnership} in order to replace the
* old one. This can help prevent common mistakes, such as transfers of ownership to
* incorrect accounts, or to contracts that are unable to interact with the
* permission system.
*
* The initial owner is specified at deployment time in the constructor for `Ownable`. This
* can later be changed with {transferOwnership} and {acceptOwnership}.
*
* This module is used through inheritance. It will make available all functions
* from parent (Ownable).
*/
abstract contract Ownable2Step is Ownable {
address private _pendingOwner;
event OwnershipTransferStarted(address indexed previousOwner, address indexed newOwner);
/**
* @dev Returns the address of the pending owner.
*/
function pendingOwner() public view virtual returns (address) {
return _pendingOwner;
}
/**
* @dev Starts the ownership transfer of the contract to a new account. Replaces the pending transfer if there is one.
* Can only be called by the current owner.
*
* Setting `newOwner` to the zero address is allowed; this can be used to cancel an initiated ownership transfer.
*/
function transferOwnership(address newOwner) public virtual override onlyOwner {
_pendingOwner = newOwner;
emit OwnershipTransferStarted(owner(), newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`) and deletes any pending owner.
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual override {
delete _pendingOwner;
super._transferOwnership(newOwner);
}
/**
* @dev The new owner accepts the ownership transfer.
*/
function acceptOwnership() public virtual {
address sender = _msgSender();
if (pendingOwner() != sender) {
revert OwnableUnauthorizedAccount(sender);
}
_transferOwnership(sender);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.5.0) (utils/ReentrancyGuard.sol)
pragma solidity ^0.8.20;
import {StorageSlot} from "./StorageSlot.sol";
/**
* @dev Contract module that helps prevent reentrant calls to a function.
*
* Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
* available, which can be applied to functions to make sure there are no nested
* (reentrant) calls to them.
*
* Note that because there is a single `nonReentrant` guard, functions marked as
* `nonReentrant` may not call one another. This can be worked around by making
* those functions `private`, and then adding `external` `nonReentrant` entry
* points to them.
*
* TIP: If EIP-1153 (transient storage) is available on the chain you're deploying at,
* consider using {ReentrancyGuardTransient} instead.
*
* TIP: If you would like to learn more about reentrancy and alternative ways
* to protect against it, check out our blog post
* https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
*
* IMPORTANT: Deprecated. This storage-based reentrancy guard will be removed and replaced
* by the {ReentrancyGuardTransient} variant in v6.0.
*
* @custom:stateless
*/
abstract contract ReentrancyGuard {
using StorageSlot for bytes32;
// keccak256(abi.encode(uint256(keccak256("openzeppelin.storage.ReentrancyGuard")) - 1)) & ~bytes32(uint256(0xff))
bytes32 private constant REENTRANCY_GUARD_STORAGE =
0x9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f00;
// Booleans are more expensive than uint256 or any type that takes up a full
// word because each write operation emits an extra SLOAD to first read the
// slot's contents, replace the bits taken up by the boolean, and then write
// back. This is the compiler's defense against contract upgrades and
// pointer aliasing, and it cannot be disabled.
// The values being non-zero value makes deployment a bit more expensive,
// but in exchange the refund on every call to nonReentrant will be lower in
// amount. Since refunds are capped to a percentage of the total
// transaction's gas, it is best to keep them low in cases like this one, to
// increase the likelihood of the full refund coming into effect.
uint256 private constant NOT_ENTERED = 1;
uint256 private constant ENTERED = 2;
/**
* @dev Unauthorized reentrant call.
*/
error ReentrancyGuardReentrantCall();
constructor() {
_reentrancyGuardStorageSlot().getUint256Slot().value = NOT_ENTERED;
}
/**
* @dev Prevents a contract from calling itself, directly or indirectly.
* Calling a `nonReentrant` function from another `nonReentrant`
* function is not supported. It is possible to prevent this from happening
* by making the `nonReentrant` function external, and making it call a
* `private` function that does the actual work.
*/
modifier nonReentrant() {
_nonReentrantBefore();
_;
_nonReentrantAfter();
}
/**
* @dev A `view` only version of {nonReentrant}. Use to block view functions
* from being called, preventing reading from inconsistent contract state.
*
* CAUTION: This is a "view" modifier and does not change the reentrancy
* status. Use it only on view functions. For payable or non-payable functions,
* use the standard {nonReentrant} modifier instead.
*/
modifier nonReentrantView() {
_nonReentrantBeforeView();
_;
}
function _nonReentrantBeforeView() private view {
if (_reentrancyGuardEntered()) {
revert ReentrancyGuardReentrantCall();
}
}
function _nonReentrantBefore() private {
// On the first call to nonReentrant, _status will be NOT_ENTERED
_nonReentrantBeforeView();
// Any calls to nonReentrant after this point will fail
_reentrancyGuardStorageSlot().getUint256Slot().value = ENTERED;
}
function _nonReentrantAfter() private {
// By storing the original value once again, a refund is triggered (see
// https://eips.ethereum.org/EIPS/eip-2200)
_reentrancyGuardStorageSlot().getUint256Slot().value = NOT_ENTERED;
}
/**
* @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a
* `nonReentrant` function in the call stack.
*/
function _reentrancyGuardEntered() internal view returns (bool) {
return _reentrancyGuardStorageSlot().getUint256Slot().value == ENTERED;
}
function _reentrancyGuardStorageSlot() internal pure virtual returns (bytes32) {
return REENTRANCY_GUARD_STORAGE;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.4.0) (interfaces/IERC20.sol)
pragma solidity >=0.4.16;
import {IERC20} from "../token/ERC20/IERC20.sol";// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.4.0) (interfaces/IERC165.sol)
pragma solidity >=0.4.16;
import {IERC165} from "../utils/introspection/IERC165.sol";// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)
pragma solidity ^0.8.20;
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
function _contextSuffixLength() internal view virtual returns (uint256) {
return 0;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (utils/StorageSlot.sol)
// This file was procedurally generated from scripts/generate/templates/StorageSlot.js.
pragma solidity ^0.8.20;
/**
* @dev Library for reading and writing primitive types to specific storage slots.
*
* Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.
* This library helps with reading and writing to such slots without the need for inline assembly.
*
* The functions in this library return Slot structs that contain a `value` member that can be used to read or write.
*
* Example usage to set ERC-1967 implementation slot:
* ```solidity
* contract ERC1967 {
* // Define the slot. Alternatively, use the SlotDerivation library to derive the slot.
* bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;
*
* function _getImplementation() internal view returns (address) {
* return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;
* }
*
* function _setImplementation(address newImplementation) internal {
* require(newImplementation.code.length > 0);
* StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;
* }
* }
* ```
*
* TIP: Consider using this library along with {SlotDerivation}.
*/
library StorageSlot {
struct AddressSlot {
address value;
}
struct BooleanSlot {
bool value;
}
struct Bytes32Slot {
bytes32 value;
}
struct Uint256Slot {
uint256 value;
}
struct Int256Slot {
int256 value;
}
struct StringSlot {
string value;
}
struct BytesSlot {
bytes value;
}
/**
* @dev Returns an `AddressSlot` with member `value` located at `slot`.
*/
function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {
assembly ("memory-safe") {
r.slot := slot
}
}
/**
* @dev Returns a `BooleanSlot` with member `value` located at `slot`.
*/
function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {
assembly ("memory-safe") {
r.slot := slot
}
}
/**
* @dev Returns a `Bytes32Slot` with member `value` located at `slot`.
*/
function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {
assembly ("memory-safe") {
r.slot := slot
}
}
/**
* @dev Returns a `Uint256Slot` with member `value` located at `slot`.
*/
function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {
assembly ("memory-safe") {
r.slot := slot
}
}
/**
* @dev Returns a `Int256Slot` with member `value` located at `slot`.
*/
function getInt256Slot(bytes32 slot) internal pure returns (Int256Slot storage r) {
assembly ("memory-safe") {
r.slot := slot
}
}
/**
* @dev Returns a `StringSlot` with member `value` located at `slot`.
*/
function getStringSlot(bytes32 slot) internal pure returns (StringSlot storage r) {
assembly ("memory-safe") {
r.slot := slot
}
}
/**
* @dev Returns an `StringSlot` representation of the string storage pointer `store`.
*/
function getStringSlot(string storage store) internal pure returns (StringSlot storage r) {
assembly ("memory-safe") {
r.slot := store.slot
}
}
/**
* @dev Returns a `BytesSlot` with member `value` located at `slot`.
*/
function getBytesSlot(bytes32 slot) internal pure returns (BytesSlot storage r) {
assembly ("memory-safe") {
r.slot := slot
}
}
/**
* @dev Returns an `BytesSlot` representation of the bytes storage pointer `store`.
*/
function getBytesSlot(bytes storage store) internal pure returns (BytesSlot storage r) {
assembly ("memory-safe") {
r.slot := store.slot
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.4.0) (utils/introspection/IERC165.sol)
pragma solidity >=0.4.16;
/**
* @dev Interface of the ERC-165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[ERC].
*
* Implementers can declare support of contract interfaces, which can then be
* queried by others ({ERC165Checker}).
*
* For an implementation, see {ERC165}.
*/
interface IERC165 {
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[ERC section]
* to learn more about how these ids are created.
*
* This function call must use less than 30 000 gas.
*/
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}{
"remappings": [
"@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/",
"erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/",
"forge-std/=lib/forge-std/src/",
"halmos-cheatcodes/=lib/openzeppelin-contracts/lib/halmos-cheatcodes/src/",
"openzeppelin-contracts/=lib/openzeppelin-contracts/"
],
"optimizer": {
"enabled": true,
"runs": 200
},
"metadata": {
"useLiteralContent": false,
"bytecodeHash": "ipfs",
"appendCBOR": true
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"evmVersion": "prague",
"viaIR": true
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"address","name":"_vault","type":"address"},{"internalType":"address","name":"_dai","type":"address"},{"internalType":"address","name":"_lusd","type":"address"},{"internalType":"address","name":"_crvusd","type":"address"},{"internalType":"address","name":"_usdc","type":"address"},{"internalType":"address","name":"_usdt","type":"address"},{"internalType":"address","name":"_lightPsm","type":"address"},{"internalType":"address","name":"_curve3Pool","type":"address"},{"internalType":"address","name":"_curveLusdPool","type":"address"},{"internalType":"address","name":"_curveCrvUsdUsdc","type":"address"},{"internalType":"address","name":"_curveCrvUsdUsdt","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"DeadlineExpired","type":"error"},{"inputs":[],"name":"ExcessiveSwapLoss","type":"error"},{"inputs":[],"name":"InvalidInputToken","type":"error"},{"inputs":[],"name":"InvalidPathAmounts","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"OwnableInvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"OwnableUnauthorizedAccount","type":"error"},{"inputs":[],"name":"PathImbalanceTooHigh","type":"error"},{"inputs":[],"name":"ReentrancyGuardReentrantCall","type":"error"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"SafeERC20FailedOperation","type":"error"},{"inputs":[],"name":"SlippageTooHigh","type":"error"},{"inputs":[],"name":"ZeroAddress","type":"error"},{"inputs":[],"name":"ZeroAmount","type":"error"},{"inputs":[],"name":"ZeroReceiver","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferStarted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"address","name":"tokenIn","type":"address"},{"indexed":false,"internalType":"uint256","name":"amountIn","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"sharesOut","type":"uint256"}],"name":"ZapIn","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"address","name":"tokenIn","type":"address"},{"indexed":false,"internalType":"uint256","name":"amountIn","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"sharesOut","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amountDai","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amountLusd","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amountCrvUsd","type":"uint256"}],"name":"ZapInManual","type":"event"},{"inputs":[],"name":"CRVUSD","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DAI","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"LUSD","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"USDC","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"USDT","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"acceptOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"curve3Pool","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"curveCrvUsdUsdc","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"curveCrvUsdUsdt","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"curveLusdPool","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lightPsm","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"sweep","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"vault","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"vaultToken","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"inputToken","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint256","name":"minSharesOut","type":"uint256"},{"internalType":"uint256","name":"slippageBps","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint256","name":"dustThreshold","type":"uint256"}],"name":"zapIn","outputs":[{"internalType":"uint256","name":"sharesOut","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"inputToken","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256[3]","name":"pathAmounts","type":"uint256[3]"},{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint256","name":"minSharesOut","type":"uint256"},{"internalType":"uint256","name":"slippageBps","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint256","name":"dustThreshold","type":"uint256"}],"name":"zapInManual","outputs":[{"internalType":"uint256","name":"sharesOut","type":"uint256"}],"stateMutability":"nonpayable","type":"function"}]Contract Creation Code
0x6102003461047057601f61307a38819003918201601f19168301916001600160401b0383118484101761047457808492610160946040528339810103126104705761004981610488565b61005560208301610488565b61006160408401610488565b9061006e60608501610488565b9161007b60808601610488565b9461008860a08201610488565b9061009560c08201610488565b6100a160e08301610488565b6100ae6101008401610488565b916100c96101406100c26101208701610488565b9501610488565b94331561045d57600180546001600160a01b03199081169091555f805433928116831782556001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09080a360017f9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f00556001600160a01b038a1697881561044e576001600160a01b031696871561044e576001600160a01b031698891561044e576001600160a01b03169a8b1561044e576001600160a01b031690811561044e576001600160a01b031690811561044e576001600160a01b0383161561044e576001600160a01b0384161561044e576001600160a01b0385161561044e576001600160a01b0386161561044e576001600160a01b0387161561044e576102519b6102299a8c9a8b610140526080528960a05260c05260e052610100526101205261016052610180526101a0526101c0526101e05261049c565b60c0516102409082906001600160a01b031661049c565b60e0516001600160a01b031661049c565b604051612a8590816105f5823960805181610321015260a0518181816106fa015281816108ed01528181610ccd01528181610dad015281816111a1015281816115de01528181611a7401528181611cdf01528181612085015281816124ac01528181612565015281816125c1015261277b015260c05181818161073d0152818161086501528181610d0601528181610d7b015281816113700152818161162501528181611a2701528181611e270152818161218e0152818161250901526127d4015260e0518181816102990152818161078201528181610d49015281816110a20152818161181c01528181611f430152818161226a015261282a0152610100518181816105410152818161061701528181610b02015281816110580152818161172001528181611b68015281816120d3015261244f0152610120518181816106b70152818161082101528181610c5d01528181610c8e01528181610ddf0152611d270152610140518181816109cb01526123ba0152610160518181816104b9015281816111eb01528181611bca01526120f50152610180518181816102dd0152611d4901526101a051818181610255015281816113bc0152818161164701528181611a9601528181611e6901526121d001526101c0518181816108a9015281816110c4015261187501526101e0518181816104fd0152611f920152f35b63d92e233d60e01b5f5260045ffd5b631e4fbdf760e01b5f525f60045260245ffd5b5f80fd5b634e487b7160e01b5f52604160045260245ffd5b51906001600160a01b038216820361047057565b60405163095ea7b360e01b5f9081526001600160a01b0384166004525f1960245291929160209060448180875af19060015f51148216156105e5575b604052156104e4575050565b60405163095ea7b360e01b5f9081526001600160a01b038316600452602481905260209060448180875af19060015f51148216156105cd575b604052156105ac5760405163095ea7b360e01b5f9081526001600160a01b039092166004525f196024529060209060448180865af19060015f511482161561058b575b6040521561056b5750565b635274afe760e01b5f9081526001600160a01b0391909116600452602490fd5b9060018115166105a357823b15153d15161690610560565b503d5f823e3d90fd5b50635274afe760e01b5f9081526001600160a01b0391909116600452602490fd5b9060018115166105a357833b15153d1516169061051d565b90833b15153d151616906104d856fe60806040526004361015610011575f80fd5b5f3560e01c806301681a6214610154578063087eb2b41461014f57806316063ec01461014a57806363a6b1da14610145578063703bafd514610140578063715018a61461013b578063732948de1461013657806379ba5097146101315780637a4b1f561461012c578063877705ee1461012757806389a30271146101225780638da5cb5b1461011d57806397ded8e714610118578063c54e44eb14610113578063cf59d5631461010e578063d44bd1e514610109578063e0bab4c414610104578063e30c3978146100ff578063f2fde38b146100fa5763fbfa77cf146100f5575f80fd5b6109b6565b610944565b61091c565b6108d8565b610894565b610850565b61080c565b610597565b610570565b61052c565b6104e8565b6104a4565b61041f565b6103b3565b610350565b61030c565b6102c8565b610284565b610240565b610189565b600435906001600160a01b038216820361016f57565b5f80fd5b604435906001600160a01b038216820361016f57565b3461016f57602036600319011261016f576101a2610159565b6101aa610f08565b6040516370a0823160e01b81523060048201526001600160a01b039190911690602081602481855afa908115610231575f91610202575b50806101e957005b5f54610200926001600160a01b0390911690610f1b565b005b610224915060203d60201161022a575b61021c8183610a0e565b810190610a35565b5f6101e1565b503d610212565b610a44565b5f91031261016f57565b3461016f575f36600319011261016f576040517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b3461016f575f36600319011261016f576040517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b3461016f575f36600319011261016f576040517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b3461016f575f36600319011261016f576040517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b3461016f575f36600319011261016f57610368610f08565b600180546001600160a01b03199081169091555f80549182168155906001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a3005b3461016f5761014036600319011261016f576103cd610159565b602435903660a41161016f5760a435906001600160a01b038216820361016f5761041b9261040b9260c43560e4359161010435936101243595610a4f565b6040519081529081906020820190565b0390f35b3461016f575f36600319011261016f57600154336001600160a01b039091160361049157600180546001600160a01b03199081169091555f805433928116831782556001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09080a3005b63118cdaa760e01b5f523360045260245ffd5b3461016f575f36600319011261016f576040517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b3461016f575f36600319011261016f576040517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b3461016f575f36600319011261016f576040517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b3461016f575f36600319011261016f575f546040516001600160a01b039091168152602090f35b3461016f5760e036600319011261016f576105b0610159565b6024356105bb610173565b606435926084359160c4359160a4356105d2610f98565b42116107fd576101f484116107ee5784156107df576001600160a01b038216156107d0576001600160a01b03169261060c85303387610fd0565b610614610ee5565b507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031684036106b5579061041b9561065861065d94938761259b565b612363565b917fa5df22cab1c918f04c7e14e446f9b60df68c2bb5b808423f4bf055ca7a499fe56040518061069c8633958360209093929193604081019481520152565b0390a361040b60015f516020612a305f395f51905f5255565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031684036106f8579061041b9561065861065d94938761253f565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316840361073b579061041b9561065861065d9493876124e1565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316840361077e579061041b9561065861065d949387612488565b91907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031684036107c15761041b9561065861065d9487612424565b632df9739b60e01b5f5260045ffd5b630d753d9b60e31b5f5260045ffd5b631f2a200560e01b5f5260045ffd5b63428637bb60e11b5f5260045ffd5b631ab7da6b60e01b5f5260045ffd5b3461016f575f36600319011261016f576040517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b3461016f575f36600319011261016f576040517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b3461016f575f36600319011261016f576040517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b3461016f575f36600319011261016f576040517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b3461016f575f36600319011261016f576001546040516001600160a01b039091168152602090f35b3461016f57602036600319011261016f5761095d610159565b610965610f08565b60018060a01b0316806bffffffffffffffffffffffff60a01b600154161760015560018060a01b035f54167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e227005f80a3005b3461016f575f36600319011261016f576040517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b634e487b7160e01b5f52604160045260245ffd5b90601f8019910116810190811067ffffffffffffffff821117610a3057604052565b6109fa565b9081602091031261016f575190565b6040513d5f823e3d90fd5b91909394959295610a5e610f98565b42116107fd576101f485116107ee5783156107df576001600160a01b038116156107d05760643590604435610a938382610e72565b9386610aa26084358097610e72565b03610e4f57610abb610ab388610e84565b612710900490565b610ac7610ab389610e9c565b818410918215610e45575b8215610e3b575b8215610e31575b8215610e27575b508115610e1d575b50610e0e576001600160a01b03908116977f0000000000000000000000000000000000000000000000000000000000000000909116881480159590948587610ddc575b8015610daa575b8015610d78575b8015610d46575b156107c157610b588930338d610fd0565b610b60610ee5565b508515610c8c57610b7093612062565b965b875192610b8560208a0194855190610e72565b94610b9660408b0196875190610e72565b9190610c5a575b15610c4e57610bba610ab3610bb189610eb4565b6126de90610ed2565b11610c3f577f649e353d625729a555d99205d723b5578e04aecddcd98d84560866035cf3153594610c2392610bef928a612363565b965191519251604051938493893398869192608093969594919660a084019784526020840152604083015260608201520152565b0390a390610c3d60015f516020612a305f395f51905f5255565b565b6378f9708160e11b5f5260045ffd5b610bba610ab388610bb1565b507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168814610b9d565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168a03610ccb57610cc593611cbc565b96610b72565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168a03610d0457610cc593611a06565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168a03610d3d57610cc5936115be565b610cc593611037565b507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168a14610b47565b507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168a14610b40565b507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168a14610b39565b507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168a14610b32565b637a8ecfaf60e11b5f5260045ffd5b905085115f610aef565b871091505f610ae7565b8187119250610ae0565b8087109250610ad9565b8185119250610ad2565b63205b07a560e01b5f5260045ffd5b634e487b7160e01b5f52601160045260245ffd5b91908201809211610e7f57565b610e5e565b90610b11820291808304610b111490151715610e7f57565b90610ef9820291808304610ef91490151715610e7f57565b9064e8d4a5100082029180830464e8d4a510001490151715610e7f57565b81810292918115918404141715610e7f57565b60405190610ef4606083610a0e565b6060368337565b91908203918211610e7f57565b5f546001600160a01b0316330361049157565b916040519163a9059cbb60e01b5f5260018060a01b031660045260245260205f60448180865af160015f5114811615610f79575b604091909152155b610f5e5750565b635274afe760e01b5f526001600160a01b031660045260245ffd5b6001811516610f8f573d15833b15151616610f4f565b503d5f823e3d90fd5b60025f516020612a305f395f51905f525414610fc15760025f516020612a305f395f51905f5255565b633ee5aeb560e01b5f5260045ffd5b6040516323b872dd60e01b5f9081526001600160a01b039384166004529290931660245260449390935260209060648180865af160015f5114811615611021575b6040919091525f60605215610f57565b6001811516610f8f573d15833b15151616611011565b61103f610ee5565b6040516370a0823160e01b8152306004820152909490927f0000000000000000000000000000000000000000000000000000000000000000926001600160a01b0384169160208680602481015b0381865afa958615610231575f9661159d575b507f0000000000000000000000000000000000000000000000000000000000000000917f0000000000000000000000000000000000000000000000000000000000000000966110ef8289866125f7565b6001600160a01b0388169161113e9060209061110b89826126b0565b604051630f7c084960e21b8152600160048201525f60248201526044810192909252606482015291829081906084820190565b03815f875af1801561023157611580575b506040516370a0823160e01b815230600482015290602082602481895afa801561023157611184925f91611480575b50610efb565b6040516370a0823160e01b81523060048201526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169190602081602481865afa9182156102315789915f93611556575b5061123b5f92826112116020947f000000000000000000000000000000000000000000000000000000000000000080946125f7565b604051634acc893b60e11b8152306004820152602481019190915293849283919082906044820190565b03926001600160a01b03165af1801561023157611539575b506040516370a0823160e01b815230600482015291602090839060249082905afa80156102315761128a925f916114805750610efb565b6040516370a0823160e01b815230600482015290979093602085602481895afa948515610231575f95611507575b50916112cb8461130d95936020956125f7565b6112d587836126b0565b915f604051809681958294630f7c084960e21b845260048401606090939291936080810194600182525f602083015260408201520152565b03925af18015610231576114ea575b506040516370a0823160e01b815230600482015291602090839060249082905afa801561023157611353925f916114805750610efb565b6040516370a0823160e01b81523060048201526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016939092602084602481885afa938415610231575f946114bc575b50916020916113e8611420946113e2847f000000000000000000000000000000000000000000000000000000000000000080956125f7565b836126d8565b915f604051809681958294635320bf6b60e11b845260048401606090939291936080810194600282525f602083015260408201520152565b03926001600160a01b03165af180156102315761149f575b506040516370a0823160e01b815230600482015291602090839060249082905afa80156102315761146f925f916114805750610efb565b908352602083015b52604082015290565b611499915060203d60201161022a5761021c8183610a0e565b5f61117e565b6114b79060203d60201161022a5761021c8183610a0e565b611438565b61142093919450916113e86114df602094853d871161022a5761021c8183610a0e565b9592945050916113aa565b6115029060203d60201161022a5761021c8183610a0e565b61131c565b6020939195508461130d959361152c6112cb93873d891161022a5761021c8183610a0e565b97939550935094506112b8565b6115519060203d60201161022a5761021c8183610a0e565b611253565b60209193505f9261157661123b92843d861161022a5761021c8183610a0e565b94925092506111dc565b6115989060203d60201161022a5761021c8183610a0e565b61114f565b6115b791965060203d60201161022a5761021c8183610a0e565b945f61109f565b6115c6610ee5565b6040516370a0823160e01b81523060048201529094907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031660208280602481015b0381845afa918215610231575f926119e5575b507f0000000000000000000000000000000000000000000000000000000000000000907f0000000000000000000000000000000000000000000000000000000000000000926116728685856125f7565b6001600160a01b038416956116c19060209061168e8882612704565b604051635320bf6b60e11b81525f6004820152600160248201526044810192909252606482015291829081906084820190565b03815f8b5af18015610231576119c8575b506040516370a0823160e01b815230600482015291602090839060249082905afa801561023157611709925f916114805750610efb565b6040516370a0823160e01b815230600482015290967f0000000000000000000000000000000000000000000000000000000000000000956001600160a01b03871694929391929091602085602481895afa948515610231575f95611996575b509161177b846117bd95936020956125f7565b61178587836126b0565b915f604051809681958294635320bf6b60e11b8452600484016060909392919360808101945f82526002602083015260408201520152565b03925af1801561023157611979575b506040516370a0823160e01b81523060048201529160209083908180602481015b03915afa801561023157611807925f916114805750610efb565b6040516370a0823160e01b81523060048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031693909260208480602481015b0381885afa938415610231575f9461194b575b509160209161189b6118d3946113e2847f000000000000000000000000000000000000000000000000000000000000000080956125f7565b915f604051809681958294630f7c084960e21b8452600484016060909392919360808101945f82526001602083015260408201520152565b03926001600160a01b03165af180156102315761192e575b506040516370a0823160e01b815230600482015291602090839060249082905afa801561023157611922925f916114805750610efb565b91835260208301611477565b6119469060203d60201161022a5761021c8183610a0e565b6118eb565b6118d3939194509161189b61196e602094853d871161022a5761021c8183610a0e565b959294505091611863565b6119919060203d60201161022a5761021c8183610a0e565b6117cc565b602093919550846117bd95936119bb61177b93873d891161022a5761021c8183610a0e565b9793955093509450611768565b6119e09060203d60201161022a5761021c8183610a0e565b6116d2565b6119ff91925060203d60201161022a5761021c8183610a0e565b905f611622565b91611a0f610ee5565b6040516370a0823160e01b81523060048201529094907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169060208180602481015b0381855afa908115610231575f91611c9d575b50611b0260207f0000000000000000000000000000000000000000000000000000000000000000967f0000000000000000000000000000000000000000000000000000000000000000611ac082828b6125f7565b611aca8783612704565b915f604051809681958294635320bf6b60e11b845260048401606090939291936080810194600182525f602083015260408201520152565b03926001600160a01b03165af1801561023157611c80575b506040516370a0823160e01b815230600482015291602090839060249082905afa801561023157611b51925f916114805750610efb565b6040516370a0823160e01b815230600482015290937f0000000000000000000000000000000000000000000000000000000000000000936001600160a01b038516929190602083602481875afa928315610231575f93611c56575b50611c1a5f9282611bf0611bc760209564e8d4a51000900490565b917f000000000000000000000000000000000000000000000000000000000000000080946125f7565b604051638d7ef9bb60e01b8152306004820152602481019190915293849283919082906044820190565b03926001600160a01b03165af180156102315761197957506040516370a0823160e01b81523060048201529160209083908180602481016117ed565b60209193505f92611c76611c1a92843d861161022a5761021c8183610a0e565b9492509250611bac565b611c989060203d60201161022a5761021c8183610a0e565b611b1a565b611cb6915060203d60201161022a5761021c8183610a0e565b5f611a6c565b919091611cc7610ee5565b6040516370a0823160e01b81523060048201529094907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169060208180602481015b0381855afa908115610231575f91612043575b507f0000000000000000000000000000000000000000000000000000000000000000937f0000000000000000000000000000000000000000000000000000000000000000611d738282886125f7565b6001600160a01b031690611d8785826126d8565b823b1561016f57604051630f7c084960e21b8152600260048201525f6024820181905260448201939093526064810191909152918290608490829084905af1801561023157612029575b506040516370a0823160e01b815230600482015291602090839060249082905afa801561023157611e08925f916114805750610efb565b6040516370a0823160e01b815230600482015290946001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169190602082602481865afa918215610231575f92612003575b506020611ed5917f0000000000000000000000000000000000000000000000000000000000000000611e9382828a6125f7565b611e9d87836126d8565b915f604051809681958294635320bf6b60e11b845260048401606090939291936080810194600382525f602083015260408201520152565b03926001600160a01b03165af1801561023157611fe6575b506040516370a0823160e01b815230600482015291602090839060249082905afa801561023157611f24925f916114805750610efb565b6040516370a0823160e01b815230600482015290936001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016939192909190602084602481885afa938415610231575f94611fb8575b509160209161189b6118d3946113e2847f000000000000000000000000000000000000000000000000000000000000000080956125f7565b6118d3939194509161189b611fdb602094853d871161022a5761021c8183610a0e565b959294505091611f80565b611ffe9060203d60201161022a5761021c8183610a0e565b611eed565b611ed5919250612021602091823d841161022a5761021c8183610a0e565b929150611e60565b806120375f61203d93610a0e565b80610236565b5f611dd1565b61205c915060203d60201161022a5761021c8183610a0e565b5f611d24565b91909161206d610ee5565b6040516370a0823160e01b81523060048201529094907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169060208180602481015b0381855afa908115610231575f91612305575b505f60206121207f0000000000000000000000000000000000000000000000000000000000000000967f00000000000000000000000000000000000000000000000000000000000000009061121181838b6125f7565b03926001600160a01b03165af18015610231576122e8575b506040516370a0823160e01b815230600482015291602090839060249082905afa80156102315761216f925f916114805750610efb565b6040516370a0823160e01b815230600482015290946001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169190602082602481865afa918215610231575f926122c2575b506020612204917f00000000000000000000000000000000000000000000000000000000000000006121fa82828a6125f7565b6113e887836126d8565b03926001600160a01b03165af18015610231576122a5575b506040516370a0823160e01b815230600482015291602090839060249082905afa801561023157612253925f916114805750610efb565b6040516370a0823160e01b815230600482015290937f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169391929091906020848060248101611850565b6122bd9060203d60201161022a5761021c8183610a0e565b61221c565b6122049192506122e0602091823d841161022a5761021c8183610a0e565b9291506121c7565b6123009060203d60201161022a5761021c8183610a0e565b612138565b61231e915060203d60201161022a5761021c8183610a0e565b5f6120ca565b3d1561235e573d9067ffffffffffffffff8211610a305760405191612353601f8201601f191660200184610a0e565b82523d5f602084013e565b606090565b6040516318ad8f4960e01b602082019081529394939290915f602484015b6003821061240e5750505060848201526001600160a01b03841660a48083019190915281525f9182916123b560c482610a0e565b5190827f00000000000000000000000000000000000000000000000000000000000000005af16123e3612324565b901561240957906124008260208061240695518301019101610a35565b92612766565b90565b612710565b6020806001928551815201930191019091612381565b90612436612430610ee5565b92612971565b6040516370a0823160e01b8152306004820152909390927f0000000000000000000000000000000000000000000000000000000000000000926001600160a01b0384169190602086806024810161108c565b90612494612430610ee5565b6040516370a0823160e01b81523060048201529093907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316602082806024810161160f565b906124ed612430610ee5565b6040516370a0823160e01b8152306004820152929391929091907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906020818060248101611a59565b9061254b612430610ee5565b6040516370a0823160e01b815230600482015291939092917f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906020818060248101611d11565b906125a7612430610ee5565b6040516370a0823160e01b815230600482015291939092917f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169060208180602481016120b7565b60405163095ea7b360e01b5f9081526001600160a01b03841660045260248590529193929160209060448180885af19060015f51148216156126a1575b6040521561264157505050565b61264b818461298f565b15612683579061265b91836129f4565b156126635750565b635274afe760e01b5f9081526001600160a01b0391909116600452602490fd5b635274afe760e01b5f9081526001600160a01b038416600452602490fd5b90843b15153d15161690612634565b64e8d4a5100090049061271003906127108211610e7f57612710916126d491610ed2565b0490565b6126e89064e8d4a5100090610ed2565b9061271003906127108211610e7f57612710916126d491610ed2565b6126e890600190610ed2565b80519060048210156127615760405162461bcd60e51b815260206004820152601860248201527f5a6170496e3a207661756c742063616c6c206661696c656400000000000000006044820152606490fd5b602001fd5b6040516370a0823160e01b81523060048201527f0000000000000000000000000000000000000000000000000000000000000000929091906020836024816001600160a01b0388165afa928315610231575f93612950575b506040516370a0823160e01b81523060048201527f0000000000000000000000000000000000000000000000000000000000000000906020816024816001600160a01b0386165afa908115610231575f91612931575b506040516370a0823160e01b81523060048201527f00000000000000000000000000000000000000000000000000000000000000009690956020876024816001600160a01b038c165afa968715610231575f97612910575b5085811515806128fe575b6128ed575b915050811515806128db575b6128ca575b50505082151590816128ad575b506128a457505050565b610c3d92610f1b565b8015915081156128bf575b505f61289a565b90508210155f6128b8565b6128d392610f1b565b5f808361288d565b50831580612888575083821015612888565b6128f692610f1b565b5f808561287c565b50851580612877575085821015612877565b61292a91975060203d60201161022a5761021c8183610a0e565b955f61286c565b61294a915060203d60201161022a5761021c8183610a0e565b5f612814565b61296a91935060203d60201161022a5761021c8183610a0e565b915f6127be565b60038104918291838103908111610e7f57838103908111610e7f5790565b60405163095ea7b360e01b5f9081526001600160a01b03909316600452602483905290929160209060448180875af19260015f51148416156129d2575b50604052565b600184929415166129eb573b15153d151616915f6129cc565b833d5f823e3d90fd5b92916040519163095ea7b360e01b5f5260018060a01b031660045260245260205f60448180875af19260015f51148416156129d2575060405256fe9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f00a2646970667358221220d5a21ea08dea802b8c2326a6f1ecd20c11785ef4a146f022dc4d1921e23bbd0064736f6c634300081b0033000000000000000000000000c5c6cb88598203f3652e531dbb1128ff52f386210000000000000000000000006b175474e89094c44da98b954eedeac495271d0f0000000000000000000000005f98805a4e8be255a32880fdec7f6728c6568ba0000000000000000000000000f939e0a03fb07f59a73314e73794be0e57ac1b4e000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec7000000000000000000000000f6e72db5454dd049d0788e411b06cfaf16853042000000000000000000000000bebc44782c7db0a1a60cb6fe97d0b483032ff1c7000000000000000000000000ed279fdd11ca84beef15af5d39bb4d4bee23f0ca0000000000000000000000004dece678ceceb27446b35c672dc7d61f30bad69e000000000000000000000000390f3595bca2df7d23783dfd126427cceb997bf4
Deployed Bytecode
0x60806040526004361015610011575f80fd5b5f3560e01c806301681a6214610154578063087eb2b41461014f57806316063ec01461014a57806363a6b1da14610145578063703bafd514610140578063715018a61461013b578063732948de1461013657806379ba5097146101315780637a4b1f561461012c578063877705ee1461012757806389a30271146101225780638da5cb5b1461011d57806397ded8e714610118578063c54e44eb14610113578063cf59d5631461010e578063d44bd1e514610109578063e0bab4c414610104578063e30c3978146100ff578063f2fde38b146100fa5763fbfa77cf146100f5575f80fd5b6109b6565b610944565b61091c565b6108d8565b610894565b610850565b61080c565b610597565b610570565b61052c565b6104e8565b6104a4565b61041f565b6103b3565b610350565b61030c565b6102c8565b610284565b610240565b610189565b600435906001600160a01b038216820361016f57565b5f80fd5b604435906001600160a01b038216820361016f57565b3461016f57602036600319011261016f576101a2610159565b6101aa610f08565b6040516370a0823160e01b81523060048201526001600160a01b039190911690602081602481855afa908115610231575f91610202575b50806101e957005b5f54610200926001600160a01b0390911690610f1b565b005b610224915060203d60201161022a575b61021c8183610a0e565b810190610a35565b5f6101e1565b503d610212565b610a44565b5f91031261016f57565b3461016f575f36600319011261016f576040517f000000000000000000000000ed279fdd11ca84beef15af5d39bb4d4bee23f0ca6001600160a01b03168152602090f35b3461016f575f36600319011261016f576040517f000000000000000000000000f939e0a03fb07f59a73314e73794be0e57ac1b4e6001600160a01b03168152602090f35b3461016f575f36600319011261016f576040517f000000000000000000000000bebc44782c7db0a1a60cb6fe97d0b483032ff1c76001600160a01b03168152602090f35b3461016f575f36600319011261016f576040517f000000000000000000000000c5c6cb88598203f3652e531dbb1128ff52f386216001600160a01b03168152602090f35b3461016f575f36600319011261016f57610368610f08565b600180546001600160a01b03199081169091555f80549182168155906001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a3005b3461016f5761014036600319011261016f576103cd610159565b602435903660a41161016f5760a435906001600160a01b038216820361016f5761041b9261040b9260c43560e4359161010435936101243595610a4f565b6040519081529081906020820190565b0390f35b3461016f575f36600319011261016f57600154336001600160a01b039091160361049157600180546001600160a01b03199081169091555f805433928116831782556001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09080a3005b63118cdaa760e01b5f523360045260245ffd5b3461016f575f36600319011261016f576040517f000000000000000000000000f6e72db5454dd049d0788e411b06cfaf168530426001600160a01b03168152602090f35b3461016f575f36600319011261016f576040517f000000000000000000000000390f3595bca2df7d23783dfd126427cceb997bf46001600160a01b03168152602090f35b3461016f575f36600319011261016f576040517f000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb486001600160a01b03168152602090f35b3461016f575f36600319011261016f575f546040516001600160a01b039091168152602090f35b3461016f5760e036600319011261016f576105b0610159565b6024356105bb610173565b606435926084359160c4359160a4356105d2610f98565b42116107fd576101f484116107ee5784156107df576001600160a01b038216156107d0576001600160a01b03169261060c85303387610fd0565b610614610ee5565b507f000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb486001600160a01b031684036106b5579061041b9561065861065d94938761259b565b612363565b917fa5df22cab1c918f04c7e14e446f9b60df68c2bb5b808423f4bf055ca7a499fe56040518061069c8633958360209093929193604081019481520152565b0390a361040b60015f516020612a305f395f51905f5255565b7f000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec76001600160a01b031684036106f8579061041b9561065861065d94938761253f565b7f0000000000000000000000006b175474e89094c44da98b954eedeac495271d0f6001600160a01b0316840361073b579061041b9561065861065d9493876124e1565b7f0000000000000000000000005f98805a4e8be255a32880fdec7f6728c6568ba06001600160a01b0316840361077e579061041b9561065861065d949387612488565b91907f000000000000000000000000f939e0a03fb07f59a73314e73794be0e57ac1b4e6001600160a01b031684036107c15761041b9561065861065d9487612424565b632df9739b60e01b5f5260045ffd5b630d753d9b60e31b5f5260045ffd5b631f2a200560e01b5f5260045ffd5b63428637bb60e11b5f5260045ffd5b631ab7da6b60e01b5f5260045ffd5b3461016f575f36600319011261016f576040517f000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec76001600160a01b03168152602090f35b3461016f575f36600319011261016f576040517f0000000000000000000000005f98805a4e8be255a32880fdec7f6728c6568ba06001600160a01b03168152602090f35b3461016f575f36600319011261016f576040517f0000000000000000000000004dece678ceceb27446b35c672dc7d61f30bad69e6001600160a01b03168152602090f35b3461016f575f36600319011261016f576040517f0000000000000000000000006b175474e89094c44da98b954eedeac495271d0f6001600160a01b03168152602090f35b3461016f575f36600319011261016f576001546040516001600160a01b039091168152602090f35b3461016f57602036600319011261016f5761095d610159565b610965610f08565b60018060a01b0316806bffffffffffffffffffffffff60a01b600154161760015560018060a01b035f54167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e227005f80a3005b3461016f575f36600319011261016f576040517f000000000000000000000000c5c6cb88598203f3652e531dbb1128ff52f386216001600160a01b03168152602090f35b634e487b7160e01b5f52604160045260245ffd5b90601f8019910116810190811067ffffffffffffffff821117610a3057604052565b6109fa565b9081602091031261016f575190565b6040513d5f823e3d90fd5b91909394959295610a5e610f98565b42116107fd576101f485116107ee5783156107df576001600160a01b038116156107d05760643590604435610a938382610e72565b9386610aa26084358097610e72565b03610e4f57610abb610ab388610e84565b612710900490565b610ac7610ab389610e9c565b818410918215610e45575b8215610e3b575b8215610e31575b8215610e27575b508115610e1d575b50610e0e576001600160a01b03908116977f000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48909116881480159590948587610ddc575b8015610daa575b8015610d78575b8015610d46575b156107c157610b588930338d610fd0565b610b60610ee5565b508515610c8c57610b7093612062565b965b875192610b8560208a0194855190610e72565b94610b9660408b0196875190610e72565b9190610c5a575b15610c4e57610bba610ab3610bb189610eb4565b6126de90610ed2565b11610c3f577f649e353d625729a555d99205d723b5578e04aecddcd98d84560866035cf3153594610c2392610bef928a612363565b965191519251604051938493893398869192608093969594919660a084019784526020840152604083015260608201520152565b0390a390610c3d60015f516020612a305f395f51905f5255565b565b6378f9708160e11b5f5260045ffd5b610bba610ab388610bb1565b507f000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec76001600160a01b03168814610b9d565b7f000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec76001600160a01b03168a03610ccb57610cc593611cbc565b96610b72565b7f0000000000000000000000006b175474e89094c44da98b954eedeac495271d0f6001600160a01b03168a03610d0457610cc593611a06565b7f0000000000000000000000005f98805a4e8be255a32880fdec7f6728c6568ba06001600160a01b03168a03610d3d57610cc5936115be565b610cc593611037565b507f000000000000000000000000f939e0a03fb07f59a73314e73794be0e57ac1b4e6001600160a01b03168a14610b47565b507f0000000000000000000000005f98805a4e8be255a32880fdec7f6728c6568ba06001600160a01b03168a14610b40565b507f0000000000000000000000006b175474e89094c44da98b954eedeac495271d0f6001600160a01b03168a14610b39565b507f000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec76001600160a01b03168a14610b32565b637a8ecfaf60e11b5f5260045ffd5b905085115f610aef565b871091505f610ae7565b8187119250610ae0565b8087109250610ad9565b8185119250610ad2565b63205b07a560e01b5f5260045ffd5b634e487b7160e01b5f52601160045260245ffd5b91908201809211610e7f57565b610e5e565b90610b11820291808304610b111490151715610e7f57565b90610ef9820291808304610ef91490151715610e7f57565b9064e8d4a5100082029180830464e8d4a510001490151715610e7f57565b81810292918115918404141715610e7f57565b60405190610ef4606083610a0e565b6060368337565b91908203918211610e7f57565b5f546001600160a01b0316330361049157565b916040519163a9059cbb60e01b5f5260018060a01b031660045260245260205f60448180865af160015f5114811615610f79575b604091909152155b610f5e5750565b635274afe760e01b5f526001600160a01b031660045260245ffd5b6001811516610f8f573d15833b15151616610f4f565b503d5f823e3d90fd5b60025f516020612a305f395f51905f525414610fc15760025f516020612a305f395f51905f5255565b633ee5aeb560e01b5f5260045ffd5b6040516323b872dd60e01b5f9081526001600160a01b039384166004529290931660245260449390935260209060648180865af160015f5114811615611021575b6040919091525f60605215610f57565b6001811516610f8f573d15833b15151616611011565b61103f610ee5565b6040516370a0823160e01b8152306004820152909490927f000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48926001600160a01b0384169160208680602481015b0381865afa958615610231575f9661159d575b507f000000000000000000000000f939e0a03fb07f59a73314e73794be0e57ac1b4e917f0000000000000000000000004dece678ceceb27446b35c672dc7d61f30bad69e966110ef8289866125f7565b6001600160a01b0388169161113e9060209061110b89826126b0565b604051630f7c084960e21b8152600160048201525f60248201526044810192909252606482015291829081906084820190565b03815f875af1801561023157611580575b506040516370a0823160e01b815230600482015290602082602481895afa801561023157611184925f91611480575b50610efb565b6040516370a0823160e01b81523060048201526001600160a01b037f0000000000000000000000006b175474e89094c44da98b954eedeac495271d0f169190602081602481865afa9182156102315789915f93611556575b5061123b5f92826112116020947f000000000000000000000000f6e72db5454dd049d0788e411b06cfaf1685304280946125f7565b604051634acc893b60e11b8152306004820152602481019190915293849283919082906044820190565b03926001600160a01b03165af1801561023157611539575b506040516370a0823160e01b815230600482015291602090839060249082905afa80156102315761128a925f916114805750610efb565b6040516370a0823160e01b815230600482015290979093602085602481895afa948515610231575f95611507575b50916112cb8461130d95936020956125f7565b6112d587836126b0565b915f604051809681958294630f7c084960e21b845260048401606090939291936080810194600182525f602083015260408201520152565b03925af18015610231576114ea575b506040516370a0823160e01b815230600482015291602090839060249082905afa801561023157611353925f916114805750610efb565b6040516370a0823160e01b81523060048201526001600160a01b037f0000000000000000000000005f98805a4e8be255a32880fdec7f6728c6568ba016939092602084602481885afa938415610231575f946114bc575b50916020916113e8611420946113e2847f000000000000000000000000ed279fdd11ca84beef15af5d39bb4d4bee23f0ca80956125f7565b836126d8565b915f604051809681958294635320bf6b60e11b845260048401606090939291936080810194600282525f602083015260408201520152565b03926001600160a01b03165af180156102315761149f575b506040516370a0823160e01b815230600482015291602090839060249082905afa80156102315761146f925f916114805750610efb565b908352602083015b52604082015290565b611499915060203d60201161022a5761021c8183610a0e565b5f61117e565b6114b79060203d60201161022a5761021c8183610a0e565b611438565b61142093919450916113e86114df602094853d871161022a5761021c8183610a0e565b9592945050916113aa565b6115029060203d60201161022a5761021c8183610a0e565b61131c565b6020939195508461130d959361152c6112cb93873d891161022a5761021c8183610a0e565b97939550935094506112b8565b6115519060203d60201161022a5761021c8183610a0e565b611253565b60209193505f9261157661123b92843d861161022a5761021c8183610a0e565b94925092506111dc565b6115989060203d60201161022a5761021c8183610a0e565b61114f565b6115b791965060203d60201161022a5761021c8183610a0e565b945f61109f565b6115c6610ee5565b6040516370a0823160e01b81523060048201529094907f0000000000000000000000006b175474e89094c44da98b954eedeac495271d0f6001600160a01b031660208280602481015b0381845afa918215610231575f926119e5575b507f0000000000000000000000005f98805a4e8be255a32880fdec7f6728c6568ba0907f000000000000000000000000ed279fdd11ca84beef15af5d39bb4d4bee23f0ca926116728685856125f7565b6001600160a01b038416956116c19060209061168e8882612704565b604051635320bf6b60e11b81525f6004820152600160248201526044810192909252606482015291829081906084820190565b03815f8b5af18015610231576119c8575b506040516370a0823160e01b815230600482015291602090839060249082905afa801561023157611709925f916114805750610efb565b6040516370a0823160e01b815230600482015290967f000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48956001600160a01b03871694929391929091602085602481895afa948515610231575f95611996575b509161177b846117bd95936020956125f7565b61178587836126b0565b915f604051809681958294635320bf6b60e11b8452600484016060909392919360808101945f82526002602083015260408201520152565b03925af1801561023157611979575b506040516370a0823160e01b81523060048201529160209083908180602481015b03915afa801561023157611807925f916114805750610efb565b6040516370a0823160e01b81523060048201527f000000000000000000000000f939e0a03fb07f59a73314e73794be0e57ac1b4e6001600160a01b031693909260208480602481015b0381885afa938415610231575f9461194b575b509160209161189b6118d3946113e2847f0000000000000000000000004dece678ceceb27446b35c672dc7d61f30bad69e80956125f7565b915f604051809681958294630f7c084960e21b8452600484016060909392919360808101945f82526001602083015260408201520152565b03926001600160a01b03165af180156102315761192e575b506040516370a0823160e01b815230600482015291602090839060249082905afa801561023157611922925f916114805750610efb565b91835260208301611477565b6119469060203d60201161022a5761021c8183610a0e565b6118eb565b6118d3939194509161189b61196e602094853d871161022a5761021c8183610a0e565b959294505091611863565b6119919060203d60201161022a5761021c8183610a0e565b6117cc565b602093919550846117bd95936119bb61177b93873d891161022a5761021c8183610a0e565b9793955093509450611768565b6119e09060203d60201161022a5761021c8183610a0e565b6116d2565b6119ff91925060203d60201161022a5761021c8183610a0e565b905f611622565b91611a0f610ee5565b6040516370a0823160e01b81523060048201529094907f0000000000000000000000005f98805a4e8be255a32880fdec7f6728c6568ba06001600160a01b03169060208180602481015b0381855afa908115610231575f91611c9d575b50611b0260207f0000000000000000000000006b175474e89094c44da98b954eedeac495271d0f967f000000000000000000000000ed279fdd11ca84beef15af5d39bb4d4bee23f0ca611ac082828b6125f7565b611aca8783612704565b915f604051809681958294635320bf6b60e11b845260048401606090939291936080810194600182525f602083015260408201520152565b03926001600160a01b03165af1801561023157611c80575b506040516370a0823160e01b815230600482015291602090839060249082905afa801561023157611b51925f916114805750610efb565b6040516370a0823160e01b815230600482015290937f000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48936001600160a01b038516929190602083602481875afa928315610231575f93611c56575b50611c1a5f9282611bf0611bc760209564e8d4a51000900490565b917f000000000000000000000000f6e72db5454dd049d0788e411b06cfaf1685304280946125f7565b604051638d7ef9bb60e01b8152306004820152602481019190915293849283919082906044820190565b03926001600160a01b03165af180156102315761197957506040516370a0823160e01b81523060048201529160209083908180602481016117ed565b60209193505f92611c76611c1a92843d861161022a5761021c8183610a0e565b9492509250611bac565b611c989060203d60201161022a5761021c8183610a0e565b611b1a565b611cb6915060203d60201161022a5761021c8183610a0e565b5f611a6c565b919091611cc7610ee5565b6040516370a0823160e01b81523060048201529094907f0000000000000000000000006b175474e89094c44da98b954eedeac495271d0f6001600160a01b03169060208180602481015b0381855afa908115610231575f91612043575b507f000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec7937f000000000000000000000000bebc44782c7db0a1a60cb6fe97d0b483032ff1c7611d738282886125f7565b6001600160a01b031690611d8785826126d8565b823b1561016f57604051630f7c084960e21b8152600260048201525f6024820181905260448201939093526064810191909152918290608490829084905af1801561023157612029575b506040516370a0823160e01b815230600482015291602090839060249082905afa801561023157611e08925f916114805750610efb565b6040516370a0823160e01b815230600482015290946001600160a01b037f0000000000000000000000005f98805a4e8be255a32880fdec7f6728c6568ba0169190602082602481865afa918215610231575f92612003575b506020611ed5917f000000000000000000000000ed279fdd11ca84beef15af5d39bb4d4bee23f0ca611e9382828a6125f7565b611e9d87836126d8565b915f604051809681958294635320bf6b60e11b845260048401606090939291936080810194600382525f602083015260408201520152565b03926001600160a01b03165af1801561023157611fe6575b506040516370a0823160e01b815230600482015291602090839060249082905afa801561023157611f24925f916114805750610efb565b6040516370a0823160e01b815230600482015290936001600160a01b037f000000000000000000000000f939e0a03fb07f59a73314e73794be0e57ac1b4e16939192909190602084602481885afa938415610231575f94611fb8575b509160209161189b6118d3946113e2847f000000000000000000000000390f3595bca2df7d23783dfd126427cceb997bf480956125f7565b6118d3939194509161189b611fdb602094853d871161022a5761021c8183610a0e565b959294505091611f80565b611ffe9060203d60201161022a5761021c8183610a0e565b611eed565b611ed5919250612021602091823d841161022a5761021c8183610a0e565b929150611e60565b806120375f61203d93610a0e565b80610236565b5f611dd1565b61205c915060203d60201161022a5761021c8183610a0e565b5f611d24565b91909161206d610ee5565b6040516370a0823160e01b81523060048201529094907f0000000000000000000000006b175474e89094c44da98b954eedeac495271d0f6001600160a01b03169060208180602481015b0381855afa908115610231575f91612305575b505f60206121207f000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48967f000000000000000000000000f6e72db5454dd049d0788e411b06cfaf168530429061121181838b6125f7565b03926001600160a01b03165af18015610231576122e8575b506040516370a0823160e01b815230600482015291602090839060249082905afa80156102315761216f925f916114805750610efb565b6040516370a0823160e01b815230600482015290946001600160a01b037f0000000000000000000000005f98805a4e8be255a32880fdec7f6728c6568ba0169190602082602481865afa918215610231575f926122c2575b506020612204917f000000000000000000000000ed279fdd11ca84beef15af5d39bb4d4bee23f0ca6121fa82828a6125f7565b6113e887836126d8565b03926001600160a01b03165af18015610231576122a5575b506040516370a0823160e01b815230600482015291602090839060249082905afa801561023157612253925f916114805750610efb565b6040516370a0823160e01b815230600482015290937f000000000000000000000000f939e0a03fb07f59a73314e73794be0e57ac1b4e6001600160a01b03169391929091906020848060248101611850565b6122bd9060203d60201161022a5761021c8183610a0e565b61221c565b6122049192506122e0602091823d841161022a5761021c8183610a0e565b9291506121c7565b6123009060203d60201161022a5761021c8183610a0e565b612138565b61231e915060203d60201161022a5761021c8183610a0e565b5f6120ca565b3d1561235e573d9067ffffffffffffffff8211610a305760405191612353601f8201601f191660200184610a0e565b82523d5f602084013e565b606090565b6040516318ad8f4960e01b602082019081529394939290915f602484015b6003821061240e5750505060848201526001600160a01b03841660a48083019190915281525f9182916123b560c482610a0e565b5190827f000000000000000000000000c5c6cb88598203f3652e531dbb1128ff52f386215af16123e3612324565b901561240957906124008260208061240695518301019101610a35565b92612766565b90565b612710565b6020806001928551815201930191019091612381565b90612436612430610ee5565b92612971565b6040516370a0823160e01b8152306004820152909390927f000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48926001600160a01b0384169190602086806024810161108c565b90612494612430610ee5565b6040516370a0823160e01b81523060048201529093907f0000000000000000000000006b175474e89094c44da98b954eedeac495271d0f6001600160a01b0316602082806024810161160f565b906124ed612430610ee5565b6040516370a0823160e01b8152306004820152929391929091907f0000000000000000000000005f98805a4e8be255a32880fdec7f6728c6568ba06001600160a01b0316906020818060248101611a59565b9061254b612430610ee5565b6040516370a0823160e01b815230600482015291939092917f0000000000000000000000006b175474e89094c44da98b954eedeac495271d0f6001600160a01b0316906020818060248101611d11565b906125a7612430610ee5565b6040516370a0823160e01b815230600482015291939092917f0000000000000000000000006b175474e89094c44da98b954eedeac495271d0f6001600160a01b03169060208180602481016120b7565b60405163095ea7b360e01b5f9081526001600160a01b03841660045260248590529193929160209060448180885af19060015f51148216156126a1575b6040521561264157505050565b61264b818461298f565b15612683579061265b91836129f4565b156126635750565b635274afe760e01b5f9081526001600160a01b0391909116600452602490fd5b635274afe760e01b5f9081526001600160a01b038416600452602490fd5b90843b15153d15161690612634565b64e8d4a5100090049061271003906127108211610e7f57612710916126d491610ed2565b0490565b6126e89064e8d4a5100090610ed2565b9061271003906127108211610e7f57612710916126d491610ed2565b6126e890600190610ed2565b80519060048210156127615760405162461bcd60e51b815260206004820152601860248201527f5a6170496e3a207661756c742063616c6c206661696c656400000000000000006044820152606490fd5b602001fd5b6040516370a0823160e01b81523060048201527f0000000000000000000000006b175474e89094c44da98b954eedeac495271d0f929091906020836024816001600160a01b0388165afa928315610231575f93612950575b506040516370a0823160e01b81523060048201527f0000000000000000000000005f98805a4e8be255a32880fdec7f6728c6568ba0906020816024816001600160a01b0386165afa908115610231575f91612931575b506040516370a0823160e01b81523060048201527f000000000000000000000000f939e0a03fb07f59a73314e73794be0e57ac1b4e9690956020876024816001600160a01b038c165afa968715610231575f97612910575b5085811515806128fe575b6128ed575b915050811515806128db575b6128ca575b50505082151590816128ad575b506128a457505050565b610c3d92610f1b565b8015915081156128bf575b505f61289a565b90508210155f6128b8565b6128d392610f1b565b5f808361288d565b50831580612888575083821015612888565b6128f692610f1b565b5f808561287c565b50851580612877575085821015612877565b61292a91975060203d60201161022a5761021c8183610a0e565b955f61286c565b61294a915060203d60201161022a5761021c8183610a0e565b5f612814565b61296a91935060203d60201161022a5761021c8183610a0e565b915f6127be565b60038104918291838103908111610e7f57838103908111610e7f5790565b60405163095ea7b360e01b5f9081526001600160a01b03909316600452602483905290929160209060448180875af19260015f51148416156129d2575b50604052565b600184929415166129eb573b15153d151616915f6129cc565b833d5f823e3d90fd5b92916040519163095ea7b360e01b5f5260018060a01b031660045260245260205f60448180875af19260015f51148416156129d2575060405256fe9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f00a2646970667358221220d5a21ea08dea802b8c2326a6f1ecd20c11785ef4a146f022dc4d1921e23bbd0064736f6c634300081b0033
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.