diff --git a/.contentlayer/.cache/v0.3.2/compiled-contentlayer-config-WSC433HJ.mjs b/.contentlayer/.cache/v0.3.2/compiled-contentlayer-config-WSC433HJ.mjs new file mode 100644 index 0000000..062c159 --- /dev/null +++ b/.contentlayer/.cache/v0.3.2/compiled-contentlayer-config-WSC433HJ.mjs @@ -0,0 +1,109 @@ +// contentlayer.config.js +import { defineDocumentType, makeSource } from "contentlayer/source-files"; +import remarkGfm from "remark-gfm"; +import rehypePrettyCode from "rehype-pretty-code"; +import rehypeSlug from "rehype-slug"; +import rehypeAutolinkHeadings from "rehype-autolink-headings"; +var computedFields = { + path: { + type: "string", + resolve: (doc) => `/${doc._raw.flattenedPath}` + }, + slug: { + type: "string", + resolve: (doc) => doc._raw.flattenedPath.split("/").slice(1).join("/") + } +}; +var Project = defineDocumentType(() => ({ + name: "Project", + filePathPattern: "./projects/**/*.md", + contentType: "mdx", + fields: { + published: { + type: "boolean" + }, + title: { + type: "string", + required: true + }, + description: { + type: "string", + required: true + }, + date: { + type: "date" + }, + url: { + type: "string" + }, + repository: { + type: "string" + }, + author: { + type: "string", + default: "LowK" + }, + featured: { + type: "boolean", + default: false + } + }, + computedFields +})); +var Page = defineDocumentType(() => ({ + name: "Page", + filePathPattern: "pages/**/*.md", + contentType: "mdx", + fields: { + title: { + type: "string", + required: true + }, + description: { + type: "string" + } + }, + computedFields +})); +var contentlayer_config_default = makeSource({ + contentDirPath: "./content", + documentTypes: [Page, Project], + mdx: { + remarkPlugins: [remarkGfm], + rehypePlugins: [ + rehypeSlug, + [ + rehypePrettyCode, + { + theme: "github-dark", + onVisitLine(node) { + if (node.children.length === 0) { + node.children = [{ type: "text", value: " " }]; + } + }, + onVisitHighlightedLine(node) { + node.properties.className.push("line--highlighted"); + }, + onVisitHighlightedWord(node) { + node.properties.className = ["word--highlighted"]; + } + } + ], + [ + rehypeAutolinkHeadings, + { + properties: { + className: ["subheading-anchor"], + ariaLabel: "Link to section" + } + } + ] + ] + } +}); +export { + Page, + Project, + contentlayer_config_default as default +}; +//# sourceMappingURL=compiled-contentlayer-config-WSC433HJ.mjs.map diff --git a/.contentlayer/.cache/v0.3.2/compiled-contentlayer-config-WSC433HJ.mjs.map b/.contentlayer/.cache/v0.3.2/compiled-contentlayer-config-WSC433HJ.mjs.map new file mode 100644 index 0000000..37c78fa --- /dev/null +++ b/.contentlayer/.cache/v0.3.2/compiled-contentlayer-config-WSC433HJ.mjs.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../../../contentlayer.config.js"], + "sourcesContent": ["import { defineDocumentType, makeSource } from \"contentlayer/source-files\";\nimport remarkGfm from \"remark-gfm\";\nimport rehypePrettyCode from \"rehype-pretty-code\";\nimport rehypeSlug from \"rehype-slug\";\nimport rehypeAutolinkHeadings from \"rehype-autolink-headings\";\n\n/** @type {import('contentlayer/source-files').ComputedFields} */\nconst computedFields = {\n\tpath: {\n\t\ttype: \"string\",\n\t\tresolve: (doc) => `/${doc._raw.flattenedPath}`,\n\t},\n\tslug: {\n\t\ttype: \"string\",\n\t\tresolve: (doc) => doc._raw.flattenedPath.split(\"/\").slice(1).join(\"/\"),\n\t},\n};\n\nexport const Project = defineDocumentType(() => ({\n\tname: \"Project\",\n\tfilePathPattern: \"./projects/**/*.md\",\n\tcontentType: \"mdx\",\n\n\tfields: {\n\t\tpublished: {\n\t\t\ttype: \"boolean\",\n\t\t},\n\t\ttitle: {\n\t\t\ttype: \"string\",\n\t\t\trequired: true,\n\t\t},\n\t\tdescription: {\n\t\t\ttype: \"string\",\n\t\t\trequired: true,\n\t\t},\n\t\tdate: {\n\t\t\ttype: \"date\",\n\t\t},\n\t\turl: {\n\t\t\ttype: \"string\",\n\t\t},\n\t\trepository: {\n\t\t\ttype: \"string\",\n\t\t},\n\t\tauthor: {\n\t\t\ttype: \"string\",\n\t\t\tdefault: \"LowK\"\n\t\t},\n\t\tfeatured: {\n\t\t\ttype: \"boolean\",\n\t\t\tdefault: false,\n\t\t}\n\t},\n\tcomputedFields,\n}));\n\nexport const Page = defineDocumentType(() => ({\n\tname: \"Page\",\n\tfilePathPattern: \"pages/**/*.md\",\n\tcontentType: \"mdx\",\n\tfields: {\n\t\ttitle: {\n\t\t\ttype: \"string\",\n\t\t\trequired: true,\n\t\t},\n\t\tdescription: {\n\t\t\ttype: \"string\",\n\t\t},\n\t},\n\tcomputedFields,\n}));\n\nexport default makeSource({\n\tcontentDirPath: \"./content\",\n\tdocumentTypes: [Page, Project],\n\tmdx: {\n\t\tremarkPlugins: [remarkGfm],\n\t\trehypePlugins: [\n\t\t\trehypeSlug,\n\t\t\t[\n\t\t\t\trehypePrettyCode,\n\t\t\t\t{\n\t\t\t\t\ttheme: \"github-dark\",\n\t\t\t\t\tonVisitLine(node) {\n\t\t\t\t\t\t// Prevent lines from collapsing in `display: grid` mode, and allow empty\n\t\t\t\t\t\t// lines to be copy/pasted\n\t\t\t\t\t\tif (node.children.length === 0) {\n\t\t\t\t\t\t\tnode.children = [{ type: \"text\", value: \" \" }];\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tonVisitHighlightedLine(node) {\n\t\t\t\t\t\tnode.properties.className.push(\"line--highlighted\");\n\t\t\t\t\t},\n\t\t\t\t\tonVisitHighlightedWord(node) {\n\t\t\t\t\t\tnode.properties.className = [\"word--highlighted\"];\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t],\n\t\t\t[\n\t\t\t\trehypeAutolinkHeadings,\n\t\t\t\t{\n\t\t\t\t\tproperties: {\n\t\t\t\t\t\tclassName: [\"subheading-anchor\"],\n\t\t\t\t\t\tariaLabel: \"Link to section\",\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t],\n\t\t],\n\t},\n});\n"], + "mappings": ";AAAA,SAAS,oBAAoB,kBAAkB;AAC/C,OAAO,eAAe;AACtB,OAAO,sBAAsB;AAC7B,OAAO,gBAAgB;AACvB,OAAO,4BAA4B;AAGnC,IAAM,iBAAiB;AAAA,EACtB,MAAM;AAAA,IACL,MAAM;AAAA,IACN,SAAS,CAAC,QAAQ,IAAI,IAAI,KAAK;AAAA,EAChC;AAAA,EACA,MAAM;AAAA,IACL,MAAM;AAAA,IACN,SAAS,CAAC,QAAQ,IAAI,KAAK,cAAc,MAAM,GAAG,EAAE,MAAM,CAAC,EAAE,KAAK,GAAG;AAAA,EACtE;AACD;AAEO,IAAM,UAAU,mBAAmB,OAAO;AAAA,EAChD,MAAM;AAAA,EACN,iBAAiB;AAAA,EACjB,aAAa;AAAA,EAEb,QAAQ;AAAA,IACP,WAAW;AAAA,MACV,MAAM;AAAA,IACP;AAAA,IACA,OAAO;AAAA,MACN,MAAM;AAAA,MACN,UAAU;AAAA,IACX;AAAA,IACA,aAAa;AAAA,MACZ,MAAM;AAAA,MACN,UAAU;AAAA,IACX;AAAA,IACA,MAAM;AAAA,MACL,MAAM;AAAA,IACP;AAAA,IACA,KAAK;AAAA,MACJ,MAAM;AAAA,IACP;AAAA,IACA,YAAY;AAAA,MACX,MAAM;AAAA,IACP;AAAA,IACA,QAAQ;AAAA,MACP,MAAM;AAAA,MACN,SAAS;AAAA,IACV;AAAA,IACA,UAAU;AAAA,MACT,MAAM;AAAA,MACN,SAAS;AAAA,IACV;AAAA,EACD;AAAA,EACA;AACD,EAAE;AAEK,IAAM,OAAO,mBAAmB,OAAO;AAAA,EAC7C,MAAM;AAAA,EACN,iBAAiB;AAAA,EACjB,aAAa;AAAA,EACb,QAAQ;AAAA,IACP,OAAO;AAAA,MACN,MAAM;AAAA,MACN,UAAU;AAAA,IACX;AAAA,IACA,aAAa;AAAA,MACZ,MAAM;AAAA,IACP;AAAA,EACD;AAAA,EACA;AACD,EAAE;AAEF,IAAO,8BAAQ,WAAW;AAAA,EACzB,gBAAgB;AAAA,EAChB,eAAe,CAAC,MAAM,OAAO;AAAA,EAC7B,KAAK;AAAA,IACJ,eAAe,CAAC,SAAS;AAAA,IACzB,eAAe;AAAA,MACd;AAAA,MACA;AAAA,QACC;AAAA,QACA;AAAA,UACC,OAAO;AAAA,UACP,YAAY,MAAM;AAGjB,gBAAI,KAAK,SAAS,WAAW,GAAG;AAC/B,mBAAK,WAAW,CAAC,EAAE,MAAM,QAAQ,OAAO,IAAI,CAAC;AAAA,YAC9C;AAAA,UACD;AAAA,UACA,uBAAuB,MAAM;AAC5B,iBAAK,WAAW,UAAU,KAAK,mBAAmB;AAAA,UACnD;AAAA,UACA,uBAAuB,MAAM;AAC5B,iBAAK,WAAW,YAAY,CAAC,mBAAmB;AAAA,UACjD;AAAA,QACD;AAAA,MACD;AAAA,MACA;AAAA,QACC;AAAA,QACA;AAAA,UACC,YAAY;AAAA,YACX,WAAW,CAAC,mBAAmB;AAAA,YAC/B,WAAW;AAAA,UACZ;AAAA,QACD;AAAA,MACD;AAAA,IACD;AAAA,EACD;AACD,CAAC;", + "names": [] +} diff --git a/.contentlayer/.cache/v0.3.2/data-WSC433HJ.json b/.contentlayer/.cache/v0.3.2/data-WSC433HJ.json new file mode 100644 index 0000000..1fb3ce7 --- /dev/null +++ b/.contentlayer/.cache/v0.3.2/data-WSC433HJ.json @@ -0,0 +1,62 @@ +{ + "cacheItemsMap": { + "projects/2023-10-10-LayerZero-Integrations-Security-Tips.md": { + "document": { + "published": true, + "title": "LayerZero Integrations Security Tips", + "description": "LayerZero integrations security tips for smart contract developers and auditors.", + "date": "2023-10-10T00:00:00.000Z", + "repository": null, + "author": "LowK", + "featured": true, + "body": { + "raw": "\nLayerZero is an omnichain interoperability protocol designed for lightweight message passing across chains. \nLayerZero provides authentic and guaranteed message delivery with configurable trustlessness.\nNeeds more information about LayerZero check out the [docs](https://layerzero.gitbook.io/docs/). \n\nIf you are a smart contract developer or auditor, you should be aware of the following security tips \nwhen integrating LayerZero into your smart contracts.\n\n## Security Tips\n\n1. Calling `send()` with `{value: msg.value}` is because `send()` **requires a bit of native gas token** so the relayer can complete the message delivery on the destination chain. If you don't set this value [you might get this error](notion://www.notion.so/docs/evm-guides/error-messages/error-layerzero-relayer-fee-failed) when calling `endpoint.send()`\n\n2. In a received chain, A **msg.sender is the LZ endpoint**. Are there any mistakes?\n\n3. **Address Sanity Check** In a receiving chain\n \n Is SrcAddress whitelisted?\n \n Check the address size according to the source chain (e.g. address size == 20 bytes on EVM chains) to prevent a vector unauthenticated contract call.\n \n4. In a received chain, parse srcAddress to the address type that is just applied for EVM chains. **Is your application connected with non-evm chain?**\n\n5. **Is there a set of trusted remote addresses**? The feature is available at some places that must be checked:\n - retryPayload()::srcAddress\n - hasStoredPayload()::srcAddress\n - forceResumeReceive()::srcAddress\n - setTrustedRemote()::path\n - isTrustedRemote()::_srcAddress\n - lzReceive()::_srcAddress\n6. **Should implement an *Instant Finality Guarantee (IFG)***\n \n Reverting in (user application) UA is cumbersome and expensive. It is more efficient to design your UA with IFG such that if a transaction was accepted at source, the transaction will be accepted at the remote. For example, Stargate has a credit management system (Delta Algorithm) to guarantee that if a swap was accepted at source, the destination must have enough asset to complete the swap, hence the IFG.\n \n7. **Tracking the nonce**\n\n8. **One action per message**: only one thing per message\n\n9. **Store failed message**: [example](https://solodit.xyz/issues/h-06-attacker-can-block-layerzero-channel-code4rena-velodrome-finance-velodrome-finance-git)\n \n If the message execution fails at the destination, try-catch it, and store it for future retries. From LayerZero's perspective, the message has been delivered. It is much cheaper and easier for your programs to recover from the last state at the destination chain.\n Store a hash of the message payload is much cheaper than storing the whole message\n \n *sink*: not implement `blockingLzReceive()`\n \n10. **Gas for Message Types**\n \n *If your app includes multiple message types to be sent across chains,* compute a rough gas estimate at the destination chain per each message type.\n \n *Your message may fail for the out-of-gas exception at the destination if your app did not instruct the relayer to put extra gas on contract execution*. \n \n And the UA should enforce the gas estimate on-chain at the source chain to prevent users from inputting too low a value for gas.", + "code": "var Component=(()=>{var lr=Object.create;var A=Object.defineProperty;var cr=Object.getOwnPropertyDescriptor;var ur=Object.getOwnPropertyNames;var dr=Object.getPrototypeOf,fr=Object.prototype.hasOwnProperty;var Z=(u,n)=>()=>(n||u((n={exports:{}}).exports,n),n.exports),mr=(u,n)=>{for(var _ in n)A(u,_,{get:n[_],enumerable:!0})},ge=(u,n,_,N)=>{if(n&&typeof n==\"object\"||typeof n==\"function\")for(let y of ur(n))!fr.call(u,y)&&y!==_&&A(u,y,{get:()=>n[y],enumerable:!(N=cr(n,y))||N.enumerable});return u};var br=(u,n,_)=>(_=u!=null?lr(dr(u)):{},ge(n||!u||!u.__esModule?A(_,\"default\",{value:u,enumerable:!0}):_,u)),pr=u=>ge(A({},\"__esModule\",{value:!0}),u);var xe=Z((gr,je)=>{je.exports=React});var we=Z(B=>{\"use strict\";(function(){\"use strict\";var u=xe(),n=Symbol.for(\"react.element\"),_=Symbol.for(\"react.portal\"),N=Symbol.for(\"react.fragment\"),y=Symbol.for(\"react.strict_mode\"),q=Symbol.for(\"react.profiler\"),K=Symbol.for(\"react.provider\"),X=Symbol.for(\"react.context\"),R=Symbol.for(\"react.forward_ref\"),D=Symbol.for(\"react.suspense\"),F=Symbol.for(\"react.suspense_list\"),U=Symbol.for(\"react.memo\"),I=Symbol.for(\"react.lazy\"),Ue=Symbol.for(\"react.offscreen\"),H=Symbol.iterator,Te=\"@@iterator\";function Ce(e){if(e===null||typeof e!=\"object\")return null;var r=H&&e[H]||e[Te];return typeof r==\"function\"?r:null}var j=u.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function m(e){{for(var r=arguments.length,t=new Array(r>1?r-1:0),a=1;a=1&&f>=0&&i[d]!==b[f];)f--;for(;d>=1&&f>=0;d--,f--)if(i[d]!==b[f]){if(d!==1||f!==1)do if(d--,f--,f<0||i[d]!==b[f]){var p=`\n`+i[d].replace(\" at new \",\" at \");return e.displayName&&p.includes(\"\")&&(p=p.replace(\"\",e.displayName)),typeof e==\"function\"&&C.set(e,p),p}while(d>=1&&f>=0);break}}}finally{M=!1,L.current=c,Me(),Error.prepareStackTrace=l}var w=e?e.displayName||e.name:\"\",Ne=w?T(w):\"\";return typeof e==\"function\"&&C.set(e,Ne),Ne}function Ve(e,r,t){return le(e,!1)}function We(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function S(e,r,t){if(e==null)return\"\";if(typeof e==\"function\")return le(e,We(e));if(typeof e==\"string\")return T(e);switch(e){case D:return T(\"Suspense\");case F:return T(\"SuspenseList\")}if(typeof e==\"object\")switch(e.$$typeof){case R:return Ve(e.render);case U:return S(e.type,r,t);case I:{var a=e,l=a._payload,c=a._init;try{return S(c(l),r,t)}catch{}}}return\"\"}var O=Object.prototype.hasOwnProperty,ce={},ue=j.ReactDebugCurrentFrame;function P(e){if(e){var r=e._owner,t=S(e.type,e._source,r?r.type:null);ue.setExtraStackFrame(t)}else ue.setExtraStackFrame(null)}function ze(e,r,t,a,l){{var c=Function.call.bind(O);for(var s in e)if(c(e,s)){var i=void 0;try{if(typeof e[s]!=\"function\"){var b=Error((a||\"React class\")+\": \"+t+\" type `\"+s+\"` is invalid; it must be a function, usually from the `prop-types` package, but received `\"+typeof e[s]+\"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.\");throw b.name=\"Invariant Violation\",b}i=e[s](r,s,a,t,null,\"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED\")}catch(d){i=d}i&&!(i instanceof Error)&&(P(l),m(\"%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).\",a||\"React class\",t,s,typeof i),P(null)),i instanceof Error&&!(i.message in ce)&&(ce[i.message]=!0,P(l),m(\"Failed %s type: %s\",t,i.message),P(null))}}}var Ge=Array.isArray;function $(e){return Ge(e)}function Ze(e){{var r=typeof Symbol==\"function\"&&Symbol.toStringTag,t=r&&e[Symbol.toStringTag]||e.constructor.name||\"Object\";return t}}function Be(e){try{return de(e),!1}catch{return!0}}function de(e){return\"\"+e}function fe(e){if(Be(e))return m(\"The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.\",Ze(e)),de(e)}var E=j.ReactCurrentOwner,qe={key:!0,ref:!0,__self:!0,__source:!0},me,be,V;V={};function Ke(e){if(O.call(e,\"ref\")){var r=Object.getOwnPropertyDescriptor(e,\"ref\").get;if(r&&r.isReactWarning)return!1}return e.ref!==void 0}function Xe(e){if(O.call(e,\"key\")){var r=Object.getOwnPropertyDescriptor(e,\"key\").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function He(e,r){if(typeof e.ref==\"string\"&&E.current&&r&&E.current.stateNode!==r){var t=h(E.current.type);V[t]||(m('Component \"%s\" contains the string ref \"%s\". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',h(E.current.type),e.ref),V[t]=!0)}}function Je(e,r){{var t=function(){me||(me=!0,m(\"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)\",r))};t.isReactWarning=!0,Object.defineProperty(e,\"key\",{get:t,configurable:!0})}}function Qe(e,r){{var t=function(){be||(be=!0,m(\"%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)\",r))};t.isReactWarning=!0,Object.defineProperty(e,\"ref\",{get:t,configurable:!0})}}var er=function(e,r,t,a,l,c,s){var i={$$typeof:n,type:e,key:r,ref:t,props:s,_owner:c};return i._store={},Object.defineProperty(i._store,\"validated\",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(i,\"_self\",{configurable:!1,enumerable:!1,writable:!1,value:a}),Object.defineProperty(i,\"_source\",{configurable:!1,enumerable:!1,writable:!1,value:l}),Object.freeze&&(Object.freeze(i.props),Object.freeze(i)),i};function rr(e,r,t,a,l){{var c,s={},i=null,b=null;t!==void 0&&(fe(t),i=\"\"+t),Xe(r)&&(fe(r.key),i=\"\"+r.key),Ke(r)&&(b=r.ref,He(r,l));for(c in r)O.call(r,c)&&!qe.hasOwnProperty(c)&&(s[c]=r[c]);if(e&&e.defaultProps){var d=e.defaultProps;for(c in d)s[c]===void 0&&(s[c]=d[c])}if(i||b){var f=typeof e==\"function\"?e.displayName||e.name||\"Unknown\":e;i&&Je(s,f),b&&Qe(s,f)}return er(e,i,b,l,a,E.current,s)}}var W=j.ReactCurrentOwner,pe=j.ReactDebugCurrentFrame;function x(e){if(e){var r=e._owner,t=S(e.type,e._source,r?r.type:null);pe.setExtraStackFrame(t)}else pe.setExtraStackFrame(null)}var z;z=!1;function G(e){return typeof e==\"object\"&&e!==null&&e.$$typeof===n}function _e(){{if(W.current){var e=h(W.current.type);if(e)return`\n\nCheck the render method of \\``+e+\"`.\"}return\"\"}}function nr(e){{if(e!==void 0){var r=e.fileName.replace(/^.*[\\\\\\/]/,\"\"),t=e.lineNumber;return`\n\nCheck your code at `+r+\":\"+t+\".\"}return\"\"}}var he={};function tr(e){{var r=_e();if(!r){var t=typeof e==\"string\"?e:e.displayName||e.name;t&&(r=`\n\nCheck the top-level render call using <`+t+\">.\")}return r}}function ve(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var t=tr(r);if(he[t])return;he[t]=!0;var a=\"\";e&&e._owner&&e._owner!==W.current&&(a=\" It was passed a child from \"+h(e._owner.type)+\".\"),x(e),m('Each child in a list should have a unique \"key\" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',t,a),x(null)}}function ye(e,r){{if(typeof e!=\"object\")return;if($(e))for(var t=0;t\",i=\" Did you accidentally export a JSX literal instead of a component?\"):d=typeof e,m(\"React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s\",d,i)}var f=rr(e,r,t,l,c);if(f==null)return f;if(s){var p=r.children;if(p!==void 0)if(a)if($(p)){for(var w=0;w{\"use strict\";ke.exports=we()});var yr={};mr(yr,{default:()=>vr,frontmatter:()=>_r});var o=br(Ee()),_r={title:\"LayerZero Integrations Security Tips\",description:\"LayerZero integrations security tips for smart contract developers and auditors.\",repository:null,date:new Date(1696896e6),published:!0,featured:!0,author:\"LowK\"};function Re(u){let n=Object.assign({p:\"p\",a:\"a\",h2:\"h2\",span:\"span\",ol:\"ol\",li:\"li\",code:\"code\",strong:\"strong\",ul:\"ul\",em:\"em\"},u.components);return(0,o.jsxDEV)(o.Fragment,{children:[(0,o.jsxDEV)(n.p,{children:[`LayerZero is an omnichain interoperability protocol designed for lightweight message passing across chains.\nLayerZero provides authentic and guaranteed message delivery with configurable trustlessness.\nNeeds more information about LayerZero check out the `,(0,o.jsxDEV)(n.a,{href:\"https://layerzero.gitbook.io/docs/\",children:\"docs\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:13,columnNumber:54},this),\".\"]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:11,columnNumber:1},this),`\n`,(0,o.jsxDEV)(n.p,{children:`If you are a smart contract developer or auditor, you should be aware of the following security tips\nwhen integrating LayerZero into your smart contracts.`},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:15,columnNumber:1},this),`\n`,(0,o.jsxDEV)(n.h2,{id:\"security-tips\",children:[(0,o.jsxDEV)(n.a,{className:\"subheading-anchor\",\"aria-label\":\"Link to section\",href:\"#security-tips\",children:(0,o.jsxDEV)(n.span,{className:\"icon icon-link\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\"},this)},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\"},this),\"Security Tips\"]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:18,columnNumber:1},this),`\n`,(0,o.jsxDEV)(n.ol,{children:[`\n`,(0,o.jsxDEV)(n.li,{children:[`\n`,(0,o.jsxDEV)(n.p,{children:[\"Calling\\xA0\",(0,o.jsxDEV)(n.code,{children:\"send()\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:20,columnNumber:12},this),\"\\xA0with\\xA0\",(0,o.jsxDEV)(n.code,{children:\"{value: msg.value}\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:20,columnNumber:26},this),\" is because\\xA0\",(0,o.jsxDEV)(n.code,{children:\"send()\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:20,columnNumber:58},this),\"\\xA0\",(0,o.jsxDEV)(n.strong,{children:\"requires a bit of native gas token\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:20,columnNumber:67},this),\" so the relayer can complete the message delivery on the destination chain. If you don't set this value\\xA0\",(0,o.jsxDEV)(n.a,{href:\"notion://www.notion.so/docs/evm-guides/error-messages/error-layerzero-relayer-fee-failed\",children:\"you might get this error\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:20,columnNumber:209},this),\"\\xA0when calling\\xA0\",(0,o.jsxDEV)(n.code,{children:\"endpoint.send()\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:20,columnNumber:339},this)]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:20,columnNumber:4},this),`\n`]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:20,columnNumber:1},this),`\n`,(0,o.jsxDEV)(n.li,{children:[`\n`,(0,o.jsxDEV)(n.p,{children:[\"In a received chain, A \",(0,o.jsxDEV)(n.strong,{children:\"msg.sender is the LZ endpoint\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:22,columnNumber:28},this),\". Are there any mistakes?\"]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:22,columnNumber:5},this),`\n`]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:22,columnNumber:1},this),`\n`,(0,o.jsxDEV)(n.li,{children:[`\n`,(0,o.jsxDEV)(n.p,{children:[(0,o.jsxDEV)(n.strong,{children:\"Address Sanity Check\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:24,columnNumber:4},this),\" In a receiving chain\"]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:24,columnNumber:4},this),`\n`,(0,o.jsxDEV)(n.p,{children:\"Is SrcAddress whitelisted?\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:26,columnNumber:5},this),`\n`,(0,o.jsxDEV)(n.p,{children:\"Check the address size according to the source chain (e.g. address size == 20 bytes on EVM chains) to prevent a vector unauthenticated contract call.\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:28,columnNumber:5},this),`\n`]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:24,columnNumber:1},this),`\n`,(0,o.jsxDEV)(n.li,{children:[`\n`,(0,o.jsxDEV)(n.p,{children:[\"In a received chain, parse srcAddress to the address type that is just applied for EVM chains. \",(0,o.jsxDEV)(n.strong,{children:\"Is your application connected with non-evm chain?\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:30,columnNumber:100},this)]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:30,columnNumber:5},this),`\n`]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:30,columnNumber:1},this),`\n`,(0,o.jsxDEV)(n.li,{children:[`\n`,(0,o.jsxDEV)(n.p,{children:[(0,o.jsxDEV)(n.strong,{children:\"Is there a set of trusted remote addresses\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:32,columnNumber:4},this),\"? The feature is available at some places that must be checked:\"]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:32,columnNumber:4},this),`\n`,(0,o.jsxDEV)(n.ul,{children:[`\n`,(0,o.jsxDEV)(n.li,{children:\"retryPayload()::srcAddress\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:33,columnNumber:5},this),`\n`,(0,o.jsxDEV)(n.li,{children:\"hasStoredPayload()::srcAddress\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:34,columnNumber:5},this),`\n`,(0,o.jsxDEV)(n.li,{children:\"forceResumeReceive()::srcAddress\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:35,columnNumber:5},this),`\n`,(0,o.jsxDEV)(n.li,{children:\"setTrustedRemote()::path\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:36,columnNumber:5},this),`\n`,(0,o.jsxDEV)(n.li,{children:\"isTrustedRemote()::_srcAddress\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:37,columnNumber:5},this),`\n`,(0,o.jsxDEV)(n.li,{children:\"lzReceive()::_srcAddress\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:38,columnNumber:5},this),`\n`]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:33,columnNumber:5},this),`\n`]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:32,columnNumber:1},this),`\n`,(0,o.jsxDEV)(n.li,{children:[`\n`,(0,o.jsxDEV)(n.p,{children:(0,o.jsxDEV)(n.strong,{children:[\"Should implement an \",(0,o.jsxDEV)(n.em,{children:\"Instant Finality Guarantee (IFG)\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:39,columnNumber:26},this)]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:39,columnNumber:4},this)},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:39,columnNumber:4},this),`\n`,(0,o.jsxDEV)(n.p,{children:\"Reverting in (user application) UA is cumbersome and expensive. It is more efficient to design your UA with IFG such that if a transaction was accepted at source, the transaction will be accepted at the remote. For example, Stargate has a credit management system (Delta Algorithm) to guarantee that if a swap was accepted at source, the destination must have enough asset to complete the swap, hence the IFG.\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:41,columnNumber:5},this),`\n`]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:39,columnNumber:1},this),`\n`,(0,o.jsxDEV)(n.li,{children:[`\n`,(0,o.jsxDEV)(n.p,{children:(0,o.jsxDEV)(n.strong,{children:\"Tracking the nonce\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:43,columnNumber:4},this)},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:43,columnNumber:4},this),`\n`]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:43,columnNumber:1},this),`\n`,(0,o.jsxDEV)(n.li,{children:[`\n`,(0,o.jsxDEV)(n.p,{children:[(0,o.jsxDEV)(n.strong,{children:\"One action per message\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:45,columnNumber:4},this),\": only one thing per message\"]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:45,columnNumber:4},this),`\n`]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:45,columnNumber:1},this),`\n`,(0,o.jsxDEV)(n.li,{children:[`\n`,(0,o.jsxDEV)(n.p,{children:[(0,o.jsxDEV)(n.strong,{children:\"Store failed message\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:47,columnNumber:4},this),\": \",(0,o.jsxDEV)(n.a,{href:\"https://solodit.xyz/issues/h-06-attacker-can-block-layerzero-channel-code4rena-velodrome-finance-velodrome-finance-git\",children:\"example\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:47,columnNumber:30},this)]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:47,columnNumber:4},this),`\n`,(0,o.jsxDEV)(n.p,{children:`If the message execution fails at the destination, try-catch it, and store it for future retries. From LayerZero's perspective, the message has been delivered. It is much cheaper and easier for your programs to recover from the last state at the destination chain.\nStore a hash of the message payload is much cheaper than storing the whole message`},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:49,columnNumber:5},this),`\n`,(0,o.jsxDEV)(n.p,{children:[(0,o.jsxDEV)(n.em,{children:\"sink\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:52,columnNumber:5},this),\": not implement \",(0,o.jsxDEV)(n.code,{children:\"blockingLzReceive()\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:52,columnNumber:27},this)]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:52,columnNumber:5},this),`\n`]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:47,columnNumber:1},this),`\n`,(0,o.jsxDEV)(n.li,{children:[`\n`,(0,o.jsxDEV)(n.p,{children:(0,o.jsxDEV)(n.strong,{children:\"Gas for Message Types\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:54,columnNumber:5},this)},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:54,columnNumber:5},this),`\n`,(0,o.jsxDEV)(n.p,{children:[(0,o.jsxDEV)(n.em,{children:\"If your app includes multiple message types to be sent across chains,\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:56,columnNumber:5},this),\" compute a rough gas estimate at the destination chain per each message type.\"]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:56,columnNumber:5},this),`\n`,(0,o.jsxDEV)(n.p,{children:[(0,o.jsxDEV)(n.em,{children:\"Your message may fail for the out-of-gas exception at the destination if your app did not instruct the relayer to put extra gas on contract execution\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:58,columnNumber:5},this),\".\"]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:58,columnNumber:5},this),`\n`,(0,o.jsxDEV)(n.p,{children:\"And the UA should enforce the gas estimate on-chain at the source chain to prevent users from inputting too low a value for gas.\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:60,columnNumber:5},this),`\n`]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:54,columnNumber:1},this),`\n`]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:20,columnNumber:1},this)]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:1,columnNumber:1},this)}function hr(u={}){let{wrapper:n}=u.components||{};return n?(0,o.jsxDEV)(n,Object.assign({},u,{children:(0,o.jsxDEV)(Re,u,void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\"},this)}),void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\"},this):Re(u)}var vr=hr;return pr(yr);})();\n/*! Bundled license information:\n\nreact/cjs/react-jsx-dev-runtime.development.js:\n (**\n * @license React\n * react-jsx-dev-runtime.development.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *)\n*/\n;return Component;" + }, + "_id": "projects/2023-10-10-LayerZero-Integrations-Security-Tips.md", + "_raw": { + "sourceFilePath": "projects/2023-10-10-LayerZero-Integrations-Security-Tips.md", + "sourceFileName": "2023-10-10-LayerZero-Integrations-Security-Tips.md", + "sourceFileDir": "projects", + "contentType": "markdown", + "flattenedPath": "projects/2023-10-10-LayerZero-Integrations-Security-Tips" + }, + "type": "Project", + "path": "/projects/2023-10-10-LayerZero-Integrations-Security-Tips", + "slug": "2023-10-10-LayerZero-Integrations-Security-Tips" + }, + "documentHash": "1696910203884", + "hasWarnings": false, + "documentTypeName": "Project" + }, + "projects/WooFi.md": { + "document": { + "published": false, + "title": "Woo Finance - Users can lose their money if they use cross-swap in some situations.", + "description": "Users can lose their money if there is any reverts when use crossSwap in Woo Finance.", + "date": "2023-10-06T00:00:00.000Z", + "repository": "woonetwork/WooPoolV2", + "author": "LowK", + "featured": true, + "body": { + "raw": "\nI discovered some high-impact vulnerabilities in WooFi smart contracts. \nUsers can lose their money if they use the function \"crossSwap\" in WooCrossChainRouter, WooCrossChainRouterV2, and WooCrossChainRouterV3 contracts. \nFollowing the details below:\n\nIn the contract \"WooCrossChainRouter\" at\n\n- https://github.com/woonetwork/WooPoolV2/blob/6b7d13fea34a78ca59e4b1aae73d3caa00c2efba/contracts/WooCrossChainRouter.sol#L250-L368\n- https://arbiscan.io/address/0x44df096d2600c6a6db77899db3de3aecff746cb8\n- and in other chains.\n\n```solidity\nfunction sgReceive(\n uint16, /*_chainId*/\n bytes memory, /*_srcAddress*/\n uint256, /*_nonce*/\n address _token,\n uint256 amountLD,\n bytes memory payload\n ) external override {\n require(msg.sender == address(stargateRouter), \"WooCrossChainRouter: INVALID_CALLER\");\n\n (address toToken, uint256 refId, uint256 minToAmount, address to) = abi.decode(\n payload,\n (address, uint256, uint256, address)\n );\n\n if (wooRouter.wooPool().quoteToken() != _token) {\n // NOTE: The bridged token is not WooPP's quote token.\n // So Cannot do the swap; just return it to users.\n // ..\n }\n\n uint256 quoteAmount = amountLD;\n\n if (toToken == ETH_PLACEHOLDER_ADDR) {\n // quoteToken -> WETH -> ETH\n TransferHelper.safeApprove(_token, address(wooRouter), quoteAmount);\n try wooRouter.swap(_token, WETH, quoteAmount, minToAmount, payable(address(this)), to) returns (\n uint256 realToAmount\n ) {\n IWETH(WETH).withdraw(realToAmount);\n TransferHelper.safeTransferETH(to, realToAmount);\n emit WooCrossSwapOnDstChain(...);\n } catch {\n // transfer _token/amountLD to msg.sender because the swap failed for some reason.\n // this is not the ideal scenario, but the contract needs to deliver them eth or USDC.\n TransferHelper.safeTransfer(_token, to, amountLD);\n emit WooCrossSwapOnDstChain(...);\n }\n } else {\n // ...\n }\n }\n```\n\nThe \"crossSwap\" function allows users to send and swap cross-chains.\n\nWhen users call the \"crossSwap\" function to swap in a source chain, a \"StarGateRouter\" contract will callback to the \"sgReceive\" function in a destination chain.\n\nThe contract \"WooCrossChainRouter\" uses a try-catch block to handle reverting. If any revert is raised, the user in the destination chain will not receive their fund.\n\nAn example scenario:\n\n1. A user cross-swaps in the source chain with the `toToken` parameter equal to the ETH_PLACEHOLDER_ADDR constant, and `toToken` is a quote token.\n\n2. In the destination chain, the contract will swap `_token` to WETH. After that, transferring these ETH to an address the user owned\n\n3. The swap is OK and is wrapped by a try-catch block. However, the transfer of ETH is not protected. If the receiving address does not define fallback() or receive() functions, it will revert.\n\nIf any reverts occur, the user will lose their money, and the money will be held in this contract.\n\n", + "code": "var Component=(()=>{var mn=Object.create;var O=Object.defineProperty;var dn=Object.getOwnPropertyDescriptor;var cn=Object.getOwnPropertyNames;var un=Object.getPrototypeOf,fn=Object.prototype.hasOwnProperty;var q=(d,e)=>()=>(e||d((e={exports:{}}).exports,e),e.exports),pn=(d,e)=>{for(var _ in e)O(d,_,{get:e[_],enumerable:!0})},xe=(d,e,_,y)=>{if(e&&typeof e==\"object\"||typeof e==\"function\")for(let j of cn(e))!fn.call(d,j)&&j!==_&&O(d,j,{get:()=>e[j],enumerable:!(y=dn(e,j))||y.enumerable});return d};var bn=(d,e,_)=>(_=d!=null?mn(un(d)):{},xe(e||!d||!d.__esModule?O(_,\"default\",{value:d,enumerable:!0}):_,d)),_n=d=>xe(O({},\"__esModule\",{value:!0}),d);var Ee=q((vn,ve)=>{ve.exports=React});var we=q(G=>{\"use strict\";(function(){\"use strict\";var d=Ee(),e=Symbol.for(\"react.element\"),_=Symbol.for(\"react.portal\"),y=Symbol.for(\"react.fragment\"),j=Symbol.for(\"react.strict_mode\"),z=Symbol.for(\"react.profiler\"),K=Symbol.for(\"react.provider\"),X=Symbol.for(\"react.context\"),g=Symbol.for(\"react.forward_ref\"),P=Symbol.for(\"react.suspense\"),S=Symbol.for(\"react.suspense_list\"),F=Symbol.for(\"react.memo\"),B=Symbol.for(\"react.lazy\"),Fe=Symbol.for(\"react.offscreen\"),J=Symbol.iterator,Re=\"@@iterator\";function Te(r){if(r===null||typeof r!=\"object\")return null;var t=J&&r[J]||r[Re];return typeof t==\"function\"?t:null}var v=d.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function f(r){{for(var t=arguments.length,o=new Array(t>1?t-1:0),l=1;l=1&&u>=0&&a[c]!==p[u];)u--;for(;c>=1&&u>=0;c--,u--)if(a[c]!==p[u]){if(c!==1||u!==1)do if(c--,u--,u<0||a[c]!==p[u]){var b=`\n`+a[c].replace(\" at new \",\" at \");return r.displayName&&b.includes(\"\")&&(b=b.replace(\"\",r.displayName)),typeof r==\"function\"&&T.set(r,b),b}while(c>=1&&u>=0);break}}}finally{L=!1,W.current=i,Le(),Error.prepareStackTrace=m}var w=r?r.displayName||r.name:\"\",ye=w?R(w):\"\";return typeof r==\"function\"&&T.set(r,ye),ye}function Ye(r,t,o){return me(r,!1)}function $e(r){var t=r.prototype;return!!(t&&t.isReactComponent)}function C(r,t,o){if(r==null)return\"\";if(typeof r==\"function\")return me(r,$e(r));if(typeof r==\"string\")return R(r);switch(r){case P:return R(\"Suspense\");case S:return R(\"SuspenseList\")}if(typeof r==\"object\")switch(r.$$typeof){case g:return Ye(r.render);case F:return C(r.type,t,o);case B:{var l=r,m=l._payload,i=l._init;try{return C(i(m),t,o)}catch{}}}return\"\"}var A=Object.prototype.hasOwnProperty,ie={},de=v.ReactDebugCurrentFrame;function D(r){if(r){var t=r._owner,o=C(r.type,r._source,t?t.type:null);de.setExtraStackFrame(o)}else de.setExtraStackFrame(null)}function He(r,t,o,l,m){{var i=Function.call.bind(A);for(var s in r)if(i(r,s)){var a=void 0;try{if(typeof r[s]!=\"function\"){var p=Error((l||\"React class\")+\": \"+o+\" type `\"+s+\"` is invalid; it must be a function, usually from the `prop-types` package, but received `\"+typeof r[s]+\"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.\");throw p.name=\"Invariant Violation\",p}a=r[s](t,s,l,o,null,\"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED\")}catch(c){a=c}a&&!(a instanceof Error)&&(D(m),f(\"%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).\",l||\"React class\",o,s,typeof a),D(null)),a instanceof Error&&!(a.message in ie)&&(ie[a.message]=!0,D(m),f(\"Failed %s type: %s\",o,a.message),D(null))}}}var Me=Array.isArray;function V(r){return Me(r)}function qe(r){{var t=typeof Symbol==\"function\"&&Symbol.toStringTag,o=t&&r[Symbol.toStringTag]||r.constructor.name||\"Object\";return o}}function Ge(r){try{return ce(r),!1}catch{return!0}}function ce(r){return\"\"+r}function ue(r){if(Ge(r))return f(\"The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.\",qe(r)),ce(r)}var U=v.ReactCurrentOwner,ze={key:!0,ref:!0,__self:!0,__source:!0},fe,pe,Y;Y={};function Ke(r){if(A.call(r,\"ref\")){var t=Object.getOwnPropertyDescriptor(r,\"ref\").get;if(t&&t.isReactWarning)return!1}return r.ref!==void 0}function Xe(r){if(A.call(r,\"key\")){var t=Object.getOwnPropertyDescriptor(r,\"key\").get;if(t&&t.isReactWarning)return!1}return r.key!==void 0}function Je(r,t){if(typeof r.ref==\"string\"&&U.current&&t&&U.current.stateNode!==t){var o=N(U.current.type);Y[o]||(f('Component \"%s\" contains the string ref \"%s\". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',N(U.current.type),r.ref),Y[o]=!0)}}function Ze(r,t){{var o=function(){fe||(fe=!0,f(\"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)\",t))};o.isReactWarning=!0,Object.defineProperty(r,\"key\",{get:o,configurable:!0})}}function Qe(r,t){{var o=function(){pe||(pe=!0,f(\"%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)\",t))};o.isReactWarning=!0,Object.defineProperty(r,\"ref\",{get:o,configurable:!0})}}var en=function(r,t,o,l,m,i,s){var a={$$typeof:e,type:r,key:t,ref:o,props:s,_owner:i};return a._store={},Object.defineProperty(a._store,\"validated\",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(a,\"_self\",{configurable:!1,enumerable:!1,writable:!1,value:l}),Object.defineProperty(a,\"_source\",{configurable:!1,enumerable:!1,writable:!1,value:m}),Object.freeze&&(Object.freeze(a.props),Object.freeze(a)),a};function nn(r,t,o,l,m){{var i,s={},a=null,p=null;o!==void 0&&(ue(o),a=\"\"+o),Xe(t)&&(ue(t.key),a=\"\"+t.key),Ke(t)&&(p=t.ref,Je(t,m));for(i in t)A.call(t,i)&&!ze.hasOwnProperty(i)&&(s[i]=t[i]);if(r&&r.defaultProps){var c=r.defaultProps;for(i in c)s[i]===void 0&&(s[i]=c[i])}if(a||p){var u=typeof r==\"function\"?r.displayName||r.name||\"Unknown\":r;a&&Ze(s,u),p&&Qe(s,u)}return en(r,a,p,m,l,U.current,s)}}var $=v.ReactCurrentOwner,be=v.ReactDebugCurrentFrame;function E(r){if(r){var t=r._owner,o=C(r.type,r._source,t?t.type:null);be.setExtraStackFrame(o)}else be.setExtraStackFrame(null)}var H;H=!1;function M(r){return typeof r==\"object\"&&r!==null&&r.$$typeof===e}function _e(){{if($.current){var r=N($.current.type);if(r)return`\n\nCheck the render method of \\``+r+\"`.\"}return\"\"}}function rn(r){{if(r!==void 0){var t=r.fileName.replace(/^.*[\\\\\\/]/,\"\"),o=r.lineNumber;return`\n\nCheck your code at `+t+\":\"+o+\".\"}return\"\"}}var Ne={};function tn(r){{var t=_e();if(!t){var o=typeof r==\"string\"?r:r.displayName||r.name;o&&(t=`\n\nCheck the top-level render call using <`+o+\">.\")}return t}}function he(r,t){{if(!r._store||r._store.validated||r.key!=null)return;r._store.validated=!0;var o=tn(t);if(Ne[o])return;Ne[o]=!0;var l=\"\";r&&r._owner&&r._owner!==$.current&&(l=\" It was passed a child from \"+N(r._owner.type)+\".\"),E(r),f('Each child in a list should have a unique \"key\" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',o,l),E(null)}}function je(r,t){{if(typeof r!=\"object\")return;if(V(r))for(var o=0;o\",a=\" Did you accidentally export a JSX literal instead of a component?\"):c=typeof r,f(\"React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s\",c,a)}var u=nn(r,t,o,m,i);if(u==null)return u;if(s){var b=t.children;if(b!==void 0)if(l)if(V(b)){for(var w=0;w{\"use strict\";ke.exports=we()});var yn={};pn(yn,{default:()=>jn,frontmatter:()=>Nn});var n=bn(Ue()),Nn={title:\"Woo Finance - Users can lose their money if they use cross-swap in some situations.\",description:\"Users can lose their money if there is any reverts when use crossSwap in Woo Finance.\",repository:\"woonetwork/WooPoolV2\",date:\"2023-10-06\",published:!1,featured:!0};function ge(d){let e=Object.assign({p:\"p\",ul:\"ul\",li:\"li\",a:\"a\",div:\"div\",pre:\"pre\",code:\"code\",span:\"span\",ol:\"ol\"},d.components);return(0,n.jsxDEV)(n.Fragment,{children:[(0,n.jsxDEV)(e.p,{children:`I discovered some high-impact vulnerabilities in WooFi smart contracts.\nUsers can lose their money if they use the function \"crossSwap\" in WooCrossChainRouter, WooCrossChainRouterV2, and WooCrossChainRouterV3 contracts.\nFollowing the details below:`},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:10,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.p,{children:'In the contract \"WooCrossChainRouter\" at'},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:14,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.ul,{children:[`\n`,(0,n.jsxDEV)(e.li,{children:(0,n.jsxDEV)(e.a,{href:\"https://github.com/woonetwork/WooPoolV2/blob/6b7d13fea34a78ca59e4b1aae73d3caa00c2efba/contracts/WooCrossChainRouter.sol#L250-L368\",children:\"https://github.com/woonetwork/WooPoolV2/blob/6b7d13fea34a78ca59e4b1aae73d3caa00c2efba/contracts/WooCrossChainRouter.sol#L250-L368\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:16,columnNumber:3},this)},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:16,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.li,{children:(0,n.jsxDEV)(e.a,{href:\"https://arbiscan.io/address/0x44df096d2600c6a6db77899db3de3aecff746cb8\",children:\"https://arbiscan.io/address/0x44df096d2600c6a6db77899db3de3aecff746cb8\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:17,columnNumber:3},this)},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:17,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.li,{children:\"and in other chains.\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:18,columnNumber:1},this),`\n`]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:16,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.div,{\"data-rehype-pretty-code-fragment\":\"\",children:(0,n.jsxDEV)(e.pre,{\"data-language\":\"solidity\",\"data-theme\":\"default\",children:(0,n.jsxDEV)(e.code,{\"data-language\":\"solidity\",\"data-theme\":\"default\",children:[(0,n.jsxDEV)(e.span,{className:\"line\",children:[(0,n.jsxDEV)(e.span,{style:{color:\"#F97583\"},children:\"function\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:1,columnNumber:104},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:1,columnNumber:148},this),(0,n.jsxDEV)(e.span,{style:{color:\"#B392F0\"},children:\"sgReceive\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:1,columnNumber:185},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\"(\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:1,columnNumber:230},this)]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:1,columnNumber:85},this),`\n`,(0,n.jsxDEV)(e.span,{className:\"line\",children:[(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:2,columnNumber:20},this),(0,n.jsxDEV)(e.span,{style:{color:\"#79B8FF\"},children:\"uint16\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:2,columnNumber:64},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\", \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:2,columnNumber:106},this),(0,n.jsxDEV)(e.span,{style:{color:\"#6A737D\"},children:\"/*_chainId*/\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:2,columnNumber:144},this)]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:2,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.span,{className:\"line\",children:[(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:3,columnNumber:20},this),(0,n.jsxDEV)(e.span,{style:{color:\"#79B8FF\"},children:\"bytes\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:3,columnNumber:64},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:3,columnNumber:105},this),(0,n.jsxDEV)(e.span,{style:{color:\"#F97583\"},children:\"memory\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:3,columnNumber:142},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\", \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:3,columnNumber:184},this),(0,n.jsxDEV)(e.span,{style:{color:\"#6A737D\"},children:\"/*_srcAddress*/\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:3,columnNumber:222},this)]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:3,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.span,{className:\"line\",children:[(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:4,columnNumber:20},this),(0,n.jsxDEV)(e.span,{style:{color:\"#79B8FF\"},children:\"uint256\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:4,columnNumber:64},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\", \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:4,columnNumber:107},this),(0,n.jsxDEV)(e.span,{style:{color:\"#6A737D\"},children:\"/*_nonce*/\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:4,columnNumber:145},this)]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:4,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.span,{className:\"line\",children:[(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:5,columnNumber:20},this),(0,n.jsxDEV)(e.span,{style:{color:\"#79B8FF\"},children:\"address\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:5,columnNumber:64},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" _token,\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:5,columnNumber:107},this)]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:5,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.span,{className:\"line\",children:[(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:6,columnNumber:20},this),(0,n.jsxDEV)(e.span,{style:{color:\"#79B8FF\"},children:\"uint256\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:6,columnNumber:64},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:6,columnNumber:107},this),(0,n.jsxDEV)(e.span,{style:{color:\"#FFAB70\"},children:\"amountLD\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:6,columnNumber:144},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\",\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:6,columnNumber:188},this)]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:6,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.span,{className:\"line\",children:[(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:7,columnNumber:20},this),(0,n.jsxDEV)(e.span,{style:{color:\"#79B8FF\"},children:\"bytes\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:7,columnNumber:64},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:7,columnNumber:105},this),(0,n.jsxDEV)(e.span,{style:{color:\"#F97583\"},children:\"memory\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:7,columnNumber:142},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:7,columnNumber:184},this),(0,n.jsxDEV)(e.span,{style:{color:\"#FFAB70\"},children:\"payload\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:7,columnNumber:221},this)]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:7,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.span,{className:\"line\",children:[(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" ) \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:8,columnNumber:20},this),(0,n.jsxDEV)(e.span,{style:{color:\"#F97583\"},children:\"external\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:8,columnNumber:62},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:8,columnNumber:106},this),(0,n.jsxDEV)(e.span,{style:{color:\"#F97583\"},children:\"override\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:8,columnNumber:143},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" {\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:8,columnNumber:187},this)]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:8,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.span,{className:\"line\",children:[(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:9,columnNumber:20},this),(0,n.jsxDEV)(e.span,{style:{color:\"#F97583\"},children:\"require\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:9,columnNumber:64},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\"(\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:9,columnNumber:107},this),(0,n.jsxDEV)(e.span,{style:{color:\"#79B8FF\"},children:\"msg.sender\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:9,columnNumber:144},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:9,columnNumber:190},this),(0,n.jsxDEV)(e.span,{style:{color:\"#F97583\"},children:\"==\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:9,columnNumber:227},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:9,columnNumber:265},this),(0,n.jsxDEV)(e.span,{style:{color:\"#79B8FF\"},children:\"address\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:9,columnNumber:302},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\"(stargateRouter), \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:9,columnNumber:345},this),(0,n.jsxDEV)(e.span,{style:{color:\"#9ECBFF\"},children:'\"WooCrossChainRouter: INVALID_CALLER\"'},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:9,columnNumber:399},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\");\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:9,columnNumber:482},this)]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:9,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.span,{className:\"line\",children:\" \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:10,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.span,{className:\"line\",children:[(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" (\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:11,columnNumber:20},this),(0,n.jsxDEV)(e.span,{style:{color:\"#79B8FF\"},children:\"address\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:11,columnNumber:65},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" toToken, \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:11,columnNumber:108},this),(0,n.jsxDEV)(e.span,{style:{color:\"#79B8FF\"},children:\"uint256\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:11,columnNumber:154},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" refId, \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:11,columnNumber:197},this),(0,n.jsxDEV)(e.span,{style:{color:\"#79B8FF\"},children:\"uint256\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:11,columnNumber:241},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" minToAmount, \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:11,columnNumber:284},this),(0,n.jsxDEV)(e.span,{style:{color:\"#79B8FF\"},children:\"address\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:11,columnNumber:334},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" to) \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:11,columnNumber:377},this),(0,n.jsxDEV)(e.span,{style:{color:\"#F97583\"},children:\"=\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:11,columnNumber:418},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:11,columnNumber:455},this),(0,n.jsxDEV)(e.span,{style:{color:\"#79B8FF\"},children:\"abi\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:11,columnNumber:492},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\".\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:11,columnNumber:531},this),(0,n.jsxDEV)(e.span,{style:{color:\"#B392F0\"},children:\"decode\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:11,columnNumber:568},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\"(\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:11,columnNumber:610},this)]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:11,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.span,{className:\"line\",children:(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" payload,\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:12,columnNumber:20},this)},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:12,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.span,{className:\"line\",children:[(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" (\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:13,columnNumber:20},this),(0,n.jsxDEV)(e.span,{style:{color:\"#79B8FF\"},children:\"address\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:13,columnNumber:69},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\", \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:13,columnNumber:112},this),(0,n.jsxDEV)(e.span,{style:{color:\"#79B8FF\"},children:\"uint256\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:13,columnNumber:150},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\", \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:13,columnNumber:193},this),(0,n.jsxDEV)(e.span,{style:{color:\"#79B8FF\"},children:\"uint256\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:13,columnNumber:231},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\", \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:13,columnNumber:274},this),(0,n.jsxDEV)(e.span,{style:{color:\"#79B8FF\"},children:\"address\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:13,columnNumber:312},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\")\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:13,columnNumber:355},this)]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:13,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.span,{className:\"line\",children:(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" );\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:14,columnNumber:20},this)},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:14,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.span,{className:\"line\",children:\" \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:15,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.span,{className:\"line\",children:[(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:16,columnNumber:20},this),(0,n.jsxDEV)(e.span,{style:{color:\"#F97583\"},children:\"if\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:16,columnNumber:64},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" (wooRouter.\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:16,columnNumber:102},this),(0,n.jsxDEV)(e.span,{style:{color:\"#B392F0\"},children:\"wooPool\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:16,columnNumber:150},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\"().\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:16,columnNumber:193},this),(0,n.jsxDEV)(e.span,{style:{color:\"#B392F0\"},children:\"quoteToken\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:16,columnNumber:232},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\"() \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:16,columnNumber:278},this),(0,n.jsxDEV)(e.span,{style:{color:\"#F97583\"},children:\"!=\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:16,columnNumber:317},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" _token) {\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:16,columnNumber:355},this)]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:16,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.span,{className:\"line\",children:[(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:17,columnNumber:20},this),(0,n.jsxDEV)(e.span,{style:{color:\"#6A737D\"},children:\"// \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:17,columnNumber:68},this),(0,n.jsxDEV)(e.span,{style:{color:\"#F97583\"},children:\"NOTE\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:17,columnNumber:107},this),(0,n.jsxDEV)(e.span,{style:{color:\"#6A737D\"},children:\": The bridged token is not WooPP's quote token.\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:17,columnNumber:147},this)]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:17,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.span,{className:\"line\",children:[(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:18,columnNumber:20},this),(0,n.jsxDEV)(e.span,{style:{color:\"#6A737D\"},children:\"// So Cannot do the swap; just return it to users.\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:18,columnNumber:68},this)]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:18,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.span,{className:\"line\",children:[(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:19,columnNumber:20},this),(0,n.jsxDEV)(e.span,{style:{color:\"#6A737D\"},children:\"// ..\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:19,columnNumber:68},this)]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:19,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.span,{className:\"line\",children:(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" }\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:20,columnNumber:20},this)},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:20,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.span,{className:\"line\",children:\" \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:21,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.span,{className:\"line\",children:[(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:22,columnNumber:20},this),(0,n.jsxDEV)(e.span,{style:{color:\"#79B8FF\"},children:\"uint256\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:22,columnNumber:64},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" quoteAmount \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:22,columnNumber:107},this),(0,n.jsxDEV)(e.span,{style:{color:\"#F97583\"},children:\"=\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:22,columnNumber:156},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" amountLD;\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:22,columnNumber:193},this)]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:22,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.span,{className:\"line\",children:\" \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:23,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.span,{className:\"line\",children:[(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:24,columnNumber:20},this),(0,n.jsxDEV)(e.span,{style:{color:\"#F97583\"},children:\"if\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:24,columnNumber:64},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" (toToken \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:24,columnNumber:102},this),(0,n.jsxDEV)(e.span,{style:{color:\"#F97583\"},children:\"==\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:24,columnNumber:148},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" ETH_PLACEHOLDER_ADDR) {\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:24,columnNumber:186},this)]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:24,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.span,{className:\"line\",children:[(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:25,columnNumber:20},this),(0,n.jsxDEV)(e.span,{style:{color:\"#6A737D\"},children:\"// quoteToken -> WETH -> ETH\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:25,columnNumber:68},this)]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:25,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.span,{className:\"line\",children:[(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" TransferHelper.\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:26,columnNumber:20},this),(0,n.jsxDEV)(e.span,{style:{color:\"#B392F0\"},children:\"safeApprove\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:26,columnNumber:83},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\"(_token, \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:26,columnNumber:130},this),(0,n.jsxDEV)(e.span,{style:{color:\"#79B8FF\"},children:\"address\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:26,columnNumber:175},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\"(wooRouter), quoteAmount);\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:26,columnNumber:218},this)]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:26,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.span,{className:\"line\",children:[(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:27,columnNumber:20},this),(0,n.jsxDEV)(e.span,{style:{color:\"#F97583\"},children:\"try\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:27,columnNumber:68},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" wooRouter.\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:27,columnNumber:107},this),(0,n.jsxDEV)(e.span,{style:{color:\"#B392F0\"},children:\"swap\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:27,columnNumber:154},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\"(_token, WETH, quoteAmount, minToAmount, \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:27,columnNumber:194},this),(0,n.jsxDEV)(e.span,{style:{color:\"#F97583\"},children:\"payable\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:27,columnNumber:271},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\"(\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:27,columnNumber:314},this),(0,n.jsxDEV)(e.span,{style:{color:\"#79B8FF\"},children:\"address\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:27,columnNumber:351},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\"(\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:27,columnNumber:394},this),(0,n.jsxDEV)(e.span,{style:{color:\"#79B8FF\"},children:\"this\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:27,columnNumber:431},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\")), to) \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:27,columnNumber:471},this),(0,n.jsxDEV)(e.span,{style:{color:\"#F97583\"},children:\"returns\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:27,columnNumber:515},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" (\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:27,columnNumber:558},this)]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:27,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.span,{className:\"line\",children:[(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:28,columnNumber:20},this),(0,n.jsxDEV)(e.span,{style:{color:\"#79B8FF\"},children:\"uint256\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:28,columnNumber:72},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:28,columnNumber:115},this),(0,n.jsxDEV)(e.span,{style:{color:\"#FFAB70\"},children:\"realToAmount\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:28,columnNumber:152},this)]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:28,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.span,{className:\"line\",children:(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" ) {\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:29,columnNumber:20},this)},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:29,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.span,{className:\"line\",children:[(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:30,columnNumber:20},this),(0,n.jsxDEV)(e.span,{style:{color:\"#B392F0\"},children:\"IWETH\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:30,columnNumber:72},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\"(WETH).\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:30,columnNumber:113},this),(0,n.jsxDEV)(e.span,{style:{color:\"#B392F0\"},children:\"withdraw\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:30,columnNumber:156},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\"(realToAmount);\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:30,columnNumber:200},this)]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:30,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.span,{className:\"line\",children:[(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" TransferHelper.\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:31,columnNumber:20},this),(0,n.jsxDEV)(e.span,{style:{color:\"#B392F0\"},children:\"safeTransferETH\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:31,columnNumber:87},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\"(to, realToAmount);\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:31,columnNumber:138},this)]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:31,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.span,{className:\"line\",children:[(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:32,columnNumber:20},this),(0,n.jsxDEV)(e.span,{style:{color:\"#F97583\"},children:\"emit\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:32,columnNumber:72},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:32,columnNumber:112},this),(0,n.jsxDEV)(e.span,{style:{color:\"#B392F0\"},children:\"WooCrossSwapOnDstChain\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:32,columnNumber:149},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\"(...);\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:32,columnNumber:207},this)]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:32,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.span,{className:\"line\",children:[(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" } \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:33,columnNumber:20},this),(0,n.jsxDEV)(e.span,{style:{color:\"#F97583\"},children:\"catch\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:33,columnNumber:70},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" {\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:33,columnNumber:111},this)]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:33,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.span,{className:\"line\",children:[(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:34,columnNumber:20},this),(0,n.jsxDEV)(e.span,{style:{color:\"#6A737D\"},children:\"// transfer _token/amountLD to msg.sender because the swap failed for some reason.\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:34,columnNumber:72},this)]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:34,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.span,{className:\"line\",children:[(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:35,columnNumber:20},this),(0,n.jsxDEV)(e.span,{style:{color:\"#6A737D\"},children:\"// this is not the ideal scenario, but the contract needs to deliver them eth or USDC.\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:35,columnNumber:72},this)]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:35,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.span,{className:\"line\",children:[(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" TransferHelper.\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:36,columnNumber:20},this),(0,n.jsxDEV)(e.span,{style:{color:\"#B392F0\"},children:\"safeTransfer\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:36,columnNumber:87},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\"(_token, to, amountLD);\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:36,columnNumber:135},this)]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:36,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.span,{className:\"line\",children:[(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:37,columnNumber:20},this),(0,n.jsxDEV)(e.span,{style:{color:\"#F97583\"},children:\"emit\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:37,columnNumber:72},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:37,columnNumber:112},this),(0,n.jsxDEV)(e.span,{style:{color:\"#B392F0\"},children:\"WooCrossSwapOnDstChain\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:37,columnNumber:149},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\"(...);\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:37,columnNumber:207},this)]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:37,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.span,{className:\"line\",children:(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" }\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:38,columnNumber:20},this)},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:38,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.span,{className:\"line\",children:[(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" } \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:39,columnNumber:20},this),(0,n.jsxDEV)(e.span,{style:{color:\"#F97583\"},children:\"else\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:39,columnNumber:66},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" {\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:39,columnNumber:106},this)]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:39,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.span,{className:\"line\",children:[(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:40,columnNumber:20},this),(0,n.jsxDEV)(e.span,{style:{color:\"#6A737D\"},children:\"// ...\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:40,columnNumber:68},this)]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:40,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.span,{className:\"line\",children:(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" }\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:41,columnNumber:20},this)},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:41,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.span,{className:\"line\",children:(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" }\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:42,columnNumber:20},this)},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:42,columnNumber:1},this)]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:1,columnNumber:79},this)},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:1,columnNumber:1},this)},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:20,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.p,{children:'The \"crossSwap\" function allows users to send and swap cross-chains.'},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:65,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.p,{children:'When users call the \"crossSwap\" function to swap in a source chain, a \"StarGateRouter\" contract will callback to the \"sgReceive\" function in a destination chain.'},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:67,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.p,{children:'The contract \"WooCrossChainRouter\" uses a try-catch block to handle reverting. If any revert is raised, the user in the destination chain will not receive their fund.'},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:69,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.p,{children:\"An example scenario:\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:71,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.ol,{children:[`\n`,(0,n.jsxDEV)(e.li,{children:[`\n`,(0,n.jsxDEV)(e.p,{children:[\"A user cross-swaps in the source chain with the \",(0,n.jsxDEV)(e.code,{children:\"toToken\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:73,columnNumber:52},this),\" parameter equal to the ETH_PLACEHOLDER_ADDR constant, and \",(0,n.jsxDEV)(e.code,{children:\"toToken\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:73,columnNumber:120},this),\" is a quote token.\"]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:73,columnNumber:4},this),`\n`]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:73,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.li,{children:[`\n`,(0,n.jsxDEV)(e.p,{children:[\"In the destination chain, the contract will swap \",(0,n.jsxDEV)(e.code,{children:\"_token\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:75,columnNumber:53},this),\" to WETH. After that, transferring these ETH to an address the user owned\"]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:75,columnNumber:4},this),`\n`]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:75,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.li,{children:[`\n`,(0,n.jsxDEV)(e.p,{children:\"The swap is OK and is wrapped by a try-catch block. However, the transfer of ETH is not protected. If the receiving address does not define fallback() or receive() functions, it will revert.\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:77,columnNumber:4},this),`\n`]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:77,columnNumber:1},this),`\n`]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:73,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.p,{children:\"If any reverts occur, the user will lose their money, and the money will be held in this contract.\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:79,columnNumber:1},this)]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:1,columnNumber:1},this)}function hn(d={}){let{wrapper:e}=d.components||{};return e?(0,n.jsxDEV)(e,Object.assign({},d,{children:(0,n.jsxDEV)(ge,d,void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\"},this)}),void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\"},this):ge(d)}var jn=hn;return _n(yn);})();\n/*! Bundled license information:\n\nreact/cjs/react-jsx-dev-runtime.development.js:\n (**\n * @license React\n * react-jsx-dev-runtime.development.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *)\n*/\n;return Component;" + }, + "_id": "projects/WooFi.md", + "_raw": { + "sourceFilePath": "projects/WooFi.md", + "sourceFileName": "WooFi.md", + "sourceFileDir": "projects", + "contentType": "markdown", + "flattenedPath": "projects/WooFi" + }, + "type": "Project", + "path": "/projects/WooFi", + "slug": "WooFi" + }, + "documentHash": "1696671601705", + "hasWarnings": false, + "documentTypeName": "Project" + } + } +} diff --git a/.contentlayer/generated/Project/_index.json b/.contentlayer/generated/Project/_index.json index cfd2cd5..e376021 100644 --- a/.contentlayer/generated/Project/_index.json +++ b/.contentlayer/generated/Project/_index.json @@ -1,4 +1,28 @@ [ + { + "published": true, + "title": "LayerZero Integrations Security Tips", + "description": "LayerZero integrations security tips for smart contract developers and auditors.", + "date": "2023-10-10T00:00:00.000Z", + "repository": null, + "author": "LowK", + "featured": true, + "body": { + "raw": "\nLayerZero is an omnichain interoperability protocol designed for lightweight message passing across chains. \nLayerZero provides authentic and guaranteed message delivery with configurable trustlessness.\nNeeds more information about LayerZero check out the [docs](https://layerzero.gitbook.io/docs/). \n\nIf you are a smart contract developer or auditor, you should be aware of the following security tips \nwhen integrating LayerZero into your smart contracts.\n\n## Security Tips\n\n1. Calling `send()` with `{value: msg.value}` is because `send()` **requires a bit of native gas token** so the relayer can complete the message delivery on the destination chain. If you don't set this value [you might get this error](notion://www.notion.so/docs/evm-guides/error-messages/error-layerzero-relayer-fee-failed) when calling `endpoint.send()`\n\n2. In a received chain, A **msg.sender is the LZ endpoint**. Are there any mistakes?\n\n3. **Address Sanity Check** In a receiving chain\n \n Is SrcAddress whitelisted?\n \n Check the address size according to the source chain (e.g. address size == 20 bytes on EVM chains) to prevent a vector unauthenticated contract call.\n \n4. In a received chain, parse srcAddress to the address type that is just applied for EVM chains. **Is your application connected with non-evm chain?**\n\n5. **Is there a set of trusted remote addresses**? The feature is available at some places that must be checked:\n - retryPayload()::srcAddress\n - hasStoredPayload()::srcAddress\n - forceResumeReceive()::srcAddress\n - setTrustedRemote()::path\n - isTrustedRemote()::_srcAddress\n - lzReceive()::_srcAddress\n6. **Should implement an *Instant Finality Guarantee (IFG)***\n \n Reverting in (user application) UA is cumbersome and expensive. It is more efficient to design your UA with IFG such that if a transaction was accepted at source, the transaction will be accepted at the remote. For example, Stargate has a credit management system (Delta Algorithm) to guarantee that if a swap was accepted at source, the destination must have enough asset to complete the swap, hence the IFG.\n \n7. **Tracking the nonce**\n\n8. **One action per message**: only one thing per message\n\n9. **Store failed message**: [example](https://solodit.xyz/issues/h-06-attacker-can-block-layerzero-channel-code4rena-velodrome-finance-velodrome-finance-git)\n \n If the message execution fails at the destination, try-catch it, and store it for future retries. From LayerZero's perspective, the message has been delivered. It is much cheaper and easier for your programs to recover from the last state at the destination chain.\n Store a hash of the message payload is much cheaper than storing the whole message\n \n *sink*: not implement `blockingLzReceive()`\n \n10. **Gas for Message Types**\n \n *If your app includes multiple message types to be sent across chains,* compute a rough gas estimate at the destination chain per each message type.\n \n *Your message may fail for the out-of-gas exception at the destination if your app did not instruct the relayer to put extra gas on contract execution*. \n \n And the UA should enforce the gas estimate on-chain at the source chain to prevent users from inputting too low a value for gas.", + "code": "var Component=(()=>{var lr=Object.create;var A=Object.defineProperty;var cr=Object.getOwnPropertyDescriptor;var ur=Object.getOwnPropertyNames;var dr=Object.getPrototypeOf,fr=Object.prototype.hasOwnProperty;var Z=(u,n)=>()=>(n||u((n={exports:{}}).exports,n),n.exports),mr=(u,n)=>{for(var _ in n)A(u,_,{get:n[_],enumerable:!0})},ge=(u,n,_,N)=>{if(n&&typeof n==\"object\"||typeof n==\"function\")for(let y of ur(n))!fr.call(u,y)&&y!==_&&A(u,y,{get:()=>n[y],enumerable:!(N=cr(n,y))||N.enumerable});return u};var br=(u,n,_)=>(_=u!=null?lr(dr(u)):{},ge(n||!u||!u.__esModule?A(_,\"default\",{value:u,enumerable:!0}):_,u)),pr=u=>ge(A({},\"__esModule\",{value:!0}),u);var xe=Z((gr,je)=>{je.exports=React});var we=Z(B=>{\"use strict\";(function(){\"use strict\";var u=xe(),n=Symbol.for(\"react.element\"),_=Symbol.for(\"react.portal\"),N=Symbol.for(\"react.fragment\"),y=Symbol.for(\"react.strict_mode\"),q=Symbol.for(\"react.profiler\"),K=Symbol.for(\"react.provider\"),X=Symbol.for(\"react.context\"),R=Symbol.for(\"react.forward_ref\"),D=Symbol.for(\"react.suspense\"),F=Symbol.for(\"react.suspense_list\"),U=Symbol.for(\"react.memo\"),I=Symbol.for(\"react.lazy\"),Ue=Symbol.for(\"react.offscreen\"),H=Symbol.iterator,Te=\"@@iterator\";function Ce(e){if(e===null||typeof e!=\"object\")return null;var r=H&&e[H]||e[Te];return typeof r==\"function\"?r:null}var j=u.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function m(e){{for(var r=arguments.length,t=new Array(r>1?r-1:0),a=1;a=1&&f>=0&&i[d]!==b[f];)f--;for(;d>=1&&f>=0;d--,f--)if(i[d]!==b[f]){if(d!==1||f!==1)do if(d--,f--,f<0||i[d]!==b[f]){var p=`\n`+i[d].replace(\" at new \",\" at \");return e.displayName&&p.includes(\"\")&&(p=p.replace(\"\",e.displayName)),typeof e==\"function\"&&C.set(e,p),p}while(d>=1&&f>=0);break}}}finally{M=!1,L.current=c,Me(),Error.prepareStackTrace=l}var w=e?e.displayName||e.name:\"\",Ne=w?T(w):\"\";return typeof e==\"function\"&&C.set(e,Ne),Ne}function Ve(e,r,t){return le(e,!1)}function We(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function S(e,r,t){if(e==null)return\"\";if(typeof e==\"function\")return le(e,We(e));if(typeof e==\"string\")return T(e);switch(e){case D:return T(\"Suspense\");case F:return T(\"SuspenseList\")}if(typeof e==\"object\")switch(e.$$typeof){case R:return Ve(e.render);case U:return S(e.type,r,t);case I:{var a=e,l=a._payload,c=a._init;try{return S(c(l),r,t)}catch{}}}return\"\"}var O=Object.prototype.hasOwnProperty,ce={},ue=j.ReactDebugCurrentFrame;function P(e){if(e){var r=e._owner,t=S(e.type,e._source,r?r.type:null);ue.setExtraStackFrame(t)}else ue.setExtraStackFrame(null)}function ze(e,r,t,a,l){{var c=Function.call.bind(O);for(var s in e)if(c(e,s)){var i=void 0;try{if(typeof e[s]!=\"function\"){var b=Error((a||\"React class\")+\": \"+t+\" type `\"+s+\"` is invalid; it must be a function, usually from the `prop-types` package, but received `\"+typeof e[s]+\"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.\");throw b.name=\"Invariant Violation\",b}i=e[s](r,s,a,t,null,\"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED\")}catch(d){i=d}i&&!(i instanceof Error)&&(P(l),m(\"%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).\",a||\"React class\",t,s,typeof i),P(null)),i instanceof Error&&!(i.message in ce)&&(ce[i.message]=!0,P(l),m(\"Failed %s type: %s\",t,i.message),P(null))}}}var Ge=Array.isArray;function $(e){return Ge(e)}function Ze(e){{var r=typeof Symbol==\"function\"&&Symbol.toStringTag,t=r&&e[Symbol.toStringTag]||e.constructor.name||\"Object\";return t}}function Be(e){try{return de(e),!1}catch{return!0}}function de(e){return\"\"+e}function fe(e){if(Be(e))return m(\"The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.\",Ze(e)),de(e)}var E=j.ReactCurrentOwner,qe={key:!0,ref:!0,__self:!0,__source:!0},me,be,V;V={};function Ke(e){if(O.call(e,\"ref\")){var r=Object.getOwnPropertyDescriptor(e,\"ref\").get;if(r&&r.isReactWarning)return!1}return e.ref!==void 0}function Xe(e){if(O.call(e,\"key\")){var r=Object.getOwnPropertyDescriptor(e,\"key\").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function He(e,r){if(typeof e.ref==\"string\"&&E.current&&r&&E.current.stateNode!==r){var t=h(E.current.type);V[t]||(m('Component \"%s\" contains the string ref \"%s\". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',h(E.current.type),e.ref),V[t]=!0)}}function Je(e,r){{var t=function(){me||(me=!0,m(\"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)\",r))};t.isReactWarning=!0,Object.defineProperty(e,\"key\",{get:t,configurable:!0})}}function Qe(e,r){{var t=function(){be||(be=!0,m(\"%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)\",r))};t.isReactWarning=!0,Object.defineProperty(e,\"ref\",{get:t,configurable:!0})}}var er=function(e,r,t,a,l,c,s){var i={$$typeof:n,type:e,key:r,ref:t,props:s,_owner:c};return i._store={},Object.defineProperty(i._store,\"validated\",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(i,\"_self\",{configurable:!1,enumerable:!1,writable:!1,value:a}),Object.defineProperty(i,\"_source\",{configurable:!1,enumerable:!1,writable:!1,value:l}),Object.freeze&&(Object.freeze(i.props),Object.freeze(i)),i};function rr(e,r,t,a,l){{var c,s={},i=null,b=null;t!==void 0&&(fe(t),i=\"\"+t),Xe(r)&&(fe(r.key),i=\"\"+r.key),Ke(r)&&(b=r.ref,He(r,l));for(c in r)O.call(r,c)&&!qe.hasOwnProperty(c)&&(s[c]=r[c]);if(e&&e.defaultProps){var d=e.defaultProps;for(c in d)s[c]===void 0&&(s[c]=d[c])}if(i||b){var f=typeof e==\"function\"?e.displayName||e.name||\"Unknown\":e;i&&Je(s,f),b&&Qe(s,f)}return er(e,i,b,l,a,E.current,s)}}var W=j.ReactCurrentOwner,pe=j.ReactDebugCurrentFrame;function x(e){if(e){var r=e._owner,t=S(e.type,e._source,r?r.type:null);pe.setExtraStackFrame(t)}else pe.setExtraStackFrame(null)}var z;z=!1;function G(e){return typeof e==\"object\"&&e!==null&&e.$$typeof===n}function _e(){{if(W.current){var e=h(W.current.type);if(e)return`\n\nCheck the render method of \\``+e+\"`.\"}return\"\"}}function nr(e){{if(e!==void 0){var r=e.fileName.replace(/^.*[\\\\\\/]/,\"\"),t=e.lineNumber;return`\n\nCheck your code at `+r+\":\"+t+\".\"}return\"\"}}var he={};function tr(e){{var r=_e();if(!r){var t=typeof e==\"string\"?e:e.displayName||e.name;t&&(r=`\n\nCheck the top-level render call using <`+t+\">.\")}return r}}function ve(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var t=tr(r);if(he[t])return;he[t]=!0;var a=\"\";e&&e._owner&&e._owner!==W.current&&(a=\" It was passed a child from \"+h(e._owner.type)+\".\"),x(e),m('Each child in a list should have a unique \"key\" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',t,a),x(null)}}function ye(e,r){{if(typeof e!=\"object\")return;if($(e))for(var t=0;t\",i=\" Did you accidentally export a JSX literal instead of a component?\"):d=typeof e,m(\"React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s\",d,i)}var f=rr(e,r,t,l,c);if(f==null)return f;if(s){var p=r.children;if(p!==void 0)if(a)if($(p)){for(var w=0;w{\"use strict\";ke.exports=we()});var yr={};mr(yr,{default:()=>vr,frontmatter:()=>_r});var o=br(Ee()),_r={title:\"LayerZero Integrations Security Tips\",description:\"LayerZero integrations security tips for smart contract developers and auditors.\",repository:null,date:new Date(1696896e6),published:!0,featured:!0,author:\"LowK\"};function Re(u){let n=Object.assign({p:\"p\",a:\"a\",h2:\"h2\",span:\"span\",ol:\"ol\",li:\"li\",code:\"code\",strong:\"strong\",ul:\"ul\",em:\"em\"},u.components);return(0,o.jsxDEV)(o.Fragment,{children:[(0,o.jsxDEV)(n.p,{children:[`LayerZero is an omnichain interoperability protocol designed for lightweight message passing across chains.\nLayerZero provides authentic and guaranteed message delivery with configurable trustlessness.\nNeeds more information about LayerZero check out the `,(0,o.jsxDEV)(n.a,{href:\"https://layerzero.gitbook.io/docs/\",children:\"docs\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:13,columnNumber:54},this),\".\"]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:11,columnNumber:1},this),`\n`,(0,o.jsxDEV)(n.p,{children:`If you are a smart contract developer or auditor, you should be aware of the following security tips\nwhen integrating LayerZero into your smart contracts.`},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:15,columnNumber:1},this),`\n`,(0,o.jsxDEV)(n.h2,{id:\"security-tips\",children:[(0,o.jsxDEV)(n.a,{className:\"subheading-anchor\",\"aria-label\":\"Link to section\",href:\"#security-tips\",children:(0,o.jsxDEV)(n.span,{className:\"icon icon-link\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\"},this)},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\"},this),\"Security Tips\"]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:18,columnNumber:1},this),`\n`,(0,o.jsxDEV)(n.ol,{children:[`\n`,(0,o.jsxDEV)(n.li,{children:[`\n`,(0,o.jsxDEV)(n.p,{children:[\"Calling\\xA0\",(0,o.jsxDEV)(n.code,{children:\"send()\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:20,columnNumber:12},this),\"\\xA0with\\xA0\",(0,o.jsxDEV)(n.code,{children:\"{value: msg.value}\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:20,columnNumber:26},this),\" is because\\xA0\",(0,o.jsxDEV)(n.code,{children:\"send()\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:20,columnNumber:58},this),\"\\xA0\",(0,o.jsxDEV)(n.strong,{children:\"requires a bit of native gas token\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:20,columnNumber:67},this),\" so the relayer can complete the message delivery on the destination chain. If you don't set this value\\xA0\",(0,o.jsxDEV)(n.a,{href:\"notion://www.notion.so/docs/evm-guides/error-messages/error-layerzero-relayer-fee-failed\",children:\"you might get this error\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:20,columnNumber:209},this),\"\\xA0when calling\\xA0\",(0,o.jsxDEV)(n.code,{children:\"endpoint.send()\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:20,columnNumber:339},this)]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:20,columnNumber:4},this),`\n`]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:20,columnNumber:1},this),`\n`,(0,o.jsxDEV)(n.li,{children:[`\n`,(0,o.jsxDEV)(n.p,{children:[\"In a received chain, A \",(0,o.jsxDEV)(n.strong,{children:\"msg.sender is the LZ endpoint\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:22,columnNumber:28},this),\". Are there any mistakes?\"]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:22,columnNumber:5},this),`\n`]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:22,columnNumber:1},this),`\n`,(0,o.jsxDEV)(n.li,{children:[`\n`,(0,o.jsxDEV)(n.p,{children:[(0,o.jsxDEV)(n.strong,{children:\"Address Sanity Check\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:24,columnNumber:4},this),\" In a receiving chain\"]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:24,columnNumber:4},this),`\n`,(0,o.jsxDEV)(n.p,{children:\"Is SrcAddress whitelisted?\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:26,columnNumber:5},this),`\n`,(0,o.jsxDEV)(n.p,{children:\"Check the address size according to the source chain (e.g. address size == 20 bytes on EVM chains) to prevent a vector unauthenticated contract call.\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:28,columnNumber:5},this),`\n`]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:24,columnNumber:1},this),`\n`,(0,o.jsxDEV)(n.li,{children:[`\n`,(0,o.jsxDEV)(n.p,{children:[\"In a received chain, parse srcAddress to the address type that is just applied for EVM chains. \",(0,o.jsxDEV)(n.strong,{children:\"Is your application connected with non-evm chain?\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:30,columnNumber:100},this)]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:30,columnNumber:5},this),`\n`]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:30,columnNumber:1},this),`\n`,(0,o.jsxDEV)(n.li,{children:[`\n`,(0,o.jsxDEV)(n.p,{children:[(0,o.jsxDEV)(n.strong,{children:\"Is there a set of trusted remote addresses\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:32,columnNumber:4},this),\"? The feature is available at some places that must be checked:\"]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:32,columnNumber:4},this),`\n`,(0,o.jsxDEV)(n.ul,{children:[`\n`,(0,o.jsxDEV)(n.li,{children:\"retryPayload()::srcAddress\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:33,columnNumber:5},this),`\n`,(0,o.jsxDEV)(n.li,{children:\"hasStoredPayload()::srcAddress\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:34,columnNumber:5},this),`\n`,(0,o.jsxDEV)(n.li,{children:\"forceResumeReceive()::srcAddress\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:35,columnNumber:5},this),`\n`,(0,o.jsxDEV)(n.li,{children:\"setTrustedRemote()::path\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:36,columnNumber:5},this),`\n`,(0,o.jsxDEV)(n.li,{children:\"isTrustedRemote()::_srcAddress\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:37,columnNumber:5},this),`\n`,(0,o.jsxDEV)(n.li,{children:\"lzReceive()::_srcAddress\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:38,columnNumber:5},this),`\n`]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:33,columnNumber:5},this),`\n`]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:32,columnNumber:1},this),`\n`,(0,o.jsxDEV)(n.li,{children:[`\n`,(0,o.jsxDEV)(n.p,{children:(0,o.jsxDEV)(n.strong,{children:[\"Should implement an \",(0,o.jsxDEV)(n.em,{children:\"Instant Finality Guarantee (IFG)\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:39,columnNumber:26},this)]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:39,columnNumber:4},this)},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:39,columnNumber:4},this),`\n`,(0,o.jsxDEV)(n.p,{children:\"Reverting in (user application) UA is cumbersome and expensive. It is more efficient to design your UA with IFG such that if a transaction was accepted at source, the transaction will be accepted at the remote. For example, Stargate has a credit management system (Delta Algorithm) to guarantee that if a swap was accepted at source, the destination must have enough asset to complete the swap, hence the IFG.\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:41,columnNumber:5},this),`\n`]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:39,columnNumber:1},this),`\n`,(0,o.jsxDEV)(n.li,{children:[`\n`,(0,o.jsxDEV)(n.p,{children:(0,o.jsxDEV)(n.strong,{children:\"Tracking the nonce\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:43,columnNumber:4},this)},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:43,columnNumber:4},this),`\n`]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:43,columnNumber:1},this),`\n`,(0,o.jsxDEV)(n.li,{children:[`\n`,(0,o.jsxDEV)(n.p,{children:[(0,o.jsxDEV)(n.strong,{children:\"One action per message\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:45,columnNumber:4},this),\": only one thing per message\"]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:45,columnNumber:4},this),`\n`]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:45,columnNumber:1},this),`\n`,(0,o.jsxDEV)(n.li,{children:[`\n`,(0,o.jsxDEV)(n.p,{children:[(0,o.jsxDEV)(n.strong,{children:\"Store failed message\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:47,columnNumber:4},this),\": \",(0,o.jsxDEV)(n.a,{href:\"https://solodit.xyz/issues/h-06-attacker-can-block-layerzero-channel-code4rena-velodrome-finance-velodrome-finance-git\",children:\"example\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:47,columnNumber:30},this)]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:47,columnNumber:4},this),`\n`,(0,o.jsxDEV)(n.p,{children:`If the message execution fails at the destination, try-catch it, and store it for future retries. From LayerZero's perspective, the message has been delivered. It is much cheaper and easier for your programs to recover from the last state at the destination chain.\nStore a hash of the message payload is much cheaper than storing the whole message`},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:49,columnNumber:5},this),`\n`,(0,o.jsxDEV)(n.p,{children:[(0,o.jsxDEV)(n.em,{children:\"sink\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:52,columnNumber:5},this),\": not implement \",(0,o.jsxDEV)(n.code,{children:\"blockingLzReceive()\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:52,columnNumber:27},this)]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:52,columnNumber:5},this),`\n`]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:47,columnNumber:1},this),`\n`,(0,o.jsxDEV)(n.li,{children:[`\n`,(0,o.jsxDEV)(n.p,{children:(0,o.jsxDEV)(n.strong,{children:\"Gas for Message Types\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:54,columnNumber:5},this)},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:54,columnNumber:5},this),`\n`,(0,o.jsxDEV)(n.p,{children:[(0,o.jsxDEV)(n.em,{children:\"If your app includes multiple message types to be sent across chains,\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:56,columnNumber:5},this),\" compute a rough gas estimate at the destination chain per each message type.\"]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:56,columnNumber:5},this),`\n`,(0,o.jsxDEV)(n.p,{children:[(0,o.jsxDEV)(n.em,{children:\"Your message may fail for the out-of-gas exception at the destination if your app did not instruct the relayer to put extra gas on contract execution\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:58,columnNumber:5},this),\".\"]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:58,columnNumber:5},this),`\n`,(0,o.jsxDEV)(n.p,{children:\"And the UA should enforce the gas estimate on-chain at the source chain to prevent users from inputting too low a value for gas.\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:60,columnNumber:5},this),`\n`]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:54,columnNumber:1},this),`\n`]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:20,columnNumber:1},this)]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:1,columnNumber:1},this)}function hr(u={}){let{wrapper:n}=u.components||{};return n?(0,o.jsxDEV)(n,Object.assign({},u,{children:(0,o.jsxDEV)(Re,u,void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\"},this)}),void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\"},this):Re(u)}var vr=hr;return pr(yr);})();\n/*! Bundled license information:\n\nreact/cjs/react-jsx-dev-runtime.development.js:\n (**\n * @license React\n * react-jsx-dev-runtime.development.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *)\n*/\n;return Component;" + }, + "_id": "projects/2023-10-10-LayerZero-Integrations-Security-Tips.md", + "_raw": { + "sourceFilePath": "projects/2023-10-10-LayerZero-Integrations-Security-Tips.md", + "sourceFileName": "2023-10-10-LayerZero-Integrations-Security-Tips.md", + "sourceFileDir": "projects", + "contentType": "markdown", + "flattenedPath": "projects/2023-10-10-LayerZero-Integrations-Security-Tips" + }, + "type": "Project", + "path": "/projects/2023-10-10-LayerZero-Integrations-Security-Tips", + "slug": "2023-10-10-LayerZero-Integrations-Security-Tips" + }, { "published": false, "title": "Woo Finance - Users can lose their money if they use cross-swap in some situations.", @@ -9,14 +33,14 @@ "featured": true, "body": { "raw": "\nI discovered some high-impact vulnerabilities in WooFi smart contracts. \nUsers can lose their money if they use the function \"crossSwap\" in WooCrossChainRouter, WooCrossChainRouterV2, and WooCrossChainRouterV3 contracts. \nFollowing the details below:\n\nIn the contract \"WooCrossChainRouter\" at\n\n- https://github.com/woonetwork/WooPoolV2/blob/6b7d13fea34a78ca59e4b1aae73d3caa00c2efba/contracts/WooCrossChainRouter.sol#L250-L368\n- https://arbiscan.io/address/0x44df096d2600c6a6db77899db3de3aecff746cb8\n- and in other chains.\n\n```solidity\nfunction sgReceive(\n uint16, /*_chainId*/\n bytes memory, /*_srcAddress*/\n uint256, /*_nonce*/\n address _token,\n uint256 amountLD,\n bytes memory payload\n ) external override {\n require(msg.sender == address(stargateRouter), \"WooCrossChainRouter: INVALID_CALLER\");\n\n (address toToken, uint256 refId, uint256 minToAmount, address to) = abi.decode(\n payload,\n (address, uint256, uint256, address)\n );\n\n if (wooRouter.wooPool().quoteToken() != _token) {\n // NOTE: The bridged token is not WooPP's quote token.\n // So Cannot do the swap; just return it to users.\n // ..\n }\n\n uint256 quoteAmount = amountLD;\n\n if (toToken == ETH_PLACEHOLDER_ADDR) {\n // quoteToken -> WETH -> ETH\n TransferHelper.safeApprove(_token, address(wooRouter), quoteAmount);\n try wooRouter.swap(_token, WETH, quoteAmount, minToAmount, payable(address(this)), to) returns (\n uint256 realToAmount\n ) {\n IWETH(WETH).withdraw(realToAmount);\n TransferHelper.safeTransferETH(to, realToAmount);\n emit WooCrossSwapOnDstChain(...);\n } catch {\n // transfer _token/amountLD to msg.sender because the swap failed for some reason.\n // this is not the ideal scenario, but the contract needs to deliver them eth or USDC.\n TransferHelper.safeTransfer(_token, to, amountLD);\n emit WooCrossSwapOnDstChain(...);\n }\n } else {\n // ...\n }\n }\n```\n\nThe \"crossSwap\" function allows users to send and swap cross-chains.\n\nWhen users call the \"crossSwap\" function to swap in a source chain, a \"StarGateRouter\" contract will callback to the \"sgReceive\" function in a destination chain.\n\nThe contract \"WooCrossChainRouter\" uses a try-catch block to handle reverting. If any revert is raised, the user in the destination chain will not receive their fund.\n\nAn example scenario:\n\n1. A user cross-swaps in the source chain with the `toToken` parameter equal to the ETH_PLACEHOLDER_ADDR constant, and `toToken` is a quote token.\n\n2. In the destination chain, the contract will swap `_token` to WETH. After that, transferring these ETH to an address the user owned\n\n3. The swap is OK and is wrapped by a try-catch block. However, the transfer of ETH is not protected. If the receiving address does not define fallback() or receive() functions, it will revert.\n\nIf any reverts occur, the user will lose their money, and the money will be held in this contract.\n\n", - "code": "var Component=(()=>{var cn=Object.create;var O=Object.defineProperty;var mn=Object.getOwnPropertyDescriptor;var fn=Object.getOwnPropertyNames;var an=Object.getPrototypeOf,un=Object.prototype.hasOwnProperty;var q=(i,e)=>()=>(e||i((e={exports:{}}).exports,e),e.exports),pn=(i,e)=>{for(var _ in e)O(i,_,{get:e[_],enumerable:!0})},xe=(i,e,_,y)=>{if(e&&typeof e==\"object\"||typeof e==\"function\")for(let j of fn(e))!un.call(i,j)&&j!==_&&O(i,j,{get:()=>e[j],enumerable:!(y=mn(e,j))||y.enumerable});return i};var bn=(i,e,_)=>(_=i!=null?cn(an(i)):{},xe(e||!i||!i.__esModule?O(_,\"default\",{value:i,enumerable:!0}):_,i)),_n=i=>xe(O({},\"__esModule\",{value:!0}),i);var Ee=q((vn,ve)=>{ve.exports=React});var we=q(G=>{\"use strict\";(function(){\"use strict\";var i=Ee(),e=Symbol.for(\"react.element\"),_=Symbol.for(\"react.portal\"),y=Symbol.for(\"react.fragment\"),j=Symbol.for(\"react.strict_mode\"),z=Symbol.for(\"react.profiler\"),K=Symbol.for(\"react.provider\"),X=Symbol.for(\"react.context\"),g=Symbol.for(\"react.forward_ref\"),P=Symbol.for(\"react.suspense\"),S=Symbol.for(\"react.suspense_list\"),F=Symbol.for(\"react.memo\"),B=Symbol.for(\"react.lazy\"),Fe=Symbol.for(\"react.offscreen\"),J=Symbol.iterator,Re=\"@@iterator\";function Te(r){if(r===null||typeof r!=\"object\")return null;var t=J&&r[J]||r[Re];return typeof t==\"function\"?t:null}var v=i.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function u(r){{for(var t=arguments.length,o=new Array(t>1?t-1:0),l=1;l=1&&a>=0&&s[f]!==p[a];)a--;for(;f>=1&&a>=0;f--,a--)if(s[f]!==p[a]){if(f!==1||a!==1)do if(f--,a--,a<0||s[f]!==p[a]){var b=`\n`+s[f].replace(\" at new \",\" at \");return r.displayName&&b.includes(\"\")&&(b=b.replace(\"\",r.displayName)),typeof r==\"function\"&&T.set(r,b),b}while(f>=1&&a>=0);break}}}finally{L=!1,W.current=m,Le(),Error.prepareStackTrace=c}var w=r?r.displayName||r.name:\"\",ye=w?R(w):\"\";return typeof r==\"function\"&&T.set(r,ye),ye}function Ye(r,t,o){return ce(r,!1)}function $e(r){var t=r.prototype;return!!(t&&t.isReactComponent)}function C(r,t,o){if(r==null)return\"\";if(typeof r==\"function\")return ce(r,$e(r));if(typeof r==\"string\")return R(r);switch(r){case P:return R(\"Suspense\");case S:return R(\"SuspenseList\")}if(typeof r==\"object\")switch(r.$$typeof){case g:return Ye(r.render);case F:return C(r.type,t,o);case B:{var l=r,c=l._payload,m=l._init;try{return C(m(c),t,o)}catch{}}}return\"\"}var A=Object.prototype.hasOwnProperty,me={},ie=v.ReactDebugCurrentFrame;function D(r){if(r){var t=r._owner,o=C(r.type,r._source,t?t.type:null);ie.setExtraStackFrame(o)}else ie.setExtraStackFrame(null)}function He(r,t,o,l,c){{var m=Function.call.bind(A);for(var d in r)if(m(r,d)){var s=void 0;try{if(typeof r[d]!=\"function\"){var p=Error((l||\"React class\")+\": \"+o+\" type `\"+d+\"` is invalid; it must be a function, usually from the `prop-types` package, but received `\"+typeof r[d]+\"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.\");throw p.name=\"Invariant Violation\",p}s=r[d](t,d,l,o,null,\"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED\")}catch(f){s=f}s&&!(s instanceof Error)&&(D(c),u(\"%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).\",l||\"React class\",o,d,typeof s),D(null)),s instanceof Error&&!(s.message in me)&&(me[s.message]=!0,D(c),u(\"Failed %s type: %s\",o,s.message),D(null))}}}var Me=Array.isArray;function V(r){return Me(r)}function qe(r){{var t=typeof Symbol==\"function\"&&Symbol.toStringTag,o=t&&r[Symbol.toStringTag]||r.constructor.name||\"Object\";return o}}function Ge(r){try{return fe(r),!1}catch{return!0}}function fe(r){return\"\"+r}function ae(r){if(Ge(r))return u(\"The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.\",qe(r)),fe(r)}var U=v.ReactCurrentOwner,ze={key:!0,ref:!0,__self:!0,__source:!0},ue,pe,Y;Y={};function Ke(r){if(A.call(r,\"ref\")){var t=Object.getOwnPropertyDescriptor(r,\"ref\").get;if(t&&t.isReactWarning)return!1}return r.ref!==void 0}function Xe(r){if(A.call(r,\"key\")){var t=Object.getOwnPropertyDescriptor(r,\"key\").get;if(t&&t.isReactWarning)return!1}return r.key!==void 0}function Je(r,t){if(typeof r.ref==\"string\"&&U.current&&t&&U.current.stateNode!==t){var o=N(U.current.type);Y[o]||(u('Component \"%s\" contains the string ref \"%s\". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',N(U.current.type),r.ref),Y[o]=!0)}}function Ze(r,t){{var o=function(){ue||(ue=!0,u(\"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)\",t))};o.isReactWarning=!0,Object.defineProperty(r,\"key\",{get:o,configurable:!0})}}function Qe(r,t){{var o=function(){pe||(pe=!0,u(\"%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)\",t))};o.isReactWarning=!0,Object.defineProperty(r,\"ref\",{get:o,configurable:!0})}}var en=function(r,t,o,l,c,m,d){var s={$$typeof:e,type:r,key:t,ref:o,props:d,_owner:m};return s._store={},Object.defineProperty(s._store,\"validated\",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(s,\"_self\",{configurable:!1,enumerable:!1,writable:!1,value:l}),Object.defineProperty(s,\"_source\",{configurable:!1,enumerable:!1,writable:!1,value:c}),Object.freeze&&(Object.freeze(s.props),Object.freeze(s)),s};function nn(r,t,o,l,c){{var m,d={},s=null,p=null;o!==void 0&&(ae(o),s=\"\"+o),Xe(t)&&(ae(t.key),s=\"\"+t.key),Ke(t)&&(p=t.ref,Je(t,c));for(m in t)A.call(t,m)&&!ze.hasOwnProperty(m)&&(d[m]=t[m]);if(r&&r.defaultProps){var f=r.defaultProps;for(m in f)d[m]===void 0&&(d[m]=f[m])}if(s||p){var a=typeof r==\"function\"?r.displayName||r.name||\"Unknown\":r;s&&Ze(d,a),p&&Qe(d,a)}return en(r,s,p,c,l,U.current,d)}}var $=v.ReactCurrentOwner,be=v.ReactDebugCurrentFrame;function E(r){if(r){var t=r._owner,o=C(r.type,r._source,t?t.type:null);be.setExtraStackFrame(o)}else be.setExtraStackFrame(null)}var H;H=!1;function M(r){return typeof r==\"object\"&&r!==null&&r.$$typeof===e}function _e(){{if($.current){var r=N($.current.type);if(r)return`\n\nCheck the render method of \\``+r+\"`.\"}return\"\"}}function rn(r){{if(r!==void 0){var t=r.fileName.replace(/^.*[\\\\\\/]/,\"\"),o=r.lineNumber;return`\n\nCheck your code at `+t+\":\"+o+\".\"}return\"\"}}var Ne={};function tn(r){{var t=_e();if(!t){var o=typeof r==\"string\"?r:r.displayName||r.name;o&&(t=`\n\nCheck the top-level render call using <`+o+\">.\")}return t}}function he(r,t){{if(!r._store||r._store.validated||r.key!=null)return;r._store.validated=!0;var o=tn(t);if(Ne[o])return;Ne[o]=!0;var l=\"\";r&&r._owner&&r._owner!==$.current&&(l=\" It was passed a child from \"+N(r._owner.type)+\".\"),E(r),u('Each child in a list should have a unique \"key\" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',o,l),E(null)}}function je(r,t){{if(typeof r!=\"object\")return;if(V(r))for(var o=0;o\",s=\" Did you accidentally export a JSX literal instead of a component?\"):f=typeof r,u(\"React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s\",f,s)}var a=nn(r,t,o,c,m);if(a==null)return a;if(d){var b=t.children;if(b!==void 0)if(l)if(V(b)){for(var w=0;w{\"use strict\";ke.exports=we()});var yn={};pn(yn,{default:()=>jn,frontmatter:()=>Nn});var n=bn(Ue()),Nn={title:\"Woo Finance - Users can lose their money if they use cross-swap in some situations.\",description:\"Users can lose their money if there is any reverts when use crossSwap in Woo Finance.\",repository:\"woonetwork/WooPoolV2\",date:\"2023-10-06\",published:!1,featured:!0};function ge(i){let e=Object.assign({p:\"p\",ul:\"ul\",li:\"li\",a:\"a\",div:\"div\",pre:\"pre\",code:\"code\",span:\"span\",ol:\"ol\"},i.components);return(0,n.jsxDEV)(n.Fragment,{children:[(0,n.jsxDEV)(e.p,{children:`I discovered some high-impact vulnerabilities in WooFi smart contracts.\nUsers can lose their money if they use the function \"crossSwap\" in WooCrossChainRouter, WooCrossChainRouterV2, and WooCrossChainRouterV3 contracts.\nFollowing the details below:`},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:10,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.p,{children:'In the contract \"WooCrossChainRouter\" at'},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:14,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.ul,{children:[`\n`,(0,n.jsxDEV)(e.li,{children:(0,n.jsxDEV)(e.a,{href:\"https://github.com/woonetwork/WooPoolV2/blob/6b7d13fea34a78ca59e4b1aae73d3caa00c2efba/contracts/WooCrossChainRouter.sol#L250-L368\",children:\"https://github.com/woonetwork/WooPoolV2/blob/6b7d13fea34a78ca59e4b1aae73d3caa00c2efba/contracts/WooCrossChainRouter.sol#L250-L368\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:16,columnNumber:3},this)},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:16,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.li,{children:(0,n.jsxDEV)(e.a,{href:\"https://arbiscan.io/address/0x44df096d2600c6a6db77899db3de3aecff746cb8\",children:\"https://arbiscan.io/address/0x44df096d2600c6a6db77899db3de3aecff746cb8\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:17,columnNumber:3},this)},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:17,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.li,{children:\"and in other chains.\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:18,columnNumber:1},this),`\n`]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:16,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.div,{\"data-rehype-pretty-code-fragment\":\"\",children:(0,n.jsxDEV)(e.pre,{\"data-language\":\"solidity\",\"data-theme\":\"default\",children:(0,n.jsxDEV)(e.code,{\"data-language\":\"solidity\",\"data-theme\":\"default\",children:[(0,n.jsxDEV)(e.span,{className:\"line\",children:[(0,n.jsxDEV)(e.span,{style:{color:\"#F97583\"},children:\"function\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:1,columnNumber:104},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:1,columnNumber:148},this),(0,n.jsxDEV)(e.span,{style:{color:\"#B392F0\"},children:\"sgReceive\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:1,columnNumber:185},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\"(\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:1,columnNumber:230},this)]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:1,columnNumber:85},this),`\n`,(0,n.jsxDEV)(e.span,{className:\"line\",children:[(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:2,columnNumber:20},this),(0,n.jsxDEV)(e.span,{style:{color:\"#79B8FF\"},children:\"uint16\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:2,columnNumber:64},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\", \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:2,columnNumber:106},this),(0,n.jsxDEV)(e.span,{style:{color:\"#6A737D\"},children:\"/*_chainId*/\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:2,columnNumber:144},this)]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:2,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.span,{className:\"line\",children:[(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:3,columnNumber:20},this),(0,n.jsxDEV)(e.span,{style:{color:\"#79B8FF\"},children:\"bytes\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:3,columnNumber:64},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:3,columnNumber:105},this),(0,n.jsxDEV)(e.span,{style:{color:\"#F97583\"},children:\"memory\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:3,columnNumber:142},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\", \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:3,columnNumber:184},this),(0,n.jsxDEV)(e.span,{style:{color:\"#6A737D\"},children:\"/*_srcAddress*/\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:3,columnNumber:222},this)]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:3,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.span,{className:\"line\",children:[(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:4,columnNumber:20},this),(0,n.jsxDEV)(e.span,{style:{color:\"#79B8FF\"},children:\"uint256\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:4,columnNumber:64},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\", \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:4,columnNumber:107},this),(0,n.jsxDEV)(e.span,{style:{color:\"#6A737D\"},children:\"/*_nonce*/\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:4,columnNumber:145},this)]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:4,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.span,{className:\"line\",children:[(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:5,columnNumber:20},this),(0,n.jsxDEV)(e.span,{style:{color:\"#79B8FF\"},children:\"address\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:5,columnNumber:64},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" _token,\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:5,columnNumber:107},this)]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:5,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.span,{className:\"line\",children:[(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:6,columnNumber:20},this),(0,n.jsxDEV)(e.span,{style:{color:\"#79B8FF\"},children:\"uint256\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:6,columnNumber:64},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:6,columnNumber:107},this),(0,n.jsxDEV)(e.span,{style:{color:\"#FFAB70\"},children:\"amountLD\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:6,columnNumber:144},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\",\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:6,columnNumber:188},this)]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:6,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.span,{className:\"line\",children:[(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:7,columnNumber:20},this),(0,n.jsxDEV)(e.span,{style:{color:\"#79B8FF\"},children:\"bytes\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:7,columnNumber:64},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:7,columnNumber:105},this),(0,n.jsxDEV)(e.span,{style:{color:\"#F97583\"},children:\"memory\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:7,columnNumber:142},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:7,columnNumber:184},this),(0,n.jsxDEV)(e.span,{style:{color:\"#FFAB70\"},children:\"payload\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:7,columnNumber:221},this)]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:7,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.span,{className:\"line\",children:[(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" ) \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:8,columnNumber:20},this),(0,n.jsxDEV)(e.span,{style:{color:\"#F97583\"},children:\"external\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:8,columnNumber:62},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:8,columnNumber:106},this),(0,n.jsxDEV)(e.span,{style:{color:\"#F97583\"},children:\"override\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:8,columnNumber:143},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" {\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:8,columnNumber:187},this)]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:8,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.span,{className:\"line\",children:[(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:9,columnNumber:20},this),(0,n.jsxDEV)(e.span,{style:{color:\"#F97583\"},children:\"require\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:9,columnNumber:64},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\"(\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:9,columnNumber:107},this),(0,n.jsxDEV)(e.span,{style:{color:\"#79B8FF\"},children:\"msg.sender\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:9,columnNumber:144},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:9,columnNumber:190},this),(0,n.jsxDEV)(e.span,{style:{color:\"#F97583\"},children:\"==\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:9,columnNumber:227},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:9,columnNumber:265},this),(0,n.jsxDEV)(e.span,{style:{color:\"#79B8FF\"},children:\"address\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:9,columnNumber:302},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\"(stargateRouter), \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:9,columnNumber:345},this),(0,n.jsxDEV)(e.span,{style:{color:\"#9ECBFF\"},children:'\"WooCrossChainRouter: INVALID_CALLER\"'},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:9,columnNumber:399},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\");\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:9,columnNumber:482},this)]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:9,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.span,{className:\"line\",children:\" \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:10,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.span,{className:\"line\",children:[(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" (\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:11,columnNumber:20},this),(0,n.jsxDEV)(e.span,{style:{color:\"#79B8FF\"},children:\"address\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:11,columnNumber:65},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" toToken, \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:11,columnNumber:108},this),(0,n.jsxDEV)(e.span,{style:{color:\"#79B8FF\"},children:\"uint256\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:11,columnNumber:154},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" refId, \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:11,columnNumber:197},this),(0,n.jsxDEV)(e.span,{style:{color:\"#79B8FF\"},children:\"uint256\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:11,columnNumber:241},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" minToAmount, \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:11,columnNumber:284},this),(0,n.jsxDEV)(e.span,{style:{color:\"#79B8FF\"},children:\"address\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:11,columnNumber:334},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" to) \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:11,columnNumber:377},this),(0,n.jsxDEV)(e.span,{style:{color:\"#F97583\"},children:\"=\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:11,columnNumber:418},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:11,columnNumber:455},this),(0,n.jsxDEV)(e.span,{style:{color:\"#79B8FF\"},children:\"abi\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:11,columnNumber:492},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\".\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:11,columnNumber:531},this),(0,n.jsxDEV)(e.span,{style:{color:\"#B392F0\"},children:\"decode\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:11,columnNumber:568},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\"(\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:11,columnNumber:610},this)]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:11,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.span,{className:\"line\",children:(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" payload,\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:12,columnNumber:20},this)},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:12,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.span,{className:\"line\",children:[(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" (\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:13,columnNumber:20},this),(0,n.jsxDEV)(e.span,{style:{color:\"#79B8FF\"},children:\"address\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:13,columnNumber:69},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\", \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:13,columnNumber:112},this),(0,n.jsxDEV)(e.span,{style:{color:\"#79B8FF\"},children:\"uint256\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:13,columnNumber:150},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\", \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:13,columnNumber:193},this),(0,n.jsxDEV)(e.span,{style:{color:\"#79B8FF\"},children:\"uint256\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:13,columnNumber:231},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\", \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:13,columnNumber:274},this),(0,n.jsxDEV)(e.span,{style:{color:\"#79B8FF\"},children:\"address\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:13,columnNumber:312},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\")\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:13,columnNumber:355},this)]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:13,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.span,{className:\"line\",children:(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" );\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:14,columnNumber:20},this)},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:14,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.span,{className:\"line\",children:\" \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:15,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.span,{className:\"line\",children:[(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:16,columnNumber:20},this),(0,n.jsxDEV)(e.span,{style:{color:\"#F97583\"},children:\"if\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:16,columnNumber:64},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" (wooRouter.\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:16,columnNumber:102},this),(0,n.jsxDEV)(e.span,{style:{color:\"#B392F0\"},children:\"wooPool\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:16,columnNumber:150},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\"().\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:16,columnNumber:193},this),(0,n.jsxDEV)(e.span,{style:{color:\"#B392F0\"},children:\"quoteToken\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:16,columnNumber:232},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\"() \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:16,columnNumber:278},this),(0,n.jsxDEV)(e.span,{style:{color:\"#F97583\"},children:\"!=\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:16,columnNumber:317},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" _token) {\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:16,columnNumber:355},this)]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:16,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.span,{className:\"line\",children:[(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:17,columnNumber:20},this),(0,n.jsxDEV)(e.span,{style:{color:\"#6A737D\"},children:\"// \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:17,columnNumber:68},this),(0,n.jsxDEV)(e.span,{style:{color:\"#F97583\"},children:\"NOTE\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:17,columnNumber:107},this),(0,n.jsxDEV)(e.span,{style:{color:\"#6A737D\"},children:\": The bridged token is not WooPP's quote token.\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:17,columnNumber:147},this)]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:17,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.span,{className:\"line\",children:[(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:18,columnNumber:20},this),(0,n.jsxDEV)(e.span,{style:{color:\"#6A737D\"},children:\"// So Cannot do the swap; just return it to users.\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:18,columnNumber:68},this)]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:18,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.span,{className:\"line\",children:[(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:19,columnNumber:20},this),(0,n.jsxDEV)(e.span,{style:{color:\"#6A737D\"},children:\"// ..\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:19,columnNumber:68},this)]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:19,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.span,{className:\"line\",children:(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" }\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:20,columnNumber:20},this)},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:20,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.span,{className:\"line\",children:\" \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:21,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.span,{className:\"line\",children:[(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:22,columnNumber:20},this),(0,n.jsxDEV)(e.span,{style:{color:\"#79B8FF\"},children:\"uint256\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:22,columnNumber:64},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" quoteAmount \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:22,columnNumber:107},this),(0,n.jsxDEV)(e.span,{style:{color:\"#F97583\"},children:\"=\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:22,columnNumber:156},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" amountLD;\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:22,columnNumber:193},this)]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:22,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.span,{className:\"line\",children:\" \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:23,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.span,{className:\"line\",children:[(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:24,columnNumber:20},this),(0,n.jsxDEV)(e.span,{style:{color:\"#F97583\"},children:\"if\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:24,columnNumber:64},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" (toToken \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:24,columnNumber:102},this),(0,n.jsxDEV)(e.span,{style:{color:\"#F97583\"},children:\"==\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:24,columnNumber:148},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" ETH_PLACEHOLDER_ADDR) {\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:24,columnNumber:186},this)]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:24,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.span,{className:\"line\",children:[(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:25,columnNumber:20},this),(0,n.jsxDEV)(e.span,{style:{color:\"#6A737D\"},children:\"// quoteToken -> WETH -> ETH\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:25,columnNumber:68},this)]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:25,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.span,{className:\"line\",children:[(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" TransferHelper.\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:26,columnNumber:20},this),(0,n.jsxDEV)(e.span,{style:{color:\"#B392F0\"},children:\"safeApprove\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:26,columnNumber:83},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\"(_token, \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:26,columnNumber:130},this),(0,n.jsxDEV)(e.span,{style:{color:\"#79B8FF\"},children:\"address\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:26,columnNumber:175},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\"(wooRouter), quoteAmount);\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:26,columnNumber:218},this)]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:26,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.span,{className:\"line\",children:[(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:27,columnNumber:20},this),(0,n.jsxDEV)(e.span,{style:{color:\"#F97583\"},children:\"try\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:27,columnNumber:68},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" wooRouter.\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:27,columnNumber:107},this),(0,n.jsxDEV)(e.span,{style:{color:\"#B392F0\"},children:\"swap\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:27,columnNumber:154},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\"(_token, WETH, quoteAmount, minToAmount, \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:27,columnNumber:194},this),(0,n.jsxDEV)(e.span,{style:{color:\"#F97583\"},children:\"payable\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:27,columnNumber:271},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\"(\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:27,columnNumber:314},this),(0,n.jsxDEV)(e.span,{style:{color:\"#79B8FF\"},children:\"address\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:27,columnNumber:351},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\"(\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:27,columnNumber:394},this),(0,n.jsxDEV)(e.span,{style:{color:\"#79B8FF\"},children:\"this\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:27,columnNumber:431},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\")), to) \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:27,columnNumber:471},this),(0,n.jsxDEV)(e.span,{style:{color:\"#F97583\"},children:\"returns\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:27,columnNumber:515},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" (\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:27,columnNumber:558},this)]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:27,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.span,{className:\"line\",children:[(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:28,columnNumber:20},this),(0,n.jsxDEV)(e.span,{style:{color:\"#79B8FF\"},children:\"uint256\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:28,columnNumber:72},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:28,columnNumber:115},this),(0,n.jsxDEV)(e.span,{style:{color:\"#FFAB70\"},children:\"realToAmount\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:28,columnNumber:152},this)]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:28,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.span,{className:\"line\",children:(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" ) {\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:29,columnNumber:20},this)},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:29,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.span,{className:\"line\",children:[(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:30,columnNumber:20},this),(0,n.jsxDEV)(e.span,{style:{color:\"#B392F0\"},children:\"IWETH\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:30,columnNumber:72},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\"(WETH).\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:30,columnNumber:113},this),(0,n.jsxDEV)(e.span,{style:{color:\"#B392F0\"},children:\"withdraw\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:30,columnNumber:156},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\"(realToAmount);\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:30,columnNumber:200},this)]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:30,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.span,{className:\"line\",children:[(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" TransferHelper.\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:31,columnNumber:20},this),(0,n.jsxDEV)(e.span,{style:{color:\"#B392F0\"},children:\"safeTransferETH\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:31,columnNumber:87},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\"(to, realToAmount);\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:31,columnNumber:138},this)]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:31,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.span,{className:\"line\",children:[(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:32,columnNumber:20},this),(0,n.jsxDEV)(e.span,{style:{color:\"#F97583\"},children:\"emit\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:32,columnNumber:72},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:32,columnNumber:112},this),(0,n.jsxDEV)(e.span,{style:{color:\"#B392F0\"},children:\"WooCrossSwapOnDstChain\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:32,columnNumber:149},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\"(...);\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:32,columnNumber:207},this)]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:32,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.span,{className:\"line\",children:[(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" } \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:33,columnNumber:20},this),(0,n.jsxDEV)(e.span,{style:{color:\"#F97583\"},children:\"catch\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:33,columnNumber:70},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" {\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:33,columnNumber:111},this)]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:33,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.span,{className:\"line\",children:[(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:34,columnNumber:20},this),(0,n.jsxDEV)(e.span,{style:{color:\"#6A737D\"},children:\"// transfer _token/amountLD to msg.sender because the swap failed for some reason.\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:34,columnNumber:72},this)]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:34,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.span,{className:\"line\",children:[(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:35,columnNumber:20},this),(0,n.jsxDEV)(e.span,{style:{color:\"#6A737D\"},children:\"// this is not the ideal scenario, but the contract needs to deliver them eth or USDC.\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:35,columnNumber:72},this)]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:35,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.span,{className:\"line\",children:[(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" TransferHelper.\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:36,columnNumber:20},this),(0,n.jsxDEV)(e.span,{style:{color:\"#B392F0\"},children:\"safeTransfer\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:36,columnNumber:87},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\"(_token, to, amountLD);\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:36,columnNumber:135},this)]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:36,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.span,{className:\"line\",children:[(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:37,columnNumber:20},this),(0,n.jsxDEV)(e.span,{style:{color:\"#F97583\"},children:\"emit\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:37,columnNumber:72},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:37,columnNumber:112},this),(0,n.jsxDEV)(e.span,{style:{color:\"#B392F0\"},children:\"WooCrossSwapOnDstChain\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:37,columnNumber:149},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\"(...);\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:37,columnNumber:207},this)]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:37,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.span,{className:\"line\",children:(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" }\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:38,columnNumber:20},this)},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:38,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.span,{className:\"line\",children:[(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" } \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:39,columnNumber:20},this),(0,n.jsxDEV)(e.span,{style:{color:\"#F97583\"},children:\"else\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:39,columnNumber:66},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" {\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:39,columnNumber:106},this)]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:39,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.span,{className:\"line\",children:[(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:40,columnNumber:20},this),(0,n.jsxDEV)(e.span,{style:{color:\"#6A737D\"},children:\"// ...\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:40,columnNumber:68},this)]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:40,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.span,{className:\"line\",children:(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" }\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:41,columnNumber:20},this)},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:41,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.span,{className:\"line\",children:(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" }\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:42,columnNumber:20},this)},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:42,columnNumber:1},this)]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:1,columnNumber:79},this)},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:1,columnNumber:1},this)},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:20,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.p,{children:'The \"crossSwap\" function allows users to send and swap cross-chains.'},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:65,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.p,{children:'When users call the \"crossSwap\" function to swap in a source chain, a \"StarGateRouter\" contract will callback to the \"sgReceive\" function in a destination chain.'},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:67,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.p,{children:'The contract \"WooCrossChainRouter\" uses a try-catch block to handle reverting. If any revert is raised, the user in the destination chain will not receive their fund.'},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:69,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.p,{children:\"An example scenario:\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:71,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.ol,{children:[`\n`,(0,n.jsxDEV)(e.li,{children:[`\n`,(0,n.jsxDEV)(e.p,{children:[\"A user cross-swaps in the source chain with the \",(0,n.jsxDEV)(e.code,{children:\"toToken\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:73,columnNumber:52},this),\" parameter equal to the ETH_PLACEHOLDER_ADDR constant, and \",(0,n.jsxDEV)(e.code,{children:\"toToken\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:73,columnNumber:120},this),\" is a quote token.\"]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:73,columnNumber:4},this),`\n`]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:73,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.li,{children:[`\n`,(0,n.jsxDEV)(e.p,{children:[\"In the destination chain, the contract will swap \",(0,n.jsxDEV)(e.code,{children:\"_token\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:75,columnNumber:53},this),\" to WETH. After that, transferring these ETH to an address the user owned\"]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:75,columnNumber:4},this),`\n`]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:75,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.li,{children:[`\n`,(0,n.jsxDEV)(e.p,{children:\"The swap is OK and is wrapped by a try-catch block. However, the transfer of ETH is not protected. If the receiving address does not define fallback() or receive() functions, it will revert.\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:77,columnNumber:4},this),`\n`]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:77,columnNumber:1},this),`\n`]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:73,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.p,{children:\"If any reverts occur, the user will lose their money, and the money will be held in this contract.\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:79,columnNumber:1},this)]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\",lineNumber:1,columnNumber:1},this)}function hn(i={}){let{wrapper:e}=i.components||{};return e?(0,n.jsxDEV)(e,Object.assign({},i,{children:(0,n.jsxDEV)(ge,i,void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\"},this)}),void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-07062d34-30c8-48b5-9953-53428f3f3f06.mdx\"},this):ge(i)}var jn=hn;return _n(yn);})();\n/*! Bundled license information:\n\nreact/cjs/react-jsx-dev-runtime.development.js:\n (**\n * @license React\n * react-jsx-dev-runtime.development.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *)\n*/\n;return Component;" + "code": "var Component=(()=>{var mn=Object.create;var O=Object.defineProperty;var dn=Object.getOwnPropertyDescriptor;var cn=Object.getOwnPropertyNames;var un=Object.getPrototypeOf,fn=Object.prototype.hasOwnProperty;var q=(d,e)=>()=>(e||d((e={exports:{}}).exports,e),e.exports),pn=(d,e)=>{for(var _ in e)O(d,_,{get:e[_],enumerable:!0})},xe=(d,e,_,y)=>{if(e&&typeof e==\"object\"||typeof e==\"function\")for(let j of cn(e))!fn.call(d,j)&&j!==_&&O(d,j,{get:()=>e[j],enumerable:!(y=dn(e,j))||y.enumerable});return d};var bn=(d,e,_)=>(_=d!=null?mn(un(d)):{},xe(e||!d||!d.__esModule?O(_,\"default\",{value:d,enumerable:!0}):_,d)),_n=d=>xe(O({},\"__esModule\",{value:!0}),d);var Ee=q((vn,ve)=>{ve.exports=React});var we=q(G=>{\"use strict\";(function(){\"use strict\";var d=Ee(),e=Symbol.for(\"react.element\"),_=Symbol.for(\"react.portal\"),y=Symbol.for(\"react.fragment\"),j=Symbol.for(\"react.strict_mode\"),z=Symbol.for(\"react.profiler\"),K=Symbol.for(\"react.provider\"),X=Symbol.for(\"react.context\"),g=Symbol.for(\"react.forward_ref\"),P=Symbol.for(\"react.suspense\"),S=Symbol.for(\"react.suspense_list\"),F=Symbol.for(\"react.memo\"),B=Symbol.for(\"react.lazy\"),Fe=Symbol.for(\"react.offscreen\"),J=Symbol.iterator,Re=\"@@iterator\";function Te(r){if(r===null||typeof r!=\"object\")return null;var t=J&&r[J]||r[Re];return typeof t==\"function\"?t:null}var v=d.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function f(r){{for(var t=arguments.length,o=new Array(t>1?t-1:0),l=1;l=1&&u>=0&&a[c]!==p[u];)u--;for(;c>=1&&u>=0;c--,u--)if(a[c]!==p[u]){if(c!==1||u!==1)do if(c--,u--,u<0||a[c]!==p[u]){var b=`\n`+a[c].replace(\" at new \",\" at \");return r.displayName&&b.includes(\"\")&&(b=b.replace(\"\",r.displayName)),typeof r==\"function\"&&T.set(r,b),b}while(c>=1&&u>=0);break}}}finally{L=!1,W.current=i,Le(),Error.prepareStackTrace=m}var w=r?r.displayName||r.name:\"\",ye=w?R(w):\"\";return typeof r==\"function\"&&T.set(r,ye),ye}function Ye(r,t,o){return me(r,!1)}function $e(r){var t=r.prototype;return!!(t&&t.isReactComponent)}function C(r,t,o){if(r==null)return\"\";if(typeof r==\"function\")return me(r,$e(r));if(typeof r==\"string\")return R(r);switch(r){case P:return R(\"Suspense\");case S:return R(\"SuspenseList\")}if(typeof r==\"object\")switch(r.$$typeof){case g:return Ye(r.render);case F:return C(r.type,t,o);case B:{var l=r,m=l._payload,i=l._init;try{return C(i(m),t,o)}catch{}}}return\"\"}var A=Object.prototype.hasOwnProperty,ie={},de=v.ReactDebugCurrentFrame;function D(r){if(r){var t=r._owner,o=C(r.type,r._source,t?t.type:null);de.setExtraStackFrame(o)}else de.setExtraStackFrame(null)}function He(r,t,o,l,m){{var i=Function.call.bind(A);for(var s in r)if(i(r,s)){var a=void 0;try{if(typeof r[s]!=\"function\"){var p=Error((l||\"React class\")+\": \"+o+\" type `\"+s+\"` is invalid; it must be a function, usually from the `prop-types` package, but received `\"+typeof r[s]+\"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.\");throw p.name=\"Invariant Violation\",p}a=r[s](t,s,l,o,null,\"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED\")}catch(c){a=c}a&&!(a instanceof Error)&&(D(m),f(\"%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).\",l||\"React class\",o,s,typeof a),D(null)),a instanceof Error&&!(a.message in ie)&&(ie[a.message]=!0,D(m),f(\"Failed %s type: %s\",o,a.message),D(null))}}}var Me=Array.isArray;function V(r){return Me(r)}function qe(r){{var t=typeof Symbol==\"function\"&&Symbol.toStringTag,o=t&&r[Symbol.toStringTag]||r.constructor.name||\"Object\";return o}}function Ge(r){try{return ce(r),!1}catch{return!0}}function ce(r){return\"\"+r}function ue(r){if(Ge(r))return f(\"The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.\",qe(r)),ce(r)}var U=v.ReactCurrentOwner,ze={key:!0,ref:!0,__self:!0,__source:!0},fe,pe,Y;Y={};function Ke(r){if(A.call(r,\"ref\")){var t=Object.getOwnPropertyDescriptor(r,\"ref\").get;if(t&&t.isReactWarning)return!1}return r.ref!==void 0}function Xe(r){if(A.call(r,\"key\")){var t=Object.getOwnPropertyDescriptor(r,\"key\").get;if(t&&t.isReactWarning)return!1}return r.key!==void 0}function Je(r,t){if(typeof r.ref==\"string\"&&U.current&&t&&U.current.stateNode!==t){var o=N(U.current.type);Y[o]||(f('Component \"%s\" contains the string ref \"%s\". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',N(U.current.type),r.ref),Y[o]=!0)}}function Ze(r,t){{var o=function(){fe||(fe=!0,f(\"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)\",t))};o.isReactWarning=!0,Object.defineProperty(r,\"key\",{get:o,configurable:!0})}}function Qe(r,t){{var o=function(){pe||(pe=!0,f(\"%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)\",t))};o.isReactWarning=!0,Object.defineProperty(r,\"ref\",{get:o,configurable:!0})}}var en=function(r,t,o,l,m,i,s){var a={$$typeof:e,type:r,key:t,ref:o,props:s,_owner:i};return a._store={},Object.defineProperty(a._store,\"validated\",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(a,\"_self\",{configurable:!1,enumerable:!1,writable:!1,value:l}),Object.defineProperty(a,\"_source\",{configurable:!1,enumerable:!1,writable:!1,value:m}),Object.freeze&&(Object.freeze(a.props),Object.freeze(a)),a};function nn(r,t,o,l,m){{var i,s={},a=null,p=null;o!==void 0&&(ue(o),a=\"\"+o),Xe(t)&&(ue(t.key),a=\"\"+t.key),Ke(t)&&(p=t.ref,Je(t,m));for(i in t)A.call(t,i)&&!ze.hasOwnProperty(i)&&(s[i]=t[i]);if(r&&r.defaultProps){var c=r.defaultProps;for(i in c)s[i]===void 0&&(s[i]=c[i])}if(a||p){var u=typeof r==\"function\"?r.displayName||r.name||\"Unknown\":r;a&&Ze(s,u),p&&Qe(s,u)}return en(r,a,p,m,l,U.current,s)}}var $=v.ReactCurrentOwner,be=v.ReactDebugCurrentFrame;function E(r){if(r){var t=r._owner,o=C(r.type,r._source,t?t.type:null);be.setExtraStackFrame(o)}else be.setExtraStackFrame(null)}var H;H=!1;function M(r){return typeof r==\"object\"&&r!==null&&r.$$typeof===e}function _e(){{if($.current){var r=N($.current.type);if(r)return`\n\nCheck the render method of \\``+r+\"`.\"}return\"\"}}function rn(r){{if(r!==void 0){var t=r.fileName.replace(/^.*[\\\\\\/]/,\"\"),o=r.lineNumber;return`\n\nCheck your code at `+t+\":\"+o+\".\"}return\"\"}}var Ne={};function tn(r){{var t=_e();if(!t){var o=typeof r==\"string\"?r:r.displayName||r.name;o&&(t=`\n\nCheck the top-level render call using <`+o+\">.\")}return t}}function he(r,t){{if(!r._store||r._store.validated||r.key!=null)return;r._store.validated=!0;var o=tn(t);if(Ne[o])return;Ne[o]=!0;var l=\"\";r&&r._owner&&r._owner!==$.current&&(l=\" It was passed a child from \"+N(r._owner.type)+\".\"),E(r),f('Each child in a list should have a unique \"key\" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',o,l),E(null)}}function je(r,t){{if(typeof r!=\"object\")return;if(V(r))for(var o=0;o\",a=\" Did you accidentally export a JSX literal instead of a component?\"):c=typeof r,f(\"React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s\",c,a)}var u=nn(r,t,o,m,i);if(u==null)return u;if(s){var b=t.children;if(b!==void 0)if(l)if(V(b)){for(var w=0;w{\"use strict\";ke.exports=we()});var yn={};pn(yn,{default:()=>jn,frontmatter:()=>Nn});var n=bn(Ue()),Nn={title:\"Woo Finance - Users can lose their money if they use cross-swap in some situations.\",description:\"Users can lose their money if there is any reverts when use crossSwap in Woo Finance.\",repository:\"woonetwork/WooPoolV2\",date:\"2023-10-06\",published:!1,featured:!0};function ge(d){let e=Object.assign({p:\"p\",ul:\"ul\",li:\"li\",a:\"a\",div:\"div\",pre:\"pre\",code:\"code\",span:\"span\",ol:\"ol\"},d.components);return(0,n.jsxDEV)(n.Fragment,{children:[(0,n.jsxDEV)(e.p,{children:`I discovered some high-impact vulnerabilities in WooFi smart contracts.\nUsers can lose their money if they use the function \"crossSwap\" in WooCrossChainRouter, WooCrossChainRouterV2, and WooCrossChainRouterV3 contracts.\nFollowing the details below:`},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:10,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.p,{children:'In the contract \"WooCrossChainRouter\" at'},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:14,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.ul,{children:[`\n`,(0,n.jsxDEV)(e.li,{children:(0,n.jsxDEV)(e.a,{href:\"https://github.com/woonetwork/WooPoolV2/blob/6b7d13fea34a78ca59e4b1aae73d3caa00c2efba/contracts/WooCrossChainRouter.sol#L250-L368\",children:\"https://github.com/woonetwork/WooPoolV2/blob/6b7d13fea34a78ca59e4b1aae73d3caa00c2efba/contracts/WooCrossChainRouter.sol#L250-L368\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:16,columnNumber:3},this)},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:16,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.li,{children:(0,n.jsxDEV)(e.a,{href:\"https://arbiscan.io/address/0x44df096d2600c6a6db77899db3de3aecff746cb8\",children:\"https://arbiscan.io/address/0x44df096d2600c6a6db77899db3de3aecff746cb8\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:17,columnNumber:3},this)},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:17,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.li,{children:\"and in other chains.\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:18,columnNumber:1},this),`\n`]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:16,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.div,{\"data-rehype-pretty-code-fragment\":\"\",children:(0,n.jsxDEV)(e.pre,{\"data-language\":\"solidity\",\"data-theme\":\"default\",children:(0,n.jsxDEV)(e.code,{\"data-language\":\"solidity\",\"data-theme\":\"default\",children:[(0,n.jsxDEV)(e.span,{className:\"line\",children:[(0,n.jsxDEV)(e.span,{style:{color:\"#F97583\"},children:\"function\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:1,columnNumber:104},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:1,columnNumber:148},this),(0,n.jsxDEV)(e.span,{style:{color:\"#B392F0\"},children:\"sgReceive\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:1,columnNumber:185},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\"(\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:1,columnNumber:230},this)]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:1,columnNumber:85},this),`\n`,(0,n.jsxDEV)(e.span,{className:\"line\",children:[(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:2,columnNumber:20},this),(0,n.jsxDEV)(e.span,{style:{color:\"#79B8FF\"},children:\"uint16\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:2,columnNumber:64},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\", \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:2,columnNumber:106},this),(0,n.jsxDEV)(e.span,{style:{color:\"#6A737D\"},children:\"/*_chainId*/\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:2,columnNumber:144},this)]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:2,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.span,{className:\"line\",children:[(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:3,columnNumber:20},this),(0,n.jsxDEV)(e.span,{style:{color:\"#79B8FF\"},children:\"bytes\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:3,columnNumber:64},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:3,columnNumber:105},this),(0,n.jsxDEV)(e.span,{style:{color:\"#F97583\"},children:\"memory\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:3,columnNumber:142},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\", \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:3,columnNumber:184},this),(0,n.jsxDEV)(e.span,{style:{color:\"#6A737D\"},children:\"/*_srcAddress*/\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:3,columnNumber:222},this)]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:3,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.span,{className:\"line\",children:[(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:4,columnNumber:20},this),(0,n.jsxDEV)(e.span,{style:{color:\"#79B8FF\"},children:\"uint256\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:4,columnNumber:64},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\", \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:4,columnNumber:107},this),(0,n.jsxDEV)(e.span,{style:{color:\"#6A737D\"},children:\"/*_nonce*/\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:4,columnNumber:145},this)]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:4,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.span,{className:\"line\",children:[(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:5,columnNumber:20},this),(0,n.jsxDEV)(e.span,{style:{color:\"#79B8FF\"},children:\"address\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:5,columnNumber:64},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" _token,\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:5,columnNumber:107},this)]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:5,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.span,{className:\"line\",children:[(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:6,columnNumber:20},this),(0,n.jsxDEV)(e.span,{style:{color:\"#79B8FF\"},children:\"uint256\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:6,columnNumber:64},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:6,columnNumber:107},this),(0,n.jsxDEV)(e.span,{style:{color:\"#FFAB70\"},children:\"amountLD\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:6,columnNumber:144},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\",\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:6,columnNumber:188},this)]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:6,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.span,{className:\"line\",children:[(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:7,columnNumber:20},this),(0,n.jsxDEV)(e.span,{style:{color:\"#79B8FF\"},children:\"bytes\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:7,columnNumber:64},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:7,columnNumber:105},this),(0,n.jsxDEV)(e.span,{style:{color:\"#F97583\"},children:\"memory\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:7,columnNumber:142},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:7,columnNumber:184},this),(0,n.jsxDEV)(e.span,{style:{color:\"#FFAB70\"},children:\"payload\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:7,columnNumber:221},this)]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:7,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.span,{className:\"line\",children:[(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" ) \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:8,columnNumber:20},this),(0,n.jsxDEV)(e.span,{style:{color:\"#F97583\"},children:\"external\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:8,columnNumber:62},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:8,columnNumber:106},this),(0,n.jsxDEV)(e.span,{style:{color:\"#F97583\"},children:\"override\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:8,columnNumber:143},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" {\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:8,columnNumber:187},this)]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:8,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.span,{className:\"line\",children:[(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:9,columnNumber:20},this),(0,n.jsxDEV)(e.span,{style:{color:\"#F97583\"},children:\"require\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:9,columnNumber:64},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\"(\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:9,columnNumber:107},this),(0,n.jsxDEV)(e.span,{style:{color:\"#79B8FF\"},children:\"msg.sender\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:9,columnNumber:144},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:9,columnNumber:190},this),(0,n.jsxDEV)(e.span,{style:{color:\"#F97583\"},children:\"==\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:9,columnNumber:227},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:9,columnNumber:265},this),(0,n.jsxDEV)(e.span,{style:{color:\"#79B8FF\"},children:\"address\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:9,columnNumber:302},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\"(stargateRouter), \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:9,columnNumber:345},this),(0,n.jsxDEV)(e.span,{style:{color:\"#9ECBFF\"},children:'\"WooCrossChainRouter: INVALID_CALLER\"'},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:9,columnNumber:399},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\");\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:9,columnNumber:482},this)]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:9,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.span,{className:\"line\",children:\" \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:10,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.span,{className:\"line\",children:[(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" (\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:11,columnNumber:20},this),(0,n.jsxDEV)(e.span,{style:{color:\"#79B8FF\"},children:\"address\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:11,columnNumber:65},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" toToken, \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:11,columnNumber:108},this),(0,n.jsxDEV)(e.span,{style:{color:\"#79B8FF\"},children:\"uint256\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:11,columnNumber:154},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" refId, \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:11,columnNumber:197},this),(0,n.jsxDEV)(e.span,{style:{color:\"#79B8FF\"},children:\"uint256\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:11,columnNumber:241},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" minToAmount, \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:11,columnNumber:284},this),(0,n.jsxDEV)(e.span,{style:{color:\"#79B8FF\"},children:\"address\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:11,columnNumber:334},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" to) \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:11,columnNumber:377},this),(0,n.jsxDEV)(e.span,{style:{color:\"#F97583\"},children:\"=\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:11,columnNumber:418},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:11,columnNumber:455},this),(0,n.jsxDEV)(e.span,{style:{color:\"#79B8FF\"},children:\"abi\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:11,columnNumber:492},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\".\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:11,columnNumber:531},this),(0,n.jsxDEV)(e.span,{style:{color:\"#B392F0\"},children:\"decode\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:11,columnNumber:568},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\"(\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:11,columnNumber:610},this)]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:11,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.span,{className:\"line\",children:(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" payload,\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:12,columnNumber:20},this)},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:12,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.span,{className:\"line\",children:[(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" (\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:13,columnNumber:20},this),(0,n.jsxDEV)(e.span,{style:{color:\"#79B8FF\"},children:\"address\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:13,columnNumber:69},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\", \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:13,columnNumber:112},this),(0,n.jsxDEV)(e.span,{style:{color:\"#79B8FF\"},children:\"uint256\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:13,columnNumber:150},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\", \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:13,columnNumber:193},this),(0,n.jsxDEV)(e.span,{style:{color:\"#79B8FF\"},children:\"uint256\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:13,columnNumber:231},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\", \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:13,columnNumber:274},this),(0,n.jsxDEV)(e.span,{style:{color:\"#79B8FF\"},children:\"address\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:13,columnNumber:312},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\")\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:13,columnNumber:355},this)]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:13,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.span,{className:\"line\",children:(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" );\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:14,columnNumber:20},this)},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:14,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.span,{className:\"line\",children:\" \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:15,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.span,{className:\"line\",children:[(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:16,columnNumber:20},this),(0,n.jsxDEV)(e.span,{style:{color:\"#F97583\"},children:\"if\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:16,columnNumber:64},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" (wooRouter.\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:16,columnNumber:102},this),(0,n.jsxDEV)(e.span,{style:{color:\"#B392F0\"},children:\"wooPool\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:16,columnNumber:150},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\"().\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:16,columnNumber:193},this),(0,n.jsxDEV)(e.span,{style:{color:\"#B392F0\"},children:\"quoteToken\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:16,columnNumber:232},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\"() \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:16,columnNumber:278},this),(0,n.jsxDEV)(e.span,{style:{color:\"#F97583\"},children:\"!=\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:16,columnNumber:317},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" _token) {\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:16,columnNumber:355},this)]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:16,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.span,{className:\"line\",children:[(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:17,columnNumber:20},this),(0,n.jsxDEV)(e.span,{style:{color:\"#6A737D\"},children:\"// \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:17,columnNumber:68},this),(0,n.jsxDEV)(e.span,{style:{color:\"#F97583\"},children:\"NOTE\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:17,columnNumber:107},this),(0,n.jsxDEV)(e.span,{style:{color:\"#6A737D\"},children:\": The bridged token is not WooPP's quote token.\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:17,columnNumber:147},this)]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:17,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.span,{className:\"line\",children:[(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:18,columnNumber:20},this),(0,n.jsxDEV)(e.span,{style:{color:\"#6A737D\"},children:\"// So Cannot do the swap; just return it to users.\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:18,columnNumber:68},this)]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:18,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.span,{className:\"line\",children:[(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:19,columnNumber:20},this),(0,n.jsxDEV)(e.span,{style:{color:\"#6A737D\"},children:\"// ..\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:19,columnNumber:68},this)]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:19,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.span,{className:\"line\",children:(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" }\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:20,columnNumber:20},this)},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:20,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.span,{className:\"line\",children:\" \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:21,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.span,{className:\"line\",children:[(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:22,columnNumber:20},this),(0,n.jsxDEV)(e.span,{style:{color:\"#79B8FF\"},children:\"uint256\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:22,columnNumber:64},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" quoteAmount \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:22,columnNumber:107},this),(0,n.jsxDEV)(e.span,{style:{color:\"#F97583\"},children:\"=\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:22,columnNumber:156},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" amountLD;\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:22,columnNumber:193},this)]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:22,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.span,{className:\"line\",children:\" \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:23,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.span,{className:\"line\",children:[(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:24,columnNumber:20},this),(0,n.jsxDEV)(e.span,{style:{color:\"#F97583\"},children:\"if\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:24,columnNumber:64},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" (toToken \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:24,columnNumber:102},this),(0,n.jsxDEV)(e.span,{style:{color:\"#F97583\"},children:\"==\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:24,columnNumber:148},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" ETH_PLACEHOLDER_ADDR) {\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:24,columnNumber:186},this)]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:24,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.span,{className:\"line\",children:[(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:25,columnNumber:20},this),(0,n.jsxDEV)(e.span,{style:{color:\"#6A737D\"},children:\"// quoteToken -> WETH -> ETH\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:25,columnNumber:68},this)]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:25,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.span,{className:\"line\",children:[(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" TransferHelper.\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:26,columnNumber:20},this),(0,n.jsxDEV)(e.span,{style:{color:\"#B392F0\"},children:\"safeApprove\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:26,columnNumber:83},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\"(_token, \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:26,columnNumber:130},this),(0,n.jsxDEV)(e.span,{style:{color:\"#79B8FF\"},children:\"address\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:26,columnNumber:175},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\"(wooRouter), quoteAmount);\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:26,columnNumber:218},this)]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:26,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.span,{className:\"line\",children:[(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:27,columnNumber:20},this),(0,n.jsxDEV)(e.span,{style:{color:\"#F97583\"},children:\"try\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:27,columnNumber:68},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" wooRouter.\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:27,columnNumber:107},this),(0,n.jsxDEV)(e.span,{style:{color:\"#B392F0\"},children:\"swap\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:27,columnNumber:154},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\"(_token, WETH, quoteAmount, minToAmount, \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:27,columnNumber:194},this),(0,n.jsxDEV)(e.span,{style:{color:\"#F97583\"},children:\"payable\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:27,columnNumber:271},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\"(\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:27,columnNumber:314},this),(0,n.jsxDEV)(e.span,{style:{color:\"#79B8FF\"},children:\"address\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:27,columnNumber:351},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\"(\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:27,columnNumber:394},this),(0,n.jsxDEV)(e.span,{style:{color:\"#79B8FF\"},children:\"this\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:27,columnNumber:431},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\")), to) \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:27,columnNumber:471},this),(0,n.jsxDEV)(e.span,{style:{color:\"#F97583\"},children:\"returns\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:27,columnNumber:515},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" (\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:27,columnNumber:558},this)]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:27,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.span,{className:\"line\",children:[(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:28,columnNumber:20},this),(0,n.jsxDEV)(e.span,{style:{color:\"#79B8FF\"},children:\"uint256\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:28,columnNumber:72},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:28,columnNumber:115},this),(0,n.jsxDEV)(e.span,{style:{color:\"#FFAB70\"},children:\"realToAmount\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:28,columnNumber:152},this)]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:28,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.span,{className:\"line\",children:(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" ) {\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:29,columnNumber:20},this)},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:29,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.span,{className:\"line\",children:[(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:30,columnNumber:20},this),(0,n.jsxDEV)(e.span,{style:{color:\"#B392F0\"},children:\"IWETH\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:30,columnNumber:72},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\"(WETH).\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:30,columnNumber:113},this),(0,n.jsxDEV)(e.span,{style:{color:\"#B392F0\"},children:\"withdraw\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:30,columnNumber:156},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\"(realToAmount);\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:30,columnNumber:200},this)]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:30,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.span,{className:\"line\",children:[(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" TransferHelper.\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:31,columnNumber:20},this),(0,n.jsxDEV)(e.span,{style:{color:\"#B392F0\"},children:\"safeTransferETH\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:31,columnNumber:87},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\"(to, realToAmount);\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:31,columnNumber:138},this)]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:31,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.span,{className:\"line\",children:[(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:32,columnNumber:20},this),(0,n.jsxDEV)(e.span,{style:{color:\"#F97583\"},children:\"emit\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:32,columnNumber:72},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:32,columnNumber:112},this),(0,n.jsxDEV)(e.span,{style:{color:\"#B392F0\"},children:\"WooCrossSwapOnDstChain\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:32,columnNumber:149},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\"(...);\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:32,columnNumber:207},this)]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:32,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.span,{className:\"line\",children:[(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" } \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:33,columnNumber:20},this),(0,n.jsxDEV)(e.span,{style:{color:\"#F97583\"},children:\"catch\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:33,columnNumber:70},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" {\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:33,columnNumber:111},this)]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:33,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.span,{className:\"line\",children:[(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:34,columnNumber:20},this),(0,n.jsxDEV)(e.span,{style:{color:\"#6A737D\"},children:\"// transfer _token/amountLD to msg.sender because the swap failed for some reason.\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:34,columnNumber:72},this)]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:34,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.span,{className:\"line\",children:[(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:35,columnNumber:20},this),(0,n.jsxDEV)(e.span,{style:{color:\"#6A737D\"},children:\"// this is not the ideal scenario, but the contract needs to deliver them eth or USDC.\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:35,columnNumber:72},this)]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:35,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.span,{className:\"line\",children:[(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" TransferHelper.\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:36,columnNumber:20},this),(0,n.jsxDEV)(e.span,{style:{color:\"#B392F0\"},children:\"safeTransfer\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:36,columnNumber:87},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\"(_token, to, amountLD);\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:36,columnNumber:135},this)]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:36,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.span,{className:\"line\",children:[(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:37,columnNumber:20},this),(0,n.jsxDEV)(e.span,{style:{color:\"#F97583\"},children:\"emit\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:37,columnNumber:72},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:37,columnNumber:112},this),(0,n.jsxDEV)(e.span,{style:{color:\"#B392F0\"},children:\"WooCrossSwapOnDstChain\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:37,columnNumber:149},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\"(...);\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:37,columnNumber:207},this)]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:37,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.span,{className:\"line\",children:(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" }\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:38,columnNumber:20},this)},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:38,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.span,{className:\"line\",children:[(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" } \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:39,columnNumber:20},this),(0,n.jsxDEV)(e.span,{style:{color:\"#F97583\"},children:\"else\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:39,columnNumber:66},this),(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" {\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:39,columnNumber:106},this)]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:39,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.span,{className:\"line\",children:[(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" \"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:40,columnNumber:20},this),(0,n.jsxDEV)(e.span,{style:{color:\"#6A737D\"},children:\"// ...\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:40,columnNumber:68},this)]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:40,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.span,{className:\"line\",children:(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" }\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:41,columnNumber:20},this)},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:41,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.span,{className:\"line\",children:(0,n.jsxDEV)(e.span,{style:{color:\"#E1E4E8\"},children:\" }\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:42,columnNumber:20},this)},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:42,columnNumber:1},this)]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:1,columnNumber:79},this)},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:1,columnNumber:1},this)},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:20,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.p,{children:'The \"crossSwap\" function allows users to send and swap cross-chains.'},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:65,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.p,{children:'When users call the \"crossSwap\" function to swap in a source chain, a \"StarGateRouter\" contract will callback to the \"sgReceive\" function in a destination chain.'},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:67,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.p,{children:'The contract \"WooCrossChainRouter\" uses a try-catch block to handle reverting. If any revert is raised, the user in the destination chain will not receive their fund.'},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:69,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.p,{children:\"An example scenario:\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:71,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.ol,{children:[`\n`,(0,n.jsxDEV)(e.li,{children:[`\n`,(0,n.jsxDEV)(e.p,{children:[\"A user cross-swaps in the source chain with the \",(0,n.jsxDEV)(e.code,{children:\"toToken\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:73,columnNumber:52},this),\" parameter equal to the ETH_PLACEHOLDER_ADDR constant, and \",(0,n.jsxDEV)(e.code,{children:\"toToken\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:73,columnNumber:120},this),\" is a quote token.\"]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:73,columnNumber:4},this),`\n`]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:73,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.li,{children:[`\n`,(0,n.jsxDEV)(e.p,{children:[\"In the destination chain, the contract will swap \",(0,n.jsxDEV)(e.code,{children:\"_token\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:75,columnNumber:53},this),\" to WETH. After that, transferring these ETH to an address the user owned\"]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:75,columnNumber:4},this),`\n`]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:75,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.li,{children:[`\n`,(0,n.jsxDEV)(e.p,{children:\"The swap is OK and is wrapped by a try-catch block. However, the transfer of ETH is not protected. If the receiving address does not define fallback() or receive() functions, it will revert.\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:77,columnNumber:4},this),`\n`]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:77,columnNumber:1},this),`\n`]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:73,columnNumber:1},this),`\n`,(0,n.jsxDEV)(e.p,{children:\"If any reverts occur, the user will lose their money, and the money will be held in this contract.\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:79,columnNumber:1},this)]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\",lineNumber:1,columnNumber:1},this)}function hn(d={}){let{wrapper:e}=d.components||{};return e?(0,n.jsxDEV)(e,Object.assign({},d,{children:(0,n.jsxDEV)(ge,d,void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\"},this)}),void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-e8a74695-5a48-41a5-be09-83f616f048b7.mdx\"},this):ge(d)}var jn=hn;return _n(yn);})();\n/*! Bundled license information:\n\nreact/cjs/react-jsx-dev-runtime.development.js:\n (**\n * @license React\n * react-jsx-dev-runtime.development.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *)\n*/\n;return Component;" }, - "_id": "projects/WooFi.mdx", + "_id": "projects/WooFi.md", "_raw": { - "sourceFilePath": "projects/WooFi.mdx", - "sourceFileName": "WooFi.mdx", + "sourceFilePath": "projects/WooFi.md", + "sourceFileName": "WooFi.md", "sourceFileDir": "projects", - "contentType": "mdx", + "contentType": "markdown", "flattenedPath": "projects/WooFi" }, "type": "Project", diff --git a/.contentlayer/generated/Project/_index.mjs b/.contentlayer/generated/Project/_index.mjs index ecf9073..93841a3 100644 --- a/.contentlayer/generated/Project/_index.mjs +++ b/.contentlayer/generated/Project/_index.mjs @@ -1,5 +1,6 @@ // NOTE This file is auto-generated by Contentlayer -import projects__wooFiMdx from './projects__WooFi.mdx.json' assert { type: 'json' } +import projects__2023_10_10LayerZeroIntegrationsSecurityTipsMd from './projects__2023-10-10-LayerZero-Integrations-Security-Tips.md.json' assert { type: 'json' } +import projects__wooFiMd from './projects__WooFi.md.json' assert { type: 'json' } -export const allProjects = [projects__wooFiMdx] +export const allProjects = [projects__2023_10_10LayerZeroIntegrationsSecurityTipsMd, projects__wooFiMd] diff --git a/.contentlayer/generated/Project/projects__2023-10-10-LayerZero-Integrations-Security-Tips.md.json b/.contentlayer/generated/Project/projects__2023-10-10-LayerZero-Integrations-Security-Tips.md.json new file mode 100644 index 0000000..0fdb915 --- /dev/null +++ b/.contentlayer/generated/Project/projects__2023-10-10-LayerZero-Integrations-Security-Tips.md.json @@ -0,0 +1,24 @@ +{ + "published": true, + "title": "LayerZero Integrations Security Tips", + "description": "LayerZero integrations security tips for smart contract developers and auditors.", + "date": "2023-10-10T00:00:00.000Z", + "repository": null, + "author": "LowK", + "featured": true, + "body": { + "raw": "\nLayerZero is an omnichain interoperability protocol designed for lightweight message passing across chains. \nLayerZero provides authentic and guaranteed message delivery with configurable trustlessness.\nNeeds more information about LayerZero check out the [docs](https://layerzero.gitbook.io/docs/). \n\nIf you are a smart contract developer or auditor, you should be aware of the following security tips \nwhen integrating LayerZero into your smart contracts.\n\n## Security Tips\n\n1. Calling `send()` with `{value: msg.value}` is because `send()` **requires a bit of native gas token** so the relayer can complete the message delivery on the destination chain. If you don't set this value [you might get this error](notion://www.notion.so/docs/evm-guides/error-messages/error-layerzero-relayer-fee-failed) when calling `endpoint.send()`\n\n2. In a received chain, A **msg.sender is the LZ endpoint**. Are there any mistakes?\n\n3. **Address Sanity Check** In a receiving chain\n \n Is SrcAddress whitelisted?\n \n Check the address size according to the source chain (e.g. address size == 20 bytes on EVM chains) to prevent a vector unauthenticated contract call.\n \n4. In a received chain, parse srcAddress to the address type that is just applied for EVM chains. **Is your application connected with non-evm chain?**\n\n5. **Is there a set of trusted remote addresses**? The feature is available at some places that must be checked:\n - retryPayload()::srcAddress\n - hasStoredPayload()::srcAddress\n - forceResumeReceive()::srcAddress\n - setTrustedRemote()::path\n - isTrustedRemote()::_srcAddress\n - lzReceive()::_srcAddress\n6. **Should implement an *Instant Finality Guarantee (IFG)***\n \n Reverting in (user application) UA is cumbersome and expensive. It is more efficient to design your UA with IFG such that if a transaction was accepted at source, the transaction will be accepted at the remote. For example, Stargate has a credit management system (Delta Algorithm) to guarantee that if a swap was accepted at source, the destination must have enough asset to complete the swap, hence the IFG.\n \n7. **Tracking the nonce**\n\n8. **One action per message**: only one thing per message\n\n9. **Store failed message**: [example](https://solodit.xyz/issues/h-06-attacker-can-block-layerzero-channel-code4rena-velodrome-finance-velodrome-finance-git)\n \n If the message execution fails at the destination, try-catch it, and store it for future retries. From LayerZero's perspective, the message has been delivered. It is much cheaper and easier for your programs to recover from the last state at the destination chain.\n Store a hash of the message payload is much cheaper than storing the whole message\n \n *sink*: not implement `blockingLzReceive()`\n \n10. **Gas for Message Types**\n \n *If your app includes multiple message types to be sent across chains,* compute a rough gas estimate at the destination chain per each message type.\n \n *Your message may fail for the out-of-gas exception at the destination if your app did not instruct the relayer to put extra gas on contract execution*. \n \n And the UA should enforce the gas estimate on-chain at the source chain to prevent users from inputting too low a value for gas.", + "code": "var Component=(()=>{var lr=Object.create;var A=Object.defineProperty;var cr=Object.getOwnPropertyDescriptor;var ur=Object.getOwnPropertyNames;var dr=Object.getPrototypeOf,fr=Object.prototype.hasOwnProperty;var Z=(u,n)=>()=>(n||u((n={exports:{}}).exports,n),n.exports),mr=(u,n)=>{for(var _ in n)A(u,_,{get:n[_],enumerable:!0})},ge=(u,n,_,N)=>{if(n&&typeof n==\"object\"||typeof n==\"function\")for(let y of ur(n))!fr.call(u,y)&&y!==_&&A(u,y,{get:()=>n[y],enumerable:!(N=cr(n,y))||N.enumerable});return u};var br=(u,n,_)=>(_=u!=null?lr(dr(u)):{},ge(n||!u||!u.__esModule?A(_,\"default\",{value:u,enumerable:!0}):_,u)),pr=u=>ge(A({},\"__esModule\",{value:!0}),u);var xe=Z((gr,je)=>{je.exports=React});var we=Z(B=>{\"use strict\";(function(){\"use strict\";var u=xe(),n=Symbol.for(\"react.element\"),_=Symbol.for(\"react.portal\"),N=Symbol.for(\"react.fragment\"),y=Symbol.for(\"react.strict_mode\"),q=Symbol.for(\"react.profiler\"),K=Symbol.for(\"react.provider\"),X=Symbol.for(\"react.context\"),R=Symbol.for(\"react.forward_ref\"),D=Symbol.for(\"react.suspense\"),F=Symbol.for(\"react.suspense_list\"),U=Symbol.for(\"react.memo\"),I=Symbol.for(\"react.lazy\"),Ue=Symbol.for(\"react.offscreen\"),H=Symbol.iterator,Te=\"@@iterator\";function Ce(e){if(e===null||typeof e!=\"object\")return null;var r=H&&e[H]||e[Te];return typeof r==\"function\"?r:null}var j=u.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function m(e){{for(var r=arguments.length,t=new Array(r>1?r-1:0),a=1;a=1&&f>=0&&i[d]!==b[f];)f--;for(;d>=1&&f>=0;d--,f--)if(i[d]!==b[f]){if(d!==1||f!==1)do if(d--,f--,f<0||i[d]!==b[f]){var p=`\n`+i[d].replace(\" at new \",\" at \");return e.displayName&&p.includes(\"\")&&(p=p.replace(\"\",e.displayName)),typeof e==\"function\"&&C.set(e,p),p}while(d>=1&&f>=0);break}}}finally{M=!1,L.current=c,Me(),Error.prepareStackTrace=l}var w=e?e.displayName||e.name:\"\",Ne=w?T(w):\"\";return typeof e==\"function\"&&C.set(e,Ne),Ne}function Ve(e,r,t){return le(e,!1)}function We(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function S(e,r,t){if(e==null)return\"\";if(typeof e==\"function\")return le(e,We(e));if(typeof e==\"string\")return T(e);switch(e){case D:return T(\"Suspense\");case F:return T(\"SuspenseList\")}if(typeof e==\"object\")switch(e.$$typeof){case R:return Ve(e.render);case U:return S(e.type,r,t);case I:{var a=e,l=a._payload,c=a._init;try{return S(c(l),r,t)}catch{}}}return\"\"}var O=Object.prototype.hasOwnProperty,ce={},ue=j.ReactDebugCurrentFrame;function P(e){if(e){var r=e._owner,t=S(e.type,e._source,r?r.type:null);ue.setExtraStackFrame(t)}else ue.setExtraStackFrame(null)}function ze(e,r,t,a,l){{var c=Function.call.bind(O);for(var s in e)if(c(e,s)){var i=void 0;try{if(typeof e[s]!=\"function\"){var b=Error((a||\"React class\")+\": \"+t+\" type `\"+s+\"` is invalid; it must be a function, usually from the `prop-types` package, but received `\"+typeof e[s]+\"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.\");throw b.name=\"Invariant Violation\",b}i=e[s](r,s,a,t,null,\"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED\")}catch(d){i=d}i&&!(i instanceof Error)&&(P(l),m(\"%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).\",a||\"React class\",t,s,typeof i),P(null)),i instanceof Error&&!(i.message in ce)&&(ce[i.message]=!0,P(l),m(\"Failed %s type: %s\",t,i.message),P(null))}}}var Ge=Array.isArray;function $(e){return Ge(e)}function Ze(e){{var r=typeof Symbol==\"function\"&&Symbol.toStringTag,t=r&&e[Symbol.toStringTag]||e.constructor.name||\"Object\";return t}}function Be(e){try{return de(e),!1}catch{return!0}}function de(e){return\"\"+e}function fe(e){if(Be(e))return m(\"The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.\",Ze(e)),de(e)}var E=j.ReactCurrentOwner,qe={key:!0,ref:!0,__self:!0,__source:!0},me,be,V;V={};function Ke(e){if(O.call(e,\"ref\")){var r=Object.getOwnPropertyDescriptor(e,\"ref\").get;if(r&&r.isReactWarning)return!1}return e.ref!==void 0}function Xe(e){if(O.call(e,\"key\")){var r=Object.getOwnPropertyDescriptor(e,\"key\").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function He(e,r){if(typeof e.ref==\"string\"&&E.current&&r&&E.current.stateNode!==r){var t=h(E.current.type);V[t]||(m('Component \"%s\" contains the string ref \"%s\". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',h(E.current.type),e.ref),V[t]=!0)}}function Je(e,r){{var t=function(){me||(me=!0,m(\"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)\",r))};t.isReactWarning=!0,Object.defineProperty(e,\"key\",{get:t,configurable:!0})}}function Qe(e,r){{var t=function(){be||(be=!0,m(\"%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)\",r))};t.isReactWarning=!0,Object.defineProperty(e,\"ref\",{get:t,configurable:!0})}}var er=function(e,r,t,a,l,c,s){var i={$$typeof:n,type:e,key:r,ref:t,props:s,_owner:c};return i._store={},Object.defineProperty(i._store,\"validated\",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(i,\"_self\",{configurable:!1,enumerable:!1,writable:!1,value:a}),Object.defineProperty(i,\"_source\",{configurable:!1,enumerable:!1,writable:!1,value:l}),Object.freeze&&(Object.freeze(i.props),Object.freeze(i)),i};function rr(e,r,t,a,l){{var c,s={},i=null,b=null;t!==void 0&&(fe(t),i=\"\"+t),Xe(r)&&(fe(r.key),i=\"\"+r.key),Ke(r)&&(b=r.ref,He(r,l));for(c in r)O.call(r,c)&&!qe.hasOwnProperty(c)&&(s[c]=r[c]);if(e&&e.defaultProps){var d=e.defaultProps;for(c in d)s[c]===void 0&&(s[c]=d[c])}if(i||b){var f=typeof e==\"function\"?e.displayName||e.name||\"Unknown\":e;i&&Je(s,f),b&&Qe(s,f)}return er(e,i,b,l,a,E.current,s)}}var W=j.ReactCurrentOwner,pe=j.ReactDebugCurrentFrame;function x(e){if(e){var r=e._owner,t=S(e.type,e._source,r?r.type:null);pe.setExtraStackFrame(t)}else pe.setExtraStackFrame(null)}var z;z=!1;function G(e){return typeof e==\"object\"&&e!==null&&e.$$typeof===n}function _e(){{if(W.current){var e=h(W.current.type);if(e)return`\n\nCheck the render method of \\``+e+\"`.\"}return\"\"}}function nr(e){{if(e!==void 0){var r=e.fileName.replace(/^.*[\\\\\\/]/,\"\"),t=e.lineNumber;return`\n\nCheck your code at `+r+\":\"+t+\".\"}return\"\"}}var he={};function tr(e){{var r=_e();if(!r){var t=typeof e==\"string\"?e:e.displayName||e.name;t&&(r=`\n\nCheck the top-level render call using <`+t+\">.\")}return r}}function ve(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var t=tr(r);if(he[t])return;he[t]=!0;var a=\"\";e&&e._owner&&e._owner!==W.current&&(a=\" It was passed a child from \"+h(e._owner.type)+\".\"),x(e),m('Each child in a list should have a unique \"key\" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',t,a),x(null)}}function ye(e,r){{if(typeof e!=\"object\")return;if($(e))for(var t=0;t\",i=\" Did you accidentally export a JSX literal instead of a component?\"):d=typeof e,m(\"React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s\",d,i)}var f=rr(e,r,t,l,c);if(f==null)return f;if(s){var p=r.children;if(p!==void 0)if(a)if($(p)){for(var w=0;w{\"use strict\";ke.exports=we()});var yr={};mr(yr,{default:()=>vr,frontmatter:()=>_r});var o=br(Ee()),_r={title:\"LayerZero Integrations Security Tips\",description:\"LayerZero integrations security tips for smart contract developers and auditors.\",repository:null,date:new Date(1696896e6),published:!0,featured:!0,author:\"LowK\"};function Re(u){let n=Object.assign({p:\"p\",a:\"a\",h2:\"h2\",span:\"span\",ol:\"ol\",li:\"li\",code:\"code\",strong:\"strong\",ul:\"ul\",em:\"em\"},u.components);return(0,o.jsxDEV)(o.Fragment,{children:[(0,o.jsxDEV)(n.p,{children:[`LayerZero is an omnichain interoperability protocol designed for lightweight message passing across chains.\nLayerZero provides authentic and guaranteed message delivery with configurable trustlessness.\nNeeds more information about LayerZero check out the `,(0,o.jsxDEV)(n.a,{href:\"https://layerzero.gitbook.io/docs/\",children:\"docs\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:13,columnNumber:54},this),\".\"]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:11,columnNumber:1},this),`\n`,(0,o.jsxDEV)(n.p,{children:`If you are a smart contract developer or auditor, you should be aware of the following security tips\nwhen integrating LayerZero into your smart contracts.`},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:15,columnNumber:1},this),`\n`,(0,o.jsxDEV)(n.h2,{id:\"security-tips\",children:[(0,o.jsxDEV)(n.a,{className:\"subheading-anchor\",\"aria-label\":\"Link to section\",href:\"#security-tips\",children:(0,o.jsxDEV)(n.span,{className:\"icon icon-link\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\"},this)},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\"},this),\"Security Tips\"]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:18,columnNumber:1},this),`\n`,(0,o.jsxDEV)(n.ol,{children:[`\n`,(0,o.jsxDEV)(n.li,{children:[`\n`,(0,o.jsxDEV)(n.p,{children:[\"Calling\\xA0\",(0,o.jsxDEV)(n.code,{children:\"send()\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:20,columnNumber:12},this),\"\\xA0with\\xA0\",(0,o.jsxDEV)(n.code,{children:\"{value: msg.value}\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:20,columnNumber:26},this),\" is because\\xA0\",(0,o.jsxDEV)(n.code,{children:\"send()\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:20,columnNumber:58},this),\"\\xA0\",(0,o.jsxDEV)(n.strong,{children:\"requires a bit of native gas token\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:20,columnNumber:67},this),\" so the relayer can complete the message delivery on the destination chain. If you don't set this value\\xA0\",(0,o.jsxDEV)(n.a,{href:\"notion://www.notion.so/docs/evm-guides/error-messages/error-layerzero-relayer-fee-failed\",children:\"you might get this error\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:20,columnNumber:209},this),\"\\xA0when calling\\xA0\",(0,o.jsxDEV)(n.code,{children:\"endpoint.send()\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:20,columnNumber:339},this)]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:20,columnNumber:4},this),`\n`]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:20,columnNumber:1},this),`\n`,(0,o.jsxDEV)(n.li,{children:[`\n`,(0,o.jsxDEV)(n.p,{children:[\"In a received chain, A \",(0,o.jsxDEV)(n.strong,{children:\"msg.sender is the LZ endpoint\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:22,columnNumber:28},this),\". Are there any mistakes?\"]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:22,columnNumber:5},this),`\n`]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:22,columnNumber:1},this),`\n`,(0,o.jsxDEV)(n.li,{children:[`\n`,(0,o.jsxDEV)(n.p,{children:[(0,o.jsxDEV)(n.strong,{children:\"Address Sanity Check\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:24,columnNumber:4},this),\" In a receiving chain\"]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:24,columnNumber:4},this),`\n`,(0,o.jsxDEV)(n.p,{children:\"Is SrcAddress whitelisted?\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:26,columnNumber:5},this),`\n`,(0,o.jsxDEV)(n.p,{children:\"Check the address size according to the source chain (e.g. address size == 20 bytes on EVM chains) to prevent a vector unauthenticated contract call.\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:28,columnNumber:5},this),`\n`]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:24,columnNumber:1},this),`\n`,(0,o.jsxDEV)(n.li,{children:[`\n`,(0,o.jsxDEV)(n.p,{children:[\"In a received chain, parse srcAddress to the address type that is just applied for EVM chains. \",(0,o.jsxDEV)(n.strong,{children:\"Is your application connected with non-evm chain?\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:30,columnNumber:100},this)]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:30,columnNumber:5},this),`\n`]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:30,columnNumber:1},this),`\n`,(0,o.jsxDEV)(n.li,{children:[`\n`,(0,o.jsxDEV)(n.p,{children:[(0,o.jsxDEV)(n.strong,{children:\"Is there a set of trusted remote addresses\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:32,columnNumber:4},this),\"? The feature is available at some places that must be checked:\"]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:32,columnNumber:4},this),`\n`,(0,o.jsxDEV)(n.ul,{children:[`\n`,(0,o.jsxDEV)(n.li,{children:\"retryPayload()::srcAddress\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:33,columnNumber:5},this),`\n`,(0,o.jsxDEV)(n.li,{children:\"hasStoredPayload()::srcAddress\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:34,columnNumber:5},this),`\n`,(0,o.jsxDEV)(n.li,{children:\"forceResumeReceive()::srcAddress\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:35,columnNumber:5},this),`\n`,(0,o.jsxDEV)(n.li,{children:\"setTrustedRemote()::path\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:36,columnNumber:5},this),`\n`,(0,o.jsxDEV)(n.li,{children:\"isTrustedRemote()::_srcAddress\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:37,columnNumber:5},this),`\n`,(0,o.jsxDEV)(n.li,{children:\"lzReceive()::_srcAddress\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:38,columnNumber:5},this),`\n`]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:33,columnNumber:5},this),`\n`]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:32,columnNumber:1},this),`\n`,(0,o.jsxDEV)(n.li,{children:[`\n`,(0,o.jsxDEV)(n.p,{children:(0,o.jsxDEV)(n.strong,{children:[\"Should implement an \",(0,o.jsxDEV)(n.em,{children:\"Instant Finality Guarantee (IFG)\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:39,columnNumber:26},this)]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:39,columnNumber:4},this)},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:39,columnNumber:4},this),`\n`,(0,o.jsxDEV)(n.p,{children:\"Reverting in (user application) UA is cumbersome and expensive. It is more efficient to design your UA with IFG such that if a transaction was accepted at source, the transaction will be accepted at the remote. For example, Stargate has a credit management system (Delta Algorithm) to guarantee that if a swap was accepted at source, the destination must have enough asset to complete the swap, hence the IFG.\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:41,columnNumber:5},this),`\n`]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:39,columnNumber:1},this),`\n`,(0,o.jsxDEV)(n.li,{children:[`\n`,(0,o.jsxDEV)(n.p,{children:(0,o.jsxDEV)(n.strong,{children:\"Tracking the nonce\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:43,columnNumber:4},this)},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:43,columnNumber:4},this),`\n`]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:43,columnNumber:1},this),`\n`,(0,o.jsxDEV)(n.li,{children:[`\n`,(0,o.jsxDEV)(n.p,{children:[(0,o.jsxDEV)(n.strong,{children:\"One action per message\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:45,columnNumber:4},this),\": only one thing per message\"]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:45,columnNumber:4},this),`\n`]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:45,columnNumber:1},this),`\n`,(0,o.jsxDEV)(n.li,{children:[`\n`,(0,o.jsxDEV)(n.p,{children:[(0,o.jsxDEV)(n.strong,{children:\"Store failed message\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:47,columnNumber:4},this),\": \",(0,o.jsxDEV)(n.a,{href:\"https://solodit.xyz/issues/h-06-attacker-can-block-layerzero-channel-code4rena-velodrome-finance-velodrome-finance-git\",children:\"example\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:47,columnNumber:30},this)]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:47,columnNumber:4},this),`\n`,(0,o.jsxDEV)(n.p,{children:`If the message execution fails at the destination, try-catch it, and store it for future retries. From LayerZero's perspective, the message has been delivered. It is much cheaper and easier for your programs to recover from the last state at the destination chain.\nStore a hash of the message payload is much cheaper than storing the whole message`},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:49,columnNumber:5},this),`\n`,(0,o.jsxDEV)(n.p,{children:[(0,o.jsxDEV)(n.em,{children:\"sink\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:52,columnNumber:5},this),\": not implement \",(0,o.jsxDEV)(n.code,{children:\"blockingLzReceive()\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:52,columnNumber:27},this)]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:52,columnNumber:5},this),`\n`]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:47,columnNumber:1},this),`\n`,(0,o.jsxDEV)(n.li,{children:[`\n`,(0,o.jsxDEV)(n.p,{children:(0,o.jsxDEV)(n.strong,{children:\"Gas for Message Types\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:54,columnNumber:5},this)},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:54,columnNumber:5},this),`\n`,(0,o.jsxDEV)(n.p,{children:[(0,o.jsxDEV)(n.em,{children:\"If your app includes multiple message types to be sent across chains,\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:56,columnNumber:5},this),\" compute a rough gas estimate at the destination chain per each message type.\"]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:56,columnNumber:5},this),`\n`,(0,o.jsxDEV)(n.p,{children:[(0,o.jsxDEV)(n.em,{children:\"Your message may fail for the out-of-gas exception at the destination if your app did not instruct the relayer to put extra gas on contract execution\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:58,columnNumber:5},this),\".\"]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:58,columnNumber:5},this),`\n`,(0,o.jsxDEV)(n.p,{children:\"And the UA should enforce the gas estimate on-chain at the source chain to prevent users from inputting too low a value for gas.\"},void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:60,columnNumber:5},this),`\n`]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:54,columnNumber:1},this),`\n`]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:20,columnNumber:1},this)]},void 0,!0,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\",lineNumber:1,columnNumber:1},this)}function hr(u={}){let{wrapper:n}=u.components||{};return n?(0,o.jsxDEV)(n,Object.assign({},u,{children:(0,o.jsxDEV)(Re,u,void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\"},this)}),void 0,!1,{fileName:\"/Users/lap14962/projects/me/lowk-dot-me-v2/content/projects/_mdx_bundler_entry_point-36bae548-78e4-4939-ae25-6b2df62f18cb.mdx\"},this):Re(u)}var vr=hr;return pr(yr);})();\n/*! Bundled license information:\n\nreact/cjs/react-jsx-dev-runtime.development.js:\n (**\n * @license React\n * react-jsx-dev-runtime.development.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *)\n*/\n;return Component;" + }, + "_id": "projects/2023-10-10-LayerZero-Integrations-Security-Tips.md", + "_raw": { + "sourceFilePath": "projects/2023-10-10-LayerZero-Integrations-Security-Tips.md", + "sourceFileName": "2023-10-10-LayerZero-Integrations-Security-Tips.md", + "sourceFileDir": "projects", + "contentType": "markdown", + "flattenedPath": "projects/2023-10-10-LayerZero-Integrations-Security-Tips" + }, + "type": "Project", + "path": "/projects/2023-10-10-LayerZero-Integrations-Security-Tips", + "slug": "2023-10-10-LayerZero-Integrations-Security-Tips" +} \ No newline at end of file diff --git a/.contentlayer/package.json b/.contentlayer/package.json index 40fe078..386d155 100644 --- a/.contentlayer/package.json +++ b/.contentlayer/package.json @@ -1,7 +1,7 @@ { "name": "dot-contentlayer", "description": "This package is auto-generated by Contentlayer", - "version": "0.0.0-7OOTH3RP", + "version": "0.0.0-WSC433HJ", "exports": { "./generated": { "import": "./generated/index.mjs" diff --git a/app/page.tsx b/app/page.tsx index a658400..866f733 100644 --- a/app/page.tsx +++ b/app/page.tsx @@ -70,7 +70,7 @@ export default function Home() { { link: 'mailto:lowk3v@gmail.com', title: ( - Review Your Project + Request an audit 🔐 ), diff --git a/content/projects/2023-10-10-LayerZero-Integrations-Security-Tips.md b/content/projects/2023-10-10-LayerZero-Integrations-Security-Tips.md index c68793c..5424f76 100644 --- a/content/projects/2023-10-10-LayerZero-Integrations-Security-Tips.md +++ b/content/projects/2023-10-10-LayerZero-Integrations-Security-Tips.md @@ -17,7 +17,7 @@ when integrating LayerZero into your smart contracts. ## Security Tips -1. Calling `send()` with `{value: msg.value}` is because `send()` **requires a bit of native gas token** so the relayer can complete the message delivery on the destination chain. If you don't set this value [you might get this error](notion://www.notion.so/docs/evm-guides/error-messages/error-layerzero-relayer-fee-failed) when calling `endpoint.send()` +1. Calling `send()` with `{value: msg.value}` is because `send()` **requires a bit of native gas token** so the relayer can complete the message delivery on the destination chain. If you don't set this value you might get an error when calling `endpoint.send()` 2. In a received chain, A **msg.sender is the LZ endpoint**. Are there any mistakes? @@ -27,7 +27,7 @@ when integrating LayerZero into your smart contracts. Check the address size according to the source chain (e.g. address size == 20 bytes on EVM chains) to prevent a vector unauthenticated contract call. -4. In a received chain, parse srcAddress to the address type that is just applied for EVM chains. **Is your application connected with non-e chain?** +4. In a received chain, parse srcAddress to the address type that is just applied for EVM chains. **Is your application connected with non-evm chain?** 5. **Is there a set of trusted remote addresses**? The feature is available at some places that must be checked: - retryPayload()::srcAddress diff --git a/contentlayer.config.js b/contentlayer.config.js index 70369e1..f9f3ab4 100644 --- a/contentlayer.config.js +++ b/contentlayer.config.js @@ -18,7 +18,7 @@ const computedFields = { export const Project = defineDocumentType(() => ({ name: "Project", - filePathPattern: "./projects/**/*.mdx", + filePathPattern: "./projects/**/*.md", contentType: "mdx", fields: { @@ -56,7 +56,7 @@ export const Project = defineDocumentType(() => ({ export const Page = defineDocumentType(() => ({ name: "Page", - filePathPattern: "pages/**/*.mdx", + filePathPattern: "pages/**/*.md", contentType: "mdx", fields: { title: {