Contract Address Details

0x56054dD259EE91adD53a988C079cfb17bE9a2108

Contract Name
EnergiswapRouter
Creator
0x79f104–b96244 at 0x89a74a–90a56a
Balance
0.00 NRG ( )
Tokens
Fetching tokens...
Transactions
986 Transactions
Transfers
66,570 Transfers
Gas Used
84,493,754
Last Balance Update
897818
Warning! Contract bytecode has been changed and doesn't match the verified one. Therefore, interaction with this smart contract may be risky.
Contract name:
EnergiswapRouter




Optimization enabled
true
Compiler version
v0.5.16+commit.9c3226ce




Optimization runs
200
EVM Version
petersburg




Verified at
2021-10-08 17:53:48.829455Z

Constructor Arguments

000000000000000000000000a2dae9e70d5a08b781dee134617cf5e7d23043c2000000000000000000000000a55f26319462355474a9f2c8790860776a329aa400000000000000000000000000000000000000000000000000000000000003050000000000000000000000000000000000000000000000000000000000000000

Arg [0] (address) : 0xa2dae9e70d5a08b781dee134617cf5e7d23043c2
Arg [1] (address) : 0xa55f26319462355474a9f2c8790860776a329aa4
Arg [2] (address) : 0x0000000000000000000000000000000000000305
Arg [3] (address) : 0x0000000000000000000000000000000000000000

              

Contract source code

pragma solidity ^0.5.16;
/**
* Genesis version of GovernedContract interface.
*
* Base Consensus interface for upgradable contracts.
* Unlike common approach, the implementation is NOT expected to be
* called through delegatecall() to minimize risks of shared storage.
*
* NOTE: it MUST NOT change after blockchain launch!
*/
interface IGovernedContract {
// Return actual proxy address for secure validation
function proxy() external returns(address);
// It must check that the caller is the proxy
// and copy all required data from the old address.
function migrate(IGovernedContract _oldImpl) external;
// It must check that the caller is the proxy
// and self destruct to the new address.
function destroy(IGovernedContract _newImpl) external;
// function () external payable; // This line (from original Energi IGovernedContract) is commented because it
// makes truffle migrations fail
}
// a library for performing overflow-safe math, courtesy of DappHub (https://github.com/dapphub/ds-math)
library SafeMath {
function add(uint x, uint y) internal pure returns (uint z) {
require((z = x + y) >= x, 'ds-math-add-overflow');
}
function sub(uint x, uint y) internal pure returns (uint z) {
require((z = x - y) <= x, 'ds-math-sub-underflow');
}
function mul(uint x, uint y) internal pure returns (uint z) {
require(y == 0 || (z = x * y) / y == x, 'ds-math-mul-overflow');
}
}
// SPDX-License-Identifier: GPL-3.0-or-later
// helper methods for interacting with ERC20 tokens and sending WNRG that do not consistently return true/false
library TransferHelper {
function safeApprove(address token, address to, uint value) internal {
// bytes4(keccak256(bytes('approve(address,uint256)')));
(bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x095ea7b3, to, value));
require(success && (data.length == 0 || abi.decode(data, (bool))), 'TransferHelper: APPROVE_FAILED');
}
function safeTransfer(address token, address to, uint value) internal {
// bytes4(keccak256(bytes('transfer(address,uint256)')));
(bool success, bytes memory data) = token.call(abi.encodeWithSelector(0xa9059cbb, to, value));
require(success && (data.length == 0 || abi.decode(data, (bool))), 'TransferHelper: TRANSFER_FAILED');
}
function safeTransferFrom(address token, address from, address to, uint value) internal {
// bytes4(keccak256(bytes('transferFrom(address,address,uint256)')));
(bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x23b872dd, from, to, value));
require(success && (data.length == 0 || abi.decode(data, (bool))), 'TransferHelper: TRANSFER_FROM_FAILED');
}
function safeTransferNRG(address to, uint value) internal {
(bool success, ) = to.call.value(value)(new bytes(0));
require(success, 'TransferHelper: NRG_TRANSFER_FAILED');
}
}
/**
* Genesis version of IGovernedProxy interface.
*
* Base Consensus interface for upgradable contracts proxy.
* Unlike common approach, the implementation is NOT expected to be
* called through delegatecall() to minimize risks of shared storage.
*
* NOTE: it MUST NOT change after blockchain launch!
*/
interface IGovernedProxy {
event UpgradeProposal(
IGovernedContract indexed impl,
IUpgradeProposal proposal
);
event Upgraded(
IGovernedContract indexed impl,
IUpgradeProposal proposal
);
function impl() external view returns(IGovernedContract);
function proposeUpgrade(IGovernedContract _newImpl, uint _period)
external payable returns(IUpgradeProposal);
function upgrade(IUpgradeProposal _proposal) external;
function upgradeProposalImpl(IUpgradeProposal _proposal) external view returns(IGovernedContract new_impl);
function listUpgradeProposals() external view returns(IUpgradeProposal[] memory proposals);
function collectUpgradeProposal(IUpgradeProposal _proposal) external;
function () external payable;
}
interface IStorageBase {
function setOwner(address _newOwner) external;
}
interface IWNRG {
function deposit() external payable;
function withdraw(uint amount) external;
}
interface IERC20 {
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function decimals() external view 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);
}
interface IEnergiswapFactory {
function initialized() external view returns (bool);
function _storage() external view returns (address);
event PairCreated(address indexed token0, address indexed token1, address pair, uint);
function initialize(address _routerProxy, address _pairsManagerProxy, address _pairsERC20Proxy) external;
function destroy(address _newImpl) external;
function migrate(address _oldImpl) external;
function createPair(
address tokenA,
address tokenB
) external returns (address pairProxy);
function setFeeTo(address _feeTo) external;
function setFeeToSetter(address _feeToSetter) external;
function feeTo() external view returns (address _feeTo);
function feeToSetter() external view returns (address _feeToSetter);
function sporkProxy() external view returns (address _sporkProxy);
function getPair(address tokenA, address tokenB) external view returns (address _pair);
function allPairs(uint index) external view returns (address _pair);
function allPairsLength() external view returns (uint);
}
interface IEnergiswapRouterStorage {
function getFactory() external view returns(address _factory);
function getWNRG() external view returns(address _WNRG);
}
interface IEnergiswapPairsManager {
event Mint(address indexed pair, address indexed sender, uint amount0, uint amount1, address indexed to);
event Burn(address indexed pair, 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(address indexed sender, uint112 reserve0, uint112 reserve1);
function _storage() external view returns (address);
function destroy(address _newImpl) external;
function migrate(address _oldImpl) external;
function registerPair(address _pairProxy, address _pairStorage, address _erc20Storage) external;
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 approve(address spender, uint value) external returns (bool result);
function transfer(address to, uint value) external returns (bool result);
function transferFrom(address from, address to, uint value) external returns (bool result);
function redeemLiquidity(address router, address owner, uint value) external returns (bool result);
function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external;
function emitApproval(address pair, address owner, address spender, uint value) external;
function emitTransfer(address pair, address from, address to, uint value) external;
function factory() external view returns (address _factory);
function getReserves(address pair) external view returns (uint112 _reserve0, uint112 _reserve1, uint32 _blockTimestampLast);
function token0(address pair) external view returns (address _token0);
function token1(address pair) external view returns (address _token1);
function price0CumulativeLast(address pair) external view returns (uint _price0CumulativeLast);
function price1CumulativeLast(address pair) external view returns (uint _price1CumulativeLast);
function kLast(address pair) external view returns (uint _kLast);
}
/**
* Genesis version of IGovernedProxy interface.
*
* Base Consensus interface for upgradable contracts proxy.
* Unlike common approach, the implementation is NOT expected to be
* called through delegatecall() to minimize risks of shared storage.
*
* NOTE: it MUST NOT change after blockchain launch!
*/
interface IEnergiswapPairProxy {
function pairsManagerProxy() external view returns (address);
function pairsERC20Proxy() external view returns (address);
function routerProxy() external view returns (address);
function emitMint(address sender, uint amount0, uint amount1, address to) external;
function emitBurn(address sender, uint amount0, uint amount1, address to) external;
function emitSwap(address sender, uint amount0In, uint amount1In, uint amount0Out, uint amount1Out, address to) external;
function emitSync(uint112 reserve0, uint112 reserve1) external;
function emitApproval(address owner, address spender, uint value) external;
function emitTransfer(address from, address to, uint value) external;
function safeTransfer(address token, address to, uint value, bytes4 SELECTOR) external;
function getReserves() external view returns (uint112 _reserve0, uint112 _reserve1, uint32 _blockTimestampLast);
function token0() external view returns (address _token0);
function token1() external view returns (address _token1);
function price0CumulativeLast() external view returns (uint _price0CumulativeLast);
function price1CumulativeLast() external view returns (uint _price1CumulativeLast);
function kLast() external view returns (uint _kLast);
function name() external view returns(string memory _name);
function symbol() external view returns(string memory _symbol);
function decimals() external view returns(uint8 _decimals);
function totalSupply() external view returns (uint _totalSupply);
function balanceOf(address account) external view returns (uint _balance);
function allowance(address owner, address spender) external view returns (uint _allowance);
function nonce(address owner) external view returns(uint _nonce);
function () external payable;
}
interface IEnergiswapGovernedContract {
function proxy() external returns(address);
}
interface IEnergiswapRouterGovernedProxy {
event UpgradeProposal(
IGovernedContract indexed impl,
IUpgradeProposal proposal
);
event Upgraded(
IGovernedContract indexed impl,
IUpgradeProposal proposal
);
function impl() external view returns (address);
function spork_proxy() external view returns (address);
function safeTransferFrom(address token, address from, address to, uint value) external;
function proposeUpgrade(IGovernedContract _newImpl, uint _period) external payable returns(IUpgradeProposal);
function upgrade(IUpgradeProposal _proposal) external;
function upgradeProposalImpl(IUpgradeProposal _proposal) external view returns(IGovernedContract new_impl);
function listUpgradeProposals() external view returns(IUpgradeProposal[] memory proposals);
function collectUpgradeProposal(IUpgradeProposal _proposal) external;
function proxy() external view returns (address);
function migrate(IGovernedContract) external pure;
function destroy(IGovernedContract) external pure;
function () external payable;
}
interface IProposal {
function parent() external view returns(address);
function created_block() external view returns(uint);
function deadline() external view returns(uint);
function fee_payer() external view returns(address payable);
function fee_amount() external view returns(uint);
function accepted_weight() external view returns(uint);
function rejected_weight() external view returns(uint);
function total_weight() external view returns(uint);
function quorum_weight() external view returns(uint);
function isFinished() external view returns(bool);
function isAccepted() external view returns(bool);
function withdraw() external;
function destroy() external;
function collect() external;
function voteAccept() external;
function voteReject() external;
function setFee() external payable;
function canVote(address owner) external view returns(bool);
}
interface ISporkRegistry {
function createUpgradeProposal(
IGovernedContract _impl,
uint _period,
address payable _fee_payer
)
external payable
returns (IUpgradeProposal);
function consensusGasLimits()
external view
returns(uint callGas, uint xferGas);
}
interface IEnergiswapRouter {
function _storage() external view returns (address);
function destroy(address _newImpl) external;
function migrate(address _oldImpl) external;
function() external payable;
function removeLiquidityNRGSupportingFeeOnTransferTokens(
address token,
uint liquidity,
uint amountTokenMin,
uint amountNRGMin,
address to,
uint deadline
) external returns (uint amountNRG);
function removeLiquidityNRGWithPermitSupportingFeeOnTransferTokens(
address token,
uint liquidity,
uint amountTokenMin,
uint amountNRGMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountNRG);
function swapExactTokensForTokensSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function swapExactNRGForTokensSupportingFeeOnTransferTokens(
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external payable;
function swapExactTokensForNRGSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function addLiquidity(
address tokenA,
address tokenB,
uint amountADesired,
uint amountBDesired,
uint amountAMin,
uint amountBMin,
address to,
uint deadline
) external returns (uint amountA, uint amountB, uint liquidity);
function addLiquidityNRG(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountNRGMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountNRG, uint liquidity);
function removeLiquidity(
address tokenA,
address tokenB,
uint liquidity,
uint amountAMin,
uint amountBMin,
address to,
uint deadline
) external returns (uint amountA, uint amountB);
function removeLiquidityNRG(
address token,
uint liquidity,
uint amountTokenMin,
uint amountNRGMin,
address to,
uint deadline
) external returns (uint amountToken, uint amountNRG);
function removeLiquidityWithPermit(
address tokenA,
address tokenB,
uint liquidity,
uint amountAMin,
uint amountBMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountA, uint amountB);
function removeLiquidityNRGWithPermit(
address token,
uint liquidity,
uint amountTokenMin,
uint amountNRGMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountToken, uint amountNRG);
function swapExactTokensForTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external returns (uint[] memory amounts);
function swapTokensForExactTokens(
uint amountOut,
uint amountInMax,
address[] calldata path,
address to,
uint deadline
) external returns (uint[] memory amounts);
function swapExactNRGForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline)
external
payable
returns (uint[] memory amounts);
function swapTokensForExactNRG(uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline)
external
returns (uint[] memory amounts);
function swapExactTokensForNRG(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline)
external
returns (uint[] memory amounts);
function swapNRGForExactTokens(uint amountOut, address[] calldata path, address to, uint deadline)
external
payable
returns (uint[] memory amounts);
function quote(uint amountA, uint reserveA, uint reserveB) external pure returns (uint amountB);
function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) external pure returns (uint amountOut);
function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) external pure returns (uint amountIn);
function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts);
function getAmountsIn(uint amountOut, address[] calldata path) external view returns (uint[] memory amounts);
}
library EnergiswapLibrary {
using SafeMath for uint;
// returns sorted token addresses, used to handle return values from pairs sorted in this order
function sortTokens(address tokenA, address tokenB) internal pure returns (address token0, address token1) {
require(tokenA != tokenB, 'EnergiswapLibrary: IDENTICAL_ADDRESSES');
(token0, token1) = tokenA < tokenB ? (tokenA, tokenB) : (tokenB, tokenA);
require(token0 != address(0), 'EnergiswapLibrary: ZERO_ADDRESS');
}
// fetches and sorts the reserves for a pair
function getReserves(address factory, address tokenA, address tokenB) internal view returns (uint reserveA, uint reserveB) {
(address token0,) = sortTokens(tokenA, tokenB);
address payable pairProxy = address(uint160(IEnergiswapFactory(factory).getPair(tokenA, tokenB)));
(uint reserve0, uint reserve1,) = IEnergiswapPairProxy(pairProxy).getReserves();
(reserveA, reserveB) = tokenA == token0 ? (reserve0, reserve1) : (reserve1, reserve0);
}
// given some amount of an asset and pair reserves, returns an equivalent amount of the other asset
function quote(uint amountA, uint reserveA, uint reserveB) internal pure returns (uint amountB) {
require(amountA > 0, 'EnergiswapLibrary: INSUFFICIENT_AMOUNT');
require(reserveA > 0 && reserveB > 0, 'EnergiswapLibrary: INSUFFICIENT_LIQUIDITY');
amountB = amountA.mul(reserveB) / reserveA;
}
// given an input amount of an asset and pair reserves, returns the maximum output amount of the other asset
function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) internal pure returns (uint amountOut) {
require(amountIn > 0, 'EnergiswapLibrary: INSUFFICIENT_INPUT_AMOUNT');
require(reserveIn > 0 && reserveOut > 0, 'EnergiswapLibrary: INSUFFICIENT_LIQUIDITY');
uint amountInWithFee = amountIn.mul(997); // 0.3% fee
uint numerator = amountInWithFee.mul(reserveOut);
uint denominator = reserveIn.mul(1000).add(amountInWithFee);
amountOut = numerator / denominator;
}
// given an output amount of an asset and pair reserves, returns a required input amount of the other asset
function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) internal pure returns (uint amountIn) {
require(amountOut > 0, 'EnergiswapLibrary: INSUFFICIENT_OUTPUT_AMOUNT');
require(reserveIn > 0 && reserveOut > 0, 'EnergiswapLibrary: INSUFFICIENT_LIQUIDITY');
uint numerator = reserveIn.mul(amountOut).mul(1000);
uint denominator = reserveOut.sub(amountOut).mul(997);
amountIn = (numerator / denominator).add(1);
}
// performs chained getAmountOut calculations on any number of pairs
function getAmountsOut(address factory, uint amountIn, address[] memory path) internal view returns (uint[] memory amounts) {
require(path.length >= 2, 'EnergiswapLibrary: INVALID_PATH');
amounts = new uint[](path.length);
amounts[0] = amountIn;
for (uint i; i < path.length - 1; i++) {
(uint reserveIn, uint reserveOut) = getReserves(factory, path[i], path[i + 1]);
amounts[i + 1] = getAmountOut(amounts[i], reserveIn, reserveOut);
}
}
// performs chained getAmountIn calculations on any number of pairs
function getAmountsIn(address factory, uint amountOut, address[] memory path) internal view returns (uint[] memory amounts) {
require(path.length >= 2, 'EnergiswapLibrary: INVALID_PATH');
amounts = new uint[](path.length);
amounts[amounts.length - 1] = amountOut;
for (uint i = path.length - 1; i > 0; i--) {
(uint reserveIn, uint reserveOut) = getReserves(factory, path[i - 1], path[i]);
amounts[i - 1] = getAmountIn(amounts[i], reserveIn, reserveOut);
}
}
}
/**
* Interface of UpgradeProposal
*/
contract IUpgradeProposal is IProposal {
function impl() external view returns(IGovernedContract);
}
/**
* Genesis version of GovernedContract common base.
*
* Base Consensus interface for upgradable contracts.
* Unlike common approach, the implementation is NOT expected to be
* called through delegatecall() to minimize risks of shared storage.
*
* NOTE: it MUST NOT change after blockchain launch!
*/
contract EnergiswapGovernedContract is IEnergiswapGovernedContract {
address public proxy;
constructor(address _proxy) public {
proxy = _proxy;
}
modifier requireProxy {
require(msg.sender == proxy, "EnergiswapGovernedContract: FORBIDDEN, not proxy");
_;
}
function getProxy() internal view returns(address _proxy) {
_proxy = proxy;
}
// solium-disable-next-line no-empty-blocks
function _migrate(address) internal {}
function _destroy(address _newImpl) internal {
selfdestruct(address(uint160(_newImpl)));
}
function _callerAddress()
internal view
returns (address payable)
{
if (msg.sender == proxy) {
// This is guarantee of the GovernedProxy
// solium-disable-next-line security/no-tx-origin
return tx.origin;
} else {
return msg.sender;
}
}
}
/**
* A little helper to protect contract from being re-entrant in state
* modifying functions.
*/
contract NonReentrant {
uint private entry_guard;
modifier noReentry {
require(entry_guard == 0, "Reentry");
entry_guard = 1;
_;
entry_guard = 0;
}
}
/**
* SC-9: This contract has no chance of being updated. It must be stupid simple.
*
* If another upgrade logic is required in the future - it can be done as proxy stage II.
*/
contract EnergiswapRouterGovernedProxy is IEnergiswapRouterGovernedProxy, NonReentrant {
IGovernedContract public impl;
IGovernedProxy public spork_proxy;
mapping(address => IGovernedContract) public upgrade_proposals;
IUpgradeProposal[] public upgrade_proposal_list;
modifier senderOrigin {
// Internal calls are expected to use impl directly.
// That's due to use of call() instead of delegatecall() on purpose.
// solium-disable-next-line security/no-tx-origin
require(tx.origin == msg.sender, "EnergiswapRouterGovernedProxy: FORBIDDEN, only direct calls are allowed!");
_;
}
modifier requireImpl {
require(msg.sender == address(impl), "EnergiswapRouterGovernedProxy: FORBIDDEN, not impl");
_;
}
constructor(address _impl, address payable _sporkProxy) public {
impl = IGovernedContract(_impl);
spork_proxy = IGovernedProxy(_sporkProxy);
}
function safeTransferFrom(address token, address from, address to, uint value) external requireImpl {
// bytes4(keccak256(bytes('transferFrom(address,address,uint256)')));
(bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x23b872dd, from, to, value));
require(success && (data.length == 0 || abi.decode(data, (bool))), 'EnergiswapGovernedProxy: TRANSFER_FROM_FAILED');
}
/**
* Pre-create a new contract first.
* Then propose upgrade based on that.
*/
function proposeUpgrade(IGovernedContract _newImpl, uint _period)
external payable
senderOrigin
noReentry
returns(IUpgradeProposal)
{
require(_newImpl != impl, "Already active!");
require(_newImpl.proxy() == address(this), "Wrong proxy!");
ISporkRegistry spork_reg = ISporkRegistry(address(spork_proxy.impl()));
IUpgradeProposal proposal = spork_reg.createUpgradeProposal.value(msg.value)(_newImpl, _period, msg.sender);
upgrade_proposals[address(proposal)] = _newImpl;
upgrade_proposal_list.push(proposal);
emit UpgradeProposal(_newImpl, proposal);
return proposal;
}
/**
* Once proposal is accepted, anyone can activate that.
*/
function upgrade(IUpgradeProposal _proposal)
external
noReentry
{
IGovernedContract new_impl = upgrade_proposals[address(_proposal)];
require(new_impl != impl, "Already active!"); // in case it changes in the flight
require(address(new_impl) != address(0), "Not registered!");
require(_proposal.isAccepted(), "Not accepted!");
IGovernedContract old_impl = impl;
new_impl.migrate(old_impl);
impl = new_impl;
old_impl.destroy(new_impl);
// SECURITY: prevent downgrade attack
_cleanupProposal(_proposal);
// Return fee ASAP
_proposal.destroy();
emit Upgraded(new_impl, _proposal);
}
/**
* Map proposal to implementation
*/
function upgradeProposalImpl(IUpgradeProposal _proposal)
external view
returns(IGovernedContract new_impl)
{
new_impl = upgrade_proposals[address(_proposal)];
}
/**
* Lists all available upgrades
*/
function listUpgradeProposals()
external view
returns(IUpgradeProposal[] memory proposals)
{
uint len = upgrade_proposal_list.length;
proposals = new IUpgradeProposal[](len);
for (uint i = 0; i < len; ++i) {
proposals[i] = upgrade_proposal_list[i];
}
return proposals;
}
/**
* Once proposal is reject, anyone can start collect procedure.
*/
function collectUpgradeProposal(IUpgradeProposal _proposal)
external
noReentry
{
IGovernedContract new_impl = upgrade_proposals[address(_proposal)];
require(address(new_impl) != address(0), "Not registered!");
_proposal.collect();
delete upgrade_proposals[address(_proposal)];
_cleanupProposal(_proposal);
}
function _cleanupProposal(IUpgradeProposal _proposal) internal {
delete upgrade_proposals[address(_proposal)];
uint len = upgrade_proposal_list.length;
for (uint i = 0; i < len; ++i) {
if (upgrade_proposal_list[i] == _proposal) {
upgrade_proposal_list[i] = upgrade_proposal_list[len - 1];
upgrade_proposal_list.pop();
break;
}
}
}
/**
* Related to above
*/
function proxy() external view returns (address) {
return address(this);
}
/**
* SECURITY: prevent on-behalf-of calls
*/
function migrate(IGovernedContract) external pure {
revert("Good try");
}
/**
* SECURITY: prevent on-behalf-of calls
*/
function destroy(IGovernedContract) external pure {
revert("Good try");
}
/**
* Proxy all other calls to implementation.
*/
function ()
external
payable
senderOrigin
{
// SECURITY: senderOrigin() modifier is mandatory
IGovernedContract impl_m = impl;
// solium-disable-next-line security/no-inline-assembly
assembly {
let ptr := mload(0x40)
calldatacopy(ptr, 0, calldatasize())
let res := call(sub(gas(), 10000), impl_m, callvalue(), ptr, calldatasize(), 0, 0)
// NOTE: returndatasize should allow repeatable calls
// what should save one opcode.
returndatacopy(ptr, 0, returndatasize())
switch res
case 0 {
revert(ptr, returndatasize())
}
default {
return(ptr, returndatasize())
}
}
}
}
contract EnergiswapRouterAutoProxy is EnergiswapGovernedContract {
constructor (
address _proxy,
address _impl,
address payable _sporkProxy
) public EnergiswapGovernedContract(_proxy) {
// If _proxy is set to address(0), a new EnergiswapRouterGovernedProxy is deployed
if(_proxy == address(0)){
_proxy = address(new EnergiswapRouterGovernedProxy(_impl, _sporkProxy));
}
proxy = _proxy;
}
}
/**
* Base for contract storage (SC-14).
*
* NOTE: it MUST NOT change after blockchain launch!
*/
contract StorageBase {
address payable internal owner;
modifier requireOwner {
require(msg.sender == address(owner), "Not owner!");
_;
}
constructor() public {
owner = msg.sender;
}
function setOwner(IGovernedContract _newOwner) external requireOwner {
owner = address(uint160(address(_newOwner)));
}
function kill() external requireOwner {
selfdestruct(msg.sender);
}
}
contract EnergiswapRouterStorage is StorageBase, IEnergiswapRouterStorage {
address private factoryProxy;
address private pairsManagerProxy;
address private WNRG;
constructor(
address _factoryProxy,
address _WNRG
) public {
factoryProxy = _factoryProxy;
WNRG = _WNRG;
}
function getFactory() external view returns(address _factory) {
_factory = address(IGovernedProxy(address(uint160(factoryProxy))).impl());
}
function getWNRG() external view returns(address _WNRG) {
_WNRG = WNRG;
}
}
contract EnergiswapRouter is EnergiswapRouterAutoProxy, IEnergiswapRouter {
using SafeMath for uint;
EnergiswapRouterStorage public _storage;
modifier ensure(uint deadline) {
require(deadline >= block.timestamp, 'EnergiswapRouter: EXPIRED');
_;
}
constructor(
address _factoryProxy,
address _WNRG,
address _sporkProxy,
address _proxy // If set to address(0), EnergiswapRouterGovernedProxy will be deployed by EnergiswapRouterAutoProxy
) public EnergiswapRouterAutoProxy(
_proxy,
address(this),
address(uint160(_sporkProxy))
) {
_storage = new EnergiswapRouterStorage(_factoryProxy, _WNRG); // Deploy EnergiswapRouterStorage contract
}
// This function must be called in order to upgrade to a new EnergiswapRouter implementation
function destroy(address _newImpl) external requireProxy {
// Updates EnergiswapRouterStorage contract with new EnergiswapRouter implementation address as owner
IStorageBase(address(_storage)).setOwner(_newImpl);
// Self-destruct
_destroy(_newImpl);
}
// This function (placeholder) would be called on the new implementation if necessary for the upgrade
function migrate(address _oldImpl) external requireProxy {
_migrate(_oldImpl);
}
function() external payable {
address WNRG = _storage.getWNRG();
assert(msg.sender == WNRG); // only accept WNRG via fallback from the WNRG contract
}
// Get pair proxy address from tokens addresses
function pairFor(address tokenA, address tokenB) internal view returns (address pair) {
pair = IEnergiswapFactory(_storage.getFactory()).getPair(tokenA, tokenB);
}
// **** ADD LIQUIDITY ****
function _addLiquidity(
address tokenA,
address tokenB,
uint amountADesired,
uint amountBDesired,
uint amountAMin,
uint amountBMin
) internal returns (uint amountA, uint amountB) {
// create the pair if it doesn't exist yet
if (pairFor(tokenA, tokenB) == address(0)) {
IEnergiswapFactory(_storage.getFactory()).createPair(
tokenA,
tokenB
);
}
(uint reserveA, uint reserveB) = EnergiswapLibrary.getReserves(
_storage.getFactory(),
tokenA,
tokenB
);
if (reserveA == 0 && reserveB == 0) {
(amountA, amountB) = (amountADesired, amountBDesired);
} else {
uint amountBOptimal = EnergiswapLibrary.quote(amountADesired, reserveA, reserveB);
if (amountBOptimal <= amountBDesired) {
require(amountBOptimal >= amountBMin, 'EnergiswapRouter: INSUFFICIENT_B_AMOUNT');
(amountA, amountB) = (amountADesired, amountBOptimal);
} else {
uint amountAOptimal = EnergiswapLibrary.quote(amountBDesired, reserveB, reserveA);
assert(amountAOptimal <= amountADesired);
require(amountAOptimal >= amountAMin, 'EnergiswapRouter: INSUFFICIENT_A_AMOUNT');
(amountA, amountB) = (amountAOptimal, amountBDesired);
}
}
}
function addLiquidity(
address tokenA,
address tokenB,
uint amountADesired,
uint amountBDesired,
uint amountAMin,
uint amountBMin,
address to,
uint deadline
) external ensure(deadline) returns (uint amountA, uint amountB, uint liquidity) {
(amountA, amountB) = _addLiquidity(tokenA, tokenB, amountADesired, amountBDesired, amountAMin, amountBMin);
address pair = pairFor(tokenA, tokenB);
IEnergiswapRouterGovernedProxy(address(uint160(proxy))).safeTransferFrom(tokenA, tx.origin, pair, amountA);
IEnergiswapRouterGovernedProxy(address(uint160(proxy))).safeTransferFrom(tokenB, tx.origin, pair, amountB);
liquidity = IEnergiswapPairsManager(pair).mint(to);
}
function addLiquidityNRG(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountNRGMin,
address to,
uint deadline
) external payable ensure(deadline) returns (uint amountToken, uint amountNRG, uint liquidity) {
address WNRG = _storage.getWNRG();
(amountToken, amountNRG) = _addLiquidity(
token,
WNRG,
amountTokenDesired,
msg.value,
amountTokenMin,
amountNRGMin
);
address pair = pairFor(token, WNRG);
IEnergiswapRouterGovernedProxy(address(uint160(proxy))).safeTransferFrom(token, tx.origin, pair, amountToken);
IWNRG(WNRG).deposit.value(amountNRG)();
assert(IERC20(WNRG).transfer(pair, amountNRG));
liquidity = IEnergiswapPairsManager(pair).mint(to);
// refund dust wnrg, if any
if (msg.value > amountNRG) TransferHelper.safeTransferNRG(tx.origin, msg.value - amountNRG);
}
// **** REMOVE LIQUIDITY ****
function removeLiquidity(
address tokenA,
address tokenB,
uint liquidity,
uint amountAMin,
uint amountBMin,
address to,
uint deadline
) public ensure(deadline) returns (uint amountA, uint amountB) {
address pair = pairFor(tokenA, tokenB);
IEnergiswapPairsManager(pair).redeemLiquidity(address(proxy), tx.origin, liquidity); // send liquidity to pair
(uint amount0, uint amount1) = IEnergiswapPairsManager(pair).burn(to);
(address token0,) = EnergiswapLibrary.sortTokens(tokenA, tokenB);
(amountA, amountB) = tokenA == token0 ? (amount0, amount1) : (amount1, amount0);
require(amountA >= amountAMin, 'EnergiswapRouter: INSUFFICIENT_A_AMOUNT');
require(amountB >= amountBMin, 'EnergiswapRouter: INSUFFICIENT_B_AMOUNT');
}
function removeLiquidityNRG(
address token,
uint liquidity,
uint amountTokenMin,
uint amountNRGMin,
address to,
uint deadline
) public ensure(deadline) returns (uint amountToken, uint amountNRG) {
address WNRG = _storage.getWNRG();
(amountToken, amountNRG) = removeLiquidity(
token,
WNRG,
liquidity,
amountTokenMin,
amountNRGMin,
address(this),
deadline
);
TransferHelper.safeTransfer(token, to, amountToken);
IWNRG(WNRG).withdraw(amountNRG);
TransferHelper.safeTransferNRG(to, amountNRG);
}
function removeLiquidityWithPermit(
address tokenA,
address tokenB,
uint liquidity,
uint amountAMin,
uint amountBMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountA, uint amountB) {
address pair = pairFor(tokenA, tokenB);
uint value = approveMax ? uint(-1) : liquidity;
IEnergiswapPairsManager(pair).permit(tx.origin, address(proxy), value, deadline, v, r, s);
(amountA, amountB) = removeLiquidity(tokenA, tokenB, liquidity, amountAMin, amountBMin, to, deadline);
}
function removeLiquidityNRGWithPermit(
address token,
uint liquidity,
uint amountTokenMin,
uint amountNRGMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountToken, uint amountNRG) {
address WNRG = _storage.getWNRG();
address pair = pairFor(token, WNRG);
uint value = approveMax ? uint(-1) : liquidity;
IEnergiswapPairsManager(pair).permit(tx.origin, address(proxy), value, deadline, v, r, s);
(amountToken, amountNRG) = removeLiquidityNRG(token, liquidity, amountTokenMin, amountNRGMin, to, deadline);
}
// **** REMOVE LIQUIDITY (supporting fee-on-transfer tokens) ****
function removeLiquidityNRGSupportingFeeOnTransferTokens(
address token,
uint liquidity,
uint amountTokenMin,
uint amountNRGMin,
address to,
uint deadline
) public ensure(deadline) returns (uint amountNRG) {
address WNRG = _storage.getWNRG();
(, amountNRG) = removeLiquidity(
token,
WNRG,
liquidity,
amountTokenMin,
amountNRGMin,
address(this),
deadline
);
TransferHelper.safeTransfer(token, to, IERC20(token).balanceOf(address(this)));
IWNRG(WNRG).withdraw(amountNRG);
TransferHelper.safeTransferNRG(to, amountNRG);
}
function removeLiquidityNRGWithPermitSupportingFeeOnTransferTokens(
address token,
uint liquidity,
uint amountTokenMin,
uint amountNRGMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountNRG) {
address WNRG = _storage.getWNRG();
address pair = pairFor(token, WNRG);
uint value = approveMax ? uint(-1) : liquidity;
IEnergiswapPairsManager(pair).permit(tx.origin, address(proxy), value, deadline, v, r, s);
amountNRG = removeLiquidityNRGSupportingFeeOnTransferTokens(
token, liquidity, amountTokenMin, amountNRGMin, to, deadline
);
}
// **** SWAP ****
// requires the initial amount to have already been sent to the first pair
function _swap(uint[] memory amounts, address[] memory path, address _to) internal {
for (uint i; i < path.length - 1; i++) {
(address input, address output) = (path[i], path[i + 1]);
(address token0,) = EnergiswapLibrary.sortTokens(input, output);
uint amountOut = amounts[i + 1];
(uint amount0Out, uint amount1Out) = input == token0 ? (uint(0), amountOut) : (amountOut, uint(0));
address to = i < path.length - 2 ? pairFor(output, path[i + 2]) : _to;
IEnergiswapPairsManager(pairFor(input, output)).swap(
amount0Out, amount1Out, to, new bytes(0)
);
}
}
function swapExactTokensForTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external ensure(deadline) returns (uint[] memory amounts) {
amounts = EnergiswapLibrary.getAmountsOut(_storage.getFactory(), amountIn, path);
require(amounts[amounts.length - 1] >= amountOutMin, 'EnergiswapRouter: INSUFFICIENT_OUTPUT_AMOUNT');
IEnergiswapRouterGovernedProxy(address(uint160(proxy))).safeTransferFrom(path[0], tx.origin, pairFor(path[0], path[1]), amounts[0]);
_swap(amounts, path, to);
}
function swapTokensForExactTokens(
uint amountOut,
uint amountInMax,
address[] calldata path,
address to,
uint deadline
) external ensure(deadline) returns (uint[] memory amounts) {
amounts = EnergiswapLibrary.getAmountsIn(_storage.getFactory(), amountOut, path);
require(amounts[0] <= amountInMax, 'EnergiswapRouter: EXCESSIVE_INPUT_AMOUNT');
IEnergiswapRouterGovernedProxy(address(uint160(proxy))).safeTransferFrom(path[0], tx.origin, pairFor(path[0], path[1]), amounts[0]);
_swap(amounts, path, to);
}
function swapExactNRGForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline)
external
payable
ensure(deadline)
returns (uint[] memory amounts)
{
address WNRG = _storage.getWNRG();
require(path[0] == WNRG, 'EnergiswapRouter: INVALID_PATH');
amounts = EnergiswapLibrary.getAmountsOut(_storage.getFactory(), msg.value, path);
require(amounts[amounts.length - 1] >= amountOutMin, 'EnergiswapRouter: INSUFFICIENT_OUTPUT_AMOUNT');
IWNRG(WNRG).deposit.value(amounts[0])();
assert(IERC20(WNRG).transfer(pairFor(path[0], path[1]), amounts[0]));
_swap(amounts, path, to);
}
function swapTokensForExactNRG(uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline)
external
ensure(deadline)
returns (uint[] memory amounts)
{
address WNRG = _storage.getWNRG();
require(path[path.length - 1] == WNRG, 'EnergiswapRouter: INVALID_PATH');
amounts = EnergiswapLibrary.getAmountsIn(_storage.getFactory(), amountOut, path);
require(amounts[0] <= amountInMax, 'EnergiswapRouter: EXCESSIVE_INPUT_AMOUNT');
IEnergiswapRouterGovernedProxy(address(uint160(proxy))).safeTransferFrom(path[0], tx.origin, pairFor(path[0], path[1]), amounts[0]);
_swap(amounts, path, address(this));
IWNRG(WNRG).withdraw(amounts[amounts.length - 1]);
TransferHelper.safeTransferNRG(to, amounts[amounts.length - 1]);
}
function swapExactTokensForNRG(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline)
external
ensure(deadline)
returns (uint[] memory amounts)
{
address WNRG = _storage.getWNRG();
require(path[path.length - 1] == WNRG, 'EnergiswapRouter: INVALID_PATH');
amounts = EnergiswapLibrary.getAmountsOut(_storage.getFactory(), amountIn, path);
require(amounts[amounts.length - 1] >= amountOutMin, 'EnergiswapRouter: INSUFFICIENT_OUTPUT_AMOUNT');
IEnergiswapRouterGovernedProxy(address(uint160(proxy))).safeTransferFrom(path[0], tx.origin, pairFor(path[0], path[1]), amounts[0]);
_swap(amounts, path, address(this));
IWNRG(WNRG).withdraw(amounts[amounts.length - 1]);
TransferHelper.safeTransferNRG(to, amounts[amounts.length - 1]);
}
function swapNRGForExactTokens(uint amountOut, address[] calldata path, address to, uint deadline)
external
payable
ensure(deadline)
returns (uint[] memory amounts)
{
address WNRG = _storage.getWNRG();
require(path[0] == WNRG, 'EnergiswapRouter: INVALID_PATH');
amounts = EnergiswapLibrary.getAmountsIn(_storage.getFactory(), amountOut, path);
require(amounts[0] <= msg.value, 'EnergiswapRouter: EXCESSIVE_INPUT_AMOUNT');
IWNRG(WNRG).deposit.value(amounts[0])();
assert(IERC20(WNRG).transfer(pairFor(path[0], path[1]), amounts[0]));
_swap(amounts, path, to);
// refund dust wnrg, if any
if (msg.value > amounts[0]) TransferHelper.safeTransferNRG(tx.origin, msg.value - amounts[0]);
}
// **** SWAP (supporting fee-on-transfer tokens) ****
// requires the initial amount to have already been sent to the first pair
function _swapSupportingFeeOnTransferTokens(address[] memory path, address _to) internal {
for (uint i; i < path.length - 1; i++) {
(address input, address output) = (path[i], path[i + 1]);
(address token0,) = EnergiswapLibrary.sortTokens(input, output);
address pair = pairFor(input, output);
uint amountInput;
uint amountOutput;
{ // scope to avoid stack too deep errors
(uint reserve0, uint reserve1,) = IEnergiswapPairProxy(address(uint160(pair))).getReserves();
(uint reserveInput, uint reserveOutput) = input == token0 ? (reserve0, reserve1) : (reserve1, reserve0);
amountInput = IERC20(input).balanceOf(pair).sub(reserveInput);
amountOutput = EnergiswapLibrary.getAmountOut(amountInput, reserveInput, reserveOutput);
}
(uint amount0Out, uint amount1Out) = input == token0 ? (uint(0), amountOutput) : (amountOutput, uint(0));
address to = i < path.length - 2 ? pairFor(output, path[i + 2]) : _to;
IEnergiswapPairsManager(pair).swap(amount0Out, amount1Out, to, new bytes(0));
}
}
function swapExactTokensForTokensSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external ensure(deadline) {
IEnergiswapRouterGovernedProxy(address(uint160(proxy))).safeTransferFrom(path[0], tx.origin, pairFor(path[0], path[1]), amountIn);
uint balanceBefore = IERC20(path[path.length - 1]).balanceOf(to);
_swapSupportingFeeOnTransferTokens(path, to);
require(
IERC20(path[path.length - 1]).balanceOf(to).sub(balanceBefore) >= amountOutMin,
'EnergiswapRouter: INSUFFICIENT_OUTPUT_AMOUNT'
);
}
function swapExactNRGForTokensSupportingFeeOnTransferTokens(
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
)
external
payable
ensure(deadline)
{
address WNRG = _storage.getWNRG();
require(path[0] == WNRG, 'EnergiswapRouter: INVALID_PATH');
uint amountIn = msg.value;
IWNRG(WNRG).deposit.value(amountIn)();
assert(IERC20(WNRG).transfer(pairFor(path[0], path[1]), amountIn));
uint balanceBefore = IERC20(path[path.length - 1]).balanceOf(to);
_swapSupportingFeeOnTransferTokens(path, to);
require(
IERC20(path[path.length - 1]).balanceOf(to).sub(balanceBefore) >= amountOutMin,
'EnergiswapRouter: INSUFFICIENT_OUTPUT_AMOUNT'
);
}
function swapExactTokensForNRGSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
)
external
ensure(deadline)
{
address WNRG = _storage.getWNRG();
require(path[path.length - 1] == WNRG, 'EnergiswapRouter: INVALID_PATH');
IEnergiswapRouterGovernedProxy(address(uint160(proxy))).safeTransferFrom(path[0], tx.origin, pairFor(path[0], path[1]), amountIn);
_swapSupportingFeeOnTransferTokens(path, address(this));
uint amountOut = IERC20(WNRG).balanceOf(address(this));
require(amountOut >= amountOutMin, 'EnergiswapRouter: INSUFFICIENT_OUTPUT_AMOUNT');
IWNRG(WNRG).withdraw(amountOut);
TransferHelper.safeTransferNRG(to, amountOut);
}
// **** LIBRARY FUNCTIONS ****
function quote(uint amountA, uint reserveA, uint reserveB) public pure returns (uint amountB) {
return EnergiswapLibrary.quote(amountA, reserveA, reserveB);
}
function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut)
public
pure
returns (uint amountOut)
{
return EnergiswapLibrary.getAmountOut(amountIn, reserveIn, reserveOut);
}
function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut)
public
pure
returns (uint amountIn)
{
return EnergiswapLibrary.getAmountIn(amountOut, reserveIn, reserveOut);
}
function getAmountsOut(uint amountIn, address[] memory path)
public
view
returns (uint[] memory amounts)
{
return EnergiswapLibrary.getAmountsOut(_storage.getFactory(), amountIn, path);
}
function getAmountsIn(uint amountOut, address[] memory path)
public
view
returns (uint[] memory amounts)
{
return EnergiswapLibrary.getAmountsIn(_storage.getFactory(), amountOut, path);
}
}

Contract ABI

[{"type":"constructor","stateMutability":"nonpayable","payable":false,"inputs":[{"type":"address","name":"_factoryProxy","internalType":"address"},{"type":"address","name":"_WNRG","internalType":"address"},{"type":"address","name":"_sporkProxy","internalType":"address"},{"type":"address","name":"_proxy","internalType":"address"}]},{"type":"fallback","stateMutability":"payable","payable":true},{"type":"function","stateMutability":"view","payable":false,"outputs":[{"type":"address","name":"","internalType":"contract EnergiswapRouterStorage"}],"name":"_storage","inputs":[],"constant":true},{"type":"function","stateMutability":"nonpayable","payable":false,"outputs":[{"type":"uint256","name":"amountA","internalType":"uint256"},{"type":"uint256","name":"amountB","internalType":"uint256"},{"type":"uint256","name":"liquidity","internalType":"uint256"}],"name":"addLiquidity","inputs":[{"type":"address","name":"tokenA","internalType":"address"},{"type":"address","name":"tokenB","internalType":"address"},{"type":"uint256","name":"amountADesired","internalType":"uint256"},{"type":"uint256","name":"amountBDesired","internalType":"uint256"},{"type":"uint256","name":"amountAMin","internalType":"uint256"},{"type":"uint256","name":"amountBMin","internalType":"uint256"},{"type":"address","name":"to","internalType":"address"},{"type":"uint256","name":"deadline","internalType":"uint256"}],"constant":false},{"type":"function","stateMutability":"payable","payable":true,"outputs":[{"type":"uint256","name":"amountToken","internalType":"uint256"},{"type":"uint256","name":"amountNRG","internalType":"uint256"},{"type":"uint256","name":"liquidity","internalType":"uint256"}],"name":"addLiquidityNRG","inputs":[{"type":"address","name":"token","internalType":"address"},{"type":"uint256","name":"amountTokenDesired","internalType":"uint256"},{"type":"uint256","name":"amountTokenMin","internalType":"uint256"},{"type":"uint256","name":"amountNRGMin","internalType":"uint256"},{"type":"address","name":"to","internalType":"address"},{"type":"uint256","name":"deadline","internalType":"uint256"}],"constant":false},{"type":"function","stateMutability":"nonpayable","payable":false,"outputs":[],"name":"destroy","inputs":[{"type":"address","name":"_newImpl","internalType":"address"}],"constant":false},{"type":"function","stateMutability":"pure","payable":false,"outputs":[{"type":"uint256","name":"amountIn","internalType":"uint256"}],"name":"getAmountIn","inputs":[{"type":"uint256","name":"amountOut","internalType":"uint256"},{"type":"uint256","name":"reserveIn","internalType":"uint256"},{"type":"uint256","name":"reserveOut","internalType":"uint256"}],"constant":true},{"type":"function","stateMutability":"pure","payable":false,"outputs":[{"type":"uint256","name":"amountOut","internalType":"uint256"}],"name":"getAmountOut","inputs":[{"type":"uint256","name":"amountIn","internalType":"uint256"},{"type":"uint256","name":"reserveIn","internalType":"uint256"},{"type":"uint256","name":"reserveOut","internalType":"uint256"}],"constant":true},{"type":"function","stateMutability":"view","payable":false,"outputs":[{"type":"uint256[]","name":"amounts","internalType":"uint256[]"}],"name":"getAmountsIn","inputs":[{"type":"uint256","name":"amountOut","internalType":"uint256"},{"type":"address[]","name":"path","internalType":"address[]"}],"constant":true},{"type":"function","stateMutability":"view","payable":false,"outputs":[{"type":"uint256[]","name":"amounts","internalType":"uint256[]"}],"name":"getAmountsOut","inputs":[{"type":"uint256","name":"amountIn","internalType":"uint256"},{"type":"address[]","name":"path","internalType":"address[]"}],"constant":true},{"type":"function","stateMutability":"nonpayable","payable":false,"outputs":[],"name":"migrate","inputs":[{"type":"address","name":"_oldImpl","internalType":"address"}],"constant":false},{"type":"function","stateMutability":"view","payable":false,"outputs":[{"type":"address","name":"","internalType":"address"}],"name":"proxy","inputs":[],"constant":true},{"type":"function","stateMutability":"pure","payable":false,"outputs":[{"type":"uint256","name":"amountB","internalType":"uint256"}],"name":"quote","inputs":[{"type":"uint256","name":"amountA","internalType":"uint256"},{"type":"uint256","name":"reserveA","internalType":"uint256"},{"type":"uint256","name":"reserveB","internalType":"uint256"}],"constant":true},{"type":"function","stateMutability":"nonpayable","payable":false,"outputs":[{"type":"uint256","name":"amountA","internalType":"uint256"},{"type":"uint256","name":"amountB","internalType":"uint256"}],"name":"removeLiquidity","inputs":[{"type":"address","name":"tokenA","internalType":"address"},{"type":"address","name":"tokenB","internalType":"address"},{"type":"uint256","name":"liquidity","internalType":"uint256"},{"type":"uint256","name":"amountAMin","internalType":"uint256"},{"type":"uint256","name":"amountBMin","internalType":"uint256"},{"type":"address","name":"to","internalType":"address"},{"type":"uint256","name":"deadline","internalType":"uint256"}],"constant":false},{"type":"function","stateMutability":"nonpayable","payable":false,"outputs":[{"type":"uint256","name":"amountToken","internalType":"uint256"},{"type":"uint256","name":"amountNRG","internalType":"uint256"}],"name":"removeLiquidityNRG","inputs":[{"type":"address","name":"token","internalType":"address"},{"type":"uint256","name":"liquidity","internalType":"uint256"},{"type":"uint256","name":"amountTokenMin","internalType":"uint256"},{"type":"uint256","name":"amountNRGMin","internalType":"uint256"},{"type":"address","name":"to","internalType":"address"},{"type":"uint256","name":"deadline","internalType":"uint256"}],"constant":false},{"type":"function","stateMutability":"nonpayable","payable":false,"outputs":[{"type":"uint256","name":"amountNRG","internalType":"uint256"}],"name":"removeLiquidityNRGSupportingFeeOnTransferTokens","inputs":[{"type":"address","name":"token","internalType":"address"},{"type":"uint256","name":"liquidity","internalType":"uint256"},{"type":"uint256","name":"amountTokenMin","internalType":"uint256"},{"type":"uint256","name":"amountNRGMin","internalType":"uint256"},{"type":"address","name":"to","internalType":"address"},{"type":"uint256","name":"deadline","internalType":"uint256"}],"constant":false},{"type":"function","stateMutability":"nonpayable","payable":false,"outputs":[{"type":"uint256","name":"amountToken","internalType":"uint256"},{"type":"uint256","name":"amountNRG","internalType":"uint256"}],"name":"removeLiquidityNRGWithPermit","inputs":[{"type":"address","name":"token","internalType":"address"},{"type":"uint256","name":"liquidity","internalType":"uint256"},{"type":"uint256","name":"amountTokenMin","internalType":"uint256"},{"type":"uint256","name":"amountNRGMin","internalType":"uint256"},{"type":"address","name":"to","internalType":"address"},{"type":"uint256","name":"deadline","internalType":"uint256"},{"type":"bool","name":"approveMax","internalType":"bool"},{"type":"uint8","name":"v","internalType":"uint8"},{"type":"bytes32","name":"r","internalType":"bytes32"},{"type":"bytes32","name":"s","internalType":"bytes32"}],"constant":false},{"type":"function","stateMutability":"nonpayable","payable":false,"outputs":[{"type":"uint256","name":"amountNRG","internalType":"uint256"}],"name":"removeLiquidityNRGWithPermitSupportingFeeOnTransferTokens","inputs":[{"type":"address","name":"token","internalType":"address"},{"type":"uint256","name":"liquidity","internalType":"uint256"},{"type":"uint256","name":"amountTokenMin","internalType":"uint256"},{"type":"uint256","name":"amountNRGMin","internalType":"uint256"},{"type":"address","name":"to","internalType":"address"},{"type":"uint256","name":"deadline","internalType":"uint256"},{"type":"bool","name":"approveMax","internalType":"bool"},{"type":"uint8","name":"v","internalType":"uint8"},{"type":"bytes32","name":"r","internalType":"bytes32"},{"type":"bytes32","name":"s","internalType":"bytes32"}],"constant":false},{"type":"function","stateMutability":"nonpayable","payable":false,"outputs":[{"type":"uint256","name":"amountA","internalType":"uint256"},{"type":"uint256","name":"amountB","internalType":"uint256"}],"name":"removeLiquidityWithPermit","inputs":[{"type":"address","name":"tokenA","internalType":"address"},{"type":"address","name":"tokenB","internalType":"address"},{"type":"uint256","name":"liquidity","internalType":"uint256"},{"type":"uint256","name":"amountAMin","internalType":"uint256"},{"type":"uint256","name":"amountBMin","internalType":"uint256"},{"type":"address","name":"to","internalType":"address"},{"type":"uint256","name":"deadline","internalType":"uint256"},{"type":"bool","name":"approveMax","internalType":"bool"},{"type":"uint8","name":"v","internalType":"uint8"},{"type":"bytes32","name":"r","internalType":"bytes32"},{"type":"bytes32","name":"s","internalType":"bytes32"}],"constant":false},{"type":"function","stateMutability":"payable","payable":true,"outputs":[{"type":"uint256[]","name":"amounts","internalType":"uint256[]"}],"name":"swapExactNRGForTokens","inputs":[{"type":"uint256","name":"amountOutMin","internalType":"uint256"},{"type":"address[]","name":"path","internalType":"address[]"},{"type":"address","name":"to","internalType":"address"},{"type":"uint256","name":"deadline","internalType":"uint256"}],"constant":false},{"type":"function","stateMutability":"payable","payable":true,"outputs":[],"name":"swapExactNRGForTokensSupportingFeeOnTransferTokens","inputs":[{"type":"uint256","name":"amountOutMin","internalType":"uint256"},{"type":"address[]","name":"path","internalType":"address[]"},{"type":"address","name":"to","internalType":"address"},{"type":"uint256","name":"deadline","internalType":"uint256"}],"constant":false},{"type":"function","stateMutability":"nonpayable","payable":false,"outputs":[{"type":"uint256[]","name":"amounts","internalType":"uint256[]"}],"name":"swapExactTokensForNRG","inputs":[{"type":"uint256","name":"amountIn","internalType":"uint256"},{"type":"uint256","name":"amountOutMin","internalType":"uint256"},{"type":"address[]","name":"path","internalType":"address[]"},{"type":"address","name":"to","internalType":"address"},{"type":"uint256","name":"deadline","internalType":"uint256"}],"constant":false},{"type":"function","stateMutability":"nonpayable","payable":false,"outputs":[],"name":"swapExactTokensForNRGSupportingFeeOnTransferTokens","inputs":[{"type":"uint256","name":"amountIn","internalType":"uint256"},{"type":"uint256","name":"amountOutMin","internalType":"uint256"},{"type":"address[]","name":"path","internalType":"address[]"},{"type":"address","name":"to","internalType":"address"},{"type":"uint256","name":"deadline","internalType":"uint256"}],"constant":false},{"type":"function","stateMutability":"nonpayable","payable":false,"outputs":[{"type":"uint256[]","name":"amounts","internalType":"uint256[]"}],"name":"swapExactTokensForTokens","inputs":[{"type":"uint256","name":"amountIn","internalType":"uint256"},{"type":"uint256","name":"amountOutMin","internalType":"uint256"},{"type":"address[]","name":"path","internalType":"address[]"},{"type":"address","name":"to","internalType":"address"},{"type":"uint256","name":"deadline","internalType":"uint256"}],"constant":false},{"type":"function","stateMutability":"nonpayable","payable":false,"outputs":[],"name":"swapExactTokensForTokensSupportingFeeOnTransferTokens","inputs":[{"type":"uint256","name":"amountIn","internalType":"uint256"},{"type":"uint256","name":"amountOutMin","internalType":"uint256"},{"type":"address[]","name":"path","internalType":"address[]"},{"type":"address","name":"to","internalType":"address"},{"type":"uint256","name":"deadline","internalType":"uint256"}],"constant":false},{"type":"function","stateMutability":"payable","payable":true,"outputs":[{"type":"uint256[]","name":"amounts","internalType":"uint256[]"}],"name":"swapNRGForExactTokens","inputs":[{"type":"uint256","name":"amountOut","internalType":"uint256"},{"type":"address[]","name":"path","internalType":"address[]"},{"type":"address","name":"to","internalType":"address"},{"type":"uint256","name":"deadline","internalType":"uint256"}],"constant":false},{"type":"function","stateMutability":"nonpayable","payable":false,"outputs":[{"type":"uint256[]","name":"amounts","internalType":"uint256[]"}],"name":"swapTokensForExactNRG","inputs":[{"type":"uint256","name":"amountOut","internalType":"uint256"},{"type":"uint256","name":"amountInMax","internalType":"uint256"},{"type":"address[]","name":"path","internalType":"address[]"},{"type":"address","name":"to","internalType":"address"},{"type":"uint256","name":"deadline","internalType":"uint256"}],"constant":false},{"type":"function","stateMutability":"nonpayable","payable":false,"outputs":[{"type":"uint256[]","name":"amounts","internalType":"uint256[]"}],"name":"swapTokensForExactTokens","inputs":[{"type":"uint256","name":"amountOut","internalType":"uint256"},{"type":"uint256","name":"amountInMax","internalType":"uint256"},{"type":"address[]","name":"path","internalType":"address[]"},{"type":"address","name":"to","internalType":"address"},{"type":"uint256","name":"deadline","internalType":"uint256"}],"constant":false}]
            

Deployed ByteCode

0x6080604052600436106101805760003560e01c8063ad615dec116100d1578063d06ca61f1161008a578063de34e75211610064578063de34e75214610c3d578063e1c8f91e14610cb0578063e8e3370014610d03578063ec55688914610d6557610180565b8063d06ca61f14610a6e578063d4a63a8514610b23578063ddfb899b14610bb957610180565b8063ad615dec1461088e578063b4a1824c146108c4578063baa2abde14610917578063c3fb90d614610974578063ce5494bb146109a5578063d06755ec146109d857610180565b806338ed17391161013e57806385f8c2591161011857806385f8c259146106da5780638803dbee1461071057806395e7c1f8146107a65780639db8625d1461082a57610180565b806338ed17391461053b5780635c11d795146105d157806368a1b8b51461066757610180565b8062f55d9d14610208578063054d50d41461023d5780630cfb6b3e146102855780631f00ca741461036b5780632195995c1461042057806326a30fb1146104b7575b600154604080516317d28c5760e31b815290516000926001600160a01b03169163be9462b8916004808301926020929190829003018186803b1580156101c557600080fd5b505afa1580156101d9573d6000803e3d6000fd5b505050506040513d60208110156101ef57600080fd5b50519050336001600160a01b0382161461020557fe5b50005b34801561021457600080fd5b5061023b6004803603602081101561022b57600080fd5b50356001600160a01b0316610d7a565b005b34801561024957600080fd5b506102736004803603606081101561026057600080fd5b5080359060208101359060400135610e35565b60408051918252519081900360200190f35b34801561029157600080fd5b5061031b600480360360a08110156102a857600080fd5b813591602081013591810190606081016040820135600160201b8111156102ce57600080fd5b8201836020820111156102e057600080fd5b803590602001918460208302840111600160201b8311171561030157600080fd5b91935091506001600160a01b038135169060200135610e4a565b60408051602080825283518183015283519192839290830191858101910280838360005b8381101561035757818101518382015260200161033f565b505050509050019250505060405180910390f35b34801561037757600080fd5b5061031b6004803603604081101561038e57600080fd5b81359190810190604081016020820135600160201b8111156103af57600080fd5b8201836020820111156103c157600080fd5b803590602001918460208302840111600160201b831117156103e257600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550611275945050505050565b34801561042c57600080fd5b5061049e600480360361016081101561044457600080fd5b506001600160a01b038135811691602081013582169160408201359160608101359160808201359160a08101359091169060c08101359060e081013515159060ff6101008201351690610120810135906101400135611304565b6040805192835260208301919091528051918290030190f35b61023b600480360360808110156104cd57600080fd5b81359190810190604081016020820135600160201b8111156104ee57600080fd5b82018360208201111561050057600080fd5b803590602001918460208302840111600160201b8311171561052157600080fd5b91935091506001600160a01b0381351690602001356113e1565b34801561054757600080fd5b5061031b600480360360a081101561055e57600080fd5b813591602081013591810190606081016040820135600160201b81111561058457600080fd5b82018360208201111561059657600080fd5b803590602001918460208302840111600160201b831117156105b757600080fd5b91935091506001600160a01b0381351690602001356117fa565b3480156105dd57600080fd5b5061023b600480360360a08110156105f457600080fd5b813591602081013591810190606081016040820135600160201b81111561061a57600080fd5b82018360208201111561062c57600080fd5b803590602001918460208302840111600160201b8311171561064d57600080fd5b91935091506001600160a01b038135169060200135611a96565b34801561067357600080fd5b5061049e600480360361014081101561068b57600080fd5b506001600160a01b0381358116916020810135916040820135916060810135916080820135169060a08101359060c081013515159060ff60e08201351690610100810135906101200135611d35565b3480156106e657600080fd5b50610273600480360360608110156106fd57600080fd5b5080359060208101359060400135611e8f565b34801561071c57600080fd5b5061031b600480360360a081101561073357600080fd5b813591602081013591810190606081016040820135600160201b81111561075957600080fd5b82018360208201111561076b57600080fd5b803590602001918460208302840111600160201b8311171561078c57600080fd5b91935091506001600160a01b038135169060200135611e9c565b61031b600480360360808110156107bc57600080fd5b81359190810190604081016020820135600160201b8111156107dd57600080fd5b8201836020820111156107ef57600080fd5b803590602001918460208302840111600160201b8311171561081057600080fd5b91935091506001600160a01b038135169060200135611fe0565b610870600480360360c081101561084057600080fd5b506001600160a01b0381358116916020810135916040820135916060810135916080820135169060a0013561236f565b60408051938452602084019290925282820152519081900360600190f35b34801561089a57600080fd5b50610273600480360360608110156108b157600080fd5b508035906020810135906040013561268c565b3480156108d057600080fd5b5061049e600480360360c08110156108e757600080fd5b506001600160a01b0381358116916020810135916040820135916060810135916080820135169060a00135612699565b34801561092357600080fd5b5061049e600480360360e081101561093a57600080fd5b506001600160a01b038135811691602081013582169160408201359160608101359160808201359160a08101359091169060c001356127e7565b34801561098057600080fd5b50610989612a10565b604080516001600160a01b039092168252519081900360200190f35b3480156109b157600080fd5b5061023b600480360360208110156109c857600080fd5b50356001600160a01b0316612a1f565b3480156109e457600080fd5b5061031b600480360360a08110156109fb57600080fd5b813591602081013591810190606081016040820135600160201b811115610a2157600080fd5b820183602082011115610a3357600080fd5b803590602001918460208302840111600160201b83111715610a5457600080fd5b91935091506001600160a01b038135169060200135612a71565b348015610a7a57600080fd5b5061031b60048036036040811015610a9157600080fd5b81359190810190604081016020820135600160201b811115610ab257600080fd5b820183602082011115610ac457600080fd5b803590602001918460208302840111600160201b83111715610ae557600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550612c9e945050505050565b348015610b2f57600080fd5b5061023b600480360360a0811015610b4657600080fd5b813591602081013591810190606081016040820135600160201b811115610b6c57600080fd5b820183602082011115610b7e57600080fd5b803590602001918460208302840111600160201b83111715610b9f57600080fd5b91935091506001600160a01b038135169060200135612d24565b61031b60048036036080811015610bcf57600080fd5b81359190810190604081016020820135600160201b811115610bf057600080fd5b820183602082011115610c0257600080fd5b803590602001918460208302840111600160201b83111715610c2357600080fd5b91935091506001600160a01b038135169060200135613060565b348015610c4957600080fd5b506102736004803603610140811015610c6157600080fd5b506001600160a01b0381358116916020810135916040820135916060810135916080820135169060a08101359060c081013515159060ff60e0820135169061010081013590610120013561341d565b348015610cbc57600080fd5b50610273600480360360c0811015610cd357600080fd5b506001600160a01b0381358116916020810135916040820135916060810135916080820135169060a0013561356d565b348015610d0f57600080fd5b506108706004803603610100811015610d2757600080fd5b506001600160a01b038135811691602081013582169160408201359160608101359160808201359160a08101359160c0820135169060e00135613721565b348015610d7157600080fd5b506109896139a4565b6000546001600160a01b03163314610dc35760405162461bcd60e51b8152600401808060200182810382526030815260200180614cf56030913960400191505060405180910390fd5b600154604080516313af403560e01b81526001600160a01b038481166004830152915191909216916313af403591602480830192600092919082900301818387803b158015610e1157600080fd5b505af1158015610e25573d6000803e3d6000fd5b50505050610e32816139b3565b50565b6000610e428484846139bf565b949350505050565b60608142811015610e90576040805162461bcd60e51b81526020600482015260196024820152600080516020614da6833981519152604482015290519081900360640190fd5b600154604080516317d28c5760e31b815290516000926001600160a01b03169163be9462b8916004808301926020929190829003018186803b158015610ed557600080fd5b505afa158015610ee9573d6000803e3d6000fd5b505050506040513d6020811015610eff57600080fd5b505190506001600160a01b03811687876000198101818110610f1d57fe5b905060200201356001600160a01b03166001600160a01b031614610f76576040805162461bcd60e51b815260206004820152601e6024820152600080516020614e38833981519152604482015290519081900360640190fd5b60015460408051632233163960e21b8152905161101f926001600160a01b0316916388cc58e4916004808301926020929190829003018186803b158015610fbc57600080fd5b505afa158015610fd0573d6000803e3d6000fd5b505050506040513d6020811015610fe657600080fd5b50516040805160208a810282810182019093528a82528d928c918c918291850190849080828437600092019190915250613aaf92505050565b9250878360008151811061102f57fe5b602002602001015111156110745760405162461bcd60e51b8152600401808060200182810382526028815260200180614d256028913960400191505060405180910390fd5b600080546001600160a01b03169063d9fc4b6190899089908161109357fe5b905060200201356001600160a01b0316326110e68b8b60008181106110b457fe5b905060200201356001600160a01b03168c8c60018181106110d157fe5b905060200201356001600160a01b0316613be5565b876000815181106110f357fe5b60200260200101516040518563ffffffff1660e01b815260040180856001600160a01b03166001600160a01b03168152602001846001600160a01b03166001600160a01b03168152602001836001600160a01b03166001600160a01b03168152602001828152602001945050505050600060405180830381600087803b15801561117c57600080fd5b505af1158015611190573d6000803e3d6000fd5b505050506111d383888880806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250309250613cdb915050565b806001600160a01b0316632e1a7d4d846001865103815181106111f257fe5b60200260200101516040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b15801561123057600080fd5b505af1158015611244573d6000803e3d6000fd5b50505050611269858460018651038151811061125c57fe5b6020026020010151613edf565b50509695505050505050565b60606112fb600160009054906101000a90046001600160a01b03166001600160a01b03166388cc58e46040518163ffffffff1660e01b815260040160206040518083038186803b1580156112c857600080fd5b505afa1580156112dc573d6000803e3d6000fd5b505050506040513d60208110156112f257600080fd5b50518484613aaf565b90505b92915050565b60008060006113138e8e613be5565b9050600087611322578c611326565b6000195b600080546040805163d505accf60e01b81523260048201526001600160a01b03928316602482015260448101859052606481018e905260ff8c16608482015260a481018b905260c481018a905290519394509085169263d505accf9260e48084019391929182900301818387803b1580156113a057600080fd5b505af11580156113b4573d6000803e3d6000fd5b505050506113c78f8f8f8f8f8f8f6127e7565b809450819550505050509b509b9950505050505050505050565b8042811015611425576040805162461bcd60e51b81526020600482015260196024820152600080516020614da6833981519152604482015290519081900360640190fd5b600154604080516317d28c5760e31b815290516000926001600160a01b03169163be9462b8916004808301926020929190829003018186803b15801561146a57600080fd5b505afa15801561147e573d6000803e3d6000fd5b505050506040513d602081101561149457600080fd5b505190506001600160a01b03811686866000816114ad57fe5b905060200201356001600160a01b03166001600160a01b031614611506576040805162461bcd60e51b815260206004820152601e6024820152600080516020614e38833981519152604482015290519081900360640190fd5b6000349050816001600160a01b031663d0e30db0826040518263ffffffff1660e01b81526004016000604051808303818588803b15801561154657600080fd5b505af115801561155a573d6000803e3d6000fd5b5050505050816001600160a01b031663a9059cbb61159b8989600081811061157e57fe5b905060200201356001600160a01b03168a8a60018181106110d157fe5b836040518363ffffffff1660e01b815260040180836001600160a01b03166001600160a01b0316815260200182815260200192505050602060405180830381600087803b1580156115eb57600080fd5b505af11580156115ff573d6000803e3d6000fd5b505050506040513d602081101561161557600080fd5b505161161d57fe5b60008787600019810181811061162f57fe5b905060200201356001600160a01b03166001600160a01b03166370a08231876040518263ffffffff1660e01b815260040180826001600160a01b03166001600160a01b0316815260200191505060206040518083038186803b15801561169457600080fd5b505afa1580156116a8573d6000803e3d6000fd5b505050506040513d60208110156116be57600080fd5b50516040805160208a810282810182019093528a82529293506117009290918b918b9182918501908490808284376000920191909152508a9250613fd7915050565b886117b2828a8a600019810181811061171557fe5b905060200201356001600160a01b03166001600160a01b03166370a082318a6040518263ffffffff1660e01b815260040180826001600160a01b03166001600160a01b0316815260200191505060206040518083038186803b15801561177a57600080fd5b505afa15801561178e573d6000803e3d6000fd5b505050506040513d60208110156117a457600080fd5b50519063ffffffff6142a016565b10156117ef5760405162461bcd60e51b815260040180806020018281038252602c815260200180614d4d602c913960400191505060405180910390fd5b505050505050505050565b60608142811015611840576040805162461bcd60e51b81526020600482015260196024820152600080516020614da6833981519152604482015290519081900360640190fd5b60015460408051632233163960e21b815290516118e9926001600160a01b0316916388cc58e4916004808301926020929190829003018186803b15801561188657600080fd5b505afa15801561189a573d6000803e3d6000fd5b505050506040513d60208110156118b057600080fd5b505160408051602089810282810182019093528982528c928b918b9182918501908490808284376000920191909152506142f092505050565b915086826001845103815181106118fc57fe5b602002602001015110156119415760405162461bcd60e51b815260040180806020018281038252602c815260200180614d4d602c913960400191505060405180910390fd5b600080546001600160a01b03169063d9fc4b6190889088908161196057fe5b905060200201356001600160a01b03163261199e8a8a600081811061198157fe5b905060200201356001600160a01b03168b8b60018181106110d157fe5b866000815181106119ab57fe5b60200260200101516040518563ffffffff1660e01b815260040180856001600160a01b03166001600160a01b03168152602001846001600160a01b03166001600160a01b03168152602001836001600160a01b03166001600160a01b03168152602001828152602001945050505050600060405180830381600087803b158015611a3457600080fd5b505af1158015611a48573d6000803e3d6000fd5b50505050611a8b82878780806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250899250613cdb915050565b509695505050505050565b8042811015611ada576040805162461bcd60e51b81526020600482015260196024820152600080516020614da6833981519152604482015290519081900360640190fd5b600080546001600160a01b03169063d9fc4b61908790879081611af957fe5b905060200201356001600160a01b031632611b1a8989600081811061157e57fe5b604080516001600160e01b031960e087901b1681526001600160a01b039485166004820152928416602484015292166044820152606481018b90529051608480830192600092919082900301818387803b158015611b7757600080fd5b505af1158015611b8b573d6000803e3d6000fd5b505050506000858560018888905003818110611ba357fe5b905060200201356001600160a01b03166001600160a01b03166370a08231856040518263ffffffff1660e01b815260040180826001600160a01b03166001600160a01b0316815260200191505060206040518083038186803b158015611c0857600080fd5b505afa158015611c1c573d6000803e3d6000fd5b505050506040513d6020811015611c3257600080fd5b50516040805160208881028281018201909352888252929350611c74929091899189918291850190849080828437600092019190915250889250613fd7915050565b86611cee8288886000198101818110611c8957fe5b905060200201356001600160a01b03166001600160a01b03166370a08231886040518263ffffffff1660e01b815260040180826001600160a01b03166001600160a01b0316815260200191505060206040518083038186803b15801561177a57600080fd5b1015611d2b5760405162461bcd60e51b815260040180806020018281038252602c815260200180614d4d602c913960400191505060405180910390fd5b5050505050505050565b6000806000600160009054906101000a90046001600160a01b03166001600160a01b031663be9462b86040518163ffffffff1660e01b815260040160206040518083038186803b158015611d8857600080fd5b505afa158015611d9c573d6000803e3d6000fd5b505050506040513d6020811015611db257600080fd5b505190506000611dc28e83613be5565b9050600088611dd1578d611dd5565b6000195b600080546040805163d505accf60e01b81523260048201526001600160a01b03928316602482015260448101859052606481018f905260ff8d16608482015260a481018c905260c481018b905290519394509085169263d505accf9260e48084019391929182900301818387803b158015611e4f57600080fd5b505af1158015611e63573d6000803e3d6000fd5b50505050611e758f8f8f8f8f8f612699565b80955081965050505050509a509a98505050505050505050565b6000610e42848484614410565b60608142811015611ee2576040805162461bcd60e51b81526020600482015260196024820152600080516020614da6833981519152604482015290519081900360640190fd5b60015460408051632233163960e21b81529051611f8b926001600160a01b0316916388cc58e4916004808301926020929190829003018186803b158015611f2857600080fd5b505afa158015611f3c573d6000803e3d6000fd5b505050506040513d6020811015611f5257600080fd5b505160408051602089810282810182019093528982528c928b918b918291850190849080828437600092019190915250613aaf92505050565b91508682600081518110611f9b57fe5b602002602001015111156119415760405162461bcd60e51b8152600401808060200182810382526028815260200180614d256028913960400191505060405180910390fd5b60608142811015612026576040805162461bcd60e51b81526020600482015260196024820152600080516020614da6833981519152604482015290519081900360640190fd5b600154604080516317d28c5760e31b815290516000926001600160a01b03169163be9462b8916004808301926020929190829003018186803b15801561206b57600080fd5b505afa15801561207f573d6000803e3d6000fd5b505050506040513d602081101561209557600080fd5b505190506001600160a01b03811687876000816120ae57fe5b905060200201356001600160a01b03166001600160a01b031614612107576040805162461bcd60e51b815260206004820152601e6024820152600080516020614e38833981519152604482015290519081900360640190fd5b60015460408051632233163960e21b815290516121b0926001600160a01b0316916388cc58e4916004808301926020929190829003018186803b15801561214d57600080fd5b505afa158015612161573d6000803e3d6000fd5b505050506040513d602081101561217757600080fd5b50516040805160208a810282810182019093528a825234928c918c9182918501908490808284376000920191909152506142f092505050565b925087836001855103815181106121c357fe5b602002602001015110156122085760405162461bcd60e51b815260040180806020018281038252602c815260200180614d4d602c913960400191505060405180910390fd5b806001600160a01b031663d0e30db08460008151811061222457fe5b60200260200101516040518263ffffffff1660e01b81526004016000604051808303818588803b15801561225757600080fd5b505af115801561226b573d6000803e3d6000fd5b5050505050806001600160a01b031663a9059cbb61228f8989600081811061157e57fe5b8560008151811061229c57fe5b60200260200101516040518363ffffffff1660e01b815260040180836001600160a01b03166001600160a01b0316815260200182815260200192505050602060405180830381600087803b1580156122f357600080fd5b505af1158015612307573d6000803e3d6000fd5b505050506040513d602081101561231d57600080fd5b505161232557fe5b612364838888808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152508a9250613cdb915050565b505095945050505050565b600080600083428110156123b8576040805162461bcd60e51b81526020600482015260196024820152600080516020614da6833981519152604482015290519081900360640190fd5b600154604080516317d28c5760e31b815290516000926001600160a01b03169163be9462b8916004808301926020929190829003018186803b1580156123fd57600080fd5b505afa158015612411573d6000803e3d6000fd5b505050506040513d602081101561242757600080fd5b505190506124398b828c348d8d614500565b9095509350600061244a8c83613be5565b90506000809054906101000a90046001600160a01b03166001600160a01b031663d9fc4b618d32848a6040518563ffffffff1660e01b815260040180856001600160a01b03166001600160a01b03168152602001846001600160a01b03166001600160a01b03168152602001836001600160a01b03166001600160a01b03168152602001828152602001945050505050600060405180830381600087803b1580156124f457600080fd5b505af1158015612508573d6000803e3d6000fd5b50505050816001600160a01b031663d0e30db0866040518263ffffffff1660e01b81526004016000604051808303818588803b15801561254757600080fd5b505af115801561255b573d6000803e3d6000fd5b50506040805163a9059cbb60e01b81526001600160a01b038681166004830152602482018b90529151918716945063a9059cbb935060448082019350602092918290030181600087803b1580156125b157600080fd5b505af11580156125c5573d6000803e3d6000fd5b505050506040513d60208110156125db57600080fd5b50516125e357fe5b806001600160a01b0316636a627842896040518263ffffffff1660e01b815260040180826001600160a01b03166001600160a01b03168152602001915050602060405180830381600087803b15801561263b57600080fd5b505af115801561264f573d6000803e3d6000fd5b505050506040513d602081101561266557600080fd5b505193503485101561267d5761267d32863403613edf565b50505096509650969350505050565b6000610e4284848461478d565b60008082428110156126e0576040805162461bcd60e51b81526020600482015260196024820152600080516020614da6833981519152604482015290519081900360640190fd5b600154604080516317d28c5760e31b815290516000926001600160a01b03169163be9462b8916004808301926020929190829003018186803b15801561272557600080fd5b505afa158015612739573d6000803e3d6000fd5b505050506040513d602081101561274f57600080fd5b505190506127628a828b8b8b308b6127e7565b90945092506127728a8786614839565b806001600160a01b0316632e1a7d4d846040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b1580156127b857600080fd5b505af11580156127cc573d6000803e3d6000fd5b505050506127da8684613edf565b5050965096945050505050565b600080824281101561282e576040805162461bcd60e51b81526020600482015260196024820152600080516020614da6833981519152604482015290519081900360640190fd5b600061283a8b8b613be5565b600080546040805163cebdd1bb60e01b81526001600160a01b039283166004820152326024820152604481018e905290519394509084169263cebdd1bb92606480840193602093929083900390910190829087803b15801561289b57600080fd5b505af11580156128af573d6000803e3d6000fd5b505050506040513d60208110156128c557600080fd5b50506040805163226bf2d160e21b81526001600160a01b03888116600483015282516000938493928616926389afcb44926024808301939282900301818787803b15801561291257600080fd5b505af1158015612926573d6000803e3d6000fd5b505050506040513d604081101561293c57600080fd5b508051602090910151909250905060006129568e8e6149a3565b509050806001600160a01b03168e6001600160a01b03161461297957818361297c565b82825b90975095508a8710156129c05760405162461bcd60e51b8152600401808060200182810382526027815260200180614c816027913960400191505060405180910390fd5b898610156129ff5760405162461bcd60e51b8152600401808060200182810382526027815260200180614ca86027913960400191505060405180910390fd5b505050505097509795505050505050565b6001546001600160a01b031681565b6000546001600160a01b03163314612a685760405162461bcd60e51b8152600401808060200182810382526030815260200180614cf56030913960400191505060405180910390fd5b610e3281610e32565b60608142811015612ab7576040805162461bcd60e51b81526020600482015260196024820152600080516020614da6833981519152604482015290519081900360640190fd5b600154604080516317d28c5760e31b815290516000926001600160a01b03169163be9462b8916004808301926020929190829003018186803b158015612afc57600080fd5b505afa158015612b10573d6000803e3d6000fd5b505050506040513d6020811015612b2657600080fd5b505190506001600160a01b03811687876000198101818110612b4457fe5b905060200201356001600160a01b03166001600160a01b031614612b9d576040805162461bcd60e51b815260206004820152601e6024820152600080516020614e38833981519152604482015290519081900360640190fd5b60015460408051632233163960e21b81529051612c46926001600160a01b0316916388cc58e4916004808301926020929190829003018186803b158015612be357600080fd5b505afa158015612bf7573d6000803e3d6000fd5b505050506040513d6020811015612c0d57600080fd5b50516040805160208a810282810182019093528a82528d928c918c9182918501908490808284376000920191909152506142f092505050565b92508783600185510381518110612c5957fe5b602002602001015110156110745760405162461bcd60e51b815260040180806020018281038252602c815260200180614d4d602c913960400191505060405180910390fd5b60606112fb600160009054906101000a90046001600160a01b03166001600160a01b03166388cc58e46040518163ffffffff1660e01b815260040160206040518083038186803b158015612cf157600080fd5b505afa158015612d05573d6000803e3d6000fd5b505050506040513d6020811015612d1b57600080fd5b505184846142f0565b8042811015612d68576040805162461bcd60e51b81526020600482015260196024820152600080516020614da6833981519152604482015290519081900360640190fd5b600154604080516317d28c5760e31b815290516000926001600160a01b03169163be9462b8916004808301926020929190829003018186803b158015612dad57600080fd5b505afa158015612dc1573d6000803e3d6000fd5b505050506040513d6020811015612dd757600080fd5b505190506001600160a01b03811686866000198101818110612df557fe5b905060200201356001600160a01b03166001600160a01b031614612e4e576040805162461bcd60e51b815260206004820152601e6024820152600080516020614e38833981519152604482015290519081900360640190fd5b600080546001600160a01b03169063d9fc4b61908890889081612e6d57fe5b905060200201356001600160a01b031632612e8e8a8a600081811061198157fe5b604080516001600160e01b031960e087901b1681526001600160a01b039485166004820152928416602484015292166044820152606481018c90529051608480830192600092919082900301818387803b158015612eeb57600080fd5b505af1158015612eff573d6000803e3d6000fd5b50505050612f41868680806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250309250613fd7915050565b604080516370a0823160e01b815230600482015290516000916001600160a01b038416916370a0823191602480820192602092909190829003018186803b158015612f8b57600080fd5b505afa158015612f9f573d6000803e3d6000fd5b505050506040513d6020811015612fb557600080fd5b5051905087811015612ff85760405162461bcd60e51b815260040180806020018281038252602c815260200180614d4d602c913960400191505060405180910390fd5b816001600160a01b0316632e1a7d4d826040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b15801561303e57600080fd5b505af1158015613052573d6000803e3d6000fd5b505050506117ef8582613edf565b606081428110156130a6576040805162461bcd60e51b81526020600482015260196024820152600080516020614da6833981519152604482015290519081900360640190fd5b600154604080516317d28c5760e31b815290516000926001600160a01b03169163be9462b8916004808301926020929190829003018186803b1580156130eb57600080fd5b505afa1580156130ff573d6000803e3d6000fd5b505050506040513d602081101561311557600080fd5b505190506001600160a01b038116878760008161312e57fe5b905060200201356001600160a01b03166001600160a01b031614613187576040805162461bcd60e51b815260206004820152601e6024820152600080516020614e38833981519152604482015290519081900360640190fd5b60015460408051632233163960e21b81529051613230926001600160a01b0316916388cc58e4916004808301926020929190829003018186803b1580156131cd57600080fd5b505afa1580156131e1573d6000803e3d6000fd5b505050506040513d60208110156131f757600080fd5b50516040805160208a810282810182019093528a82528c928c918c918291850190849080828437600092019190915250613aaf92505050565b9250348360008151811061324057fe5b602002602001015111156132855760405162461bcd60e51b8152600401808060200182810382526028815260200180614d256028913960400191505060405180910390fd5b806001600160a01b031663d0e30db0846000815181106132a157fe5b60200260200101516040518263ffffffff1660e01b81526004016000604051808303818588803b1580156132d457600080fd5b505af11580156132e8573d6000803e3d6000fd5b5050505050806001600160a01b031663a9059cbb61330c8989600081811061157e57fe5b8560008151811061331957fe5b60200260200101516040518363ffffffff1660e01b815260040180836001600160a01b03166001600160a01b0316815260200182815260200192505050602060405180830381600087803b15801561337057600080fd5b505af1158015613384573d6000803e3d6000fd5b505050506040513d602081101561339a57600080fd5b50516133a257fe5b6133e1838888808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152508a9250613cdb915050565b826000815181106133ee57fe5b602002602001015134111561236457612364328460008151811061340e57fe5b60200260200101513403613edf565b600080600160009054906101000a90046001600160a01b03166001600160a01b031663be9462b86040518163ffffffff1660e01b815260040160206040518083038186803b15801561346e57600080fd5b505afa158015613482573d6000803e3d6000fd5b505050506040513d602081101561349857600080fd5b5051905060006134a88d83613be5565b90506000876134b7578c6134bb565b6000195b600080546040805163d505accf60e01b81523260048201526001600160a01b03928316602482015260448101859052606481018e905260ff8c16608482015260a481018b905260c481018a905290519394509085169263d505accf9260e48084019391929182900301818387803b15801561353557600080fd5b505af1158015613549573d6000803e3d6000fd5b5050505061355b8e8e8e8e8e8e61356d565b9e9d5050505050505050505050505050565b600081428110156135b3576040805162461bcd60e51b81526020600482015260196024820152600080516020614da6833981519152604482015290519081900360640190fd5b600154604080516317d28c5760e31b815290516000926001600160a01b03169163be9462b8916004808301926020929190829003018186803b1580156135f857600080fd5b505afa15801561360c573d6000803e3d6000fd5b505050506040513d602081101561362257600080fd5b5051905061363589828a8a8a308a6127e7565b604080516370a0823160e01b815230600482015290519195506136b992508b9188916001600160a01b038416916370a0823191602480820192602092909190829003018186803b15801561368857600080fd5b505afa15801561369c573d6000803e3d6000fd5b505050506040513d60208110156136b257600080fd5b5051614839565b806001600160a01b0316632e1a7d4d846040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b1580156136ff57600080fd5b505af1158015613713573d6000803e3d6000fd5b505050506112698584613edf565b6000806000834281101561376a576040805162461bcd60e51b81526020600482015260196024820152600080516020614da6833981519152604482015290519081900360640190fd5b6137788c8c8c8c8c8c614500565b909450925060006137898d8d613be5565b90506000809054906101000a90046001600160a01b03166001600160a01b031663d9fc4b618e3284896040518563ffffffff1660e01b815260040180856001600160a01b03166001600160a01b03168152602001846001600160a01b03166001600160a01b03168152602001836001600160a01b03166001600160a01b03168152602001828152602001945050505050600060405180830381600087803b15801561383357600080fd5b505af1158015613847573d6000803e3d6000fd5b505050506000809054906101000a90046001600160a01b03166001600160a01b031663d9fc4b618d3284886040518563ffffffff1660e01b815260040180856001600160a01b03166001600160a01b03168152602001846001600160a01b03166001600160a01b03168152602001836001600160a01b03166001600160a01b03168152602001828152602001945050505050600060405180830381600087803b1580156138f357600080fd5b505af1158015613907573d6000803e3d6000fd5b50505050806001600160a01b0316636a627842886040518263ffffffff1660e01b815260040180826001600160a01b03166001600160a01b03168152602001915050602060405180830381600087803b15801561396357600080fd5b505af1158015613977573d6000803e3d6000fd5b505050506040513d602081101561398d57600080fd5b5051949d939c50939a509198505050505050505050565b6000546001600160a01b031681565b806001600160a01b0316ff5b60008084116139ff5760405162461bcd60e51b815260040180806020018281038252602c815260200180614e58602c913960400191505060405180910390fd5b600083118015613a0f5750600082115b613a4a5760405162461bcd60e51b8152600401808060200182810382526029815260200180614de96029913960400191505060405180910390fd5b6000613a5e856103e563ffffffff614a8116565b90506000613a72828563ffffffff614a8116565b90506000613a9883613a8c886103e863ffffffff614a8116565b9063ffffffff614ae416565b9050808281613aa357fe5b04979650505050505050565b6060600282511015613b08576040805162461bcd60e51b815260206004820152601f60248201527f456e65726769737761704c6962726172793a20494e56414c49445f5041544800604482015290519081900360640190fd5b8151604051908082528060200260200182016040528015613b33578160200160208202803883390190505b5090508281600183510381518110613b4757fe5b60209081029190910101528151600019015b8015613bdd57600080613b9687866001860381518110613b7557fe5b6020026020010151878681518110613b8957fe5b6020026020010151614b33565b91509150613bb8848481518110613ba957fe5b60200260200101518383614410565b846001850381518110613bc757fe5b6020908102919091010152505060001901613b59565b509392505050565b60015460408051632233163960e21b815290516000926001600160a01b0316916388cc58e4916004808301926020929190829003018186803b158015613c2a57600080fd5b505afa158015613c3e573d6000803e3d6000fd5b505050506040513d6020811015613c5457600080fd5b50516040805163e6a4390560e01b81526001600160a01b03868116600483015285811660248301529151919092169163e6a43905916044808301926020929190829003018186803b158015613ca857600080fd5b505afa158015613cbc573d6000803e3d6000fd5b505050506040513d6020811015613cd257600080fd5b50519392505050565b60005b6001835103811015613ed957600080848381518110613cf957fe5b6020026020010151858460010181518110613d1057fe5b6020026020010151915091506000613d2883836149a3565b5090506000878560010181518110613d3c57fe5b60200260200101519050600080836001600160a01b0316866001600160a01b031614613d6a57826000613d6e565b6000835b91509150600060028a51038810613d855788613da5565b613da5868b8a60020181518110613d9857fe5b6020026020010151613be5565b9050613db18787613be5565b6001600160a01b031663022c0d9f84848460006040519080825280601f01601f191660200182016040528015613dee576020820181803883390190505b506040518563ffffffff1660e01b815260040180858152602001848152602001836001600160a01b03166001600160a01b0316815260200180602001828103825283818151815260200191508051906020019080838360005b83811015613e5f578181015183820152602001613e47565b50505050905090810190601f168015613e8c5780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b158015613eae57600080fd5b505af1158015613ec2573d6000803e3d6000fd5b505060019099019850613cde975050505050505050565b50505050565b604080516000808252602082019092526001600160a01b0384169083906040518082805190602001908083835b60208310613f2b5780518252601f199092019160209182019101613f0c565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114613f8d576040519150601f19603f3d011682016040523d82523d6000602084013e613f92565b606091505b5050905080613fd25760405162461bcd60e51b8152600401808060200182810382526023815260200180614dc66023913960400191505060405180910390fd5b505050565b60005b6001835103811015613fd257600080848381518110613ff557fe5b602002602001015185846001018151811061400c57fe5b602002602001015191509150600061402483836149a3565b50905060006140338484613be5565b9050600080600080846001600160a01b0316630902f1ac6040518163ffffffff1660e01b815260040160606040518083038186803b15801561407457600080fd5b505afa158015614088573d6000803e3d6000fd5b505050506040513d606081101561409e57600080fd5b5080516020909101516001600160701b0391821693501690506000806001600160a01b038a8116908916146140d45782846140d7565b83835b91509150614135828b6001600160a01b03166370a082318a6040518263ffffffff1660e01b815260040180826001600160a01b03166001600160a01b0316815260200191505060206040518083038186803b15801561177a57600080fd5b95506141428683836139bf565b945050505050600080856001600160a01b0316886001600160a01b03161461416c57826000614170565b6000835b91509150600060028c51038a10614187578a61419a565b61419a888d8c60020181518110613d9857fe5b604080516000808252602082019283905263022c0d9f60e01b835260248201878152604483018790526001600160a01b038086166064850152608060848501908152845160a48601819052969750908c169563022c0d9f958a958a958a9591949193919260c486019290918190849084905b8381101561422457818101518382015260200161420c565b50505050905090810190601f1680156142515780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b15801561427357600080fd5b505af1158015614287573d6000803e3d6000fd5b50506001909b019a50613fda9950505050505050505050565b808203828111156112fe576040805162461bcd60e51b815260206004820152601560248201527464732d6d6174682d7375622d756e646572666c6f7760581b604482015290519081900360640190fd5b6060600282511015614349576040805162461bcd60e51b815260206004820152601f60248201527f456e65726769737761704c6962726172793a20494e56414c49445f5041544800604482015290519081900360640190fd5b8151604051908082528060200260200182016040528015614374578160200160208202803883390190505b509050828160008151811061438557fe5b60200260200101818152505060005b6001835103811015613bdd576000806143ca878685815181106143b357fe5b6020026020010151878660010181518110613b8957fe5b915091506143ec8484815181106143dd57fe5b602002602001015183836139bf565b8484600101815181106143fb57fe5b60209081029190910101525050600101614394565b60008084116144505760405162461bcd60e51b815260040180806020018281038252602d815260200180614d79602d913960400191505060405180910390fd5b6000831180156144605750600082115b61449b5760405162461bcd60e51b8152600401808060200182810382526029815260200180614de96029913960400191505060405180910390fd5b60006144bf6103e86144b3868863ffffffff614a8116565b9063ffffffff614a8116565b905060006144d96103e56144b3868963ffffffff6142a016565b90506144f660018284816144e957fe5b049063ffffffff614ae416565b9695505050505050565b6000808061450e8989613be5565b6001600160a01b0316141561461857600160009054906101000a90046001600160a01b03166001600160a01b03166388cc58e46040518163ffffffff1660e01b815260040160206040518083038186803b15801561456b57600080fd5b505afa15801561457f573d6000803e3d6000fd5b505050506040513d602081101561459557600080fd5b5051604080516364e329cb60e11b81526001600160a01b038b811660048301528a811660248301529151919092169163c9c653969160448083019260209291908290030181600087803b1580156145eb57600080fd5b505af11580156145ff573d6000803e3d6000fd5b505050506040513d602081101561461557600080fd5b50505b60008061469f600160009054906101000a90046001600160a01b03166001600160a01b03166388cc58e46040518163ffffffff1660e01b815260040160206040518083038186803b15801561466c57600080fd5b505afa158015614680573d6000803e3d6000fd5b505050506040513d602081101561469657600080fd5b50518b8b614b33565b915091508160001480156146b1575080155b156146c1578793508692506127da565b60006146ce89848461478d565b905087811161472157858110156147165760405162461bcd60e51b8152600401808060200182810382526027815260200180614ca86027913960400191505060405180910390fd5b88945092508261477f565b600061472e89848661478d565b90508981111561473a57fe5b878110156147795760405162461bcd60e51b8152600401808060200182810382526027815260200180614c816027913960400191505060405180910390fd5b94508793505b505050965096945050505050565b60008084116147cd5760405162461bcd60e51b8152600401808060200182810382526026815260200180614e126026913960400191505060405180910390fd5b6000831180156147dd5750600082115b6148185760405162461bcd60e51b8152600401808060200182810382526029815260200180614de96029913960400191505060405180910390fd5b82614829858463ffffffff614a8116565b8161483057fe5b04949350505050565b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663a9059cbb60e01b178152925182516000946060949389169392918291908083835b602083106148b65780518252601f199092019160209182019101614897565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114614918576040519150601f19603f3d011682016040523d82523d6000602084013e61491d565b606091505b509150915081801561494b57508051158061494b575080806020019051602081101561494857600080fd5b50515b61499c576040805162461bcd60e51b815260206004820152601f60248201527f5472616e7366657248656c7065723a205452414e534645525f4641494c454400604482015290519081900360640190fd5b5050505050565b600080826001600160a01b0316846001600160a01b031614156149f75760405162461bcd60e51b8152600401808060200182810382526026815260200180614ccf6026913960400191505060405180910390fd5b826001600160a01b0316846001600160a01b031610614a17578284614a1a565b83835b90925090506001600160a01b038216614a7a576040805162461bcd60e51b815260206004820152601f60248201527f456e65726769737761704c6962726172793a205a45524f5f4144445245535300604482015290519081900360640190fd5b9250929050565b6000811580614a9c57505080820282828281614a9957fe5b04145b6112fe576040805162461bcd60e51b815260206004820152601460248201527364732d6d6174682d6d756c2d6f766572666c6f7760601b604482015290519081900360640190fd5b808201828110156112fe576040805162461bcd60e51b815260206004820152601460248201527364732d6d6174682d6164642d6f766572666c6f7760601b604482015290519081900360640190fd5b6000806000614b4285856149a3565b506040805163e6a4390560e01b81526001600160a01b038881166004830152878116602483015291519293506000929189169163e6a4390591604480820192602092909190829003018186803b158015614b9b57600080fd5b505afa158015614baf573d6000803e3d6000fd5b505050506040513d6020811015614bc557600080fd5b505160408051630240bc6b60e21b8152905191925060009182916001600160a01b03851691630902f1ac91600480820192606092909190829003018186803b158015614c1057600080fd5b505afa158015614c24573d6000803e3d6000fd5b505050506040513d6060811015614c3a57600080fd5b5080516020909101516001600160701b0391821693501690506001600160a01b0388811690851614614c6d578082614c70565b81815b909a90995097505050505050505056fe456e6572676973776170526f757465723a20494e53554646494349454e545f415f414d4f554e54456e6572676973776170526f757465723a20494e53554646494349454e545f425f414d4f554e54456e65726769737761704c6962726172793a204944454e544943414c5f414444524553534553456e6572676973776170476f7665726e6564436f6e74726163743a20464f5242494444454e2c206e6f742070726f7879456e6572676973776170526f757465723a204558434553534956455f494e5055545f414d4f554e54456e6572676973776170526f757465723a20494e53554646494349454e545f4f55545055545f414d4f554e54456e65726769737761704c6962726172793a20494e53554646494349454e545f4f55545055545f414d4f554e54456e6572676973776170526f757465723a2045585049524544000000000000005472616e7366657248656c7065723a204e52475f5452414e534645525f4641494c4544456e65726769737761704c6962726172793a20494e53554646494349454e545f4c4951554944495459456e65726769737761704c6962726172793a20494e53554646494349454e545f414d4f554e54456e6572676973776170526f757465723a20494e56414c49445f504154480000456e65726769737761704c6962726172793a20494e53554646494349454e545f494e5055545f414d4f554e54a265627a7a723158200819abba4162f92ed03d35e782b14afdffc6ecb58f356594785bd478803023bf64736f6c63430005100032