PageSourceSearch

https://pancakeswap.finance/_next/static/chunks/245-45a19ebe41e2a5c1.js

js pancakeswap.finance collected 2026-10-01 10:15:54 UTC 23,575 bytes, 2 lines download raw bytes

1try{let e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="4134a5ac-6cfe-4d6d-a54d-c7617599fd1c",e._sentryDebugIdIdentifier="sentry-dbid-4134a5ac-6cfe-4d6d-a54d-c7617599fd1c")}catch(e){}"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[245],{52203:(e,t,n)=>{n.d(t,{Fs:()=>u,Ic:()=>c});var i=n(659918);let a=(e,t)=>!!e&&!!t&&0===e.localeCompare(t,void 0,{sensitivity:"accent"});var o=n(91168),r=n(659197),l=n(414070);let s=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:["BUSD","WBNB"];return e.find(e=>t.some(t=>e.quoteToken.symbol===t))||e[0]};function u(e,t,n,a){return(0,r.o4)(e)?((e,t,n,a,o,r)=>{if(e.isZero())return i.AH;let s=n.times(t),u=o.times(a),c=s.plus(u),d=e.div((0,l.E)(r));return c.div(d)})(new o.A(e.lpTotalSupply),new o.A(e.tokenAmountTotal),t,new o.A(e.quoteTokenAmountTotal),n,a):((e,t,n,a,o)=>{let r=i.AH;if(e.gt(0)&&t.gt(0)){let t=a.times(n).times(i.eA),s=e.div((0,l.E)(o));r=t.div(s)}return r})(new o.A(e.lpTotalSupply),new o.A(e.lpTotalInQuoteToken),new o.A(e.tokenAmountTotal),t,a)}let c=(e,t,n)=>{var r;if(!e||!t||0===e.length)return[];let l=e.find(e=>((e,t)=>!!a(e.lpAddress,t.address)||a(e.token.symbol,t.stable)&&a(e.quoteToken.symbol,t.wNative))(e,t)),c=(null==l||null==(r=l.token)?void 0:r.symbol)===t.wNative,d=l&&0!==Number(null==l?void 0:l.tokenPriceVsQuote)?c?new o.A(l.tokenPriceVsQuote):i.Mm.div(new o.A(l.tokenPriceVsQuote)):i.AH;return e.map(r=>{var l,c;let p=(l=r.quoteToken.address,c=[t.wNative,t.stable],s(e.filter(e=>a(e.token.address,l)),c)),m=((e,t,n,a,r)=>e.quoteToken.symbol===r?i.Mm:e.quoteToken.symbol===a?n:t?t.quoteToken.symbol===a?t.tokenPriceVsQuote?n.times(new o.A(t.tokenPriceVsQuote)):i.AH:t.quoteToken.symbol===r&&t.tokenPriceVsQuote?new o.A(t.tokenPriceVsQuote):i.AH:i.AH)(r,p,d,t.wNative,t.stable),y=((e,t,n,a,r,l)=>{let s=!!e.tokenPriceVsQuote;return e.quoteToken.symbol===r?s?new o.A(e.tokenPriceVsQuote):i.Mm:e.quoteToken.symbol===a?s?n.times(new o.A(e.tokenPriceVsQuote)):i.Mm:t&&(t.quoteToken.symbol===a||t.quoteToken.symbol===r)?s&&l?new o.A(e.tokenPriceVsQuote).times(l):i.Mm:i.AH})(r,p,d,t.wNative,t.stable,m),f=u(r,y,m,n);return{...r,tokenPriceBusd:y.toString(),quoteTokenPriceBusd:m.toString(),lpTokenPrice:f.toString()}})}},389512:(e,t,n)=>{n.d(t,{A:()=>d});var i=n(350979),a=n(769932),o=n(334404),r=n(227883),l=n(25963),s=n(661742),u=n(189346),c=n(728844);function d(e){let{throwUserRejectError:t=!1,throwCustomError:n}=e||{},{t:d}=(0,a.A)(),{toastError:p,toastSuccess:m}=(0,o.d)(),[y,f]=(0,l.useState)(!1),{waitForTransaction:k}=(0,c.x)(),[w,T]=(0,l.useState)(!1),h=(0,l.useCallback)(e=>{(0,u.v)(e);let t=(0,s.rM)(e);if(t){let e=((e,t)=>{if(!e)return e;let n=e;return e.toLowerCase().includes("contract not allowed")&&(n+=`
2${t("Smart Wallets are not supported, please create a ticket on our Official Discord")}`),n})(t.shortMessage||t.message,d);p(d("Error"),d("Transaction failed with error: %reason%",{reason:e}))}else p(d("Error"),d("Please try again. Confirm the transaction and make sure you are paying enough gas!"))},[d,p]),g=(0,l.useCallback)((e,t)=>{(0,u.v)(e);let n=(0,s.rM)(e);p(d("Failed"),(0,i.jsx)(r.G,{txHash:t,children:n?d("Transaction failed with error: %reason%",{reason:(0,s.rV)(n)}):d("Transaction failed. For detailed error message:")}))},[d,p]);return{fetchWithCatchTxError:(0,l.useCallback)(async function(e){let a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{toastSuccess:{title:`${d("Transaction Submitted")}!`}},o=null;try{if(f(!0),!(o=await e()))return null;let t="string"==typeof o?o:o.hash;m(a.toastSuccess.title||`${d("Transaction Submitted")}!`,(0,i.jsx)(r.G,{txHash:t}));let n=await k({hash:t});if((null==n?void 0:n.status)==="success")return n;throw Error(d("Failed"))}catch(e){if((0,u.U)(e)||(o?n?n():g(e,"string"==typeof o?o:o.hash):h(e)),t)throw e}finally{f(!1)}return null},[m,d,k,t,n,h,g]),fetchTxResponse:(0,l.useCallback)(async e=>{let t=null;try{if(T(!0),!(t=await e()))return null;let n="string"==typeof t?t:t.hash;return m(`${d("Transaction Submitted")}!`,(0,i.jsx)(r.G,{txHash:n})),{hash:n}}catch(e){(0,u.U)(e)||(t?g(e,"string"==typeof t?t:t.hash):h(e))}finally{T(!1)}return null},[m,d,h,g]),loading:y,txResponseLoading:w}}},414070:(e,t,n)=>{n.d(t,{E:()=>a});var i=n(659918);let a=(0,n(381033).A)(e=>i.Fw.pow(e))},466020:(e,t,n)=>{n.d(t,{VD:()=>c,gz:()=>u});var i=n(228876),a=n(91168),o=n(776204),r=n(495659),l=n(988998),s=n(579058);function u(e){return{fetchFarms:async t=>{let{isTestnet:n,farms:a,chainId:l}=t,u=n?r.dU[i.nU.BSC_TESTNET]:r.dU[i.nU.BSC],{poolLength:c,totalRegularAllocPoint:d,totalSpecialAllocPoint:p,cakePerBlock:m}=await (0,s.HL)({isTestnet:n,provider:e,masterChefAddress:u}),y=(0,o.c)(m);return{farmsWithPrice:await (0,s.Uj)({provider:e,masterChefAddress:u,isTestnet:n,chainId:l,farms:a.filter(e=>!e.pid||c>e.pid),totalRegularAllocPoint:d,totalSpecialAllocPoint:p}),poolLength:Number(c),regularCakePerBlock:+y,totalRegularAllocPoint:d.toString()}},isChainSupported:e=>r.z.includes(e),supportedChainId:r.z,isTestnet:e=>![i.nU.BSC,i.nU.ETHEREUM].includes(e)}}function c(e){return{fetchFarms:async t=>{let{farms:n,chainId:i,commonPrice:o}=t,s=r.eQ[i];if(!s||!e)throw Error("Unsupported chain");try{let{poolLength:t,totalAllocPoint:r,latestPeriodCakePerSecond:u}=await (0,l.Gr)({provider:e,masterChefAddress:s,chainId:i}),c=new a.A(u.toString()).div(1e18).div(1e12).toString(),d=await (0,l.tP)({farms:n,chainId:i,provider:e,masterChefAddress:s,totalAllocPoint:r,commonPrice:o});return{chainId:i,poolLength:Number(t),farmsWithPrice:d,cakePerSecond:c,totalAllocPoint:r.toString()}}catch(e){throw console.error(e),e}},getCakeAprAndTVL:(e,t,n,i,o)=>{let[r,s]=e.token.sortsBefore(e.quoteToken)?[e.tokenPriceBusd,e.quoteTokenPriceBusd]:[e.quoteTokenPriceBusd,e.tokenPriceBusd],u=new a.A(r).times(t.token0).plus(new a.A(s).times(t.token1)),c=(0,l.El)(e.poolWeight,u.times(null!=o?o:1),n,i);return{activeTvlUSD:u.toString(),activeTvlUSDUpdatedAt:t.updatedAt,cakeApr:c}},isChainSupported:e=>r.GO.includes(e),supportedChainId:r.GO,isTestnet:e=>![i.nU.BSC,i.nU.ETHEREUM].includes(e)}}},579058:(e,t,n)=>{n.d(t,{Uj:()=>g,HL:()=>S});var i=n(228876),a=n(987212),o=n(659918),r=n(91168),l=n(240183),s=n(495659),u=n(659197),c=n(52203),d=n(603616);let p=[{constant:!0,inputs:[{name:"_owner",type:"address"}],name:"balanceOf",outputs:[{name:"balance",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"totalSupply",outputs:[{name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"}],m=async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i.nU.BSC,n=arguments.length>2?arguments[2]:void 0,a=arguments.length>3?arguments[3]:void 0;try{let i=e.flatMap(e=>((e,t,n)=>{let{lpAddress:i,token:a,quoteToken:o,bCakeWrapperAddress:r}=e;return[{abi:p,address:a.address,functionName:"balanceOf",args:[i]},{abi:p,address:o.address,functionName:"balanceOf",args:[i]},{abi:p,address:i,functionName:"balanceOf",args:[r||n||t]},{abi:p,address:i,functionName:"totalSupply"}]})(e,a,s.vJ[t])),o=i.length/e.length,r=await n({chainId:t}
2).multicall({contracts:i,allowFailure:!1});return(0,d.A)(r,o)}catch(e){throw console.error("MasterChef Public Data error ",e),e}};var y=n(34117);let f=[{inputs:[{internalType:"uint256",name:"",type:"uint256"}],name:"coins",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"",type:"uint256"}],name:"balances",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"i",type:"uint256"},{internalType:"uint256",name:"j",type:"uint256"},{internalType:"uint256",name:"dx",type:"uint256"}],name:"get_dy",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"}];async function k(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i.nU.BSC,n=arguments.length>2?arguments[2]:void 0,a=e.flatMap(e=>[{abi:f,address:e.stableSwapAddress,functionName:"balances",args:[0n]},{abi:f,address:e.stableSwapAddress,functionName:"balances",args:[1n]},{abi:f,address:e.stableSwapAddress,functionName:"get_dy",args:[0n,1n,(0,y.X)("1",e.token.decimals)]},{abi:f,address:e.stableSwapAddress,functionName:"get_dy",args:[1n,0n,(0,y.X)("1",e.quoteToken.decimals)]}]),o=a.length/e.length,r=await n({chainId:t}).multicall({contracts:a,allowFailure:!1});return(0,d.A)(r,o)}var w=n(414070);let T={[i.nU.ETHEREUM]:{address:"0x2E8135bE71230c6B1B4045696d41C09Db0414226",wNative:"WETH",stable:"USDC"},[i.nU.GOERLI]:{address:"0xf5bf0C34d3c428A74Ceb98d27d38d0036C587200",wNative:"WETH",stable:"tUSDC"},[i.nU.BSC]:{address:"0x58F876857a02D6762E0101bb5C46A8c1ED44Dc16",wNative:"WBNB",stable:"BUSD"},[i.nU.BSC_TESTNET]:{address:"0x4E96D2e92680Ca65D58A0e2eB5bd1c0f44cAB897",wNative:"WBNB",stable:"BUSD"},[i.nU.ARBITRUM_ONE]:{address:"0x4E96D2e92680Ca65D58A0e2eB5bd1c0f44cAB897",wNative:"WETH",stable:"USDC"},[i.nU.MONAD_TESTNET]:{address:"0x4E96D2e92680Ca65D58A0e2eB5bd1c0f44cAB897",wNative:"MON",stable:"USDC"},[i.nU.MONAD_MAINNET]:{address:"0x4E96D2e92680Ca65D58A0e2eB5bd1c0f44cAB897",wNative:"MON",stable:"USDC"},[i.nU.ROBINHOOD]:{address:"0x0000000000000000000000000000000000000000",wNative:"WETH",stable:"USDC"}},h=(e,t)=>e.div((0,w.E)(t));async function g(e){let{farms:t,provider:n,isTestnet:i,masterChefAddress:o,chainId:l,totalRegularAllocPoint:d,totalSpecialAllocPoint:p}=e;if(!s.z.includes(l))return[];let y=t.filter(u.o4),[f,w,h]=await Promise.all([k(y,l,n),A(t,i,n,o),m(t,l,n,o)]),g=f.map(P),b=y.reduce((e,t,n)=>({...e,[t.pid]:g[n]}),{}),v=h.map(q),S=t.map((e,t)=>{var n,i,a,o,r,l;try{return{...e,...b[e.pid]?B({...v[t],...b[e.pid],token0Decimals:e.token.decimals,token1Decimals:e.quoteToken.decimals,price1:b[e.pid].price1}):N({...v[t],...b[e.pid],token0Decimals:e.token.decimals,token1Decimals:e.quoteToken.decimals}),...C({allocPoint:null!=(o=BigInt(null!=(a=null==e?void 0:e.allocPoint)?a:0))?o:null==(n=w[t])?void 0:n.allocPoint,isRegular:null==(i=w[t])?void 0:i.isRegular,totalRegularAllocPoint:BigInt(2305)||d,totalSpecialAllocPoint:p})}}catch(n){throw console.error(n,e,t,{allocPoint:null==(r=w[t])?void 0:r.allocPoint,isRegular:null==(l=w[t])?void 0:l.isRegular,token0Decimals:e.token.decimals,token1Decimals:e.quoteToken.decimals,totalRegularAllocPoint:d,totalSpecialAllocPoint:p}),n}}),E=(0,c.Ic)(S,T[l],18),M=Array.from(E.reduce((e,t)=>("0"===t.tokenPriceBusd&&e.set(t.token.address,t.token),"0"===t.quoteTokenPriceBusd&&e.set(t.quoteToken.address,t.quoteToken),e),new Map).values());if(M.length){let e=await (0,a.Tn)(M);return E.map(t=>{var n,i;if("0"!==t.tokenPriceBusd&&"0"!==t.quoteTokenPriceBusd)return t;let o=(0,a.Vt)(t.token),l=(0,a.Vt)(t.quoteToken),s=new r.A(t.tokenPriceVsQuote),u=new r.A(o&&null!=(n=e[o])?n:0),d=new r.A(l&&null!=(i=e[l])?i:0);s.gt(0)&&(u.eq(0)&&d.gt(0)?u=d.div(s):d.eq(0)&&u.gt(0)&&(d=u.times(s)));let p=(0,c.Fs)(t,u,d,18);return{...t,tokenPriceBusd:u.toString(),quoteTokenPriceBusd:d.toString(),lpTokenPrice:p.toString()}})}return E}let b=[{inputs:[{internalType:"uint256",name:"",type:"uint256"}],name:"poolInfo",outputs:[{internalType:"uint256",name:"accCakePerShare",type:"uint256"},{internalType:"uint256",name:"lastRewardBlock",type:"uint256"},{internalType:"uint256",name:"allocPoint",type:"uint256"},{internalType:"uint256",name:"totalBoostedShare",type:"uint256"},{internalType:"bool",name:"isRegular",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"poolLength",outputs:[{internalType:"uint256",name:"pools",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"totalRegularAllocPoint",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"totalSpecialAllocPoint",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bool",name:"_isRegular",type:"bool"}],name:"cakePerBlock",outputs:[{internalType:"uint256",name:"amount",type:"uint256"}],stateMutability:"view",type:"function"}];function v(e){return null!=e}let A=async(e,t,n,a)=>{try{let o=e.map(e=>((e,t)=>{let{pid:n}=e;return n||0===n?{abi:b,address:t,functionName:"poolInfo",args:[BigInt(n)]}:null})(e,a)),r=o.filter(v),l=t?i.nU.BSC_TESTNET:i.nU.BSC,s=await n({chainId:l}).multicall({contracts:r,allowFailure:!1}),u=0;return o.map(e=>{if(null===e)return null;let t=s[u];return u++,{accCakePerShare:t[0],lastRewardBlock:t[1],allocPoint:t[2],totalBoostedShare:t[3],isRegular:t[4]}})}catch(e){throw console.error("MasterChef Pool info data error",e),e}},S=async e=>{let{provider:t,isTestnet:n,masterChefAddress:a}=e;try{let e=n?i.nU.BSC_TESTNET:i.nU.BSC,[o,r,l,s]=await t({chainId:e}).multicall({contracts:[{abi:b,address:a,functionName:"poolLength"},{abi:b,address:a,functionName:"totalRegularAllocPoint"},{abi:b,address:a,functionName:"totalSpecialAllocPoint"}
2,{abi:b,address:a,functionName:"cakePerBlock",args:[!0]}],allowFailure:!1});return{poolLength:o,totalRegularAllocPoint:r,totalSpecialAllocPoint:l,cakePerBlock:s}}catch(e){throw console.error("Get MasterChef data error",e),e}},P=e=>{let[t,n,i,a]=e;return{tokenBalanceLP:new r.A(t.toString()),quoteTokenBalanceLP:new r.A(n.toString()),price1:a}},B=e=>{let{lpTokenBalanceMC:t,lpTotalSupply:n,quoteTokenBalanceLP:i,tokenBalanceLP:a,token0Decimals:r,token1Decimals:s,price1:u}=e,c=h(a,r),d=h(i,s),p=n.isZero()||t.isZero()?o.AH:t.div(n),m=(0,l.J)(u,r),y=d.times(p),f=c.times(p).times(o.Mm.div(m)),k=y.plus(f);return{tokenAmountTotal:c.toString(),quoteTokenAmountTotal:d.toString(),lpTotalSupply:n.toString(),lpTotalInQuoteToken:k.toString(),tokenPriceVsQuote:m}},q=e=>{let[t,n,i,a]=e;return{tokenBalanceLP:new r.A(t.toString()),quoteTokenBalanceLP:new r.A(n.toString()),lpTokenBalanceMC:new r.A(i.toString()),lpTotalSupply:new r.A(a.toString())}},C=e=>{let{allocPoint:t,isRegular:n,totalRegularAllocPoint:i,totalSpecialAllocPoint:a}=e,l=t?new r.A(t.toString()):o.AH,s=n?i:a;return{poolWeight:(s&&l?l.div(s.toString()):o.AH).toString(),multiplier:l.isZero()?"0X":`${+l.div(10).toString()}X`}},N=e=>{let{lpTokenBalanceMC:t,lpTotalSupply:n,quoteTokenBalanceLP:i,tokenBalanceLP:a,token0Decimals:r,token1Decimals:l}=e,s=h(a,r),u=h(i,l),c=n.isZero()||t.isZero()?o.AH:t.div(n),d=u.times(c).times(o.eA);return{tokenAmountTotal:s.toString(),quoteTokenAmountTotal:u.toString(),lpTotalSupply:n.toString(),lpTotalInQuoteToken:d.toString(),tokenPriceVsQuote:u.isZero()||s.isZero()?o.AH.toString():u.div(s).toString(),lpTokenStakedAmount:t.toString()}}},603616:(e,t,n)=>{n.d(t,{A:()=>i});function i(e,t){if(t<=0)throw Error("Chunk size must be greater than 0");let n=[];for(let i=0;i<e.length;i+=t)n.push(e.slice(i,i+t));return n}},728844:(e,t,n)=>{n.d(t,{x:()=>v});var i=n(228876),a=n(782739),o=n(893130),r=n(899188),l=n(209208),s=n(760013),u=n.n(s),c=n(25963),d=n(695055),p=n(617921),m=n(524099),y=n(779623),f=n(680116),k=n(545416),w=n(532649),T=n(660193),h=n(697115),g=n(53670);let b=u()(function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return r.rY.reduce((t,n)=>({...t,[n.id]:(0,m.l)({chain:n,transport:e&&window.ethereum?(0,y.I)(window.ethereum):(0,p.v)([...l.I[n.id].map(e=>(0,f.L)(e,{timeout:15e3}))]),batch:{multicall:{batchSize:204800,wait:16}},pollingInterval:6e3})}),{})});function v(e){let{chainId:t}=(0,g.ax)(),n=null!=e?e:t,r=(0,h.e)({chainId:n}),l=(0,g.NM)(),s=(0,a.hm)(n);return{waitForTransaction:(0,c.useCallback)(async e=>{var t;let a=null!=(t=null==e?void 0:e.chainId)?t:n,u=async()=>{try{if(a&&b(l)[a]){let t=await b(l)[a].getTransactionReceipt({hash:e.hash});return"success"===t.status&&s(),t}if(!r)return;let t=await r.getTransactionReceipt({hash:e.hash});return"success"===t.status&&s(),t}catch(i){var t,n;if(i instanceof k.Kz)throw new d.dw(`Transaction not found: ${e.hash}`);if(i instanceof k.Kc)throw new d.dw(`Transaction receipt not found: ${e.hash}`);if(i instanceof w.l)throw new d.dw(`Block not found for transaction: ${e.hash}`);else if(i instanceof k.WA)throw new d.dw(`Timeout reached when fetching transaction receipt: ${e.hash}`);else if(i instanceof T.Ci&&((null==(t=i.details)?void 0:t.includes("Load failed"))||(null==(n=i.details)?void 0:n.includes("Failed to fetch"))))throw new d.dw(`Network error when request to ${i.url} failed: ${i.status}, ${i.details}`);throw i}},c=(a?i.vf[a]:o.J3)*1e3+1e3;return(0,d.cJ)(u,{n:10,base:c,delay:c,factor:1.5}).promise},[n,r,s,l])}}},988998:(e,t,n)=>{n.d(t,{tP:()=>w,ej:()=>C,Gr:()=>h,S5:()=>N,El:()=>b});var i=n(228876),a=n(670420),o=n(659918),r=n(603616),l=n(673384),s=n(91168),u=n(240183),c=n(449229),d=n(987212),p=n(740523),m=n(955647);n(311560);let y=e=>{let t=new s.A(e);return t.isFinite()&&t.isPositive()};var f=n(495659);let k=[{inputs:[],name:"latestAnswer",outputs:[{internalType:"int256",name:"",type:"int256"}],stateMutability:"view",type:"function"}];async function w(e){let{farms:t,provider:n,masterChefAddress:r,chainId:l,totalAllocPoint:c,commonPrice:d}=e,[m,y,w]=await Promise.all([g(t,l,n,r),n({chainId:i.nU.BSC}
2).readContract({abi:k,address:"0xB6064eD41d4f67e353768aA239cA86f4F73665a1",functionName:"latestAnswer"}).then(e=>(0,u.J)(e,8)),q(t,l,n)]),T=await B(w.map(e=>e[1]?e[1]:null).filter(Boolean),l,n);var h=t.map((e,t)=>{var n;let{token:i,quoteToken:a,...o}=e;if(!w[t][1])return null;let r=w[t][1];return{...o,token:i,quoteToken:a,lmPool:r,lmPoolLiquidity:T[r].liquidity,_rewardGrowthGlobalX128:T[r].rewardGrowthGlobalX128,...v({tick:w[t][0][1],token0:e.token,token1:e.quoteToken}),...A({allocPoint:null==(n=m[t])?void 0:n[0],totalAllocPoint:c})}}).filter(Boolean),b=y,S={...f.GO.includes(l)?p.w$[l]:{},...d};let P=h.map(e=>{let t=o.AH,n=o.AH;return S[e.quoteToken.address]&&(n=new s.A(S[e.quoteToken.address])),S[e.token.address]&&(t=new s.A(S[e.token.address])),t.isZero()&&e.token.chainId in a.vb&&e.token.equals(a.vb[e.token.chainId])&&(t=new s.A(b)),n.isZero()&&e.quoteToken.chainId in a.vb&&e.quoteToken.equals(a.vb[e.quoteToken.chainId])&&(n=new s.A(b)),t.isZero()&&!n.isZero()&&e.tokenPriceVsQuote&&(t=n.times(e.tokenPriceVsQuote)),n.isZero()&&!t.isZero()&&e.tokenPriceVsQuote&&(n=t.div(e.tokenPriceVsQuote)),{...e,tokenPriceBusd:t,quoteTokenPriceBusd:n}});return P.map(e=>{let{tokenPriceBusd:t,quoteTokenPriceBusd:n}=e;if(t.isZero()){let i=P.find(t=>e.token.equals(t.token)&&!t.tokenPriceBusd.isZero()||e.token.equals(t.quoteToken)&&!t.quoteTokenPriceBusd.isZero());if(i&&(t=e.token.equals(i.token)?i.tokenPriceBusd:i.quoteTokenPriceBusd),n.isZero()){let i=P.find(t=>e.quoteToken.equals(t.token)&&!t.tokenPriceBusd.isZero()||e.quoteToken.equals(t.quoteToken)&&!t.quoteTokenPriceBusd.isZero());i&&(n=e.quoteToken.equals(i.token)?i.tokenPriceBusd:i.quoteTokenPriceBusd),t.isZero()&&!n.isZero()&&e.tokenPriceVsQuote&&(t=n.times(e.tokenPriceVsQuote)),n.isZero()&&!t.isZero()&&e.tokenPriceVsQuote&&(n=t.div(e.tokenPriceVsQuote)),t.isZero()&&console.error(`Can't get price for ${e.token.address}`),n.isZero()&&console.error(`Can't get price for ${e.quoteToken.address}`)}}return{...e,tokenPriceBusd:t.toString(),quoteTokenPriceBusd:!n.isZero()&&e.tokenPriceVsQuote?t.div(e.tokenPriceVsQuote).toString():n.toString()}})}let T=[{inputs:[],name:"latestPeriodCakePerSecond",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"",type:"uint256"}],name:"poolInfo",outputs:[{internalType:"uint256",name:"allocPoint",type:"uint256"},{internalType:"contract IPancakeV3Pool",name:"v3Pool",type:"address"},{internalType:"address",name:"token0",type:"address"},{internalType:"address",name:"token1",type:"address"},{internalType:"uint24",name:"fee",type:"uint24"},{internalType:"uint256",name:"totalLiquidity",type:"uint256"},{internalType:"uint256",name:"totalBoostLiquidity",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"poolLength",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"totalAllocPoint",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"}];async function h(e){let{provider:t,masterChefAddress:n,chainId:i}=e,[a,o,r]=await t({chainId:i}).multicall({contracts:[{address:n,abi:T,functionName:"poolLength"},{address:n,abi:T,functionName:"totalAllocPoint"},{address:n,abi:T,functionName:"latestPeriodCakePerSecond"}],allowFailure:!1});return{poolLength:a,totalAllocPoint:o,latestPeriodCakePerSecond:r}}let g=async(e,t,n,i)=>{try{let a=e.map(e=>({abi:T,address:i,functionName:"poolInfo",args:[BigInt(e.pid)]})),o=await n({chainId:t}).multicall({contracts:a,allowFailure:!1}),r=0;return a.map(e=>{if(null===e)return null;let t=o[r];return r++,t})}catch(e){throw console.error("MasterChef Pool info data error",e),e}},b=(e,t,n,i)=>(function(e){let{poolWeight:t,tvlUsd:n,cakePriceUsd:i,cakePerSecond:a,precision:o=6}=e;if(!y(t)||!y(n)||!y(i)||!y(a))return"0";let r=new s.A(a).times(31536e3),l=new s.A(t).times(r).times(i).div(n).times(100);return l.isZero()?"0":(0,m.MJ)((0,m.Qu)(l.toNumber(),o),o)})({poolWeight:e,tvlUsd:t,cakePriceUsd:n,cakePerSecond:i,precision:6}),v=e=>{let{token0:t,token1:n,tick:i}=e;
2return{tokenPriceVsQuote:(0,l.y1)(t,n,i).toSignificant(6)}},A=e=>{let{allocPoint:t,totalAllocPoint:n}=e,i=void 0!==t?new s.A(t.toString()):o.AH;return{poolWeight:(n&&!i.isZero()?i.div(n.toString()):o.AH).toString(),multiplier:i.isZero()?"0X":`${+i.div(10).toString()}X`}},S=[{inputs:[],name:"lmLiquidity",outputs:[{internalType:"uint128",name:"",type:"uint128"}],stateMutability:"view",type:"function"},{inputs:[],name:"rewardGrowthGlobalX128",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"}],P=[{inputs:[],name:"lmPool",outputs:[{internalType:"contract IPancakeV3LmPool",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"slot0",outputs:[{internalType:"uint160",name:"sqrtPriceX96",type:"uint160"},{internalType:"int24",name:"tick",type:"int24"},{internalType:"uint16",name:"observationIndex",type:"uint16"},{internalType:"uint16",name:"observationCardinality",type:"uint16"},{internalType:"uint16",name:"observationCardinalityNext",type:"uint16"},{internalType:"uint32",name:"feeProtocol",type:"uint32"},{internalType:"bool",name:"unlocked",type:"bool"}],stateMutability:"view",type:"function"}];async function B(e,t,n){let i=e.flatMap(e=>[{abi:S,address:e,functionName:"lmLiquidity"},{abi:S,address:e,functionName:"rewardGrowthGlobalX128"}]),a=i.length/e.length,o=await n({chainId:t}).multicall({contracts:i,allowFailure:!0}),l=(0,r.A)(o,a),s={};for(let[t,n]of l.entries()){var u,c,d,p,m,y;s[e[t]]={liquidity:null!=(m=null==n||null==(c=n[0])||null==(u=c.result)?void 0:u.toString())?m:"0",rewardGrowthGlobalX128:null!=(y=null==n||null==(p=n[1])||null==(d=p.result)?void 0:d.toString())?y:"0"}}return s}async function q(e,t,n){let i=e.flatMap(e=>[{abi:P,address:e.lpAddress,functionName:"slot0"},{abi:P,address:e.lpAddress,functionName:"lmPool"}]),a=i.length/e.length,o=await n({chainId:t}).multicall({contracts:i,allowFailure:!1});return(0,r.A)(o,a)}let C=async e=>N((null==e?void 0:e.list)||[]),N=async function(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n={};return f.GO.includes(null==(e=t[0])?void 0:e.chainId)&&t.length>0&&Object.entries(await (0,d.Tn)(t)||{}).forEach(e=>{let[t,i]=e,[,a]=t.split(":");n[(0,c.b)(a)]=i.toString()}),n}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.