Spend less on fees, more on crypto. Buy crypto easily with MoonPay Balance. 20M+ users trust MoonPay worldwide.
Ready to onboard to Ethereum? With MetaMask Portfolio, you're in control.
Don’t invest unless you’re prepared to lose all the money you invest.
Ready to simplify your web3 experience? Try the all-in-one web3 app trusted by millions worldwide.
MetaMask is the most powerful and convenient way to swap tokens directly in your wallet.
Everyday giveaways up to 100 ETH, Lucky Spins. Deposit BONUS 300% and Cashbacks!
5000+ Slots & Live Casino Games, 50+cryptos. Register with Etherscan and get 760% deposit bonus. Win Big$, withdraw it fast.
Slots, Roulette, Poker & more - Proud sponsors of UFC, Everton & StakeF1 team!
5000+ Slots & Live Casino Games, 50+cryptos. Register with Etherscan and get 760% deposit bonus. Win Big$, withdraw it fast.
Anonymous play on awesome games - sign up now for 25 free jackpot spins - worth $100s!
100s of games, generous bonuses, 20+ years of trusted gaming. Join CryptoWins & start winning today!
Overview
ETH Balance
Eth Value
$0.00Token Holdings
Could not find any matches!
- ERC-20 Tokens (15)30,704.029216 USDCUSDC (USDC)$30,686.07@0.99943.40113619 WBTCWrapped BTC (WBTC)$348,130.10@102,357.002,500 $ Evmosia.comERC-20: $ E... ($ Evm...)4.75ERC20 ***1.2 TokenERC-20 TOKEN*[Suspicious]3,999.99 TokenERC-20 TOKEN*[Suspicious]3,999.99 TokenERC-20 TOKEN*[Suspicious]0.7 TokenERC-20 TOKEN*[Suspicious]100,000 TokenERC-20 TOKEN*[Suspicious]7,000 TokenERC-20 TOKEN*[Suspicious]98,127 TokenERC-20 TOKEN*[Suspicious]7,000 TokenERC-20 TOKEN*[Unsafe]7,000 TokenERC-20 TOKEN*[Spam]50,000 TokenERC-20 TOKEN*[Spam]50,000 TokenERC-20 TOKEN*[Spam]NFT Tokens (15)claim rewards on apyusd.netapyusd.netERC-1155claim rewards on wbtcnetwork.netwbtcnetwork.netERC-1155Let's Go!🎁ERC-1155ERC-1155 TOKEN*[Suspicious]ERC-1155 TOKEN*[Suspicious]ERC-1155 TOKEN*[Suspicious]ERC-1155 TOKEN*[Suspicious]
More Info
Private Name Tags
ContractCreator
TokenTracker
- Transactions
- Internal Transactions
- Token Transfers (ERC-20)
- NFT Transfers
- Contract
- Events
- Analytics
- Multichain Portfolio
- Cards New
- Info
Advanced Filter- Filter by Tx Type:
- Tx
- Internal Tx
- ERC-20
- NFTs
Latest 25 from a total of 418 transactions
Transaction Hash MethodBlockFromToApprove 21409678 2024-12-15 18:22:59 3 hrs ago 1734286979 IN 0 ETH$0.00 0.00046531 9.99807043 Approve 21409663 2024-12-15 18:19:59 3 hrs ago 1734286799 IN 0 ETH$0.00 0.00030282 10.28606477 Approve 21409627 2024-12-15 18:12:47 3 hrs ago 1734286367 IN 0 ETH$0.00 0.00050144 10.77449964 Approve 21409609 2024-12-15 18:09:11 3 hrs ago 1734286151 IN 0 ETH$0.00 0.00028089 10.6641979 Approve 21393946 2024-12-13 13:39:47 2 days ago 1734097187 IN 0 ETH$0.00 0.00079314 17.04228734 Approve 21377779 2024-12-11 7:28:35 4 days ago 1733902115 IN 0 ETH$0.00 0.00055138 11.92137381 Approve 21357507 2024-12-08 11:35:11 7 days ago 1733657711 IN 0 ETH$0.00 0.00033849 7.31858048 Approve 21357412 2024-12-08 11:15:59 7 days ago 1733656559 IN 0 ETH$0.00 0.00037283 8.01111022 Approve 21347241 2024-12-07 1:09:35 8 days ago 1733533775 IN 0 ETH$0.00 0.00073118 15.71085756 Approve 21346258 2024-12-06 21:51:23 9 days ago 1733521883 IN 0 ETH$0.00 0.00114089 24.67339926 Approve 21346247 2024-12-06 21:49:11 9 days ago 1733521751 IN 0 ETH$0.00 0.00129783 28.06746622 Approve 21335825 2024-12-05 10:53:47 10 days ago 1733396027 IN 0 ETH$0.00 0.00099107 21.29507655 Approve 21335097 2024-12-05 8:27:23 10 days ago 1733387243 IN 0 ETH$0.00 0.00080732 17.34695648 Approve 21333459 2024-12-05 2:57:47 10 days ago 1733367467 IN 0 ETH$0.00 0.00056813 21.56919085 Approve 21333453 2024-12-05 2:56:35 10 days ago 1733367395 IN 0 ETH$0.00 0.00101512 21.9534472 Approve 21314513 2024-12-02 11:25:23 13 days ago 1733138723 IN 0 ETH$0.00 0.0007575 16.37785455 Approve 21314508 2024-12-02 11:24:11 13 days ago 1733138651 IN 0 ETH$0.00 0.00042055 16.01744092 Approve 21312718 2024-12-02 5:24:23 13 days ago 1733117063 IN 0 ETH$0.00 0.00057041 12.25634454 Approve 21310520 2024-12-01 22:02:23 14 days ago 1733090543 IN 0 ETH$0.00 0.00099111 21.32357253 Approve 21306331 2024-12-01 8:01:23 14 days ago 1733040083 IN 0 ETH$0.00 0.00047815 10.27398032 Approve 21303325 2024-11-30 21:57:59 15 days ago 1733003879 IN 0 ETH$0.00 0.00059217 12.7240678 Approve 21290460 2024-11-29 2:45:47 16 days ago 1732848347 IN 0 ETH$0.00 0.00031973 6.87015265 Approve 21286923 2024-11-28 14:54:47 17 days ago 1732805687 IN 0 ETH$0.00 0.0006647 14.28255148 Approve 21284766 2024-11-28 7:40:23 17 days ago 1732779623 IN 0 ETH$0.00 0.0003652 7.84713032 Approve 21279788 2024-11-27 14:48:35 18 days ago 1732718915 IN 0 ETH$0.00 0.00092182 19.80723735 Latest 1 internal transaction
Advanced mode:Parent Transaction Hash Block FromTo15695364 2022-10-07 9:34:59 800 days ago 1665135299 Contract Creation 0 ETH$0.00 Loading...LoadingContract Name:Dynaset
Compiler Versionv0.8.15+commit.e14f2714
Optimization Enabled:Yes with 200 runs
Other Settings:default evmVersionContract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: GPL-3.0 pragma solidity 0.8.15; import "./libs/OneInchSwapValidation.sol"; import "./interfaces/IUniswapV2Router.sol"; import "./interfaces/OneInchAggregator.sol"; import "./AbstractDynaset.sol"; contract Dynaset is AbstractDynaset { using SafeERC20 for IERC20; using OneInchSwapValidation for address; /* ========== Constants ========== */ address private constant ONEINCH_V4_AGREGATION_ROUTER = 0x1111111254fb6c44bAC0beD2854e76F90643097d; address private constant WETH = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2; /* ========== State variables ========== */ address public uniswapV2Router = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D; uint256 public deadline; /* ========== Events ========== */ event Swap( address indexed tokenIn, address indexed tokenOut, uint256 amountIn, uint256 amountOutMin ); /* ========== Constructor ========== */ constructor( address factoryContract, address dam, address controller_, string memory name, string memory symbol ) AbstractDynaset(factoryContract, dam, controller_, name, symbol) { } /* ========== Token Swaps ========== */ function swapUniswap( address tokenIn, address tokenOut, uint256 amountIn, uint256 amountOutMin ) external payable nonReentrant { onlyDigitalAssetManager(); _checkBounds(tokenIn, tokenOut); //next we need to allow the uniswapv2 router to spend the token we just sent to this contract //by calling IERC20 approve you allow the uniswap contract to spend the tokens in this contract IERC20(tokenIn).safeIncreaseAllowance(uniswapV2Router, amountIn); //path is an array of addresses. //this path array will have 3 addresses [tokenIn, WETH, tokenOut] //the if statement below takes into account if token in or token out is WETH. then the path is only 2 addresses address[] memory path; if (tokenIn == WETH || tokenOut == WETH) { path = new address[](2); path[0] = tokenIn; path[1] = tokenOut; } else { path = new address[](3); path[0] = tokenIn; path[1] = WETH; path[2] = tokenOut; } //then we will call swapExactTokensForTokens //for the deadline we will pass in block.timestamp + deadline //the deadline is the latest time the trade is valid for IUniswapV2Router(uniswapV2Router).swapExactTokensForTokens( amountIn, amountOutMin, path, address(this), block.timestamp + deadline ); _afterSwap(tokenIn, tokenOut, amountIn, amountOutMin); } // swap using 1inch API function swapOneInch( address tokenIn, address tokenOut, uint256 amount, uint256 minReturn, bytes32[] calldata pools ) external payable nonReentrant { onlyDigitalAssetManager(); _checkBounds(tokenIn, tokenOut); tokenIn.validateUnoswap(tokenOut, pools); IERC20(tokenIn).safeIncreaseAllowance(ONEINCH_V4_AGREGATION_ROUTER, amount); OneInchAggregator(ONEINCH_V4_AGREGATION_ROUTER).unoswap( tokenIn, amount, minReturn, pools ); _afterSwap(tokenIn, tokenOut, amount, minReturn); } // swap on uniswapV3 using 1inch API function swapOneInchUniV3( address tokenIn, address tokenOut, uint256 amount, uint256 minReturn, uint256[] calldata pools ) external payable nonReentrant { onlyDigitalAssetManager(); _checkBounds(tokenIn, tokenOut); tokenIn.validateUniswapV3Swap(tokenOut, pools); IERC20(tokenIn).safeIncreaseAllowance(ONEINCH_V4_AGREGATION_ROUTER, amount); OneInchAggregator(ONEINCH_V4_AGREGATION_ROUTER).uniswapV3Swap( amount, minReturn, pools ); _afterSwap(tokenIn, tokenOut, amount, minReturn); } /* =========== Internal functions ============ */ function _checkBounds(address tokenIn, address tokenOut) internal view { require(records[tokenIn].bound, "ERR_NOT_BOUND"); require(records[tokenOut].bound, "ERR_NOT_BOUND"); } function _afterSwap(address tokenIn, address tokenOut, uint256 amount, uint256 minReturn) internal { updateAfterSwap(tokenIn, tokenOut); emit Swap(tokenIn, tokenOut, amount, minReturn); } /* =========== Privileged configuration functions ============ */ function setDeadline(uint256 newDeadline) external { onlyController(); deadline = newDeadline; } function upgradeUniswapV2Router(address newUniswapV2Router) external { onlyController(); require(newUniswapV2Router != address(0), "ERR_ADDRESS_ZERO"); uniswapV2Router = newUniswapV2Router; } }
// SPDX-License-Identifier: GPL-3.0 pragma solidity 0.8.15; /* ========== Internal Inheritance ========== */ import {DToken} from "./DToken.sol"; /* ========== Internal Interfaces ========== */ import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "./interfaces/IDynasetContract.sol"; import "./interfaces/IUniswapV2Router.sol"; import "./interfaces/IDynasetTvlOracle.sol"; import "./balancer/BNum.sol"; /************************************************************************************************ Originally from https://github.com/balancer-labs/balancer-core/blob/master/contracts/BPool.sol This source code has been modified from the original, which was copied from the github repository at commit hash f4ed5d65362a8d6cec21662fb6eae233b0babc1f. Subject to the GPL-3.0 license *************************************************************************************************/ abstract contract AbstractDynaset is DToken, BNum, IDynasetContract, ReentrancyGuard { using SafeERC20 for IERC20; /* ========== Storage ========== */ // Account with CONTROL role. // set mint/burn forges. address internal controller; address internal factory; address internal digitalAssetManager; mapping(address => bool) internal mintForges; mapping(address => bool) internal burnForges; // Array of underlying tokens in the dynaset. address[] internal dynasetTokens; // Internal records of the dynaset's underlying tokens mapping(address => Record) internal records; address internal dynasetTvlOracle; /* ========== Events ========== */ event LogTokenAdded(address indexed tokenIn, address indexed provider); event LogTokenRemoved(address indexed tokenOut); event DynasetInitialized( address[] indexed tokens, uint256[] balances, address indexed tokenProvider ); event MintForge(address indexed forgeAddress); event BurnForge(address indexed forgeAddress); event WithdrawalFee(address token, uint256 indexed amount); /* ========== Access Modifiers (changed to internal functions to decrease contract size) ========== */ function onlyFactory() internal view { require(msg.sender == factory, "ERR_NOT_FACTORY"); } function onlyController() internal view { require(msg.sender == controller, "ERR_NOT_CONTROLLER"); } function onlyDigitalAssetManager() internal view { require(msg.sender == digitalAssetManager, "ERR_NOT_DAM"); } /* ========== Constructor ========== */ constructor( address factoryContract, address dam, address controller_, string memory name, string memory symbol ) { require( factoryContract != address(0) && dam != address(0) && controller_ != address(0), "ERR_ZERO_ADDRESS" ); factory = factoryContract; controller = controller_; digitalAssetManager = dam; _initializeToken(name, symbol); } /* ========== External Functions ========== */ /** * @dev Sets up the initial assets for the pool. * * Note: `tokenProvider` must have approved the pool to transfer the * corresponding `balances` of `tokens`. * * @param tokens Underlying tokens to initialize the pool with * @param balances Initial balances to transfer * @param tokenProvider Address to transfer the balances from */ function initialize( address[] calldata tokens, uint256[] calldata balances, address tokenProvider ) external nonReentrant override { onlyFactory(); require(dynasetTokens.length == 0, "ERR_INITIALIZED"); require(tokenProvider != address(0), "INVALID_TOKEN_PROVIDER"); uint256 len = tokens.length; require(len >= MIN_BOUND_TOKENS, "ERR_MIN_TOKENS"); require(len <= MAX_BOUND_TOKENS, "ERR_MAX_TOKENS"); _mint(INIT_POOL_SUPPLY); address token; uint256 balance; for (uint256 i = 0; i < len; i++) { token = tokens[i]; require(token != address(0), "INVALID_TOKEN"); balance = balances[i]; require(balance > 0, "ERR_MIN_BALANCE"); records[token] = Record({ bound: true, ready: true, index: uint8(i), balance: balance }); dynasetTokens.push(token); // ! external interaction _pullUnderlying(token, tokenProvider, balance); } _push(tokenProvider, INIT_POOL_SUPPLY); emit DynasetInitialized(tokens, balances, tokenProvider); } function addToken( address token, uint256 minimumBalance, address tokenProvider ) external nonReentrant { onlyDigitalAssetManager(); require(token != address(0), "ERR_ZERO_TOKEN"); require(dynasetTokens.length < MAX_BOUND_TOKENS, "ERR_MAX_TOKENS"); require(tokenProvider != address(0), "ERR_ZERO_TOKEN_PROVIDER"); require(!records[token].bound, "ERR_IS_BOUND"); require(minimumBalance > 0, "ERR_MIN_BALANCE"); require( IERC20(token).allowance(address(tokenProvider), address(this)) >= minimumBalance, "ERR_INSUFFICIENT_ALLOWANCE" ); records[token] = Record({ bound: true, ready: true, index: uint8(dynasetTokens.length), balance: minimumBalance }); dynasetTokens.push(token); _pullUnderlying(token, tokenProvider, minimumBalance); emit LogTokenAdded(token, tokenProvider); } function removeToken(address token) external nonReentrant { onlyDigitalAssetManager(); require(dynasetTokens.length > MIN_BOUND_TOKENS, "ERR_MIN_TOKENS"); Record memory record = records[token]; uint256 tokenBalance = record.balance; require(tokenBalance == 0, "ERR_CAN_NOT_REMOVE_TOKEN"); // Swap the token-to-unbind with the last token, // then delete the last token uint256 index = record.index; uint256 last = dynasetTokens.length - 1; // Only swap the token with the last token if it is not // already at the end of the array. if (index != last) { dynasetTokens[index] = dynasetTokens[last]; records[dynasetTokens[index]].index = uint8(index); records[dynasetTokens[index]].balance = records[dynasetTokens[last]] .balance; } dynasetTokens.pop(); records[token] = Record({ bound: false, ready: false, index: 0, balance: 0 }); emit LogTokenRemoved(token); } function setMintForge(address newMintForge) external { onlyController(); require(!mintForges[newMintForge], "ERR_FORGE_ALREADY_ADDED"); mintForges[newMintForge] = true; emit MintForge(newMintForge); } function setBurnForge(address newBurnForge) external { onlyController(); require(!burnForges[newBurnForge], "ERR_FORGE_ALREADY_ADDED"); burnForges[newBurnForge] = true; emit BurnForge(newBurnForge); } function setDynasetOracle(address oracleAddress) external { onlyFactory(); dynasetTvlOracle = oracleAddress; } /** NOTE The function can only be called using dynaset factory contract. * It is made sure that fee is not taken too frequently or * not more than 25% more details can be found in DynasetFactory contract * collectFee funciton. */ function withdrawFee(address token, uint256 amount) external { onlyFactory(); IERC20 token_ = IERC20(token); token_.safeTransfer(msg.sender, amount); emit WithdrawalFee(token, amount); } /** * * @param amount is number of dynaset amount * @return tokens returns the tokens list in the dynasets and * their respective @return amounts which combines make same * usd value as the amount of dynasets */ function calcTokensForAmount(uint256 amount) external view returns (address[] memory tokens, uint256[] memory amounts) { uint256 dynasetTotal = totalSupply(); uint256 ratio = bdiv(amount, dynasetTotal); require(ratio != 0, "ERR_MATH_APPROX"); tokens = dynasetTokens; amounts = new uint256[](dynasetTokens.length); uint256 tokenAmountIn; for (uint256 i = 0; i < dynasetTokens.length; i++) { (Record memory record, ) = _getInputToken(tokens[i]); tokenAmountIn = bmul(ratio, record.balance); amounts[i] = tokenAmountIn; } } function getTokenAmounts() external view returns (address[] memory tokens, uint256[] memory amounts) { tokens = dynasetTokens; amounts = new uint256[](dynasetTokens.length); for (uint256 i = 0; i < dynasetTokens.length; i++) { amounts[i] = records[tokens[i]].balance; } } /** * @dev Returns the controller address. */ function getController() external view override returns (address) { return controller; } /** * @dev Check if a token is bound to the dynaset. */ function isBound(address token) external view override returns (bool) { return records[token].bound; } /** * @dev Get the number of tokens bound to the dynaset. */ function getNumTokens() external view override returns (uint256) { return dynasetTokens.length; } /** * @dev Returns the record for a token bound to the dynaset. */ function getTokenRecord(address token) external view override returns (Record memory record) { record = records[token]; require(record.bound, "ERR_NOT_BOUND"); } /** * @dev Returns the stored balance of a bound token. */ function getBalance(address token) external view override returns (uint256) { Record memory record = records[token]; require(record.bound, "ERR_NOT_BOUND"); return record.balance; } /** * @dev Get all bound tokens. */ function getCurrentTokens() external view override returns (address[] memory tokens) { tokens = dynasetTokens; } /* ========== Public Functions ========== */ /** * @dev Absorb any tokens that have been sent to the dynaset. * If the token is not bound, it will be sent to the unbound * token handler. */ function updateAfterSwap(address tokenIn, address tokenOut) public { uint256 balanceIn = IERC20(tokenIn).balanceOf(address(this)); uint256 balanceOut = IERC20(tokenOut).balanceOf(address(this)); records[tokenIn].balance = balanceIn; records[tokenOut].balance = balanceOut; } /* * @dev Mint new dynaset tokens by providing the proportional amount of each * underlying token's balance relative to the proportion of dynaset tokens minted. * * NOTE: function can only be called by the forge contracts and min/max amounts checks are * implemented in forge contracts. * For any underlying tokens which are not initialized, the caller must provide * the proportional share of the minimum balance for the token rather than the * actual balance. * * @param dynasetAmountOut Amount of dynaset tokens to mint * order as the dynaset's dynasetTokens list. */ function joinDynaset(uint256 expectedSharesToMint) external override nonReentrant returns (uint256 sharesToMint) { require(mintForges[msg.sender], "ERR_NOT_FORGE"); require(dynasetTvlOracle != address(0), "ERR_DYNASET_ORACLE_NOT_SET"); sharesToMint = expectedSharesToMint; uint256 dynasetTotal = totalSupply(); uint256 ratio = bdiv(sharesToMint, dynasetTotal); require(ratio != 0, "ERR_MATH_APPROX"); uint256 tokenAmountIn; address token; uint256 dynaset_usd_value_before_join = IDynasetTvlOracle(dynasetTvlOracle).dynasetTvlUsdc(); for (uint256 i = 0; i < dynasetTokens.length; i++) { token = dynasetTokens[i]; (, uint256 realBalance) = _getInputToken(token); tokenAmountIn = bmul(ratio, realBalance); require(tokenAmountIn != 0, "ERR_MATH_APPROX"); uint256 forgeTokenBalance = IERC20(token).balanceOf(msg.sender); if (forgeTokenBalance < tokenAmountIn) { tokenAmountIn = forgeTokenBalance; } uint256 forgeTokenAllowance = IERC20(token).allowance(msg.sender, address(this)); if (forgeTokenAllowance < tokenAmountIn) { tokenAmountIn = forgeTokenAllowance; } _updateInputToken(token, badd(realBalance, tokenAmountIn)); _pullUnderlying(token, msg.sender, tokenAmountIn); emit LOG_JOIN(token, msg.sender, tokenAmountIn); } // calculate correct sharesToMint uint256 dynaset_added_value = IDynasetTvlOracle(dynasetTvlOracle).dynasetTvlUsdc() - dynaset_usd_value_before_join; sharesToMint = dynaset_added_value * dynasetTotal / dynaset_usd_value_before_join; require(sharesToMint > 0, "MINT_ZERO_DYNASETS"); _mint(sharesToMint); _push(msg.sender, sharesToMint); } /** * @dev Burns `_amount` dynaset tokens in exchange for the amounts of each * underlying token's balance proportional to the ratio of tokens burned to * total dynaset supply. * * @param dynasetAmountIn Exact amount of dynaset tokens to burn */ function exitDynaset(uint256 dynasetAmountIn) external override nonReentrant { require(burnForges[msg.sender], "ERR_NOT_FORGE"); uint256 dynasetTotal = totalSupply(); uint256 ratio = bdiv(dynasetAmountIn, dynasetTotal); require(ratio != 0, "ERR_MATH_APPROX"); _pull(msg.sender, dynasetAmountIn); _burn(dynasetAmountIn); address token; Record memory record; uint256 tokenAmountOut; for (uint256 i = 0; i < dynasetTokens.length; i++) { token = dynasetTokens[i]; record = records[token]; require(record.ready, "ERR_OUT_NOT_READY"); tokenAmountOut = bmul(ratio, record.balance); require(tokenAmountOut != 0, "ERR_MATH_APPROX"); records[token].balance = bsub(record.balance, tokenAmountOut); _pushUnderlying(token, msg.sender, tokenAmountOut); emit LOG_EXIT(msg.sender, token, tokenAmountOut); } } /* ========== Underlying Token Internal Functions ========== */ // 'Underlying' token-manipulation functions make external calls but are NOT locked function _pullUnderlying( address erc20, address from, uint256 amount ) internal { IERC20(erc20).safeTransferFrom(from, address(this), amount); } function _pushUnderlying( address erc20, address to, uint256 amount ) internal { IERC20(erc20).safeTransfer(to, amount); } /* ========== Token Management Internal Functions ========== */ /** * @dev Handles weight changes and initialization of an * input token. * @param token Address of the input token * @param realBalance real balance is set to the records for token * and weight if the token was uninitialized. */ function _updateInputToken(address token, uint256 realBalance) internal { records[token].balance = realBalance; } /* ========== Token Query Internal Functions ========== */ /** * @dev Get the record for a token. * The token must be bound to the dynaset. If the token is not * initialized (meaning it does not have the minimum balance) * this function will return the actual balance of the token */ function _getInputToken(address token) internal view returns (Record memory record, uint256 realBalance) { record = records[token]; require(record.bound, "ERR_NOT_BOUND"); realBalance = record.balance; } }
// SPDX-License-Identifier: GPL-3.0 pragma solidity 0.8.15; interface IUniswapV2Router { function swapExactTokensForTokens( //amount of tokens we are sending in uint256 amountIn, //the minimum amount of tokens we want out of the trade uint256 amountOutMin, //list of token addresses we are going to trade in. this is necessary to calculate amounts address[] calldata path, //this is the address we are going to send the output tokens to address to, //the last time that the trade is valid for uint256 deadline ) external returns (uint256[] memory amounts); function swapTokensForExactTokens( uint256 amountOut, uint256 amountInMax, address[] calldata path, address to, uint256 deadline ) external returns (uint256[] memory amounts); function quote( uint256 amountA, uint256 reserveA, uint256 reserveB ) external pure returns (uint256 amountB); function getAmountOut( uint256 amountIn, uint256 reserveIn, uint256 reserveOut ) external pure returns (uint256 amountOut); function getAmountIn( uint256 amountOut, uint256 reserveIn, uint256 reserveOut ) external pure returns (uint256 amountIn); function getAmountsOut(uint256 amountIn, address[] calldata path) external view returns (uint256[] memory amounts); function getAmountsIn(uint256 amountOut, address[] calldata path) external view returns (uint256[] memory amounts); }
// SPDX-License-Identifier: GPL-3.0 pragma solidity 0.8.15; import "../interfaces/IUniswapV2Pair.sol"; library OneInchSwapValidation { function getOutputTokenForInputTokenAndPair(address tokenIn, address pair) internal view returns (address) { address token0 = IUniswapV2Pair(pair).token0(); address token1 = IUniswapV2Pair(pair).token1(); if (token0 == tokenIn) { return token1; } if (token1 == tokenIn) { return token0; } revert("ERR_TOKEN_MISSING_IN_PAIR"); } function validateUnoswap( address tokenIn, address tokenOut, bytes32[] calldata pools ) internal view { address outputToken = tokenIn; for (uint8 i = 0; i < pools.length; i++) { outputToken = getOutputTokenForInputTokenAndPair( outputToken, address(uint160(uint256(pools[i]))) ); } require(outputToken == tokenOut, "ERR_OUTPUT_TOKEN"); } function validateUniswapV3Swap( address tokenIn, address tokenOut, uint256[] calldata pools ) internal view { address outputToken = tokenIn; for (uint8 i = 0; i < pools.length; i++) { outputToken = getOutputTokenForInputTokenAndPair( outputToken, address(uint160(pools[i])) ); } require(outputToken == tokenOut, "ERR_OUTPUT_TOKEN"); } }
// SPDX-License-Identifier: GPL-3.0 pragma solidity 0.8.15; interface OneInchAggregator { function unoswap( address srcToken, uint256 amount, uint256 minReturn, bytes32[] calldata _pools ) external payable returns (uint256 returnAmount); function uniswapV3Swap( uint256 amount, uint256 minReturn, uint256[] calldata pools ) external payable returns (uint256 returnAmount); }
// SPDX-License-Identifier: GPL-3.0 pragma solidity 0.8.15; import "./interfaces/IERC20.sol"; /************************************************************************************************ Originally from https://github.com/balancer-labs/balancer-core/blob/master/contracts/BToken.sol This source code has been modified from the original, which was copied from the github repository at commit hash f4ed5d65362a8d6cec21662fb6eae233b0babc1f. Subject to the GPL-3.0 license *************************************************************************************************/ contract DTokenBase { mapping(address => uint256) internal _balance; mapping(address => mapping(address => uint256)) internal _allowance; uint256 internal _totalSupply; event Transfer(address indexed src, address indexed dst, uint256 amt); function _mint(uint256 amt) internal { _balance[address(this)] = (_balance[address(this)] + amt); _totalSupply = (_totalSupply + amt); emit Transfer(address(0), address(this), amt); } function _burn(uint256 amt) internal { require(_balance[address(this)] >= amt, "ERR_INSUFFICIENT_BAL"); _balance[address(this)] = (_balance[address(this)] - amt); _totalSupply = (_totalSupply - amt); emit Transfer(address(this), address(0), amt); } function _move( address src, address dst, uint256 amt ) internal { require(_balance[src] >= amt, "ERR_INSUFFICIENT_BAL"); _balance[src] = (_balance[src] - amt); _balance[dst] = (_balance[dst] + amt); emit Transfer(src, dst, amt); } function _push(address to, uint256 amt) internal { _move(address(this), to, amt); } function _pull(address from, uint256 amt) internal { _move(from, address(this), amt); } } contract DToken is DTokenBase, IERC20 { uint8 private constant DECIMALS = 18; string private _name; string private _symbol; function _initializeToken(string memory name_, string memory symbol_) internal { require( bytes(_name).length == 0 && bytes(name_).length != 0 && bytes(symbol_).length != 0, "ERR_BTOKEN_INITIALIZED" ); _name = name_; _symbol = symbol_; } function name() external view returns (string memory) { return _name; } function symbol() external view returns (string memory) { return _symbol; } function decimals() external pure returns (uint8) { return DECIMALS; } function allowance(address src, address dst) external view override returns (uint256) { return _allowance[src][dst]; } function balanceOf(address whom) external view override returns (uint256) { return _balance[whom]; } function totalSupply() public view override returns (uint256) { return _totalSupply; } function approve(address dst, uint256 amt) external override returns (bool) { _allowance[msg.sender][dst] = amt; emit Approval(msg.sender, dst, amt); return true; } function increaseApproval(address dst, uint256 amt) external returns (bool) { _allowance[msg.sender][dst] = (_allowance[msg.sender][dst] + amt); emit Approval(msg.sender, dst, _allowance[msg.sender][dst]); return true; } function decreaseApproval(address dst, uint256 amt) external returns (bool) { uint256 oldValue = _allowance[msg.sender][dst]; if (amt > oldValue) { _allowance[msg.sender][dst] = 0; } else { _allowance[msg.sender][dst] = (oldValue - amt); } emit Approval(msg.sender, dst, _allowance[msg.sender][dst]); return true; } function transfer(address dst, uint256 amt) external override returns (bool) { _move(msg.sender, dst, amt); return true; } function transferFrom( address src, address dst, uint256 amt ) external override returns (bool) { require( msg.sender == src || amt <= _allowance[src][msg.sender], "ERR_BTOKEN_BAD_CALLER" ); _move(src, dst, amt); if ( msg.sender != src && _allowance[src][msg.sender] != type(uint128).max ) { _allowance[src][msg.sender] = (_allowance[src][msg.sender] - amt); emit Approval(msg.sender, dst, _allowance[src][msg.sender]); } return true; } }
// SPDX-License-Identifier: GPL-3.0 pragma solidity 0.8.15; interface IDynasetContract { /** * @dev Token record data structure * @param bound is token bound to pool * @param ready has token been initialized * @param lastDenormUpdate timestamp of last denorm change * @param desiredDenorm desired denormalized weight (used for incremental changes) * @param index of address in tokens array * @param balance token balance */ struct Record { bool bound; // is token bound to dynaset bool ready; uint256 index; // private uint256 balance; } event LOG_SWAP( address indexed caller, address indexed tokenIn, address indexed tokenOut, uint256 tokenAmountIn, uint256 tokenAmountOut ); event LOG_JOIN( address indexed tokenIn, address indexed caller, uint256 tokenAmountIn ); event LOG_EXIT( address indexed caller, address indexed tokenOut, uint256 tokenAmountOut ); event LOG_DENORM_UPDATED(address indexed token, uint256 newDenorm); event LOG_DESIRED_DENORM_SET(address indexed token, uint256 desiredDenorm); event LOG_MINIMUM_BALANCE_UPDATED(address token, uint256 minimumBalance); event LOG_TOKEN_READY(address indexed token); event LOG_PUBLIC_SWAP_TOGGLED(bool enabled); function initialize( address[] calldata tokens, uint256[] calldata balances, address tokenProvider ) external; function joinDynaset(uint256 _amount) external returns (uint256); function exitDynaset(uint256 _amount) external; function getController() external view returns (address); function isBound(address t) external view returns (bool); function getNumTokens() external view returns (uint256); function getCurrentTokens() external view returns (address[] memory tokens); function getTokenRecord(address token) external view returns (Record memory record); function getBalance(address token) external view returns (uint256); function setDynasetOracle(address oracle) external; function withdrawFee(address token, uint256 amount) external; }
// SPDX-License-Identifier: GPL-3.0 pragma solidity 0.8.15; interface IDynasetTvlOracle { function dynasetTvlUsdc() external view returns (uint256 total_usd); function tokenUsdcValue(address _tokenIn, uint256 _amount) external view returns (uint256); function dynasetUsdcValuePerShare() external view returns (uint256); function dynasetTokenUsdcRatios() external view returns (address[] memory, uint256[] memory, uint256); }
// SPDX-License-Identifier: GPL-3.0 pragma solidity 0.8.15; import "./BConst.sol"; /************************************************************************************************ Originally from https://github.com/balancer-labs/balancer-core/blob/master/contracts/BNum.sol This source code has been modified from the original, which was copied from the github repository at commit hash f4ed5d65362a8d6cec21662fb6eae233b0babc1f. Subject to the GPL-3.0 license *************************************************************************************************/ contract BNum is BConst { function btoi(uint256 a) internal pure returns (uint256) { return a / BONE; } function bfloor(uint256 a) internal pure returns (uint256) { return btoi(a) * BONE; } function badd(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "ERR_ADD_OVERFLOW"); return c; } function bsub(uint256 a, uint256 b) internal pure returns (uint256) { (uint256 c, bool flag) = bsubSign(a, b); require(!flag, "ERR_SUB_UNDERFLOW"); return c; } function bsubSign(uint256 a, uint256 b) internal pure returns (uint256, bool) { if (a >= b) { return (a - b, false); } else { return (b - a, true); } } function bmul(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c0 = a * b; require(a == 0 || c0 / a == b, "ERR_MUL_OVERFLOW"); uint256 c1 = c0 + (BONE / 2); require(c1 >= c0, "ERR_MUL_OVERFLOW"); uint256 c2 = c1 / BONE; return c2; } function bdiv(uint256 a, uint256 b) internal pure returns (uint256) { require(b != 0, "ERR_DIV_ZERO"); uint256 c0 = a * BONE; require(a == 0 || c0 / a == BONE, "ERR_DIV_INTERNAL"); // bmul overflow uint256 c1 = c0 + (b / 2); require(c1 >= c0, "ERR_DIV_INTERNAL"); // badd require uint256 c2 = c1 / b; return c2; } // DSMath.wpow function bpowi(uint256 a, uint256 n) internal pure returns (uint256) { uint256 z = n % 2 != 0 ? a : BONE; for (n /= 2; n != 0; n /= 2) { a = bmul(a, a); if (n % 2 != 0) { z = bmul(z, a); } } return z; } // Compute b^(e.w) by splitting it into (b^e)*(b^0.w). // Use `bpowi` for `b^e` and `bpowK` for k iterations // of approximation of b^0.w function bpow(uint256 base, uint256 exp) internal pure returns (uint256) { require(base >= MIN_BPOW_BASE, "ERR_BPOW_BASE_TOO_LOW"); require(base <= MAX_BPOW_BASE, "ERR_BPOW_BASE_TOO_HIGH"); uint256 whole = bfloor(exp); uint256 remain = bsub(exp, whole); uint256 wholePow = bpowi(base, btoi(whole)); if (remain == 0) { return wholePow; } uint256 partialResult = bpowApprox(base, remain, BPOW_PRECISION); return bmul(wholePow, partialResult); } function bpowApprox( uint256 base, uint256 exp, uint256 precision ) internal pure returns (uint256) { // term 0: uint256 a = exp; (uint256 x, bool xneg) = bsubSign(base, BONE); uint256 term = BONE; uint256 sum = term; bool negative = false; // term(k) = numer / denom // = (product(a - i - 1, i=1-->k) * x^k) / (k!) // each iteration, multiply previous term by (a-(k-1)) * x / k // continue until term is less than precision for (uint256 i = 1; term >= precision; i++) { uint256 bigK = i * BONE; (uint256 c, bool cneg) = bsubSign(a, bsub(bigK, BONE)); term = bmul(term, bmul(c, x)); term = bdiv(term, bigK); if (term == 0) break; if (xneg) negative = !negative; if (cneg) negative = !negative; if (negative) { sum = bsub(sum, term); } else { sum = badd(sum, term); } } return sum; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (security/ReentrancyGuard.sol) pragma solidity ^0.8.0; /** * @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 you would like to learn more about reentrancy and alternative ways * to protect against it, check out our blog post * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul]. */ abstract contract ReentrancyGuard { // Booleans are more expensive than uint256 or any type that takes up a full // word because each write operation emits an extra SLOAD to first read the // slot's contents, replace the bits taken up by the boolean, and then write // back. This is the compiler's defense against contract upgrades and // pointer aliasing, and it cannot be disabled. // The values being non-zero value makes deployment a bit more expensive, // but in exchange the refund on every call to nonReentrant will be lower in // amount. Since refunds are capped to a percentage of the total // transaction's gas, it is best to keep them low in cases like this one, to // increase the likelihood of the full refund coming into effect. uint256 private constant _NOT_ENTERED = 1; uint256 private constant _ENTERED = 2; uint256 private _status; constructor() { _status = _NOT_ENTERED; } /** * @dev Prevents a contract from calling itself, directly or indirectly. * Calling a `nonReentrant` function from another `nonReentrant` * function is not supported. It is possible to prevent this from happening * by making the `nonReentrant` function external, and making it call a * `private` function that does the actual work. */ modifier nonReentrant() { // On the first call to nonReentrant, _notEntered will be true require(_status != _ENTERED, "ReentrancyGuard: reentrant call"); // Any calls to nonReentrant after this point will fail _status = _ENTERED; _; // By storing the original value once again, a refund is triggered (see // https://eips.ethereum.org/EIPS/eip-2200) _status = _NOT_ENTERED; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (token/ERC20/utils/SafeERC20.sol) pragma solidity ^0.8.0; import "../IERC20.sol"; import "../extensions/draft-IERC20Permit.sol"; import "../../../utils/Address.sol"; /** * @title SafeERC20 * @dev Wrappers around ERC20 operations that throw on failure (when the token * contract returns false). Tokens that return no value (and instead revert or * throw on failure) are also supported, non-reverting calls are assumed to be * successful. * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract, * which allows you to call the safe operations as `token.safeTransfer(...)`, etc. */ library SafeERC20 { using Address for address; function safeTransfer( IERC20 token, address to, uint256 value ) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom( IERC20 token, address from, address to, uint256 value ) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value)); } /** * @dev Deprecated. This function has issues similar to the ones found in * {IERC20-approve}, and its usage is discouraged. * * Whenever possible, use {safeIncreaseAllowance} and * {safeDecreaseAllowance} instead. */ function safeApprove( IERC20 token, address spender, uint256 value ) internal { // safeApprove should only be called when setting an initial allowance, // or when resetting it to zero. To increase and decrease it, use // 'safeIncreaseAllowance' and 'safeDecreaseAllowance' require( (value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: approve from non-zero to non-zero allowance" ); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value)); } function safeIncreaseAllowance( IERC20 token, address spender, uint256 value ) internal { uint256 newAllowance = token.allowance(address(this), spender) + value; _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } function safeDecreaseAllowance( IERC20 token, address spender, uint256 value ) internal { unchecked { uint256 oldAllowance = token.allowance(address(this), spender); require(oldAllowance >= value, "SafeERC20: decreased allowance below zero"); uint256 newAllowance = oldAllowance - value; _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } } function safePermit( IERC20Permit token, address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) internal { uint256 nonceBefore = token.nonces(owner); token.permit(owner, spender, value, deadline, v, r, s); uint256 nonceAfter = token.nonces(owner); require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed"); } /** * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement * on the return value: the return value is optional (but if data is returned, it must not be false). * @param token The token targeted by the call. * @param data The call data (encoded using abi.encode or one of its variants). */ function _callOptionalReturn(IERC20 token, bytes memory data) private { // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that // the target address contains contract code and also asserts for success in the low-level call. bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed"); if (returndata.length > 0) { // Return data is optional require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } } }
// SPDX-License-Identifier: GPL-3.0 pragma solidity 0.8.15; interface IERC20 { event Approval(address indexed _src, address indexed _dst, uint256 _amount); function totalSupply() external view returns (uint256); function balanceOf(address _whom) external view returns (uint256); function allowance(address _src, address _dst) external view returns (uint256); function approve(address _dst, uint256 _amount) external returns (bool); function transfer(address _dst, uint256 _amount) external returns (bool); function transferFrom( address _src, address _dst, uint256 _amount ) external returns (bool); }
// SPDX-License-Identifier: GPL-3.0 pragma solidity 0.8.15; /************************************************************************************************ Originally from https://github.com/balancer-labs/balancer-core/blob/master/contracts/BConst.sol This source code has been modified from the original, which was copied from the github repository at commit hash f4ed5d65362a8d6cec21662fb6eae233b0babc1f. Subject to the GPL-3.0 license *************************************************************************************************/ contract BConst { uint256 public constant VERSION_NUMBER = 1; /* --- Weight Updates --- */ // Minimum time passed between each weight update for a token. uint256 internal constant WEIGHT_UPDATE_DELAY = 1 hours; // Maximum percent by which a weight can adjust at a time // relative to the current weight. // The number of iterations needed to move from weight A to weight B is the floor of: // (A > B): (ln(A) - ln(B)) / ln(1.01) // (B > A): (ln(A) - ln(B)) / ln(0.99) uint256 internal constant WEIGHT_CHANGE_PCT = BONE / 100; uint256 internal constant BONE = 10**18; uint256 internal constant MIN_BOUND_TOKENS = 2; uint256 internal constant MAX_BOUND_TOKENS = 20; // Minimum swap fee. uint256 internal constant MIN_FEE = BONE / 10**6; // Maximum swap or exit fee. uint256 internal constant MAX_FEE = BONE / 10; // Actual exit fee. uint256 internal constant EXIT_FEE = 5e15; // Minimum weight for any token (1/100). uint256 internal constant MIN_WEIGHT = BONE; uint256 internal constant MAX_WEIGHT = BONE * 50; // Maximum total weight. uint256 internal constant MAX_TOTAL_WEIGHT = BONE * 50; // Minimum balance for a token (only applied at initialization) // uint256 internal constant MIN_BALANCE = BONE / 10**12; // Initial pool tokens uint256 internal constant INIT_POOL_SUPPLY = BONE * 100; uint256 internal constant MIN_BPOW_BASE = 1 wei; uint256 internal constant MAX_BPOW_BASE = (2 * BONE) - 1 wei; uint256 internal constant BPOW_PRECISION = BONE / 10**10; // Maximum ratio of input tokens to balance for swaps. uint256 internal constant MAX_IN_RATIO = BONE / 2; // Maximum ratio of output tokens to balance for swaps. uint256 internal constant MAX_OUT_RATIO = (BONE / 3) + 1 wei; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `to`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address to, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `from` to `to` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 amount ) external returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (utils/Address.sol) pragma solidity ^0.8.1; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== * * [IMPORTANT] * ==== * You shouldn't rely on `isContract` to protect against flash loan attacks! * * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract * constructor. * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize/address.code.length, which returns 0 // for contracts in construction, since the code is only stored at the end // of the constructor execution. return account.code.length > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); require(isContract(target), "Address: call to non-contract"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { require(isContract(target), "Address: delegate call to non-contract"); (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly /// @solidity memory-safe-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612]. * * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't * need to send a transaction, and thus is not required to hold Ether at all. */ interface IERC20Permit { /** * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens, * given ``owner``'s signed approval. * * IMPORTANT: The same issues {IERC20-approve} has related to transaction * ordering also apply here. * * Emits an {Approval} event. * * Requirements: * * - `spender` cannot be the zero address. * - `deadline` must be a timestamp in the future. * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner` * over the EIP712-formatted function arguments. * - the signature must use ``owner``'s current nonce (see {nonces}). * * For more information on the signature format, see the * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP * section]. */ function permit( address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) external; /** * @dev Returns the current nonce for `owner`. This value must be * included whenever a signature is generated for {permit}. * * Every successful call to {permit} increases ``owner``'s nonce by one. This * prevents a signature from being used multiple times. */ function nonces(address owner) external view returns (uint256); /** * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}. */ // solhint-disable-next-line func-name-mixedcase function DOMAIN_SEPARATOR() external view returns (bytes32); }
// SPDX-License-Identifier: GPL-3.0 pragma solidity 0.8.15; interface IUniswapV2Pair { event Approval(address indexed owner, address indexed spender, uint value); event Transfer(address indexed from, address indexed to, uint value); function name() external pure returns (string memory); function symbol() external pure returns (string memory); function decimals() external pure returns (uint8); function totalSupply() external view returns (uint); function balanceOf(address owner) external view returns (uint); function allowance(address owner, address spender) external view returns (uint); function approve(address spender, uint value) external returns (bool); function transfer(address to, uint value) external returns (bool); function transferFrom(address from, address to, uint value) external returns (bool); function DOMAIN_SEPARATOR() external view returns (bytes32); function PERMIT_TYPEHASH() external pure returns (bytes32); function nonces(address owner) external view returns (uint); function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external; event Mint(address indexed sender, uint amount0, uint amount1); event Burn(address indexed sender, uint amount0, uint amount1, address indexed to); event Swap( address indexed sender, uint amount0In, uint amount1In, uint amount0Out, uint amount1Out, address indexed to ); event Sync(uint112 reserve0, uint112 reserve1); function MINIMUM_LIQUIDITY() external pure returns (uint); function factory() external view returns (address); function token0() external view returns (address); function token1() external view returns (address); function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast); function price0CumulativeLast() external view returns (uint); function price1CumulativeLast() external view returns (uint); function kLast() external view returns (uint); function mint(address to) external returns (uint liquidity); function burn(address to) external returns (uint amount0, uint amount1); function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external; function skim(address to) external; function sync() external; function initialize(address, address) external; }
{ "optimizer": { "enabled": true, "runs": 200 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "metadata": { "useLiteralContent": true }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
[{"inputs":[{"internalType":"address","name":"factoryContract","type":"address"},{"internalType":"address","name":"dam","type":"address"},{"internalType":"address","name":"controller_","type":"address"},{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"symbol","type":"string"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_src","type":"address"},{"indexed":true,"internalType":"address","name":"_dst","type":"address"},{"indexed":false,"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"forgeAddress","type":"address"}],"name":"BurnForge","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address[]","name":"tokens","type":"address[]"},{"indexed":false,"internalType":"uint256[]","name":"balances","type":"uint256[]"},{"indexed":true,"internalType":"address","name":"tokenProvider","type":"address"}],"name":"DynasetInitialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"newDenorm","type":"uint256"}],"name":"LOG_DENORM_UPDATED","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"desiredDenorm","type":"uint256"}],"name":"LOG_DESIRED_DENORM_SET","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"caller","type":"address"},{"indexed":true,"internalType":"address","name":"tokenOut","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokenAmountOut","type":"uint256"}],"name":"LOG_EXIT","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"tokenIn","type":"address"},{"indexed":true,"internalType":"address","name":"caller","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokenAmountIn","type":"uint256"}],"name":"LOG_JOIN","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"minimumBalance","type":"uint256"}],"name":"LOG_MINIMUM_BALANCE_UPDATED","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bool","name":"enabled","type":"bool"}],"name":"LOG_PUBLIC_SWAP_TOGGLED","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"caller","type":"address"},{"indexed":true,"internalType":"address","name":"tokenIn","type":"address"},{"indexed":true,"internalType":"address","name":"tokenOut","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokenAmountIn","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"tokenAmountOut","type":"uint256"}],"name":"LOG_SWAP","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"token","type":"address"}],"name":"LOG_TOKEN_READY","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"tokenIn","type":"address"},{"indexed":true,"internalType":"address","name":"provider","type":"address"}],"name":"LogTokenAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"tokenOut","type":"address"}],"name":"LogTokenRemoved","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"forgeAddress","type":"address"}],"name":"MintForge","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"tokenIn","type":"address"},{"indexed":true,"internalType":"address","name":"tokenOut","type":"address"},{"indexed":false,"internalType":"uint256","name":"amountIn","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amountOutMin","type":"uint256"}],"name":"Swap","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"src","type":"address"},{"indexed":true,"internalType":"address","name":"dst","type":"address"},{"indexed":false,"internalType":"uint256","name":"amt","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"token","type":"address"},{"indexed":true,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"WithdrawalFee","type":"event"},{"inputs":[],"name":"VERSION_NUMBER","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"minimumBalance","type":"uint256"},{"internalType":"address","name":"tokenProvider","type":"address"}],"name":"addToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"src","type":"address"},{"internalType":"address","name":"dst","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"dst","type":"address"},{"internalType":"uint256","name":"amt","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"whom","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"calcTokensForAmount","outputs":[{"internalType":"address[]","name":"tokens","type":"address[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"deadline","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"dst","type":"address"},{"internalType":"uint256","name":"amt","type":"uint256"}],"name":"decreaseApproval","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"dynasetAmountIn","type":"uint256"}],"name":"exitDynaset","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"getBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getController","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getCurrentTokens","outputs":[{"internalType":"address[]","name":"tokens","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getNumTokens","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTokenAmounts","outputs":[{"internalType":"address[]","name":"tokens","type":"address[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"getTokenRecord","outputs":[{"components":[{"internalType":"bool","name":"bound","type":"bool"},{"internalType":"bool","name":"ready","type":"bool"},{"internalType":"uint256","name":"index","type":"uint256"},{"internalType":"uint256","name":"balance","type":"uint256"}],"internalType":"struct IDynasetContract.Record","name":"record","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"dst","type":"address"},{"internalType":"uint256","name":"amt","type":"uint256"}],"name":"increaseApproval","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"tokens","type":"address[]"},{"internalType":"uint256[]","name":"balances","type":"uint256[]"},{"internalType":"address","name":"tokenProvider","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"isBound","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"expectedSharesToMint","type":"uint256"}],"name":"joinDynaset","outputs":[{"internalType":"uint256","name":"sharesToMint","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"removeToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newBurnForge","type":"address"}],"name":"setBurnForge","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newDeadline","type":"uint256"}],"name":"setDeadline","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"oracleAddress","type":"address"}],"name":"setDynasetOracle","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newMintForge","type":"address"}],"name":"setMintForge","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"tokenIn","type":"address"},{"internalType":"address","name":"tokenOut","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"minReturn","type":"uint256"},{"internalType":"bytes32[]","name":"pools","type":"bytes32[]"}],"name":"swapOneInch","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"tokenIn","type":"address"},{"internalType":"address","name":"tokenOut","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"minReturn","type":"uint256"},{"internalType":"uint256[]","name":"pools","type":"uint256[]"}],"name":"swapOneInchUniV3","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"tokenIn","type":"address"},{"internalType":"address","name":"tokenOut","type":"address"},{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"uint256","name":"amountOutMin","type":"uint256"}],"name":"swapUniswap","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"dst","type":"address"},{"internalType":"uint256","name":"amt","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"src","type":"address"},{"internalType":"address","name":"dst","type":"address"},{"internalType":"uint256","name":"amt","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"uniswapV2Router","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"tokenIn","type":"address"},{"internalType":"address","name":"tokenOut","type":"address"}],"name":"updateAfterSwap","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newUniswapV2Router","type":"address"}],"name":"upgradeUniswapV2Router","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdrawFee","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
6080604052600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d1790553480156200003757600080fd5b50604051620042f9380380620042f98339810160408190526200005a91620002be565b600160055584848484846001600160a01b038516158015906200008557506001600160a01b03841615155b80156200009a57506001600160a01b03831615155b620000df5760405162461bcd60e51b815260206004820152601060248201526f4552525f5a45524f5f4144445245535360801b60448201526064015b60405180910390fd5b600780546001600160a01b038088166001600160a01b03199283161790925560068054868416908316179055600880549287169290911691909117905562000128828262000138565b50505050505050505050620004bb565b60038054620001479062000361565b1590508015620001575750815115155b8015620001645750805115155b620001b25760405162461bcd60e51b815260206004820152601660248201527f4552525f42544f4b454e5f494e495449414c495a4544000000000000000000006044820152606401620000d6565b6003620001c08382620003ef565b506004620001cf8282620003ef565b505050565b80516001600160a01b0381168114620001ec57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b600082601f8301126200021957600080fd5b81516001600160401b0380821115620002365762000236620001f1565b604051601f8301601f19908116603f01168101908282118183101715620002615762000261620001f1565b816040528381526020925086838588010111156200027e57600080fd5b600091505b83821015620002a2578582018301518183018401529082019062000283565b83821115620002b45760008385830101525b9695505050505050565b600080600080600060a08688031215620002d757600080fd5b620002e286620001d4565b9450620002f260208701620001d4565b93506200030260408701620001d4565b60608701519093506001600160401b03808211156200032057600080fd5b6200032e89838a0162000207565b935060808801519150808211156200034557600080fd5b50620003548882890162000207565b9150509295509295909350565b600181811c908216806200037657607f821691505b6020821081036200039757634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620001cf57600081815260208120601f850160051c81016020861015620003c65750805b601f850160051c820191505b81811015620003e757828155600101620003d2565b505050505050565b81516001600160401b038111156200040b576200040b620001f1565b62000423816200041c845462000361565b846200039d565b602080601f8311600181146200045b5760008415620004425750858301515b600019600386901b1c1916600185901b178555620003e7565b600085815260208120601f198616915b828110156200048c578886015182559484019460019091019084016200046b565b5085821015620004ab5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b613e2e80620004cb6000396000f3fe60806040526004361061021a5760003560e01c806370a0823111610123578063cbb61226116100ab578063d73dd6231161006f578063d73dd62314610666578063dd62ed3e14610686578063de009a44146106cc578063f8b2cb4f146106ec578063fd9be5221461070c57600080fd5b8063cbb61226146105da578063cc77828d146105fa578063cd2ed8fb1461061c578063cd4c690214610631578063d73cc4df1461065157600080fd5b806395d89b41116100f257806395d89b4114610545578063a766a3921461055a578063a9059cbb1461057a578063b9d52f711461059a578063c963ac98146105ba57600080fd5b806370a08231146104d45780637cb470d71461050a5780638025e3031461051d578063848955461461053257600080fd5b80632f37b624116101a6578063371babdc11610175578063371babdc146103ef5780633fe906751461041d5780635fa7b5841461043d57806364c7d6611461045d57806366188463146104b457600080fd5b80632f37b6241461035c5780633018205f14610395578063313ce567146103b3578063339c0528146103cf57600080fd5b806318160ddd116101ed57806318160ddd146102c7578063195199f6146102e657806323b872dd1461030657806323ddc5ab1461032657806329dcb0cf1461034657600080fd5b806306fdde031461021f578063095ea7b31461024a578063107783ec1461027a5780631694505e1461028f575b600080fd5b34801561022b57600080fd5b5061023461072c565b604051610241919061362d565b60405180910390f35b34801561025657600080fd5b5061026a610265366004613678565b6107be565b6040519015158152602001610241565b61028d6102883660046136e9565b610819565b005b34801561029b57600080fd5b50600e546102af906001600160a01b031681565b6040516001600160a01b039091168152602001610241565b3480156102d357600080fd5b506002545b604051908152602001610241565b3480156102f257600080fd5b5061028d610301366004613765565b610934565b34801561031257600080fd5b5061026a61032136600461377e565b610941565b34801561033257600080fd5b5061028d610341366004613765565b610aa5565b34801561035257600080fd5b506102d8600f5481565b34801561036857600080fd5b5061026a6103773660046137bf565b6001600160a01b03166000908152600c602052604090205460ff1690565b3480156103a157600080fd5b506006546001600160a01b03166102af565b3480156103bf57600080fd5b5060405160128152602001610241565b3480156103db57600080fd5b5061028d6103ea3660046137bf565b610d12565b3480156103fb57600080fd5b5061040f61040a366004613765565b610dc9565b604051610241929190613820565b34801561042957600080fd5b506102d8610438366004613765565b610f2c565b34801561044957600080fd5b5061028d6104583660046137bf565b6113b2565b34801561046957600080fd5b5061047d6104783660046137bf565b611709565b6040516102419190815115158152602080830151151590820152604080830151908201526060918201519181019190915260800190565b3480156104c057600080fd5b5061026a6104cf366004613678565b6117a4565b3480156104e057600080fd5b506102d86104ef3660046137bf565b6001600160a01b031660009081526020819052604090205490565b61028d6105183660046136e9565b61187a565b34801561052957600080fd5b506102d8600181565b61028d610540366004613877565b61192d565b34801561055157600080fd5b50610234611bd7565b34801561056657600080fd5b5061028d6105753660046138bd565b611be6565b34801561058657600080fd5b5061026a610595366004613678565b611f5b565b3480156105a657600080fd5b5061028d6105b53660046138ff565b611f71565b3480156105c657600080fd5b5061028d6105d5366004613983565b612302565b3480156105e657600080fd5b5061028d6105f53660046137bf565b61240d565b34801561060657600080fd5b5061060f612437565b60405161024191906139bc565b34801561062857600080fd5b50600b546102d8565b34801561063d57600080fd5b5061028d61064c3660046137bf565b612498565b34801561065d57600080fd5b5061040f61250b565b34801561067257600080fd5b5061026a610681366004613678565b612637565b34801561069257600080fd5b506102d86106a1366004613983565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b3480156106d857600080fd5b5061028d6106e73660046137bf565b6126ab565b3480156106f857600080fd5b506102d86107073660046137bf565b612762565b34801561071857600080fd5b5061028d610727366004613678565b6127dd565b60606003805461073b906139cf565b80601f0160208091040260200160405190810160405280929190818152602001828054610767906139cf565b80156107b45780601f10610789576101008083540402835291602001916107b4565b820191906000526020600020905b81548152906001019060200180831161079757829003601f168201915b5050505050905090565b3360008181526001602090815260408083206001600160a01b03871680855292528083208590555191929091600080516020613dd9833981519152906108079086815260200190565b60405180910390a35060015b92915050565b6002600554036108445760405162461bcd60e51b815260040161083b90613a09565b60405180910390fd5b600260055561085161283d565b61085b8686612887565b6108706001600160a01b0387168684846128fb565b6108986001600160a01b038716731111111254fb6c44bac0bed2854e76f90643097d866129a2565b6040516305d2b6d960e31b8152731111111254fb6c44bac0bed2854e76f90643097d90632e95b6c8906108d79089908890889088908890600401613a76565b6020604051808303816000875af11580156108f6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061091a9190613aa4565b5061092786868686612a8d565b5050600160055550505050565b61093c612af3565b600f55565b6000336001600160a01b038516148061097d57506001600160a01b03841660009081526001602090815260408083203384529091529020548211155b6109c15760405162461bcd60e51b815260206004820152601560248201527422a9292fa12a27a5a2a72fa120a22fa1a0a62622a960591b604482015260640161083b565b6109cc848484612b42565b336001600160a01b03851614801590610a1857506001600160a01b03841660009081526001602090815260408083203384529091529020546fffffffffffffffffffffffffffffffff14155b15610a9a576001600160a01b0384166000908152600160209081526040808320338452909152902054610a4c908390613ad3565b6001600160a01b038581166000908152600160209081526040808320338085529083529281902085905551938452918616929091600080516020613dd9833981519152910160405180910390a35b5060015b9392505050565b600260055403610ac75760405162461bcd60e51b815260040161083b90613a09565b6002600555336000908152600a602052604090205460ff16610b1b5760405162461bcd60e51b815260206004820152600d60248201526c4552525f4e4f545f464f52474560981b604482015260640161083b565b6000610b2660025490565b90506000610b348383612c4e565b905080600003610b565760405162461bcd60e51b815260040161083b90613aea565b610b603384612d73565b610b6983612d7e565b60408051608081018252600080825260208201819052918101829052606081018290526000805b600b54811015610d0457600b8181548110610bad57610bad613b13565b60009182526020808320909101546001600160a01b0316808352600c82526040928390208351608081018552815460ff808216151583526101009091041615159381018490526001820154948101949094526002015460608401529550909350610c4d5760405162461bcd60e51b81526020600482015260116024820152704552525f4f55545f4e4f545f524541445960781b604482015260640161083b565b610c5b858460600151612e4c565b915081600003610c7d5760405162461bcd60e51b815260040161083b90613aea565b610c8b836060015183612f27565b6001600160a01b0385166000908152600c6020526040902060020155610cb2843384612f84565b6040518281526001600160a01b0385169033907fe74c91552b64c2e2e7bd255639e004e693bd3e1d01cc33e65610b86afcc1ffed9060200160405180910390a380610cfc81613b29565b915050610b90565b505060016005555050505050565b610d1a612af3565b6001600160a01b03811660009081526009602052604090205460ff1615610d7d5760405162461bcd60e51b815260206004820152601760248201527611549497d193d491d157d053149150511657d051111151604a1b604482015260640161083b565b6001600160a01b038116600081815260096020526040808220805460ff19166001179055517f3e8033965d38bf14f7324229095da5e193ecb0204a77a56d309da0c94882fd279190a250565b6060806000610dd760025490565b90506000610de58583612c4e565b905080600003610e075760405162461bcd60e51b815260040161083b90613aea565b600b805480602002602001604051908101604052809291908181526020018280548015610e5d57602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610e3f575b5050600b54939750505067ffffffffffffffff8211159050610e8157610e81613b42565b604051908082528060200260200182016040528015610eaa578160200160208202803683370190505b5092506000805b600b54811015610f23576000610edf878381518110610ed257610ed2613b13565b6020026020010151612f9d565b509050610ef0848260600151612e4c565b925082868381518110610f0557610f05613b13565b60209081029190910101525080610f1b81613b29565b915050610eb1565b50505050915091565b6000600260055403610f505760405162461bcd60e51b815260040161083b90613a09565b60026005553360009081526009602052604090205460ff16610fa45760405162461bcd60e51b815260206004820152600d60248201526c4552525f4e4f545f464f52474560981b604482015260640161083b565b600d546001600160a01b0316610ffc5760405162461bcd60e51b815260206004820152601a60248201527f4552525f44594e415345545f4f5241434c455f4e4f545f534554000000000000604482015260640161083b565b5080600061100960025490565b905060006110178383612c4e565b9050806000036110395760405162461bcd60e51b815260040161083b90613aea565b6000806000600d60009054906101000a90046001600160a01b03166001600160a01b031663d66d13e06040518163ffffffff1660e01b8152600401602060405180830381865afa158015611091573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110b59190613aa4565b905060005b600b548110156112ab57600b81815481106110d7576110d7613b13565b60009182526020822001546001600160a01b031693506110f684612f9d565b9150506111038682612e4c565b9450846000036111255760405162461bcd60e51b815260040161083b90613aea565b6040516370a0823160e01b81523360048201526000906001600160a01b038616906370a0823190602401602060405180830381865afa15801561116c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111909190613aa4565b90508581101561119e578095505b604051636eb1769f60e11b81523360048201523060248201526000906001600160a01b0387169063dd62ed3e90604401602060405180830381865afa1580156111eb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061120f9190613aa4565b90508681101561121d578096505b61124a8661122b858a613040565b6001600160a01b039091166000908152600c6020526040902060020155565b611255863389613092565b60405187815233906001600160a01b038816907f63982df10efd8dfaaaa0fcc7f50b2d93b7cba26ccc48adee2873220d485dc39a9060200160405180910390a350505080806112a390613b29565b9150506110ba565b50600081600d60009054906101000a90046001600160a01b03166001600160a01b031663d66d13e06040518163ffffffff1660e01b8152600401602060405180830381865afa158015611302573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113269190613aa4565b6113309190613ad3565b90508161133d8783613b58565b6113479190613b77565b96506000871161138e5760405162461bcd60e51b81526020600482015260126024820152714d494e545f5a45524f5f44594e415345545360701b604482015260640161083b565b611397876130a7565b6113a13388613118565b505060016005555092949350505050565b6002600554036113d45760405162461bcd60e51b815260040161083b90613a09565b60026005556113e161283d565b600b546002106114245760405162461bcd60e51b815260206004820152600e60248201526d4552525f4d494e5f544f4b454e5360901b604482015260640161083b565b6001600160a01b0381166000908152600c60209081526040918290208251608081018452815460ff80821615158352610100909104161515928101929092526001810154928201929092526002909101546060820181905280156114ca5760405162461bcd60e51b815260206004820152601860248201527f4552525f43414e5f4e4f545f52454d4f56455f544f4b454e0000000000000000604482015260640161083b565b6040820151600b546000906114e190600190613ad3565b905080821461163857600b81815481106114fd576114fd613b13565b600091825260209091200154600b80546001600160a01b03909216918490811061152957611529613b13565b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b031602179055508160ff16600c6000600b858154811061157257611572613b13565b60009182526020808320909101546001600160a01b03168352820192909252604001812060010191909155600b8054600c929190849081106115b6576115b6613b13565b9060005260206000200160009054906101000a90046001600160a01b03166001600160a01b03166001600160a01b0316815260200190815260200160002060020154600c6000600b858154811061160f5761160f613b13565b60009182526020808320909101546001600160a01b031683528201929092526040019020600201555b600b80548061164957611649613b99565b60008281526020808220600019908401810180546001600160a01b031916905590920190925560408051608081018252838152808301848152818301858152606083018681526001600160a01b038c16808852600c90965284872093518454935161ffff1990941690151561ff0019161761010093151593909302929092178355516001830155516002909101555190917f48207b8b88ad0363606ff7f381bc9ee60bb9b614b5dccd985ae4cb02af0f77c391a250506001600555505050565b604080516080810182526000808252602082018190529181018290526060810191909152506001600160a01b0381166000908152600c60209081526040918290208251608081018452815460ff80821615158084526101009092041615159382019390935260018201549381019390935260020154606083015261179f5760405162461bcd60e51b815260040161083b90613baf565b919050565b3360009081526001602090815260408083206001600160a01b0386168452909152812054808311156117f9573360009081526001602090815260408083206001600160a01b0388168452909152812055611828565b6118038382613ad3565b3360009081526001602090815260408083206001600160a01b03891684529091529020555b3360008181526001602090815260408083206001600160a01b03891680855290835292819020549051908152919291600080516020613dd9833981519152910160405180910390a35060019392505050565b60026005540361189c5760405162461bcd60e51b815260040161083b90613a09565b60026005556118a961283d565b6118b38686612887565b6118c86001600160a01b038716868484613123565b6118f06001600160a01b038716731111111254fb6c44bac0bed2854e76f90643097d866129a2565b604051637224811760e11b8152731111111254fb6c44bac0bed2854e76f90643097d9063e449022e906108d7908790879087908790600401613bd6565b60026005540361194f5760405162461bcd60e51b815260040161083b90613a09565b600260055561195c61283d565b6119668484612887565b600e54611980906001600160a01b038681169116846129a2565b60606001600160a01b03851673c02aaa39b223fe8d0a0e5c4f27ead9083c756cc214806119c957506001600160a01b03841673c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2145b15611a5b5760408051600280825260608201835290916020830190803683370190505090508481600081518110611a0257611a02613b13565b60200260200101906001600160a01b031690816001600160a01b0316815250508381600181518110611a3657611a36613b13565b60200260200101906001600160a01b031690816001600160a01b031681525050611b2d565b6040805160038082526080820190925290602082016060803683370190505090508481600081518110611a9057611a90613b13565b60200260200101906001600160a01b031690816001600160a01b03168152505073c02aaa39b223fe8d0a0e5c4f27ead9083c756cc281600181518110611ad857611ad8613b13565b60200260200101906001600160a01b031690816001600160a01b0316815250508381600281518110611b0c57611b0c613b13565b60200260200101906001600160a01b031690816001600160a01b0316815250505b600e54600f546001600160a01b03909116906338ed1739908590859085903090611b579042613bf6565b6040518663ffffffff1660e01b8152600401611b77959493929190613c0e565b6000604051808303816000875af1158015611b96573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052611bbe9190810190613c4a565b50611bcb85858585612a8d565b50506001600555505050565b60606004805461073b906139cf565b600260055403611c085760405162461bcd60e51b815260040161083b90613a09565b6002600555611c1561283d565b6001600160a01b038316611c5c5760405162461bcd60e51b815260206004820152600e60248201526d22a9292fad22a927afaa27a5a2a760911b604482015260640161083b565b600b54601411611c9f5760405162461bcd60e51b815260206004820152600e60248201526d4552525f4d41585f544f4b454e5360901b604482015260640161083b565b6001600160a01b038116611cf55760405162461bcd60e51b815260206004820152601760248201527f4552525f5a45524f5f544f4b454e5f50524f5649444552000000000000000000604482015260640161083b565b6001600160a01b0383166000908152600c602052604090205460ff1615611d4d5760405162461bcd60e51b815260206004820152600c60248201526b11549497d254d7d093d5539160a21b604482015260640161083b565b60008211611d8f5760405162461bcd60e51b815260206004820152600f60248201526e4552525f4d494e5f42414c414e434560881b604482015260640161083b565b604051636eb1769f60e11b81526001600160a01b03828116600483015230602483015283919085169063dd62ed3e90604401602060405180830381865afa158015611dde573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e029190613aa4565b1015611e505760405162461bcd60e51b815260206004820152601a60248201527f4552525f494e53554646494349454e545f414c4c4f57414e4345000000000000604482015260640161083b565b6040805160808101825260018082526020808301828152600b805460ff16858701908152606086018981526001600160a01b038b166000818152600c90965297852096518754945161ffff1990951690151561ff00191617610100941515949094029390931786555185850155905160029094019390935582549182018355919091527f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01db90180546001600160a01b0319169091179055611f11838284613092565b806001600160a01b0316836001600160a01b03167fad3294aab2ec3d457e8b2c34125e9cc6abb32088405c71d3701d59c189d1688b60405160405180910390a35050600160055550565b6000611f68338484612b42565b50600192915050565b600260055403611f935760405162461bcd60e51b815260040161083b90613a09565b6002600555611fa061316b565b600b5415611fe25760405162461bcd60e51b815260206004820152600f60248201526e11549497d253925512505312569151608a1b604482015260640161083b565b6001600160a01b0381166120315760405162461bcd60e51b815260206004820152601660248201527524a72b20a624a22faa27a5a2a72fa82927ab24a222a960511b604482015260640161083b565b8360028110156120745760405162461bcd60e51b815260206004820152600e60248201526d4552525f4d494e5f544f4b454e5360901b604482015260640161083b565b60148111156120b65760405162461bcd60e51b815260206004820152600e60248201526d4552525f4d41585f544f4b454e5360901b604482015260640161083b565b6120d16120cc670de0b6b3a76400006064613b58565b6130a7565b60008060005b8381101561227b578888828181106120f1576120f1613b13565b905060200201602081019061210691906137bf565b92506001600160a01b03831661214e5760405162461bcd60e51b815260206004820152600d60248201526c24a72b20a624a22faa27a5a2a760991b604482015260640161083b565b86868281811061216057612160613b13565b905060200201359150600082116121ab5760405162461bcd60e51b815260206004820152600f60248201526e4552525f4d494e5f42414c414e434560881b604482015260640161083b565b604080516080810182526001808252602080830182815260ff8616848601908152606085018881526001600160a01b038a166000818152600c90955296842095518654935161ffff1990941690151561ff0019161761010093151593909302929092178555518484015551600290930192909255600b805491820181559091527f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01db90180546001600160a01b0319169091179055612269838684613092565b8061227381613b29565b9150506120d7565b5061229884612293670de0b6b3a76400006064613b58565b613118565b836001600160a01b031688886040516122b2929190613d08565b60405180910390207fee29c4ecb305fc552ccd2503b77a9b843043f6298df130f25f2c272716206ea088886040516122eb929190613d4a565b60405180910390a350506001600555505050505050565b6040516370a0823160e01b81523060048201526000906001600160a01b038416906370a0823190602401602060405180830381865afa158015612349573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061236d9190613aa4565b6040516370a0823160e01b81523060048201529091506000906001600160a01b038416906370a0823190602401602060405180830381865afa1580156123b7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123db9190613aa4565b6001600160a01b039485166000908152600c602052604080822060029081019590955594909516855292909320015550565b61241561316b565b600d80546001600160a01b0319166001600160a01b0392909216919091179055565b6060600b8054806020026020016040519081016040528092919081815260200182805480156107b457602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311612471575050505050905090565b6124a0612af3565b6001600160a01b0381166124e95760405162461bcd60e51b815260206004820152601060248201526f4552525f414444524553535f5a45524f60801b604482015260640161083b565b600e80546001600160a01b0319166001600160a01b0392909216919091179055565b606080600b80548060200260200160405190810160405280929190818152602001828054801561256457602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311612546575b5050600b54939550505067ffffffffffffffff821115905061258857612588613b42565b6040519080825280602002602001820160405280156125b1578160200160208202803683370190505b50905060005b600b5481101561263257600c60008483815181106125d7576125d7613b13565b60200260200101516001600160a01b03166001600160a01b031681526020019081526020016000206002015482828151811061261557612615613b13565b60209081029190910101528061262a81613b29565b9150506125b7565b509091565b3360009081526001602090815260408083206001600160a01b0386168452909152812054612666908390613bf6565b3360008181526001602090815260408083206001600160a01b03891680855290835292819020859055519384529092600080516020613dd98339815191529101610807565b6126b3612af3565b6001600160a01b0381166000908152600a602052604090205460ff16156127165760405162461bcd60e51b815260206004820152601760248201527611549497d193d491d157d053149150511657d051111151604a1b604482015260640161083b565b6001600160a01b0381166000818152600a6020526040808220805460ff19166001179055517fb8aafec1aa056456cdaa0f9446ba81026cd6950d76df9602a23f41435cde410a9190a250565b6001600160a01b0381166000908152600c602090815260408083208151608081018352815460ff808216151580845261010090920416151594820194909452600182015492810192909252600201546060820152906127d35760405162461bcd60e51b815260040161083b90613baf565b6060015192915050565b6127e561316b565b816127fa6001600160a01b03821633846131b7565b6040516001600160a01b038416815282907fc18340ba98721bcff47f10f30da90ced66f2b96b9afed4cbdf4e0184b4a704699060200160405180910390a2505050565b6008546001600160a01b031633146128855760405162461bcd60e51b815260206004820152600b60248201526a4552525f4e4f545f44414d60a81b604482015260640161083b565b565b6001600160a01b0382166000908152600c602052604090205460ff166128bf5760405162461bcd60e51b815260040161083b90613baf565b6001600160a01b0381166000908152600c602052604090205460ff166128f75760405162461bcd60e51b815260040161083b90613baf565b5050565b8360005b60ff8116831115612946576129328285858460ff1681811061292357612923613b13565b9050602002013560001c6131e7565b91508061293e81613d5e565b9150506128ff565b50836001600160a01b0316816001600160a01b03161461299b5760405162461bcd60e51b815260206004820152601060248201526f22a9292fa7aaaa282aaa2faa27a5a2a760811b604482015260640161083b565b5050505050565b604051636eb1769f60e11b81523060048201526001600160a01b038381166024830152600091839186169063dd62ed3e90604401602060405180830381865afa1580156129f3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612a179190613aa4565b612a219190613bf6565b6040516001600160a01b038516602482015260448101829052909150612a8790859063095ea7b360e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915261333f565b50505050565b612a978484612302565b826001600160a01b0316846001600160a01b03167ffa2dda1cc1b86e41239702756b13effbc1a092b5c57e3ad320fbe4f3b13fe2358484604051612ae5929190918252602082015260400190565b60405180910390a350505050565b6006546001600160a01b031633146128855760405162461bcd60e51b815260206004820152601260248201527122a9292fa727aa2fa1a7a72a2927a62622a960711b604482015260640161083b565b6001600160a01b038316600090815260208190526040902054811115612ba15760405162461bcd60e51b815260206004820152601460248201527311549497d25394d551919250d251539517d0905360621b604482015260640161083b565b6001600160a01b038316600090815260208190526040902054612bc5908290613ad3565b6001600160a01b038085166000908152602081905260408082209390935590841681522054612bf5908290613bf6565b6001600160a01b038381166000818152602081815260409182902094909455518481529092918616917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a3505050565b600081600003612c8f5760405162461bcd60e51b815260206004820152600c60248201526b4552525f4449565f5a45524f60a01b604482015260640161083b565b6000612ca3670de0b6b3a764000085613b58565b9050831580612cc25750670de0b6b3a7640000612cc08583613b77565b145b612d015760405162461bcd60e51b815260206004820152601060248201526f11549497d1125597d25395115493905360821b604482015260640161083b565b6000612d0e600285613b77565b612d189083613bf6565b905081811015612d5d5760405162461bcd60e51b815260206004820152601060248201526f11549497d1125597d25395115493905360821b604482015260640161083b565b6000612d698583613b77565b9695505050505050565b6128f7823083612b42565b30600090815260208190526040902054811115612dd45760405162461bcd60e51b815260206004820152601460248201527311549497d25394d551919250d251539517d0905360621b604482015260640161083b565b30600090815260208190526040902054612def908290613ad3565b30600090815260208190526040902055600254612e0d908290613ad3565b60025560405181815260009030907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906020015b60405180910390a350565b600080612e598385613b58565b9050831580612e70575082612e6e8583613b77565b145b612eaf5760405162461bcd60e51b815260206004820152601060248201526f4552525f4d554c5f4f564552464c4f5760801b604482015260640161083b565b6000612ec46002670de0b6b3a7640000613b77565b612ece9083613bf6565b905081811015612f135760405162461bcd60e51b815260206004820152601060248201526f4552525f4d554c5f4f564552464c4f5760801b604482015260640161083b565b6000612d69670de0b6b3a764000083613b77565b6000806000612f368585613411565b915091508015612f7c5760405162461bcd60e51b81526020600482015260116024820152704552525f5355425f554e444552464c4f5760781b604482015260640161083b565b509392505050565b612f986001600160a01b03841683836131b7565b505050565b604080516080810182526000808252602082018190529181018290526060810191909152506001600160a01b0381166000908152600c602090815260408083208151608081018352815460ff80821615158084526101009092041615159482019490945260018201549281019290925260020154606082015291906130345760405162461bcd60e51b815260040161083b90613baf565b81606001519050915091565b60008061304d8385613bf6565b905083811015610a9e5760405162461bcd60e51b815260206004820152601060248201526f4552525f4144445f4f564552464c4f5760801b604482015260640161083b565b612f986001600160a01b038416833084613448565b306000908152602081905260409020546130c2908290613bf6565b306000908152602081905260409020556002546130e0908290613bf6565b60025560405181815230906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90602001612e41565b6128f7308383612b42565b8360005b60ff8116831115612946576131578285858460ff1681811061314b5761314b613b13565b905060200201356131e7565b91508061316381613d5e565b915050613127565b6007546001600160a01b031633146128855760405162461bcd60e51b815260206004820152600f60248201526e4552525f4e4f545f464143544f525960881b604482015260640161083b565b6040516001600160a01b038316602482015260448101829052612f9890849063a9059cbb60e01b90606401612a50565b600080826001600160a01b0316630dfe16816040518163ffffffff1660e01b8152600401602060405180830381865afa158015613228573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061324c9190613d7d565b90506000836001600160a01b031663d21220a76040518163ffffffff1660e01b8152600401602060405180830381865afa15801561328e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906132b29190613d7d565b9050846001600160a01b0316826001600160a01b0316036132d65791506108139050565b846001600160a01b0316816001600160a01b0316036132f757509050610813565b60405162461bcd60e51b815260206004820152601960248201527f4552525f544f4b454e5f4d495353494e475f494e5f5041495200000000000000604482015260640161083b565b6000613394826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166134809092919063ffffffff16565b805190915015612f9857808060200190518101906133b29190613d9a565b612f985760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b606482015260840161083b565b600080828410613430576134258385613ad3565b600091509150613441565b61343a8484613ad3565b6001915091505b9250929050565b6040516001600160a01b0380851660248301528316604482015260648101829052612a879085906323b872dd60e01b90608401612a50565b606061348f8484600085613497565b949350505050565b6060824710156134f85760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b606482015260840161083b565b6001600160a01b0385163b61354f5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161083b565b600080866001600160a01b0316858760405161356b9190613dbc565b60006040518083038185875af1925050503d80600081146135a8576040519150601f19603f3d011682016040523d82523d6000602084013e6135ad565b606091505b50915091506135bd8282866135c8565b979650505050505050565b606083156135d7575081610a9e565b8251156135e75782518084602001fd5b8160405162461bcd60e51b815260040161083b919061362d565b60005b8381101561361c578181015183820152602001613604565b83811115612a875750506000910152565b602081526000825180602084015261364c816040850160208701613601565b601f01601f19169190910160400192915050565b6001600160a01b038116811461367557600080fd5b50565b6000806040838503121561368b57600080fd5b823561369681613660565b946020939093013593505050565b60008083601f8401126136b657600080fd5b50813567ffffffffffffffff8111156136ce57600080fd5b6020830191508360208260051b850101111561344157600080fd5b60008060008060008060a0878903121561370257600080fd5b863561370d81613660565b9550602087013561371d81613660565b94506040870135935060608701359250608087013567ffffffffffffffff81111561374757600080fd5b61375389828a016136a4565b979a9699509497509295939492505050565b60006020828403121561377757600080fd5b5035919050565b60008060006060848603121561379357600080fd5b833561379e81613660565b925060208401356137ae81613660565b929592945050506040919091013590565b6000602082840312156137d157600080fd5b8135610a9e81613660565b600081518084526020808501945080840160005b838110156138155781516001600160a01b0316875295820195908201906001016137f0565b509495945050505050565b60408152600061383360408301856137dc565b82810360208481019190915284518083528582019282019060005b8181101561386a5784518352938301939183019160010161384e565b5090979650505050505050565b6000806000806080858703121561388d57600080fd5b843561389881613660565b935060208501356138a881613660565b93969395505050506040820135916060013590565b6000806000606084860312156138d257600080fd5b83356138dd81613660565b92506020840135915060408401356138f481613660565b809150509250925092565b60008060008060006060868803121561391757600080fd5b853567ffffffffffffffff8082111561392f57600080fd5b61393b89838a016136a4565b9097509550602088013591508082111561395457600080fd5b50613961888289016136a4565b909450925050604086013561397581613660565b809150509295509295909350565b6000806040838503121561399657600080fd5b82356139a181613660565b915060208301356139b181613660565b809150509250929050565b602081526000610a9e60208301846137dc565b600181811c908216806139e357607f821691505b602082108103613a0357634e487b7160e01b600052602260045260246000fd5b50919050565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b81835260006001600160fb1b03831115613a5957600080fd5b8260051b8083602087013760009401602001938452509192915050565b60018060a01b03861681528460208201528360408201526080606082015260006135bd608083018486613a40565b600060208284031215613ab657600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b600082821015613ae557613ae5613abd565b500390565b6020808252600f908201526e08aa4a4be9a82a890be82a0a0a49eb608b1b604082015260600190565b634e487b7160e01b600052603260045260246000fd5b600060018201613b3b57613b3b613abd565b5060010190565b634e487b7160e01b600052604160045260246000fd5b6000816000190483118215151615613b7257613b72613abd565b500290565b600082613b9457634e487b7160e01b600052601260045260246000fd5b500490565b634e487b7160e01b600052603160045260246000fd5b6020808252600d908201526c11549497d393d517d093d55391609a1b604082015260600190565b848152836020820152606060408201526000612d69606083018486613a40565b60008219821115613c0957613c09613abd565b500190565b85815284602082015260a060408201526000613c2d60a08301866137dc565b6001600160a01b0394909416606083015250608001529392505050565b60006020808385031215613c5d57600080fd5b825167ffffffffffffffff80821115613c7557600080fd5b818501915085601f830112613c8957600080fd5b815181811115613c9b57613c9b613b42565b8060051b604051601f19603f83011681018181108582111715613cc057613cc0613b42565b604052918252848201925083810185019188831115613cde57600080fd5b938501935b82851015613cfc57845184529385019392850192613ce3565b98975050505050505050565b60008184825b85811015613d3f578135613d2181613660565b6001600160a01b031683526020928301929190910190600101613d0e565b509095945050505050565b60208152600061348f602083018486613a40565b600060ff821660ff8103613d7457613d74613abd565b60010192915050565b600060208284031215613d8f57600080fd5b8151610a9e81613660565b600060208284031215613dac57600080fd5b81518015158114610a9e57600080fd5b60008251613dce818460208701613601565b919091019291505056fe8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925a2646970667358221220b77a6de6c5965c542b537bfee3b2a2e4c3fd8e348b922de9578f27839594b2dc64736f6c634300080f0033000000000000000000000000b245ab0d2e9dfb99b1212eb3d7732c22591557a2000000000000000000000000372a1674b1d84a2e9891d04453b5b1cbd12b452f000000000000000000000000cd231d4ba7b15a4722ac057419d9cd7689e7b8db00000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000000b4254432044796e61536574000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000664796e4254430000000000000000000000000000000000000000000000000000Deployed Bytecode
0x60806040526004361061021a5760003560e01c806370a0823111610123578063cbb61226116100ab578063d73dd6231161006f578063d73dd62314610666578063dd62ed3e14610686578063de009a44146106cc578063f8b2cb4f146106ec578063fd9be5221461070c57600080fd5b8063cbb61226146105da578063cc77828d146105fa578063cd2ed8fb1461061c578063cd4c690214610631578063d73cc4df1461065157600080fd5b806395d89b41116100f257806395d89b4114610545578063a766a3921461055a578063a9059cbb1461057a578063b9d52f711461059a578063c963ac98146105ba57600080fd5b806370a08231146104d45780637cb470d71461050a5780638025e3031461051d578063848955461461053257600080fd5b80632f37b624116101a6578063371babdc11610175578063371babdc146103ef5780633fe906751461041d5780635fa7b5841461043d57806364c7d6611461045d57806366188463146104b457600080fd5b80632f37b6241461035c5780633018205f14610395578063313ce567146103b3578063339c0528146103cf57600080fd5b806318160ddd116101ed57806318160ddd146102c7578063195199f6146102e657806323b872dd1461030657806323ddc5ab1461032657806329dcb0cf1461034657600080fd5b806306fdde031461021f578063095ea7b31461024a578063107783ec1461027a5780631694505e1461028f575b600080fd5b34801561022b57600080fd5b5061023461072c565b604051610241919061362d565b60405180910390f35b34801561025657600080fd5b5061026a610265366004613678565b6107be565b6040519015158152602001610241565b61028d6102883660046136e9565b610819565b005b34801561029b57600080fd5b50600e546102af906001600160a01b031681565b6040516001600160a01b039091168152602001610241565b3480156102d357600080fd5b506002545b604051908152602001610241565b3480156102f257600080fd5b5061028d610301366004613765565b610934565b34801561031257600080fd5b5061026a61032136600461377e565b610941565b34801561033257600080fd5b5061028d610341366004613765565b610aa5565b34801561035257600080fd5b506102d8600f5481565b34801561036857600080fd5b5061026a6103773660046137bf565b6001600160a01b03166000908152600c602052604090205460ff1690565b3480156103a157600080fd5b506006546001600160a01b03166102af565b3480156103bf57600080fd5b5060405160128152602001610241565b3480156103db57600080fd5b5061028d6103ea3660046137bf565b610d12565b3480156103fb57600080fd5b5061040f61040a366004613765565b610dc9565b604051610241929190613820565b34801561042957600080fd5b506102d8610438366004613765565b610f2c565b34801561044957600080fd5b5061028d6104583660046137bf565b6113b2565b34801561046957600080fd5b5061047d6104783660046137bf565b611709565b6040516102419190815115158152602080830151151590820152604080830151908201526060918201519181019190915260800190565b3480156104c057600080fd5b5061026a6104cf366004613678565b6117a4565b3480156104e057600080fd5b506102d86104ef3660046137bf565b6001600160a01b031660009081526020819052604090205490565b61028d6105183660046136e9565b61187a565b34801561052957600080fd5b506102d8600181565b61028d610540366004613877565b61192d565b34801561055157600080fd5b50610234611bd7565b34801561056657600080fd5b5061028d6105753660046138bd565b611be6565b34801561058657600080fd5b5061026a610595366004613678565b611f5b565b3480156105a657600080fd5b5061028d6105b53660046138ff565b611f71565b3480156105c657600080fd5b5061028d6105d5366004613983565b612302565b3480156105e657600080fd5b5061028d6105f53660046137bf565b61240d565b34801561060657600080fd5b5061060f612437565b60405161024191906139bc565b34801561062857600080fd5b50600b546102d8565b34801561063d57600080fd5b5061028d61064c3660046137bf565b612498565b34801561065d57600080fd5b5061040f61250b565b34801561067257600080fd5b5061026a610681366004613678565b612637565b34801561069257600080fd5b506102d86106a1366004613983565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b3480156106d857600080fd5b5061028d6106e73660046137bf565b6126ab565b3480156106f857600080fd5b506102d86107073660046137bf565b612762565b34801561071857600080fd5b5061028d610727366004613678565b6127dd565b60606003805461073b906139cf565b80601f0160208091040260200160405190810160405280929190818152602001828054610767906139cf565b80156107b45780601f10610789576101008083540402835291602001916107b4565b820191906000526020600020905b81548152906001019060200180831161079757829003601f168201915b5050505050905090565b3360008181526001602090815260408083206001600160a01b03871680855292528083208590555191929091600080516020613dd9833981519152906108079086815260200190565b60405180910390a35060015b92915050565b6002600554036108445760405162461bcd60e51b815260040161083b90613a09565b60405180910390fd5b600260055561085161283d565b61085b8686612887565b6108706001600160a01b0387168684846128fb565b6108986001600160a01b038716731111111254fb6c44bac0bed2854e76f90643097d866129a2565b6040516305d2b6d960e31b8152731111111254fb6c44bac0bed2854e76f90643097d90632e95b6c8906108d79089908890889088908890600401613a76565b6020604051808303816000875af11580156108f6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061091a9190613aa4565b5061092786868686612a8d565b5050600160055550505050565b61093c612af3565b600f55565b6000336001600160a01b038516148061097d57506001600160a01b03841660009081526001602090815260408083203384529091529020548211155b6109c15760405162461bcd60e51b815260206004820152601560248201527422a9292fa12a27a5a2a72fa120a22fa1a0a62622a960591b604482015260640161083b565b6109cc848484612b42565b336001600160a01b03851614801590610a1857506001600160a01b03841660009081526001602090815260408083203384529091529020546fffffffffffffffffffffffffffffffff14155b15610a9a576001600160a01b0384166000908152600160209081526040808320338452909152902054610a4c908390613ad3565b6001600160a01b038581166000908152600160209081526040808320338085529083529281902085905551938452918616929091600080516020613dd9833981519152910160405180910390a35b5060015b9392505050565b600260055403610ac75760405162461bcd60e51b815260040161083b90613a09565b6002600555336000908152600a602052604090205460ff16610b1b5760405162461bcd60e51b815260206004820152600d60248201526c4552525f4e4f545f464f52474560981b604482015260640161083b565b6000610b2660025490565b90506000610b348383612c4e565b905080600003610b565760405162461bcd60e51b815260040161083b90613aea565b610b603384612d73565b610b6983612d7e565b60408051608081018252600080825260208201819052918101829052606081018290526000805b600b54811015610d0457600b8181548110610bad57610bad613b13565b60009182526020808320909101546001600160a01b0316808352600c82526040928390208351608081018552815460ff808216151583526101009091041615159381018490526001820154948101949094526002015460608401529550909350610c4d5760405162461bcd60e51b81526020600482015260116024820152704552525f4f55545f4e4f545f524541445960781b604482015260640161083b565b610c5b858460600151612e4c565b915081600003610c7d5760405162461bcd60e51b815260040161083b90613aea565b610c8b836060015183612f27565b6001600160a01b0385166000908152600c6020526040902060020155610cb2843384612f84565b6040518281526001600160a01b0385169033907fe74c91552b64c2e2e7bd255639e004e693bd3e1d01cc33e65610b86afcc1ffed9060200160405180910390a380610cfc81613b29565b915050610b90565b505060016005555050505050565b610d1a612af3565b6001600160a01b03811660009081526009602052604090205460ff1615610d7d5760405162461bcd60e51b815260206004820152601760248201527611549497d193d491d157d053149150511657d051111151604a1b604482015260640161083b565b6001600160a01b038116600081815260096020526040808220805460ff19166001179055517f3e8033965d38bf14f7324229095da5e193ecb0204a77a56d309da0c94882fd279190a250565b6060806000610dd760025490565b90506000610de58583612c4e565b905080600003610e075760405162461bcd60e51b815260040161083b90613aea565b600b805480602002602001604051908101604052809291908181526020018280548015610e5d57602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610e3f575b5050600b54939750505067ffffffffffffffff8211159050610e8157610e81613b42565b604051908082528060200260200182016040528015610eaa578160200160208202803683370190505b5092506000805b600b54811015610f23576000610edf878381518110610ed257610ed2613b13565b6020026020010151612f9d565b509050610ef0848260600151612e4c565b925082868381518110610f0557610f05613b13565b60209081029190910101525080610f1b81613b29565b915050610eb1565b50505050915091565b6000600260055403610f505760405162461bcd60e51b815260040161083b90613a09565b60026005553360009081526009602052604090205460ff16610fa45760405162461bcd60e51b815260206004820152600d60248201526c4552525f4e4f545f464f52474560981b604482015260640161083b565b600d546001600160a01b0316610ffc5760405162461bcd60e51b815260206004820152601a60248201527f4552525f44594e415345545f4f5241434c455f4e4f545f534554000000000000604482015260640161083b565b5080600061100960025490565b905060006110178383612c4e565b9050806000036110395760405162461bcd60e51b815260040161083b90613aea565b6000806000600d60009054906101000a90046001600160a01b03166001600160a01b031663d66d13e06040518163ffffffff1660e01b8152600401602060405180830381865afa158015611091573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110b59190613aa4565b905060005b600b548110156112ab57600b81815481106110d7576110d7613b13565b60009182526020822001546001600160a01b031693506110f684612f9d565b9150506111038682612e4c565b9450846000036111255760405162461bcd60e51b815260040161083b90613aea565b6040516370a0823160e01b81523360048201526000906001600160a01b038616906370a0823190602401602060405180830381865afa15801561116c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111909190613aa4565b90508581101561119e578095505b604051636eb1769f60e11b81523360048201523060248201526000906001600160a01b0387169063dd62ed3e90604401602060405180830381865afa1580156111eb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061120f9190613aa4565b90508681101561121d578096505b61124a8661122b858a613040565b6001600160a01b039091166000908152600c6020526040902060020155565b611255863389613092565b60405187815233906001600160a01b038816907f63982df10efd8dfaaaa0fcc7f50b2d93b7cba26ccc48adee2873220d485dc39a9060200160405180910390a350505080806112a390613b29565b9150506110ba565b50600081600d60009054906101000a90046001600160a01b03166001600160a01b031663d66d13e06040518163ffffffff1660e01b8152600401602060405180830381865afa158015611302573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113269190613aa4565b6113309190613ad3565b90508161133d8783613b58565b6113479190613b77565b96506000871161138e5760405162461bcd60e51b81526020600482015260126024820152714d494e545f5a45524f5f44594e415345545360701b604482015260640161083b565b611397876130a7565b6113a13388613118565b505060016005555092949350505050565b6002600554036113d45760405162461bcd60e51b815260040161083b90613a09565b60026005556113e161283d565b600b546002106114245760405162461bcd60e51b815260206004820152600e60248201526d4552525f4d494e5f544f4b454e5360901b604482015260640161083b565b6001600160a01b0381166000908152600c60209081526040918290208251608081018452815460ff80821615158352610100909104161515928101929092526001810154928201929092526002909101546060820181905280156114ca5760405162461bcd60e51b815260206004820152601860248201527f4552525f43414e5f4e4f545f52454d4f56455f544f4b454e0000000000000000604482015260640161083b565b6040820151600b546000906114e190600190613ad3565b905080821461163857600b81815481106114fd576114fd613b13565b600091825260209091200154600b80546001600160a01b03909216918490811061152957611529613b13565b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b031602179055508160ff16600c6000600b858154811061157257611572613b13565b60009182526020808320909101546001600160a01b03168352820192909252604001812060010191909155600b8054600c929190849081106115b6576115b6613b13565b9060005260206000200160009054906101000a90046001600160a01b03166001600160a01b03166001600160a01b0316815260200190815260200160002060020154600c6000600b858154811061160f5761160f613b13565b60009182526020808320909101546001600160a01b031683528201929092526040019020600201555b600b80548061164957611649613b99565b60008281526020808220600019908401810180546001600160a01b031916905590920190925560408051608081018252838152808301848152818301858152606083018681526001600160a01b038c16808852600c90965284872093518454935161ffff1990941690151561ff0019161761010093151593909302929092178355516001830155516002909101555190917f48207b8b88ad0363606ff7f381bc9ee60bb9b614b5dccd985ae4cb02af0f77c391a250506001600555505050565b604080516080810182526000808252602082018190529181018290526060810191909152506001600160a01b0381166000908152600c60209081526040918290208251608081018452815460ff80821615158084526101009092041615159382019390935260018201549381019390935260020154606083015261179f5760405162461bcd60e51b815260040161083b90613baf565b919050565b3360009081526001602090815260408083206001600160a01b0386168452909152812054808311156117f9573360009081526001602090815260408083206001600160a01b0388168452909152812055611828565b6118038382613ad3565b3360009081526001602090815260408083206001600160a01b03891684529091529020555b3360008181526001602090815260408083206001600160a01b03891680855290835292819020549051908152919291600080516020613dd9833981519152910160405180910390a35060019392505050565b60026005540361189c5760405162461bcd60e51b815260040161083b90613a09565b60026005556118a961283d565b6118b38686612887565b6118c86001600160a01b038716868484613123565b6118f06001600160a01b038716731111111254fb6c44bac0bed2854e76f90643097d866129a2565b604051637224811760e11b8152731111111254fb6c44bac0bed2854e76f90643097d9063e449022e906108d7908790879087908790600401613bd6565b60026005540361194f5760405162461bcd60e51b815260040161083b90613a09565b600260055561195c61283d565b6119668484612887565b600e54611980906001600160a01b038681169116846129a2565b60606001600160a01b03851673c02aaa39b223fe8d0a0e5c4f27ead9083c756cc214806119c957506001600160a01b03841673c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2145b15611a5b5760408051600280825260608201835290916020830190803683370190505090508481600081518110611a0257611a02613b13565b60200260200101906001600160a01b031690816001600160a01b0316815250508381600181518110611a3657611a36613b13565b60200260200101906001600160a01b031690816001600160a01b031681525050611b2d565b6040805160038082526080820190925290602082016060803683370190505090508481600081518110611a9057611a90613b13565b60200260200101906001600160a01b031690816001600160a01b03168152505073c02aaa39b223fe8d0a0e5c4f27ead9083c756cc281600181518110611ad857611ad8613b13565b60200260200101906001600160a01b031690816001600160a01b0316815250508381600281518110611b0c57611b0c613b13565b60200260200101906001600160a01b031690816001600160a01b0316815250505b600e54600f546001600160a01b03909116906338ed1739908590859085903090611b579042613bf6565b6040518663ffffffff1660e01b8152600401611b77959493929190613c0e565b6000604051808303816000875af1158015611b96573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052611bbe9190810190613c4a565b50611bcb85858585612a8d565b50506001600555505050565b60606004805461073b906139cf565b600260055403611c085760405162461bcd60e51b815260040161083b90613a09565b6002600555611c1561283d565b6001600160a01b038316611c5c5760405162461bcd60e51b815260206004820152600e60248201526d22a9292fad22a927afaa27a5a2a760911b604482015260640161083b565b600b54601411611c9f5760405162461bcd60e51b815260206004820152600e60248201526d4552525f4d41585f544f4b454e5360901b604482015260640161083b565b6001600160a01b038116611cf55760405162461bcd60e51b815260206004820152601760248201527f4552525f5a45524f5f544f4b454e5f50524f5649444552000000000000000000604482015260640161083b565b6001600160a01b0383166000908152600c602052604090205460ff1615611d4d5760405162461bcd60e51b815260206004820152600c60248201526b11549497d254d7d093d5539160a21b604482015260640161083b565b60008211611d8f5760405162461bcd60e51b815260206004820152600f60248201526e4552525f4d494e5f42414c414e434560881b604482015260640161083b565b604051636eb1769f60e11b81526001600160a01b03828116600483015230602483015283919085169063dd62ed3e90604401602060405180830381865afa158015611dde573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e029190613aa4565b1015611e505760405162461bcd60e51b815260206004820152601a60248201527f4552525f494e53554646494349454e545f414c4c4f57414e4345000000000000604482015260640161083b565b6040805160808101825260018082526020808301828152600b805460ff16858701908152606086018981526001600160a01b038b166000818152600c90965297852096518754945161ffff1990951690151561ff00191617610100941515949094029390931786555185850155905160029094019390935582549182018355919091527f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01db90180546001600160a01b0319169091179055611f11838284613092565b806001600160a01b0316836001600160a01b03167fad3294aab2ec3d457e8b2c34125e9cc6abb32088405c71d3701d59c189d1688b60405160405180910390a35050600160055550565b6000611f68338484612b42565b50600192915050565b600260055403611f935760405162461bcd60e51b815260040161083b90613a09565b6002600555611fa061316b565b600b5415611fe25760405162461bcd60e51b815260206004820152600f60248201526e11549497d253925512505312569151608a1b604482015260640161083b565b6001600160a01b0381166120315760405162461bcd60e51b815260206004820152601660248201527524a72b20a624a22faa27a5a2a72fa82927ab24a222a960511b604482015260640161083b565b8360028110156120745760405162461bcd60e51b815260206004820152600e60248201526d4552525f4d494e5f544f4b454e5360901b604482015260640161083b565b60148111156120b65760405162461bcd60e51b815260206004820152600e60248201526d4552525f4d41585f544f4b454e5360901b604482015260640161083b565b6120d16120cc670de0b6b3a76400006064613b58565b6130a7565b60008060005b8381101561227b578888828181106120f1576120f1613b13565b905060200201602081019061210691906137bf565b92506001600160a01b03831661214e5760405162461bcd60e51b815260206004820152600d60248201526c24a72b20a624a22faa27a5a2a760991b604482015260640161083b565b86868281811061216057612160613b13565b905060200201359150600082116121ab5760405162461bcd60e51b815260206004820152600f60248201526e4552525f4d494e5f42414c414e434560881b604482015260640161083b565b604080516080810182526001808252602080830182815260ff8616848601908152606085018881526001600160a01b038a166000818152600c90955296842095518654935161ffff1990941690151561ff0019161761010093151593909302929092178555518484015551600290930192909255600b805491820181559091527f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01db90180546001600160a01b0319169091179055612269838684613092565b8061227381613b29565b9150506120d7565b5061229884612293670de0b6b3a76400006064613b58565b613118565b836001600160a01b031688886040516122b2929190613d08565b60405180910390207fee29c4ecb305fc552ccd2503b77a9b843043f6298df130f25f2c272716206ea088886040516122eb929190613d4a565b60405180910390a350506001600555505050505050565b6040516370a0823160e01b81523060048201526000906001600160a01b038416906370a0823190602401602060405180830381865afa158015612349573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061236d9190613aa4565b6040516370a0823160e01b81523060048201529091506000906001600160a01b038416906370a0823190602401602060405180830381865afa1580156123b7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123db9190613aa4565b6001600160a01b039485166000908152600c602052604080822060029081019590955594909516855292909320015550565b61241561316b565b600d80546001600160a01b0319166001600160a01b0392909216919091179055565b6060600b8054806020026020016040519081016040528092919081815260200182805480156107b457602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311612471575050505050905090565b6124a0612af3565b6001600160a01b0381166124e95760405162461bcd60e51b815260206004820152601060248201526f4552525f414444524553535f5a45524f60801b604482015260640161083b565b600e80546001600160a01b0319166001600160a01b0392909216919091179055565b606080600b80548060200260200160405190810160405280929190818152602001828054801561256457602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311612546575b5050600b54939550505067ffffffffffffffff821115905061258857612588613b42565b6040519080825280602002602001820160405280156125b1578160200160208202803683370190505b50905060005b600b5481101561263257600c60008483815181106125d7576125d7613b13565b60200260200101516001600160a01b03166001600160a01b031681526020019081526020016000206002015482828151811061261557612615613b13565b60209081029190910101528061262a81613b29565b9150506125b7565b509091565b3360009081526001602090815260408083206001600160a01b0386168452909152812054612666908390613bf6565b3360008181526001602090815260408083206001600160a01b03891680855290835292819020859055519384529092600080516020613dd98339815191529101610807565b6126b3612af3565b6001600160a01b0381166000908152600a602052604090205460ff16156127165760405162461bcd60e51b815260206004820152601760248201527611549497d193d491d157d053149150511657d051111151604a1b604482015260640161083b565b6001600160a01b0381166000818152600a6020526040808220805460ff19166001179055517fb8aafec1aa056456cdaa0f9446ba81026cd6950d76df9602a23f41435cde410a9190a250565b6001600160a01b0381166000908152600c602090815260408083208151608081018352815460ff808216151580845261010090920416151594820194909452600182015492810192909252600201546060820152906127d35760405162461bcd60e51b815260040161083b90613baf565b6060015192915050565b6127e561316b565b816127fa6001600160a01b03821633846131b7565b6040516001600160a01b038416815282907fc18340ba98721bcff47f10f30da90ced66f2b96b9afed4cbdf4e0184b4a704699060200160405180910390a2505050565b6008546001600160a01b031633146128855760405162461bcd60e51b815260206004820152600b60248201526a4552525f4e4f545f44414d60a81b604482015260640161083b565b565b6001600160a01b0382166000908152600c602052604090205460ff166128bf5760405162461bcd60e51b815260040161083b90613baf565b6001600160a01b0381166000908152600c602052604090205460ff166128f75760405162461bcd60e51b815260040161083b90613baf565b5050565b8360005b60ff8116831115612946576129328285858460ff1681811061292357612923613b13565b9050602002013560001c6131e7565b91508061293e81613d5e565b9150506128ff565b50836001600160a01b0316816001600160a01b03161461299b5760405162461bcd60e51b815260206004820152601060248201526f22a9292fa7aaaa282aaa2faa27a5a2a760811b604482015260640161083b565b5050505050565b604051636eb1769f60e11b81523060048201526001600160a01b038381166024830152600091839186169063dd62ed3e90604401602060405180830381865afa1580156129f3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612a179190613aa4565b612a219190613bf6565b6040516001600160a01b038516602482015260448101829052909150612a8790859063095ea7b360e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915261333f565b50505050565b612a978484612302565b826001600160a01b0316846001600160a01b03167ffa2dda1cc1b86e41239702756b13effbc1a092b5c57e3ad320fbe4f3b13fe2358484604051612ae5929190918252602082015260400190565b60405180910390a350505050565b6006546001600160a01b031633146128855760405162461bcd60e51b815260206004820152601260248201527122a9292fa727aa2fa1a7a72a2927a62622a960711b604482015260640161083b565b6001600160a01b038316600090815260208190526040902054811115612ba15760405162461bcd60e51b815260206004820152601460248201527311549497d25394d551919250d251539517d0905360621b604482015260640161083b565b6001600160a01b038316600090815260208190526040902054612bc5908290613ad3565b6001600160a01b038085166000908152602081905260408082209390935590841681522054612bf5908290613bf6565b6001600160a01b038381166000818152602081815260409182902094909455518481529092918616917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a3505050565b600081600003612c8f5760405162461bcd60e51b815260206004820152600c60248201526b4552525f4449565f5a45524f60a01b604482015260640161083b565b6000612ca3670de0b6b3a764000085613b58565b9050831580612cc25750670de0b6b3a7640000612cc08583613b77565b145b612d015760405162461bcd60e51b815260206004820152601060248201526f11549497d1125597d25395115493905360821b604482015260640161083b565b6000612d0e600285613b77565b612d189083613bf6565b905081811015612d5d5760405162461bcd60e51b815260206004820152601060248201526f11549497d1125597d25395115493905360821b604482015260640161083b565b6000612d698583613b77565b9695505050505050565b6128f7823083612b42565b30600090815260208190526040902054811115612dd45760405162461bcd60e51b815260206004820152601460248201527311549497d25394d551919250d251539517d0905360621b604482015260640161083b565b30600090815260208190526040902054612def908290613ad3565b30600090815260208190526040902055600254612e0d908290613ad3565b60025560405181815260009030907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906020015b60405180910390a350565b600080612e598385613b58565b9050831580612e70575082612e6e8583613b77565b145b612eaf5760405162461bcd60e51b815260206004820152601060248201526f4552525f4d554c5f4f564552464c4f5760801b604482015260640161083b565b6000612ec46002670de0b6b3a7640000613b77565b612ece9083613bf6565b905081811015612f135760405162461bcd60e51b815260206004820152601060248201526f4552525f4d554c5f4f564552464c4f5760801b604482015260640161083b565b6000612d69670de0b6b3a764000083613b77565b6000806000612f368585613411565b915091508015612f7c5760405162461bcd60e51b81526020600482015260116024820152704552525f5355425f554e444552464c4f5760781b604482015260640161083b565b509392505050565b612f986001600160a01b03841683836131b7565b505050565b604080516080810182526000808252602082018190529181018290526060810191909152506001600160a01b0381166000908152600c602090815260408083208151608081018352815460ff80821615158084526101009092041615159482019490945260018201549281019290925260020154606082015291906130345760405162461bcd60e51b815260040161083b90613baf565b81606001519050915091565b60008061304d8385613bf6565b905083811015610a9e5760405162461bcd60e51b815260206004820152601060248201526f4552525f4144445f4f564552464c4f5760801b604482015260640161083b565b612f986001600160a01b038416833084613448565b306000908152602081905260409020546130c2908290613bf6565b306000908152602081905260409020556002546130e0908290613bf6565b60025560405181815230906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90602001612e41565b6128f7308383612b42565b8360005b60ff8116831115612946576131578285858460ff1681811061314b5761314b613b13565b905060200201356131e7565b91508061316381613d5e565b915050613127565b6007546001600160a01b031633146128855760405162461bcd60e51b815260206004820152600f60248201526e4552525f4e4f545f464143544f525960881b604482015260640161083b565b6040516001600160a01b038316602482015260448101829052612f9890849063a9059cbb60e01b90606401612a50565b600080826001600160a01b0316630dfe16816040518163ffffffff1660e01b8152600401602060405180830381865afa158015613228573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061324c9190613d7d565b90506000836001600160a01b031663d21220a76040518163ffffffff1660e01b8152600401602060405180830381865afa15801561328e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906132b29190613d7d565b9050846001600160a01b0316826001600160a01b0316036132d65791506108139050565b846001600160a01b0316816001600160a01b0316036132f757509050610813565b60405162461bcd60e51b815260206004820152601960248201527f4552525f544f4b454e5f4d495353494e475f494e5f5041495200000000000000604482015260640161083b565b6000613394826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166134809092919063ffffffff16565b805190915015612f9857808060200190518101906133b29190613d9a565b612f985760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b606482015260840161083b565b600080828410613430576134258385613ad3565b600091509150613441565b61343a8484613ad3565b6001915091505b9250929050565b6040516001600160a01b0380851660248301528316604482015260648101829052612a879085906323b872dd60e01b90608401612a50565b606061348f8484600085613497565b949350505050565b6060824710156134f85760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b606482015260840161083b565b6001600160a01b0385163b61354f5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161083b565b600080866001600160a01b0316858760405161356b9190613dbc565b60006040518083038185875af1925050503d80600081146135a8576040519150601f19603f3d011682016040523d82523d6000602084013e6135ad565b606091505b50915091506135bd8282866135c8565b979650505050505050565b606083156135d7575081610a9e565b8251156135e75782518084602001fd5b8160405162461bcd60e51b815260040161083b919061362d565b60005b8381101561361c578181015183820152602001613604565b83811115612a875750506000910152565b602081526000825180602084015261364c816040850160208701613601565b601f01601f19169190910160400192915050565b6001600160a01b038116811461367557600080fd5b50565b6000806040838503121561368b57600080fd5b823561369681613660565b946020939093013593505050565b60008083601f8401126136b657600080fd5b50813567ffffffffffffffff8111156136ce57600080fd5b6020830191508360208260051b850101111561344157600080fd5b60008060008060008060a0878903121561370257600080fd5b863561370d81613660565b9550602087013561371d81613660565b94506040870135935060608701359250608087013567ffffffffffffffff81111561374757600080fd5b61375389828a016136a4565b979a9699509497509295939492505050565b60006020828403121561377757600080fd5b5035919050565b60008060006060848603121561379357600080fd5b833561379e81613660565b925060208401356137ae81613660565b929592945050506040919091013590565b6000602082840312156137d157600080fd5b8135610a9e81613660565b600081518084526020808501945080840160005b838110156138155781516001600160a01b0316875295820195908201906001016137f0565b509495945050505050565b60408152600061383360408301856137dc565b82810360208481019190915284518083528582019282019060005b8181101561386a5784518352938301939183019160010161384e565b5090979650505050505050565b6000806000806080858703121561388d57600080fd5b843561389881613660565b935060208501356138a881613660565b93969395505050506040820135916060013590565b6000806000606084860312156138d257600080fd5b83356138dd81613660565b92506020840135915060408401356138f481613660565b809150509250925092565b60008060008060006060868803121561391757600080fd5b853567ffffffffffffffff8082111561392f57600080fd5b61393b89838a016136a4565b9097509550602088013591508082111561395457600080fd5b50613961888289016136a4565b909450925050604086013561397581613660565b809150509295509295909350565b6000806040838503121561399657600080fd5b82356139a181613660565b915060208301356139b181613660565b809150509250929050565b602081526000610a9e60208301846137dc565b600181811c908216806139e357607f821691505b602082108103613a0357634e487b7160e01b600052602260045260246000fd5b50919050565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b81835260006001600160fb1b03831115613a5957600080fd5b8260051b8083602087013760009401602001938452509192915050565b60018060a01b03861681528460208201528360408201526080606082015260006135bd608083018486613a40565b600060208284031215613ab657600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b600082821015613ae557613ae5613abd565b500390565b6020808252600f908201526e08aa4a4be9a82a890be82a0a0a49eb608b1b604082015260600190565b634e487b7160e01b600052603260045260246000fd5b600060018201613b3b57613b3b613abd565b5060010190565b634e487b7160e01b600052604160045260246000fd5b6000816000190483118215151615613b7257613b72613abd565b500290565b600082613b9457634e487b7160e01b600052601260045260246000fd5b500490565b634e487b7160e01b600052603160045260246000fd5b6020808252600d908201526c11549497d393d517d093d55391609a1b604082015260600190565b848152836020820152606060408201526000612d69606083018486613a40565b60008219821115613c0957613c09613abd565b500190565b85815284602082015260a060408201526000613c2d60a08301866137dc565b6001600160a01b0394909416606083015250608001529392505050565b60006020808385031215613c5d57600080fd5b825167ffffffffffffffff80821115613c7557600080fd5b818501915085601f830112613c8957600080fd5b815181811115613c9b57613c9b613b42565b8060051b604051601f19603f83011681018181108582111715613cc057613cc0613b42565b604052918252848201925083810185019188831115613cde57600080fd5b938501935b82851015613cfc57845184529385019392850192613ce3565b98975050505050505050565b60008184825b85811015613d3f578135613d2181613660565b6001600160a01b031683526020928301929190910190600101613d0e565b509095945050505050565b60208152600061348f602083018486613a40565b600060ff821660ff8103613d7457613d74613abd565b60010192915050565b600060208284031215613d8f57600080fd5b8151610a9e81613660565b600060208284031215613dac57600080fd5b81518015158114610a9e57600080fd5b60008251613dce818460208701613601565b919091019291505056fe8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925a2646970667358221220b77a6de6c5965c542b537bfee3b2a2e4c3fd8e348b922de9578f27839594b2dc64736f6c634300080f0033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000b245ab0d2e9dfb99b1212eb3d7732c22591557a2000000000000000000000000372a1674b1d84a2e9891d04453b5b1cbd12b452f000000000000000000000000cd231d4ba7b15a4722ac057419d9cd7689e7b8db00000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000000b4254432044796e61536574000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000664796e4254430000000000000000000000000000000000000000000000000000
-----Decoded View---------------
Arg [0] : factoryContract (address): 0xb245Ab0d2e9dfB99b1212eb3d7732c22591557A2
Arg [1] : dam (address): 0x372A1674b1d84a2e9891d04453b5b1cbd12B452F
Arg [2] : controller_ (address): 0xcd231d4ba7B15A4722ac057419D9cd7689e7b8db
Arg [3] : name (string): BTC DynaSet
Arg [4] : symbol (string): dynBTC
-----Encoded View---------------
9 Constructor Arguments found :
Arg [0] : 000000000000000000000000b245ab0d2e9dfb99b1212eb3d7732c22591557a2
Arg [1] : 000000000000000000000000372a1674b1d84a2e9891d04453b5b1cbd12b452f
Arg [2] : 000000000000000000000000cd231d4ba7b15a4722ac057419d9cd7689e7b8db
Arg [3] : 00000000000000000000000000000000000000000000000000000000000000a0
Arg [4] : 00000000000000000000000000000000000000000000000000000000000000e0
Arg [5] : 000000000000000000000000000000000000000000000000000000000000000b
Arg [6] : 4254432044796e61536574000000000000000000000000000000000000000000
Arg [7] : 0000000000000000000000000000000000000000000000000000000000000006
Arg [8] : 64796e4254430000000000000000000000000000000000000000000000000000Loading...LoadingLoading...Loading
Loading...Loading
Loading...LoadingLoading...LoadingLoading...LoadingLoading...LoadingLoading...LoadingLoading...LoadingOVERVIEW
dynBTC gives you exposure to Bitcoin using long only strategies managed by the Dynamic Asset Manager with less fees & expenses.
Loading...Loading[ Download: CSV Export ][ Download: CSV Export ]A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.
Address QR Code
My Address - Private Name Tag or Note
My Name Tag:
Private Name Tags (up to 35 characters) can be used for easy identification of addressesPrivate Note:
A private note (up to 500 characters) can be attached to this address.
Please DO NOT store any passwords or private keys here.Compiler specific version warnings:
The compiled contract might be susceptible to VerbatimInvalidDeduplication (low-severity), FullInlinerNonExpressionSplitArgumentEvaluationOrder (low-severity), MissingSideEffectsOnSelectorAccess (low-severity), StorageWriteRemovalBeforeConditionalTermination (medium/high-severity), AbiReencodingHeadOverflowWithStaticArrayCleanup (medium-severity) Solidity Compiler Bugs.
Connect a Wallet
Connecting wallet for read function is optional, useful if you want to call certain functions or simply use your wallet's node.Connect a Wallet
Connecting wallet for read function is optional, useful if you want to call certain functions or simply use your wallet's node.Connect a Wallet
Connecting wallet for read function is optional, useful if you want to call certain functions or simply use your wallet's node.SignIn
Address Cards
To use this feature, please login to your Etherscan account and return to this page.Before You Copy
Transaction Private Note
This website uses cookies to improve your experience. By continuing to use this website, you agree to its Terms and Privacy Policy.