@latticexyz/world-module-erc20 2.2.18-318924725246340b208d3fbee8793314686f1759 → 2.2.18-4565714f5e9421cc7b2de56fe51db4434c55f5d1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (120) hide show
  1. package/dist/_esm-BQNWKNND.js +10 -0
  2. package/dist/{_esm-H47RQ4ED.js.map → _esm-BQNWKNND.js.map} +1 -1
  3. package/dist/ccip-YAWUVTAX.js +2 -0
  4. package/dist/chunk-GSBUANUZ.js +30 -0
  5. package/dist/{chunk-LIWKL347.js.map → chunk-GSBUANUZ.js.map} +1 -1
  6. package/dist/chunk-LURIOADG.js +2 -0
  7. package/dist/chunk-TJJDXMQ6.js +7 -0
  8. package/dist/{chunk-2VXHCW2O.js.map → chunk-TJJDXMQ6.js.map} +1 -1
  9. package/dist/internal.js +1 -27
  10. package/dist/internal.js.map +1 -1
  11. package/dist/mud.config.js +1 -83
  12. package/dist/mud.config.js.map +1 -1
  13. package/dist/secp256k1-UMYSD4MC.js +22 -0
  14. package/dist/{secp256k1-XVT662DN.js.map → secp256k1-UMYSD4MC.js.map} +1 -1
  15. package/out/AccessManagementSystem.sol/AccessManagementSystem.json +1 -1
  16. package/out/BalanceTransferSystem.sol/BalanceTransferSystem.json +1 -1
  17. package/out/BatchCallSystem.sol/BatchCallSystem.json +1 -1
  18. package/out/Constants.sol/ERC20TableNames.json +1 -1
  19. package/out/Constants.sol/ModuleConstants.json +1 -1
  20. package/out/Constants.sol/OwnableTableNames.json +1 -1
  21. package/out/Constants.sol/PausableTableNames.json +1 -1
  22. package/out/Context.sol/Context.abi.json +1 -15
  23. package/out/Context.sol/Context.json +1 -1
  24. package/out/Delegation.sol/Delegation.json +1 -1
  25. package/out/ERC20BaseTest.t.sol/ERC20BehaviorTest.json +1 -1
  26. package/out/ERC20BaseTest.t.sol/ERC20WithInternalStoreBehaviorTest.json +1 -1
  27. package/out/ERC20BaseTest.t.sol/ERC20WithInternalStoreTest.json +1 -1
  28. package/out/ERC20BaseTest.t.sol/ERC20WithWorldBehaviorTest.json +1 -1
  29. package/out/ERC20BaseTest.t.sol/ERC20WithWorldTest.json +1 -1
  30. package/out/ERC20BaseTest.t.sol/MockERC20Base.abi.json +0 -13
  31. package/out/ERC20BaseTest.t.sol/MockERC20Base.abi.json.d.ts +0 -13
  32. package/out/ERC20BaseTest.t.sol/MockERC20Base.json +1 -1
  33. package/out/ERC20BaseTest.t.sol/MockERC20WithInternalStore.abi.json +0 -13
  34. package/out/ERC20BaseTest.t.sol/MockERC20WithInternalStore.abi.json.d.ts +0 -13
  35. package/out/ERC20BaseTest.t.sol/MockERC20WithInternalStore.json +1 -1
  36. package/out/ERC20BaseTest.t.sol/MockERC20WithWorld.abi.json +3 -95
  37. package/out/ERC20BaseTest.t.sol/MockERC20WithWorld.abi.json.d.ts +3 -95
  38. package/out/ERC20BaseTest.t.sol/MockERC20WithWorld.json +1 -1
  39. package/out/ERC20BaseTest.t.sol/TestConstants.json +1 -1
  40. package/out/ERC20Burnable.sol/ERC20Burnable.abi.json +0 -13
  41. package/out/ERC20Burnable.sol/ERC20Burnable.abi.json.d.ts +0 -13
  42. package/out/ERC20Burnable.sol/ERC20Burnable.json +1 -1
  43. package/out/ERC20Burnable.t.sol/ERC20BurnableTest.json +1 -1
  44. package/out/ERC20Burnable.t.sol/ERC20BurnableWithInternalStoreTest.json +1 -1
  45. package/out/ERC20Burnable.t.sol/ERC20BurnableWithWorldTest.json +1 -1
  46. package/out/ERC20Burnable.t.sol/MockERC20WithInternalStoreBurnable.abi.json +0 -13
  47. package/out/ERC20Burnable.t.sol/MockERC20WithInternalStoreBurnable.abi.json.d.ts +0 -13
  48. package/out/ERC20Burnable.t.sol/MockERC20WithInternalStoreBurnable.json +1 -1
  49. package/out/ERC20Burnable.t.sol/MockERC20WithWorldBurnable.abi.json +3 -95
  50. package/out/ERC20Burnable.t.sol/MockERC20WithWorldBurnable.abi.json.d.ts +3 -95
  51. package/out/ERC20Burnable.t.sol/MockERC20WithWorldBurnable.json +1 -1
  52. package/out/ERC20Module.sol/ERC20Module.json +1 -1
  53. package/out/ERC20Module.sol/ERC20RegistryLib.json +1 -1
  54. package/out/ERC20Module.t.sol/ERC20ModuleTest.json +1 -1
  55. package/out/ERC20Module.t.sol/TestConstants.json +1 -1
  56. package/out/ERC20Pausable.sol/ERC20Pausable.abi.json +0 -13
  57. package/out/ERC20Pausable.sol/ERC20Pausable.abi.json.d.ts +0 -13
  58. package/out/ERC20Pausable.sol/ERC20Pausable.json +1 -1
  59. package/out/ERC20Pausable.t.sol/ERC20PausableBehaviorTest.json +1 -1
  60. package/out/ERC20Pausable.t.sol/ERC20PausableWithInternalStoreTest.json +1 -1
  61. package/out/ERC20Pausable.t.sol/ERC20PausableWithWorldTest.json +1 -1
  62. package/out/ERC20Pausable.t.sol/MockERC20Pausable.abi.json +0 -13
  63. package/out/ERC20Pausable.t.sol/MockERC20Pausable.abi.json.d.ts +0 -13
  64. package/out/ERC20Pausable.t.sol/MockERC20Pausable.json +1 -1
  65. package/out/ERC20Pausable.t.sol/MockERC20WithInternalStorePausable.abi.json +0 -13
  66. package/out/ERC20Pausable.t.sol/MockERC20WithInternalStorePausable.abi.json.d.ts +0 -13
  67. package/out/ERC20Pausable.t.sol/MockERC20WithInternalStorePausable.json +1 -1
  68. package/out/ERC20Pausable.t.sol/MockERC20WithWorldPausable.abi.json +3 -95
  69. package/out/ERC20Pausable.t.sol/MockERC20WithWorldPausable.abi.json.d.ts +3 -95
  70. package/out/ERC20Pausable.t.sol/MockERC20WithWorldPausable.json +1 -1
  71. package/out/ERC20WithInternalStore.sol/ERC20WithInternalStore.abi.json +0 -13
  72. package/out/ERC20WithInternalStore.sol/ERC20WithInternalStore.abi.json.d.ts +0 -13
  73. package/out/ERC20WithInternalStore.sol/ERC20WithInternalStore.json +1 -1
  74. package/out/ERC20WithWorld.sol/ERC20WithWorld.abi.json +3 -95
  75. package/out/ERC20WithWorld.sol/ERC20WithWorld.abi.json.d.ts +3 -95
  76. package/out/ERC20WithWorld.sol/ERC20WithWorld.json +1 -1
  77. package/out/IBaseWorld.sol/IBaseWorld.json +1 -1
  78. package/out/IWorldRegistrationSystem.sol/IWorldRegistrationSystem.json +1 -1
  79. package/out/InitModule.sol/InitModule.json +1 -1
  80. package/out/MUDERC20.sol/MUDERC20.abi.json +0 -13
  81. package/out/MUDERC20.sol/MUDERC20.abi.json.d.ts +0 -13
  82. package/out/MUDERC20.sol/MUDERC20.json +1 -1
  83. package/out/Module.sol/Module.json +1 -1
  84. package/out/ModuleInstallationSystem.sol/ModuleInstallationSystem.json +1 -1
  85. package/out/Ownable.sol/Ownable.abi.json +0 -13
  86. package/out/Ownable.sol/Ownable.abi.json.d.ts +0 -13
  87. package/out/Ownable.sol/Ownable.json +1 -1
  88. package/out/Pausable.sol/Pausable.abi.json +0 -13
  89. package/out/Pausable.sol/Pausable.abi.json.d.ts +0 -13
  90. package/out/Pausable.sol/Pausable.json +1 -1
  91. package/out/RegistrationSystem.sol/RegistrationSystem.json +1 -1
  92. package/out/StoreConsumer.sol/StoreConsumer.json +1 -1
  93. package/out/StoreRegistrationSystem.sol/StoreRegistrationSystem.json +1 -1
  94. package/out/System.sol/System.json +1 -1
  95. package/out/SystemCall.sol/SystemCall.json +1 -1
  96. package/out/WithStore.sol/WithStore.abi.json +0 -13
  97. package/out/WithStore.sol/WithStore.abi.json.d.ts +0 -13
  98. package/out/WithStore.sol/WithStore.json +1 -1
  99. package/out/WithWorld.sol/WithWorld.abi.json +3 -95
  100. package/out/WithWorld.sol/WithWorld.abi.json.d.ts +3 -95
  101. package/out/WithWorld.sol/WithWorld.json +1 -1
  102. package/out/World.sol/World.json +1 -1
  103. package/out/WorldContext.sol/WorldContextConsumer.json +1 -1
  104. package/out/WorldContext.sol/WorldContextConsumerLib.json +1 -1
  105. package/out/WorldContext.sol/WorldContextProviderLib.json +1 -1
  106. package/out/WorldRegistrationSystem.sol/WorldRegistrationSystem.json +1 -1
  107. package/out/build-info/{60c60a9593fdb00b3264c36836a28f39.json → 04cd01b00610d99132b6410373c2f462.json} +1 -1
  108. package/package.json +10 -9
  109. package/src/examples/ERC20WithWorld.sol +0 -5
  110. package/src/experimental/Constants.sol +7 -7
  111. package/src/experimental/ERC20Module.sol +1 -9
  112. package/dist/_esm-H47RQ4ED.js +0 -3915
  113. package/dist/ccip-VJWDNI4X.js +0 -15
  114. package/dist/chunk-2VXHCW2O.js +0 -132
  115. package/dist/chunk-LIWKL347.js +0 -3833
  116. package/dist/chunk-PR4QN5HX.js +0 -43
  117. package/dist/secp256k1-XVT662DN.js +0 -2395
  118. package/out/Context.sol/Context.abi.json.d.ts +0 -17
  119. /package/dist/{ccip-VJWDNI4X.js.map → ccip-YAWUVTAX.js.map} +0 -0
  120. /package/dist/{chunk-PR4QN5HX.js.map → chunk-LURIOADG.js.map} +0 -0
@@ -0,0 +1,2 @@
1
+ import{c as a,d as b,e as c,f as d}from"./chunk-GSBUANUZ.js";import"./chunk-TJJDXMQ6.js";import"./chunk-LURIOADG.js";export{d as ccipRequest,c as offchainLookup,b as offchainLookupAbiItem,a as offchainLookupSignature};
2
+ //# sourceMappingURL=ccip-YAWUVTAX.js.map
@@ -0,0 +1,30 @@
1
+ import{a as Tt,b as an,d as Bt,e as un,f as cn,i as kt,j as zt,k as pn,m as dn,n as fn,o as mn}from"./chunk-TJJDXMQ6.js";var ln="1.0.6";var x=class e extends Error{constructor(t,n={}){let r=n.cause instanceof e?n.cause.details:n.cause?.message?n.cause.message:n.details,o=n.cause instanceof e&&n.cause.docsPath||n.docsPath,i=[t||"An error occurred.","",...n.metaMessages?[...n.metaMessages,""]:[],...o?[`Docs: https://abitype.dev${o}`]:[],...r?[`Details: ${r}`]:[],`Version: abitype@${ln}`].join(`
2
+ `);super(i),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiTypeError"}),n.cause&&(this.cause=n.cause),this.details=r,this.docsPath=o,this.metaMessages=n.metaMessages,this.shortMessage=t}};function $(e,t){return e.exec(t)?.groups}var Ot=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,Ct=/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/,Me=/^\(.+?\).*?$/;var yn=/^tuple(?<array>(\[(\d*)\])*)$/;function Se(e){let t=e.type;if(yn.test(e.type)&&"components"in e){t="(";let n=e.components.length;for(let o=0;o<n;o++){let i=e.components[o];t+=Se(i),o<n-1&&(t+=", ")}let r=$(yn,e.type);return t+=`)${r?.array??""}`,Se({...e,type:t})}return"indexed"in e&&e.indexed&&(t=`${t} indexed`),e.name?`${t} ${e.name}`:t}function W(e){let t="",n=e.length;for(let r=0;r<n;r++){let o=e[r];t+=Se(o),r!==n-1&&(t+=", ")}return t}function Rt(e){return e.type==="function"?`function ${e.name}(${W(e.inputs)})${e.stateMutability&&e.stateMutability!=="nonpayable"?` ${e.stateMutability}`:""}${e.outputs.length?` returns (${W(e.outputs)})`:""}`:e.type==="event"?`event ${e.name}(${W(e.inputs)})`:e.type==="error"?`error ${e.name}(${W(e.inputs)})`:e.type==="constructor"?`constructor(${W(e.inputs)})${e.stateMutability==="payable"?" payable":""}`:e.type==="fallback"?"fallback()":"receive() external payable"}var bn=/^error (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;function hn(e){return bn.test(e)}function xn(e){return $(bn,e)}var gn=/^event (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;function wn(e){return gn.test(e)}function vn(e){return $(gn,e)}var $n=/^function (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)(?: (?<scope>external|public{1}))?(?: (?<stateMutability>pure|view|nonpayable|payable{1}))?(?: returns\s?\((?<returns>.*?)\))?$/;function An(e){return $n.test(e)}function Pn(e){return $($n,e)}var In=/^struct (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*) \{(?<properties>.*?)\}$/;function Ee(e){return In.test(e)}function Mn(e){return $(In,e)}var Sn=/^constructor\((?<parameters>.*?)\)(?:\s(?<stateMutability>payable{1}))?$/;function En(e){return Sn.test(e)}function Tn(e){return $(Sn,e)}var Gr=/^fallback\(\) external(?:\s(?<stateMutability>payable{1}))?$/;function Bn(e){return Gr.test(e)}var Vr=/^receive\(\) external payable$/;function kn(e){return Vr.test(e)}var zn=new Set(["indexed"]),Te=new Set(["calldata","memory","storage"]);var Be=class extends x{constructor({type:t}){super("Unknown type.",{metaMessages:[`Type "${t}" is not a valid ABI type. Perhaps you forgot to include a struct signature?`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownTypeError"})}},ke=class extends x{constructor({type:t}){super("Unknown type.",{metaMessages:[`Type "${t}" is not a valid ABI type.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSolidityTypeError"})}};var ze=class extends x{constructor({param:t}){super("Invalid ABI parameter.",{details:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParameterError"})}},Oe=class extends x{constructor({param:t,name:n}){super("Invalid ABI parameter.",{details:t,metaMessages:[`"${n}" is a protected Solidity keyword. More info: https://docs.soliditylang.org/en/latest/cheatsheet.html`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SolidityProtectedKeywordError"})}},Ce=class extends x{constructor({param:t,type:n,modifier:r}){super("Invalid ABI parameter.",{details:t,metaMessages:[`Modifier "${r}" not allowed${n?` in "${n}" type`:""}.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidModifierError"})}},Re=class extends x{constructor({param:t,type:n,modifier:r}){super("Invalid ABI parameter.",{details:t,metaMessages:[`Modifier "${r}" not allowed${n?` in "${n}" type`:""}.`,`Data location can only be specified for array, struct, or mapping types, but "${r}" was given.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidFunctionModifierError"})}},je=class extends x{constructor({abiParameter:t}){super("Invalid ABI parameter.",{details:JSON.stringify(t,null,2),metaMessages:["ABI parameter type is invalid."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiTypeParameterError"})}};var T=class extends x{constructor({signature:t,type:n}){super(`Invalid ${n} signature.`,{details:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidSignatureError"})}},Ue=class extends x{constructor({signature:t}){super("Unknown signature.",{details:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSignatureError"})}},Fe=class extends x{constructor({signature:t}){super("Invalid struct signature.",{details:t,metaMessages:["No properties exist."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidStructSignatureError"})}};var Le=class extends x{constructor({type:t}){super("Circular reference detected.",{metaMessages:[`Struct "${t}" is a circular reference.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"CircularReferenceError"})}};var De=class extends x{constructor({current:t,depth:n}){super("Unbalanced parentheses.",{metaMessages:[`"${t.trim()}" has too many ${n>0?"opening":"closing"} parentheses.`],details:`Depth "${n}"`}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParenthesisError"})}};function On(e,t){return t?`${t}:${e}`:e}var Ne=new Map([["address",{type:"address"}],["bool",{type:"bool"}],["bytes",{type:"bytes"}],["bytes32",{type:"bytes32"}],["int",{type:"int256"}],["int256",{type:"int256"}],["string",{type:"string"}],["uint",{type:"uint256"}],["uint8",{type:"uint8"}],["uint16",{type:"uint16"}],["uint24",{type:"uint24"}],["uint32",{type:"uint32"}],["uint64",{type:"uint64"}],["uint96",{type:"uint96"}],["uint112",{type:"uint112"}],["uint160",{type:"uint160"}],["uint192",{type:"uint192"}],["uint256",{type:"uint256"}],["address owner",{type:"address",name:"owner"}],["address to",{type:"address",name:"to"}],["bool approved",{type:"bool",name:"approved"}],["bytes _data",{type:"bytes",name:"_data"}],["bytes data",{type:"bytes",name:"data"}],["bytes signature",{type:"bytes",name:"signature"}],["bytes32 hash",{type:"bytes32",name:"hash"}],["bytes32 r",{type:"bytes32",name:"r"}],["bytes32 root",{type:"bytes32",name:"root"}],["bytes32 s",{type:"bytes32",name:"s"}],["string name",{type:"string",name:"name"}],["string symbol",{type:"string",name:"symbol"}],["string tokenURI",{type:"string",name:"tokenURI"}],["uint tokenId",{type:"uint256",name:"tokenId"}],["uint8 v",{type:"uint8",name:"v"}],["uint256 balance",{type:"uint256",name:"balance"}],["uint256 tokenId",{type:"uint256",name:"tokenId"}],["uint256 value",{type:"uint256",name:"value"}],["event:address indexed from",{type:"address",name:"from",indexed:!0}],["event:address indexed to",{type:"address",name:"to",indexed:!0}],["event:uint indexed tokenId",{type:"uint256",name:"tokenId",indexed:!0}],["event:uint256 indexed tokenId",{type:"uint256",name:"tokenId",indexed:!0}]]);function Cn(e,t={}){if(An(e)){let n=Pn(e);if(!n)throw new T({signature:e,type:"function"});let r=M(n.parameters),o=[],i=r.length;for(let a=0;a<i;a++)o.push(R(r[a],{modifiers:Te,structs:t,type:"function"}));let s=[];if(n.returns){let a=M(n.returns),u=a.length;for(let p=0;p<u;p++)s.push(R(a[p],{modifiers:Te,structs:t,type:"function"}))}return{name:n.name,type:"function",stateMutability:n.stateMutability??"nonpayable",inputs:o,outputs:s}}if(wn(e)){let n=vn(e);if(!n)throw new T({signature:e,type:"event"});let r=M(n.parameters),o=[],i=r.length;for(let s=0;s<i;s++)o.push(R(r[s],{modifiers:zn,structs:t,type:"event"}));return{name:n.name,type:"event",inputs:o}}if(hn(e)){let n=xn(e);if(!n)throw new T({signature:e,type:"error"});let r=M(n.parameters),o=[],i=r.length;for(let s=0;s<i;s++)o.push(R(r[s],{structs:t,type:"error"}));return{name:n.name,type:"error",inputs:o}}if(En(e)){let n=Tn(e);if(!n)throw new T({signature:e,type:"constructor"});let r=M(n.parameters),o=[],i=r.length;for(let s=0;s<i;s++)o.push(R(r[s],{structs:t,type:"constructor"}));return{type:"constructor",stateMutability:n.stateMutability??"nonpayable",inputs:o}}if(Bn(e))return{type:"fallback"};if(kn(e))return{type:"receive",stateMutability:"payable"};throw new Ue({signature:e})}var Wr=/^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,Zr=/^\((?<type>.+?)\)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,Kr=/^u?int$/;function R(e,t){let n=On(e,t?.type);if(Ne.has(n))return Ne.get(n);let r=Me.test(e),o=$(r?Zr:Wr,e);if(!o)throw new ze({param:e});if(o.name&&Jr(o.name))throw new Oe({param:e,name:o.name});let i=o.name?{name:o.name}:{},s=o.modifier==="indexed"?{indexed:!0}:{},a=t?.structs??{},u,p={};if(r){u="tuple";let f=M(o.type),l=[],m=f.length;for(let b=0;b<m;b++)l.push(R(f[b],{structs:a}));p={components:l}}else if(o.type in a)u="tuple",p={components:a[o.type]};else if(Kr.test(o.type))u=`${o.type}256`;else if(u=o.type,t?.type!=="struct"&&!jt(u))throw new ke({type:u});if(o.modifier){if(!t?.modifiers?.has?.(o.modifier))throw new Ce({param:e,type:t?.type,modifier:o.modifier});if(Te.has(o.modifier)&&!Yr(u,!!o.array))throw new Re({param:e,type:t?.type,modifier:o.modifier})}let d={type:`${u}${o.array??""}`,...i,...s,...p};return Ne.set(n,d),d}function M(e,t=[],n="",r=0){let o=e.trim().length;for(let i=0;i<o;i++){let s=e[i],a=e.slice(i+1);switch(s){case",":return r===0?M(a,[...t,n.trim()]):M(a,t,`${n}${s}`,r);case"(":return M(a,t,`${n}${s}`,r+1);case")":return M(a,t,`${n}${s}`,r-1);default:return M(a,t,`${n}${s}`,r)}}if(n==="")return t;if(r!==0)throw new De({current:n,depth:r});return t.push(n.trim()),t}function jt(e){return e==="address"||e==="bool"||e==="function"||e==="string"||Ot.test(e)||Ct.test(e)}var Xr=/^(?:after|alias|anonymous|apply|auto|byte|calldata|case|catch|constant|copyof|default|defined|error|event|external|false|final|function|immutable|implements|in|indexed|inline|internal|let|mapping|match|memory|mutable|null|of|override|partial|private|promise|public|pure|reference|relocatable|return|returns|sizeof|static|storage|struct|super|supports|switch|this|true|try|typedef|typeof|var|view|virtual)$/;function Jr(e){return e==="address"||e==="bool"||e==="function"||e==="string"||e==="tuple"||Ot.test(e)||Ct.test(e)||Xr.test(e)}function Yr(e,t){return t||e==="bytes"||e==="string"||e==="tuple"}function Rn(e){let t={},n=e.length;for(let s=0;s<n;s++){let a=e[s];if(!Ee(a))continue;let u=Mn(a);if(!u)throw new T({signature:a,type:"struct"});let p=u.properties.split(";"),d=[],f=p.length;for(let l=0;l<f;l++){let b=p[l].trim();if(!b)continue;let g=R(b,{type:"struct"});d.push(g)}if(!d.length)throw new Fe({signature:a});t[u.name]=d}let r={},o=Object.entries(t),i=o.length;for(let s=0;s<i;s++){let[a,u]=o[s];r[a]=jn(u,t)}return r}var qr=/^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*)(?<array>(?:\[\d*?\])+?)?$/;function jn(e,t,n=new Set){let r=[],o=e.length;for(let i=0;i<o;i++){let s=e[i];if(Me.test(s.type))r.push(s);else{let u=$(qr,s.type);if(!u?.type)throw new je({abiParameter:s});let{array:p,type:d}=u;if(d in t){if(n.has(d))throw new Le({type:d});r.push({...s,type:`tuple${p??""}`,components:jn(t[d]??[],t,new Set([...n,d]))})}else if(jt(d))r.push(s);else throw new Be({type:d})}}return r}function He(e){let t=Rn(e),n=[],r=e.length;for(let o=0;o<r;o++){let i=e[o];Ee(i)||n.push(Cn(i,t))}return n}function Z(e){return typeof e=="string"?{address:e,type:"json-rpc"}:e}var Ut=[{inputs:[{components:[{name:"target",type:"address"},{name:"allowFailure",type:"bool"},{name:"callData",type:"bytes"}],name:"calls",type:"tuple[]"}],name:"aggregate3",outputs:[{components:[{name:"success",type:"bool"},{name:"returnData",type:"bytes"}],name:"returnData",type:"tuple[]"}],stateMutability:"view",type:"function"}],Un=[{inputs:[],name:"ResolverNotFound",type:"error"},{inputs:[],name:"ResolverWildcardNotSupported",type:"error"},{inputs:[],name:"ResolverNotContract",type:"error"},{inputs:[{name:"returnData",type:"bytes"}],name:"ResolverError",type:"error"},{inputs:[{components:[{name:"status",type:"uint16"},{name:"message",type:"string"}],name:"errors",type:"tuple[]"}],name:"HttpError",type:"error"}],Ds=[...Un,{name:"resolve",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes"},{name:"data",type:"bytes"}],outputs:[{name:"",type:"bytes"},{name:"address",type:"address"}]},{name:"resolve",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes"},{name:"data",type:"bytes"},{name:"gateways",type:"string[]"}],outputs:[{name:"",type:"bytes"},{name:"address",type:"address"}]}],Ns=[...Un,{name:"reverse",type:"function",stateMutability:"view",inputs:[{type:"bytes",name:"reverseName"}],outputs:[{type:"string",name:"resolvedName"},{type:"address",name:"resolvedAddress"},{type:"address",name:"reverseResolver"},{type:"address",name:"resolver"}]},{name:"reverse",type:"function",stateMutability:"view",inputs:[{type:"bytes",name:"reverseName"},{type:"string[]",name:"gateways"}],outputs:[{type:"string",name:"resolvedName"},{type:"address",name:"resolvedAddress"},{type:"address",name:"reverseResolver"},{type:"address",name:"resolver"}]}];var Fn="0x82ad56cb";var Ln="0x608060405234801561001057600080fd5b5060405161018e38038061018e83398101604081905261002f91610124565b6000808351602085016000f59050803b61004857600080fd5b6000808351602085016000855af16040513d6000823e81610067573d81fd5b3d81f35b634e487b7160e01b600052604160045260246000fd5b600082601f83011261009257600080fd5b81516001600160401b038111156100ab576100ab61006b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156100d9576100d961006b565b6040528181528382016020018510156100f157600080fd5b60005b82811015610110576020818601810151838301820152016100f4565b506000918101602001919091529392505050565b6000806040838503121561013757600080fd5b82516001600160401b0381111561014d57600080fd5b61015985828601610081565b602085015190935090506001600160401b0381111561017757600080fd5b61018385828601610081565b915050925092905056fe",Dn="0x608060405234801561001057600080fd5b506040516102c03803806102c083398101604081905261002f916101e6565b836001600160a01b03163b6000036100e457600080836001600160a01b03168360405161005c9190610270565b6000604051808303816000865af19150503d8060008114610099576040519150601f19603f3d011682016040523d82523d6000602084013e61009e565b606091505b50915091508115806100b857506001600160a01b0386163b155b156100e1578060405163101bb98d60e01b81526004016100d8919061028c565b60405180910390fd5b50505b6000808451602086016000885af16040513d6000823e81610103573d81fd5b3d81f35b80516001600160a01b038116811461011e57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561015457818101518382015260200161013c565b50506000910152565b600082601f83011261016e57600080fd5b81516001600160401b0381111561018757610187610123565b604051601f8201601f19908116603f011681016001600160401b03811182821017156101b5576101b5610123565b6040528181528382016020018510156101cd57600080fd5b6101de826020830160208701610139565b949350505050565b600080600080608085870312156101fc57600080fd5b61020585610107565b60208601519094506001600160401b0381111561022157600080fd5b61022d8782880161015d565b93505061023c60408601610107565b60608601519092506001600160401b0381111561025857600080fd5b6102648782880161015d565b91505092959194509250565b60008251610282818460208701610139565b9190910192915050565b60208152600082518060208401526102ab816040850160208701610139565b601f01601f1916919091016040019291505056fe";var Ft="2.21.19";var Lt={getDocsUrl:({docsBaseUrl:e,docsPath:t="",docsSlug:n})=>t?`${e??"https://viem.sh"}${t}${n?`#${n}`:""}`:void 0,version:Ft};var c=class e extends Error{constructor(t,n={}){let r=n.cause instanceof e?n.cause.details:n.cause?.message?n.cause.message:n.details,o=n.cause instanceof e&&n.cause.docsPath||n.docsPath,i=Lt.getDocsUrl?.({...n,docsPath:o}),s=[t||"An error occurred.","",...n.metaMessages?[...n.metaMessages,""]:[],...i?[`Docs: ${i}`]:[],...r?[`Details: ${r}`]:[],...Lt.version?[`Version: ${Lt.version}`]:[]].join(`
3
+ `);super(s,n.cause?{cause:n.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.details=r,this.docsPath=o,this.metaMessages=n.metaMessages,this.name=n.name??this.name,this.shortMessage=t,this.version=Ft}walk(t){return Nn(this,t)}};function Nn(e,t){return t?.(e)?e:e&&typeof e=="object"&&"cause"in e?Nn(e.cause,t):t?null:e}var H=class extends c{constructor({blockNumber:t,chain:n,contract:r}){super(`Chain "${n.name}" does not support contract "${r.name}".`,{metaMessages:["This could be due to any of the following:",...t&&r.blockCreated&&r.blockCreated>t?[`- The contract "${r.name}" was not deployed until block ${r.blockCreated} (current block ${t}).`]:[`- The chain does not have the contract "${r.name}" configured.`]],name:"ChainDoesNotSupportContract"})}};var de=class extends c{constructor(){super("No chain was provided to the Client.",{name:"ClientChainNotConfiguredError"})}};var Hn={inputs:[{name:"message",type:"string"}],name:"Error",type:"error"},_n={inputs:[{name:"reason",type:"uint256"}],name:"Panic",type:"error"};function _(e,{includeName:t=!1}={}){if(e.type!=="function"&&e.type!=="event"&&e.type!=="error")throw new Ge(e.type);return`${e.name}(${_e(e.inputs,{includeName:t})})`}function _e(e,{includeName:t=!1}={}){return e?e.map(n=>Qr(n,{includeName:t})).join(t?", ":","):""}function Qr(e,{includeName:t}){return e.type.startsWith("tuple")?`(${_e(e.components,{includeName:t})})${e.type.slice(5)}`:e.type+(t&&e.name?` ${e.name}`:"")}function A(e,{strict:t=!0}={}){return!e||typeof e!="string"?!1:t?/^0x[0-9a-fA-F]*$/.test(e):e.startsWith("0x")}function h(e){return A(e,{strict:!1})?Math.ceil((e.length-2)/2):e.length}var Ve=class extends c{constructor({docsPath:t}){super(["A constructor was not found on the ABI.","Make sure you are using the correct ABI and that the constructor exists on it."].join(`
4
+ `),{docsPath:t,name:"AbiConstructorNotFoundError"})}},fe=class extends c{constructor({docsPath:t}){super(["Constructor arguments were provided (`args`), but a constructor parameters (`inputs`) were not found on the ABI.","Make sure you are using the correct ABI, and that the `inputs` attribute on the constructor exists."].join(`
5
+ `),{docsPath:t,name:"AbiConstructorParamsNotFoundError"})}};var We=class extends c{constructor({data:t,params:n,size:r}){super([`Data size of ${r} bytes is too small for given parameters.`].join(`
6
+ `),{metaMessages:[`Params: (${_e(n,{includeName:!0})})`,`Data: ${t} (${r} bytes)`],name:"AbiDecodingDataSizeTooSmallError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"params",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"size",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=t,this.params=n,this.size=r}},K=class extends c{constructor(){super('Cannot decode zero data ("0x") with ABI parameters.',{name:"AbiDecodingZeroDataError"})}},Ze=class extends c{constructor({expectedLength:t,givenLength:n,type:r}){super([`ABI encoding array length mismatch for type ${r}.`,`Expected length: ${t}`,`Given length: ${n}`].join(`
7
+ `),{name:"AbiEncodingArrayLengthMismatchError"})}},Ke=class extends c{constructor({expectedSize:t,value:n}){super(`Size of bytes "${n}" (bytes${h(n)}) does not match expected size (bytes${t}).`,{name:"AbiEncodingBytesSizeMismatchError"})}},Xe=class extends c{constructor({expectedLength:t,givenLength:n}){super(["ABI encoding params/values length mismatch.",`Expected length (params): ${t}`,`Given length (values): ${n}`].join(`
8
+ `),{name:"AbiEncodingLengthMismatchError"})}};var Je=class extends c{constructor(t,{docsPath:n}){super([`Encoded error signature "${t}" not found on ABI.`,"Make sure you are using the correct ABI and that the error exists on it.",`You can look up the decoded signature here: https://openchain.xyz/signatures?query=${t}.`].join(`
9
+ `),{docsPath:n,name:"AbiErrorSignatureNotFoundError"}),Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.signature=t}};var j=class extends c{constructor(t,{docsPath:n}={}){super([`Function ${t?`"${t}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the function exists on it."].join(`
10
+ `),{docsPath:n,name:"AbiFunctionNotFoundError"})}},Ye=class extends c{constructor(t,{docsPath:n}){super([`Function "${t}" does not contain any \`outputs\` on ABI.`,"Cannot decode function result without knowing what the parameter types are.","Make sure you are using the correct ABI and that the function exists on it."].join(`
11
+ `),{docsPath:n,name:"AbiFunctionOutputsNotFoundError"})}};var qe=class extends c{constructor(t,n){super("Found ambiguous types in overloaded ABI items.",{metaMessages:[`\`${t.type}\` in \`${_(t.abiItem)}\`, and`,`\`${n.type}\` in \`${_(n.abiItem)}\``,"","These types encode differently and cannot be distinguished at runtime.","Remove one of the ambiguous items in the ABI."],name:"AbiItemAmbiguityError"})}};var Qe=class extends c{constructor(t,{docsPath:n}){super([`Type "${t}" is not a valid encoding type.`,"Please provide a valid ABI type."].join(`
12
+ `),{docsPath:n,name:"InvalidAbiEncodingType"})}},et=class extends c{constructor(t,{docsPath:n}){super([`Type "${t}" is not a valid decoding type.`,"Please provide a valid ABI type."].join(`
13
+ `),{docsPath:n,name:"InvalidAbiDecodingType"})}},tt=class extends c{constructor(t){super([`Value "${t}" is not a valid array.`].join(`
14
+ `),{name:"InvalidArrayError"})}},Ge=class extends c{constructor(t){super([`"${t}" is not a valid definition type.`,'Valid types: "function", "event", "error"'].join(`
15
+ `),{name:"InvalidDefinitionTypeError"})}};var me=class extends c{constructor({offset:t,position:n,size:r}){super(`Slice ${n==="start"?"starting":"ending"} at offset "${t}" is out-of-bounds (size: ${r}).`,{name:"SliceOffsetOutOfBoundsError"})}},le=class extends c{constructor({size:t,targetSize:n,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} size (${t}) exceeds padding size (${n}).`,{name:"SizeExceedsPaddingSizeError"})}},ye=class extends c{constructor({size:t,targetSize:n,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} is expected to be ${n} ${r} long, but is ${t} ${r} long.`,{name:"InvalidBytesLengthError"})}};function G(e,t,n,{strict:r}={}){return A(e,{strict:!1})?eo(e,t,n,{strict:r}):Dt(e,t,n,{strict:r})}function Gn(e,t){if(typeof t=="number"&&t>0&&t>h(e)-1)throw new me({offset:t,position:"start",size:h(e)})}function Vn(e,t,n){if(typeof t=="number"&&typeof n=="number"&&h(e)!==n-t)throw new me({offset:n,position:"end",size:h(e)})}function Dt(e,t,n,{strict:r}={}){Gn(e,t);let o=e.slice(t,n);return r&&Vn(o,t,n),o}function eo(e,t,n,{strict:r}={}){Gn(e,t);let o=`0x${e.replace("0x","").slice((t??0)*2,(n??e.length)*2)}`;return r&&Vn(o,t,n),o}function U(e,{dir:t,size:n=32}={}){return typeof e=="string"?B(e,{dir:t,size:n}):to(e,{dir:t,size:n})}function B(e,{dir:t,size:n=32}={}){if(n===null)return e;let r=e.replace("0x","");if(r.length>n*2)throw new le({size:Math.ceil(r.length/2),targetSize:n,type:"hex"});return`0x${r[t==="right"?"padEnd":"padStart"](n*2,"0")}`}function to(e,{dir:t,size:n=32}={}){if(n===null)return e;if(e.length>n)throw new le({size:e.length,targetSize:n,type:"bytes"});let r=new Uint8Array(n);for(let o=0;o<n;o++){let i=t==="right";r[i?o:n-o-1]=e[i?o:e.length-o-1]}return r}var nt=class extends c{constructor({max:t,min:n,signed:r,size:o,value:i}){super(`Number "${i}" is not in safe ${o?`${o*8}-bit ${r?"signed":"unsigned"} `:""}integer range ${t?`(${n} to ${t})`:`(above ${n})`}`,{name:"IntegerOutOfRangeError"})}},rt=class extends c{constructor(t){super(`Bytes value "${t}" is not a valid boolean. The bytes array must contain a single byte of either a 0 or 1 value.`,{name:"InvalidBytesBooleanError"})}};var ot=class extends c{constructor({givenSize:t,maxSize:n}){super(`Size cannot exceed ${n} bytes. Given size: ${t} bytes.`,{name:"SizeOverflowError"})}};function be(e,{dir:t="left"}={}){let n=typeof e=="string"?e.replace("0x",""):e,r=0;for(let o=0;o<n.length-1&&n[t==="left"?o:n.length-o-1].toString()==="0";o++)r++;return n=t==="left"?n.slice(r):n.slice(0,n.length-r),typeof e=="string"?(n.length===1&&t==="right"&&(n=`${n}0`),`0x${n.length%2===1?`0${n}`:n}`):n}function v(e,{size:t}){if(h(e)>t)throw new ot({givenSize:h(e),maxSize:t})}function Nt(e,t={}){let{signed:n}=t;t.size&&v(e,{size:t.size});let r=BigInt(e);if(!n)return r;let o=(e.length-2)/2,i=(1n<<BigInt(o)*8n-1n)-1n;return r<=i?r:r-BigInt(`0x${"f".padStart(o*2,"f")}`)-1n}function Wn(e,t={}){return Number(Nt(e,t))}var no=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function Zn(e,t={}){return typeof e=="number"||typeof e=="bigint"?y(e,t):typeof e=="string"?_t(e,t):typeof e=="boolean"?Ht(e,t):P(e,t)}function Ht(e,t={}){let n=`0x${Number(e)}`;return typeof t.size=="number"?(v(n,{size:t.size}),U(n,{size:t.size})):n}function P(e,t={}){let n="";for(let o=0;o<e.length;o++)n+=no[e[o]];let r=`0x${n}`;return typeof t.size=="number"?(v(r,{size:t.size}),U(r,{dir:"right",size:t.size})):r}function y(e,t={}){let{signed:n,size:r}=t,o=BigInt(e),i;r?n?i=(1n<<BigInt(r)*8n-1n)-1n:i=2n**(BigInt(r)*8n)-1n:typeof e=="number"&&(i=BigInt(Number.MAX_SAFE_INTEGER));let s=typeof i=="bigint"&&n?-i-1n:0;if(i&&o>i||o<s){let u=typeof e=="bigint"?"n":"";throw new nt({max:i?`${i}${u}`:void 0,min:`${s}${u}`,signed:n,size:r,value:`${e}${u}`})}let a=`0x${(n&&o<0?(1n<<BigInt(r*8))+BigInt(o):o).toString(16)}`;return r?U(a,{size:r}):a}var ro=new TextEncoder;function _t(e,t={}){let n=ro.encode(e);return P(n,t)}var oo=new TextEncoder;function st(e,t={}){return typeof e=="number"||typeof e=="bigint"?io(e,t):typeof e=="boolean"?so(e,t):A(e)?it(e,t):Gt(e,t)}function so(e,t={}){let n=new Uint8Array(1);return n[0]=Number(e),typeof t.size=="number"?(v(n,{size:t.size}),U(n,{size:t.size})):n}var k={zero:48,nine:57,A:65,F:70,a:97,f:102};function Kn(e){if(e>=k.zero&&e<=k.nine)return e-k.zero;if(e>=k.A&&e<=k.F)return e-(k.A-10);if(e>=k.a&&e<=k.f)return e-(k.a-10)}function it(e,t={}){let n=e;t.size&&(v(n,{size:t.size}),n=U(n,{dir:"right",size:t.size}));let r=n.slice(2);r.length%2&&(r=`0${r}`);let o=r.length/2,i=new Uint8Array(o);for(let s=0,a=0;s<o;s++){let u=Kn(r.charCodeAt(a++)),p=Kn(r.charCodeAt(a++));if(u===void 0||p===void 0)throw new c(`Invalid byte sequence ("${r[a-2]}${r[a-1]}" in "${r}").`);i[s]=u*16+p}return i}function io(e,t){let n=y(e,t);return it(n)}function Gt(e,t={}){let n=oo.encode(e);return typeof t.size=="number"?(v(n,{size:t.size}),U(n,{dir:"right",size:t.size})):n}var at=BigInt(4294967295),Xn=BigInt(32);function ao(e,t=!1){return t?{h:Number(e&at),l:Number(e>>Xn&at)}:{h:Number(e>>Xn&at)|0,l:Number(e&at)|0}}function Jn(e,t=!1){let n=new Uint32Array(e.length),r=new Uint32Array(e.length);for(let o=0;o<e.length;o++){let{h:i,l:s}=ao(e[o],t);[n[o],r[o]]=[i,s]}return[n,r]}var Yn=(e,t,n)=>e<<n|t>>>32-n,qn=(e,t,n)=>t<<n|e>>>32-n,Qn=(e,t,n)=>t<<n-32|e>>>64-n,er=(e,t,n)=>e<<n-32|t>>>64-n;var rr=[],or=[],sr=[],uo=BigInt(0),he=BigInt(1),co=BigInt(2),po=BigInt(7),fo=BigInt(256),mo=BigInt(113);for(let e=0,t=he,n=1,r=0;e<24;e++){[n,r]=[r,(2*n+3*r)%5],rr.push(2*(5*r+n)),or.push((e+1)*(e+2)/2%64);let o=uo;for(let i=0;i<7;i++)t=(t<<he^(t>>po)*mo)%fo,t&co&&(o^=he<<(he<<BigInt(i))-he);sr.push(o)}var[lo,yo]=Jn(sr,!0),tr=(e,t,n)=>n>32?Qn(e,t,n):Yn(e,t,n),nr=(e,t,n)=>n>32?er(e,t,n):qn(e,t,n);function bo(e,t=24){let n=new Uint32Array(10);for(let r=24-t;r<24;r++){for(let s=0;s<10;s++)n[s]=e[s]^e[s+10]^e[s+20]^e[s+30]^e[s+40];for(let s=0;s<10;s+=2){let a=(s+8)%10,u=(s+2)%10,p=n[u],d=n[u+1],f=tr(p,d,1)^n[a],l=nr(p,d,1)^n[a+1];for(let m=0;m<50;m+=10)e[s+m]^=f,e[s+m+1]^=l}let o=e[2],i=e[3];for(let s=0;s<24;s++){let a=or[s],u=tr(o,i,a),p=nr(o,i,a),d=rr[s];o=e[d],i=e[d+1],e[d]=u,e[d+1]=p}for(let s=0;s<50;s+=10){for(let a=0;a<10;a++)n[a]=e[s+a];for(let a=0;a<10;a++)e[s+a]^=~n[(a+2)%10]&n[(a+4)%10]}e[0]^=lo[r],e[1]^=yo[r]}n.fill(0)}var ut=class e extends dn{constructor(t,n,r,o=!1,i=24){if(super(),this.blockLen=t,this.suffix=n,this.outputLen=r,this.enableXOF=o,this.rounds=i,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,Tt(r),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=cn(this.state)}keccak(){kt||zt(this.state32),bo(this.state32,this.rounds),kt||zt(this.state32),this.posOut=0,this.pos=0}update(t){Bt(this);let{blockLen:n,state:r}=this;t=pn(t);let o=t.length;for(let i=0;i<o;){let s=Math.min(n-this.pos,o-i);for(let a=0;a<s;a++)r[this.pos++]^=t[i++];this.pos===n&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;let{state:t,suffix:n,pos:r,blockLen:o}=this;t[r]^=n,n&128&&r===o-1&&this.keccak(),t[o-1]^=128,this.keccak()}writeInto(t){Bt(this,!1),an(t),this.finish();let n=this.state,{blockLen:r}=this;for(let o=0,i=t.length;o<i;){this.posOut>=r&&this.keccak();let s=Math.min(r-this.posOut,i-o);t.set(n.subarray(this.posOut,this.posOut+s),o),this.posOut+=s,o+=s}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return Tt(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(un(t,this),this.finished)throw new Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(t){let{blockLen:n,suffix:r,outputLen:o,rounds:i,enableXOF:s}=this;return t||(t=new e(n,r,o,s,i)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=i,t.suffix=r,t.outputLen=o,t.enableXOF=s,t.destroyed=this.destroyed,t}},F=(e,t,n)=>fn(()=>new ut(t,e,n)),Ri=F(6,144,224/8),ji=F(6,136,256/8),Ui=F(6,104,384/8),Fi=F(6,72,512/8),Li=F(1,144,224/8),ir=F(1,136,256/8),Di=F(1,104,384/8),Ni=F(1,72,512/8),ar=(e,t,n)=>mn((r={})=>new ut(t,e,r.dkLen===void 0?n:r.dkLen,!0)),Hi=ar(31,168,128/8),_i=ar(31,136,256/8);function ct(e,t){let n=t||"hex",r=ir(A(e,{strict:!1})?st(e):e);return n==="bytes"?r:Zn(r)}var ho=e=>ct(st(e));function ur(e){return ho(e)}function cr(e){let t=!0,n="",r=0,o="",i=!1;for(let s=0;s<e.length;s++){let a=e[s];if(["(",")",","].includes(a)&&(t=!0),a==="("&&r++,a===")"&&r--,!!t){if(r===0){if(a===" "&&["event","function",""].includes(o))o="";else if(o+=a,a===")"){i=!0;break}continue}if(a===" "){e[s-1]!==","&&n!==","&&n!==",("&&(n="",t=!1);continue}o+=a,n+=a}}if(!i)throw new c("Unable to normalize signature.");return o}var pr=e=>{let t=typeof e=="string"?e:Rt(e);return cr(t)};function pt(e){return ur(pr(e))}var X=e=>G(pt(e),0,4);var I=class extends c{constructor({address:t}){super(`Address "${t}" is invalid.`,{metaMessages:["- Address must be a hex value of 20 bytes (40 hex characters).","- Address must match its checksum counterpart."],name:"InvalidAddressError"})}};var J=class extends Map{constructor(t){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=t}get(t){let n=super.get(t);return super.has(t)&&n!==void 0&&(this.delete(t),super.set(t,n)),n}set(t,n){if(super.set(t,n),this.maxSize&&this.size>this.maxSize){let r=this.keys().next().value;r&&this.delete(r)}return this}};var xo=/^0x[a-fA-F0-9]{40}$/,Vt=new J(8192);function w(e,t){let{strict:n=!0}=t??{},r=`${e}.${n}`;if(Vt.has(r))return Vt.get(r);let o=xo.test(e)?e.toLowerCase()===e?!0:n?dt(e)===e:!0:!1;return Vt.set(r,o),o}var Wt=new J(8192);function dt(e,t){if(Wt.has(`${e}.${t}`))return Wt.get(`${e}.${t}`);let n=t?`${t}${e.toLowerCase()}`:e.substring(2).toLowerCase(),r=ct(Gt(n),"bytes"),o=(t?n.substring(`${t}0x`.length):n).split("");for(let s=0;s<40;s+=2)r[s>>1]>>4>=8&&o[s]&&(o[s]=o[s].toUpperCase()),(r[s>>1]&15)>=8&&o[s+1]&&(o[s+1]=o[s+1].toUpperCase());let i=`0x${o.join("")}`;return Wt.set(`${e}.${t}`,i),i}var xe=class extends c{constructor({offset:t}){super(`Offset \`${t}\` cannot be negative.`,{name:"NegativeOffsetError"})}},ft=class extends c{constructor({length:t,position:n}){super(`Position \`${n}\` is out of bounds (\`0 < position < ${t}\`).`,{name:"PositionOutOfBoundsError"})}},mt=class extends c{constructor({count:t,limit:n}){super(`Recursive read limit of \`${n}\` exceeded (recursive read count: \`${t}\`).`,{name:"RecursiveReadLimitExceededError"})}};var go={bytes:new Uint8Array,dataView:new DataView(new ArrayBuffer(0)),position:0,positionReadCount:new Map,recursiveReadCount:0,recursiveReadLimit:Number.POSITIVE_INFINITY,assertReadLimit(){if(this.recursiveReadCount>=this.recursiveReadLimit)throw new mt({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(e){if(e<0||e>this.bytes.length-1)throw new ft({length:this.bytes.length,position:e})},decrementPosition(e){if(e<0)throw new xe({offset:e});let t=this.position-e;this.assertPosition(t),this.position=t},getReadCount(e){return this.positionReadCount.get(e||this.position)||0},incrementPosition(e){if(e<0)throw new xe({offset:e});let t=this.position+e;this.assertPosition(t),this.position=t},inspectByte(e){let t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectBytes(e,t){let n=t??this.position;return this.assertPosition(n+e-1),this.bytes.subarray(n,n+e)},inspectUint8(e){let t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectUint16(e){let t=e??this.position;return this.assertPosition(t+1),this.dataView.getUint16(t)},inspectUint24(e){let t=e??this.position;return this.assertPosition(t+2),(this.dataView.getUint16(t)<<8)+this.dataView.getUint8(t+2)},inspectUint32(e){let t=e??this.position;return this.assertPosition(t+3),this.dataView.getUint32(t)},pushByte(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushBytes(e){this.assertPosition(this.position+e.length-1),this.bytes.set(e,this.position),this.position+=e.length},pushUint8(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushUint16(e){this.assertPosition(this.position+1),this.dataView.setUint16(this.position,e),this.position+=2},pushUint24(e){this.assertPosition(this.position+2),this.dataView.setUint16(this.position,e>>8),this.dataView.setUint8(this.position+2,e&255),this.position+=3},pushUint32(e){this.assertPosition(this.position+3),this.dataView.setUint32(this.position,e),this.position+=4},readByte(){this.assertReadLimit(),this._touch();let e=this.inspectByte();return this.position++,e},readBytes(e,t){this.assertReadLimit(),this._touch();let n=this.inspectBytes(e);return this.position+=t??e,n},readUint8(){this.assertReadLimit(),this._touch();let e=this.inspectUint8();return this.position+=1,e},readUint16(){this.assertReadLimit(),this._touch();let e=this.inspectUint16();return this.position+=2,e},readUint24(){this.assertReadLimit(),this._touch();let e=this.inspectUint24();return this.position+=3,e},readUint32(){this.assertReadLimit(),this._touch();let e=this.inspectUint32();return this.position+=4,e},get remaining(){return this.bytes.length-this.position},setPosition(e){let t=this.position;return this.assertPosition(e),this.position=e,()=>this.position=t},_touch(){if(this.recursiveReadLimit===Number.POSITIVE_INFINITY)return;let e=this.getReadCount();this.positionReadCount.set(this.position,e+1),e>0&&this.recursiveReadCount++}};function dr(e,{recursiveReadLimit:t=8192}={}){let n=Object.create(go);return n.bytes=e,n.dataView=new DataView(e.buffer,e.byteOffset,e.byteLength),n.positionReadCount=new Map,n.recursiveReadLimit=t,n}function fr(e,t={}){typeof t.size<"u"&&v(e,{size:t.size});let n=P(e,t);return Nt(n,t)}function mr(e,t={}){let n=e;if(typeof t.size<"u"&&(v(n,{size:t.size}),n=be(n)),n.length>1||n[0]>1)throw new rt(n);return!!n[0]}function E(e,t={}){typeof t.size<"u"&&v(e,{size:t.size});let n=P(e,t);return Wn(n,t)}function lr(e,t={}){let n=e;return typeof t.size<"u"&&(v(n,{size:t.size}),n=be(n,{dir:"right"})),new TextDecoder().decode(n)}function z(e){return typeof e[0]=="string"?ge(e):wo(e)}function wo(e){let t=0;for(let o of e)t+=o.length;let n=new Uint8Array(t),r=0;for(let o of e)n.set(o,r),r+=o.length;return n}function ge(e){return`0x${e.reduce((t,n)=>t+n.replace("0x",""),"")}`}function Y(e,t){if(e.length!==t.length)throw new Xe({expectedLength:e.length,givenLength:t.length});let n=vo({params:e,values:t}),r=Kt(n);return r.length===0?"0x":r}function vo({params:e,values:t}){let n=[];for(let r=0;r<e.length;r++)n.push(Zt({param:e[r],value:t[r]}));return n}function Zt({param:e,value:t}){let n=lt(e.type);if(n){let[r,o]=n;return Ao(t,{length:r,param:{...e,type:o}})}if(e.type==="tuple")return Eo(t,{param:e});if(e.type==="address")return $o(t);if(e.type==="bool")return Io(t);if(e.type.startsWith("uint")||e.type.startsWith("int")){let r=e.type.startsWith("int");return Mo(t,{signed:r})}if(e.type.startsWith("bytes"))return Po(t,{param:e});if(e.type==="string")return So(t);throw new Qe(e.type,{docsPath:"/docs/contract/encodeAbiParameters"})}function Kt(e){let t=0;for(let i=0;i<e.length;i++){let{dynamic:s,encoded:a}=e[i];s?t+=32:t+=h(a)}let n=[],r=[],o=0;for(let i=0;i<e.length;i++){let{dynamic:s,encoded:a}=e[i];s?(n.push(y(t+o,{size:32})),r.push(a),o+=h(a)):n.push(a)}return z([...n,...r])}function $o(e){if(!w(e))throw new I({address:e});return{dynamic:!1,encoded:B(e.toLowerCase())}}function Ao(e,{length:t,param:n}){let r=t===null;if(!Array.isArray(e))throw new tt(e);if(!r&&e.length!==t)throw new Ze({expectedLength:t,givenLength:e.length,type:`${n.type}[${t}]`});let o=!1,i=[];for(let s=0;s<e.length;s++){let a=Zt({param:n,value:e[s]});a.dynamic&&(o=!0),i.push(a)}if(r||o){let s=Kt(i);if(r){let a=y(i.length,{size:32});return{dynamic:!0,encoded:i.length>0?z([a,s]):a}}if(o)return{dynamic:!0,encoded:s}}return{dynamic:!1,encoded:z(i.map(({encoded:s})=>s))}}function Po(e,{param:t}){let[,n]=t.type.split("bytes"),r=h(e);if(!n){let o=e;return r%32!==0&&(o=B(o,{dir:"right",size:Math.ceil((e.length-2)/2/32)*32})),{dynamic:!0,encoded:z([B(y(r,{size:32})),o])}}if(r!==Number.parseInt(n))throw new Ke({expectedSize:Number.parseInt(n),value:e});return{dynamic:!1,encoded:B(e,{dir:"right"})}}function Io(e){if(typeof e!="boolean")throw new c(`Invalid boolean value: "${e}" (type: ${typeof e}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:B(Ht(e))}}function Mo(e,{signed:t}){return{dynamic:!1,encoded:y(e,{size:32,signed:t})}}function So(e){let t=_t(e),n=Math.ceil(h(t)/32),r=[];for(let o=0;o<n;o++)r.push(B(G(t,o*32,(o+1)*32),{dir:"right"}));return{dynamic:!0,encoded:z([B(y(h(t),{size:32})),...r])}}function Eo(e,{param:t}){let n=!1,r=[];for(let o=0;o<t.components.length;o++){let i=t.components[o],s=Array.isArray(e)?o:i.name,a=Zt({param:i,value:e[s]});r.push(a),a.dynamic&&(n=!0)}return{dynamic:n,encoded:n?Kt(r):z(r.map(({encoded:o})=>o))}}function lt(e){let t=e.match(/^(.*)\[(\d+)?\]$/);return t?[t[2]?Number(t[2]):null,t[1]]:void 0}function yt(e,t){let n=typeof t=="string"?it(t):t,r=dr(n);if(h(n)===0&&e.length>0)throw new K;if(h(t)&&h(t)<32)throw new We({data:typeof t=="string"?t:P(t),params:e,size:h(t)});let o=0,i=[];for(let s=0;s<e.length;++s){let a=e[s];r.setPosition(o);let[u,p]=q(r,a,{staticPosition:0});o+=p,i.push(u)}return i}function q(e,t,{staticPosition:n}){let r=lt(t.type);if(r){let[o,i]=r;return Bo(e,{...t,type:i},{length:o,staticPosition:n})}if(t.type==="tuple")return Co(e,t,{staticPosition:n});if(t.type==="address")return To(e);if(t.type==="bool")return ko(e);if(t.type.startsWith("bytes"))return zo(e,t,{staticPosition:n});if(t.type.startsWith("uint")||t.type.startsWith("int"))return Oo(e,t);if(t.type==="string")return Ro(e,{staticPosition:n});throw new et(t.type,{docsPath:"/docs/contract/decodeAbiParameters"})}var yr=32,Xt=32;function To(e){let t=e.readBytes(32);return[dt(P(Dt(t,-20))),32]}function Bo(e,t,{length:n,staticPosition:r}){if(!n){let s=E(e.readBytes(Xt)),a=r+s,u=a+yr;e.setPosition(a);let p=E(e.readBytes(yr)),d=we(t),f=0,l=[];for(let m=0;m<p;++m){e.setPosition(u+(d?m*32:f));let[b,g]=q(e,t,{staticPosition:u});f+=g,l.push(b)}return e.setPosition(r+32),[l,32]}if(we(t)){let s=E(e.readBytes(Xt)),a=r+s,u=[];for(let p=0;p<n;++p){e.setPosition(a+p*32);let[d]=q(e,t,{staticPosition:a});u.push(d)}return e.setPosition(r+32),[u,32]}let o=0,i=[];for(let s=0;s<n;++s){let[a,u]=q(e,t,{staticPosition:r+o});o+=u,i.push(a)}return[i,o]}function ko(e){return[mr(e.readBytes(32),{size:32}),32]}function zo(e,t,{staticPosition:n}){let[r,o]=t.type.split("bytes");if(!o){let s=E(e.readBytes(32));e.setPosition(n+s);let a=E(e.readBytes(32));if(a===0)return e.setPosition(n+32),["0x",32];let u=e.readBytes(a);return e.setPosition(n+32),[P(u),32]}return[P(e.readBytes(Number.parseInt(o),32)),32]}function Oo(e,t){let n=t.type.startsWith("int"),r=Number.parseInt(t.type.split("int")[1]||"256"),o=e.readBytes(32);return[r>48?fr(o,{signed:n}):E(o,{signed:n}),32]}function Co(e,t,{staticPosition:n}){let r=t.components.length===0||t.components.some(({name:s})=>!s),o=r?[]:{},i=0;if(we(t)){let s=E(e.readBytes(Xt)),a=n+s;for(let u=0;u<t.components.length;++u){let p=t.components[u];e.setPosition(a+i);let[d,f]=q(e,p,{staticPosition:a});i+=f,o[r?u:p?.name]=d}return e.setPosition(n+32),[o,32]}for(let s=0;s<t.components.length;++s){let a=t.components[s],[u,p]=q(e,a,{staticPosition:n});o[r?s:a?.name]=u,i+=p}return[o,i]}function Ro(e,{staticPosition:t}){let n=E(e.readBytes(32)),r=t+n;e.setPosition(r);let o=E(e.readBytes(32));if(o===0)return e.setPosition(t+32),["",32];let i=e.readBytes(o,32),s=lr(be(i));return e.setPosition(t+32),[s,32]}function we(e){let{type:t}=e;if(t==="string"||t==="bytes"||t.endsWith("[]"))return!0;if(t==="tuple")return e.components?.some(we);let n=lt(e.type);return!!(n&&we({...e,type:n[1]}))}function br(e){let{abi:t,data:n}=e,r=G(n,0,4);if(r==="0x")throw new K;let i=[...t||[],Hn,_n].find(s=>s.type==="error"&&r===X(_(s)));if(!i)throw new Je(r,{docsPath:"/docs/contract/decodeErrorResult"});return{abiItem:i,args:"inputs"in i&&i.inputs&&i.inputs.length>0?yt(i.inputs,G(n,4)):void 0,errorName:i.name}}var Q=(e,t,n)=>JSON.stringify(e,(r,o)=>{let i=typeof o=="bigint"?o.toString():o;return typeof t=="function"?t(r,i):i},n);var hr=pt;function bt(e){let{abi:t,args:n=[],name:r}=e,o=A(r,{strict:!1}),i=t.filter(a=>o?a.type==="function"?X(a)===r:a.type==="event"?hr(a)===r:!1:"name"in a&&a.name===r);if(i.length===0)return;if(i.length===1)return i[0];let s;for(let a of i){if(!("inputs"in a))continue;if(!n||n.length===0){if(!a.inputs||a.inputs.length===0)return a;continue}if(!a.inputs||a.inputs.length===0||a.inputs.length!==n.length)continue;if(n.every((p,d)=>{let f="inputs"in a&&a.inputs[d];return f?Jt(p,f):!1})){if(s&&"inputs"in s&&s.inputs){let p=xr(a.inputs,s.inputs,n);if(p)throw new qe({abiItem:a,type:p[0]},{abiItem:s,type:p[1]})}s=a}}return s||i[0]}function Jt(e,t){let n=typeof e,r=t.type;switch(r){case"address":return w(e,{strict:!1});case"bool":return n==="boolean";case"function":return n==="string";case"string":return n==="string";default:return r==="tuple"&&"components"in t?Object.values(t.components).every((o,i)=>Jt(Object.values(e)[i],o)):/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/.test(r)?n==="number"||n==="bigint":/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(r)?n==="string"||e instanceof Uint8Array:/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(r)?Array.isArray(e)&&e.every(o=>Jt(o,{...t,type:r.replace(/(\[[0-9]{0,}\])$/,"")})):!1}}function xr(e,t,n){for(let r in e){let o=e[r],i=t[r];if(o.type==="tuple"&&i.type==="tuple"&&"components"in o&&"components"in i)return xr(o.components,i.components,n[r]);let s=[o.type,i.type];if(s.includes("address")&&s.includes("bytes20")?!0:s.includes("address")&&s.includes("string")?w(n[r],{strict:!1}):s.includes("address")&&s.includes("bytes")?w(n[r],{strict:!1}):!1)return s}}var gr={gwei:9,wei:18},wr={ether:-9,wei:9};function ht(e,t){let n=e.toString(),r=n.startsWith("-");r&&(n=n.slice(1)),n=n.padStart(t,"0");let[o,i]=[n.slice(0,n.length-t),n.slice(n.length-t)];return i=i.replace(/(0+)$/,""),`${r?"-":""}${o||"0"}${i?`.${i}`:""}`}function vr(e,t="wei"){return ht(e,gr[t])}function O(e,t="wei"){return ht(e,wr[t])}var xt=class extends c{constructor({address:t}){super(`State for account "${t}" is set multiple times.`,{name:"AccountStateConflictError"})}},gt=class extends c{constructor(){super("state and stateDiff are set on the same account.",{name:"StateAssignmentConflictError"})}};function $r(e){return e.reduce((t,{slot:n,value:r})=>`${t} ${n}: ${r}
16
+ `,"")}function Ar(e){return e.reduce((t,{address:n,...r})=>{let o=`${t} ${n}:
17
+ `;return r.nonce&&(o+=` nonce: ${r.nonce}
18
+ `),r.balance&&(o+=` balance: ${r.balance}
19
+ `),r.code&&(o+=` code: ${r.code}
20
+ `),r.state&&(o+=` state:
21
+ `,o+=$r(r.state)),r.stateDiff&&(o+=` stateDiff:
22
+ `,o+=$r(r.stateDiff)),o},` State Override:
23
+ `).slice(0,-1)}function Pr(e){let t=Object.entries(e).map(([r,o])=>o===void 0||o===!1?null:[r,o]).filter(Boolean),n=t.reduce((r,[o])=>Math.max(r,o.length),0);return t.map(([r,o])=>` ${`${r}:`.padEnd(n+1)} ${o}`).join(`
24
+ `)}var wt=class extends c{constructor(){super(["Cannot specify both a `gasPrice` and a `maxFeePerGas`/`maxPriorityFeePerGas`.","Use `maxFeePerGas`/`maxPriorityFeePerGas` for EIP-1559 compatible networks, and `gasPrice` for others."].join(`
25
+ `),{name:"FeeConflictError"})}};var ve=e=>e;var vt=class extends c{constructor(t,{account:n,docsPath:r,chain:o,data:i,gas:s,gasPrice:a,maxFeePerGas:u,maxPriorityFeePerGas:p,nonce:d,to:f,value:l,stateOverride:m}){let b=n?Z(n):void 0,g=Pr({from:b?.address,to:f,value:typeof l<"u"&&`${vr(l)} ${o?.nativeCurrency?.symbol||"ETH"}`,data:i,gas:s,gasPrice:typeof a<"u"&&`${O(a)} gwei`,maxFeePerGas:typeof u<"u"&&`${O(u)} gwei`,maxPriorityFeePerGas:typeof p<"u"&&`${O(p)} gwei`,nonce:d});m&&(g+=`
26
+ ${Ar(m)}`),super(t.shortMessage,{cause:t,docsPath:r,metaMessages:[...t.metaMessages?[...t.metaMessages," "]:[],"Raw Call Arguments:",g].filter(Boolean),name:"CallExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=t}};var $t=class extends c{constructor({factory:t}){super(`Deployment for counterfactual contract call failed${t?` for factory "${t}".`:""}`,{metaMessages:["Please ensure:","- The `factory` is a valid contract deployment factory (ie. Create2 Factory, ERC-4337 Factory, etc).","- The `factoryData` is a valid encoded function call for contract deployment function on the factory."],name:"CounterfactualDeploymentFailedError"})}},At=class extends c{constructor({data:t,message:n}){super(n||"",{name:"RawContractError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:3}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=t}};var Yt="/docs/contract/decodeFunctionResult";function Ir(e){let{abi:t,args:n,functionName:r,data:o}=e,i=t[0];if(r){let a=bt({abi:t,args:n,name:r});if(!a)throw new j(r,{docsPath:Yt});i=a}if(i.type!=="function")throw new j(void 0,{docsPath:Yt});if(!i.outputs)throw new Ye(i.name,{docsPath:Yt});let s=yt(i.outputs,o);if(s&&s.length>1)return s;if(s&&s.length===1)return s[0]}var qt="/docs/contract/encodeDeployData";function Qt(e){let{abi:t,args:n,bytecode:r}=e;if(!n||n.length===0)return r;let o=t.find(s=>"type"in s&&s.type==="constructor");if(!o)throw new Ve({docsPath:qt});if(!("inputs"in o))throw new fe({docsPath:qt});if(!o.inputs||o.inputs.length===0)throw new fe({docsPath:qt});let i=Y(o.inputs,n);return ge([r,i])}var Mr="/docs/contract/encodeFunctionData";function Sr(e){let{abi:t,args:n,functionName:r}=e,o=t[0];if(r){let i=bt({abi:t,args:n,name:r});if(!i)throw new j(r,{docsPath:Mr});o=i}if(o.type!=="function")throw new j(void 0,{docsPath:Mr});return{abi:[o],functionName:X(_(o))}}function Er(e){let{args:t}=e,{abi:n,functionName:r}=e.abi.length===1&&e.functionName?.startsWith("0x")?e:Sr(e),o=n[0],i=r,s="inputs"in o&&o.inputs?Y(o.inputs,t??[]):void 0;return ge([i,s??"0x"])}function Tr({blockNumber:e,chain:t,contract:n}){let r=t?.contracts?.[n];if(!r)throw new H({chain:t,contract:{name:n}});if(e&&r.blockCreated&&r.blockCreated>e)throw new H({blockNumber:e,chain:t,contract:{name:n,blockCreated:r.blockCreated}});return r.address}var C=class extends c{constructor({cause:t,message:n}={}){let r=n?.replace("execution reverted: ","")?.replace("execution reverted","");super(`Execution reverted ${r?`with reason: ${r}`:"for an unknown reason"}.`,{cause:t,name:"ExecutionRevertedError"})}};Object.defineProperty(C,"code",{enumerable:!0,configurable:!0,writable:!0,value:3});Object.defineProperty(C,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/execution reverted/});var L=class extends c{constructor({cause:t,maxFeePerGas:n}={}){super(`The fee cap (\`maxFeePerGas\`${n?` = ${O(n)} gwei`:""}) cannot be higher than the maximum allowed value (2^256-1).`,{cause:t,name:"FeeCapTooHighError"})}};Object.defineProperty(L,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas higher than 2\^256-1|fee cap higher than 2\^256-1/});var ee=class extends c{constructor({cause:t,maxFeePerGas:n}={}){super(`The fee cap (\`maxFeePerGas\`${n?` = ${O(n)}`:""} gwei) cannot be lower than the block base fee.`,{cause:t,name:"FeeCapTooLowError"})}};Object.defineProperty(ee,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas less than block base fee|fee cap less than block base fee|transaction is outdated/});var te=class extends c{constructor({cause:t,nonce:n}={}){super(`Nonce provided for the transaction ${n?`(${n}) `:""}is higher than the next one expected.`,{cause:t,name:"NonceTooHighError"})}};Object.defineProperty(te,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too high/});var ne=class extends c{constructor({cause:t,nonce:n}={}){super([`Nonce provided for the transaction ${n?`(${n}) `:""}is lower than the current nonce of the account.`,"Try increasing the nonce or find the latest nonce with `getTransactionCount`."].join(`
27
+ `),{cause:t,name:"NonceTooLowError"})}};Object.defineProperty(ne,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too low|transaction already imported|already known/});var re=class extends c{constructor({cause:t,nonce:n}={}){super(`Nonce provided for the transaction ${n?`(${n}) `:""}exceeds the maximum allowed nonce.`,{cause:t,name:"NonceMaxValueError"})}};Object.defineProperty(re,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce has max value/});var oe=class extends c{constructor({cause:t}={}){super(["The total cost (gas * gas fee + value) of executing this transaction exceeds the balance of the account."].join(`
28
+ `),{cause:t,metaMessages:["This error could arise when the account does not have enough funds to:"," - pay for the total gas fee,"," - pay for the value to send."," ","The cost of the transaction is calculated as `gas * gas fee + value`, where:"," - `gas` is the amount of gas needed for transaction to execute,"," - `gas fee` is the gas fee,"," - `value` is the amount of ether to send to the recipient."],name:"InsufficientFundsError"})}};Object.defineProperty(oe,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/insufficient funds|exceeds transaction sender account balance/});var se=class extends c{constructor({cause:t,gas:n}={}){super(`The amount of gas ${n?`(${n}) `:""}provided for the transaction exceeds the limit allowed for the block.`,{cause:t,name:"IntrinsicGasTooHighError"})}};Object.defineProperty(se,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too high|gas limit reached/});var ie=class extends c{constructor({cause:t,gas:n}={}){super(`The amount of gas ${n?`(${n}) `:""}provided for the transaction is too low.`,{cause:t,name:"IntrinsicGasTooLowError"})}};Object.defineProperty(ie,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too low/});var ae=class extends c{constructor({cause:t}){super("The transaction type is not supported for this chain.",{cause:t,name:"TransactionTypeNotSupportedError"})}};Object.defineProperty(ae,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/transaction type not valid/});var D=class extends c{constructor({cause:t,maxPriorityFeePerGas:n,maxFeePerGas:r}={}){super([`The provided tip (\`maxPriorityFeePerGas\`${n?` = ${O(n)} gwei`:""}) cannot be higher than the fee cap (\`maxFeePerGas\`${r?` = ${O(r)} gwei`:""}).`].join(`
29
+ `),{cause:t,name:"TipAboveFeeCapError"})}};Object.defineProperty(D,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max priority fee per gas higher than max fee per gas|tip higher than fee cap/});var ue=class extends c{constructor({cause:t}){super(`An error occurred while executing: ${t?.shortMessage}`,{cause:t,name:"UnknownNodeError"})}};var $e=class extends c{constructor({body:t,cause:n,details:r,headers:o,status:i,url:s}){super("HTTP request failed.",{cause:n,details:r,metaMessages:[i&&`Status: ${i}`,`URL: ${ve(s)}`,t&&`Request body: ${Q(t)}`].filter(Boolean),name:"HttpRequestError"}),Object.defineProperty(this,"body",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"headers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"status",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.body=t,this.headers=o,this.status=i,this.url=s}};function Br(e,t){let n=(e.details||"").toLowerCase(),r=e instanceof c?e.walk(o=>o?.code===C.code):e;return r instanceof c?new C({cause:e,message:r.details}):C.nodeMessage.test(n)?new C({cause:e,message:e.details}):L.nodeMessage.test(n)?new L({cause:e,maxFeePerGas:t?.maxFeePerGas}):ee.nodeMessage.test(n)?new ee({cause:e,maxFeePerGas:t?.maxFeePerGas}):te.nodeMessage.test(n)?new te({cause:e,nonce:t?.nonce}):ne.nodeMessage.test(n)?new ne({cause:e,nonce:t?.nonce}):re.nodeMessage.test(n)?new re({cause:e,nonce:t?.nonce}):oe.nodeMessage.test(n)?new oe({cause:e}):se.nodeMessage.test(n)?new se({cause:e,gas:t?.gas}):ie.nodeMessage.test(n)?new ie({cause:e,gas:t?.gas}):ae.nodeMessage.test(n)?new ae({cause:e}):D.nodeMessage.test(n)?new D({cause:e,maxFeePerGas:t?.maxFeePerGas,maxPriorityFeePerGas:t?.maxPriorityFeePerGas}):new ue({cause:e})}function kr(e,{docsPath:t,...n}){let r=(()=>{let o=Br(e,n);return o instanceof ue?e:o})();return new vt(r,{docsPath:t,...n})}function zr(e,{format:t}){if(!t)return{};let n={};function r(i){let s=Object.keys(i);for(let a of s)a in e&&(n[a]=e[a]),i[a]&&typeof i[a]=="object"&&!Array.isArray(i[a])&&r(i[a])}let o=t(e||{});return r(o),n}var jo={legacy:"0x0",eip2930:"0x1",eip1559:"0x2",eip4844:"0x3",eip7702:"0x4"};function Or(e){let t={};return typeof e.authorizationList<"u"&&(t.authorizationList=Uo(e.authorizationList)),typeof e.accessList<"u"&&(t.accessList=e.accessList),typeof e.blobVersionedHashes<"u"&&(t.blobVersionedHashes=e.blobVersionedHashes),typeof e.blobs<"u"&&(typeof e.blobs[0]!="string"?t.blobs=e.blobs.map(n=>P(n)):t.blobs=e.blobs),typeof e.data<"u"&&(t.data=e.data),typeof e.from<"u"&&(t.from=e.from),typeof e.gas<"u"&&(t.gas=y(e.gas)),typeof e.gasPrice<"u"&&(t.gasPrice=y(e.gasPrice)),typeof e.maxFeePerBlobGas<"u"&&(t.maxFeePerBlobGas=y(e.maxFeePerBlobGas)),typeof e.maxFeePerGas<"u"&&(t.maxFeePerGas=y(e.maxFeePerGas)),typeof e.maxPriorityFeePerGas<"u"&&(t.maxPriorityFeePerGas=y(e.maxPriorityFeePerGas)),typeof e.nonce<"u"&&(t.nonce=y(e.nonce)),typeof e.to<"u"&&(t.to=e.to),typeof e.type<"u"&&(t.type=jo[e.type]),typeof e.value<"u"&&(t.value=y(e.value)),t}function Uo(e){return e.map(t=>({address:t.contractAddress,r:t.r,s:t.s,chainId:y(t.chainId),nonce:y(t.nonce),...typeof t.yParity<"u"?{yParity:y(t.yParity)}:{},...typeof t.v<"u"&&typeof t.yParity>"u"?{v:y(t.v)}:{}}))}var en=new Map;function Cr({fn:e,id:t,shouldSplitBatch:n,wait:r=0,sort:o}){let i=async()=>{let d=u();s();let f=d.map(({args:l})=>l);f.length!==0&&e(f).then(l=>{o&&Array.isArray(l)&&l.sort(o);for(let m=0;m<d.length;m++){let{pendingPromise:b}=d[m];b.resolve?.([l[m],l])}}).catch(l=>{for(let m=0;m<d.length;m++){let{pendingPromise:b}=d[m];b.reject?.(l)}})},s=()=>en.delete(t),a=()=>u().map(({args:d})=>d),u=()=>en.get(t)||[],p=d=>en.set(t,[...u(),d]);return{flush:s,async schedule(d){let f={},l=new Promise((g,N)=>{f.resolve=g,f.reject=N});return n?.([...a(),d])&&i(),u().length>0?(p({args:d,pendingPromise:f}),l):(p({args:d,pendingPromise:f}),setTimeout(i,r),l)}}}function Rr(e){if(!(!e||e.length===0))return e.reduce((t,{slot:n,value:r})=>{if(n.length!==66)throw new ye({size:n.length,targetSize:66,type:"hex"});if(r.length!==66)throw new ye({size:r.length,targetSize:66,type:"hex"});return t[n]=r,t},{})}function Fo(e){let{balance:t,nonce:n,state:r,stateDiff:o,code:i}=e,s={};if(i!==void 0&&(s.code=i),t!==void 0&&(s.balance=y(t)),n!==void 0&&(s.nonce=y(n)),r!==void 0&&(s.state=Rr(r)),o!==void 0){if(s.state)throw new gt;s.stateDiff=Rr(o)}return s}function jr(e){if(!e)return;let t={};for(let{address:n,...r}of e){if(!w(n,{strict:!1}))throw new I({address:n});if(t[n])throw new xt({address:n});t[n]=Fo(r)}return t}var $c=2n**(8n-1n)-1n,Ac=2n**(16n-1n)-1n,Pc=2n**(24n-1n)-1n,Ic=2n**(32n-1n)-1n,Mc=2n**(40n-1n)-1n,Sc=2n**(48n-1n)-1n,Ec=2n**(56n-1n)-1n,Tc=2n**(64n-1n)-1n,Bc=2n**(72n-1n)-1n,kc=2n**(80n-1n)-1n,zc=2n**(88n-1n)-1n,Oc=2n**(96n-1n)-1n,Cc=2n**(104n-1n)-1n,Rc=2n**(112n-1n)-1n,jc=2n**(120n-1n)-1n,Uc=2n**(128n-1n)-1n,Fc=2n**(136n-1n)-1n,Lc=2n**(144n-1n)-1n,Dc=2n**(152n-1n)-1n,Nc=2n**(160n-1n)-1n,Hc=2n**(168n-1n)-1n,_c=2n**(176n-1n)-1n,Gc=2n**(184n-1n)-1n,Vc=2n**(192n-1n)-1n,Wc=2n**(200n-1n)-1n,Zc=2n**(208n-1n)-1n,Kc=2n**(216n-1n)-1n,Xc=2n**(224n-1n)-1n,Jc=2n**(232n-1n)-1n,Yc=2n**(240n-1n)-1n,qc=2n**(248n-1n)-1n,Qc=2n**(256n-1n)-1n,ep=-(2n**(8n-1n)),tp=-(2n**(16n-1n)),np=-(2n**(24n-1n)),rp=-(2n**(32n-1n)),op=-(2n**(40n-1n)),sp=-(2n**(48n-1n)),ip=-(2n**(56n-1n)),ap=-(2n**(64n-1n)),up=-(2n**(72n-1n)),cp=-(2n**(80n-1n)),pp=-(2n**(88n-1n)),dp=-(2n**(96n-1n)),fp=-(2n**(104n-1n)),mp=-(2n**(112n-1n)),lp=-(2n**(120n-1n)),yp=-(2n**(128n-1n)),bp=-(2n**(136n-1n)),hp=-(2n**(144n-1n)),xp=-(2n**(152n-1n)),gp=-(2n**(160n-1n)),wp=-(2n**(168n-1n)),vp=-(2n**(176n-1n)),$p=-(2n**(184n-1n)),Ap=-(2n**(192n-1n)),Pp=-(2n**(200n-1n)),Ip=-(2n**(208n-1n)),Mp=-(2n**(216n-1n)),Sp=-(2n**(224n-1n)),Ep=-(2n**(232n-1n)),Tp=-(2n**(240n-1n)),Bp=-(2n**(248n-1n)),kp=-(2n**(256n-1n)),zp=2n**8n-1n,Op=2n**16n-1n,Cp=2n**24n-1n,Rp=2n**32n-1n,jp=2n**40n-1n,Up=2n**48n-1n,Fp=2n**56n-1n,Lp=2n**64n-1n,Dp=2n**72n-1n,Np=2n**80n-1n,Hp=2n**88n-1n,_p=2n**96n-1n,Gp=2n**104n-1n,Vp=2n**112n-1n,Wp=2n**120n-1n,Zp=2n**128n-1n,Kp=2n**136n-1n,Xp=2n**144n-1n,Jp=2n**152n-1n,Yp=2n**160n-1n,qp=2n**168n-1n,Qp=2n**176n-1n,ed=2n**184n-1n,td=2n**192n-1n,nd=2n**200n-1n,rd=2n**208n-1n,od=2n**216n-1n,sd=2n**224n-1n,id=2n**232n-1n,ad=2n**240n-1n,ud=2n**248n-1n,Ur=2n**256n-1n;function Fr(e){let{account:t,gasPrice:n,maxFeePerGas:r,maxPriorityFeePerGas:o,to:i}=e,s=t?Z(t):void 0;if(s&&!w(s.address))throw new I({address:s.address});if(i&&!w(i))throw new I({address:i});if(typeof n<"u"&&(typeof r<"u"||typeof o<"u"))throw new wt;if(r&&r>Ur)throw new L({maxFeePerGas:r});if(o&&r&&o>r)throw new D({maxFeePerGas:r,maxPriorityFeePerGas:o})}async function Lr(e,t){let{account:n=e.account,batch:r=!!e.batch?.multicall,blockNumber:o,blockTag:i="latest",accessList:s,blobs:a,code:u,data:p,factory:d,factoryData:f,gas:l,gasPrice:m,maxFeePerBlobGas:b,maxFeePerGas:g,maxPriorityFeePerGas:N,nonce:ce,to:S,value:Ae,stateOverride:Nr,...Hr}=t,tn=n?Z(n):void 0;if(u&&(d||f))throw new c("Cannot provide both `code` & `factory`/`factoryData` as parameters.");if(u&&S)throw new c("Cannot provide both `code` & `to` as parameters.");let nn=u&&p,rn=d&&f&&S&&p,on=nn||rn,_r=nn?No({code:u,data:p}):rn?Ho({data:p,factory:d,factoryData:f,to:S}):p;try{Fr(t);let V=(o?y(o):void 0)||i,pe=jr(Nr),Pe=e.chain?.formatters?.transactionRequest?.format,Ie=(Pe||Or)({...zr(Hr,{format:Pe}),from:tn?.address,accessList:s,blobs:a,data:_r,gas:l,gasPrice:m,maxFeePerBlobGas:b,maxFeePerGas:g,maxPriorityFeePerGas:N,nonce:ce,to:on?void 0:S,value:Ae});if(r&&Lo({request:Ie})&&!pe)try{return await Do(e,{...Ie,blockNumber:o,blockTag:i})}catch(Et){if(!(Et instanceof de)&&!(Et instanceof H))throw Et}let sn=await e.request({method:"eth_call",params:pe?[Ie,V,pe]:[Ie,V]});return sn==="0x"?{data:void 0}:{data:sn}}catch(St){let V=_o(St),{offchainLookup:pe,offchainLookupSignature:Pe}=await import("./ccip-YAWUVTAX.js");if(e.ccipRead!==!1&&V?.slice(0,10)===Pe&&S)return{data:await pe(e,{data:V,to:S})};throw on&&V?.slice(0,10)==="0x101bb98d"?new $t({factory:d}):kr(St,{...t,account:tn,chain:e.chain})}}function Lo({request:e}){let{data:t,to:n,...r}=e;return!(!t||t.startsWith(Fn)||!n||Object.values(r).filter(o=>typeof o<"u").length>0)}async function Do(e,t){let{batchSize:n=1024,wait:r=0}=typeof e.batch?.multicall=="object"?e.batch.multicall:{},{blockNumber:o,blockTag:i="latest",data:s,multicallAddress:a,to:u}=t,p=a;if(!p){if(!e.chain)throw new de;p=Tr({blockNumber:o,chain:e.chain,contract:"multicall3"})}let f=(o?y(o):void 0)||i,{schedule:l}=Cr({id:`${e.uid}.${f}`,wait:r,shouldSplitBatch(g){return g.reduce((ce,{data:S})=>ce+(S.length-2),0)>n*2},fn:async g=>{let N=g.map(Ae=>({allowFailure:!0,callData:Ae.data,target:Ae.to})),ce=Er({abi:Ut,args:[N],functionName:"aggregate3"}),S=await e.request({method:"eth_call",params:[{data:ce,to:p},f]});return Ir({abi:Ut,args:[N],functionName:"aggregate3",data:S||"0x"})}}),[{returnData:m,success:b}]=await l({data:s,to:u});if(!b)throw new At({data:m});return m==="0x"?{data:void 0}:{data:m}}function No(e){let{code:t,data:n}=e;return Qt({abi:He(["constructor(bytes, bytes)"]),bytecode:Ln,args:[t,n]})}function Ho(e){let{data:t,factory:n,factoryData:r,to:o}=e;return Qt({abi:He(["constructor(address, bytes, address, bytes)"]),bytecode:Dn,args:[o,t,n,r]})}function _o(e){if(!(e instanceof c))return;let t=e.walk();return typeof t?.data=="object"?t.data?.data:t.data}var Pt=class extends c{constructor({callbackSelector:t,cause:n,data:r,extraData:o,sender:i,urls:s}){super(n.shortMessage||"An error occurred while fetching for an offchain result.",{cause:n,metaMessages:[...n.metaMessages||[],n.metaMessages?.length?"":[],"Offchain Gateway Call:",s&&[" Gateway URL(s):",...s.map(a=>` ${ve(a)}`)],` Sender: ${i}`,` Data: ${r}`,` Callback selector: ${t}`,` Extra data: ${o}`].flat(),name:"OffchainLookupError"})}},It=class extends c{constructor({result:t,url:n}){super("Offchain gateway response is malformed. Response data must be a hex value.",{metaMessages:[`Gateway URL: ${ve(n)}`,`Response: ${Q(t)}`],name:"OffchainLookupResponseMalformedError"})}},Mt=class extends c{constructor({sender:t,to:n}){super("Reverted sender address does not match target contract address (`to`).",{metaMessages:[`Contract address: ${n}`,`OffchainLookup sender address: ${t}`],name:"OffchainLookupSenderMismatchError"})}};function Dr(e,t){if(!w(e,{strict:!1}))throw new I({address:e});if(!w(t,{strict:!1}))throw new I({address:t});return e.toLowerCase()===t.toLowerCase()}var Qd="0x556f1830",Go={name:"OffchainLookup",type:"error",inputs:[{name:"sender",type:"address"},{name:"urls",type:"string[]"},{name:"callData",type:"bytes"},{name:"callbackFunction",type:"bytes4"},{name:"extraData",type:"bytes"}]};async function e0(e,{blockNumber:t,blockTag:n,data:r,to:o}){let{args:i}=br({data:r,abi:[Go]}),[s,a,u,p,d]=i,{ccipRead:f}=e,l=f&&typeof f?.request=="function"?f.request:Vo;try{if(!Dr(o,s))throw new Mt({sender:s,to:o});let m=await l({data:u,sender:s,urls:a}),{data:b}=await Lr(e,{blockNumber:t,blockTag:n,data:z([p,Y([{type:"bytes"},{type:"bytes"}],[m,d])]),to:o});return b}catch(m){throw new Pt({callbackSelector:p,cause:m,data:r,extraData:d,sender:s,urls:a})}}async function Vo({data:e,sender:t,urls:n}){let r=new Error("An unknown error occurred.");for(let o=0;o<n.length;o++){let i=n[o],s=i.includes("{data}")?"GET":"POST",a=s==="POST"?{data:e,sender:t}:void 0;try{let u=await fetch(i.replace("{sender}",t).replace("{data}",e),{body:JSON.stringify(a),method:s}),p;if(u.headers.get("Content-Type")?.startsWith("application/json")?p=(await u.json()).data:p=await u.text(),!u.ok){r=new $e({body:a,details:p?.error?Q(p.error):u.statusText,headers:u.headers,status:u.status,url:i});continue}if(!A(p)){r=new It({result:p,url:i});continue}return p}catch(u){r=new $e({body:a,details:u.message,url:i})}}throw r}export{_t as a,Y as b,Qd as c,Go as d,e0 as e,Vo as f};
30
+ //# sourceMappingURL=chunk-GSBUANUZ.js.map