@diwantanushh/rapiddex-contracts 1.0.0

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 (1196) hide show
  1. package/lib/openzeppelin-contracts/contracts/drafts/IERC20Permit.sol +14 -0
  2. package/lib/openzeppelin-contracts/contracts/token/ERC20/IERC20.sol +14 -0
  3. package/lib/openzeppelin-contracts/contracts/token/ERC721/ERC721.sol +227 -0
  4. package/lib/openzeppelin-contracts/contracts/token/ERC721/IERC721.sol +20 -0
  5. package/lib/openzeppelin-contracts/contracts/token/ERC721/IERC721Enumerable.sol +10 -0
  6. package/lib/openzeppelin-contracts/contracts/token/ERC721/IERC721Metadata.sol +10 -0
  7. package/lib/openzeppelin-contracts/contracts/token/ERC721/IERC721Receiver.sol +8 -0
  8. package/lib/openzeppelin-contracts/contracts/utils/Address.sol +12 -0
  9. package/lib/openzeppelin-contracts/contracts/utils/Context.sol +8 -0
  10. package/lib/openzeppelin-contracts/contracts/utils/introspection/ERC165.sol +10 -0
  11. package/lib/openzeppelin-contracts/contracts/utils/introspection/IERC165.sol +6 -0
  12. package/lib/openzeppelin-contracts-master/.changeset/better-tires-pull.md +5 -0
  13. package/lib/openzeppelin-contracts-master/.changeset/blue-jars-lay.md +5 -0
  14. package/lib/openzeppelin-contracts-master/.changeset/bright-cooks-brush.md +5 -0
  15. package/lib/openzeppelin-contracts-master/.changeset/chatty-dryers-joke.md +5 -0
  16. package/lib/openzeppelin-contracts-master/.changeset/config.json +12 -0
  17. package/lib/openzeppelin-contracts-master/.changeset/cool-clocks-tick.md +5 -0
  18. package/lib/openzeppelin-contracts-master/.changeset/curly-pandas-flow.md +5 -0
  19. package/lib/openzeppelin-contracts-master/.changeset/flat-flies-hear.md +5 -0
  20. package/lib/openzeppelin-contracts-master/.changeset/floppy-symbols-burn.md +5 -0
  21. package/lib/openzeppelin-contracts-master/.changeset/fruity-coats-smash.md +5 -0
  22. package/lib/openzeppelin-contracts-master/.changeset/gentle-apples-dance.md +5 -0
  23. package/lib/openzeppelin-contracts-master/.changeset/happy-pants-decide.md +5 -0
  24. package/lib/openzeppelin-contracts-master/.changeset/heavy-pots-reply.md +5 -0
  25. package/lib/openzeppelin-contracts-master/.changeset/legal-cameras-sin.md +5 -0
  26. package/lib/openzeppelin-contracts-master/.changeset/rare-bushes-march.md +5 -0
  27. package/lib/openzeppelin-contracts-master/.changeset/red-gifts-appear.md +5 -0
  28. package/lib/openzeppelin-contracts-master/.changeset/silver-falcons-lay.md +5 -0
  29. package/lib/openzeppelin-contracts-master/.changeset/smooth-cows-notice.md +5 -0
  30. package/lib/openzeppelin-contracts-master/.changeset/some-dolls-shine.md +5 -0
  31. package/lib/openzeppelin-contracts-master/.changeset/spicy-seals-bake.md +5 -0
  32. package/lib/openzeppelin-contracts-master/.changeset/sweet-houses-cheer.md +5 -0
  33. package/lib/openzeppelin-contracts-master/.changeset/swift-trees-build.md +5 -0
  34. package/lib/openzeppelin-contracts-master/.changeset/tame-rules-run.md +5 -0
  35. package/lib/openzeppelin-contracts-master/.changeset/tangy-jokes-begin.md +5 -0
  36. package/lib/openzeppelin-contracts-master/.changeset/tidy-turkeys-build.md +5 -0
  37. package/lib/openzeppelin-contracts-master/.codecov.yml +16 -0
  38. package/lib/openzeppelin-contracts-master/.editorconfig +21 -0
  39. package/lib/openzeppelin-contracts-master/.gitattributes +3 -0
  40. package/lib/openzeppelin-contracts-master/.github/CODEOWNERS +10 -0
  41. package/lib/openzeppelin-contracts-master/.github/ISSUE_TEMPLATE/bug_report.md +21 -0
  42. package/lib/openzeppelin-contracts-master/.github/ISSUE_TEMPLATE/config.yml +4 -0
  43. package/lib/openzeppelin-contracts-master/.github/ISSUE_TEMPLATE/feature_request.md +14 -0
  44. package/lib/openzeppelin-contracts-master/.github/PULL_REQUEST_TEMPLATE.md +20 -0
  45. package/lib/openzeppelin-contracts-master/.github/actions/gas-compare/action.yml +51 -0
  46. package/lib/openzeppelin-contracts-master/.github/actions/setup/action.yml +108 -0
  47. package/lib/openzeppelin-contracts-master/.github/actions/storage-layout/action.yml +57 -0
  48. package/lib/openzeppelin-contracts-master/.github/workflows/actionlint.yml +18 -0
  49. package/lib/openzeppelin-contracts-master/.github/workflows/changeset.yml +28 -0
  50. package/lib/openzeppelin-contracts-master/.github/workflows/checks.yml +132 -0
  51. package/lib/openzeppelin-contracts-master/.github/workflows/docs.yml +19 -0
  52. package/lib/openzeppelin-contracts-master/.github/workflows/formal-verification.yml +63 -0
  53. package/lib/openzeppelin-contracts-master/.github/workflows/release-cycle.yml +212 -0
  54. package/lib/openzeppelin-contracts-master/.github/workflows/release-upgradeable.yml +97 -0
  55. package/lib/openzeppelin-contracts-master/.github/workflows/upgradeable.yml +35 -0
  56. package/lib/openzeppelin-contracts-master/.gitmodules +10 -0
  57. package/lib/openzeppelin-contracts-master/.husky/pre-commit +2 -0
  58. package/lib/openzeppelin-contracts-master/.mocharc.js +4 -0
  59. package/lib/openzeppelin-contracts-master/.prettierrc +15 -0
  60. package/lib/openzeppelin-contracts-master/.solcover.js +21 -0
  61. package/lib/openzeppelin-contracts-master/CHANGELOG.md +1424 -0
  62. package/lib/openzeppelin-contracts-master/CODE_OF_CONDUCT.md +73 -0
  63. package/lib/openzeppelin-contracts-master/CONTRIBUTING.md +36 -0
  64. package/lib/openzeppelin-contracts-master/FUNDING.json +10 -0
  65. package/lib/openzeppelin-contracts-master/GUIDELINES.md +170 -0
  66. package/lib/openzeppelin-contracts-master/LICENSE +22 -0
  67. package/lib/openzeppelin-contracts-master/README.md +122 -0
  68. package/lib/openzeppelin-contracts-master/RELEASING.md +45 -0
  69. package/lib/openzeppelin-contracts-master/SECURITY.md +43 -0
  70. package/lib/openzeppelin-contracts-master/audits/2017-03.md +292 -0
  71. package/lib/openzeppelin-contracts-master/audits/2018-10.pdf +0 -0
  72. package/lib/openzeppelin-contracts-master/audits/2022-10-Checkpoints.pdf +0 -0
  73. package/lib/openzeppelin-contracts-master/audits/2022-10-ERC4626.pdf +0 -0
  74. package/lib/openzeppelin-contracts-master/audits/2023-05-v4.9.pdf +0 -0
  75. package/lib/openzeppelin-contracts-master/audits/2023-10-v5.0.pdf +0 -0
  76. package/lib/openzeppelin-contracts-master/audits/2024-10-v5.1.pdf +0 -0
  77. package/lib/openzeppelin-contracts-master/audits/2024-12-v5.2.pdf +0 -0
  78. package/lib/openzeppelin-contracts-master/audits/2025-04-v5.3.pdf +0 -0
  79. package/lib/openzeppelin-contracts-master/audits/2025-07-v5.4.pdf +0 -0
  80. package/lib/openzeppelin-contracts-master/audits/2025-10-v5.5.pdf +0 -0
  81. package/lib/openzeppelin-contracts-master/audits/2025-11-RLP.pdf +0 -0
  82. package/lib/openzeppelin-contracts-master/audits/2026-02-v5.6.pdf +0 -0
  83. package/lib/openzeppelin-contracts-master/audits/README.md +24 -0
  84. package/lib/openzeppelin-contracts-master/contracts/access/AccessControl.sol +207 -0
  85. package/lib/openzeppelin-contracts-master/contracts/access/IAccessControl.sol +98 -0
  86. package/lib/openzeppelin-contracts-master/contracts/access/Ownable.sol +100 -0
  87. package/lib/openzeppelin-contracts-master/contracts/access/Ownable2Step.sol +67 -0
  88. package/lib/openzeppelin-contracts-master/contracts/access/README.adoc +45 -0
  89. package/lib/openzeppelin-contracts-master/contracts/access/extensions/AccessControlDefaultAdminRules.sol +372 -0
  90. package/lib/openzeppelin-contracts-master/contracts/access/extensions/AccessControlEnumerable.sol +81 -0
  91. package/lib/openzeppelin-contracts-master/contracts/access/extensions/IAccessControlDefaultAdminRules.sol +192 -0
  92. package/lib/openzeppelin-contracts-master/contracts/access/extensions/IAccessControlEnumerable.sol +31 -0
  93. package/lib/openzeppelin-contracts-master/contracts/access/manager/AccessManaged.sol +112 -0
  94. package/lib/openzeppelin-contracts-master/contracts/access/manager/AccessManager.sol +751 -0
  95. package/lib/openzeppelin-contracts-master/contracts/access/manager/AuthorityUtils.sol +36 -0
  96. package/lib/openzeppelin-contracts-master/contracts/access/manager/IAccessManaged.sol +32 -0
  97. package/lib/openzeppelin-contracts-master/contracts/access/manager/IAccessManager.sol +404 -0
  98. package/lib/openzeppelin-contracts-master/contracts/access/manager/IAuthority.sol +14 -0
  99. package/lib/openzeppelin-contracts-master/contracts/account/Account.sol +151 -0
  100. package/lib/openzeppelin-contracts-master/contracts/account/README.adoc +30 -0
  101. package/lib/openzeppelin-contracts-master/contracts/account/extensions/draft-AccountERC7579.sol +420 -0
  102. package/lib/openzeppelin-contracts-master/contracts/account/extensions/draft-AccountERC7579Hooked.sol +171 -0
  103. package/lib/openzeppelin-contracts-master/contracts/account/extensions/draft-ERC7821.sol +70 -0
  104. package/lib/openzeppelin-contracts-master/contracts/account/utils/EIP7702Utils.sol +21 -0
  105. package/lib/openzeppelin-contracts-master/contracts/account/utils/draft-ERC4337Utils.sol +279 -0
  106. package/lib/openzeppelin-contracts-master/contracts/account/utils/draft-ERC7579Utils.sol +280 -0
  107. package/lib/openzeppelin-contracts-master/contracts/crosschain/CrosschainLinked.sol +109 -0
  108. package/lib/openzeppelin-contracts-master/contracts/crosschain/CrosschainRemoteExecutor.sol +98 -0
  109. package/lib/openzeppelin-contracts-master/contracts/crosschain/ERC7786Recipient.sol +66 -0
  110. package/lib/openzeppelin-contracts-master/contracts/crosschain/README.adoc +44 -0
  111. package/lib/openzeppelin-contracts-master/contracts/crosschain/bridges/BridgeERC1155.sol +101 -0
  112. package/lib/openzeppelin-contracts-master/contracts/crosschain/bridges/BridgeERC20.sol +37 -0
  113. package/lib/openzeppelin-contracts-master/contracts/crosschain/bridges/BridgeERC721.sol +61 -0
  114. package/lib/openzeppelin-contracts-master/contracts/crosschain/bridges/BridgeERC7802.sol +34 -0
  115. package/lib/openzeppelin-contracts-master/contracts/crosschain/bridges/abstract/BridgeFungible.sol +83 -0
  116. package/lib/openzeppelin-contracts-master/contracts/crosschain/bridges/abstract/BridgeMultiToken.sol +92 -0
  117. package/lib/openzeppelin-contracts-master/contracts/crosschain/bridges/abstract/BridgeNonFungible.sol +75 -0
  118. package/lib/openzeppelin-contracts-master/contracts/finance/README.adoc +14 -0
  119. package/lib/openzeppelin-contracts-master/contracts/finance/VestingWallet.sol +160 -0
  120. package/lib/openzeppelin-contracts-master/contracts/finance/VestingWalletCliff.sol +54 -0
  121. package/lib/openzeppelin-contracts-master/contracts/governance/Governor.sol +820 -0
  122. package/lib/openzeppelin-contracts-master/contracts/governance/IGovernor.sol +449 -0
  123. package/lib/openzeppelin-contracts-master/contracts/governance/README.adoc +201 -0
  124. package/lib/openzeppelin-contracts-master/contracts/governance/TimelockController.sol +470 -0
  125. package/lib/openzeppelin-contracts-master/contracts/governance/extensions/GovernorCountingFractional.sol +190 -0
  126. package/lib/openzeppelin-contracts-master/contracts/governance/extensions/GovernorCountingOverridable.sol +222 -0
  127. package/lib/openzeppelin-contracts-master/contracts/governance/extensions/GovernorCountingSimple.sol +96 -0
  128. package/lib/openzeppelin-contracts-master/contracts/governance/extensions/GovernorCrosschain.sol +30 -0
  129. package/lib/openzeppelin-contracts-master/contracts/governance/extensions/GovernorNoncesKeyed.sol +91 -0
  130. package/lib/openzeppelin-contracts-master/contracts/governance/extensions/GovernorPreventLateQuorum.sol +92 -0
  131. package/lib/openzeppelin-contracts-master/contracts/governance/extensions/GovernorProposalGuardian.sol +59 -0
  132. package/lib/openzeppelin-contracts-master/contracts/governance/extensions/GovernorSequentialProposalId.sol +75 -0
  133. package/lib/openzeppelin-contracts-master/contracts/governance/extensions/GovernorSettings.sol +106 -0
  134. package/lib/openzeppelin-contracts-master/contracts/governance/extensions/GovernorStorage.sol +134 -0
  135. package/lib/openzeppelin-contracts-master/contracts/governance/extensions/GovernorSuperQuorum.sol +59 -0
  136. package/lib/openzeppelin-contracts-master/contracts/governance/extensions/GovernorTimelockAccess.sol +346 -0
  137. package/lib/openzeppelin-contracts-master/contracts/governance/extensions/GovernorTimelockCompound.sol +162 -0
  138. package/lib/openzeppelin-contracts-master/contracts/governance/extensions/GovernorTimelockControl.sol +167 -0
  139. package/lib/openzeppelin-contracts-master/contracts/governance/extensions/GovernorVotes.sol +64 -0
  140. package/lib/openzeppelin-contracts-master/contracts/governance/extensions/GovernorVotesQuorumFraction.sol +113 -0
  141. package/lib/openzeppelin-contracts-master/contracts/governance/extensions/GovernorVotesSuperQuorumFraction.sol +135 -0
  142. package/lib/openzeppelin-contracts-master/contracts/governance/utils/IVotes.sol +60 -0
  143. package/lib/openzeppelin-contracts-master/contracts/governance/utils/Votes.sol +245 -0
  144. package/lib/openzeppelin-contracts-master/contracts/governance/utils/VotesExtended.sol +85 -0
  145. package/lib/openzeppelin-contracts-master/contracts/interfaces/IERC1155.sol +6 -0
  146. package/lib/openzeppelin-contracts-master/contracts/interfaces/IERC1155MetadataURI.sol +6 -0
  147. package/lib/openzeppelin-contracts-master/contracts/interfaces/IERC1155Receiver.sol +6 -0
  148. package/lib/openzeppelin-contracts-master/contracts/interfaces/IERC1271.sol +17 -0
  149. package/lib/openzeppelin-contracts-master/contracts/interfaces/IERC1363.sol +86 -0
  150. package/lib/openzeppelin-contracts-master/contracts/interfaces/IERC1363Receiver.sol +32 -0
  151. package/lib/openzeppelin-contracts-master/contracts/interfaces/IERC1363Spender.sol +26 -0
  152. package/lib/openzeppelin-contracts-master/contracts/interfaces/IERC165.sol +6 -0
  153. package/lib/openzeppelin-contracts-master/contracts/interfaces/IERC1820Implementer.sol +20 -0
  154. package/lib/openzeppelin-contracts-master/contracts/interfaces/IERC1820Registry.sol +112 -0
  155. package/lib/openzeppelin-contracts-master/contracts/interfaces/IERC1967.sol +24 -0
  156. package/lib/openzeppelin-contracts-master/contracts/interfaces/IERC20.sol +6 -0
  157. package/lib/openzeppelin-contracts-master/contracts/interfaces/IERC20Metadata.sol +6 -0
  158. package/lib/openzeppelin-contracts-master/contracts/interfaces/IERC2309.sol +19 -0
  159. package/lib/openzeppelin-contracts-master/contracts/interfaces/IERC2612.sol +8 -0
  160. package/lib/openzeppelin-contracts-master/contracts/interfaces/IERC2981.sol +26 -0
  161. package/lib/openzeppelin-contracts-master/contracts/interfaces/IERC3156.sol +7 -0
  162. package/lib/openzeppelin-contracts-master/contracts/interfaces/IERC3156FlashBorrower.sol +27 -0
  163. package/lib/openzeppelin-contracts-master/contracts/interfaces/IERC3156FlashLender.sol +41 -0
  164. package/lib/openzeppelin-contracts-master/contracts/interfaces/IERC4626.sol +230 -0
  165. package/lib/openzeppelin-contracts-master/contracts/interfaces/IERC4906.sol +20 -0
  166. package/lib/openzeppelin-contracts-master/contracts/interfaces/IERC5267.sol +28 -0
  167. package/lib/openzeppelin-contracts-master/contracts/interfaces/IERC5313.sol +16 -0
  168. package/lib/openzeppelin-contracts-master/contracts/interfaces/IERC5805.sol +9 -0
  169. package/lib/openzeppelin-contracts-master/contracts/interfaces/IERC6372.sol +17 -0
  170. package/lib/openzeppelin-contracts-master/contracts/interfaces/IERC6909.sol +125 -0
  171. package/lib/openzeppelin-contracts-master/contracts/interfaces/IERC721.sol +6 -0
  172. package/lib/openzeppelin-contracts-master/contracts/interfaces/IERC721Enumerable.sol +6 -0
  173. package/lib/openzeppelin-contracts-master/contracts/interfaces/IERC721Metadata.sol +6 -0
  174. package/lib/openzeppelin-contracts-master/contracts/interfaces/IERC721Receiver.sol +6 -0
  175. package/lib/openzeppelin-contracts-master/contracts/interfaces/IERC7751.sol +12 -0
  176. package/lib/openzeppelin-contracts-master/contracts/interfaces/IERC777.sol +200 -0
  177. package/lib/openzeppelin-contracts-master/contracts/interfaces/IERC777Recipient.sol +35 -0
  178. package/lib/openzeppelin-contracts-master/contracts/interfaces/IERC777Sender.sol +35 -0
  179. package/lib/openzeppelin-contracts-master/contracts/interfaces/IERC7913.sol +18 -0
  180. package/lib/openzeppelin-contracts-master/contracts/interfaces/README.adoc +138 -0
  181. package/lib/openzeppelin-contracts-master/contracts/interfaces/draft-IERC1822.sol +20 -0
  182. package/lib/openzeppelin-contracts-master/contracts/interfaces/draft-IERC4337.sol +255 -0
  183. package/lib/openzeppelin-contracts-master/contracts/interfaces/draft-IERC6093.sol +162 -0
  184. package/lib/openzeppelin-contracts-master/contracts/interfaces/draft-IERC7579.sol +227 -0
  185. package/lib/openzeppelin-contracts-master/contracts/interfaces/draft-IERC7674.sol +17 -0
  186. package/lib/openzeppelin-contracts-master/contracts/interfaces/draft-IERC7786.sol +64 -0
  187. package/lib/openzeppelin-contracts-master/contracts/interfaces/draft-IERC7802.sol +32 -0
  188. package/lib/openzeppelin-contracts-master/contracts/interfaces/draft-IERC7821.sol +44 -0
  189. package/lib/openzeppelin-contracts-master/contracts/metatx/ERC2771Context.sol +90 -0
  190. package/lib/openzeppelin-contracts-master/contracts/metatx/ERC2771Forwarder.sol +379 -0
  191. package/lib/openzeppelin-contracts-master/contracts/metatx/README.adoc +17 -0
  192. package/lib/openzeppelin-contracts-master/contracts/mocks/AccessManagedTarget.sol +34 -0
  193. package/lib/openzeppelin-contracts-master/contracts/mocks/AccessManagerMock.sol +20 -0
  194. package/lib/openzeppelin-contracts-master/contracts/mocks/ArraysMock.sol +171 -0
  195. package/lib/openzeppelin-contracts-master/contracts/mocks/AuthorityMock.sol +69 -0
  196. package/lib/openzeppelin-contracts-master/contracts/mocks/Base64Dirty.sol +19 -0
  197. package/lib/openzeppelin-contracts-master/contracts/mocks/BatchCaller.sol +20 -0
  198. package/lib/openzeppelin-contracts-master/contracts/mocks/CallReceiverMock.sol +107 -0
  199. package/lib/openzeppelin-contracts-master/contracts/mocks/ConstructorMock.sol +34 -0
  200. package/lib/openzeppelin-contracts-master/contracts/mocks/ContextMock.sol +35 -0
  201. package/lib/openzeppelin-contracts-master/contracts/mocks/DummyImplementation.sol +61 -0
  202. package/lib/openzeppelin-contracts-master/contracts/mocks/EIP712Verifier.sol +16 -0
  203. package/lib/openzeppelin-contracts-master/contracts/mocks/ERC1271WalletMock.sol +24 -0
  204. package/lib/openzeppelin-contracts-master/contracts/mocks/ERC165Mock.sol +100 -0
  205. package/lib/openzeppelin-contracts-master/contracts/mocks/ERC2771ContextMock.sol +28 -0
  206. package/lib/openzeppelin-contracts-master/contracts/mocks/ERC3156FlashBorrowerMock.sol +53 -0
  207. package/lib/openzeppelin-contracts-master/contracts/mocks/EtherReceiverMock.sol +17 -0
  208. package/lib/openzeppelin-contracts-master/contracts/mocks/InitializableMock.sol +130 -0
  209. package/lib/openzeppelin-contracts-master/contracts/mocks/MerkleProofCustomHashMock.sol +62 -0
  210. package/lib/openzeppelin-contracts-master/contracts/mocks/MerkleTreeMock.sol +52 -0
  211. package/lib/openzeppelin-contracts-master/contracts/mocks/MulticallHelper.sol +23 -0
  212. package/lib/openzeppelin-contracts-master/contracts/mocks/MultipleInheritanceInitializableMocks.sol +131 -0
  213. package/lib/openzeppelin-contracts-master/contracts/mocks/PausableMock.sol +31 -0
  214. package/lib/openzeppelin-contracts-master/contracts/mocks/ReentrancyAttack.sol +17 -0
  215. package/lib/openzeppelin-contracts-master/contracts/mocks/ReentrancyMock.sol +59 -0
  216. package/lib/openzeppelin-contracts-master/contracts/mocks/ReentrancyTransientMock.sol +59 -0
  217. package/lib/openzeppelin-contracts-master/contracts/mocks/RegressionImplementation.sol +61 -0
  218. package/lib/openzeppelin-contracts-master/contracts/mocks/SingleInheritanceInitializableMocks.sol +49 -0
  219. package/lib/openzeppelin-contracts-master/contracts/mocks/Stateless.sol +64 -0
  220. package/lib/openzeppelin-contracts-master/contracts/mocks/StorageSlotMock.sol +87 -0
  221. package/lib/openzeppelin-contracts-master/contracts/mocks/TimelockReentrant.sol +26 -0
  222. package/lib/openzeppelin-contracts-master/contracts/mocks/TransientSlotMock.sol +61 -0
  223. package/lib/openzeppelin-contracts-master/contracts/mocks/UpgradeableBeaconMock.sol +27 -0
  224. package/lib/openzeppelin-contracts-master/contracts/mocks/VotesExtendedMock.sol +44 -0
  225. package/lib/openzeppelin-contracts-master/contracts/mocks/VotesMock.sol +44 -0
  226. package/lib/openzeppelin-contracts-master/contracts/mocks/account/AccountMock.sol +181 -0
  227. package/lib/openzeppelin-contracts-master/contracts/mocks/account/modules/ERC7579Mock.sol +141 -0
  228. package/lib/openzeppelin-contracts-master/contracts/mocks/account/utils/ERC7579UtilsMock.sol +23 -0
  229. package/lib/openzeppelin-contracts-master/contracts/mocks/compound/CompTimelock.sol +174 -0
  230. package/lib/openzeppelin-contracts-master/contracts/mocks/crosschain/ERC7786GatewayMock.sol +56 -0
  231. package/lib/openzeppelin-contracts-master/contracts/mocks/crosschain/ERC7786RecipientMock.sol +31 -0
  232. package/lib/openzeppelin-contracts-master/contracts/mocks/docs/AccessManagerEnumerable.sol +161 -0
  233. package/lib/openzeppelin-contracts-master/contracts/mocks/docs/ERC20WithAutoMinerReward.sol +22 -0
  234. package/lib/openzeppelin-contracts-master/contracts/mocks/docs/ERC4626Fees.sol +109 -0
  235. package/lib/openzeppelin-contracts-master/contracts/mocks/docs/MyNFT.sol +9 -0
  236. package/lib/openzeppelin-contracts-master/contracts/mocks/docs/access-control/AccessControlERC20MintBase.sol +25 -0
  237. package/lib/openzeppelin-contracts-master/contracts/mocks/docs/access-control/AccessControlERC20MintMissing.sol +24 -0
  238. package/lib/openzeppelin-contracts-master/contracts/mocks/docs/access-control/AccessControlERC20MintOnlyRole.sol +23 -0
  239. package/lib/openzeppelin-contracts-master/contracts/mocks/docs/access-control/AccessControlModified.sol +14 -0
  240. package/lib/openzeppelin-contracts-master/contracts/mocks/docs/access-control/AccessManagedERC20MintBase.sol +16 -0
  241. package/lib/openzeppelin-contracts-master/contracts/mocks/docs/access-control/MyContractOwnable.sol +17 -0
  242. package/lib/openzeppelin-contracts-master/contracts/mocks/docs/account/MyAccountEIP7702.sol +20 -0
  243. package/lib/openzeppelin-contracts-master/contracts/mocks/docs/account/MyFactoryAccount.sol +37 -0
  244. package/lib/openzeppelin-contracts-master/contracts/mocks/docs/governance/MyGovernor.sol +80 -0
  245. package/lib/openzeppelin-contracts-master/contracts/mocks/docs/governance/MyToken.sol +21 -0
  246. package/lib/openzeppelin-contracts-master/contracts/mocks/docs/governance/MyTokenTimestampBased.sol +32 -0
  247. package/lib/openzeppelin-contracts-master/contracts/mocks/docs/governance/MyTokenWrapped.sol +28 -0
  248. package/lib/openzeppelin-contracts-master/contracts/mocks/docs/token/ERC1155/GameItems.sol +21 -0
  249. package/lib/openzeppelin-contracts-master/contracts/mocks/docs/token/ERC1155/MyERC115HolderContract.sol +7 -0
  250. package/lib/openzeppelin-contracts-master/contracts/mocks/docs/token/ERC20/GLDToken.sol +11 -0
  251. package/lib/openzeppelin-contracts-master/contracts/mocks/docs/token/ERC6909/ERC6909GameItems.sol +26 -0
  252. package/lib/openzeppelin-contracts-master/contracts/mocks/docs/token/ERC721/GameItem.sol +19 -0
  253. package/lib/openzeppelin-contracts-master/contracts/mocks/docs/utilities/Base64NFT.sol +27 -0
  254. package/lib/openzeppelin-contracts-master/contracts/mocks/docs/utilities/Multicall.sol +15 -0
  255. package/lib/openzeppelin-contracts-master/contracts/mocks/governance/GovernorCountingOverridableMock.sol +18 -0
  256. package/lib/openzeppelin-contracts-master/contracts/mocks/governance/GovernorCrosschain.sol +20 -0
  257. package/lib/openzeppelin-contracts-master/contracts/mocks/governance/GovernorFractionalMock.sol +14 -0
  258. package/lib/openzeppelin-contracts-master/contracts/mocks/governance/GovernorMock.sol +14 -0
  259. package/lib/openzeppelin-contracts-master/contracts/mocks/governance/GovernorNoncesKeyedMock.sol +44 -0
  260. package/lib/openzeppelin-contracts-master/contracts/mocks/governance/GovernorPreventLateQuorumMock.sol +40 -0
  261. package/lib/openzeppelin-contracts-master/contracts/mocks/governance/GovernorProposalGuardianMock.sol +27 -0
  262. package/lib/openzeppelin-contracts-master/contracts/mocks/governance/GovernorSequentialProposalIdMock.sol +39 -0
  263. package/lib/openzeppelin-contracts-master/contracts/mocks/governance/GovernorStorageMock.sol +79 -0
  264. package/lib/openzeppelin-contracts-master/contracts/mocks/governance/GovernorSuperQuorumMock.sol +95 -0
  265. package/lib/openzeppelin-contracts-master/contracts/mocks/governance/GovernorTimelockAccessMock.sol +70 -0
  266. package/lib/openzeppelin-contracts-master/contracts/mocks/governance/GovernorTimelockCompoundMock.sol +69 -0
  267. package/lib/openzeppelin-contracts-master/contracts/mocks/governance/GovernorTimelockControlMock.sol +69 -0
  268. package/lib/openzeppelin-contracts-master/contracts/mocks/governance/GovernorVoteMock.sol +20 -0
  269. package/lib/openzeppelin-contracts-master/contracts/mocks/governance/GovernorVotesSuperQuorumFractionMock.sol +37 -0
  270. package/lib/openzeppelin-contracts-master/contracts/mocks/governance/GovernorWithParamsMock.sol +51 -0
  271. package/lib/openzeppelin-contracts-master/contracts/mocks/proxy/BadBeacon.sol +11 -0
  272. package/lib/openzeppelin-contracts-master/contracts/mocks/proxy/ClashingImplementation.sol +19 -0
  273. package/lib/openzeppelin-contracts-master/contracts/mocks/proxy/ERC1967ProxyUnsafe.sol +13 -0
  274. package/lib/openzeppelin-contracts-master/contracts/mocks/proxy/UUPSUpgradeableMock.sol +35 -0
  275. package/lib/openzeppelin-contracts-master/contracts/mocks/token/ERC1155ReceiverMock.sol +74 -0
  276. package/lib/openzeppelin-contracts-master/contracts/mocks/token/ERC1363ForceApproveMock.sol +13 -0
  277. package/lib/openzeppelin-contracts-master/contracts/mocks/token/ERC1363NoReturnMock.sol +33 -0
  278. package/lib/openzeppelin-contracts-master/contracts/mocks/token/ERC1363ReceiverMock.sol +52 -0
  279. package/lib/openzeppelin-contracts-master/contracts/mocks/token/ERC1363ReturnFalseMock.sol +34 -0
  280. package/lib/openzeppelin-contracts-master/contracts/mocks/token/ERC1363SpenderMock.sol +47 -0
  281. package/lib/openzeppelin-contracts-master/contracts/mocks/token/ERC20ApprovalMock.sol +10 -0
  282. package/lib/openzeppelin-contracts-master/contracts/mocks/token/ERC20BridgeableMock.sol +30 -0
  283. package/lib/openzeppelin-contracts-master/contracts/mocks/token/ERC20DecimalsMock.sol +17 -0
  284. package/lib/openzeppelin-contracts-master/contracts/mocks/token/ERC20ExcessDecimalsMock.sol +9 -0
  285. package/lib/openzeppelin-contracts-master/contracts/mocks/token/ERC20FlashMintMock.sol +26 -0
  286. package/lib/openzeppelin-contracts-master/contracts/mocks/token/ERC20ForceApproveMock.sol +13 -0
  287. package/lib/openzeppelin-contracts-master/contracts/mocks/token/ERC20GetterHelper.sol +38 -0
  288. package/lib/openzeppelin-contracts-master/contracts/mocks/token/ERC20Mock.sol +16 -0
  289. package/lib/openzeppelin-contracts-master/contracts/mocks/token/ERC20MulticallMock.sol +8 -0
  290. package/lib/openzeppelin-contracts-master/contracts/mocks/token/ERC20NoReturnMock.sol +30 -0
  291. package/lib/openzeppelin-contracts-master/contracts/mocks/token/ERC20Reentrant.sol +39 -0
  292. package/lib/openzeppelin-contracts-master/contracts/mocks/token/ERC20ReturnFalseMock.sol +19 -0
  293. package/lib/openzeppelin-contracts-master/contracts/mocks/token/ERC20VotesAdditionalCheckpointsMock.sol +33 -0
  294. package/lib/openzeppelin-contracts-master/contracts/mocks/token/ERC20VotesLegacyMock.sol +253 -0
  295. package/lib/openzeppelin-contracts-master/contracts/mocks/token/ERC20VotesTimestampMock.sol +31 -0
  296. package/lib/openzeppelin-contracts-master/contracts/mocks/token/ERC4626LimitsMock.sol +23 -0
  297. package/lib/openzeppelin-contracts-master/contracts/mocks/token/ERC4626Mock.sol +17 -0
  298. package/lib/openzeppelin-contracts-master/contracts/mocks/token/ERC4626OffsetMock.sol +17 -0
  299. package/lib/openzeppelin-contracts-master/contracts/mocks/token/ERC4646FeesMock.sol +40 -0
  300. package/lib/openzeppelin-contracts-master/contracts/mocks/token/ERC721ConsecutiveEnumerableMock.sol +42 -0
  301. package/lib/openzeppelin-contracts-master/contracts/mocks/token/ERC721ConsecutiveMock.sol +61 -0
  302. package/lib/openzeppelin-contracts-master/contracts/mocks/token/ERC721ReceiverMock.sol +47 -0
  303. package/lib/openzeppelin-contracts-master/contracts/mocks/token/ERC721URIStorageMock.sol +17 -0
  304. package/lib/openzeppelin-contracts-master/contracts/mocks/utils/cryptography/ERC7739Mock.sol +12 -0
  305. package/lib/openzeppelin-contracts-master/contracts/package.json +32 -0
  306. package/lib/openzeppelin-contracts-master/contracts/proxy/Clones.sol +294 -0
  307. package/lib/openzeppelin-contracts-master/contracts/proxy/ERC1967/ERC1967Proxy.sol +62 -0
  308. package/lib/openzeppelin-contracts-master/contracts/proxy/ERC1967/ERC1967Utils.sol +177 -0
  309. package/lib/openzeppelin-contracts-master/contracts/proxy/Proxy.sol +69 -0
  310. package/lib/openzeppelin-contracts-master/contracts/proxy/README.adoc +87 -0
  311. package/lib/openzeppelin-contracts-master/contracts/proxy/beacon/BeaconProxy.sol +57 -0
  312. package/lib/openzeppelin-contracts-master/contracts/proxy/beacon/IBeacon.sol +16 -0
  313. package/lib/openzeppelin-contracts-master/contracts/proxy/beacon/UpgradeableBeacon.sol +70 -0
  314. package/lib/openzeppelin-contracts-master/contracts/proxy/transparent/ProxyAdmin.sol +45 -0
  315. package/lib/openzeppelin-contracts-master/contracts/proxy/transparent/TransparentUpgradeableProxy.sol +118 -0
  316. package/lib/openzeppelin-contracts-master/contracts/proxy/utils/Initializable.sol +238 -0
  317. package/lib/openzeppelin-contracts-master/contracts/proxy/utils/UUPSUpgradeable.sol +148 -0
  318. package/lib/openzeppelin-contracts-master/contracts/token/ERC1155/ERC1155.sol +417 -0
  319. package/lib/openzeppelin-contracts-master/contracts/token/ERC1155/IERC1155.sol +123 -0
  320. package/lib/openzeppelin-contracts-master/contracts/token/ERC1155/IERC1155Receiver.sol +59 -0
  321. package/lib/openzeppelin-contracts-master/contracts/token/ERC1155/README.adoc +46 -0
  322. package/lib/openzeppelin-contracts-master/contracts/token/ERC1155/extensions/ERC1155Burnable.sol +22 -0
  323. package/lib/openzeppelin-contracts-master/contracts/token/ERC1155/extensions/ERC1155Crosschain.sol +53 -0
  324. package/lib/openzeppelin-contracts-master/contracts/token/ERC1155/extensions/ERC1155Pausable.sol +38 -0
  325. package/lib/openzeppelin-contracts-master/contracts/token/ERC1155/extensions/ERC1155Supply.sol +88 -0
  326. package/lib/openzeppelin-contracts-master/contracts/token/ERC1155/extensions/ERC1155URIStorage.sol +58 -0
  327. package/lib/openzeppelin-contracts-master/contracts/token/ERC1155/extensions/IERC1155MetadataURI.sol +20 -0
  328. package/lib/openzeppelin-contracts-master/contracts/token/ERC1155/utils/ERC1155Holder.sol +42 -0
  329. package/lib/openzeppelin-contracts-master/contracts/token/ERC1155/utils/ERC1155Utils.sol +88 -0
  330. package/lib/openzeppelin-contracts-master/contracts/token/ERC20/ERC20.sol +305 -0
  331. package/lib/openzeppelin-contracts-master/contracts/token/ERC20/IERC20.sol +79 -0
  332. package/lib/openzeppelin-contracts-master/contracts/token/ERC20/README.adoc +81 -0
  333. package/lib/openzeppelin-contracts-master/contracts/token/ERC20/extensions/ERC1363.sol +135 -0
  334. package/lib/openzeppelin-contracts-master/contracts/token/ERC20/extensions/ERC20Burnable.sol +39 -0
  335. package/lib/openzeppelin-contracts-master/contracts/token/ERC20/extensions/ERC20Capped.sol +54 -0
  336. package/lib/openzeppelin-contracts-master/contracts/token/ERC20/extensions/ERC20Crosschain.sol +39 -0
  337. package/lib/openzeppelin-contracts-master/contracts/token/ERC20/extensions/ERC20FlashMint.sol +130 -0
  338. package/lib/openzeppelin-contracts-master/contracts/token/ERC20/extensions/ERC20Pausable.sol +33 -0
  339. package/lib/openzeppelin-contracts-master/contracts/token/ERC20/extensions/ERC20Permit.sol +77 -0
  340. package/lib/openzeppelin-contracts-master/contracts/token/ERC20/extensions/ERC20Votes.sol +83 -0
  341. package/lib/openzeppelin-contracts-master/contracts/token/ERC20/extensions/ERC20Wrapper.sol +93 -0
  342. package/lib/openzeppelin-contracts-master/contracts/token/ERC20/extensions/ERC4626.sol +298 -0
  343. package/lib/openzeppelin-contracts-master/contracts/token/ERC20/extensions/IERC20Metadata.sol +26 -0
  344. package/lib/openzeppelin-contracts-master/contracts/token/ERC20/extensions/IERC20Permit.sol +90 -0
  345. package/lib/openzeppelin-contracts-master/contracts/token/ERC20/extensions/draft-ERC20Bridgeable.sol +51 -0
  346. package/lib/openzeppelin-contracts-master/contracts/token/ERC20/extensions/draft-ERC20TemporaryApproval.sol +119 -0
  347. package/lib/openzeppelin-contracts-master/contracts/token/ERC20/utils/ERC1363Utils.sol +95 -0
  348. package/lib/openzeppelin-contracts-master/contracts/token/ERC20/utils/SafeERC20.sol +292 -0
  349. package/lib/openzeppelin-contracts-master/contracts/token/ERC6909/ERC6909.sol +224 -0
  350. package/lib/openzeppelin-contracts-master/contracts/token/ERC6909/README.adoc +27 -0
  351. package/lib/openzeppelin-contracts-master/contracts/token/ERC6909/extensions/ERC6909ContentURI.sol +59 -0
  352. package/lib/openzeppelin-contracts-master/contracts/token/ERC6909/extensions/ERC6909Metadata.sol +83 -0
  353. package/lib/openzeppelin-contracts-master/contracts/token/ERC6909/extensions/ERC6909TokenSupply.sol +41 -0
  354. package/lib/openzeppelin-contracts-master/contracts/token/ERC721/ERC721.sol +433 -0
  355. package/lib/openzeppelin-contracts-master/contracts/token/ERC721/IERC721.sol +135 -0
  356. package/lib/openzeppelin-contracts-master/contracts/token/ERC721/IERC721Receiver.sol +28 -0
  357. package/lib/openzeppelin-contracts-master/contracts/token/ERC721/README.adoc +72 -0
  358. package/lib/openzeppelin-contracts-master/contracts/token/ERC721/extensions/ERC721Burnable.sol +26 -0
  359. package/lib/openzeppelin-contracts-master/contracts/token/ERC721/extensions/ERC721Consecutive.sol +176 -0
  360. package/lib/openzeppelin-contracts-master/contracts/token/ERC721/extensions/ERC721Crosschain.sol +37 -0
  361. package/lib/openzeppelin-contracts-master/contracts/token/ERC721/extensions/ERC721Enumerable.sol +165 -0
  362. package/lib/openzeppelin-contracts-master/contracts/token/ERC721/extensions/ERC721Pausable.sol +37 -0
  363. package/lib/openzeppelin-contracts-master/contracts/token/ERC721/extensions/ERC721Royalty.sol +26 -0
  364. package/lib/openzeppelin-contracts-master/contracts/token/ERC721/extensions/ERC721URIStorage.sol +62 -0
  365. package/lib/openzeppelin-contracts-master/contracts/token/ERC721/extensions/ERC721Votes.sol +47 -0
  366. package/lib/openzeppelin-contracts-master/contracts/token/ERC721/extensions/ERC721Wrapper.sol +102 -0
  367. package/lib/openzeppelin-contracts-master/contracts/token/ERC721/extensions/IERC721Enumerable.sol +29 -0
  368. package/lib/openzeppelin-contracts-master/contracts/token/ERC721/extensions/IERC721Metadata.sol +27 -0
  369. package/lib/openzeppelin-contracts-master/contracts/token/ERC721/utils/ERC721Holder.sol +26 -0
  370. package/lib/openzeppelin-contracts-master/contracts/token/ERC721/utils/ERC721Utils.sol +50 -0
  371. package/lib/openzeppelin-contracts-master/contracts/token/common/ERC2981.sol +139 -0
  372. package/lib/openzeppelin-contracts-master/contracts/token/common/README.adoc +10 -0
  373. package/lib/openzeppelin-contracts-master/contracts/utils/Address.sol +167 -0
  374. package/lib/openzeppelin-contracts-master/contracts/utils/Arrays.sol +888 -0
  375. package/lib/openzeppelin-contracts-master/contracts/utils/Base58.sol +240 -0
  376. package/lib/openzeppelin-contracts-master/contracts/utils/Base64.sol +234 -0
  377. package/lib/openzeppelin-contracts-master/contracts/utils/Blockhash.sol +54 -0
  378. package/lib/openzeppelin-contracts-master/contracts/utils/Bytes.sol +329 -0
  379. package/lib/openzeppelin-contracts-master/contracts/utils/CAIP10.sol +54 -0
  380. package/lib/openzeppelin-contracts-master/contracts/utils/CAIP2.sol +51 -0
  381. package/lib/openzeppelin-contracts-master/contracts/utils/Calldata.sol +25 -0
  382. package/lib/openzeppelin-contracts-master/contracts/utils/Comparators.sol +19 -0
  383. package/lib/openzeppelin-contracts-master/contracts/utils/Context.sol +28 -0
  384. package/lib/openzeppelin-contracts-master/contracts/utils/Create2.sol +91 -0
  385. package/lib/openzeppelin-contracts-master/contracts/utils/Create3.sol +134 -0
  386. package/lib/openzeppelin-contracts-master/contracts/utils/ERC6372Utils.sol +52 -0
  387. package/lib/openzeppelin-contracts-master/contracts/utils/Errors.sol +34 -0
  388. package/lib/openzeppelin-contracts-master/contracts/utils/LowLevelCall.sol +127 -0
  389. package/lib/openzeppelin-contracts-master/contracts/utils/Memory.sol +149 -0
  390. package/lib/openzeppelin-contracts-master/contracts/utils/Multicall.sol +37 -0
  391. package/lib/openzeppelin-contracts-master/contracts/utils/Nonces.sol +46 -0
  392. package/lib/openzeppelin-contracts-master/contracts/utils/NoncesKeyed.sol +74 -0
  393. package/lib/openzeppelin-contracts-master/contracts/utils/Packing.sol +1656 -0
  394. package/lib/openzeppelin-contracts-master/contracts/utils/Panic.sol +57 -0
  395. package/lib/openzeppelin-contracts-master/contracts/utils/Pausable.sol +112 -0
  396. package/lib/openzeppelin-contracts-master/contracts/utils/README.adoc +169 -0
  397. package/lib/openzeppelin-contracts-master/contracts/utils/RLP.sol +487 -0
  398. package/lib/openzeppelin-contracts-master/contracts/utils/ReentrancyGuard.sol +119 -0
  399. package/lib/openzeppelin-contracts-master/contracts/utils/ReentrancyGuardTransient.sol +84 -0
  400. package/lib/openzeppelin-contracts-master/contracts/utils/RelayedCall.sol +145 -0
  401. package/lib/openzeppelin-contracts-master/contracts/utils/ShortStrings.sol +122 -0
  402. package/lib/openzeppelin-contracts-master/contracts/utils/SimulateCall.sol +113 -0
  403. package/lib/openzeppelin-contracts-master/contracts/utils/SlotDerivation.sol +155 -0
  404. package/lib/openzeppelin-contracts-master/contracts/utils/StorageSlot.sol +143 -0
  405. package/lib/openzeppelin-contracts-master/contracts/utils/Strings.sol +532 -0
  406. package/lib/openzeppelin-contracts-master/contracts/utils/TransientSlot.sol +183 -0
  407. package/lib/openzeppelin-contracts-master/contracts/utils/cryptography/ECDSA.sol +284 -0
  408. package/lib/openzeppelin-contracts-master/contracts/utils/cryptography/EIP712.sol +160 -0
  409. package/lib/openzeppelin-contracts-master/contracts/utils/cryptography/Hashes.sol +31 -0
  410. package/lib/openzeppelin-contracts-master/contracts/utils/cryptography/MerkleProof.sol +510 -0
  411. package/lib/openzeppelin-contracts-master/contracts/utils/cryptography/MessageHashUtils.sol +228 -0
  412. package/lib/openzeppelin-contracts-master/contracts/utils/cryptography/P256.sol +408 -0
  413. package/lib/openzeppelin-contracts-master/contracts/utils/cryptography/README.adoc +76 -0
  414. package/lib/openzeppelin-contracts-master/contracts/utils/cryptography/RSA.sol +154 -0
  415. package/lib/openzeppelin-contracts-master/contracts/utils/cryptography/SignatureChecker.sol +191 -0
  416. package/lib/openzeppelin-contracts-master/contracts/utils/cryptography/TrieProof.sol +256 -0
  417. package/lib/openzeppelin-contracts-master/contracts/utils/cryptography/WebAuthn.sol +269 -0
  418. package/lib/openzeppelin-contracts-master/contracts/utils/cryptography/draft-ERC7739Utils.sol +207 -0
  419. package/lib/openzeppelin-contracts-master/contracts/utils/cryptography/signers/AbstractSigner.sol +23 -0
  420. package/lib/openzeppelin-contracts-master/contracts/utils/cryptography/signers/MultiSignerERC7913.sol +259 -0
  421. package/lib/openzeppelin-contracts-master/contracts/utils/cryptography/signers/MultiSignerERC7913Weighted.sol +208 -0
  422. package/lib/openzeppelin-contracts-master/contracts/utils/cryptography/signers/SignerECDSA.sol +56 -0
  423. package/lib/openzeppelin-contracts-master/contracts/utils/cryptography/signers/SignerEIP7702.sol +25 -0
  424. package/lib/openzeppelin-contracts-master/contracts/utils/cryptography/signers/SignerERC7913.sol +63 -0
  425. package/lib/openzeppelin-contracts-master/contracts/utils/cryptography/signers/SignerP256.sol +64 -0
  426. package/lib/openzeppelin-contracts-master/contracts/utils/cryptography/signers/SignerRSA.sol +65 -0
  427. package/lib/openzeppelin-contracts-master/contracts/utils/cryptography/signers/SignerWebAuthn.sol +46 -0
  428. package/lib/openzeppelin-contracts-master/contracts/utils/cryptography/signers/draft-ERC7739.sol +98 -0
  429. package/lib/openzeppelin-contracts-master/contracts/utils/cryptography/verifiers/ERC7913P256Verifier.sol +29 -0
  430. package/lib/openzeppelin-contracts-master/contracts/utils/cryptography/verifiers/ERC7913RSAVerifier.sol +23 -0
  431. package/lib/openzeppelin-contracts-master/contracts/utils/cryptography/verifiers/ERC7913WebAuthnVerifier.sol +35 -0
  432. package/lib/openzeppelin-contracts-master/contracts/utils/draft-InteroperableAddress.sol +245 -0
  433. package/lib/openzeppelin-contracts-master/contracts/utils/introspection/ERC165.sol +25 -0
  434. package/lib/openzeppelin-contracts-master/contracts/utils/introspection/ERC165Checker.sol +142 -0
  435. package/lib/openzeppelin-contracts-master/contracts/utils/introspection/IERC165.sol +25 -0
  436. package/lib/openzeppelin-contracts-master/contracts/utils/math/Math.sol +763 -0
  437. package/lib/openzeppelin-contracts-master/contracts/utils/math/SafeCast.sol +1162 -0
  438. package/lib/openzeppelin-contracts-master/contracts/utils/math/SignedMath.sol +68 -0
  439. package/lib/openzeppelin-contracts-master/contracts/utils/structs/Accumulators.sol +135 -0
  440. package/lib/openzeppelin-contracts-master/contracts/utils/structs/BitMaps.sol +60 -0
  441. package/lib/openzeppelin-contracts-master/contracts/utils/structs/Checkpoints.sol +833 -0
  442. package/lib/openzeppelin-contracts-master/contracts/utils/structs/CircularBuffer.sol +152 -0
  443. package/lib/openzeppelin-contracts-master/contracts/utils/structs/DoubleEndedQueue.sol +238 -0
  444. package/lib/openzeppelin-contracts-master/contracts/utils/structs/EnumerableMap.sol +1443 -0
  445. package/lib/openzeppelin-contracts-master/contracts/utils/structs/EnumerableSet.sol +895 -0
  446. package/lib/openzeppelin-contracts-master/contracts/utils/structs/Heap.sol +259 -0
  447. package/lib/openzeppelin-contracts-master/contracts/utils/structs/MerkleTree.sol +267 -0
  448. package/lib/openzeppelin-contracts-master/contracts/utils/types/Time.sol +133 -0
  449. package/lib/openzeppelin-contracts-master/contracts/vendor/compound/ICompoundTimelock.sol +86 -0
  450. package/lib/openzeppelin-contracts-master/contracts/vendor/compound/LICENSE +11 -0
  451. package/lib/openzeppelin-contracts-master/docs/README.md +16 -0
  452. package/lib/openzeppelin-contracts-master/docs/antora.yml +7 -0
  453. package/lib/openzeppelin-contracts-master/docs/config.js +21 -0
  454. package/lib/openzeppelin-contracts-master/docs/modules/ROOT/images/access-control-multiple.svg +97 -0
  455. package/lib/openzeppelin-contracts-master/docs/modules/ROOT/images/access-manager-functions.svg +47 -0
  456. package/lib/openzeppelin-contracts-master/docs/modules/ROOT/images/access-manager.svg +99 -0
  457. package/lib/openzeppelin-contracts-master/docs/modules/ROOT/images/erc4626-attack-3a.png +0 -0
  458. package/lib/openzeppelin-contracts-master/docs/modules/ROOT/images/erc4626-attack-3b.png +0 -0
  459. package/lib/openzeppelin-contracts-master/docs/modules/ROOT/images/erc4626-attack-6.png +0 -0
  460. package/lib/openzeppelin-contracts-master/docs/modules/ROOT/images/erc4626-attack.png +0 -0
  461. package/lib/openzeppelin-contracts-master/docs/modules/ROOT/images/erc4626-deposit.png +0 -0
  462. package/lib/openzeppelin-contracts-master/docs/modules/ROOT/images/erc4626-mint.png +0 -0
  463. package/lib/openzeppelin-contracts-master/docs/modules/ROOT/images/erc4626-rate-linear.png +0 -0
  464. package/lib/openzeppelin-contracts-master/docs/modules/ROOT/images/erc4626-rate-loglog.png +0 -0
  465. package/lib/openzeppelin-contracts-master/docs/modules/ROOT/images/erc4626-rate-loglogext.png +0 -0
  466. package/lib/openzeppelin-contracts-master/docs/modules/ROOT/images/tally-exec.png +0 -0
  467. package/lib/openzeppelin-contracts-master/docs/modules/ROOT/images/tally-vote.png +0 -0
  468. package/lib/openzeppelin-contracts-master/docs/modules/ROOT/nav.adoc +29 -0
  469. package/lib/openzeppelin-contracts-master/docs/modules/ROOT/pages/access-control.adoc +339 -0
  470. package/lib/openzeppelin-contracts-master/docs/modules/ROOT/pages/account-abstraction.adoc +100 -0
  471. package/lib/openzeppelin-contracts-master/docs/modules/ROOT/pages/accounts.adoc +354 -0
  472. package/lib/openzeppelin-contracts-master/docs/modules/ROOT/pages/backwards-compatibility.adoc +50 -0
  473. package/lib/openzeppelin-contracts-master/docs/modules/ROOT/pages/eoa-delegation.adoc +143 -0
  474. package/lib/openzeppelin-contracts-master/docs/modules/ROOT/pages/erc1155.adoc +118 -0
  475. package/lib/openzeppelin-contracts-master/docs/modules/ROOT/pages/erc20-supply.adoc +71 -0
  476. package/lib/openzeppelin-contracts-master/docs/modules/ROOT/pages/erc20.adoc +67 -0
  477. package/lib/openzeppelin-contracts-master/docs/modules/ROOT/pages/erc4626.adoc +208 -0
  478. package/lib/openzeppelin-contracts-master/docs/modules/ROOT/pages/erc6909.adoc +47 -0
  479. package/lib/openzeppelin-contracts-master/docs/modules/ROOT/pages/erc721.adoc +58 -0
  480. package/lib/openzeppelin-contracts-master/docs/modules/ROOT/pages/extending-contracts.adoc +67 -0
  481. package/lib/openzeppelin-contracts-master/docs/modules/ROOT/pages/faq.adoc +13 -0
  482. package/lib/openzeppelin-contracts-master/docs/modules/ROOT/pages/governance.adoc +242 -0
  483. package/lib/openzeppelin-contracts-master/docs/modules/ROOT/pages/index.adoc +100 -0
  484. package/lib/openzeppelin-contracts-master/docs/modules/ROOT/pages/multisig.adoc +308 -0
  485. package/lib/openzeppelin-contracts-master/docs/modules/ROOT/pages/tokens.adoc +31 -0
  486. package/lib/openzeppelin-contracts-master/docs/modules/ROOT/pages/upgradeable.adoc +75 -0
  487. package/lib/openzeppelin-contracts-master/docs/modules/ROOT/pages/utilities.adoc +634 -0
  488. package/lib/openzeppelin-contracts-master/docs/modules/ROOT/pages/wizard.adoc +15 -0
  489. package/lib/openzeppelin-contracts-master/docs/templates/contract.hbs +141 -0
  490. package/lib/openzeppelin-contracts-master/docs/templates/helpers.js +46 -0
  491. package/lib/openzeppelin-contracts-master/docs/templates/page.hbs +4 -0
  492. package/lib/openzeppelin-contracts-master/docs/templates/properties.js +88 -0
  493. package/lib/openzeppelin-contracts-master/eslint.config.mjs +29 -0
  494. package/lib/openzeppelin-contracts-master/foundry.toml +20 -0
  495. package/lib/openzeppelin-contracts-master/fv/Makefile +54 -0
  496. package/lib/openzeppelin-contracts-master/fv/README.md +60 -0
  497. package/lib/openzeppelin-contracts-master/fv/diff/access_manager_AccessManager.sol.patch +97 -0
  498. package/lib/openzeppelin-contracts-master/fv/diff/account_extensions_draft-AccountERC7579.sol.patch +25 -0
  499. package/lib/openzeppelin-contracts-master/fv/diff/token_ERC721_ERC721.sol.patch +11 -0
  500. package/lib/openzeppelin-contracts-master/fv/harnesses/AccessControlDefaultAdminRulesHarness.sol +46 -0
  501. package/lib/openzeppelin-contracts-master/fv/harnesses/AccessControlHarness.sol +6 -0
  502. package/lib/openzeppelin-contracts-master/fv/harnesses/AccessManagedHarness.sol +36 -0
  503. package/lib/openzeppelin-contracts-master/fv/harnesses/AccessManagerHarness.sol +116 -0
  504. package/lib/openzeppelin-contracts-master/fv/harnesses/AccountHarness.sol +60 -0
  505. package/lib/openzeppelin-contracts-master/fv/harnesses/DoubleEndedQueueHarness.sol +58 -0
  506. package/lib/openzeppelin-contracts-master/fv/harnesses/ERC20FlashMintHarness.sol +36 -0
  507. package/lib/openzeppelin-contracts-master/fv/harnesses/ERC20PermitHarness.sol +16 -0
  508. package/lib/openzeppelin-contracts-master/fv/harnesses/ERC20WrapperHarness.sol +22 -0
  509. package/lib/openzeppelin-contracts-master/fv/harnesses/ERC3156FlashBorrowerHarness.sol +13 -0
  510. package/lib/openzeppelin-contracts-master/fv/harnesses/ERC721Harness.sol +37 -0
  511. package/lib/openzeppelin-contracts-master/fv/harnesses/ERC721ReceiverHarness.sol +11 -0
  512. package/lib/openzeppelin-contracts-master/fv/harnesses/EnumerableMapHarness.sol +55 -0
  513. package/lib/openzeppelin-contracts-master/fv/harnesses/EnumerableSetHarness.sol +35 -0
  514. package/lib/openzeppelin-contracts-master/fv/harnesses/InitializableHarness.sol +23 -0
  515. package/lib/openzeppelin-contracts-master/fv/harnesses/NoncesHarness.sol +14 -0
  516. package/lib/openzeppelin-contracts-master/fv/harnesses/Ownable2StepHarness.sol +10 -0
  517. package/lib/openzeppelin-contracts-master/fv/harnesses/OwnableHarness.sol +10 -0
  518. package/lib/openzeppelin-contracts-master/fv/harnesses/PausableHarness.sol +18 -0
  519. package/lib/openzeppelin-contracts-master/fv/harnesses/TimelockControllerHarness.sol +13 -0
  520. package/lib/openzeppelin-contracts-master/fv/reports/2021-10.pdf +0 -0
  521. package/lib/openzeppelin-contracts-master/fv/reports/2022-03.pdf +0 -0
  522. package/lib/openzeppelin-contracts-master/fv/reports/2022-05.pdf +0 -0
  523. package/lib/openzeppelin-contracts-master/fv/run.js +68 -0
  524. package/lib/openzeppelin-contracts-master/fv/specs/AccessControl.conf +8 -0
  525. package/lib/openzeppelin-contracts-master/fv/specs/AccessControl.spec +119 -0
  526. package/lib/openzeppelin-contracts-master/fv/specs/AccessControlDefaultAdminRules.conf +8 -0
  527. package/lib/openzeppelin-contracts-master/fv/specs/AccessControlDefaultAdminRules.spec +467 -0
  528. package/lib/openzeppelin-contracts-master/fv/specs/AccessManaged.conf +14 -0
  529. package/lib/openzeppelin-contracts-master/fv/specs/AccessManaged.spec +49 -0
  530. package/lib/openzeppelin-contracts-master/fv/specs/AccessManager.conf +10 -0
  531. package/lib/openzeppelin-contracts-master/fv/specs/AccessManager.spec +837 -0
  532. package/lib/openzeppelin-contracts-master/fv/specs/Account.conf +9 -0
  533. package/lib/openzeppelin-contracts-master/fv/specs/Account.spec +490 -0
  534. package/lib/openzeppelin-contracts-master/fv/specs/DoubleEndedQueue.conf +8 -0
  535. package/lib/openzeppelin-contracts-master/fv/specs/DoubleEndedQueue.spec +300 -0
  536. package/lib/openzeppelin-contracts-master/fv/specs/ERC20.conf +9 -0
  537. package/lib/openzeppelin-contracts-master/fv/specs/ERC20.spec +352 -0
  538. package/lib/openzeppelin-contracts-master/fv/specs/ERC20FlashMint.conf +10 -0
  539. package/lib/openzeppelin-contracts-master/fv/specs/ERC20FlashMint.spec +55 -0
  540. package/lib/openzeppelin-contracts-master/fv/specs/ERC20Wrapper.conf +13 -0
  541. package/lib/openzeppelin-contracts-master/fv/specs/ERC20Wrapper.spec +226 -0
  542. package/lib/openzeppelin-contracts-master/fv/specs/ERC721.conf +10 -0
  543. package/lib/openzeppelin-contracts-master/fv/specs/ERC721.spec +695 -0
  544. package/lib/openzeppelin-contracts-master/fv/specs/EnumerableMap.conf +8 -0
  545. package/lib/openzeppelin-contracts-master/fv/specs/EnumerableMap.spec +364 -0
  546. package/lib/openzeppelin-contracts-master/fv/specs/EnumerableSet.conf +8 -0
  547. package/lib/openzeppelin-contracts-master/fv/specs/EnumerableSet.spec +272 -0
  548. package/lib/openzeppelin-contracts-master/fv/specs/Initializable.conf +8 -0
  549. package/lib/openzeppelin-contracts-master/fv/specs/Initializable.spec +176 -0
  550. package/lib/openzeppelin-contracts-master/fv/specs/Nonces.conf +8 -0
  551. package/lib/openzeppelin-contracts-master/fv/specs/Nonces.spec +92 -0
  552. package/lib/openzeppelin-contracts-master/fv/specs/Ownable.conf +8 -0
  553. package/lib/openzeppelin-contracts-master/fv/specs/Ownable.spec +77 -0
  554. package/lib/openzeppelin-contracts-master/fv/specs/Ownable2Step.conf +8 -0
  555. package/lib/openzeppelin-contracts-master/fv/specs/Ownable2Step.spec +108 -0
  556. package/lib/openzeppelin-contracts-master/fv/specs/Pausable.conf +8 -0
  557. package/lib/openzeppelin-contracts-master/fv/specs/Pausable.spec +96 -0
  558. package/lib/openzeppelin-contracts-master/fv/specs/TimelockController.conf +10 -0
  559. package/lib/openzeppelin-contracts-master/fv/specs/TimelockController.spec +299 -0
  560. package/lib/openzeppelin-contracts-master/fv/specs/helpers/helpers.spec +13 -0
  561. package/lib/openzeppelin-contracts-master/fv/specs/methods/IAccessControl.spec +8 -0
  562. package/lib/openzeppelin-contracts-master/fv/specs/methods/IAccessControlDefaultAdminRules.spec +36 -0
  563. package/lib/openzeppelin-contracts-master/fv/specs/methods/IAccessManaged.spec +5 -0
  564. package/lib/openzeppelin-contracts-master/fv/specs/methods/IAccessManager.spec +33 -0
  565. package/lib/openzeppelin-contracts-master/fv/specs/methods/IAccount.spec +34 -0
  566. package/lib/openzeppelin-contracts-master/fv/specs/methods/IERC20.spec +11 -0
  567. package/lib/openzeppelin-contracts-master/fv/specs/methods/IERC2612.spec +5 -0
  568. package/lib/openzeppelin-contracts-master/fv/specs/methods/IERC3156FlashBorrower.spec +3 -0
  569. package/lib/openzeppelin-contracts-master/fv/specs/methods/IERC3156FlashLender.spec +5 -0
  570. package/lib/openzeppelin-contracts-master/fv/specs/methods/IERC5313.spec +3 -0
  571. package/lib/openzeppelin-contracts-master/fv/specs/methods/IERC721.spec +17 -0
  572. package/lib/openzeppelin-contracts-master/fv/specs/methods/IERC721Receiver.spec +3 -0
  573. package/lib/openzeppelin-contracts-master/fv/specs/methods/IOwnable.spec +5 -0
  574. package/lib/openzeppelin-contracts-master/fv/specs/methods/IOwnable2Step.spec +7 -0
  575. package/lib/openzeppelin-contracts-master/fv-requirements.txt +4 -0
  576. package/lib/openzeppelin-contracts-master/hardhat/async-test-sanity.js +10 -0
  577. package/lib/openzeppelin-contracts-master/hardhat/env-artifacts.js +29 -0
  578. package/lib/openzeppelin-contracts-master/hardhat/ignore-unreachable-warnings.js +45 -0
  579. package/lib/openzeppelin-contracts-master/hardhat/remappings.js +18 -0
  580. package/lib/openzeppelin-contracts-master/hardhat/skip-foundry-tests.js +6 -0
  581. package/lib/openzeppelin-contracts-master/hardhat/task-test-get-files.js +25 -0
  582. package/lib/openzeppelin-contracts-master/hardhat.config.js +124 -0
  583. package/lib/openzeppelin-contracts-master/logo.svg +15 -0
  584. package/lib/openzeppelin-contracts-master/netlify.toml +3 -0
  585. package/lib/openzeppelin-contracts-master/package-lock.json +11197 -0
  586. package/lib/openzeppelin-contracts-master/package.json +109 -0
  587. package/lib/openzeppelin-contracts-master/remappings.txt +1 -0
  588. package/lib/openzeppelin-contracts-master/renovate.json +4 -0
  589. package/lib/openzeppelin-contracts-master/scripts/checks/compare-layout.js +28 -0
  590. package/lib/openzeppelin-contracts-master/scripts/checks/compareGasReports.js +249 -0
  591. package/lib/openzeppelin-contracts-master/scripts/checks/coverage.sh +24 -0
  592. package/lib/openzeppelin-contracts-master/scripts/checks/extract-layout.js +39 -0
  593. package/lib/openzeppelin-contracts-master/scripts/checks/generation.sh +6 -0
  594. package/lib/openzeppelin-contracts-master/scripts/checks/inheritance-ordering.js +56 -0
  595. package/lib/openzeppelin-contracts-master/scripts/checks/pragma-validity.js +45 -0
  596. package/lib/openzeppelin-contracts-master/scripts/fetch-common-contracts.js +50 -0
  597. package/lib/openzeppelin-contracts-master/scripts/gen-nav.js +81 -0
  598. package/lib/openzeppelin-contracts-master/scripts/generate/format-lines.js +16 -0
  599. package/lib/openzeppelin-contracts-master/scripts/generate/helpers/sanitize.js +5 -0
  600. package/lib/openzeppelin-contracts-master/scripts/generate/run.js +61 -0
  601. package/lib/openzeppelin-contracts-master/scripts/generate/templates/Arrays.js +505 -0
  602. package/lib/openzeppelin-contracts-master/scripts/generate/templates/Arrays.opts.js +9 -0
  603. package/lib/openzeppelin-contracts-master/scripts/generate/templates/Checkpoints.js +242 -0
  604. package/lib/openzeppelin-contracts-master/scripts/generate/templates/Checkpoints.opts.js +18 -0
  605. package/lib/openzeppelin-contracts-master/scripts/generate/templates/Checkpoints.t.js +141 -0
  606. package/lib/openzeppelin-contracts-master/scripts/generate/templates/Enumerable.opts.js +56 -0
  607. package/lib/openzeppelin-contracts-master/scripts/generate/templates/EnumerableMap.js +464 -0
  608. package/lib/openzeppelin-contracts-master/scripts/generate/templates/EnumerableSet.js +470 -0
  609. package/lib/openzeppelin-contracts-master/scripts/generate/templates/MerkleProof.js +186 -0
  610. package/lib/openzeppelin-contracts-master/scripts/generate/templates/MerkleProof.opts.js +11 -0
  611. package/lib/openzeppelin-contracts-master/scripts/generate/templates/Packing.js +92 -0
  612. package/lib/openzeppelin-contracts-master/scripts/generate/templates/Packing.opts.js +3 -0
  613. package/lib/openzeppelin-contracts-master/scripts/generate/templates/Packing.t.js +48 -0
  614. package/lib/openzeppelin-contracts-master/scripts/generate/templates/SafeCast.js +136 -0
  615. package/lib/openzeppelin-contracts-master/scripts/generate/templates/Slot.opts.js +15 -0
  616. package/lib/openzeppelin-contracts-master/scripts/generate/templates/SlotDerivation.js +119 -0
  617. package/lib/openzeppelin-contracts-master/scripts/generate/templates/SlotDerivation.t.js +127 -0
  618. package/lib/openzeppelin-contracts-master/scripts/generate/templates/StorageSlot.js +77 -0
  619. package/lib/openzeppelin-contracts-master/scripts/generate/templates/StorageSlotMock.js +57 -0
  620. package/lib/openzeppelin-contracts-master/scripts/generate/templates/TransientSlot.js +80 -0
  621. package/lib/openzeppelin-contracts-master/scripts/generate/templates/TransientSlotMock.js +35 -0
  622. package/lib/openzeppelin-contracts-master/scripts/generate/templates/conversion.js +34 -0
  623. package/lib/openzeppelin-contracts-master/scripts/get-contracts-metadata.js +55 -0
  624. package/lib/openzeppelin-contracts-master/scripts/git-user-config.sh +6 -0
  625. package/lib/openzeppelin-contracts-master/scripts/helpers.js +7 -0
  626. package/lib/openzeppelin-contracts-master/scripts/minimize-pragma.js +140 -0
  627. package/lib/openzeppelin-contracts-master/scripts/prepack.sh +23 -0
  628. package/lib/openzeppelin-contracts-master/scripts/prepare-docs.sh +26 -0
  629. package/lib/openzeppelin-contracts-master/scripts/release/format-changelog.js +33 -0
  630. package/lib/openzeppelin-contracts-master/scripts/release/synchronize-versions.js +15 -0
  631. package/lib/openzeppelin-contracts-master/scripts/release/update-comment.js +34 -0
  632. package/lib/openzeppelin-contracts-master/scripts/release/version.sh +11 -0
  633. package/lib/openzeppelin-contracts-master/scripts/release/workflow/check-upgradeable.sh +27 -0
  634. package/lib/openzeppelin-contracts-master/scripts/release/workflow/exit-prerelease.sh +8 -0
  635. package/lib/openzeppelin-contracts-master/scripts/release/workflow/github-release.js +48 -0
  636. package/lib/openzeppelin-contracts-master/scripts/release/workflow/integrity-check.sh +20 -0
  637. package/lib/openzeppelin-contracts-master/scripts/release/workflow/pack.sh +26 -0
  638. package/lib/openzeppelin-contracts-master/scripts/release/workflow/publish.sh +26 -0
  639. package/lib/openzeppelin-contracts-master/scripts/release/workflow/rerun.js +7 -0
  640. package/lib/openzeppelin-contracts-master/scripts/release/workflow/set-changesets-pr-title.js +17 -0
  641. package/lib/openzeppelin-contracts-master/scripts/release/workflow/start.sh +35 -0
  642. package/lib/openzeppelin-contracts-master/scripts/release/workflow/state.js +112 -0
  643. package/lib/openzeppelin-contracts-master/scripts/remove-ignored-artifacts.js +45 -0
  644. package/lib/openzeppelin-contracts-master/scripts/set-max-old-space-size.sh +10 -0
  645. package/lib/openzeppelin-contracts-master/scripts/solc-versions.js +15 -0
  646. package/lib/openzeppelin-contracts-master/scripts/solhint-custom/index.js +118 -0
  647. package/lib/openzeppelin-contracts-master/scripts/solhint-custom/package.json +8 -0
  648. package/lib/openzeppelin-contracts-master/scripts/update-docs-branch.js +65 -0
  649. package/lib/openzeppelin-contracts-master/scripts/upgradeable/README.md +21 -0
  650. package/lib/openzeppelin-contracts-master/scripts/upgradeable/alias/Initializable.sol +5 -0
  651. package/lib/openzeppelin-contracts-master/scripts/upgradeable/alias/UUPSUpgradeable.sol +5 -0
  652. package/lib/openzeppelin-contracts-master/scripts/upgradeable/patch-apply.sh +19 -0
  653. package/lib/openzeppelin-contracts-master/scripts/upgradeable/patch-save.sh +18 -0
  654. package/lib/openzeppelin-contracts-master/scripts/upgradeable/transpile-onto.sh +54 -0
  655. package/lib/openzeppelin-contracts-master/scripts/upgradeable/transpile.sh +50 -0
  656. package/lib/openzeppelin-contracts-master/scripts/upgradeable/upgradeable.patch +390 -0
  657. package/lib/openzeppelin-contracts-master/slither.config.json +4 -0
  658. package/lib/openzeppelin-contracts-master/solhint.config.js +29 -0
  659. package/lib/openzeppelin-contracts-master/test/TESTING.md +3 -0
  660. package/lib/openzeppelin-contracts-master/test/access/AccessControl.behavior.js +874 -0
  661. package/lib/openzeppelin-contracts-master/test/access/AccessControl.test.js +19 -0
  662. package/lib/openzeppelin-contracts-master/test/access/Ownable.test.js +79 -0
  663. package/lib/openzeppelin-contracts-master/test/access/Ownable2Step.test.js +102 -0
  664. package/lib/openzeppelin-contracts-master/test/access/extensions/AccessControlDefaultAdminRules.test.js +32 -0
  665. package/lib/openzeppelin-contracts-master/test/access/extensions/AccessControlEnumerable.test.js +24 -0
  666. package/lib/openzeppelin-contracts-master/test/access/manager/AccessManaged.test.js +146 -0
  667. package/lib/openzeppelin-contracts-master/test/access/manager/AccessManager.behavior.js +252 -0
  668. package/lib/openzeppelin-contracts-master/test/access/manager/AccessManager.predicate.js +456 -0
  669. package/lib/openzeppelin-contracts-master/test/access/manager/AccessManager.test.js +2536 -0
  670. package/lib/openzeppelin-contracts-master/test/access/manager/AuthorityUtils.test.js +112 -0
  671. package/lib/openzeppelin-contracts-master/test/account/Account.behavior.js +144 -0
  672. package/lib/openzeppelin-contracts-master/test/account/Account.test.js +48 -0
  673. package/lib/openzeppelin-contracts-master/test/account/AccountECDSA.test.js +52 -0
  674. package/lib/openzeppelin-contracts-master/test/account/AccountEIP7702.t.sol +116 -0
  675. package/lib/openzeppelin-contracts-master/test/account/AccountEIP7702.test.js +52 -0
  676. package/lib/openzeppelin-contracts-master/test/account/AccountERC7913.test.js +138 -0
  677. package/lib/openzeppelin-contracts-master/test/account/AccountMultiSigner.test.js +326 -0
  678. package/lib/openzeppelin-contracts-master/test/account/AccountMultiSignerWeighted.test.js +312 -0
  679. package/lib/openzeppelin-contracts-master/test/account/AccountP256.test.js +58 -0
  680. package/lib/openzeppelin-contracts-master/test/account/AccountRSA.test.js +58 -0
  681. package/lib/openzeppelin-contracts-master/test/account/AccountWebAuthn.test.js +75 -0
  682. package/lib/openzeppelin-contracts-master/test/account/examples/AccountEIP7702WithModulesMock.test.js +99 -0
  683. package/lib/openzeppelin-contracts-master/test/account/extensions/AccountERC7579.behavior.js +724 -0
  684. package/lib/openzeppelin-contracts-master/test/account/extensions/AccountERC7579.test.js +60 -0
  685. package/lib/openzeppelin-contracts-master/test/account/extensions/AccountERC7579Hooked.test.js +60 -0
  686. package/lib/openzeppelin-contracts-master/test/account/extensions/ERC7821.behavior.js +145 -0
  687. package/lib/openzeppelin-contracts-master/test/account/utils/EIP7702Utils.test.js +53 -0
  688. package/lib/openzeppelin-contracts-master/test/account/utils/draft-ERC4337Utils.test.js +594 -0
  689. package/lib/openzeppelin-contracts-master/test/account/utils/draft-ERC7579Utils.t.sol +434 -0
  690. package/lib/openzeppelin-contracts-master/test/account/utils/draft-ERC7579Utils.test.js +399 -0
  691. package/lib/openzeppelin-contracts-master/test/crosschain/BridgeERC1155.behavior.js +333 -0
  692. package/lib/openzeppelin-contracts-master/test/crosschain/BridgeERC1155.test.js +70 -0
  693. package/lib/openzeppelin-contracts-master/test/crosschain/BridgeERC20.behavior.js +146 -0
  694. package/lib/openzeppelin-contracts-master/test/crosschain/BridgeERC20.test.js +46 -0
  695. package/lib/openzeppelin-contracts-master/test/crosschain/BridgeERC721.behavior.js +218 -0
  696. package/lib/openzeppelin-contracts-master/test/crosschain/BridgeERC721.test.js +48 -0
  697. package/lib/openzeppelin-contracts-master/test/crosschain/CrosschainExecutor.test.js +144 -0
  698. package/lib/openzeppelin-contracts-master/test/crosschain/ERC7786Recipient.test.js +55 -0
  699. package/lib/openzeppelin-contracts-master/test/finance/VestingWallet.behavior.js +87 -0
  700. package/lib/openzeppelin-contracts-master/test/finance/VestingWallet.test.js +65 -0
  701. package/lib/openzeppelin-contracts-master/test/finance/VestingWalletCliff.test.js +70 -0
  702. package/lib/openzeppelin-contracts-master/test/governance/Governor.t.sol +59 -0
  703. package/lib/openzeppelin-contracts-master/test/governance/Governor.test.js +980 -0
  704. package/lib/openzeppelin-contracts-master/test/governance/TimelockController.test.js +1279 -0
  705. package/lib/openzeppelin-contracts-master/test/governance/extensions/GovernorCountingFractional.test.js +248 -0
  706. package/lib/openzeppelin-contracts-master/test/governance/extensions/GovernorCountingOverridable.test.js +346 -0
  707. package/lib/openzeppelin-contracts-master/test/governance/extensions/GovernorCrosschain.test.js +158 -0
  708. package/lib/openzeppelin-contracts-master/test/governance/extensions/GovernorERC721.test.js +131 -0
  709. package/lib/openzeppelin-contracts-master/test/governance/extensions/GovernorNoncesKeyed.test.js +243 -0
  710. package/lib/openzeppelin-contracts-master/test/governance/extensions/GovernorPreventLateQuorum.test.js +185 -0
  711. package/lib/openzeppelin-contracts-master/test/governance/extensions/GovernorProposalGuardian.test.js +132 -0
  712. package/lib/openzeppelin-contracts-master/test/governance/extensions/GovernorSequentialProposalId.test.js +202 -0
  713. package/lib/openzeppelin-contracts-master/test/governance/extensions/GovernorStorage.test.js +175 -0
  714. package/lib/openzeppelin-contracts-master/test/governance/extensions/GovernorSuperQuorum.test.js +168 -0
  715. package/lib/openzeppelin-contracts-master/test/governance/extensions/GovernorSuperQuorumGreaterThanQuorum.t.sol +79 -0
  716. package/lib/openzeppelin-contracts-master/test/governance/extensions/GovernorTimelockAccess.test.js +906 -0
  717. package/lib/openzeppelin-contracts-master/test/governance/extensions/GovernorTimelockCompound.test.js +450 -0
  718. package/lib/openzeppelin-contracts-master/test/governance/extensions/GovernorTimelockControl.test.js +506 -0
  719. package/lib/openzeppelin-contracts-master/test/governance/extensions/GovernorVotesQuorumFraction.test.js +165 -0
  720. package/lib/openzeppelin-contracts-master/test/governance/extensions/GovernorVotesSuperQuorumFraction.test.js +160 -0
  721. package/lib/openzeppelin-contracts-master/test/governance/extensions/GovernorWithParams.test.js +245 -0
  722. package/lib/openzeppelin-contracts-master/test/governance/utils/ERC6372.behavior.js +29 -0
  723. package/lib/openzeppelin-contracts-master/test/governance/utils/Votes.behavior.js +325 -0
  724. package/lib/openzeppelin-contracts-master/test/governance/utils/Votes.test.js +102 -0
  725. package/lib/openzeppelin-contracts-master/test/governance/utils/VotesExtended.test.js +152 -0
  726. package/lib/openzeppelin-contracts-master/test/helpers/access-manager.js +85 -0
  727. package/lib/openzeppelin-contracts-master/test/helpers/account.js +16 -0
  728. package/lib/openzeppelin-contracts-master/test/helpers/chains.js +56 -0
  729. package/lib/openzeppelin-contracts-master/test/helpers/constants.js +7 -0
  730. package/lib/openzeppelin-contracts-master/test/helpers/deploy.js +14 -0
  731. package/lib/openzeppelin-contracts-master/test/helpers/eip712-types.js +61 -0
  732. package/lib/openzeppelin-contracts-master/test/helpers/eip712.js +45 -0
  733. package/lib/openzeppelin-contracts-master/test/helpers/enums.js +15 -0
  734. package/lib/openzeppelin-contracts-master/test/helpers/erc4337.js +244 -0
  735. package/lib/openzeppelin-contracts-master/test/helpers/erc7579.js +58 -0
  736. package/lib/openzeppelin-contracts-master/test/helpers/erc7739.js +118 -0
  737. package/lib/openzeppelin-contracts-master/test/helpers/governance.js +218 -0
  738. package/lib/openzeppelin-contracts-master/test/helpers/iterate.js +41 -0
  739. package/lib/openzeppelin-contracts-master/test/helpers/math.js +33 -0
  740. package/lib/openzeppelin-contracts-master/test/helpers/methods.js +14 -0
  741. package/lib/openzeppelin-contracts-master/test/helpers/precompiles.js +12 -0
  742. package/lib/openzeppelin-contracts-master/test/helpers/random.js +26 -0
  743. package/lib/openzeppelin-contracts-master/test/helpers/signers.js +225 -0
  744. package/lib/openzeppelin-contracts-master/test/helpers/storage.js +48 -0
  745. package/lib/openzeppelin-contracts-master/test/helpers/strings.js +5 -0
  746. package/lib/openzeppelin-contracts-master/test/helpers/time.js +33 -0
  747. package/lib/openzeppelin-contracts-master/test/helpers/trie.js +79 -0
  748. package/lib/openzeppelin-contracts-master/test/helpers/txpool.js +28 -0
  749. package/lib/openzeppelin-contracts-master/test/metatx/ERC2771Context.test.js +109 -0
  750. package/lib/openzeppelin-contracts-master/test/metatx/ERC2771Forwarder.t.sol +279 -0
  751. package/lib/openzeppelin-contracts-master/test/metatx/ERC2771Forwarder.test.js +398 -0
  752. package/lib/openzeppelin-contracts-master/test/proxy/Clones.behaviour.js +160 -0
  753. package/lib/openzeppelin-contracts-master/test/proxy/Clones.t.sol +91 -0
  754. package/lib/openzeppelin-contracts-master/test/proxy/Clones.test.js +177 -0
  755. package/lib/openzeppelin-contracts-master/test/proxy/ERC1967/ERC1967Proxy.test.js +36 -0
  756. package/lib/openzeppelin-contracts-master/test/proxy/ERC1967/ERC1967Utils.test.js +162 -0
  757. package/lib/openzeppelin-contracts-master/test/proxy/Proxy.behaviour.js +198 -0
  758. package/lib/openzeppelin-contracts-master/test/proxy/beacon/BeaconProxy.test.js +141 -0
  759. package/lib/openzeppelin-contracts-master/test/proxy/beacon/UpgradeableBeacon.test.js +55 -0
  760. package/lib/openzeppelin-contracts-master/test/proxy/transparent/ProxyAdmin.test.js +82 -0
  761. package/lib/openzeppelin-contracts-master/test/proxy/transparent/TransparentUpgradeableProxy.behaviour.js +367 -0
  762. package/lib/openzeppelin-contracts-master/test/proxy/transparent/TransparentUpgradeableProxy.test.js +28 -0
  763. package/lib/openzeppelin-contracts-master/test/proxy/utils/Initializable.test.js +216 -0
  764. package/lib/openzeppelin-contracts-master/test/proxy/utils/UUPSUpgradeable.test.js +120 -0
  765. package/lib/openzeppelin-contracts-master/test/sanity.test.js +27 -0
  766. package/lib/openzeppelin-contracts-master/test/token/ERC1155/ERC1155.behavior.js +865 -0
  767. package/lib/openzeppelin-contracts-master/test/token/ERC1155/ERC1155.test.js +258 -0
  768. package/lib/openzeppelin-contracts-master/test/token/ERC1155/extensions/ERC1155Burnable.test.js +66 -0
  769. package/lib/openzeppelin-contracts-master/test/token/ERC1155/extensions/ERC1155Crosschain.test.js +43 -0
  770. package/lib/openzeppelin-contracts-master/test/token/ERC1155/extensions/ERC1155Pausable.test.js +105 -0
  771. package/lib/openzeppelin-contracts-master/test/token/ERC1155/extensions/ERC1155Supply.test.js +119 -0
  772. package/lib/openzeppelin-contracts-master/test/token/ERC1155/extensions/ERC1155URIStorage.test.js +70 -0
  773. package/lib/openzeppelin-contracts-master/test/token/ERC1155/utils/ERC1155Holder.test.js +56 -0
  774. package/lib/openzeppelin-contracts-master/test/token/ERC1155/utils/ERC1155Utils.test.js +299 -0
  775. package/lib/openzeppelin-contracts-master/test/token/ERC20/ERC20.behavior.js +269 -0
  776. package/lib/openzeppelin-contracts-master/test/token/ERC20/ERC20.test.js +199 -0
  777. package/lib/openzeppelin-contracts-master/test/token/ERC20/extensions/ERC1363.test.js +370 -0
  778. package/lib/openzeppelin-contracts-master/test/token/ERC20/extensions/ERC20Burnable.test.js +105 -0
  779. package/lib/openzeppelin-contracts-master/test/token/ERC20/extensions/ERC20Capped.test.js +55 -0
  780. package/lib/openzeppelin-contracts-master/test/token/ERC20/extensions/ERC20Crosschain.test.js +83 -0
  781. package/lib/openzeppelin-contracts-master/test/token/ERC20/extensions/ERC20FlashMint.test.js +164 -0
  782. package/lib/openzeppelin-contracts-master/test/token/ERC20/extensions/ERC20Pausable.test.js +129 -0
  783. package/lib/openzeppelin-contracts-master/test/token/ERC20/extensions/ERC20Permit.test.js +109 -0
  784. package/lib/openzeppelin-contracts-master/test/token/ERC20/extensions/ERC20Votes.test.js +546 -0
  785. package/lib/openzeppelin-contracts-master/test/token/ERC20/extensions/ERC20Wrapper.test.js +203 -0
  786. package/lib/openzeppelin-contracts-master/test/token/ERC20/extensions/ERC4626.t.sol +41 -0
  787. package/lib/openzeppelin-contracts-master/test/token/ERC20/extensions/ERC4626.test.js +888 -0
  788. package/lib/openzeppelin-contracts-master/test/token/ERC20/extensions/draft-ERC20Bridgeable.test.js +89 -0
  789. package/lib/openzeppelin-contracts-master/test/token/ERC20/extensions/draft-ERC20TemporaryApproval.test.js +142 -0
  790. package/lib/openzeppelin-contracts-master/test/token/ERC20/utils/SafeERC20.test.js +493 -0
  791. package/lib/openzeppelin-contracts-master/test/token/ERC6909/ERC6909.behavior.js +216 -0
  792. package/lib/openzeppelin-contracts-master/test/token/ERC6909/ERC6909.test.js +104 -0
  793. package/lib/openzeppelin-contracts-master/test/token/ERC6909/extensions/ERC6909ContentURI.test.js +52 -0
  794. package/lib/openzeppelin-contracts-master/test/token/ERC6909/extensions/ERC6909Metadata.test.js +62 -0
  795. package/lib/openzeppelin-contracts-master/test/token/ERC6909/extensions/ERC6909TokenSupply.test.js +56 -0
  796. package/lib/openzeppelin-contracts-master/test/token/ERC721/ERC721.behavior.js +954 -0
  797. package/lib/openzeppelin-contracts-master/test/token/ERC721/ERC721.test.js +23 -0
  798. package/lib/openzeppelin-contracts-master/test/token/ERC721/ERC721Enumerable.test.js +28 -0
  799. package/lib/openzeppelin-contracts-master/test/token/ERC721/extensions/ERC721Burnable.test.js +77 -0
  800. package/lib/openzeppelin-contracts-master/test/token/ERC721/extensions/ERC721Consecutive.t.sol +187 -0
  801. package/lib/openzeppelin-contracts-master/test/token/ERC721/extensions/ERC721Consecutive.test.js +228 -0
  802. package/lib/openzeppelin-contracts-master/test/token/ERC721/extensions/ERC721Crosschain.test.js +44 -0
  803. package/lib/openzeppelin-contracts-master/test/token/ERC721/extensions/ERC721Pausable.test.js +81 -0
  804. package/lib/openzeppelin-contracts-master/test/token/ERC721/extensions/ERC721Royalty.test.js +57 -0
  805. package/lib/openzeppelin-contracts-master/test/token/ERC721/extensions/ERC721URIStorage.test.js +134 -0
  806. package/lib/openzeppelin-contracts-master/test/token/ERC721/extensions/ERC721Votes.test.js +194 -0
  807. package/lib/openzeppelin-contracts-master/test/token/ERC721/extensions/ERC721Wrapper.test.js +201 -0
  808. package/lib/openzeppelin-contracts-master/test/token/ERC721/utils/ERC721Holder.test.js +20 -0
  809. package/lib/openzeppelin-contracts-master/test/token/ERC721/utils/ERC721Utils.test.js +94 -0
  810. package/lib/openzeppelin-contracts-master/test/token/common/ERC2981.behavior.js +152 -0
  811. package/lib/openzeppelin-contracts-master/test/utils/Address.test.js +332 -0
  812. package/lib/openzeppelin-contracts-master/test/utils/Arrays.t.sol +416 -0
  813. package/lib/openzeppelin-contracts-master/test/utils/Arrays.test.js +284 -0
  814. package/lib/openzeppelin-contracts-master/test/utils/Base58.t.sol +24 -0
  815. package/lib/openzeppelin-contracts-master/test/utils/Base58.test.js +65 -0
  816. package/lib/openzeppelin-contracts-master/test/utils/Base64.t.sol +36 -0
  817. package/lib/openzeppelin-contracts-master/test/utils/Base64.test.js +79 -0
  818. package/lib/openzeppelin-contracts-master/test/utils/Blockhash.t.sol +101 -0
  819. package/lib/openzeppelin-contracts-master/test/utils/Blockhash.test.js +59 -0
  820. package/lib/openzeppelin-contracts-master/test/utils/Bytes.t.sol +322 -0
  821. package/lib/openzeppelin-contracts-master/test/utils/Bytes.test.js +371 -0
  822. package/lib/openzeppelin-contracts-master/test/utils/CAIP.test.js +56 -0
  823. package/lib/openzeppelin-contracts-master/test/utils/Calldata.test.js +22 -0
  824. package/lib/openzeppelin-contracts-master/test/utils/Context.behavior.js +48 -0
  825. package/lib/openzeppelin-contracts-master/test/utils/Context.test.js +18 -0
  826. package/lib/openzeppelin-contracts-master/test/utils/Create2.t.sol +17 -0
  827. package/lib/openzeppelin-contracts-master/test/utils/Create2.test.js +190 -0
  828. package/lib/openzeppelin-contracts-master/test/utils/Create3.t.sol +25 -0
  829. package/lib/openzeppelin-contracts-master/test/utils/Create3.test.js +185 -0
  830. package/lib/openzeppelin-contracts-master/test/utils/ERC6372Utils.test.js +59 -0
  831. package/lib/openzeppelin-contracts-master/test/utils/LowLevelCall.test.js +257 -0
  832. package/lib/openzeppelin-contracts-master/test/utils/Memory.t.sol +90 -0
  833. package/lib/openzeppelin-contracts-master/test/utils/Memory.test.js +94 -0
  834. package/lib/openzeppelin-contracts-master/test/utils/Multicall.test.js +72 -0
  835. package/lib/openzeppelin-contracts-master/test/utils/Nonces.behavior.js +189 -0
  836. package/lib/openzeppelin-contracts-master/test/utils/Nonces.test.js +16 -0
  837. package/lib/openzeppelin-contracts-master/test/utils/NoncesKeyed.t.sol +51 -0
  838. package/lib/openzeppelin-contracts-master/test/utils/NoncesKeyed.test.js +17 -0
  839. package/lib/openzeppelin-contracts-master/test/utils/Packing.t.sol +993 -0
  840. package/lib/openzeppelin-contracts-master/test/utils/Packing.test.js +70 -0
  841. package/lib/openzeppelin-contracts-master/test/utils/Panic.test.js +37 -0
  842. package/lib/openzeppelin-contracts-master/test/utils/Pausable.test.js +90 -0
  843. package/lib/openzeppelin-contracts-master/test/utils/RLP.t.sol +144 -0
  844. package/lib/openzeppelin-contracts-master/test/utils/RLP.test.js +224 -0
  845. package/lib/openzeppelin-contracts-master/test/utils/ReentrancyGuard.test.js +58 -0
  846. package/lib/openzeppelin-contracts-master/test/utils/RelayedCall.test.js +223 -0
  847. package/lib/openzeppelin-contracts-master/test/utils/ShortStrings.t.sol +109 -0
  848. package/lib/openzeppelin-contracts-master/test/utils/ShortStrings.test.js +64 -0
  849. package/lib/openzeppelin-contracts-master/test/utils/SimulatedCall.test.js +101 -0
  850. package/lib/openzeppelin-contracts-master/test/utils/SlotDerivation.t.sol +248 -0
  851. package/lib/openzeppelin-contracts-master/test/utils/SlotDerivation.test.js +58 -0
  852. package/lib/openzeppelin-contracts-master/test/utils/StorageSlot.test.js +73 -0
  853. package/lib/openzeppelin-contracts-master/test/utils/Strings.t.sol +50 -0
  854. package/lib/openzeppelin-contracts-master/test/utils/Strings.test.js +366 -0
  855. package/lib/openzeppelin-contracts-master/test/utils/TransientSlot.test.js +59 -0
  856. package/lib/openzeppelin-contracts-master/test/utils/cryptography/ECDSA.test.js +322 -0
  857. package/lib/openzeppelin-contracts-master/test/utils/cryptography/EIP712.test.js +105 -0
  858. package/lib/openzeppelin-contracts-master/test/utils/cryptography/ERC1271.behavior.js +111 -0
  859. package/lib/openzeppelin-contracts-master/test/utils/cryptography/ERC7739.test.js +42 -0
  860. package/lib/openzeppelin-contracts-master/test/utils/cryptography/ERC7739Utils.test.js +203 -0
  861. package/lib/openzeppelin-contracts-master/test/utils/cryptography/MerkleProof.test.js +216 -0
  862. package/lib/openzeppelin-contracts-master/test/utils/cryptography/MessageHashUtils.t.sol +33 -0
  863. package/lib/openzeppelin-contracts-master/test/utils/cryptography/MessageHashUtils.test.js +149 -0
  864. package/lib/openzeppelin-contracts-master/test/utils/cryptography/P256.t.sol +44 -0
  865. package/lib/openzeppelin-contracts-master/test/utils/cryptography/P256.test.js +174 -0
  866. package/lib/openzeppelin-contracts-master/test/utils/cryptography/RSA.helper.js +17 -0
  867. package/lib/openzeppelin-contracts-master/test/utils/cryptography/RSA.test.js +102 -0
  868. package/lib/openzeppelin-contracts-master/test/utils/cryptography/SigVer15_186-3.rsp +3850 -0
  869. package/lib/openzeppelin-contracts-master/test/utils/cryptography/SignatureChecker.test.js +427 -0
  870. package/lib/openzeppelin-contracts-master/test/utils/cryptography/TrieProof.test.js +707 -0
  871. package/lib/openzeppelin-contracts-master/test/utils/cryptography/WebAuthn.t.sol +340 -0
  872. package/lib/openzeppelin-contracts-master/test/utils/cryptography/ecdsa_secp256r1_sha256_p1363_test.json +3719 -0
  873. package/lib/openzeppelin-contracts-master/test/utils/draft-InteroperableAddress.t.sol +99 -0
  874. package/lib/openzeppelin-contracts-master/test/utils/draft-InteroperableAddress.test.js +217 -0
  875. package/lib/openzeppelin-contracts-master/test/utils/introspection/ERC165.test.js +18 -0
  876. package/lib/openzeppelin-contracts-master/test/utils/introspection/ERC165Checker.test.js +272 -0
  877. package/lib/openzeppelin-contracts-master/test/utils/introspection/SupportsInterface.behavior.js +169 -0
  878. package/lib/openzeppelin-contracts-master/test/utils/math/Math.t.sol +370 -0
  879. package/lib/openzeppelin-contracts-master/test/utils/math/Math.test.js +746 -0
  880. package/lib/openzeppelin-contracts-master/test/utils/math/SafeCast.test.js +159 -0
  881. package/lib/openzeppelin-contracts-master/test/utils/math/SignedMath.t.sol +81 -0
  882. package/lib/openzeppelin-contracts-master/test/utils/math/SignedMath.test.js +53 -0
  883. package/lib/openzeppelin-contracts-master/test/utils/structs/Accumulators.t.sol +35 -0
  884. package/lib/openzeppelin-contracts-master/test/utils/structs/BitMap.test.js +149 -0
  885. package/lib/openzeppelin-contracts-master/test/utils/structs/Checkpoints.t.sol +440 -0
  886. package/lib/openzeppelin-contracts-master/test/utils/structs/Checkpoints.test.js +147 -0
  887. package/lib/openzeppelin-contracts-master/test/utils/structs/CircularBuffer.test.js +83 -0
  888. package/lib/openzeppelin-contracts-master/test/utils/structs/DoubleEndedQueue.test.js +144 -0
  889. package/lib/openzeppelin-contracts-master/test/utils/structs/EnumerableMap.behavior.js +214 -0
  890. package/lib/openzeppelin-contracts-master/test/utils/structs/EnumerableMap.test.js +83 -0
  891. package/lib/openzeppelin-contracts-master/test/utils/structs/EnumerableSet.behavior.js +175 -0
  892. package/lib/openzeppelin-contracts-master/test/utils/structs/EnumerableSet.test.js +66 -0
  893. package/lib/openzeppelin-contracts-master/test/utils/structs/Heap.t.sol +74 -0
  894. package/lib/openzeppelin-contracts-master/test/utils/structs/Heap.test.js +113 -0
  895. package/lib/openzeppelin-contracts-master/test/utils/structs/MerkleTree.test.js +180 -0
  896. package/lib/openzeppelin-contracts-master/test/utils/types/Time.test.js +135 -0
  897. package/lib/v3-core-main/.gitattributes +1 -0
  898. package/lib/v3-core-main/.github/stale.yml +25 -0
  899. package/lib/v3-core-main/.github/workflows/fuzz-testing.yml +60 -0
  900. package/lib/v3-core-main/.github/workflows/lint.yml +34 -0
  901. package/lib/v3-core-main/.github/workflows/mythx.yml +65 -0
  902. package/lib/v3-core-main/.github/workflows/tests.yml +38 -0
  903. package/lib/v3-core-main/.prettierrc +5 -0
  904. package/lib/v3-core-main/.solhint.json +6 -0
  905. package/lib/v3-core-main/.yarnrc +1 -0
  906. package/lib/v3-core-main/LICENSE +100 -0
  907. package/lib/v3-core-main/README.md +66 -0
  908. package/lib/v3-core-main/audits/abdk/audit.pdf +0 -0
  909. package/lib/v3-core-main/audits/tob/README.md +166 -0
  910. package/lib/v3-core-main/audits/tob/audit.pdf +0 -0
  911. package/lib/v3-core-main/audits/tob/contracts/crytic/echidna/E2E_mint_burn.config.yaml +16 -0
  912. package/lib/v3-core-main/audits/tob/contracts/crytic/echidna/E2E_mint_burn.sol +503 -0
  913. package/lib/v3-core-main/audits/tob/contracts/crytic/echidna/E2E_swap.config.yaml +10 -0
  914. package/lib/v3-core-main/audits/tob/contracts/crytic/echidna/E2E_swap.sol +487 -0
  915. package/lib/v3-core-main/audits/tob/contracts/crytic/echidna/Other.config.yaml +7 -0
  916. package/lib/v3-core-main/audits/tob/contracts/crytic/echidna/Other.sol +21 -0
  917. package/lib/v3-core-main/audits/tob/contracts/crytic/echidna/Setup.sol +205 -0
  918. package/lib/v3-core-main/audits/tob/contracts/crytic/manticore/001.sol +11 -0
  919. package/lib/v3-core-main/audits/tob/contracts/crytic/manticore/002.sol +12 -0
  920. package/lib/v3-core-main/audits/tob/contracts/crytic/manticore/003.sol +9 -0
  921. package/lib/v3-core-main/bug-bounty.md +76 -0
  922. package/lib/v3-core-main/contracts/NoDelegateCall.sol +27 -0
  923. package/lib/v3-core-main/contracts/UniswapV3Factory.sol +73 -0
  924. package/lib/v3-core-main/contracts/UniswapV3Pool.sol +869 -0
  925. package/lib/v3-core-main/contracts/UniswapV3PoolDeployer.sol +38 -0
  926. package/lib/v3-core-main/contracts/interfaces/IERC20Minimal.sol +52 -0
  927. package/lib/v3-core-main/contracts/interfaces/IUniswapV3Factory.sol +78 -0
  928. package/lib/v3-core-main/contracts/interfaces/IUniswapV3Pool.sol +24 -0
  929. package/lib/v3-core-main/contracts/interfaces/IUniswapV3PoolDeployer.sol +26 -0
  930. package/lib/v3-core-main/contracts/interfaces/LICENSE +445 -0
  931. package/lib/v3-core-main/contracts/interfaces/callback/IUniswapV3FlashCallback.sol +18 -0
  932. package/lib/v3-core-main/contracts/interfaces/callback/IUniswapV3MintCallback.sol +18 -0
  933. package/lib/v3-core-main/contracts/interfaces/callback/IUniswapV3SwapCallback.sol +21 -0
  934. package/lib/v3-core-main/contracts/interfaces/pool/IUniswapV3PoolActions.sol +103 -0
  935. package/lib/v3-core-main/contracts/interfaces/pool/IUniswapV3PoolDerivedState.sol +40 -0
  936. package/lib/v3-core-main/contracts/interfaces/pool/IUniswapV3PoolEvents.sol +121 -0
  937. package/lib/v3-core-main/contracts/interfaces/pool/IUniswapV3PoolImmutables.sol +35 -0
  938. package/lib/v3-core-main/contracts/interfaces/pool/IUniswapV3PoolOwnerActions.sol +23 -0
  939. package/lib/v3-core-main/contracts/interfaces/pool/IUniswapV3PoolState.sol +116 -0
  940. package/lib/v3-core-main/contracts/libraries/BitMath.sol +94 -0
  941. package/lib/v3-core-main/contracts/libraries/FixedPoint128.sol +8 -0
  942. package/lib/v3-core-main/contracts/libraries/FixedPoint96.sol +10 -0
  943. package/lib/v3-core-main/contracts/libraries/FullMath.sol +124 -0
  944. package/lib/v3-core-main/contracts/libraries/LICENSE +445 -0
  945. package/lib/v3-core-main/contracts/libraries/LICENSE_MIT +20 -0
  946. package/lib/v3-core-main/contracts/libraries/LiquidityMath.sol +17 -0
  947. package/lib/v3-core-main/contracts/libraries/LowGasSafeMath.sol +46 -0
  948. package/lib/v3-core-main/contracts/libraries/Oracle.sol +325 -0
  949. package/lib/v3-core-main/contracts/libraries/Position.sol +88 -0
  950. package/lib/v3-core-main/contracts/libraries/SafeCast.sol +28 -0
  951. package/lib/v3-core-main/contracts/libraries/SqrtPriceMath.sol +227 -0
  952. package/lib/v3-core-main/contracts/libraries/SwapMath.sol +98 -0
  953. package/lib/v3-core-main/contracts/libraries/Tick.sol +185 -0
  954. package/lib/v3-core-main/contracts/libraries/TickBitmap.sol +78 -0
  955. package/lib/v3-core-main/contracts/libraries/TickMath.sol +205 -0
  956. package/lib/v3-core-main/contracts/libraries/TransferHelper.sol +23 -0
  957. package/lib/v3-core-main/contracts/libraries/UnsafeMath.sol +17 -0
  958. package/lib/v3-core-main/contracts/test/BitMathEchidnaTest.sol +18 -0
  959. package/lib/v3-core-main/contracts/test/BitMathTest.sol +26 -0
  960. package/lib/v3-core-main/contracts/test/FullMathEchidnaTest.sol +67 -0
  961. package/lib/v3-core-main/contracts/test/FullMathTest.sol +22 -0
  962. package/lib/v3-core-main/contracts/test/LiquidityMathTest.sol +16 -0
  963. package/lib/v3-core-main/contracts/test/LowGasSafeMathEchidnaTest.sol +36 -0
  964. package/lib/v3-core-main/contracts/test/MockTimeUniswapV3Pool.sol +26 -0
  965. package/lib/v3-core-main/contracts/test/MockTimeUniswapV3PoolDeployer.sol +35 -0
  966. package/lib/v3-core-main/contracts/test/NoDelegateCallTest.sol +32 -0
  967. package/lib/v3-core-main/contracts/test/OracleEchidnaTest.sol +137 -0
  968. package/lib/v3-core-main/contracts/test/OracleTest.sol +100 -0
  969. package/lib/v3-core-main/contracts/test/SqrtPriceMathEchidnaTest.sol +232 -0
  970. package/lib/v3-core-main/contracts/test/SqrtPriceMathTest.sol +86 -0
  971. package/lib/v3-core-main/contracts/test/SwapMathEchidnaTest.sol +52 -0
  972. package/lib/v3-core-main/contracts/test/SwapMathTest.sol +37 -0
  973. package/lib/v3-core-main/contracts/test/TestERC20.sol +59 -0
  974. package/lib/v3-core-main/contracts/test/TestUniswapV3Callee.sol +142 -0
  975. package/lib/v3-core-main/contracts/test/TestUniswapV3ReentrantCallee.sol +56 -0
  976. package/lib/v3-core-main/contracts/test/TestUniswapV3Router.sol +91 -0
  977. package/lib/v3-core-main/contracts/test/TestUniswapV3SwapPay.sol +41 -0
  978. package/lib/v3-core-main/contracts/test/TickBitmapEchidnaTest.sol +47 -0
  979. package/lib/v3-core-main/contracts/test/TickBitmapTest.sol +40 -0
  980. package/lib/v3-core-main/contracts/test/TickEchidnaTest.sol +27 -0
  981. package/lib/v3-core-main/contracts/test/TickMathEchidnaTest.sol +22 -0
  982. package/lib/v3-core-main/contracts/test/TickMathTest.sol +34 -0
  983. package/lib/v3-core-main/contracts/test/TickOverflowSafetyEchidnaTest.sol +111 -0
  984. package/lib/v3-core-main/contracts/test/TickTest.sol +79 -0
  985. package/lib/v3-core-main/contracts/test/UniswapV3PoolSwapTest.sol +50 -0
  986. package/lib/v3-core-main/contracts/test/UnsafeMathEchidnaTest.sol +17 -0
  987. package/lib/v3-core-main/echidna.config.yml +74 -0
  988. package/lib/v3-core-main/hardhat.config.ts +68 -0
  989. package/lib/v3-core-main/package.json +59 -0
  990. package/lib/v3-core-main/test/BitMath.spec.ts +79 -0
  991. package/lib/v3-core-main/test/FullMath.spec.ts +182 -0
  992. package/lib/v3-core-main/test/LiquidityMath.spec.ts +44 -0
  993. package/lib/v3-core-main/test/NoDelegateCall.spec.ts +54 -0
  994. package/lib/v3-core-main/test/Oracle.spec.ts +798 -0
  995. package/lib/v3-core-main/test/SqrtPriceMath.spec.ts +379 -0
  996. package/lib/v3-core-main/test/SwapMath.spec.ts +324 -0
  997. package/lib/v3-core-main/test/Tick.spec.ts +329 -0
  998. package/lib/v3-core-main/test/TickBitmap.spec.ts +227 -0
  999. package/lib/v3-core-main/test/TickMath.spec.ts +166 -0
  1000. package/lib/v3-core-main/test/UniswapV3Factory.spec.ts +177 -0
  1001. package/lib/v3-core-main/test/UniswapV3Pool.arbitrage.spec.ts +373 -0
  1002. package/lib/v3-core-main/test/UniswapV3Pool.gas.spec.ts +315 -0
  1003. package/lib/v3-core-main/test/UniswapV3Pool.spec.ts +2043 -0
  1004. package/lib/v3-core-main/test/UniswapV3Pool.swaps.spec.ts +588 -0
  1005. package/lib/v3-core-main/test/UniswapV3Router.spec.ts +133 -0
  1006. package/lib/v3-core-main/test/__snapshots__/BitMath.spec.ts.snap +13 -0
  1007. package/lib/v3-core-main/test/__snapshots__/LiquidityMath.spec.ts.snap +5 -0
  1008. package/lib/v3-core-main/test/__snapshots__/NoDelegateCall.spec.ts.snap +3 -0
  1009. package/lib/v3-core-main/test/__snapshots__/Oracle.spec.ts.snap +87 -0
  1010. package/lib/v3-core-main/test/__snapshots__/SqrtPriceMath.spec.ts.snap +17 -0
  1011. package/lib/v3-core-main/test/__snapshots__/SwapMath.spec.ts.snap +17 -0
  1012. package/lib/v3-core-main/test/__snapshots__/TickBitmap.spec.ts.snap +19 -0
  1013. package/lib/v3-core-main/test/__snapshots__/TickMath.spec.ts.snap +165 -0
  1014. package/lib/v3-core-main/test/__snapshots__/UniswapV3Factory.spec.ts.snap +7 -0
  1015. package/lib/v3-core-main/test/__snapshots__/UniswapV3Pool.arbitrage.spec.ts.snap +977 -0
  1016. package/lib/v3-core-main/test/__snapshots__/UniswapV3Pool.gas.spec.ts.snap +169 -0
  1017. package/lib/v3-core-main/test/__snapshots__/UniswapV3Pool.swaps.spec.ts.snap +3541 -0
  1018. package/lib/v3-core-main/test/shared/checkObservationEquals.ts +38 -0
  1019. package/lib/v3-core-main/test/shared/expect.ts +8 -0
  1020. package/lib/v3-core-main/test/shared/fixtures.ts +92 -0
  1021. package/lib/v3-core-main/test/shared/format.ts +10 -0
  1022. package/lib/v3-core-main/test/shared/snapshotGasCost.ts +27 -0
  1023. package/lib/v3-core-main/test/shared/utilities.ts +258 -0
  1024. package/lib/v3-core-main/test/snapshotCumulativesInside.test.ts +73 -0
  1025. package/lib/v3-core-main/tsconfig.json +13 -0
  1026. package/lib/v3-core-main/yarn.lock +9271 -0
  1027. package/lib/v3-periphery-main/.gitattributes +1 -0
  1028. package/lib/v3-periphery-main/.github/stale.yml +25 -0
  1029. package/lib/v3-periphery-main/.github/workflows/lint.yml +33 -0
  1030. package/lib/v3-periphery-main/.github/workflows/tests.yml +39 -0
  1031. package/lib/v3-periphery-main/.prettierignore +1 -0
  1032. package/lib/v3-periphery-main/.prettierrc +5 -0
  1033. package/lib/v3-periphery-main/.solhint.json +6 -0
  1034. package/lib/v3-periphery-main/.yarnrc +1 -0
  1035. package/lib/v3-periphery-main/LICENSE +339 -0
  1036. package/lib/v3-periphery-main/README.md +52 -0
  1037. package/lib/v3-periphery-main/audits/abdk/audit.pdf +0 -0
  1038. package/lib/v3-periphery-main/bug-bounty.md +80 -0
  1039. package/lib/v3-periphery-main/contracts/NonfungiblePositionManager.sol +400 -0
  1040. package/lib/v3-periphery-main/contracts/NonfungibleTokenPositionDescriptor.sol +124 -0
  1041. package/lib/v3-periphery-main/contracts/SwapRouter.sol +244 -0
  1042. package/lib/v3-periphery-main/contracts/V3Migrator.sol +99 -0
  1043. package/lib/v3-periphery-main/contracts/base/BlockTimestamp.sol +12 -0
  1044. package/lib/v3-periphery-main/contracts/base/ERC721Permit.sol +86 -0
  1045. package/lib/v3-periphery-main/contracts/base/LiquidityManagement.sol +90 -0
  1046. package/lib/v3-periphery-main/contracts/base/Multicall.sol +28 -0
  1047. package/lib/v3-periphery-main/contracts/base/PeripheryImmutableState.sol +18 -0
  1048. package/lib/v3-periphery-main/contracts/base/PeripheryPayments.sol +70 -0
  1049. package/lib/v3-periphery-main/contracts/base/PeripheryPaymentsWithFee.sol +55 -0
  1050. package/lib/v3-periphery-main/contracts/base/PeripheryValidation.sol +11 -0
  1051. package/lib/v3-periphery-main/contracts/base/PoolInitializer.sol +32 -0
  1052. package/lib/v3-periphery-main/contracts/base/SelfPermit.sol +63 -0
  1053. package/lib/v3-periphery-main/contracts/examples/PairFlash.sol +149 -0
  1054. package/lib/v3-periphery-main/contracts/interfaces/IERC20Metadata.sol +18 -0
  1055. package/lib/v3-periphery-main/contracts/interfaces/IERC721Permit.sol +32 -0
  1056. package/lib/v3-periphery-main/contracts/interfaces/IMulticall.sol +13 -0
  1057. package/lib/v3-periphery-main/contracts/interfaces/INonfungiblePositionManager.sol +179 -0
  1058. package/lib/v3-periphery-main/contracts/interfaces/INonfungibleTokenPositionDescriptor.sol +17 -0
  1059. package/lib/v3-periphery-main/contracts/interfaces/IPeripheryImmutableState.sol +12 -0
  1060. package/lib/v3-periphery-main/contracts/interfaces/IPeripheryPayments.sol +28 -0
  1061. package/lib/v3-periphery-main/contracts/interfaces/IPeripheryPaymentsWithFee.sol +29 -0
  1062. package/lib/v3-periphery-main/contracts/interfaces/IPoolInitializer.sol +22 -0
  1063. package/lib/v3-periphery-main/contracts/interfaces/IQuoter.sol +51 -0
  1064. package/lib/v3-periphery-main/contracts/interfaces/IQuoterV2.sol +98 -0
  1065. package/lib/v3-periphery-main/contracts/interfaces/ISelfPermit.sol +76 -0
  1066. package/lib/v3-periphery-main/contracts/interfaces/ISwapRouter.sol +67 -0
  1067. package/lib/v3-periphery-main/contracts/interfaces/ITickLens.sol +25 -0
  1068. package/lib/v3-periphery-main/contracts/interfaces/IV3Migrator.sol +34 -0
  1069. package/lib/v3-periphery-main/contracts/interfaces/external/IERC1271.sol +16 -0
  1070. package/lib/v3-periphery-main/contracts/interfaces/external/IERC20PermitAllowed.sol +27 -0
  1071. package/lib/v3-periphery-main/contracts/interfaces/external/IWETH9.sol +13 -0
  1072. package/lib/v3-periphery-main/contracts/lens/Quoter.sol +170 -0
  1073. package/lib/v3-periphery-main/contracts/lens/QuoterV2.sol +273 -0
  1074. package/lib/v3-periphery-main/contracts/lens/README.md +4 -0
  1075. package/lib/v3-periphery-main/contracts/lens/TickLens.sol +42 -0
  1076. package/lib/v3-periphery-main/contracts/lens/UniswapInterfaceMulticall.sol +39 -0
  1077. package/lib/v3-periphery-main/contracts/libraries/BytesLib.sol +101 -0
  1078. package/lib/v3-periphery-main/contracts/libraries/CallbackValidation.sol +36 -0
  1079. package/lib/v3-periphery-main/contracts/libraries/ChainId.sol +13 -0
  1080. package/lib/v3-periphery-main/contracts/libraries/HexStrings.sol +29 -0
  1081. package/lib/v3-periphery-main/contracts/libraries/LiquidityAmounts.sol +137 -0
  1082. package/lib/v3-periphery-main/contracts/libraries/NFTDescriptor.sol +477 -0
  1083. package/lib/v3-periphery-main/contracts/libraries/NFTSVG.sol +406 -0
  1084. package/lib/v3-periphery-main/contracts/libraries/OracleLibrary.sol +180 -0
  1085. package/lib/v3-periphery-main/contracts/libraries/Path.sol +69 -0
  1086. package/lib/v3-periphery-main/contracts/libraries/PoolAddress.sol +48 -0
  1087. package/lib/v3-periphery-main/contracts/libraries/PoolTicksCounter.sol +96 -0
  1088. package/lib/v3-periphery-main/contracts/libraries/PositionKey.sol +13 -0
  1089. package/lib/v3-periphery-main/contracts/libraries/PositionValue.sol +167 -0
  1090. package/lib/v3-periphery-main/contracts/libraries/SqrtPriceMathPartial.sol +62 -0
  1091. package/lib/v3-periphery-main/contracts/libraries/TokenRatioSortOrder.sol +12 -0
  1092. package/lib/v3-periphery-main/contracts/libraries/TransferHelper.sol +60 -0
  1093. package/lib/v3-periphery-main/contracts/test/Base64Test.sol +16 -0
  1094. package/lib/v3-periphery-main/contracts/test/LiquidityAmountsTest.sol +120 -0
  1095. package/lib/v3-periphery-main/contracts/test/MockObservable.sol +48 -0
  1096. package/lib/v3-periphery-main/contracts/test/MockObservations.sol +82 -0
  1097. package/lib/v3-periphery-main/contracts/test/MockTimeNonfungiblePositionManager.sol +23 -0
  1098. package/lib/v3-periphery-main/contracts/test/MockTimeSwapRouter.sol +19 -0
  1099. package/lib/v3-periphery-main/contracts/test/NFTDescriptorTest.sol +75 -0
  1100. package/lib/v3-periphery-main/contracts/test/NonfungiblePositionManagerPositionsGasTest.sol +18 -0
  1101. package/lib/v3-periphery-main/contracts/test/OracleTest.sol +67 -0
  1102. package/lib/v3-periphery-main/contracts/test/PathTest.sol +37 -0
  1103. package/lib/v3-periphery-main/contracts/test/PeripheryImmutableStateTest.sol +8 -0
  1104. package/lib/v3-periphery-main/contracts/test/PoolAddressTest.sol +30 -0
  1105. package/lib/v3-periphery-main/contracts/test/PoolTicksCounterTest.sol +18 -0
  1106. package/lib/v3-periphery-main/contracts/test/PositionValueTest.sol +57 -0
  1107. package/lib/v3-periphery-main/contracts/test/SelfPermitTest.sol +9 -0
  1108. package/lib/v3-periphery-main/contracts/test/TestCallbackValidation.sol +15 -0
  1109. package/lib/v3-periphery-main/contracts/test/TestERC20.sol +10 -0
  1110. package/lib/v3-periphery-main/contracts/test/TestERC20Metadata.sol +14 -0
  1111. package/lib/v3-periphery-main/contracts/test/TestERC20PermitAllowed.sol +24 -0
  1112. package/lib/v3-periphery-main/contracts/test/TestMulticall.sol +30 -0
  1113. package/lib/v3-periphery-main/contracts/test/TestPositionNFTOwner.sol +28 -0
  1114. package/lib/v3-periphery-main/contracts/test/TestUniswapV3Callee.sol +62 -0
  1115. package/lib/v3-periphery-main/contracts/test/TickLensTest.sol +15 -0
  1116. package/lib/v3-periphery-main/deploys.md +25 -0
  1117. package/lib/v3-periphery-main/hardhat.config.ts +104 -0
  1118. package/lib/v3-periphery-main/package.json +68 -0
  1119. package/lib/v3-periphery-main/test/Base64.spec.ts +81 -0
  1120. package/lib/v3-periphery-main/test/CallbackValidation.spec.ts +56 -0
  1121. package/lib/v3-periphery-main/test/LiquidityAmounts.spec.ts +241 -0
  1122. package/lib/v3-periphery-main/test/Multicall.spec.ts +65 -0
  1123. package/lib/v3-periphery-main/test/NFTDescriptor.spec.ts +907 -0
  1124. package/lib/v3-periphery-main/test/NonfungiblePositionManager.spec.ts +1304 -0
  1125. package/lib/v3-periphery-main/test/NonfungibleTokenPositionDescriptor.spec.ts +217 -0
  1126. package/lib/v3-periphery-main/test/OracleLibrary.spec.ts +675 -0
  1127. package/lib/v3-periphery-main/test/PairFlash.spec.ts +168 -0
  1128. package/lib/v3-periphery-main/test/Path.spec.ts +90 -0
  1129. package/lib/v3-periphery-main/test/PeripheryImmutableState.spec.ts +56 -0
  1130. package/lib/v3-periphery-main/test/PoolAddress.spec.ts +72 -0
  1131. package/lib/v3-periphery-main/test/PoolTicksCounter.spec.ts +280 -0
  1132. package/lib/v3-periphery-main/test/PositionValue.spec.ts +490 -0
  1133. package/lib/v3-periphery-main/test/Quoter.spec.ts +201 -0
  1134. package/lib/v3-periphery-main/test/QuoterV2.spec.ts +578 -0
  1135. package/lib/v3-periphery-main/test/SelfPermit.spec.ts +198 -0
  1136. package/lib/v3-periphery-main/test/SwapRouter.gas.spec.ts +453 -0
  1137. package/lib/v3-periphery-main/test/SwapRouter.spec.ts +916 -0
  1138. package/lib/v3-periphery-main/test/TickLens.spec.ts +223 -0
  1139. package/lib/v3-periphery-main/test/V3Migrator.spec.ts +446 -0
  1140. package/lib/v3-periphery-main/test/__snapshots__/Base64.spec.ts.snap +32 -0
  1141. package/lib/v3-periphery-main/test/__snapshots__/LiquidityAmounts.spec.ts.snap +21 -0
  1142. package/lib/v3-periphery-main/test/__snapshots__/Multicall.spec.ts.snap +5 -0
  1143. package/lib/v3-periphery-main/test/__snapshots__/NFTDescriptor.spec.ts.snap +7 -0
  1144. package/lib/v3-periphery-main/test/__snapshots__/NFTDescriptor.svg +1 -0
  1145. package/lib/v3-periphery-main/test/__snapshots__/NonfungiblePositionManager.spec.ts.snap +41 -0
  1146. package/lib/v3-periphery-main/test/__snapshots__/OracleLibrary.spec.ts.snap +3 -0
  1147. package/lib/v3-periphery-main/test/__snapshots__/PairFlash.spec.ts.snap +3 -0
  1148. package/lib/v3-periphery-main/test/__snapshots__/Path.spec.ts.snap +3 -0
  1149. package/lib/v3-periphery-main/test/__snapshots__/PeripheryImmutableState.spec.ts.snap +3 -0
  1150. package/lib/v3-periphery-main/test/__snapshots__/PoolAddress.spec.ts.snap +5 -0
  1151. package/lib/v3-periphery-main/test/__snapshots__/PositionValue.spec.ts.snap +11 -0
  1152. package/lib/v3-periphery-main/test/__snapshots__/QuoterV2.spec.ts.snap +51 -0
  1153. package/lib/v3-periphery-main/test/__snapshots__/SwapRouter.gas.spec.ts.snap +37 -0
  1154. package/lib/v3-periphery-main/test/__snapshots__/SwapRouter.spec.ts.snap +3 -0
  1155. package/lib/v3-periphery-main/test/__snapshots__/TickLens.spec.ts.snap +5 -0
  1156. package/lib/v3-periphery-main/test/__snapshots__/V3Migrator.spec.ts.snap +3 -0
  1157. package/lib/v3-periphery-main/test/contracts/WETH9.json +156 -0
  1158. package/lib/v3-periphery-main/test/shared/base64.ts +7 -0
  1159. package/lib/v3-periphery-main/test/shared/completeFixture.ts +63 -0
  1160. package/lib/v3-periphery-main/test/shared/computePoolAddress.ts +22 -0
  1161. package/lib/v3-periphery-main/test/shared/constants.ts +15 -0
  1162. package/lib/v3-periphery-main/test/shared/encodePriceSqrt.ts +16 -0
  1163. package/lib/v3-periphery-main/test/shared/expandTo18Decimals.ts +5 -0
  1164. package/lib/v3-periphery-main/test/shared/expect.ts +8 -0
  1165. package/lib/v3-periphery-main/test/shared/externalFixtures.ts +57 -0
  1166. package/lib/v3-periphery-main/test/shared/extractJSONFromURI.ts +5 -0
  1167. package/lib/v3-periphery-main/test/shared/formatSqrtRatioX96.spec.ts +30 -0
  1168. package/lib/v3-periphery-main/test/shared/formatSqrtRatioX96.ts +30 -0
  1169. package/lib/v3-periphery-main/test/shared/getPermitNFTSignature.ts +57 -0
  1170. package/lib/v3-periphery-main/test/shared/path.ts +61 -0
  1171. package/lib/v3-periphery-main/test/shared/permit.ts +61 -0
  1172. package/lib/v3-periphery-main/test/shared/poolAtAddress.ts +7 -0
  1173. package/lib/v3-periphery-main/test/shared/quoter.ts +153 -0
  1174. package/lib/v3-periphery-main/test/shared/snapshotGasCost.ts +27 -0
  1175. package/lib/v3-periphery-main/test/shared/ticks.ts +9 -0
  1176. package/lib/v3-periphery-main/test/shared/tokenSort.ts +10 -0
  1177. package/lib/v3-periphery-main/testnet-deploys.md +3 -0
  1178. package/lib/v3-periphery-main/tsconfig.json +14 -0
  1179. package/lib/v3-periphery-main/yarn.lock +8111 -0
  1180. package/package.json +44 -0
  1181. package/src/LPStateStorage.sol +74 -0
  1182. package/src/MinimalPositionDescriptor.sol +38 -0
  1183. package/src/NonfungiblePositionManagerImporter.sol +13 -0
  1184. package/src/QuoterV2Importer.sol +9 -0
  1185. package/src/RapidexV3FactoryImporter.sol +6 -0
  1186. package/src/SwapRouterImporter.sol +9 -0
  1187. package/src/TestToken.sol +60 -0
  1188. package/src/WMST.sol +63 -0
  1189. package/src/flattened/LPStateStorage.flat.sol +76 -0
  1190. package/src/flattened/MinimalPositionDescriptor.flat.sol +40 -0
  1191. package/src/flattened/NonfungiblePositionManagerImporter.flat.sol +2695 -0
  1192. package/src/flattened/QuoterV2Importer.flat.sol +1616 -0
  1193. package/src/flattened/RapidexV3FactoryImporter.flat.sol +3193 -0
  1194. package/src/flattened/SwapRouterImporter.flat.sol +1811 -0
  1195. package/src/flattened/TestToken.flat.sol +62 -0
  1196. package/src/flattened/WMST.flat.sol +65 -0
@@ -0,0 +1,1616 @@
1
+ // SPDX-License-Identifier: MIT
2
+ pragma solidity <0.8.0 =0.7.6 >=0.5.0 >=0.6.0 >=0.7.5;
3
+ pragma abicoder v2;
4
+
5
+ // lib/v3-core-main/contracts/libraries/BitMath.sol
6
+
7
+ /// @title BitMath
8
+ /// @dev This library provides functionality for computing bit properties of an unsigned integer
9
+ library BitMath {
10
+ /// @notice Returns the index of the most significant bit of the number,
11
+ /// where the least significant bit is at index 0 and the most significant bit is at index 255
12
+ /// @dev The function satisfies the property:
13
+ /// x >= 2**mostSignificantBit(x) and x < 2**(mostSignificantBit(x)+1)
14
+ /// @param x the value for which to compute the most significant bit, must be greater than 0
15
+ /// @return r the index of the most significant bit
16
+ function mostSignificantBit(uint256 x) internal pure returns (uint8 r) {
17
+ require(x > 0);
18
+
19
+ if (x >= 0x100000000000000000000000000000000) {
20
+ x >>= 128;
21
+ r += 128;
22
+ }
23
+ if (x >= 0x10000000000000000) {
24
+ x >>= 64;
25
+ r += 64;
26
+ }
27
+ if (x >= 0x100000000) {
28
+ x >>= 32;
29
+ r += 32;
30
+ }
31
+ if (x >= 0x10000) {
32
+ x >>= 16;
33
+ r += 16;
34
+ }
35
+ if (x >= 0x100) {
36
+ x >>= 8;
37
+ r += 8;
38
+ }
39
+ if (x >= 0x10) {
40
+ x >>= 4;
41
+ r += 4;
42
+ }
43
+ if (x >= 0x4) {
44
+ x >>= 2;
45
+ r += 2;
46
+ }
47
+ if (x >= 0x2) r += 1;
48
+ }
49
+
50
+ /// @notice Returns the index of the least significant bit of the number,
51
+ /// where the least significant bit is at index 0 and the most significant bit is at index 255
52
+ /// @dev The function satisfies the property:
53
+ /// (x & 2**leastSignificantBit(x)) != 0 and (x & (2**(leastSignificantBit(x)) - 1)) == 0)
54
+ /// @param x the value for which to compute the least significant bit, must be greater than 0
55
+ /// @return r the index of the least significant bit
56
+ function leastSignificantBit(uint256 x) internal pure returns (uint8 r) {
57
+ require(x > 0);
58
+
59
+ r = 255;
60
+ if (x & type(uint128).max > 0) {
61
+ r -= 128;
62
+ } else {
63
+ x >>= 128;
64
+ }
65
+ if (x & type(uint64).max > 0) {
66
+ r -= 64;
67
+ } else {
68
+ x >>= 64;
69
+ }
70
+ if (x & type(uint32).max > 0) {
71
+ r -= 32;
72
+ } else {
73
+ x >>= 32;
74
+ }
75
+ if (x & type(uint16).max > 0) {
76
+ r -= 16;
77
+ } else {
78
+ x >>= 16;
79
+ }
80
+ if (x & type(uint8).max > 0) {
81
+ r -= 8;
82
+ } else {
83
+ x >>= 8;
84
+ }
85
+ if (x & 0xf > 0) {
86
+ r -= 4;
87
+ } else {
88
+ x >>= 4;
89
+ }
90
+ if (x & 0x3 > 0) {
91
+ r -= 2;
92
+ } else {
93
+ x >>= 2;
94
+ }
95
+ if (x & 0x1 > 0) r -= 1;
96
+ }
97
+ }
98
+
99
+ // lib/v3-periphery-main/contracts/libraries/BytesLib.sol
100
+
101
+ /*
102
+ * @title Solidity Bytes Arrays Utils
103
+ * @author Gonçalo Sá <goncalo.sa@consensys.net>
104
+ *
105
+ * @dev Bytes tightly packed arrays utility library for ethereum contracts written in Solidity.
106
+ * The library lets you concatenate, slice and type cast bytes arrays both in memory and storage.
107
+ */
108
+
109
+ library BytesLib {
110
+ function slice(
111
+ bytes memory _bytes,
112
+ uint256 _start,
113
+ uint256 _length
114
+ ) internal pure returns (bytes memory) {
115
+ require(_length + 31 >= _length, 'slice_overflow');
116
+ require(_start + _length >= _start, 'slice_overflow');
117
+ require(_bytes.length >= _start + _length, 'slice_outOfBounds');
118
+
119
+ bytes memory tempBytes;
120
+
121
+ assembly {
122
+ switch iszero(_length)
123
+ case 0 {
124
+ // Get a location of some free memory and store it in tempBytes as
125
+ // Solidity does for memory variables.
126
+ tempBytes := mload(0x40)
127
+
128
+ // The first word of the slice result is potentially a partial
129
+ // word read from the original array. To read it, we calculate
130
+ // the length of that partial word and start copying that many
131
+ // bytes into the array. The first word we copy will start with
132
+ // data we don't care about, but the last `lengthmod` bytes will
133
+ // land at the beginning of the contents of the new array. When
134
+ // we're done copying, we overwrite the full first word with
135
+ // the actual length of the slice.
136
+ let lengthmod := and(_length, 31)
137
+
138
+ // The multiplication in the next line is necessary
139
+ // because when slicing multiples of 32 bytes (lengthmod == 0)
140
+ // the following copy loop was copying the origin's length
141
+ // and then ending prematurely not copying everything it should.
142
+ let mc := add(add(tempBytes, lengthmod), mul(0x20, iszero(lengthmod)))
143
+ let end := add(mc, _length)
144
+
145
+ for {
146
+ // The multiplication in the next line has the same exact purpose
147
+ // as the one above.
148
+ let cc := add(add(add(_bytes, lengthmod), mul(0x20, iszero(lengthmod))), _start)
149
+ } lt(mc, end) {
150
+ mc := add(mc, 0x20)
151
+ cc := add(cc, 0x20)
152
+ } {
153
+ mstore(mc, mload(cc))
154
+ }
155
+
156
+ mstore(tempBytes, _length)
157
+
158
+ //update free-memory pointer
159
+ //allocating the array padded to 32 bytes like the compiler does now
160
+ mstore(0x40, and(add(mc, 31), not(31)))
161
+ }
162
+ //if we want a zero-length slice let's just return a zero-length array
163
+ default {
164
+ tempBytes := mload(0x40)
165
+ //zero out the 32 bytes slice we are about to return
166
+ //we need to do it because Solidity does not garbage collect
167
+ mstore(tempBytes, 0)
168
+
169
+ mstore(0x40, add(tempBytes, 0x20))
170
+ }
171
+ }
172
+
173
+ return tempBytes;
174
+ }
175
+
176
+ function toAddress(bytes memory _bytes, uint256 _start) internal pure returns (address) {
177
+ require(_start + 20 >= _start, 'toAddress_overflow');
178
+ require(_bytes.length >= _start + 20, 'toAddress_outOfBounds');
179
+ address tempAddress;
180
+
181
+ assembly {
182
+ tempAddress := div(mload(add(add(_bytes, 0x20), _start)), 0x1000000000000000000000000)
183
+ }
184
+
185
+ return tempAddress;
186
+ }
187
+
188
+ function toUint24(bytes memory _bytes, uint256 _start) internal pure returns (uint24) {
189
+ require(_start + 3 >= _start, 'toUint24_overflow');
190
+ require(_bytes.length >= _start + 3, 'toUint24_outOfBounds');
191
+ uint24 tempUint;
192
+
193
+ assembly {
194
+ tempUint := mload(add(add(_bytes, 0x3), _start))
195
+ }
196
+
197
+ return tempUint;
198
+ }
199
+ }
200
+
201
+ // lib/v3-periphery-main/contracts/interfaces/IPeripheryImmutableState.sol
202
+
203
+ /// @title Immutable state
204
+ /// @notice Functions that return immutable state of the router
205
+ interface IPeripheryImmutableState {
206
+ /// @return Returns the address of the Uniswap V3 factory
207
+ function factory() external view returns (address);
208
+
209
+ /// @return Returns the address of WETH9
210
+ function WETH9() external view returns (address);
211
+ }
212
+
213
+ // lib/v3-periphery-main/contracts/interfaces/IQuoterV2.sol
214
+
215
+ /// @title QuoterV2 Interface
216
+ /// @notice Supports quoting the calculated amounts from exact input or exact output swaps.
217
+ /// @notice For each pool also tells you the number of initialized ticks crossed and the sqrt price of the pool after the swap.
218
+ /// @dev These functions are not marked view because they rely on calling non-view functions and reverting
219
+ /// to compute the result. They are also not gas efficient and should not be called on-chain.
220
+ interface IQuoterV2 {
221
+ /// @notice Returns the amount out received for a given exact input swap without executing the swap
222
+ /// @param path The path of the swap, i.e. each token pair and the pool fee
223
+ /// @param amountIn The amount of the first token to swap
224
+ /// @return amountOut The amount of the last token that would be received
225
+ /// @return sqrtPriceX96AfterList List of the sqrt price after the swap for each pool in the path
226
+ /// @return initializedTicksCrossedList List of the initialized ticks that the swap crossed for each pool in the path
227
+ /// @return gasEstimate The estimate of the gas that the swap consumes
228
+ function quoteExactInput(bytes memory path, uint256 amountIn)
229
+ external
230
+ returns (
231
+ uint256 amountOut,
232
+ uint160[] memory sqrtPriceX96AfterList,
233
+ uint32[] memory initializedTicksCrossedList,
234
+ uint256 gasEstimate
235
+ );
236
+
237
+ struct QuoteExactInputSingleParams {
238
+ address tokenIn;
239
+ address tokenOut;
240
+ uint256 amountIn;
241
+ uint24 fee;
242
+ uint160 sqrtPriceLimitX96;
243
+ }
244
+
245
+ /// @notice Returns the amount out received for a given exact input but for a swap of a single pool
246
+ /// @param params The params for the quote, encoded as `QuoteExactInputSingleParams`
247
+ /// tokenIn The token being swapped in
248
+ /// tokenOut The token being swapped out
249
+ /// fee The fee of the token pool to consider for the pair
250
+ /// amountIn The desired input amount
251
+ /// sqrtPriceLimitX96 The price limit of the pool that cannot be exceeded by the swap
252
+ /// @return amountOut The amount of `tokenOut` that would be received
253
+ /// @return sqrtPriceX96After The sqrt price of the pool after the swap
254
+ /// @return initializedTicksCrossed The number of initialized ticks that the swap crossed
255
+ /// @return gasEstimate The estimate of the gas that the swap consumes
256
+ function quoteExactInputSingle(QuoteExactInputSingleParams memory params)
257
+ external
258
+ returns (
259
+ uint256 amountOut,
260
+ uint160 sqrtPriceX96After,
261
+ uint32 initializedTicksCrossed,
262
+ uint256 gasEstimate
263
+ );
264
+
265
+ /// @notice Returns the amount in required for a given exact output swap without executing the swap
266
+ /// @param path The path of the swap, i.e. each token pair and the pool fee. Path must be provided in reverse order
267
+ /// @param amountOut The amount of the last token to receive
268
+ /// @return amountIn The amount of first token required to be paid
269
+ /// @return sqrtPriceX96AfterList List of the sqrt price after the swap for each pool in the path
270
+ /// @return initializedTicksCrossedList List of the initialized ticks that the swap crossed for each pool in the path
271
+ /// @return gasEstimate The estimate of the gas that the swap consumes
272
+ function quoteExactOutput(bytes memory path, uint256 amountOut)
273
+ external
274
+ returns (
275
+ uint256 amountIn,
276
+ uint160[] memory sqrtPriceX96AfterList,
277
+ uint32[] memory initializedTicksCrossedList,
278
+ uint256 gasEstimate
279
+ );
280
+
281
+ struct QuoteExactOutputSingleParams {
282
+ address tokenIn;
283
+ address tokenOut;
284
+ uint256 amount;
285
+ uint24 fee;
286
+ uint160 sqrtPriceLimitX96;
287
+ }
288
+
289
+ /// @notice Returns the amount in required to receive the given exact output amount but for a swap of a single pool
290
+ /// @param params The params for the quote, encoded as `QuoteExactOutputSingleParams`
291
+ /// tokenIn The token being swapped in
292
+ /// tokenOut The token being swapped out
293
+ /// fee The fee of the token pool to consider for the pair
294
+ /// amountOut The desired output amount
295
+ /// sqrtPriceLimitX96 The price limit of the pool that cannot be exceeded by the swap
296
+ /// @return amountIn The amount required as the input for the swap in order to receive `amountOut`
297
+ /// @return sqrtPriceX96After The sqrt price of the pool after the swap
298
+ /// @return initializedTicksCrossed The number of initialized ticks that the swap crossed
299
+ /// @return gasEstimate The estimate of the gas that the swap consumes
300
+ function quoteExactOutputSingle(QuoteExactOutputSingleParams memory params)
301
+ external
302
+ returns (
303
+ uint256 amountIn,
304
+ uint160 sqrtPriceX96After,
305
+ uint32 initializedTicksCrossed,
306
+ uint256 gasEstimate
307
+ );
308
+ }
309
+
310
+ // lib/v3-core-main/contracts/interfaces/pool/IUniswapV3PoolActions.sol
311
+
312
+ /// @title Permissionless pool actions
313
+ /// @notice Contains pool methods that can be called by anyone
314
+ interface IUniswapV3PoolActions {
315
+ /// @notice Sets the initial price for the pool
316
+ /// @dev Price is represented as a sqrt(amountToken1/amountToken0) Q64.96 value
317
+ /// @param sqrtPriceX96 the initial sqrt price of the pool as a Q64.96
318
+ function initialize(uint160 sqrtPriceX96) external;
319
+
320
+ /// @notice Adds liquidity for the given recipient/tickLower/tickUpper position
321
+ /// @dev The caller of this method receives a callback in the form of IUniswapV3MintCallback#uniswapV3MintCallback
322
+ /// in which they must pay any token0 or token1 owed for the liquidity. The amount of token0/token1 due depends
323
+ /// on tickLower, tickUpper, the amount of liquidity, and the current price.
324
+ /// @param recipient The address for which the liquidity will be created
325
+ /// @param tickLower The lower tick of the position in which to add liquidity
326
+ /// @param tickUpper The upper tick of the position in which to add liquidity
327
+ /// @param amount The amount of liquidity to mint
328
+ /// @param data Any data that should be passed through to the callback
329
+ /// @return amount0 The amount of token0 that was paid to mint the given amount of liquidity. Matches the value in the callback
330
+ /// @return amount1 The amount of token1 that was paid to mint the given amount of liquidity. Matches the value in the callback
331
+ function mint(
332
+ address recipient,
333
+ int24 tickLower,
334
+ int24 tickUpper,
335
+ uint128 amount,
336
+ bytes calldata data
337
+ ) external returns (uint256 amount0, uint256 amount1);
338
+
339
+ /// @notice Collects tokens owed to a position
340
+ /// @dev Does not recompute fees earned, which must be done either via mint or burn of any amount of liquidity.
341
+ /// Collect must be called by the position owner. To withdraw only token0 or only token1, amount0Requested or
342
+ /// amount1Requested may be set to zero. To withdraw all tokens owed, caller may pass any value greater than the
343
+ /// actual tokens owed, e.g. type(uint128).max. Tokens owed may be from accumulated swap fees or burned liquidity.
344
+ /// @param recipient The address which should receive the fees collected
345
+ /// @param tickLower The lower tick of the position for which to collect fees
346
+ /// @param tickUpper The upper tick of the position for which to collect fees
347
+ /// @param amount0Requested How much token0 should be withdrawn from the fees owed
348
+ /// @param amount1Requested How much token1 should be withdrawn from the fees owed
349
+ /// @return amount0 The amount of fees collected in token0
350
+ /// @return amount1 The amount of fees collected in token1
351
+ function collect(
352
+ address recipient,
353
+ int24 tickLower,
354
+ int24 tickUpper,
355
+ uint128 amount0Requested,
356
+ uint128 amount1Requested
357
+ ) external returns (uint128 amount0, uint128 amount1);
358
+
359
+ /// @notice Burn liquidity from the sender and account tokens owed for the liquidity to the position
360
+ /// @dev Can be used to trigger a recalculation of fees owed to a position by calling with an amount of 0
361
+ /// @dev Fees must be collected separately via a call to #collect
362
+ /// @param tickLower The lower tick of the position for which to burn liquidity
363
+ /// @param tickUpper The upper tick of the position for which to burn liquidity
364
+ /// @param amount How much liquidity to burn
365
+ /// @return amount0 The amount of token0 sent to the recipient
366
+ /// @return amount1 The amount of token1 sent to the recipient
367
+ function burn(
368
+ int24 tickLower,
369
+ int24 tickUpper,
370
+ uint128 amount
371
+ ) external returns (uint256 amount0, uint256 amount1);
372
+
373
+ /// @notice Swap token0 for token1, or token1 for token0
374
+ /// @dev The caller of this method receives a callback in the form of IUniswapV3SwapCallback#uniswapV3SwapCallback
375
+ /// @param recipient The address to receive the output of the swap
376
+ /// @param zeroForOne The direction of the swap, true for token0 to token1, false for token1 to token0
377
+ /// @param amountSpecified The amount of the swap, which implicitly configures the swap as exact input (positive), or exact output (negative)
378
+ /// @param sqrtPriceLimitX96 The Q64.96 sqrt price limit. If zero for one, the price cannot be less than this
379
+ /// value after the swap. If one for zero, the price cannot be greater than this value after the swap
380
+ /// @param data Any data to be passed through to the callback
381
+ /// @return amount0 The delta of the balance of token0 of the pool, exact when negative, minimum when positive
382
+ /// @return amount1 The delta of the balance of token1 of the pool, exact when negative, minimum when positive
383
+ function swap(
384
+ address recipient,
385
+ bool zeroForOne,
386
+ int256 amountSpecified,
387
+ uint160 sqrtPriceLimitX96,
388
+ bytes calldata data
389
+ ) external returns (int256 amount0, int256 amount1);
390
+
391
+ /// @notice Receive token0 and/or token1 and pay it back, plus a fee, in the callback
392
+ /// @dev The caller of this method receives a callback in the form of IUniswapV3FlashCallback#uniswapV3FlashCallback
393
+ /// @dev Can be used to donate underlying tokens pro-rata to currently in-range liquidity providers by calling
394
+ /// with 0 amount{0,1} and sending the donation amount(s) from the callback
395
+ /// @param recipient The address which will receive the token0 and token1 amounts
396
+ /// @param amount0 The amount of token0 to send
397
+ /// @param amount1 The amount of token1 to send
398
+ /// @param data Any data to be passed through to the callback
399
+ function flash(
400
+ address recipient,
401
+ uint256 amount0,
402
+ uint256 amount1,
403
+ bytes calldata data
404
+ ) external;
405
+
406
+ /// @notice Increase the maximum number of price and liquidity observations that this pool will store
407
+ /// @dev This method is no-op if the pool already has an observationCardinalityNext greater than or equal to
408
+ /// the input observationCardinalityNext.
409
+ /// @param observationCardinalityNext The desired minimum number of observations for the pool to store
410
+ function increaseObservationCardinalityNext(uint16 observationCardinalityNext) external;
411
+ }
412
+
413
+ // lib/v3-core-main/contracts/interfaces/pool/IUniswapV3PoolDerivedState.sol
414
+
415
+ /// @title Pool state that is not stored
416
+ /// @notice Contains view functions to provide information about the pool that is computed rather than stored on the
417
+ /// blockchain. The functions here may have variable gas costs.
418
+ interface IUniswapV3PoolDerivedState {
419
+ /// @notice Returns the cumulative tick and liquidity as of each timestamp `secondsAgo` from the current block timestamp
420
+ /// @dev To get a time weighted average tick or liquidity-in-range, you must call this with two values, one representing
421
+ /// the beginning of the period and another for the end of the period. E.g., to get the last hour time-weighted average tick,
422
+ /// you must call it with secondsAgos = [3600, 0].
423
+ /// @dev The time weighted average tick represents the geometric time weighted average price of the pool, in
424
+ /// log base sqrt(1.0001) of token1 / token0. The TickMath library can be used to go from a tick value to a ratio.
425
+ /// @param secondsAgos From how long ago each cumulative tick and liquidity value should be returned
426
+ /// @return tickCumulatives Cumulative tick values as of each `secondsAgos` from the current block timestamp
427
+ /// @return secondsPerLiquidityCumulativeX128s Cumulative seconds per liquidity-in-range value as of each `secondsAgos` from the current block
428
+ /// timestamp
429
+ function observe(uint32[] calldata secondsAgos)
430
+ external
431
+ view
432
+ returns (int56[] memory tickCumulatives, uint160[] memory secondsPerLiquidityCumulativeX128s);
433
+
434
+ /// @notice Returns a snapshot of the tick cumulative, seconds per liquidity and seconds inside a tick range
435
+ /// @dev Snapshots must only be compared to other snapshots, taken over a period for which a position existed.
436
+ /// I.e., snapshots cannot be compared if a position is not held for the entire period between when the first
437
+ /// snapshot is taken and the second snapshot is taken.
438
+ /// @param tickLower The lower tick of the range
439
+ /// @param tickUpper The upper tick of the range
440
+ /// @return tickCumulativeInside The snapshot of the tick accumulator for the range
441
+ /// @return secondsPerLiquidityInsideX128 The snapshot of seconds per liquidity for the range
442
+ /// @return secondsInside The snapshot of seconds per liquidity for the range
443
+ function snapshotCumulativesInside(int24 tickLower, int24 tickUpper)
444
+ external
445
+ view
446
+ returns (
447
+ int56 tickCumulativeInside,
448
+ uint160 secondsPerLiquidityInsideX128,
449
+ uint32 secondsInside
450
+ );
451
+ }
452
+
453
+ // lib/v3-core-main/contracts/interfaces/pool/IUniswapV3PoolEvents.sol
454
+
455
+ /// @title Events emitted by a pool
456
+ /// @notice Contains all events emitted by the pool
457
+ interface IUniswapV3PoolEvents {
458
+ /// @notice Emitted exactly once by a pool when #initialize is first called on the pool
459
+ /// @dev Mint/Burn/Swap cannot be emitted by the pool before Initialize
460
+ /// @param sqrtPriceX96 The initial sqrt price of the pool, as a Q64.96
461
+ /// @param tick The initial tick of the pool, i.e. log base 1.0001 of the starting price of the pool
462
+ event Initialize(uint160 sqrtPriceX96, int24 tick);
463
+
464
+ /// @notice Emitted when liquidity is minted for a given position
465
+ /// @param sender The address that minted the liquidity
466
+ /// @param owner The owner of the position and recipient of any minted liquidity
467
+ /// @param tickLower The lower tick of the position
468
+ /// @param tickUpper The upper tick of the position
469
+ /// @param amount The amount of liquidity minted to the position range
470
+ /// @param amount0 How much token0 was required for the minted liquidity
471
+ /// @param amount1 How much token1 was required for the minted liquidity
472
+ event Mint(
473
+ address sender,
474
+ address indexed owner,
475
+ int24 indexed tickLower,
476
+ int24 indexed tickUpper,
477
+ uint128 amount,
478
+ uint256 amount0,
479
+ uint256 amount1
480
+ );
481
+
482
+ /// @notice Emitted when fees are collected by the owner of a position
483
+ /// @dev Collect events may be emitted with zero amount0 and amount1 when the caller chooses not to collect fees
484
+ /// @param owner The owner of the position for which fees are collected
485
+ /// @param tickLower The lower tick of the position
486
+ /// @param tickUpper The upper tick of the position
487
+ /// @param amount0 The amount of token0 fees collected
488
+ /// @param amount1 The amount of token1 fees collected
489
+ event Collect(
490
+ address indexed owner,
491
+ address recipient,
492
+ int24 indexed tickLower,
493
+ int24 indexed tickUpper,
494
+ uint128 amount0,
495
+ uint128 amount1
496
+ );
497
+
498
+ /// @notice Emitted when a position's liquidity is removed
499
+ /// @dev Does not withdraw any fees earned by the liquidity position, which must be withdrawn via #collect
500
+ /// @param owner The owner of the position for which liquidity is removed
501
+ /// @param tickLower The lower tick of the position
502
+ /// @param tickUpper The upper tick of the position
503
+ /// @param amount The amount of liquidity to remove
504
+ /// @param amount0 The amount of token0 withdrawn
505
+ /// @param amount1 The amount of token1 withdrawn
506
+ event Burn(
507
+ address indexed owner,
508
+ int24 indexed tickLower,
509
+ int24 indexed tickUpper,
510
+ uint128 amount,
511
+ uint256 amount0,
512
+ uint256 amount1
513
+ );
514
+
515
+ /// @notice Emitted by the pool for any swaps between token0 and token1
516
+ /// @param sender The address that initiated the swap call, and that received the callback
517
+ /// @param recipient The address that received the output of the swap
518
+ /// @param amount0 The delta of the token0 balance of the pool
519
+ /// @param amount1 The delta of the token1 balance of the pool
520
+ /// @param sqrtPriceX96 The sqrt(price) of the pool after the swap, as a Q64.96
521
+ /// @param liquidity The liquidity of the pool after the swap
522
+ /// @param tick The log base 1.0001 of price of the pool after the swap
523
+ event Swap(
524
+ address indexed sender,
525
+ address indexed recipient,
526
+ int256 amount0,
527
+ int256 amount1,
528
+ uint160 sqrtPriceX96,
529
+ uint128 liquidity,
530
+ int24 tick
531
+ );
532
+
533
+ /// @notice Emitted by the pool for any flashes of token0/token1
534
+ /// @param sender The address that initiated the swap call, and that received the callback
535
+ /// @param recipient The address that received the tokens from flash
536
+ /// @param amount0 The amount of token0 that was flashed
537
+ /// @param amount1 The amount of token1 that was flashed
538
+ /// @param paid0 The amount of token0 paid for the flash, which can exceed the amount0 plus the fee
539
+ /// @param paid1 The amount of token1 paid for the flash, which can exceed the amount1 plus the fee
540
+ event Flash(
541
+ address indexed sender,
542
+ address indexed recipient,
543
+ uint256 amount0,
544
+ uint256 amount1,
545
+ uint256 paid0,
546
+ uint256 paid1
547
+ );
548
+
549
+ /// @notice Emitted by the pool for increases to the number of observations that can be stored
550
+ /// @dev observationCardinalityNext is not the observation cardinality until an observation is written at the index
551
+ /// just before a mint/swap/burn.
552
+ /// @param observationCardinalityNextOld The previous value of the next observation cardinality
553
+ /// @param observationCardinalityNextNew The updated value of the next observation cardinality
554
+ event IncreaseObservationCardinalityNext(
555
+ uint16 observationCardinalityNextOld,
556
+ uint16 observationCardinalityNextNew
557
+ );
558
+
559
+ /// @notice Emitted when the protocol fee is changed by the pool
560
+ /// @param feeProtocol0Old The previous value of the token0 protocol fee
561
+ /// @param feeProtocol1Old The previous value of the token1 protocol fee
562
+ /// @param feeProtocol0New The updated value of the token0 protocol fee
563
+ /// @param feeProtocol1New The updated value of the token1 protocol fee
564
+ event SetFeeProtocol(uint8 feeProtocol0Old, uint8 feeProtocol1Old, uint8 feeProtocol0New, uint8 feeProtocol1New);
565
+
566
+ /// @notice Emitted when the collected protocol fees are withdrawn by the factory owner
567
+ /// @param sender The address that collects the protocol fees
568
+ /// @param recipient The address that receives the collected protocol fees
569
+ /// @param amount0 The amount of token0 protocol fees that is withdrawn
570
+ /// @param amount0 The amount of token1 protocol fees that is withdrawn
571
+ event CollectProtocol(address indexed sender, address indexed recipient, uint128 amount0, uint128 amount1);
572
+ }
573
+
574
+ // lib/v3-core-main/contracts/interfaces/pool/IUniswapV3PoolImmutables.sol
575
+
576
+ /// @title Pool state that never changes
577
+ /// @notice These parameters are fixed for a pool forever, i.e., the methods will always return the same values
578
+ interface IUniswapV3PoolImmutables {
579
+ /// @notice The contract that deployed the pool, which must adhere to the IUniswapV3Factory interface
580
+ /// @return The contract address
581
+ function factory() external view returns (address);
582
+
583
+ /// @notice The first of the two tokens of the pool, sorted by address
584
+ /// @return The token contract address
585
+ function token0() external view returns (address);
586
+
587
+ /// @notice The second of the two tokens of the pool, sorted by address
588
+ /// @return The token contract address
589
+ function token1() external view returns (address);
590
+
591
+ /// @notice The pool's fee in hundredths of a bip, i.e. 1e-6
592
+ /// @return The fee
593
+ function fee() external view returns (uint24);
594
+
595
+ /// @notice The pool tick spacing
596
+ /// @dev Ticks can only be used at multiples of this value, minimum of 1 and always positive
597
+ /// e.g.: a tickSpacing of 3 means ticks can be initialized every 3rd tick, i.e., ..., -6, -3, 0, 3, 6, ...
598
+ /// This value is an int24 to avoid casting even though it is always positive.
599
+ /// @return The tick spacing
600
+ function tickSpacing() external view returns (int24);
601
+
602
+ /// @notice The maximum amount of position liquidity that can use any tick in the range
603
+ /// @dev This parameter is enforced per tick to prevent liquidity from overflowing a uint128 at any point, and
604
+ /// also prevents out-of-range liquidity from being used to prevent adding in-range liquidity to a pool
605
+ /// @return The max amount of liquidity per tick
606
+ function maxLiquidityPerTick() external view returns (uint128);
607
+ }
608
+
609
+ // lib/v3-core-main/contracts/interfaces/pool/IUniswapV3PoolOwnerActions.sol
610
+
611
+ /// @title Permissioned pool actions
612
+ /// @notice Contains pool methods that may only be called by the factory owner
613
+ interface IUniswapV3PoolOwnerActions {
614
+ /// @notice Set the denominator of the protocol's % share of the fees
615
+ /// @param feeProtocol0 new protocol fee for token0 of the pool
616
+ /// @param feeProtocol1 new protocol fee for token1 of the pool
617
+ function setFeeProtocol(uint8 feeProtocol0, uint8 feeProtocol1) external;
618
+
619
+ /// @notice Collect the protocol fee accrued to the pool
620
+ /// @param recipient The address to which collected protocol fees should be sent
621
+ /// @param amount0Requested The maximum amount of token0 to send, can be 0 to collect fees in only token1
622
+ /// @param amount1Requested The maximum amount of token1 to send, can be 0 to collect fees in only token0
623
+ /// @return amount0 The protocol fee collected in token0
624
+ /// @return amount1 The protocol fee collected in token1
625
+ function collectProtocol(
626
+ address recipient,
627
+ uint128 amount0Requested,
628
+ uint128 amount1Requested
629
+ ) external returns (uint128 amount0, uint128 amount1);
630
+ }
631
+
632
+ // lib/v3-core-main/contracts/interfaces/pool/IUniswapV3PoolState.sol
633
+
634
+ /// @title Pool state that can change
635
+ /// @notice These methods compose the pool's state, and can change with any frequency including multiple times
636
+ /// per transaction
637
+ interface IUniswapV3PoolState {
638
+ /// @notice The 0th storage slot in the pool stores many values, and is exposed as a single method to save gas
639
+ /// when accessed externally.
640
+ /// @return sqrtPriceX96 The current price of the pool as a sqrt(token1/token0) Q64.96 value
641
+ /// tick The current tick of the pool, i.e. according to the last tick transition that was run.
642
+ /// This value may not always be equal to SqrtTickMath.getTickAtSqrtRatio(sqrtPriceX96) if the price is on a tick
643
+ /// boundary.
644
+ /// observationIndex The index of the last oracle observation that was written,
645
+ /// observationCardinality The current maximum number of observations stored in the pool,
646
+ /// observationCardinalityNext The next maximum number of observations, to be updated when the observation.
647
+ /// feeProtocol The protocol fee for both tokens of the pool.
648
+ /// Encoded as two 4 bit values, where the protocol fee of token1 is shifted 4 bits and the protocol fee of token0
649
+ /// is the lower 4 bits. Used as the denominator of a fraction of the swap fee, e.g. 4 means 1/4th of the swap fee.
650
+ /// unlocked Whether the pool is currently locked to reentrancy
651
+ function slot0()
652
+ external
653
+ view
654
+ returns (
655
+ uint160 sqrtPriceX96,
656
+ int24 tick,
657
+ uint16 observationIndex,
658
+ uint16 observationCardinality,
659
+ uint16 observationCardinalityNext,
660
+ uint8 feeProtocol,
661
+ bool unlocked
662
+ );
663
+
664
+ /// @notice The fee growth as a Q128.128 fees of token0 collected per unit of liquidity for the entire life of the pool
665
+ /// @dev This value can overflow the uint256
666
+ function feeGrowthGlobal0X128() external view returns (uint256);
667
+
668
+ /// @notice The fee growth as a Q128.128 fees of token1 collected per unit of liquidity for the entire life of the pool
669
+ /// @dev This value can overflow the uint256
670
+ function feeGrowthGlobal1X128() external view returns (uint256);
671
+
672
+ /// @notice The amounts of token0 and token1 that are owed to the protocol
673
+ /// @dev Protocol fees will never exceed uint128 max in either token
674
+ function protocolFees() external view returns (uint128 token0, uint128 token1);
675
+
676
+ /// @notice The currently in range liquidity available to the pool
677
+ /// @dev This value has no relationship to the total liquidity across all ticks
678
+ function liquidity() external view returns (uint128);
679
+
680
+ /// @notice Look up information about a specific tick in the pool
681
+ /// @param tick The tick to look up
682
+ /// @return liquidityGross the total amount of position liquidity that uses the pool either as tick lower or
683
+ /// tick upper,
684
+ /// liquidityNet how much liquidity changes when the pool price crosses the tick,
685
+ /// feeGrowthOutside0X128 the fee growth on the other side of the tick from the current tick in token0,
686
+ /// feeGrowthOutside1X128 the fee growth on the other side of the tick from the current tick in token1,
687
+ /// tickCumulativeOutside the cumulative tick value on the other side of the tick from the current tick
688
+ /// secondsPerLiquidityOutsideX128 the seconds spent per liquidity on the other side of the tick from the current tick,
689
+ /// secondsOutside the seconds spent on the other side of the tick from the current tick,
690
+ /// initialized Set to true if the tick is initialized, i.e. liquidityGross is greater than 0, otherwise equal to false.
691
+ /// Outside values can only be used if the tick is initialized, i.e. if liquidityGross is greater than 0.
692
+ /// In addition, these values are only relative and must be used only in comparison to previous snapshots for
693
+ /// a specific position.
694
+ function ticks(int24 tick)
695
+ external
696
+ view
697
+ returns (
698
+ uint128 liquidityGross,
699
+ int128 liquidityNet,
700
+ uint256 feeGrowthOutside0X128,
701
+ uint256 feeGrowthOutside1X128,
702
+ int56 tickCumulativeOutside,
703
+ uint160 secondsPerLiquidityOutsideX128,
704
+ uint32 secondsOutside,
705
+ bool initialized
706
+ );
707
+
708
+ /// @notice Returns 256 packed tick initialized boolean values. See TickBitmap for more information
709
+ function tickBitmap(int16 wordPosition) external view returns (uint256);
710
+
711
+ /// @notice Returns the information about a position by the position's key
712
+ /// @param key The position's key is a hash of a preimage composed by the owner, tickLower and tickUpper
713
+ /// @return _liquidity The amount of liquidity in the position,
714
+ /// Returns feeGrowthInside0LastX128 fee growth of token0 inside the tick range as of the last mint/burn/poke,
715
+ /// Returns feeGrowthInside1LastX128 fee growth of token1 inside the tick range as of the last mint/burn/poke,
716
+ /// Returns tokensOwed0 the computed amount of token0 owed to the position as of the last mint/burn/poke,
717
+ /// Returns tokensOwed1 the computed amount of token1 owed to the position as of the last mint/burn/poke
718
+ function positions(bytes32 key)
719
+ external
720
+ view
721
+ returns (
722
+ uint128 _liquidity,
723
+ uint256 feeGrowthInside0LastX128,
724
+ uint256 feeGrowthInside1LastX128,
725
+ uint128 tokensOwed0,
726
+ uint128 tokensOwed1
727
+ );
728
+
729
+ /// @notice Returns data about a specific observation index
730
+ /// @param index The element of the observations array to fetch
731
+ /// @dev You most likely want to use #observe() instead of this method to get an observation as of some amount of time
732
+ /// ago, rather than at a specific index in the array.
733
+ /// @return blockTimestamp The timestamp of the observation,
734
+ /// Returns tickCumulative the tick multiplied by seconds elapsed for the life of the pool as of the observation timestamp,
735
+ /// Returns secondsPerLiquidityCumulativeX128 the seconds per in range liquidity for the life of the pool as of the observation timestamp,
736
+ /// Returns initialized whether the observation has been initialized and the values are safe to use
737
+ function observations(uint256 index)
738
+ external
739
+ view
740
+ returns (
741
+ uint32 blockTimestamp,
742
+ int56 tickCumulative,
743
+ uint160 secondsPerLiquidityCumulativeX128,
744
+ bool initialized
745
+ );
746
+ }
747
+
748
+ // lib/v3-core-main/contracts/interfaces/callback/IUniswapV3SwapCallback.sol
749
+
750
+ /// @title Callback for IUniswapV3PoolActions#swap
751
+ /// @notice Any contract that calls IUniswapV3PoolActions#swap must implement this interface
752
+ interface IUniswapV3SwapCallback {
753
+ /// @notice Called to `msg.sender` after executing a swap via IUniswapV3Pool#swap.
754
+ /// @dev In the implementation you must pay the pool tokens owed for the swap.
755
+ /// The caller of this method must be checked to be a UniswapV3Pool deployed by the canonical UniswapV3Factory.
756
+ /// amount0Delta and amount1Delta can both be 0 if no tokens were swapped.
757
+ /// @param amount0Delta The amount of token0 that was sent (negative) or must be received (positive) by the pool by
758
+ /// the end of the swap. If positive, the callback must send that amount of token0 to the pool.
759
+ /// @param amount1Delta The amount of token1 that was sent (negative) or must be received (positive) by the pool by
760
+ /// the end of the swap. If positive, the callback must send that amount of token1 to the pool.
761
+ /// @param data Any data passed through by the caller via the IUniswapV3PoolActions#swap call
762
+ function uniswapV3SwapCallback(
763
+ int256 amount0Delta,
764
+ int256 amount1Delta,
765
+ bytes calldata data
766
+ ) external;
767
+ }
768
+
769
+ // lib/v3-periphery-main/contracts/libraries/PoolAddress.sol
770
+
771
+ /// @title Provides functions for deriving a pool address from the factory, tokens, and the fee
772
+ library PoolAddress {
773
+ bytes32 internal constant POOL_INIT_CODE_HASH = 0xe34f199b19b2b4f47f68442619d555527d244f78a3297ea89325f843f87b8b54;
774
+
775
+ /// @notice The identifying key of the pool
776
+ struct PoolKey {
777
+ address token0;
778
+ address token1;
779
+ uint24 fee;
780
+ }
781
+
782
+ /// @notice Returns PoolKey: the ordered tokens with the matched fee levels
783
+ /// @param tokenA The first token of a pool, unsorted
784
+ /// @param tokenB The second token of a pool, unsorted
785
+ /// @param fee The fee level of the pool
786
+ /// @return Poolkey The pool details with ordered token0 and token1 assignments
787
+ function getPoolKey(
788
+ address tokenA,
789
+ address tokenB,
790
+ uint24 fee
791
+ ) internal pure returns (PoolKey memory) {
792
+ if (tokenA > tokenB) (tokenA, tokenB) = (tokenB, tokenA);
793
+ return PoolKey({token0: tokenA, token1: tokenB, fee: fee});
794
+ }
795
+
796
+ /// @notice Deterministically computes the pool address given the factory and PoolKey
797
+ /// @param factory The Uniswap V3 factory contract address
798
+ /// @param key The PoolKey
799
+ /// @return pool The contract address of the V3 pool
800
+ function computeAddress(address factory, PoolKey memory key) internal pure returns (address pool) {
801
+ require(key.token0 < key.token1);
802
+ pool = address(
803
+ uint256(
804
+ keccak256(
805
+ abi.encodePacked(
806
+ hex'ff',
807
+ factory,
808
+ keccak256(abi.encode(key.token0, key.token1, key.fee)),
809
+ POOL_INIT_CODE_HASH
810
+ )
811
+ )
812
+ )
813
+ );
814
+ }
815
+ }
816
+
817
+ // lib/v3-core-main/contracts/libraries/SafeCast.sol
818
+
819
+ /// @title Safe casting methods
820
+ /// @notice Contains methods for safely casting between types
821
+ library SafeCast {
822
+ /// @notice Cast a uint256 to a uint160, revert on overflow
823
+ /// @param y The uint256 to be downcasted
824
+ /// @return z The downcasted integer, now type uint160
825
+ function toUint160(uint256 y) internal pure returns (uint160 z) {
826
+ require((z = uint160(y)) == y);
827
+ }
828
+
829
+ /// @notice Cast a int256 to a int128, revert on overflow or underflow
830
+ /// @param y The int256 to be downcasted
831
+ /// @return z The downcasted integer, now type int128
832
+ function toInt128(int256 y) internal pure returns (int128 z) {
833
+ require((z = int128(y)) == y);
834
+ }
835
+
836
+ /// @notice Cast a uint256 to a int256, revert on overflow
837
+ /// @param y The uint256 to be casted
838
+ /// @return z The casted integer, now type int256
839
+ function toInt256(uint256 y) internal pure returns (int256 z) {
840
+ require(y < 2**255);
841
+ z = int256(y);
842
+ }
843
+ }
844
+
845
+ // lib/v3-core-main/contracts/libraries/TickMath.sol
846
+
847
+ /// @title Math library for computing sqrt prices from ticks and vice versa
848
+ /// @notice Computes sqrt price for ticks of size 1.0001, i.e. sqrt(1.0001^tick) as fixed point Q64.96 numbers. Supports
849
+ /// prices between 2**-128 and 2**128
850
+ library TickMath {
851
+ /// @dev The minimum tick that may be passed to #getSqrtRatioAtTick computed from log base 1.0001 of 2**-128
852
+ int24 internal constant MIN_TICK = -887272;
853
+ /// @dev The maximum tick that may be passed to #getSqrtRatioAtTick computed from log base 1.0001 of 2**128
854
+ int24 internal constant MAX_TICK = -MIN_TICK;
855
+
856
+ /// @dev The minimum value that can be returned from #getSqrtRatioAtTick. Equivalent to getSqrtRatioAtTick(MIN_TICK)
857
+ uint160 internal constant MIN_SQRT_RATIO = 4295128739;
858
+ /// @dev The maximum value that can be returned from #getSqrtRatioAtTick. Equivalent to getSqrtRatioAtTick(MAX_TICK)
859
+ uint160 internal constant MAX_SQRT_RATIO = 1461446703485210103287273052203988822378723970342;
860
+
861
+ /// @notice Calculates sqrt(1.0001^tick) * 2^96
862
+ /// @dev Throws if |tick| > max tick
863
+ /// @param tick The input tick for the above formula
864
+ /// @return sqrtPriceX96 A Fixed point Q64.96 number representing the sqrt of the ratio of the two assets (token1/token0)
865
+ /// at the given tick
866
+ function getSqrtRatioAtTick(int24 tick) internal pure returns (uint160 sqrtPriceX96) {
867
+ uint256 absTick = tick < 0 ? uint256(-int256(tick)) : uint256(int256(tick));
868
+ require(absTick <= uint256(MAX_TICK), 'T');
869
+
870
+ uint256 ratio = absTick & 0x1 != 0 ? 0xfffcb933bd6fad37aa2d162d1a594001 : 0x100000000000000000000000000000000;
871
+ if (absTick & 0x2 != 0) ratio = (ratio * 0xfff97272373d413259a46990580e213a) >> 128;
872
+ if (absTick & 0x4 != 0) ratio = (ratio * 0xfff2e50f5f656932ef12357cf3c7fdcc) >> 128;
873
+ if (absTick & 0x8 != 0) ratio = (ratio * 0xffe5caca7e10e4e61c3624eaa0941cd0) >> 128;
874
+ if (absTick & 0x10 != 0) ratio = (ratio * 0xffcb9843d60f6159c9db58835c926644) >> 128;
875
+ if (absTick & 0x20 != 0) ratio = (ratio * 0xff973b41fa98c081472e6896dfb254c0) >> 128;
876
+ if (absTick & 0x40 != 0) ratio = (ratio * 0xff2ea16466c96a3843ec78b326b52861) >> 128;
877
+ if (absTick & 0x80 != 0) ratio = (ratio * 0xfe5dee046a99a2a811c461f1969c3053) >> 128;
878
+ if (absTick & 0x100 != 0) ratio = (ratio * 0xfcbe86c7900a88aedcffc83b479aa3a4) >> 128;
879
+ if (absTick & 0x200 != 0) ratio = (ratio * 0xf987a7253ac413176f2b074cf7815e54) >> 128;
880
+ if (absTick & 0x400 != 0) ratio = (ratio * 0xf3392b0822b70005940c7a398e4b70f3) >> 128;
881
+ if (absTick & 0x800 != 0) ratio = (ratio * 0xe7159475a2c29b7443b29c7fa6e889d9) >> 128;
882
+ if (absTick & 0x1000 != 0) ratio = (ratio * 0xd097f3bdfd2022b8845ad8f792aa5825) >> 128;
883
+ if (absTick & 0x2000 != 0) ratio = (ratio * 0xa9f746462d870fdf8a65dc1f90e061e5) >> 128;
884
+ if (absTick & 0x4000 != 0) ratio = (ratio * 0x70d869a156d2a1b890bb3df62baf32f7) >> 128;
885
+ if (absTick & 0x8000 != 0) ratio = (ratio * 0x31be135f97d08fd981231505542fcfa6) >> 128;
886
+ if (absTick & 0x10000 != 0) ratio = (ratio * 0x9aa508b5b7a84e1c677de54f3e99bc9) >> 128;
887
+ if (absTick & 0x20000 != 0) ratio = (ratio * 0x5d6af8dedb81196699c329225ee604) >> 128;
888
+ if (absTick & 0x40000 != 0) ratio = (ratio * 0x2216e584f5fa1ea926041bedfe98) >> 128;
889
+ if (absTick & 0x80000 != 0) ratio = (ratio * 0x48a170391f7dc42444e8fa2) >> 128;
890
+
891
+ if (tick > 0) ratio = type(uint256).max / ratio;
892
+
893
+ // this divides by 1<<32 rounding up to go from a Q128.128 to a Q128.96.
894
+ // we then downcast because we know the result always fits within 160 bits due to our tick input constraint
895
+ // we round up in the division so getTickAtSqrtRatio of the output price is always consistent
896
+ sqrtPriceX96 = uint160((ratio >> 32) + (ratio % (1 << 32) == 0 ? 0 : 1));
897
+ }
898
+
899
+ /// @notice Calculates the greatest tick value such that getRatioAtTick(tick) <= ratio
900
+ /// @dev Throws in case sqrtPriceX96 < MIN_SQRT_RATIO, as MIN_SQRT_RATIO is the lowest value getRatioAtTick may
901
+ /// ever return.
902
+ /// @param sqrtPriceX96 The sqrt ratio for which to compute the tick as a Q64.96
903
+ /// @return tick The greatest tick for which the ratio is less than or equal to the input ratio
904
+ function getTickAtSqrtRatio(uint160 sqrtPriceX96) internal pure returns (int24 tick) {
905
+ // second inequality must be < because the price can never reach the price at the max tick
906
+ require(sqrtPriceX96 >= MIN_SQRT_RATIO && sqrtPriceX96 < MAX_SQRT_RATIO, 'R');
907
+ uint256 ratio = uint256(sqrtPriceX96) << 32;
908
+
909
+ uint256 r = ratio;
910
+ uint256 msb = 0;
911
+
912
+ assembly {
913
+ let f := shl(7, gt(r, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF))
914
+ msb := or(msb, f)
915
+ r := shr(f, r)
916
+ }
917
+ assembly {
918
+ let f := shl(6, gt(r, 0xFFFFFFFFFFFFFFFF))
919
+ msb := or(msb, f)
920
+ r := shr(f, r)
921
+ }
922
+ assembly {
923
+ let f := shl(5, gt(r, 0xFFFFFFFF))
924
+ msb := or(msb, f)
925
+ r := shr(f, r)
926
+ }
927
+ assembly {
928
+ let f := shl(4, gt(r, 0xFFFF))
929
+ msb := or(msb, f)
930
+ r := shr(f, r)
931
+ }
932
+ assembly {
933
+ let f := shl(3, gt(r, 0xFF))
934
+ msb := or(msb, f)
935
+ r := shr(f, r)
936
+ }
937
+ assembly {
938
+ let f := shl(2, gt(r, 0xF))
939
+ msb := or(msb, f)
940
+ r := shr(f, r)
941
+ }
942
+ assembly {
943
+ let f := shl(1, gt(r, 0x3))
944
+ msb := or(msb, f)
945
+ r := shr(f, r)
946
+ }
947
+ assembly {
948
+ let f := gt(r, 0x1)
949
+ msb := or(msb, f)
950
+ }
951
+
952
+ if (msb >= 128) r = ratio >> (msb - 127);
953
+ else r = ratio << (127 - msb);
954
+
955
+ int256 log_2 = (int256(msb) - 128) << 64;
956
+
957
+ assembly {
958
+ r := shr(127, mul(r, r))
959
+ let f := shr(128, r)
960
+ log_2 := or(log_2, shl(63, f))
961
+ r := shr(f, r)
962
+ }
963
+ assembly {
964
+ r := shr(127, mul(r, r))
965
+ let f := shr(128, r)
966
+ log_2 := or(log_2, shl(62, f))
967
+ r := shr(f, r)
968
+ }
969
+ assembly {
970
+ r := shr(127, mul(r, r))
971
+ let f := shr(128, r)
972
+ log_2 := or(log_2, shl(61, f))
973
+ r := shr(f, r)
974
+ }
975
+ assembly {
976
+ r := shr(127, mul(r, r))
977
+ let f := shr(128, r)
978
+ log_2 := or(log_2, shl(60, f))
979
+ r := shr(f, r)
980
+ }
981
+ assembly {
982
+ r := shr(127, mul(r, r))
983
+ let f := shr(128, r)
984
+ log_2 := or(log_2, shl(59, f))
985
+ r := shr(f, r)
986
+ }
987
+ assembly {
988
+ r := shr(127, mul(r, r))
989
+ let f := shr(128, r)
990
+ log_2 := or(log_2, shl(58, f))
991
+ r := shr(f, r)
992
+ }
993
+ assembly {
994
+ r := shr(127, mul(r, r))
995
+ let f := shr(128, r)
996
+ log_2 := or(log_2, shl(57, f))
997
+ r := shr(f, r)
998
+ }
999
+ assembly {
1000
+ r := shr(127, mul(r, r))
1001
+ let f := shr(128, r)
1002
+ log_2 := or(log_2, shl(56, f))
1003
+ r := shr(f, r)
1004
+ }
1005
+ assembly {
1006
+ r := shr(127, mul(r, r))
1007
+ let f := shr(128, r)
1008
+ log_2 := or(log_2, shl(55, f))
1009
+ r := shr(f, r)
1010
+ }
1011
+ assembly {
1012
+ r := shr(127, mul(r, r))
1013
+ let f := shr(128, r)
1014
+ log_2 := or(log_2, shl(54, f))
1015
+ r := shr(f, r)
1016
+ }
1017
+ assembly {
1018
+ r := shr(127, mul(r, r))
1019
+ let f := shr(128, r)
1020
+ log_2 := or(log_2, shl(53, f))
1021
+ r := shr(f, r)
1022
+ }
1023
+ assembly {
1024
+ r := shr(127, mul(r, r))
1025
+ let f := shr(128, r)
1026
+ log_2 := or(log_2, shl(52, f))
1027
+ r := shr(f, r)
1028
+ }
1029
+ assembly {
1030
+ r := shr(127, mul(r, r))
1031
+ let f := shr(128, r)
1032
+ log_2 := or(log_2, shl(51, f))
1033
+ r := shr(f, r)
1034
+ }
1035
+ assembly {
1036
+ r := shr(127, mul(r, r))
1037
+ let f := shr(128, r)
1038
+ log_2 := or(log_2, shl(50, f))
1039
+ }
1040
+
1041
+ int256 log_sqrt10001 = log_2 * 255738958999603826347141; // 128.128 number
1042
+
1043
+ int24 tickLow = int24((log_sqrt10001 - 3402992956809132418596140100660247210) >> 128);
1044
+ int24 tickHi = int24((log_sqrt10001 + 291339464771989622907027621153398088495) >> 128);
1045
+
1046
+ tick = tickLow == tickHi ? tickLow : getSqrtRatioAtTick(tickHi) <= sqrtPriceX96 ? tickHi : tickLow;
1047
+ }
1048
+ }
1049
+
1050
+ // lib/v3-periphery-main/contracts/libraries/Path.sol
1051
+
1052
+ /// @title Functions for manipulating path data for multihop swaps
1053
+ library Path {
1054
+ using BytesLib for bytes;
1055
+
1056
+ /// @dev The length of the bytes encoded address
1057
+ uint256 private constant ADDR_SIZE = 20;
1058
+ /// @dev The length of the bytes encoded fee
1059
+ uint256 private constant FEE_SIZE = 3;
1060
+
1061
+ /// @dev The offset of a single token address and pool fee
1062
+ uint256 private constant NEXT_OFFSET = ADDR_SIZE + FEE_SIZE;
1063
+ /// @dev The offset of an encoded pool key
1064
+ uint256 private constant POP_OFFSET = NEXT_OFFSET + ADDR_SIZE;
1065
+ /// @dev The minimum length of an encoding that contains 2 or more pools
1066
+ uint256 private constant MULTIPLE_POOLS_MIN_LENGTH = POP_OFFSET + NEXT_OFFSET;
1067
+
1068
+ /// @notice Returns true iff the path contains two or more pools
1069
+ /// @param path The encoded swap path
1070
+ /// @return True if path contains two or more pools, otherwise false
1071
+ function hasMultiplePools(bytes memory path) internal pure returns (bool) {
1072
+ return path.length >= MULTIPLE_POOLS_MIN_LENGTH;
1073
+ }
1074
+
1075
+ /// @notice Returns the number of pools in the path
1076
+ /// @param path The encoded swap path
1077
+ /// @return The number of pools in the path
1078
+ function numPools(bytes memory path) internal pure returns (uint256) {
1079
+ // Ignore the first token address. From then on every fee and token offset indicates a pool.
1080
+ return ((path.length - ADDR_SIZE) / NEXT_OFFSET);
1081
+ }
1082
+
1083
+ /// @notice Decodes the first pool in path
1084
+ /// @param path The bytes encoded swap path
1085
+ /// @return tokenA The first token of the given pool
1086
+ /// @return tokenB The second token of the given pool
1087
+ /// @return fee The fee level of the pool
1088
+ function decodeFirstPool(bytes memory path)
1089
+ internal
1090
+ pure
1091
+ returns (
1092
+ address tokenA,
1093
+ address tokenB,
1094
+ uint24 fee
1095
+ )
1096
+ {
1097
+ tokenA = path.toAddress(0);
1098
+ fee = path.toUint24(ADDR_SIZE);
1099
+ tokenB = path.toAddress(NEXT_OFFSET);
1100
+ }
1101
+
1102
+ /// @notice Gets the segment corresponding to the first pool in the path
1103
+ /// @param path The bytes encoded swap path
1104
+ /// @return The segment containing all data necessary to target the first pool in the path
1105
+ function getFirstPool(bytes memory path) internal pure returns (bytes memory) {
1106
+ return path.slice(0, POP_OFFSET);
1107
+ }
1108
+
1109
+ /// @notice Skips a token + fee element from the buffer and returns the remainder
1110
+ /// @param path The swap path
1111
+ /// @return The remaining token + fee elements in the path
1112
+ function skipToken(bytes memory path) internal pure returns (bytes memory) {
1113
+ return path.slice(NEXT_OFFSET, path.length - NEXT_OFFSET);
1114
+ }
1115
+ }
1116
+
1117
+ // lib/v3-periphery-main/contracts/base/PeripheryImmutableState.sol
1118
+
1119
+ /// @title Immutable state
1120
+ /// @notice Immutable state used by periphery contracts
1121
+ abstract contract PeripheryImmutableState is IPeripheryImmutableState {
1122
+ /// @inheritdoc IPeripheryImmutableState
1123
+ address public immutable override factory;
1124
+ /// @inheritdoc IPeripheryImmutableState
1125
+ address public immutable override WETH9;
1126
+
1127
+ constructor(address _factory, address _WETH9) {
1128
+ factory = _factory;
1129
+ WETH9 = _WETH9;
1130
+ }
1131
+ }
1132
+
1133
+ // lib/v3-core-main/contracts/libraries/TickBitmap.sol
1134
+
1135
+ /// @title Packed tick initialized state library
1136
+ /// @notice Stores a packed mapping of tick index to its initialized state
1137
+ /// @dev The mapping uses int16 for keys since ticks are represented as int24 and there are 256 (2^8) values per word.
1138
+ library TickBitmap {
1139
+ /// @notice Computes the position in the mapping where the initialized bit for a tick lives
1140
+ /// @param tick The tick for which to compute the position
1141
+ /// @return wordPos The key in the mapping containing the word in which the bit is stored
1142
+ /// @return bitPos The bit position in the word where the flag is stored
1143
+ function position(int24 tick) private pure returns (int16 wordPos, uint8 bitPos) {
1144
+ wordPos = int16(tick >> 8);
1145
+ bitPos = uint8(tick % 256);
1146
+ }
1147
+
1148
+ /// @notice Flips the initialized state for a given tick from false to true, or vice versa
1149
+ /// @param self The mapping in which to flip the tick
1150
+ /// @param tick The tick to flip
1151
+ /// @param tickSpacing The spacing between usable ticks
1152
+ function flipTick(
1153
+ mapping(int16 => uint256) storage self,
1154
+ int24 tick,
1155
+ int24 tickSpacing
1156
+ ) internal {
1157
+ require(tick % tickSpacing == 0); // ensure that the tick is spaced
1158
+ (int16 wordPos, uint8 bitPos) = position(tick / tickSpacing);
1159
+ uint256 mask = 1 << bitPos;
1160
+ self[wordPos] ^= mask;
1161
+ }
1162
+
1163
+ /// @notice Returns the next initialized tick contained in the same word (or adjacent word) as the tick that is either
1164
+ /// to the left (less than or equal to) or right (greater than) of the given tick
1165
+ /// @param self The mapping in which to compute the next initialized tick
1166
+ /// @param tick The starting tick
1167
+ /// @param tickSpacing The spacing between usable ticks
1168
+ /// @param lte Whether to search for the next initialized tick to the left (less than or equal to the starting tick)
1169
+ /// @return next The next initialized or uninitialized tick up to 256 ticks away from the current tick
1170
+ /// @return initialized Whether the next tick is initialized, as the function only searches within up to 256 ticks
1171
+ function nextInitializedTickWithinOneWord(
1172
+ mapping(int16 => uint256) storage self,
1173
+ int24 tick,
1174
+ int24 tickSpacing,
1175
+ bool lte
1176
+ ) internal view returns (int24 next, bool initialized) {
1177
+ int24 compressed = tick / tickSpacing;
1178
+ if (tick < 0 && tick % tickSpacing != 0) compressed--; // round towards negative infinity
1179
+
1180
+ if (lte) {
1181
+ (int16 wordPos, uint8 bitPos) = position(compressed);
1182
+ // all the 1s at or to the right of the current bitPos
1183
+ uint256 mask = (1 << bitPos) - 1 + (1 << bitPos);
1184
+ uint256 masked = self[wordPos] & mask;
1185
+
1186
+ // if there are no initialized ticks to the right of or at the current tick, return rightmost in the word
1187
+ initialized = masked != 0;
1188
+ // overflow/underflow is possible, but prevented externally by limiting both tickSpacing and tick
1189
+ next = initialized
1190
+ ? (compressed - int24(bitPos - BitMath.mostSignificantBit(masked))) * tickSpacing
1191
+ : (compressed - int24(bitPos)) * tickSpacing;
1192
+ } else {
1193
+ // start from the word of the next tick, since the current tick state doesn't matter
1194
+ (int16 wordPos, uint8 bitPos) = position(compressed + 1);
1195
+ // all the 1s at or to the left of the bitPos
1196
+ uint256 mask = ~((1 << bitPos) - 1);
1197
+ uint256 masked = self[wordPos] & mask;
1198
+
1199
+ // if there are no initialized ticks to the left of the current tick, return leftmost in the word
1200
+ initialized = masked != 0;
1201
+ // overflow/underflow is possible, but prevented externally by limiting both tickSpacing and tick
1202
+ next = initialized
1203
+ ? (compressed + 1 + int24(BitMath.leastSignificantBit(masked) - bitPos)) * tickSpacing
1204
+ : (compressed + 1 + int24(type(uint8).max - bitPos)) * tickSpacing;
1205
+ }
1206
+ }
1207
+ }
1208
+
1209
+ // lib/v3-core-main/contracts/interfaces/IUniswapV3Pool.sol
1210
+
1211
+ /// @title The interface for a Uniswap V3 Pool
1212
+ /// @notice A Uniswap pool facilitates swapping and automated market making between any two assets that strictly conform
1213
+ /// to the ERC20 specification
1214
+ /// @dev The pool interface is broken up into many smaller pieces
1215
+ interface IUniswapV3Pool is
1216
+ IUniswapV3PoolImmutables,
1217
+ IUniswapV3PoolState,
1218
+ IUniswapV3PoolDerivedState,
1219
+ IUniswapV3PoolActions,
1220
+ IUniswapV3PoolOwnerActions,
1221
+ IUniswapV3PoolEvents
1222
+ {
1223
+
1224
+ }
1225
+
1226
+ // lib/v3-periphery-main/contracts/libraries/PoolTicksCounter.sol
1227
+
1228
+ library PoolTicksCounter {
1229
+ /// @dev This function counts the number of initialized ticks that would incur a gas cost between tickBefore and tickAfter.
1230
+ /// When tickBefore and/or tickAfter themselves are initialized, the logic over whether we should count them depends on the
1231
+ /// direction of the swap. If we are swapping upwards (tickAfter > tickBefore) we don't want to count tickBefore but we do
1232
+ /// want to count tickAfter. The opposite is true if we are swapping downwards.
1233
+ function countInitializedTicksCrossed(
1234
+ IUniswapV3Pool self,
1235
+ int24 tickBefore,
1236
+ int24 tickAfter
1237
+ ) internal view returns (uint32 initializedTicksCrossed) {
1238
+ int16 wordPosLower;
1239
+ int16 wordPosHigher;
1240
+ uint8 bitPosLower;
1241
+ uint8 bitPosHigher;
1242
+ bool tickBeforeInitialized;
1243
+ bool tickAfterInitialized;
1244
+
1245
+ {
1246
+ // Get the key and offset in the tick bitmap of the active tick before and after the swap.
1247
+ int16 wordPos = int16((tickBefore / self.tickSpacing()) >> 8);
1248
+ uint8 bitPos = uint8((tickBefore / self.tickSpacing()) % 256);
1249
+
1250
+ int16 wordPosAfter = int16((tickAfter / self.tickSpacing()) >> 8);
1251
+ uint8 bitPosAfter = uint8((tickAfter / self.tickSpacing()) % 256);
1252
+
1253
+ // In the case where tickAfter is initialized, we only want to count it if we are swapping downwards.
1254
+ // If the initializable tick after the swap is initialized, our original tickAfter is a
1255
+ // multiple of tick spacing, and we are swapping downwards we know that tickAfter is initialized
1256
+ // and we shouldn't count it.
1257
+ tickAfterInitialized =
1258
+ ((self.tickBitmap(wordPosAfter) & (1 << bitPosAfter)) > 0) &&
1259
+ ((tickAfter % self.tickSpacing()) == 0) &&
1260
+ (tickBefore > tickAfter);
1261
+
1262
+ // In the case where tickBefore is initialized, we only want to count it if we are swapping upwards.
1263
+ // Use the same logic as above to decide whether we should count tickBefore or not.
1264
+ tickBeforeInitialized =
1265
+ ((self.tickBitmap(wordPos) & (1 << bitPos)) > 0) &&
1266
+ ((tickBefore % self.tickSpacing()) == 0) &&
1267
+ (tickBefore < tickAfter);
1268
+
1269
+ if (wordPos < wordPosAfter || (wordPos == wordPosAfter && bitPos <= bitPosAfter)) {
1270
+ wordPosLower = wordPos;
1271
+ bitPosLower = bitPos;
1272
+ wordPosHigher = wordPosAfter;
1273
+ bitPosHigher = bitPosAfter;
1274
+ } else {
1275
+ wordPosLower = wordPosAfter;
1276
+ bitPosLower = bitPosAfter;
1277
+ wordPosHigher = wordPos;
1278
+ bitPosHigher = bitPos;
1279
+ }
1280
+ }
1281
+
1282
+ // Count the number of initialized ticks crossed by iterating through the tick bitmap.
1283
+ // Our first mask should include the lower tick and everything to its left.
1284
+ uint256 mask = type(uint256).max << bitPosLower;
1285
+ while (wordPosLower <= wordPosHigher) {
1286
+ // If we're on the final tick bitmap page, ensure we only count up to our
1287
+ // ending tick.
1288
+ if (wordPosLower == wordPosHigher) {
1289
+ mask = mask & (type(uint256).max >> (255 - bitPosHigher));
1290
+ }
1291
+
1292
+ uint256 masked = self.tickBitmap(wordPosLower) & mask;
1293
+ initializedTicksCrossed += countOneBits(masked);
1294
+ wordPosLower++;
1295
+ // Reset our mask so we consider all bits on the next iteration.
1296
+ mask = type(uint256).max;
1297
+ }
1298
+
1299
+ if (tickAfterInitialized) {
1300
+ initializedTicksCrossed -= 1;
1301
+ }
1302
+
1303
+ if (tickBeforeInitialized) {
1304
+ initializedTicksCrossed -= 1;
1305
+ }
1306
+
1307
+ return initializedTicksCrossed;
1308
+ }
1309
+
1310
+ function countOneBits(uint256 x) private pure returns (uint16) {
1311
+ uint16 bits = 0;
1312
+ while (x != 0) {
1313
+ bits++;
1314
+ x &= (x - 1);
1315
+ }
1316
+ return bits;
1317
+ }
1318
+ }
1319
+
1320
+ // lib/v3-periphery-main/contracts/libraries/CallbackValidation.sol
1321
+
1322
+ /// @notice Provides validation for callbacks from Uniswap V3 Pools
1323
+ library CallbackValidation {
1324
+ /// @notice Returns the address of a valid Uniswap V3 Pool
1325
+ /// @param factory The contract address of the Uniswap V3 factory
1326
+ /// @param tokenA The contract address of either token0 or token1
1327
+ /// @param tokenB The contract address of the other token
1328
+ /// @param fee The fee collected upon every swap in the pool, denominated in hundredths of a bip
1329
+ /// @return pool The V3 pool contract address
1330
+ function verifyCallback(
1331
+ address factory,
1332
+ address tokenA,
1333
+ address tokenB,
1334
+ uint24 fee
1335
+ ) internal view returns (IUniswapV3Pool pool) {
1336
+ return verifyCallback(factory, PoolAddress.getPoolKey(tokenA, tokenB, fee));
1337
+ }
1338
+
1339
+ /// @notice Returns the address of a valid Uniswap V3 Pool
1340
+ /// @param factory The contract address of the Uniswap V3 factory
1341
+ /// @param poolKey The identifying key of the V3 pool
1342
+ /// @return pool The V3 pool contract address
1343
+ function verifyCallback(address factory, PoolAddress.PoolKey memory poolKey)
1344
+ internal
1345
+ view
1346
+ returns (IUniswapV3Pool pool)
1347
+ {
1348
+ pool = IUniswapV3Pool(PoolAddress.computeAddress(factory, poolKey));
1349
+ require(msg.sender == address(pool));
1350
+ }
1351
+ }
1352
+
1353
+ // lib/v3-periphery-main/contracts/lens/QuoterV2.sol
1354
+
1355
+ /// @title Provides quotes for swaps
1356
+ /// @notice Allows getting the expected amount out or amount in for a given swap without executing the swap
1357
+ /// @dev These functions are not gas efficient and should _not_ be called on chain. Instead, optimistically execute
1358
+ /// the swap and check the amounts in the callback.
1359
+ contract QuoterV2 is IQuoterV2, IUniswapV3SwapCallback, PeripheryImmutableState {
1360
+ using Path for bytes;
1361
+ using SafeCast for uint256;
1362
+ using PoolTicksCounter for IUniswapV3Pool;
1363
+
1364
+ /// @dev Transient storage variable used to check a safety condition in exact output swaps.
1365
+ uint256 private amountOutCached;
1366
+
1367
+ constructor(address _factory, address _WETH9) PeripheryImmutableState(_factory, _WETH9) {}
1368
+
1369
+ function getPool(
1370
+ address tokenA,
1371
+ address tokenB,
1372
+ uint24 fee
1373
+ ) private view returns (IUniswapV3Pool) {
1374
+ return IUniswapV3Pool(PoolAddress.computeAddress(factory, PoolAddress.getPoolKey(tokenA, tokenB, fee)));
1375
+ }
1376
+
1377
+ /// @inheritdoc IUniswapV3SwapCallback
1378
+ function uniswapV3SwapCallback(
1379
+ int256 amount0Delta,
1380
+ int256 amount1Delta,
1381
+ bytes memory path
1382
+ ) external view override {
1383
+ require(amount0Delta > 0 || amount1Delta > 0); // swaps entirely within 0-liquidity regions are not supported
1384
+ (address tokenIn, address tokenOut, uint24 fee) = path.decodeFirstPool();
1385
+ CallbackValidation.verifyCallback(factory, tokenIn, tokenOut, fee);
1386
+
1387
+ (bool isExactInput, uint256 amountToPay, uint256 amountReceived) =
1388
+ amount0Delta > 0
1389
+ ? (tokenIn < tokenOut, uint256(amount0Delta), uint256(-amount1Delta))
1390
+ : (tokenOut < tokenIn, uint256(amount1Delta), uint256(-amount0Delta));
1391
+
1392
+ IUniswapV3Pool pool = getPool(tokenIn, tokenOut, fee);
1393
+ (uint160 sqrtPriceX96After, int24 tickAfter, , , , , ) = pool.slot0();
1394
+
1395
+ if (isExactInput) {
1396
+ assembly {
1397
+ let ptr := mload(0x40)
1398
+ mstore(ptr, amountReceived)
1399
+ mstore(add(ptr, 0x20), sqrtPriceX96After)
1400
+ mstore(add(ptr, 0x40), tickAfter)
1401
+ revert(ptr, 96)
1402
+ }
1403
+ } else {
1404
+ // if the cache has been populated, ensure that the full output amount has been received
1405
+ if (amountOutCached != 0) require(amountReceived == amountOutCached);
1406
+ assembly {
1407
+ let ptr := mload(0x40)
1408
+ mstore(ptr, amountToPay)
1409
+ mstore(add(ptr, 0x20), sqrtPriceX96After)
1410
+ mstore(add(ptr, 0x40), tickAfter)
1411
+ revert(ptr, 96)
1412
+ }
1413
+ }
1414
+ }
1415
+
1416
+ /// @dev Parses a revert reason that should contain the numeric quote
1417
+ function parseRevertReason(bytes memory reason)
1418
+ private
1419
+ pure
1420
+ returns (
1421
+ uint256 amount,
1422
+ uint160 sqrtPriceX96After,
1423
+ int24 tickAfter
1424
+ )
1425
+ {
1426
+ if (reason.length != 96) {
1427
+ if (reason.length < 68) revert('Unexpected error');
1428
+ assembly {
1429
+ reason := add(reason, 0x04)
1430
+ }
1431
+ revert(abi.decode(reason, (string)));
1432
+ }
1433
+ return abi.decode(reason, (uint256, uint160, int24));
1434
+ }
1435
+
1436
+ function handleRevert(
1437
+ bytes memory reason,
1438
+ IUniswapV3Pool pool,
1439
+ uint256 gasEstimate
1440
+ )
1441
+ private
1442
+ view
1443
+ returns (
1444
+ uint256 amount,
1445
+ uint160 sqrtPriceX96After,
1446
+ uint32 initializedTicksCrossed,
1447
+ uint256
1448
+ )
1449
+ {
1450
+ int24 tickBefore;
1451
+ int24 tickAfter;
1452
+ (, tickBefore, , , , , ) = pool.slot0();
1453
+ (amount, sqrtPriceX96After, tickAfter) = parseRevertReason(reason);
1454
+
1455
+ initializedTicksCrossed = pool.countInitializedTicksCrossed(tickBefore, tickAfter);
1456
+
1457
+ return (amount, sqrtPriceX96After, initializedTicksCrossed, gasEstimate);
1458
+ }
1459
+
1460
+ function quoteExactInputSingle(QuoteExactInputSingleParams memory params)
1461
+ public
1462
+ override
1463
+ returns (
1464
+ uint256 amountOut,
1465
+ uint160 sqrtPriceX96After,
1466
+ uint32 initializedTicksCrossed,
1467
+ uint256 gasEstimate
1468
+ )
1469
+ {
1470
+ bool zeroForOne = params.tokenIn < params.tokenOut;
1471
+ IUniswapV3Pool pool = getPool(params.tokenIn, params.tokenOut, params.fee);
1472
+
1473
+ uint256 gasBefore = gasleft();
1474
+ try
1475
+ pool.swap(
1476
+ address(this), // address(0) might cause issues with some tokens
1477
+ zeroForOne,
1478
+ params.amountIn.toInt256(),
1479
+ params.sqrtPriceLimitX96 == 0
1480
+ ? (zeroForOne ? TickMath.MIN_SQRT_RATIO + 1 : TickMath.MAX_SQRT_RATIO - 1)
1481
+ : params.sqrtPriceLimitX96,
1482
+ abi.encodePacked(params.tokenIn, params.fee, params.tokenOut)
1483
+ )
1484
+ {} catch (bytes memory reason) {
1485
+ gasEstimate = gasBefore - gasleft();
1486
+ return handleRevert(reason, pool, gasEstimate);
1487
+ }
1488
+ }
1489
+
1490
+ function quoteExactInput(bytes memory path, uint256 amountIn)
1491
+ public
1492
+ override
1493
+ returns (
1494
+ uint256 amountOut,
1495
+ uint160[] memory sqrtPriceX96AfterList,
1496
+ uint32[] memory initializedTicksCrossedList,
1497
+ uint256 gasEstimate
1498
+ )
1499
+ {
1500
+ sqrtPriceX96AfterList = new uint160[](path.numPools());
1501
+ initializedTicksCrossedList = new uint32[](path.numPools());
1502
+
1503
+ uint256 i = 0;
1504
+ while (true) {
1505
+ (address tokenIn, address tokenOut, uint24 fee) = path.decodeFirstPool();
1506
+
1507
+ // the outputs of prior swaps become the inputs to subsequent ones
1508
+ (uint256 _amountOut, uint160 _sqrtPriceX96After, uint32 _initializedTicksCrossed, uint256 _gasEstimate) =
1509
+ quoteExactInputSingle(
1510
+ QuoteExactInputSingleParams({
1511
+ tokenIn: tokenIn,
1512
+ tokenOut: tokenOut,
1513
+ fee: fee,
1514
+ amountIn: amountIn,
1515
+ sqrtPriceLimitX96: 0
1516
+ })
1517
+ );
1518
+
1519
+ sqrtPriceX96AfterList[i] = _sqrtPriceX96After;
1520
+ initializedTicksCrossedList[i] = _initializedTicksCrossed;
1521
+ amountIn = _amountOut;
1522
+ gasEstimate += _gasEstimate;
1523
+ i++;
1524
+
1525
+ // decide whether to continue or terminate
1526
+ if (path.hasMultiplePools()) {
1527
+ path = path.skipToken();
1528
+ } else {
1529
+ return (amountIn, sqrtPriceX96AfterList, initializedTicksCrossedList, gasEstimate);
1530
+ }
1531
+ }
1532
+ }
1533
+
1534
+ function quoteExactOutputSingle(QuoteExactOutputSingleParams memory params)
1535
+ public
1536
+ override
1537
+ returns (
1538
+ uint256 amountIn,
1539
+ uint160 sqrtPriceX96After,
1540
+ uint32 initializedTicksCrossed,
1541
+ uint256 gasEstimate
1542
+ )
1543
+ {
1544
+ bool zeroForOne = params.tokenIn < params.tokenOut;
1545
+ IUniswapV3Pool pool = getPool(params.tokenIn, params.tokenOut, params.fee);
1546
+
1547
+ // if no price limit has been specified, cache the output amount for comparison in the swap callback
1548
+ if (params.sqrtPriceLimitX96 == 0) amountOutCached = params.amount;
1549
+ uint256 gasBefore = gasleft();
1550
+ try
1551
+ pool.swap(
1552
+ address(this), // address(0) might cause issues with some tokens
1553
+ zeroForOne,
1554
+ -params.amount.toInt256(),
1555
+ params.sqrtPriceLimitX96 == 0
1556
+ ? (zeroForOne ? TickMath.MIN_SQRT_RATIO + 1 : TickMath.MAX_SQRT_RATIO - 1)
1557
+ : params.sqrtPriceLimitX96,
1558
+ abi.encodePacked(params.tokenOut, params.fee, params.tokenIn)
1559
+ )
1560
+ {} catch (bytes memory reason) {
1561
+ gasEstimate = gasBefore - gasleft();
1562
+ if (params.sqrtPriceLimitX96 == 0) delete amountOutCached; // clear cache
1563
+ return handleRevert(reason, pool, gasEstimate);
1564
+ }
1565
+ }
1566
+
1567
+ function quoteExactOutput(bytes memory path, uint256 amountOut)
1568
+ public
1569
+ override
1570
+ returns (
1571
+ uint256 amountIn,
1572
+ uint160[] memory sqrtPriceX96AfterList,
1573
+ uint32[] memory initializedTicksCrossedList,
1574
+ uint256 gasEstimate
1575
+ )
1576
+ {
1577
+ sqrtPriceX96AfterList = new uint160[](path.numPools());
1578
+ initializedTicksCrossedList = new uint32[](path.numPools());
1579
+
1580
+ uint256 i = 0;
1581
+ while (true) {
1582
+ (address tokenOut, address tokenIn, uint24 fee) = path.decodeFirstPool();
1583
+
1584
+ // the inputs of prior swaps become the outputs of subsequent ones
1585
+ (uint256 _amountIn, uint160 _sqrtPriceX96After, uint32 _initializedTicksCrossed, uint256 _gasEstimate) =
1586
+ quoteExactOutputSingle(
1587
+ QuoteExactOutputSingleParams({
1588
+ tokenIn: tokenIn,
1589
+ tokenOut: tokenOut,
1590
+ amount: amountOut,
1591
+ fee: fee,
1592
+ sqrtPriceLimitX96: 0
1593
+ })
1594
+ );
1595
+
1596
+ sqrtPriceX96AfterList[i] = _sqrtPriceX96After;
1597
+ initializedTicksCrossedList[i] = _initializedTicksCrossed;
1598
+ amountOut = _amountIn;
1599
+ gasEstimate += _gasEstimate;
1600
+ i++;
1601
+
1602
+ // decide whether to continue or terminate
1603
+ if (path.hasMultiplePools()) {
1604
+ path = path.skipToken();
1605
+ } else {
1606
+ return (amountOut, sqrtPriceX96AfterList, initializedTicksCrossedList, gasEstimate);
1607
+ }
1608
+ }
1609
+ }
1610
+ }
1611
+
1612
+ // src/QuoterV2Importer.sol
1613
+
1614
+ contract QuoterV2Importer is QuoterV2 {
1615
+ constructor(address factory, address wmst) QuoterV2(factory, wmst) {}
1616
+ }