@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,1811 @@
1
+ // SPDX-License-Identifier: MIT
2
+ pragma solidity <0.8.0 =0.7.6 >=0.5.0 >=0.6.0 >=0.7.0 >=0.7.5;
3
+ pragma abicoder v2;
4
+
5
+ // lib/v3-periphery-main/contracts/base/BlockTimestamp.sol
6
+
7
+ /// @title Function for getting block timestamp
8
+ /// @dev Base contract that is overridden for tests
9
+ abstract contract BlockTimestamp {
10
+ /// @dev Method that exists purely to be overridden for tests
11
+ /// @return The current block timestamp
12
+ function _blockTimestamp() internal view virtual returns (uint256) {
13
+ return block.timestamp;
14
+ }
15
+ }
16
+
17
+ // lib/v3-periphery-main/contracts/libraries/BytesLib.sol
18
+
19
+ /*
20
+ * @title Solidity Bytes Arrays Utils
21
+ * @author Gonçalo Sá <goncalo.sa@consensys.net>
22
+ *
23
+ * @dev Bytes tightly packed arrays utility library for ethereum contracts written in Solidity.
24
+ * The library lets you concatenate, slice and type cast bytes arrays both in memory and storage.
25
+ */
26
+
27
+ library BytesLib {
28
+ function slice(
29
+ bytes memory _bytes,
30
+ uint256 _start,
31
+ uint256 _length
32
+ ) internal pure returns (bytes memory) {
33
+ require(_length + 31 >= _length, 'slice_overflow');
34
+ require(_start + _length >= _start, 'slice_overflow');
35
+ require(_bytes.length >= _start + _length, 'slice_outOfBounds');
36
+
37
+ bytes memory tempBytes;
38
+
39
+ assembly {
40
+ switch iszero(_length)
41
+ case 0 {
42
+ // Get a location of some free memory and store it in tempBytes as
43
+ // Solidity does for memory variables.
44
+ tempBytes := mload(0x40)
45
+
46
+ // The first word of the slice result is potentially a partial
47
+ // word read from the original array. To read it, we calculate
48
+ // the length of that partial word and start copying that many
49
+ // bytes into the array. The first word we copy will start with
50
+ // data we don't care about, but the last `lengthmod` bytes will
51
+ // land at the beginning of the contents of the new array. When
52
+ // we're done copying, we overwrite the full first word with
53
+ // the actual length of the slice.
54
+ let lengthmod := and(_length, 31)
55
+
56
+ // The multiplication in the next line is necessary
57
+ // because when slicing multiples of 32 bytes (lengthmod == 0)
58
+ // the following copy loop was copying the origin's length
59
+ // and then ending prematurely not copying everything it should.
60
+ let mc := add(add(tempBytes, lengthmod), mul(0x20, iszero(lengthmod)))
61
+ let end := add(mc, _length)
62
+
63
+ for {
64
+ // The multiplication in the next line has the same exact purpose
65
+ // as the one above.
66
+ let cc := add(add(add(_bytes, lengthmod), mul(0x20, iszero(lengthmod))), _start)
67
+ } lt(mc, end) {
68
+ mc := add(mc, 0x20)
69
+ cc := add(cc, 0x20)
70
+ } {
71
+ mstore(mc, mload(cc))
72
+ }
73
+
74
+ mstore(tempBytes, _length)
75
+
76
+ //update free-memory pointer
77
+ //allocating the array padded to 32 bytes like the compiler does now
78
+ mstore(0x40, and(add(mc, 31), not(31)))
79
+ }
80
+ //if we want a zero-length slice let's just return a zero-length array
81
+ default {
82
+ tempBytes := mload(0x40)
83
+ //zero out the 32 bytes slice we are about to return
84
+ //we need to do it because Solidity does not garbage collect
85
+ mstore(tempBytes, 0)
86
+
87
+ mstore(0x40, add(tempBytes, 0x20))
88
+ }
89
+ }
90
+
91
+ return tempBytes;
92
+ }
93
+
94
+ function toAddress(bytes memory _bytes, uint256 _start) internal pure returns (address) {
95
+ require(_start + 20 >= _start, 'toAddress_overflow');
96
+ require(_bytes.length >= _start + 20, 'toAddress_outOfBounds');
97
+ address tempAddress;
98
+
99
+ assembly {
100
+ tempAddress := div(mload(add(add(_bytes, 0x20), _start)), 0x1000000000000000000000000)
101
+ }
102
+
103
+ return tempAddress;
104
+ }
105
+
106
+ function toUint24(bytes memory _bytes, uint256 _start) internal pure returns (uint24) {
107
+ require(_start + 3 >= _start, 'toUint24_overflow');
108
+ require(_bytes.length >= _start + 3, 'toUint24_outOfBounds');
109
+ uint24 tempUint;
110
+
111
+ assembly {
112
+ tempUint := mload(add(add(_bytes, 0x3), _start))
113
+ }
114
+
115
+ return tempUint;
116
+ }
117
+ }
118
+
119
+ // lib/openzeppelin-contracts/contracts/token/ERC20/IERC20.sol
120
+
121
+ interface IERC20 {
122
+ function totalSupply() external view returns (uint256);
123
+ function balanceOf(address account) external view returns (uint256);
124
+ function transfer(address recipient, uint256 amount) external returns (bool);
125
+ function allowance(address owner, address spender) external view returns (uint256);
126
+ function approve(address spender, uint256 amount) external returns (bool);
127
+ function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
128
+
129
+ event Transfer(address indexed from, address indexed to, uint256 value);
130
+ event Approval(address indexed owner, address indexed spender, uint256 value);
131
+ }
132
+
133
+ // lib/openzeppelin-contracts/contracts/drafts/IERC20Permit.sol
134
+
135
+ interface IERC20Permit {
136
+ function permit(
137
+ address owner,
138
+ address spender,
139
+ uint256 value,
140
+ uint256 deadline,
141
+ uint8 v,
142
+ bytes32 r,
143
+ bytes32 s
144
+ ) external;
145
+ }
146
+
147
+ // lib/v3-periphery-main/contracts/interfaces/external/IERC20PermitAllowed.sol
148
+
149
+ /// @title Interface for permit
150
+ /// @notice Interface used by DAI/CHAI for permit
151
+ interface IERC20PermitAllowed {
152
+ /// @notice Approve the spender to spend some tokens via the holder signature
153
+ /// @dev This is the permit interface used by DAI and CHAI
154
+ /// @param holder The address of the token holder, the token owner
155
+ /// @param spender The address of the token spender
156
+ /// @param nonce The holder's nonce, increases at each call to permit
157
+ /// @param expiry The timestamp at which the permit is no longer valid
158
+ /// @param allowed Boolean that sets approval amount, true for type(uint256).max and false for 0
159
+ /// @param v Must produce valid secp256k1 signature from the holder along with `r` and `s`
160
+ /// @param r Must produce valid secp256k1 signature from the holder along with `v` and `s`
161
+ /// @param s Must produce valid secp256k1 signature from the holder along with `r` and `v`
162
+ function permit(
163
+ address holder,
164
+ address spender,
165
+ uint256 nonce,
166
+ uint256 expiry,
167
+ bool allowed,
168
+ uint8 v,
169
+ bytes32 r,
170
+ bytes32 s
171
+ ) external;
172
+ }
173
+
174
+ // lib/v3-periphery-main/contracts/interfaces/IMulticall.sol
175
+
176
+ /// @title Multicall interface
177
+ /// @notice Enables calling multiple methods in a single call to the contract
178
+ interface IMulticall {
179
+ /// @notice Call multiple functions in the current contract and return the data from all of them if they all succeed
180
+ /// @dev The `msg.value` should not be trusted for any method callable from multicall.
181
+ /// @param data The encoded function data for each of the calls to make to this contract
182
+ /// @return results The results from each of the calls passed in via data
183
+ function multicall(bytes[] calldata data) external payable returns (bytes[] memory results);
184
+ }
185
+
186
+ // lib/v3-periphery-main/contracts/interfaces/IPeripheryImmutableState.sol
187
+
188
+ /// @title Immutable state
189
+ /// @notice Functions that return immutable state of the router
190
+ interface IPeripheryImmutableState {
191
+ /// @return Returns the address of the Uniswap V3 factory
192
+ function factory() external view returns (address);
193
+
194
+ /// @return Returns the address of WETH9
195
+ function WETH9() external view returns (address);
196
+ }
197
+
198
+ // lib/v3-periphery-main/contracts/interfaces/IPeripheryPayments.sol
199
+
200
+ /// @title Periphery Payments
201
+ /// @notice Functions to ease deposits and withdrawals of ETH
202
+ interface IPeripheryPayments {
203
+ /// @notice Unwraps the contract's WETH9 balance and sends it to recipient as ETH.
204
+ /// @dev The amountMinimum parameter prevents malicious contracts from stealing WETH9 from users.
205
+ /// @param amountMinimum The minimum amount of WETH9 to unwrap
206
+ /// @param recipient The address receiving ETH
207
+ function unwrapWETH9(uint256 amountMinimum, address recipient) external payable;
208
+
209
+ /// @notice Refunds any ETH balance held by this contract to the `msg.sender`
210
+ /// @dev Useful for bundling with mint or increase liquidity that uses ether, or exact output swaps
211
+ /// that use ether for the input amount
212
+ function refundETH() external payable;
213
+
214
+ /// @notice Transfers the full amount of a token held by this contract to recipient
215
+ /// @dev The amountMinimum parameter prevents malicious contracts from stealing the token from users
216
+ /// @param token The contract address of the token which will be transferred to `recipient`
217
+ /// @param amountMinimum The minimum amount of token required for a transfer
218
+ /// @param recipient The destination address of the token
219
+ function sweepToken(
220
+ address token,
221
+ uint256 amountMinimum,
222
+ address recipient
223
+ ) external payable;
224
+ }
225
+
226
+ // lib/v3-periphery-main/contracts/interfaces/ISelfPermit.sol
227
+
228
+ /// @title Self Permit
229
+ /// @notice Functionality to call permit on any EIP-2612-compliant token for use in the route
230
+ interface ISelfPermit {
231
+ /// @notice Permits this contract to spend a given token from `msg.sender`
232
+ /// @dev The `owner` is always msg.sender and the `spender` is always address(this).
233
+ /// @param token The address of the token spent
234
+ /// @param value The amount that can be spent of token
235
+ /// @param deadline A timestamp, the current blocktime must be less than or equal to this timestamp
236
+ /// @param v Must produce valid secp256k1 signature from the holder along with `r` and `s`
237
+ /// @param r Must produce valid secp256k1 signature from the holder along with `v` and `s`
238
+ /// @param s Must produce valid secp256k1 signature from the holder along with `r` and `v`
239
+ function selfPermit(
240
+ address token,
241
+ uint256 value,
242
+ uint256 deadline,
243
+ uint8 v,
244
+ bytes32 r,
245
+ bytes32 s
246
+ ) external payable;
247
+
248
+ /// @notice Permits this contract to spend a given token from `msg.sender`
249
+ /// @dev The `owner` is always msg.sender and the `spender` is always address(this).
250
+ /// Can be used instead of #selfPermit to prevent calls from failing due to a frontrun of a call to #selfPermit
251
+ /// @param token The address of the token spent
252
+ /// @param value The amount that can be spent of token
253
+ /// @param deadline A timestamp, the current blocktime must be less than or equal to this timestamp
254
+ /// @param v Must produce valid secp256k1 signature from the holder along with `r` and `s`
255
+ /// @param r Must produce valid secp256k1 signature from the holder along with `v` and `s`
256
+ /// @param s Must produce valid secp256k1 signature from the holder along with `r` and `v`
257
+ function selfPermitIfNecessary(
258
+ address token,
259
+ uint256 value,
260
+ uint256 deadline,
261
+ uint8 v,
262
+ bytes32 r,
263
+ bytes32 s
264
+ ) external payable;
265
+
266
+ /// @notice Permits this contract to spend the sender's tokens for permit signatures that have the `allowed` parameter
267
+ /// @dev The `owner` is always msg.sender and the `spender` is always address(this)
268
+ /// @param token The address of the token spent
269
+ /// @param nonce The current nonce of the owner
270
+ /// @param expiry The timestamp at which the permit is no longer valid
271
+ /// @param v Must produce valid secp256k1 signature from the holder along with `r` and `s`
272
+ /// @param r Must produce valid secp256k1 signature from the holder along with `v` and `s`
273
+ /// @param s Must produce valid secp256k1 signature from the holder along with `r` and `v`
274
+ function selfPermitAllowed(
275
+ address token,
276
+ uint256 nonce,
277
+ uint256 expiry,
278
+ uint8 v,
279
+ bytes32 r,
280
+ bytes32 s
281
+ ) external payable;
282
+
283
+ /// @notice Permits this contract to spend the sender's tokens for permit signatures that have the `allowed` parameter
284
+ /// @dev The `owner` is always msg.sender and the `spender` is always address(this)
285
+ /// Can be used instead of #selfPermitAllowed to prevent calls from failing due to a frontrun of a call to #selfPermitAllowed.
286
+ /// @param token The address of the token spent
287
+ /// @param nonce The current nonce of the owner
288
+ /// @param expiry The timestamp at which the permit is no longer valid
289
+ /// @param v Must produce valid secp256k1 signature from the holder along with `r` and `s`
290
+ /// @param r Must produce valid secp256k1 signature from the holder along with `v` and `s`
291
+ /// @param s Must produce valid secp256k1 signature from the holder along with `r` and `v`
292
+ function selfPermitAllowedIfNecessary(
293
+ address token,
294
+ uint256 nonce,
295
+ uint256 expiry,
296
+ uint8 v,
297
+ bytes32 r,
298
+ bytes32 s
299
+ ) external payable;
300
+ }
301
+
302
+ // lib/v3-core-main/contracts/interfaces/pool/IUniswapV3PoolActions.sol
303
+
304
+ /// @title Permissionless pool actions
305
+ /// @notice Contains pool methods that can be called by anyone
306
+ interface IUniswapV3PoolActions {
307
+ /// @notice Sets the initial price for the pool
308
+ /// @dev Price is represented as a sqrt(amountToken1/amountToken0) Q64.96 value
309
+ /// @param sqrtPriceX96 the initial sqrt price of the pool as a Q64.96
310
+ function initialize(uint160 sqrtPriceX96) external;
311
+
312
+ /// @notice Adds liquidity for the given recipient/tickLower/tickUpper position
313
+ /// @dev The caller of this method receives a callback in the form of IUniswapV3MintCallback#uniswapV3MintCallback
314
+ /// in which they must pay any token0 or token1 owed for the liquidity. The amount of token0/token1 due depends
315
+ /// on tickLower, tickUpper, the amount of liquidity, and the current price.
316
+ /// @param recipient The address for which the liquidity will be created
317
+ /// @param tickLower The lower tick of the position in which to add liquidity
318
+ /// @param tickUpper The upper tick of the position in which to add liquidity
319
+ /// @param amount The amount of liquidity to mint
320
+ /// @param data Any data that should be passed through to the callback
321
+ /// @return amount0 The amount of token0 that was paid to mint the given amount of liquidity. Matches the value in the callback
322
+ /// @return amount1 The amount of token1 that was paid to mint the given amount of liquidity. Matches the value in the callback
323
+ function mint(
324
+ address recipient,
325
+ int24 tickLower,
326
+ int24 tickUpper,
327
+ uint128 amount,
328
+ bytes calldata data
329
+ ) external returns (uint256 amount0, uint256 amount1);
330
+
331
+ /// @notice Collects tokens owed to a position
332
+ /// @dev Does not recompute fees earned, which must be done either via mint or burn of any amount of liquidity.
333
+ /// Collect must be called by the position owner. To withdraw only token0 or only token1, amount0Requested or
334
+ /// amount1Requested may be set to zero. To withdraw all tokens owed, caller may pass any value greater than the
335
+ /// actual tokens owed, e.g. type(uint128).max. Tokens owed may be from accumulated swap fees or burned liquidity.
336
+ /// @param recipient The address which should receive the fees collected
337
+ /// @param tickLower The lower tick of the position for which to collect fees
338
+ /// @param tickUpper The upper tick of the position for which to collect fees
339
+ /// @param amount0Requested How much token0 should be withdrawn from the fees owed
340
+ /// @param amount1Requested How much token1 should be withdrawn from the fees owed
341
+ /// @return amount0 The amount of fees collected in token0
342
+ /// @return amount1 The amount of fees collected in token1
343
+ function collect(
344
+ address recipient,
345
+ int24 tickLower,
346
+ int24 tickUpper,
347
+ uint128 amount0Requested,
348
+ uint128 amount1Requested
349
+ ) external returns (uint128 amount0, uint128 amount1);
350
+
351
+ /// @notice Burn liquidity from the sender and account tokens owed for the liquidity to the position
352
+ /// @dev Can be used to trigger a recalculation of fees owed to a position by calling with an amount of 0
353
+ /// @dev Fees must be collected separately via a call to #collect
354
+ /// @param tickLower The lower tick of the position for which to burn liquidity
355
+ /// @param tickUpper The upper tick of the position for which to burn liquidity
356
+ /// @param amount How much liquidity to burn
357
+ /// @return amount0 The amount of token0 sent to the recipient
358
+ /// @return amount1 The amount of token1 sent to the recipient
359
+ function burn(
360
+ int24 tickLower,
361
+ int24 tickUpper,
362
+ uint128 amount
363
+ ) external returns (uint256 amount0, uint256 amount1);
364
+
365
+ /// @notice Swap token0 for token1, or token1 for token0
366
+ /// @dev The caller of this method receives a callback in the form of IUniswapV3SwapCallback#uniswapV3SwapCallback
367
+ /// @param recipient The address to receive the output of the swap
368
+ /// @param zeroForOne The direction of the swap, true for token0 to token1, false for token1 to token0
369
+ /// @param amountSpecified The amount of the swap, which implicitly configures the swap as exact input (positive), or exact output (negative)
370
+ /// @param sqrtPriceLimitX96 The Q64.96 sqrt price limit. If zero for one, the price cannot be less than this
371
+ /// value after the swap. If one for zero, the price cannot be greater than this value after the swap
372
+ /// @param data Any data to be passed through to the callback
373
+ /// @return amount0 The delta of the balance of token0 of the pool, exact when negative, minimum when positive
374
+ /// @return amount1 The delta of the balance of token1 of the pool, exact when negative, minimum when positive
375
+ function swap(
376
+ address recipient,
377
+ bool zeroForOne,
378
+ int256 amountSpecified,
379
+ uint160 sqrtPriceLimitX96,
380
+ bytes calldata data
381
+ ) external returns (int256 amount0, int256 amount1);
382
+
383
+ /// @notice Receive token0 and/or token1 and pay it back, plus a fee, in the callback
384
+ /// @dev The caller of this method receives a callback in the form of IUniswapV3FlashCallback#uniswapV3FlashCallback
385
+ /// @dev Can be used to donate underlying tokens pro-rata to currently in-range liquidity providers by calling
386
+ /// with 0 amount{0,1} and sending the donation amount(s) from the callback
387
+ /// @param recipient The address which will receive the token0 and token1 amounts
388
+ /// @param amount0 The amount of token0 to send
389
+ /// @param amount1 The amount of token1 to send
390
+ /// @param data Any data to be passed through to the callback
391
+ function flash(
392
+ address recipient,
393
+ uint256 amount0,
394
+ uint256 amount1,
395
+ bytes calldata data
396
+ ) external;
397
+
398
+ /// @notice Increase the maximum number of price and liquidity observations that this pool will store
399
+ /// @dev This method is no-op if the pool already has an observationCardinalityNext greater than or equal to
400
+ /// the input observationCardinalityNext.
401
+ /// @param observationCardinalityNext The desired minimum number of observations for the pool to store
402
+ function increaseObservationCardinalityNext(uint16 observationCardinalityNext) external;
403
+ }
404
+
405
+ // lib/v3-core-main/contracts/interfaces/pool/IUniswapV3PoolDerivedState.sol
406
+
407
+ /// @title Pool state that is not stored
408
+ /// @notice Contains view functions to provide information about the pool that is computed rather than stored on the
409
+ /// blockchain. The functions here may have variable gas costs.
410
+ interface IUniswapV3PoolDerivedState {
411
+ /// @notice Returns the cumulative tick and liquidity as of each timestamp `secondsAgo` from the current block timestamp
412
+ /// @dev To get a time weighted average tick or liquidity-in-range, you must call this with two values, one representing
413
+ /// the beginning of the period and another for the end of the period. E.g., to get the last hour time-weighted average tick,
414
+ /// you must call it with secondsAgos = [3600, 0].
415
+ /// @dev The time weighted average tick represents the geometric time weighted average price of the pool, in
416
+ /// log base sqrt(1.0001) of token1 / token0. The TickMath library can be used to go from a tick value to a ratio.
417
+ /// @param secondsAgos From how long ago each cumulative tick and liquidity value should be returned
418
+ /// @return tickCumulatives Cumulative tick values as of each `secondsAgos` from the current block timestamp
419
+ /// @return secondsPerLiquidityCumulativeX128s Cumulative seconds per liquidity-in-range value as of each `secondsAgos` from the current block
420
+ /// timestamp
421
+ function observe(uint32[] calldata secondsAgos)
422
+ external
423
+ view
424
+ returns (int56[] memory tickCumulatives, uint160[] memory secondsPerLiquidityCumulativeX128s);
425
+
426
+ /// @notice Returns a snapshot of the tick cumulative, seconds per liquidity and seconds inside a tick range
427
+ /// @dev Snapshots must only be compared to other snapshots, taken over a period for which a position existed.
428
+ /// I.e., snapshots cannot be compared if a position is not held for the entire period between when the first
429
+ /// snapshot is taken and the second snapshot is taken.
430
+ /// @param tickLower The lower tick of the range
431
+ /// @param tickUpper The upper tick of the range
432
+ /// @return tickCumulativeInside The snapshot of the tick accumulator for the range
433
+ /// @return secondsPerLiquidityInsideX128 The snapshot of seconds per liquidity for the range
434
+ /// @return secondsInside The snapshot of seconds per liquidity for the range
435
+ function snapshotCumulativesInside(int24 tickLower, int24 tickUpper)
436
+ external
437
+ view
438
+ returns (
439
+ int56 tickCumulativeInside,
440
+ uint160 secondsPerLiquidityInsideX128,
441
+ uint32 secondsInside
442
+ );
443
+ }
444
+
445
+ // lib/v3-core-main/contracts/interfaces/pool/IUniswapV3PoolEvents.sol
446
+
447
+ /// @title Events emitted by a pool
448
+ /// @notice Contains all events emitted by the pool
449
+ interface IUniswapV3PoolEvents {
450
+ /// @notice Emitted exactly once by a pool when #initialize is first called on the pool
451
+ /// @dev Mint/Burn/Swap cannot be emitted by the pool before Initialize
452
+ /// @param sqrtPriceX96 The initial sqrt price of the pool, as a Q64.96
453
+ /// @param tick The initial tick of the pool, i.e. log base 1.0001 of the starting price of the pool
454
+ event Initialize(uint160 sqrtPriceX96, int24 tick);
455
+
456
+ /// @notice Emitted when liquidity is minted for a given position
457
+ /// @param sender The address that minted the liquidity
458
+ /// @param owner The owner of the position and recipient of any minted liquidity
459
+ /// @param tickLower The lower tick of the position
460
+ /// @param tickUpper The upper tick of the position
461
+ /// @param amount The amount of liquidity minted to the position range
462
+ /// @param amount0 How much token0 was required for the minted liquidity
463
+ /// @param amount1 How much token1 was required for the minted liquidity
464
+ event Mint(
465
+ address sender,
466
+ address indexed owner,
467
+ int24 indexed tickLower,
468
+ int24 indexed tickUpper,
469
+ uint128 amount,
470
+ uint256 amount0,
471
+ uint256 amount1
472
+ );
473
+
474
+ /// @notice Emitted when fees are collected by the owner of a position
475
+ /// @dev Collect events may be emitted with zero amount0 and amount1 when the caller chooses not to collect fees
476
+ /// @param owner The owner of the position for which fees are collected
477
+ /// @param tickLower The lower tick of the position
478
+ /// @param tickUpper The upper tick of the position
479
+ /// @param amount0 The amount of token0 fees collected
480
+ /// @param amount1 The amount of token1 fees collected
481
+ event Collect(
482
+ address indexed owner,
483
+ address recipient,
484
+ int24 indexed tickLower,
485
+ int24 indexed tickUpper,
486
+ uint128 amount0,
487
+ uint128 amount1
488
+ );
489
+
490
+ /// @notice Emitted when a position's liquidity is removed
491
+ /// @dev Does not withdraw any fees earned by the liquidity position, which must be withdrawn via #collect
492
+ /// @param owner The owner of the position for which liquidity is removed
493
+ /// @param tickLower The lower tick of the position
494
+ /// @param tickUpper The upper tick of the position
495
+ /// @param amount The amount of liquidity to remove
496
+ /// @param amount0 The amount of token0 withdrawn
497
+ /// @param amount1 The amount of token1 withdrawn
498
+ event Burn(
499
+ address indexed owner,
500
+ int24 indexed tickLower,
501
+ int24 indexed tickUpper,
502
+ uint128 amount,
503
+ uint256 amount0,
504
+ uint256 amount1
505
+ );
506
+
507
+ /// @notice Emitted by the pool for any swaps between token0 and token1
508
+ /// @param sender The address that initiated the swap call, and that received the callback
509
+ /// @param recipient The address that received the output of the swap
510
+ /// @param amount0 The delta of the token0 balance of the pool
511
+ /// @param amount1 The delta of the token1 balance of the pool
512
+ /// @param sqrtPriceX96 The sqrt(price) of the pool after the swap, as a Q64.96
513
+ /// @param liquidity The liquidity of the pool after the swap
514
+ /// @param tick The log base 1.0001 of price of the pool after the swap
515
+ event Swap(
516
+ address indexed sender,
517
+ address indexed recipient,
518
+ int256 amount0,
519
+ int256 amount1,
520
+ uint160 sqrtPriceX96,
521
+ uint128 liquidity,
522
+ int24 tick
523
+ );
524
+
525
+ /// @notice Emitted by the pool for any flashes of token0/token1
526
+ /// @param sender The address that initiated the swap call, and that received the callback
527
+ /// @param recipient The address that received the tokens from flash
528
+ /// @param amount0 The amount of token0 that was flashed
529
+ /// @param amount1 The amount of token1 that was flashed
530
+ /// @param paid0 The amount of token0 paid for the flash, which can exceed the amount0 plus the fee
531
+ /// @param paid1 The amount of token1 paid for the flash, which can exceed the amount1 plus the fee
532
+ event Flash(
533
+ address indexed sender,
534
+ address indexed recipient,
535
+ uint256 amount0,
536
+ uint256 amount1,
537
+ uint256 paid0,
538
+ uint256 paid1
539
+ );
540
+
541
+ /// @notice Emitted by the pool for increases to the number of observations that can be stored
542
+ /// @dev observationCardinalityNext is not the observation cardinality until an observation is written at the index
543
+ /// just before a mint/swap/burn.
544
+ /// @param observationCardinalityNextOld The previous value of the next observation cardinality
545
+ /// @param observationCardinalityNextNew The updated value of the next observation cardinality
546
+ event IncreaseObservationCardinalityNext(
547
+ uint16 observationCardinalityNextOld,
548
+ uint16 observationCardinalityNextNew
549
+ );
550
+
551
+ /// @notice Emitted when the protocol fee is changed by the pool
552
+ /// @param feeProtocol0Old The previous value of the token0 protocol fee
553
+ /// @param feeProtocol1Old The previous value of the token1 protocol fee
554
+ /// @param feeProtocol0New The updated value of the token0 protocol fee
555
+ /// @param feeProtocol1New The updated value of the token1 protocol fee
556
+ event SetFeeProtocol(uint8 feeProtocol0Old, uint8 feeProtocol1Old, uint8 feeProtocol0New, uint8 feeProtocol1New);
557
+
558
+ /// @notice Emitted when the collected protocol fees are withdrawn by the factory owner
559
+ /// @param sender The address that collects the protocol fees
560
+ /// @param recipient The address that receives the collected protocol fees
561
+ /// @param amount0 The amount of token0 protocol fees that is withdrawn
562
+ /// @param amount0 The amount of token1 protocol fees that is withdrawn
563
+ event CollectProtocol(address indexed sender, address indexed recipient, uint128 amount0, uint128 amount1);
564
+ }
565
+
566
+ // lib/v3-core-main/contracts/interfaces/pool/IUniswapV3PoolImmutables.sol
567
+
568
+ /// @title Pool state that never changes
569
+ /// @notice These parameters are fixed for a pool forever, i.e., the methods will always return the same values
570
+ interface IUniswapV3PoolImmutables {
571
+ /// @notice The contract that deployed the pool, which must adhere to the IUniswapV3Factory interface
572
+ /// @return The contract address
573
+ function factory() external view returns (address);
574
+
575
+ /// @notice The first of the two tokens of the pool, sorted by address
576
+ /// @return The token contract address
577
+ function token0() external view returns (address);
578
+
579
+ /// @notice The second of the two tokens of the pool, sorted by address
580
+ /// @return The token contract address
581
+ function token1() external view returns (address);
582
+
583
+ /// @notice The pool's fee in hundredths of a bip, i.e. 1e-6
584
+ /// @return The fee
585
+ function fee() external view returns (uint24);
586
+
587
+ /// @notice The pool tick spacing
588
+ /// @dev Ticks can only be used at multiples of this value, minimum of 1 and always positive
589
+ /// e.g.: a tickSpacing of 3 means ticks can be initialized every 3rd tick, i.e., ..., -6, -3, 0, 3, 6, ...
590
+ /// This value is an int24 to avoid casting even though it is always positive.
591
+ /// @return The tick spacing
592
+ function tickSpacing() external view returns (int24);
593
+
594
+ /// @notice The maximum amount of position liquidity that can use any tick in the range
595
+ /// @dev This parameter is enforced per tick to prevent liquidity from overflowing a uint128 at any point, and
596
+ /// also prevents out-of-range liquidity from being used to prevent adding in-range liquidity to a pool
597
+ /// @return The max amount of liquidity per tick
598
+ function maxLiquidityPerTick() external view returns (uint128);
599
+ }
600
+
601
+ // lib/v3-core-main/contracts/interfaces/pool/IUniswapV3PoolOwnerActions.sol
602
+
603
+ /// @title Permissioned pool actions
604
+ /// @notice Contains pool methods that may only be called by the factory owner
605
+ interface IUniswapV3PoolOwnerActions {
606
+ /// @notice Set the denominator of the protocol's % share of the fees
607
+ /// @param feeProtocol0 new protocol fee for token0 of the pool
608
+ /// @param feeProtocol1 new protocol fee for token1 of the pool
609
+ function setFeeProtocol(uint8 feeProtocol0, uint8 feeProtocol1) external;
610
+
611
+ /// @notice Collect the protocol fee accrued to the pool
612
+ /// @param recipient The address to which collected protocol fees should be sent
613
+ /// @param amount0Requested The maximum amount of token0 to send, can be 0 to collect fees in only token1
614
+ /// @param amount1Requested The maximum amount of token1 to send, can be 0 to collect fees in only token0
615
+ /// @return amount0 The protocol fee collected in token0
616
+ /// @return amount1 The protocol fee collected in token1
617
+ function collectProtocol(
618
+ address recipient,
619
+ uint128 amount0Requested,
620
+ uint128 amount1Requested
621
+ ) external returns (uint128 amount0, uint128 amount1);
622
+ }
623
+
624
+ // lib/v3-core-main/contracts/interfaces/pool/IUniswapV3PoolState.sol
625
+
626
+ /// @title Pool state that can change
627
+ /// @notice These methods compose the pool's state, and can change with any frequency including multiple times
628
+ /// per transaction
629
+ interface IUniswapV3PoolState {
630
+ /// @notice The 0th storage slot in the pool stores many values, and is exposed as a single method to save gas
631
+ /// when accessed externally.
632
+ /// @return sqrtPriceX96 The current price of the pool as a sqrt(token1/token0) Q64.96 value
633
+ /// tick The current tick of the pool, i.e. according to the last tick transition that was run.
634
+ /// This value may not always be equal to SqrtTickMath.getTickAtSqrtRatio(sqrtPriceX96) if the price is on a tick
635
+ /// boundary.
636
+ /// observationIndex The index of the last oracle observation that was written,
637
+ /// observationCardinality The current maximum number of observations stored in the pool,
638
+ /// observationCardinalityNext The next maximum number of observations, to be updated when the observation.
639
+ /// feeProtocol The protocol fee for both tokens of the pool.
640
+ /// Encoded as two 4 bit values, where the protocol fee of token1 is shifted 4 bits and the protocol fee of token0
641
+ /// 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.
642
+ /// unlocked Whether the pool is currently locked to reentrancy
643
+ function slot0()
644
+ external
645
+ view
646
+ returns (
647
+ uint160 sqrtPriceX96,
648
+ int24 tick,
649
+ uint16 observationIndex,
650
+ uint16 observationCardinality,
651
+ uint16 observationCardinalityNext,
652
+ uint8 feeProtocol,
653
+ bool unlocked
654
+ );
655
+
656
+ /// @notice The fee growth as a Q128.128 fees of token0 collected per unit of liquidity for the entire life of the pool
657
+ /// @dev This value can overflow the uint256
658
+ function feeGrowthGlobal0X128() external view returns (uint256);
659
+
660
+ /// @notice The fee growth as a Q128.128 fees of token1 collected per unit of liquidity for the entire life of the pool
661
+ /// @dev This value can overflow the uint256
662
+ function feeGrowthGlobal1X128() external view returns (uint256);
663
+
664
+ /// @notice The amounts of token0 and token1 that are owed to the protocol
665
+ /// @dev Protocol fees will never exceed uint128 max in either token
666
+ function protocolFees() external view returns (uint128 token0, uint128 token1);
667
+
668
+ /// @notice The currently in range liquidity available to the pool
669
+ /// @dev This value has no relationship to the total liquidity across all ticks
670
+ function liquidity() external view returns (uint128);
671
+
672
+ /// @notice Look up information about a specific tick in the pool
673
+ /// @param tick The tick to look up
674
+ /// @return liquidityGross the total amount of position liquidity that uses the pool either as tick lower or
675
+ /// tick upper,
676
+ /// liquidityNet how much liquidity changes when the pool price crosses the tick,
677
+ /// feeGrowthOutside0X128 the fee growth on the other side of the tick from the current tick in token0,
678
+ /// feeGrowthOutside1X128 the fee growth on the other side of the tick from the current tick in token1,
679
+ /// tickCumulativeOutside the cumulative tick value on the other side of the tick from the current tick
680
+ /// secondsPerLiquidityOutsideX128 the seconds spent per liquidity on the other side of the tick from the current tick,
681
+ /// secondsOutside the seconds spent on the other side of the tick from the current tick,
682
+ /// initialized Set to true if the tick is initialized, i.e. liquidityGross is greater than 0, otherwise equal to false.
683
+ /// Outside values can only be used if the tick is initialized, i.e. if liquidityGross is greater than 0.
684
+ /// In addition, these values are only relative and must be used only in comparison to previous snapshots for
685
+ /// a specific position.
686
+ function ticks(int24 tick)
687
+ external
688
+ view
689
+ returns (
690
+ uint128 liquidityGross,
691
+ int128 liquidityNet,
692
+ uint256 feeGrowthOutside0X128,
693
+ uint256 feeGrowthOutside1X128,
694
+ int56 tickCumulativeOutside,
695
+ uint160 secondsPerLiquidityOutsideX128,
696
+ uint32 secondsOutside,
697
+ bool initialized
698
+ );
699
+
700
+ /// @notice Returns 256 packed tick initialized boolean values. See TickBitmap for more information
701
+ function tickBitmap(int16 wordPosition) external view returns (uint256);
702
+
703
+ /// @notice Returns the information about a position by the position's key
704
+ /// @param key The position's key is a hash of a preimage composed by the owner, tickLower and tickUpper
705
+ /// @return _liquidity The amount of liquidity in the position,
706
+ /// Returns feeGrowthInside0LastX128 fee growth of token0 inside the tick range as of the last mint/burn/poke,
707
+ /// Returns feeGrowthInside1LastX128 fee growth of token1 inside the tick range as of the last mint/burn/poke,
708
+ /// Returns tokensOwed0 the computed amount of token0 owed to the position as of the last mint/burn/poke,
709
+ /// Returns tokensOwed1 the computed amount of token1 owed to the position as of the last mint/burn/poke
710
+ function positions(bytes32 key)
711
+ external
712
+ view
713
+ returns (
714
+ uint128 _liquidity,
715
+ uint256 feeGrowthInside0LastX128,
716
+ uint256 feeGrowthInside1LastX128,
717
+ uint128 tokensOwed0,
718
+ uint128 tokensOwed1
719
+ );
720
+
721
+ /// @notice Returns data about a specific observation index
722
+ /// @param index The element of the observations array to fetch
723
+ /// @dev You most likely want to use #observe() instead of this method to get an observation as of some amount of time
724
+ /// ago, rather than at a specific index in the array.
725
+ /// @return blockTimestamp The timestamp of the observation,
726
+ /// Returns tickCumulative the tick multiplied by seconds elapsed for the life of the pool as of the observation timestamp,
727
+ /// Returns secondsPerLiquidityCumulativeX128 the seconds per in range liquidity for the life of the pool as of the observation timestamp,
728
+ /// Returns initialized whether the observation has been initialized and the values are safe to use
729
+ function observations(uint256 index)
730
+ external
731
+ view
732
+ returns (
733
+ uint32 blockTimestamp,
734
+ int56 tickCumulative,
735
+ uint160 secondsPerLiquidityCumulativeX128,
736
+ bool initialized
737
+ );
738
+ }
739
+
740
+ // lib/v3-core-main/contracts/interfaces/callback/IUniswapV3SwapCallback.sol
741
+
742
+ /// @title Callback for IUniswapV3PoolActions#swap
743
+ /// @notice Any contract that calls IUniswapV3PoolActions#swap must implement this interface
744
+ interface IUniswapV3SwapCallback {
745
+ /// @notice Called to `msg.sender` after executing a swap via IUniswapV3Pool#swap.
746
+ /// @dev In the implementation you must pay the pool tokens owed for the swap.
747
+ /// The caller of this method must be checked to be a UniswapV3Pool deployed by the canonical UniswapV3Factory.
748
+ /// amount0Delta and amount1Delta can both be 0 if no tokens were swapped.
749
+ /// @param amount0Delta The amount of token0 that was sent (negative) or must be received (positive) by the pool by
750
+ /// the end of the swap. If positive, the callback must send that amount of token0 to the pool.
751
+ /// @param amount1Delta The amount of token1 that was sent (negative) or must be received (positive) by the pool by
752
+ /// the end of the swap. If positive, the callback must send that amount of token1 to the pool.
753
+ /// @param data Any data passed through by the caller via the IUniswapV3PoolActions#swap call
754
+ function uniswapV3SwapCallback(
755
+ int256 amount0Delta,
756
+ int256 amount1Delta,
757
+ bytes calldata data
758
+ ) external;
759
+ }
760
+
761
+ // lib/v3-core-main/contracts/libraries/LowGasSafeMath.sol
762
+
763
+ /// @title Optimized overflow and underflow safe math operations
764
+ /// @notice Contains methods for doing math operations that revert on overflow or underflow for minimal gas cost
765
+ library LowGasSafeMath {
766
+ /// @notice Returns x + y, reverts if sum overflows uint256
767
+ /// @param x The augend
768
+ /// @param y The addend
769
+ /// @return z The sum of x and y
770
+ function add(uint256 x, uint256 y) internal pure returns (uint256 z) {
771
+ require((z = x + y) >= x);
772
+ }
773
+
774
+ /// @notice Returns x - y, reverts if underflows
775
+ /// @param x The minuend
776
+ /// @param y The subtrahend
777
+ /// @return z The difference of x and y
778
+ function sub(uint256 x, uint256 y) internal pure returns (uint256 z) {
779
+ require((z = x - y) <= x);
780
+ }
781
+
782
+ /// @notice Returns x * y, reverts if overflows
783
+ /// @param x The multiplicand
784
+ /// @param y The multiplier
785
+ /// @return z The product of x and y
786
+ function mul(uint256 x, uint256 y) internal pure returns (uint256 z) {
787
+ require(x == 0 || (z = x * y) / x == y);
788
+ }
789
+
790
+ /// @notice Returns x + y, reverts if overflows or underflows
791
+ /// @param x The augend
792
+ /// @param y The addend
793
+ /// @return z The sum of x and y
794
+ function add(int256 x, int256 y) internal pure returns (int256 z) {
795
+ require((z = x + y) >= x == (y >= 0));
796
+ }
797
+
798
+ /// @notice Returns x - y, reverts if overflows or underflows
799
+ /// @param x The minuend
800
+ /// @param y The subtrahend
801
+ /// @return z The difference of x and y
802
+ function sub(int256 x, int256 y) internal pure returns (int256 z) {
803
+ require((z = x - y) <= x == (y >= 0));
804
+ }
805
+ }
806
+
807
+ // lib/v3-periphery-main/contracts/libraries/PoolAddress.sol
808
+
809
+ /// @title Provides functions for deriving a pool address from the factory, tokens, and the fee
810
+ library PoolAddress {
811
+ bytes32 internal constant POOL_INIT_CODE_HASH = 0xe34f199b19b2b4f47f68442619d555527d244f78a3297ea89325f843f87b8b54;
812
+
813
+ /// @notice The identifying key of the pool
814
+ struct PoolKey {
815
+ address token0;
816
+ address token1;
817
+ uint24 fee;
818
+ }
819
+
820
+ /// @notice Returns PoolKey: the ordered tokens with the matched fee levels
821
+ /// @param tokenA The first token of a pool, unsorted
822
+ /// @param tokenB The second token of a pool, unsorted
823
+ /// @param fee The fee level of the pool
824
+ /// @return Poolkey The pool details with ordered token0 and token1 assignments
825
+ function getPoolKey(
826
+ address tokenA,
827
+ address tokenB,
828
+ uint24 fee
829
+ ) internal pure returns (PoolKey memory) {
830
+ if (tokenA > tokenB) (tokenA, tokenB) = (tokenB, tokenA);
831
+ return PoolKey({token0: tokenA, token1: tokenB, fee: fee});
832
+ }
833
+
834
+ /// @notice Deterministically computes the pool address given the factory and PoolKey
835
+ /// @param factory The Uniswap V3 factory contract address
836
+ /// @param key The PoolKey
837
+ /// @return pool The contract address of the V3 pool
838
+ function computeAddress(address factory, PoolKey memory key) internal pure returns (address pool) {
839
+ require(key.token0 < key.token1);
840
+ pool = address(
841
+ uint256(
842
+ keccak256(
843
+ abi.encodePacked(
844
+ hex'ff',
845
+ factory,
846
+ keccak256(abi.encode(key.token0, key.token1, key.fee)),
847
+ POOL_INIT_CODE_HASH
848
+ )
849
+ )
850
+ )
851
+ );
852
+ }
853
+ }
854
+
855
+ // lib/v3-core-main/contracts/libraries/SafeCast.sol
856
+
857
+ /// @title Safe casting methods
858
+ /// @notice Contains methods for safely casting between types
859
+ library SafeCast {
860
+ /// @notice Cast a uint256 to a uint160, revert on overflow
861
+ /// @param y The uint256 to be downcasted
862
+ /// @return z The downcasted integer, now type uint160
863
+ function toUint160(uint256 y) internal pure returns (uint160 z) {
864
+ require((z = uint160(y)) == y);
865
+ }
866
+
867
+ /// @notice Cast a int256 to a int128, revert on overflow or underflow
868
+ /// @param y The int256 to be downcasted
869
+ /// @return z The downcasted integer, now type int128
870
+ function toInt128(int256 y) internal pure returns (int128 z) {
871
+ require((z = int128(y)) == y);
872
+ }
873
+
874
+ /// @notice Cast a uint256 to a int256, revert on overflow
875
+ /// @param y The uint256 to be casted
876
+ /// @return z The casted integer, now type int256
877
+ function toInt256(uint256 y) internal pure returns (int256 z) {
878
+ require(y < 2**255);
879
+ z = int256(y);
880
+ }
881
+ }
882
+
883
+ // lib/v3-core-main/contracts/libraries/TickMath.sol
884
+
885
+ /// @title Math library for computing sqrt prices from ticks and vice versa
886
+ /// @notice Computes sqrt price for ticks of size 1.0001, i.e. sqrt(1.0001^tick) as fixed point Q64.96 numbers. Supports
887
+ /// prices between 2**-128 and 2**128
888
+ library TickMath {
889
+ /// @dev The minimum tick that may be passed to #getSqrtRatioAtTick computed from log base 1.0001 of 2**-128
890
+ int24 internal constant MIN_TICK = -887272;
891
+ /// @dev The maximum tick that may be passed to #getSqrtRatioAtTick computed from log base 1.0001 of 2**128
892
+ int24 internal constant MAX_TICK = -MIN_TICK;
893
+
894
+ /// @dev The minimum value that can be returned from #getSqrtRatioAtTick. Equivalent to getSqrtRatioAtTick(MIN_TICK)
895
+ uint160 internal constant MIN_SQRT_RATIO = 4295128739;
896
+ /// @dev The maximum value that can be returned from #getSqrtRatioAtTick. Equivalent to getSqrtRatioAtTick(MAX_TICK)
897
+ uint160 internal constant MAX_SQRT_RATIO = 1461446703485210103287273052203988822378723970342;
898
+
899
+ /// @notice Calculates sqrt(1.0001^tick) * 2^96
900
+ /// @dev Throws if |tick| > max tick
901
+ /// @param tick The input tick for the above formula
902
+ /// @return sqrtPriceX96 A Fixed point Q64.96 number representing the sqrt of the ratio of the two assets (token1/token0)
903
+ /// at the given tick
904
+ function getSqrtRatioAtTick(int24 tick) internal pure returns (uint160 sqrtPriceX96) {
905
+ uint256 absTick = tick < 0 ? uint256(-int256(tick)) : uint256(int256(tick));
906
+ require(absTick <= uint256(MAX_TICK), 'T');
907
+
908
+ uint256 ratio = absTick & 0x1 != 0 ? 0xfffcb933bd6fad37aa2d162d1a594001 : 0x100000000000000000000000000000000;
909
+ if (absTick & 0x2 != 0) ratio = (ratio * 0xfff97272373d413259a46990580e213a) >> 128;
910
+ if (absTick & 0x4 != 0) ratio = (ratio * 0xfff2e50f5f656932ef12357cf3c7fdcc) >> 128;
911
+ if (absTick & 0x8 != 0) ratio = (ratio * 0xffe5caca7e10e4e61c3624eaa0941cd0) >> 128;
912
+ if (absTick & 0x10 != 0) ratio = (ratio * 0xffcb9843d60f6159c9db58835c926644) >> 128;
913
+ if (absTick & 0x20 != 0) ratio = (ratio * 0xff973b41fa98c081472e6896dfb254c0) >> 128;
914
+ if (absTick & 0x40 != 0) ratio = (ratio * 0xff2ea16466c96a3843ec78b326b52861) >> 128;
915
+ if (absTick & 0x80 != 0) ratio = (ratio * 0xfe5dee046a99a2a811c461f1969c3053) >> 128;
916
+ if (absTick & 0x100 != 0) ratio = (ratio * 0xfcbe86c7900a88aedcffc83b479aa3a4) >> 128;
917
+ if (absTick & 0x200 != 0) ratio = (ratio * 0xf987a7253ac413176f2b074cf7815e54) >> 128;
918
+ if (absTick & 0x400 != 0) ratio = (ratio * 0xf3392b0822b70005940c7a398e4b70f3) >> 128;
919
+ if (absTick & 0x800 != 0) ratio = (ratio * 0xe7159475a2c29b7443b29c7fa6e889d9) >> 128;
920
+ if (absTick & 0x1000 != 0) ratio = (ratio * 0xd097f3bdfd2022b8845ad8f792aa5825) >> 128;
921
+ if (absTick & 0x2000 != 0) ratio = (ratio * 0xa9f746462d870fdf8a65dc1f90e061e5) >> 128;
922
+ if (absTick & 0x4000 != 0) ratio = (ratio * 0x70d869a156d2a1b890bb3df62baf32f7) >> 128;
923
+ if (absTick & 0x8000 != 0) ratio = (ratio * 0x31be135f97d08fd981231505542fcfa6) >> 128;
924
+ if (absTick & 0x10000 != 0) ratio = (ratio * 0x9aa508b5b7a84e1c677de54f3e99bc9) >> 128;
925
+ if (absTick & 0x20000 != 0) ratio = (ratio * 0x5d6af8dedb81196699c329225ee604) >> 128;
926
+ if (absTick & 0x40000 != 0) ratio = (ratio * 0x2216e584f5fa1ea926041bedfe98) >> 128;
927
+ if (absTick & 0x80000 != 0) ratio = (ratio * 0x48a170391f7dc42444e8fa2) >> 128;
928
+
929
+ if (tick > 0) ratio = type(uint256).max / ratio;
930
+
931
+ // this divides by 1<<32 rounding up to go from a Q128.128 to a Q128.96.
932
+ // we then downcast because we know the result always fits within 160 bits due to our tick input constraint
933
+ // we round up in the division so getTickAtSqrtRatio of the output price is always consistent
934
+ sqrtPriceX96 = uint160((ratio >> 32) + (ratio % (1 << 32) == 0 ? 0 : 1));
935
+ }
936
+
937
+ /// @notice Calculates the greatest tick value such that getRatioAtTick(tick) <= ratio
938
+ /// @dev Throws in case sqrtPriceX96 < MIN_SQRT_RATIO, as MIN_SQRT_RATIO is the lowest value getRatioAtTick may
939
+ /// ever return.
940
+ /// @param sqrtPriceX96 The sqrt ratio for which to compute the tick as a Q64.96
941
+ /// @return tick The greatest tick for which the ratio is less than or equal to the input ratio
942
+ function getTickAtSqrtRatio(uint160 sqrtPriceX96) internal pure returns (int24 tick) {
943
+ // second inequality must be < because the price can never reach the price at the max tick
944
+ require(sqrtPriceX96 >= MIN_SQRT_RATIO && sqrtPriceX96 < MAX_SQRT_RATIO, 'R');
945
+ uint256 ratio = uint256(sqrtPriceX96) << 32;
946
+
947
+ uint256 r = ratio;
948
+ uint256 msb = 0;
949
+
950
+ assembly {
951
+ let f := shl(7, gt(r, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF))
952
+ msb := or(msb, f)
953
+ r := shr(f, r)
954
+ }
955
+ assembly {
956
+ let f := shl(6, gt(r, 0xFFFFFFFFFFFFFFFF))
957
+ msb := or(msb, f)
958
+ r := shr(f, r)
959
+ }
960
+ assembly {
961
+ let f := shl(5, gt(r, 0xFFFFFFFF))
962
+ msb := or(msb, f)
963
+ r := shr(f, r)
964
+ }
965
+ assembly {
966
+ let f := shl(4, gt(r, 0xFFFF))
967
+ msb := or(msb, f)
968
+ r := shr(f, r)
969
+ }
970
+ assembly {
971
+ let f := shl(3, gt(r, 0xFF))
972
+ msb := or(msb, f)
973
+ r := shr(f, r)
974
+ }
975
+ assembly {
976
+ let f := shl(2, gt(r, 0xF))
977
+ msb := or(msb, f)
978
+ r := shr(f, r)
979
+ }
980
+ assembly {
981
+ let f := shl(1, gt(r, 0x3))
982
+ msb := or(msb, f)
983
+ r := shr(f, r)
984
+ }
985
+ assembly {
986
+ let f := gt(r, 0x1)
987
+ msb := or(msb, f)
988
+ }
989
+
990
+ if (msb >= 128) r = ratio >> (msb - 127);
991
+ else r = ratio << (127 - msb);
992
+
993
+ int256 log_2 = (int256(msb) - 128) << 64;
994
+
995
+ assembly {
996
+ r := shr(127, mul(r, r))
997
+ let f := shr(128, r)
998
+ log_2 := or(log_2, shl(63, f))
999
+ r := shr(f, r)
1000
+ }
1001
+ assembly {
1002
+ r := shr(127, mul(r, r))
1003
+ let f := shr(128, r)
1004
+ log_2 := or(log_2, shl(62, f))
1005
+ r := shr(f, r)
1006
+ }
1007
+ assembly {
1008
+ r := shr(127, mul(r, r))
1009
+ let f := shr(128, r)
1010
+ log_2 := or(log_2, shl(61, f))
1011
+ r := shr(f, r)
1012
+ }
1013
+ assembly {
1014
+ r := shr(127, mul(r, r))
1015
+ let f := shr(128, r)
1016
+ log_2 := or(log_2, shl(60, f))
1017
+ r := shr(f, r)
1018
+ }
1019
+ assembly {
1020
+ r := shr(127, mul(r, r))
1021
+ let f := shr(128, r)
1022
+ log_2 := or(log_2, shl(59, f))
1023
+ r := shr(f, r)
1024
+ }
1025
+ assembly {
1026
+ r := shr(127, mul(r, r))
1027
+ let f := shr(128, r)
1028
+ log_2 := or(log_2, shl(58, f))
1029
+ r := shr(f, r)
1030
+ }
1031
+ assembly {
1032
+ r := shr(127, mul(r, r))
1033
+ let f := shr(128, r)
1034
+ log_2 := or(log_2, shl(57, f))
1035
+ r := shr(f, r)
1036
+ }
1037
+ assembly {
1038
+ r := shr(127, mul(r, r))
1039
+ let f := shr(128, r)
1040
+ log_2 := or(log_2, shl(56, f))
1041
+ r := shr(f, r)
1042
+ }
1043
+ assembly {
1044
+ r := shr(127, mul(r, r))
1045
+ let f := shr(128, r)
1046
+ log_2 := or(log_2, shl(55, f))
1047
+ r := shr(f, r)
1048
+ }
1049
+ assembly {
1050
+ r := shr(127, mul(r, r))
1051
+ let f := shr(128, r)
1052
+ log_2 := or(log_2, shl(54, f))
1053
+ r := shr(f, r)
1054
+ }
1055
+ assembly {
1056
+ r := shr(127, mul(r, r))
1057
+ let f := shr(128, r)
1058
+ log_2 := or(log_2, shl(53, f))
1059
+ r := shr(f, r)
1060
+ }
1061
+ assembly {
1062
+ r := shr(127, mul(r, r))
1063
+ let f := shr(128, r)
1064
+ log_2 := or(log_2, shl(52, f))
1065
+ r := shr(f, r)
1066
+ }
1067
+ assembly {
1068
+ r := shr(127, mul(r, r))
1069
+ let f := shr(128, r)
1070
+ log_2 := or(log_2, shl(51, f))
1071
+ r := shr(f, r)
1072
+ }
1073
+ assembly {
1074
+ r := shr(127, mul(r, r))
1075
+ let f := shr(128, r)
1076
+ log_2 := or(log_2, shl(50, f))
1077
+ }
1078
+
1079
+ int256 log_sqrt10001 = log_2 * 255738958999603826347141; // 128.128 number
1080
+
1081
+ int24 tickLow = int24((log_sqrt10001 - 3402992956809132418596140100660247210) >> 128);
1082
+ int24 tickHi = int24((log_sqrt10001 + 291339464771989622907027621153398088495) >> 128);
1083
+
1084
+ tick = tickLow == tickHi ? tickLow : getSqrtRatioAtTick(tickHi) <= sqrtPriceX96 ? tickHi : tickLow;
1085
+ }
1086
+ }
1087
+
1088
+ // lib/v3-periphery-main/contracts/interfaces/IPeripheryPaymentsWithFee.sol
1089
+
1090
+ /// @title Periphery Payments
1091
+ /// @notice Functions to ease deposits and withdrawals of ETH
1092
+ interface IPeripheryPaymentsWithFee is IPeripheryPayments {
1093
+ /// @notice Unwraps the contract's WETH9 balance and sends it to recipient as ETH, with a percentage between
1094
+ /// 0 (exclusive), and 1 (inclusive) going to feeRecipient
1095
+ /// @dev The amountMinimum parameter prevents malicious contracts from stealing WETH9 from users.
1096
+ function unwrapWETH9WithFee(
1097
+ uint256 amountMinimum,
1098
+ address recipient,
1099
+ uint256 feeBips,
1100
+ address feeRecipient
1101
+ ) external payable;
1102
+
1103
+ /// @notice Transfers the full amount of a token held by this contract to recipient, with a percentage between
1104
+ /// 0 (exclusive) and 1 (inclusive) going to feeRecipient
1105
+ /// @dev The amountMinimum parameter prevents malicious contracts from stealing the token from users
1106
+ function sweepTokenWithFee(
1107
+ address token,
1108
+ uint256 amountMinimum,
1109
+ address recipient,
1110
+ uint256 feeBips,
1111
+ address feeRecipient
1112
+ ) external payable;
1113
+ }
1114
+
1115
+ // lib/v3-periphery-main/contracts/interfaces/ISwapRouter.sol
1116
+
1117
+ /// @title Router token swapping functionality
1118
+ /// @notice Functions for swapping tokens via Uniswap V3
1119
+ interface ISwapRouter is IUniswapV3SwapCallback {
1120
+ struct ExactInputSingleParams {
1121
+ address tokenIn;
1122
+ address tokenOut;
1123
+ uint24 fee;
1124
+ address recipient;
1125
+ uint256 deadline;
1126
+ uint256 amountIn;
1127
+ uint256 amountOutMinimum;
1128
+ uint160 sqrtPriceLimitX96;
1129
+ }
1130
+
1131
+ /// @notice Swaps `amountIn` of one token for as much as possible of another token
1132
+ /// @param params The parameters necessary for the swap, encoded as `ExactInputSingleParams` in calldata
1133
+ /// @return amountOut The amount of the received token
1134
+ function exactInputSingle(ExactInputSingleParams calldata params) external payable returns (uint256 amountOut);
1135
+
1136
+ struct ExactInputParams {
1137
+ bytes path;
1138
+ address recipient;
1139
+ uint256 deadline;
1140
+ uint256 amountIn;
1141
+ uint256 amountOutMinimum;
1142
+ }
1143
+
1144
+ /// @notice Swaps `amountIn` of one token for as much as possible of another along the specified path
1145
+ /// @param params The parameters necessary for the multi-hop swap, encoded as `ExactInputParams` in calldata
1146
+ /// @return amountOut The amount of the received token
1147
+ function exactInput(ExactInputParams calldata params) external payable returns (uint256 amountOut);
1148
+
1149
+ struct ExactOutputSingleParams {
1150
+ address tokenIn;
1151
+ address tokenOut;
1152
+ uint24 fee;
1153
+ address recipient;
1154
+ uint256 deadline;
1155
+ uint256 amountOut;
1156
+ uint256 amountInMaximum;
1157
+ uint160 sqrtPriceLimitX96;
1158
+ }
1159
+
1160
+ /// @notice Swaps as little as possible of one token for `amountOut` of another token
1161
+ /// @param params The parameters necessary for the swap, encoded as `ExactOutputSingleParams` in calldata
1162
+ /// @return amountIn The amount of the input token
1163
+ function exactOutputSingle(ExactOutputSingleParams calldata params) external payable returns (uint256 amountIn);
1164
+
1165
+ struct ExactOutputParams {
1166
+ bytes path;
1167
+ address recipient;
1168
+ uint256 deadline;
1169
+ uint256 amountOut;
1170
+ uint256 amountInMaximum;
1171
+ }
1172
+
1173
+ /// @notice Swaps as little as possible of one token for `amountOut` of another along the specified path (reversed)
1174
+ /// @param params The parameters necessary for the multi-hop swap, encoded as `ExactOutputParams` in calldata
1175
+ /// @return amountIn The amount of the input token
1176
+ function exactOutput(ExactOutputParams calldata params) external payable returns (uint256 amountIn);
1177
+ }
1178
+
1179
+ // lib/v3-periphery-main/contracts/interfaces/external/IWETH9.sol
1180
+
1181
+ /// @title Interface for WETH9
1182
+ interface IWETH9 is IERC20 {
1183
+ /// @notice Deposit ether to get wrapped ether
1184
+ function deposit() external payable;
1185
+
1186
+ /// @notice Withdraw wrapped ether to get ether
1187
+ function withdraw(uint256) external;
1188
+ }
1189
+
1190
+ // lib/v3-periphery-main/contracts/base/Multicall.sol
1191
+
1192
+ /// @title Multicall
1193
+ /// @notice Enables calling multiple methods in a single call to the contract
1194
+ abstract contract Multicall is IMulticall {
1195
+ /// @inheritdoc IMulticall
1196
+ function multicall(bytes[] calldata data) public payable override returns (bytes[] memory results) {
1197
+ results = new bytes[](data.length);
1198
+ for (uint256 i = 0; i < data.length; i++) {
1199
+ (bool success, bytes memory result) = address(this).delegatecall(data[i]);
1200
+
1201
+ if (!success) {
1202
+ // Next 5 lines from https://ethereum.stackexchange.com/a/83577
1203
+ if (result.length < 68) revert();
1204
+ assembly {
1205
+ result := add(result, 0x04)
1206
+ }
1207
+ revert(abi.decode(result, (string)));
1208
+ }
1209
+
1210
+ results[i] = result;
1211
+ }
1212
+ }
1213
+ }
1214
+
1215
+ // lib/v3-periphery-main/contracts/libraries/Path.sol
1216
+
1217
+ /// @title Functions for manipulating path data for multihop swaps
1218
+ library Path {
1219
+ using BytesLib for bytes;
1220
+
1221
+ /// @dev The length of the bytes encoded address
1222
+ uint256 private constant ADDR_SIZE = 20;
1223
+ /// @dev The length of the bytes encoded fee
1224
+ uint256 private constant FEE_SIZE = 3;
1225
+
1226
+ /// @dev The offset of a single token address and pool fee
1227
+ uint256 private constant NEXT_OFFSET = ADDR_SIZE + FEE_SIZE;
1228
+ /// @dev The offset of an encoded pool key
1229
+ uint256 private constant POP_OFFSET = NEXT_OFFSET + ADDR_SIZE;
1230
+ /// @dev The minimum length of an encoding that contains 2 or more pools
1231
+ uint256 private constant MULTIPLE_POOLS_MIN_LENGTH = POP_OFFSET + NEXT_OFFSET;
1232
+
1233
+ /// @notice Returns true iff the path contains two or more pools
1234
+ /// @param path The encoded swap path
1235
+ /// @return True if path contains two or more pools, otherwise false
1236
+ function hasMultiplePools(bytes memory path) internal pure returns (bool) {
1237
+ return path.length >= MULTIPLE_POOLS_MIN_LENGTH;
1238
+ }
1239
+
1240
+ /// @notice Returns the number of pools in the path
1241
+ /// @param path The encoded swap path
1242
+ /// @return The number of pools in the path
1243
+ function numPools(bytes memory path) internal pure returns (uint256) {
1244
+ // Ignore the first token address. From then on every fee and token offset indicates a pool.
1245
+ return ((path.length - ADDR_SIZE) / NEXT_OFFSET);
1246
+ }
1247
+
1248
+ /// @notice Decodes the first pool in path
1249
+ /// @param path The bytes encoded swap path
1250
+ /// @return tokenA The first token of the given pool
1251
+ /// @return tokenB The second token of the given pool
1252
+ /// @return fee The fee level of the pool
1253
+ function decodeFirstPool(bytes memory path)
1254
+ internal
1255
+ pure
1256
+ returns (
1257
+ address tokenA,
1258
+ address tokenB,
1259
+ uint24 fee
1260
+ )
1261
+ {
1262
+ tokenA = path.toAddress(0);
1263
+ fee = path.toUint24(ADDR_SIZE);
1264
+ tokenB = path.toAddress(NEXT_OFFSET);
1265
+ }
1266
+
1267
+ /// @notice Gets the segment corresponding to the first pool in the path
1268
+ /// @param path The bytes encoded swap path
1269
+ /// @return The segment containing all data necessary to target the first pool in the path
1270
+ function getFirstPool(bytes memory path) internal pure returns (bytes memory) {
1271
+ return path.slice(0, POP_OFFSET);
1272
+ }
1273
+
1274
+ /// @notice Skips a token + fee element from the buffer and returns the remainder
1275
+ /// @param path The swap path
1276
+ /// @return The remaining token + fee elements in the path
1277
+ function skipToken(bytes memory path) internal pure returns (bytes memory) {
1278
+ return path.slice(NEXT_OFFSET, path.length - NEXT_OFFSET);
1279
+ }
1280
+ }
1281
+
1282
+ // lib/v3-periphery-main/contracts/base/PeripheryImmutableState.sol
1283
+
1284
+ /// @title Immutable state
1285
+ /// @notice Immutable state used by periphery contracts
1286
+ abstract contract PeripheryImmutableState is IPeripheryImmutableState {
1287
+ /// @inheritdoc IPeripheryImmutableState
1288
+ address public immutable override factory;
1289
+ /// @inheritdoc IPeripheryImmutableState
1290
+ address public immutable override WETH9;
1291
+
1292
+ constructor(address _factory, address _WETH9) {
1293
+ factory = _factory;
1294
+ WETH9 = _WETH9;
1295
+ }
1296
+ }
1297
+
1298
+ // lib/v3-periphery-main/contracts/base/PeripheryValidation.sol
1299
+
1300
+ abstract contract PeripheryValidation is BlockTimestamp {
1301
+ modifier checkDeadline(uint256 deadline) {
1302
+ require(_blockTimestamp() <= deadline, 'Transaction too old');
1303
+ _;
1304
+ }
1305
+ }
1306
+
1307
+ // lib/v3-periphery-main/contracts/libraries/TransferHelper.sol
1308
+
1309
+ library TransferHelper {
1310
+ /// @notice Transfers tokens from the targeted address to the given destination
1311
+ /// @notice Errors with 'STF' if transfer fails
1312
+ /// @param token The contract address of the token to be transferred
1313
+ /// @param from The originating address from which the tokens will be transferred
1314
+ /// @param to The destination address of the transfer
1315
+ /// @param value The amount to be transferred
1316
+ function safeTransferFrom(
1317
+ address token,
1318
+ address from,
1319
+ address to,
1320
+ uint256 value
1321
+ ) internal {
1322
+ (bool success, bytes memory data) =
1323
+ token.call(abi.encodeWithSelector(IERC20.transferFrom.selector, from, to, value));
1324
+ require(success && (data.length == 0 || abi.decode(data, (bool))), 'STF');
1325
+ }
1326
+
1327
+ /// @notice Transfers tokens from msg.sender to a recipient
1328
+ /// @dev Errors with ST if transfer fails
1329
+ /// @param token The contract address of the token which will be transferred
1330
+ /// @param to The recipient of the transfer
1331
+ /// @param value The value of the transfer
1332
+ function safeTransfer(
1333
+ address token,
1334
+ address to,
1335
+ uint256 value
1336
+ ) internal {
1337
+ (bool success, bytes memory data) = token.call(abi.encodeWithSelector(IERC20.transfer.selector, to, value));
1338
+ require(success && (data.length == 0 || abi.decode(data, (bool))), 'ST');
1339
+ }
1340
+
1341
+ /// @notice Approves the stipulated contract to spend the given allowance in the given token
1342
+ /// @dev Errors with 'SA' if transfer fails
1343
+ /// @param token The contract address of the token to be approved
1344
+ /// @param to The target of the approval
1345
+ /// @param value The amount of the given token the target will be allowed to spend
1346
+ function safeApprove(
1347
+ address token,
1348
+ address to,
1349
+ uint256 value
1350
+ ) internal {
1351
+ (bool success, bytes memory data) = token.call(abi.encodeWithSelector(IERC20.approve.selector, to, value));
1352
+ require(success && (data.length == 0 || abi.decode(data, (bool))), 'SA');
1353
+ }
1354
+
1355
+ /// @notice Transfers ETH to the recipient address
1356
+ /// @dev Fails with `STE`
1357
+ /// @param to The destination of the transfer
1358
+ /// @param value The value to be transferred
1359
+ function safeTransferETH(address to, uint256 value) internal {
1360
+ (bool success, ) = to.call{value: value}(new bytes(0));
1361
+ require(success, 'STE');
1362
+ }
1363
+ }
1364
+
1365
+ // lib/v3-periphery-main/contracts/base/SelfPermit.sol
1366
+
1367
+ /// @title Self Permit
1368
+ /// @notice Functionality to call permit on any EIP-2612-compliant token for use in the route
1369
+ /// @dev These functions are expected to be embedded in multicalls to allow EOAs to approve a contract and call a function
1370
+ /// that requires an approval in a single transaction.
1371
+ abstract contract SelfPermit is ISelfPermit {
1372
+ /// @inheritdoc ISelfPermit
1373
+ function selfPermit(
1374
+ address token,
1375
+ uint256 value,
1376
+ uint256 deadline,
1377
+ uint8 v,
1378
+ bytes32 r,
1379
+ bytes32 s
1380
+ ) public payable override {
1381
+ IERC20Permit(token).permit(msg.sender, address(this), value, deadline, v, r, s);
1382
+ }
1383
+
1384
+ /// @inheritdoc ISelfPermit
1385
+ function selfPermitIfNecessary(
1386
+ address token,
1387
+ uint256 value,
1388
+ uint256 deadline,
1389
+ uint8 v,
1390
+ bytes32 r,
1391
+ bytes32 s
1392
+ ) external payable override {
1393
+ if (IERC20(token).allowance(msg.sender, address(this)) < value) selfPermit(token, value, deadline, v, r, s);
1394
+ }
1395
+
1396
+ /// @inheritdoc ISelfPermit
1397
+ function selfPermitAllowed(
1398
+ address token,
1399
+ uint256 nonce,
1400
+ uint256 expiry,
1401
+ uint8 v,
1402
+ bytes32 r,
1403
+ bytes32 s
1404
+ ) public payable override {
1405
+ IERC20PermitAllowed(token).permit(msg.sender, address(this), nonce, expiry, true, v, r, s);
1406
+ }
1407
+
1408
+ /// @inheritdoc ISelfPermit
1409
+ function selfPermitAllowedIfNecessary(
1410
+ address token,
1411
+ uint256 nonce,
1412
+ uint256 expiry,
1413
+ uint8 v,
1414
+ bytes32 r,
1415
+ bytes32 s
1416
+ ) external payable override {
1417
+ if (IERC20(token).allowance(msg.sender, address(this)) < type(uint256).max)
1418
+ selfPermitAllowed(token, nonce, expiry, v, r, s);
1419
+ }
1420
+ }
1421
+
1422
+ // lib/v3-core-main/contracts/interfaces/IUniswapV3Pool.sol
1423
+
1424
+ /// @title The interface for a Uniswap V3 Pool
1425
+ /// @notice A Uniswap pool facilitates swapping and automated market making between any two assets that strictly conform
1426
+ /// to the ERC20 specification
1427
+ /// @dev The pool interface is broken up into many smaller pieces
1428
+ interface IUniswapV3Pool is
1429
+ IUniswapV3PoolImmutables,
1430
+ IUniswapV3PoolState,
1431
+ IUniswapV3PoolDerivedState,
1432
+ IUniswapV3PoolActions,
1433
+ IUniswapV3PoolOwnerActions,
1434
+ IUniswapV3PoolEvents
1435
+ {
1436
+
1437
+ }
1438
+
1439
+ // lib/v3-periphery-main/contracts/base/PeripheryPayments.sol
1440
+
1441
+ abstract contract PeripheryPayments is IPeripheryPayments, PeripheryImmutableState {
1442
+ receive() external payable {
1443
+ require(msg.sender == WETH9, 'Not WETH9');
1444
+ }
1445
+
1446
+ /// @inheritdoc IPeripheryPayments
1447
+ function unwrapWETH9(uint256 amountMinimum, address recipient) public payable override {
1448
+ uint256 balanceWETH9 = IWETH9(WETH9).balanceOf(address(this));
1449
+ require(balanceWETH9 >= amountMinimum, 'Insufficient WETH9');
1450
+
1451
+ if (balanceWETH9 > 0) {
1452
+ IWETH9(WETH9).withdraw(balanceWETH9);
1453
+ TransferHelper.safeTransferETH(recipient, balanceWETH9);
1454
+ }
1455
+ }
1456
+
1457
+ /// @inheritdoc IPeripheryPayments
1458
+ function sweepToken(
1459
+ address token,
1460
+ uint256 amountMinimum,
1461
+ address recipient
1462
+ ) public payable override {
1463
+ uint256 balanceToken = IERC20(token).balanceOf(address(this));
1464
+ require(balanceToken >= amountMinimum, 'Insufficient token');
1465
+
1466
+ if (balanceToken > 0) {
1467
+ TransferHelper.safeTransfer(token, recipient, balanceToken);
1468
+ }
1469
+ }
1470
+
1471
+ /// @inheritdoc IPeripheryPayments
1472
+ function refundETH() external payable override {
1473
+ if (address(this).balance > 0) TransferHelper.safeTransferETH(msg.sender, address(this).balance);
1474
+ }
1475
+
1476
+ /// @param token The token to pay
1477
+ /// @param payer The entity that must pay
1478
+ /// @param recipient The entity that will receive payment
1479
+ /// @param value The amount to pay
1480
+ function pay(
1481
+ address token,
1482
+ address payer,
1483
+ address recipient,
1484
+ uint256 value
1485
+ ) internal {
1486
+ if (token == WETH9 && address(this).balance >= value) {
1487
+ // pay with WETH9
1488
+ IWETH9(WETH9).deposit{value: value}(); // wrap only what is needed to pay
1489
+ IWETH9(WETH9).transfer(recipient, value);
1490
+ } else if (payer == address(this)) {
1491
+ // pay with tokens already in the contract (for the exact input multihop case)
1492
+ TransferHelper.safeTransfer(token, recipient, value);
1493
+ } else {
1494
+ // pull payment
1495
+ TransferHelper.safeTransferFrom(token, payer, recipient, value);
1496
+ }
1497
+ }
1498
+ }
1499
+
1500
+ // lib/v3-periphery-main/contracts/libraries/CallbackValidation.sol
1501
+
1502
+ /// @notice Provides validation for callbacks from Uniswap V3 Pools
1503
+ library CallbackValidation {
1504
+ /// @notice Returns the address of a valid Uniswap V3 Pool
1505
+ /// @param factory The contract address of the Uniswap V3 factory
1506
+ /// @param tokenA The contract address of either token0 or token1
1507
+ /// @param tokenB The contract address of the other token
1508
+ /// @param fee The fee collected upon every swap in the pool, denominated in hundredths of a bip
1509
+ /// @return pool The V3 pool contract address
1510
+ function verifyCallback(
1511
+ address factory,
1512
+ address tokenA,
1513
+ address tokenB,
1514
+ uint24 fee
1515
+ ) internal view returns (IUniswapV3Pool pool) {
1516
+ return verifyCallback(factory, PoolAddress.getPoolKey(tokenA, tokenB, fee));
1517
+ }
1518
+
1519
+ /// @notice Returns the address of a valid Uniswap V3 Pool
1520
+ /// @param factory The contract address of the Uniswap V3 factory
1521
+ /// @param poolKey The identifying key of the V3 pool
1522
+ /// @return pool The V3 pool contract address
1523
+ function verifyCallback(address factory, PoolAddress.PoolKey memory poolKey)
1524
+ internal
1525
+ view
1526
+ returns (IUniswapV3Pool pool)
1527
+ {
1528
+ pool = IUniswapV3Pool(PoolAddress.computeAddress(factory, poolKey));
1529
+ require(msg.sender == address(pool));
1530
+ }
1531
+ }
1532
+
1533
+ // lib/v3-periphery-main/contracts/base/PeripheryPaymentsWithFee.sol
1534
+
1535
+ abstract contract PeripheryPaymentsWithFee is PeripheryPayments, IPeripheryPaymentsWithFee {
1536
+ using LowGasSafeMath for uint256;
1537
+
1538
+ /// @inheritdoc IPeripheryPaymentsWithFee
1539
+ function unwrapWETH9WithFee(
1540
+ uint256 amountMinimum,
1541
+ address recipient,
1542
+ uint256 feeBips,
1543
+ address feeRecipient
1544
+ ) public payable override {
1545
+ require(feeBips > 0 && feeBips <= 100);
1546
+
1547
+ uint256 balanceWETH9 = IWETH9(WETH9).balanceOf(address(this));
1548
+ require(balanceWETH9 >= amountMinimum, 'Insufficient WETH9');
1549
+
1550
+ if (balanceWETH9 > 0) {
1551
+ IWETH9(WETH9).withdraw(balanceWETH9);
1552
+ uint256 feeAmount = balanceWETH9.mul(feeBips) / 10_000;
1553
+ if (feeAmount > 0) TransferHelper.safeTransferETH(feeRecipient, feeAmount);
1554
+ TransferHelper.safeTransferETH(recipient, balanceWETH9 - feeAmount);
1555
+ }
1556
+ }
1557
+
1558
+ /// @inheritdoc IPeripheryPaymentsWithFee
1559
+ function sweepTokenWithFee(
1560
+ address token,
1561
+ uint256 amountMinimum,
1562
+ address recipient,
1563
+ uint256 feeBips,
1564
+ address feeRecipient
1565
+ ) public payable override {
1566
+ require(feeBips > 0 && feeBips <= 100);
1567
+
1568
+ uint256 balanceToken = IERC20(token).balanceOf(address(this));
1569
+ require(balanceToken >= amountMinimum, 'Insufficient token');
1570
+
1571
+ if (balanceToken > 0) {
1572
+ uint256 feeAmount = balanceToken.mul(feeBips) / 10_000;
1573
+ if (feeAmount > 0) TransferHelper.safeTransfer(token, feeRecipient, feeAmount);
1574
+ TransferHelper.safeTransfer(token, recipient, balanceToken - feeAmount);
1575
+ }
1576
+ }
1577
+ }
1578
+
1579
+ // lib/v3-periphery-main/contracts/SwapRouter.sol
1580
+
1581
+ /// @title Uniswap V3 Swap Router
1582
+ /// @notice Router for stateless execution of swaps against Uniswap V3
1583
+ contract SwapRouter is
1584
+ ISwapRouter,
1585
+ PeripheryImmutableState,
1586
+ PeripheryValidation,
1587
+ PeripheryPaymentsWithFee,
1588
+ Multicall,
1589
+ SelfPermit
1590
+ {
1591
+ using Path for bytes;
1592
+ using SafeCast for uint256;
1593
+
1594
+ /// @dev Used as the placeholder value for amountInCached, because the computed amount in for an exact output swap
1595
+ /// can never actually be this value
1596
+ uint256 private constant DEFAULT_AMOUNT_IN_CACHED = type(uint256).max;
1597
+
1598
+ /// @dev Transient storage variable used for returning the computed amount in for an exact output swap.
1599
+ uint256 private amountInCached = DEFAULT_AMOUNT_IN_CACHED;
1600
+
1601
+ constructor(address _factory, address _WETH9) PeripheryImmutableState(_factory, _WETH9) {}
1602
+
1603
+ /// @dev Returns the pool for the given token pair and fee. The pool contract may or may not exist.
1604
+ function getPool(
1605
+ address tokenA,
1606
+ address tokenB,
1607
+ uint24 fee
1608
+ ) private view returns (IUniswapV3Pool) {
1609
+ return IUniswapV3Pool(PoolAddress.computeAddress(factory, PoolAddress.getPoolKey(tokenA, tokenB, fee)));
1610
+ }
1611
+
1612
+ struct SwapCallbackData {
1613
+ bytes path;
1614
+ address payer;
1615
+ }
1616
+
1617
+ /// @inheritdoc IUniswapV3SwapCallback
1618
+ function uniswapV3SwapCallback(
1619
+ int256 amount0Delta,
1620
+ int256 amount1Delta,
1621
+ bytes calldata _data
1622
+ ) external override {
1623
+ require(amount0Delta > 0 || amount1Delta > 0); // swaps entirely within 0-liquidity regions are not supported
1624
+ SwapCallbackData memory data = abi.decode(_data, (SwapCallbackData));
1625
+ (address tokenIn, address tokenOut, uint24 fee) = data.path.decodeFirstPool();
1626
+ CallbackValidation.verifyCallback(factory, tokenIn, tokenOut, fee);
1627
+
1628
+ (bool isExactInput, uint256 amountToPay) =
1629
+ amount0Delta > 0
1630
+ ? (tokenIn < tokenOut, uint256(amount0Delta))
1631
+ : (tokenOut < tokenIn, uint256(amount1Delta));
1632
+ if (isExactInput) {
1633
+ pay(tokenIn, data.payer, msg.sender, amountToPay);
1634
+ } else {
1635
+ // either initiate the next swap or pay
1636
+ if (data.path.hasMultiplePools()) {
1637
+ data.path = data.path.skipToken();
1638
+ exactOutputInternal(amountToPay, msg.sender, 0, data);
1639
+ } else {
1640
+ amountInCached = amountToPay;
1641
+ tokenIn = tokenOut; // swap in/out because exact output swaps are reversed
1642
+ pay(tokenIn, data.payer, msg.sender, amountToPay);
1643
+ }
1644
+ }
1645
+ }
1646
+
1647
+ /// @dev Performs a single exact input swap
1648
+ function exactInputInternal(
1649
+ uint256 amountIn,
1650
+ address recipient,
1651
+ uint160 sqrtPriceLimitX96,
1652
+ SwapCallbackData memory data
1653
+ ) private returns (uint256 amountOut) {
1654
+ // allow swapping to the router address with address 0
1655
+ if (recipient == address(0)) recipient = address(this);
1656
+
1657
+ (address tokenIn, address tokenOut, uint24 fee) = data.path.decodeFirstPool();
1658
+
1659
+ bool zeroForOne = tokenIn < tokenOut;
1660
+
1661
+ (int256 amount0, int256 amount1) =
1662
+ getPool(tokenIn, tokenOut, fee).swap(
1663
+ recipient,
1664
+ zeroForOne,
1665
+ amountIn.toInt256(),
1666
+ sqrtPriceLimitX96 == 0
1667
+ ? (zeroForOne ? TickMath.MIN_SQRT_RATIO + 1 : TickMath.MAX_SQRT_RATIO - 1)
1668
+ : sqrtPriceLimitX96,
1669
+ abi.encode(data)
1670
+ );
1671
+
1672
+ return uint256(-(zeroForOne ? amount1 : amount0));
1673
+ }
1674
+
1675
+ /// @inheritdoc ISwapRouter
1676
+ function exactInputSingle(ExactInputSingleParams calldata params)
1677
+ external
1678
+ payable
1679
+ override
1680
+ checkDeadline(params.deadline)
1681
+ returns (uint256 amountOut)
1682
+ {
1683
+ amountOut = exactInputInternal(
1684
+ params.amountIn,
1685
+ params.recipient,
1686
+ params.sqrtPriceLimitX96,
1687
+ SwapCallbackData({path: abi.encodePacked(params.tokenIn, params.fee, params.tokenOut), payer: msg.sender})
1688
+ );
1689
+ require(amountOut >= params.amountOutMinimum, 'Too little received');
1690
+ }
1691
+
1692
+ /// @inheritdoc ISwapRouter
1693
+ function exactInput(ExactInputParams memory params)
1694
+ external
1695
+ payable
1696
+ override
1697
+ checkDeadline(params.deadline)
1698
+ returns (uint256 amountOut)
1699
+ {
1700
+ address payer = msg.sender; // msg.sender pays for the first hop
1701
+
1702
+ while (true) {
1703
+ bool hasMultiplePools = params.path.hasMultiplePools();
1704
+
1705
+ // the outputs of prior swaps become the inputs to subsequent ones
1706
+ params.amountIn = exactInputInternal(
1707
+ params.amountIn,
1708
+ hasMultiplePools ? address(this) : params.recipient, // for intermediate swaps, this contract custodies
1709
+ 0,
1710
+ SwapCallbackData({
1711
+ path: params.path.getFirstPool(), // only the first pool in the path is necessary
1712
+ payer: payer
1713
+ })
1714
+ );
1715
+
1716
+ // decide whether to continue or terminate
1717
+ if (hasMultiplePools) {
1718
+ payer = address(this); // at this point, the caller has paid
1719
+ params.path = params.path.skipToken();
1720
+ } else {
1721
+ amountOut = params.amountIn;
1722
+ break;
1723
+ }
1724
+ }
1725
+
1726
+ require(amountOut >= params.amountOutMinimum, 'Too little received');
1727
+ }
1728
+
1729
+ /// @dev Performs a single exact output swap
1730
+ function exactOutputInternal(
1731
+ uint256 amountOut,
1732
+ address recipient,
1733
+ uint160 sqrtPriceLimitX96,
1734
+ SwapCallbackData memory data
1735
+ ) private returns (uint256 amountIn) {
1736
+ // allow swapping to the router address with address 0
1737
+ if (recipient == address(0)) recipient = address(this);
1738
+
1739
+ (address tokenOut, address tokenIn, uint24 fee) = data.path.decodeFirstPool();
1740
+
1741
+ bool zeroForOne = tokenIn < tokenOut;
1742
+
1743
+ (int256 amount0Delta, int256 amount1Delta) =
1744
+ getPool(tokenIn, tokenOut, fee).swap(
1745
+ recipient,
1746
+ zeroForOne,
1747
+ -amountOut.toInt256(),
1748
+ sqrtPriceLimitX96 == 0
1749
+ ? (zeroForOne ? TickMath.MIN_SQRT_RATIO + 1 : TickMath.MAX_SQRT_RATIO - 1)
1750
+ : sqrtPriceLimitX96,
1751
+ abi.encode(data)
1752
+ );
1753
+
1754
+ uint256 amountOutReceived;
1755
+ (amountIn, amountOutReceived) = zeroForOne
1756
+ ? (uint256(amount0Delta), uint256(-amount1Delta))
1757
+ : (uint256(amount1Delta), uint256(-amount0Delta));
1758
+ // it's technically possible to not receive the full output amount,
1759
+ // so if no price limit has been specified, require this possibility away
1760
+ if (sqrtPriceLimitX96 == 0) require(amountOutReceived == amountOut);
1761
+ }
1762
+
1763
+ /// @inheritdoc ISwapRouter
1764
+ function exactOutputSingle(ExactOutputSingleParams calldata params)
1765
+ external
1766
+ payable
1767
+ override
1768
+ checkDeadline(params.deadline)
1769
+ returns (uint256 amountIn)
1770
+ {
1771
+ // avoid an SLOAD by using the swap return data
1772
+ amountIn = exactOutputInternal(
1773
+ params.amountOut,
1774
+ params.recipient,
1775
+ params.sqrtPriceLimitX96,
1776
+ SwapCallbackData({path: abi.encodePacked(params.tokenOut, params.fee, params.tokenIn), payer: msg.sender})
1777
+ );
1778
+
1779
+ require(amountIn <= params.amountInMaximum, 'Too much requested');
1780
+ // has to be reset even though we don't use it in the single hop case
1781
+ amountInCached = DEFAULT_AMOUNT_IN_CACHED;
1782
+ }
1783
+
1784
+ /// @inheritdoc ISwapRouter
1785
+ function exactOutput(ExactOutputParams calldata params)
1786
+ external
1787
+ payable
1788
+ override
1789
+ checkDeadline(params.deadline)
1790
+ returns (uint256 amountIn)
1791
+ {
1792
+ // it's okay that the payer is fixed to msg.sender here, as they're only paying for the "final" exact output
1793
+ // swap, which happens first, and subsequent swaps are paid for within nested callback frames
1794
+ exactOutputInternal(
1795
+ params.amountOut,
1796
+ params.recipient,
1797
+ 0,
1798
+ SwapCallbackData({path: params.path, payer: msg.sender})
1799
+ );
1800
+
1801
+ amountIn = amountInCached;
1802
+ require(amountIn <= params.amountInMaximum, 'Too much requested');
1803
+ amountInCached = DEFAULT_AMOUNT_IN_CACHED;
1804
+ }
1805
+ }
1806
+
1807
+ // src/SwapRouterImporter.sol
1808
+
1809
+ contract SwapRouterImporter is SwapRouter {
1810
+ constructor(address factory, address wmst) SwapRouter(factory, wmst) {}
1811
+ }