@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,325 @@
1
+ // SPDX-License-Identifier: BUSL-1.1
2
+ pragma solidity >=0.5.0 <0.8.0;
3
+
4
+ /// @title Oracle
5
+ /// @notice Provides price and liquidity data useful for a wide variety of system designs
6
+ /// @dev Instances of stored oracle data, "observations", are collected in the oracle array
7
+ /// Every pool is initialized with an oracle array length of 1. Anyone can pay the SSTOREs to increase the
8
+ /// maximum length of the oracle array. New slots will be added when the array is fully populated.
9
+ /// Observations are overwritten when the full length of the oracle array is populated.
10
+ /// The most recent observation is available, independent of the length of the oracle array, by passing 0 to observe()
11
+ library Oracle {
12
+ struct Observation {
13
+ // the block timestamp of the observation
14
+ uint32 blockTimestamp;
15
+ // the tick accumulator, i.e. tick * time elapsed since the pool was first initialized
16
+ int56 tickCumulative;
17
+ // the seconds per liquidity, i.e. seconds elapsed / max(1, liquidity) since the pool was first initialized
18
+ uint160 secondsPerLiquidityCumulativeX128;
19
+ // whether or not the observation is initialized
20
+ bool initialized;
21
+ }
22
+
23
+ /// @notice Transforms a previous observation into a new observation, given the passage of time and the current tick and liquidity values
24
+ /// @dev blockTimestamp _must_ be chronologically equal to or greater than last.blockTimestamp, safe for 0 or 1 overflows
25
+ /// @param last The specified observation to be transformed
26
+ /// @param blockTimestamp The timestamp of the new observation
27
+ /// @param tick The active tick at the time of the new observation
28
+ /// @param liquidity The total in-range liquidity at the time of the new observation
29
+ /// @return Observation The newly populated observation
30
+ function transform(
31
+ Observation memory last,
32
+ uint32 blockTimestamp,
33
+ int24 tick,
34
+ uint128 liquidity
35
+ ) private pure returns (Observation memory) {
36
+ uint32 delta = blockTimestamp - last.blockTimestamp;
37
+ return
38
+ Observation({
39
+ blockTimestamp: blockTimestamp,
40
+ tickCumulative: last.tickCumulative + int56(tick) * delta,
41
+ secondsPerLiquidityCumulativeX128: last.secondsPerLiquidityCumulativeX128 +
42
+ ((uint160(delta) << 128) / (liquidity > 0 ? liquidity : 1)),
43
+ initialized: true
44
+ });
45
+ }
46
+
47
+ /// @notice Initialize the oracle array by writing the first slot. Called once for the lifecycle of the observations array
48
+ /// @param self The stored oracle array
49
+ /// @param time The time of the oracle initialization, via block.timestamp truncated to uint32
50
+ /// @return cardinality The number of populated elements in the oracle array
51
+ /// @return cardinalityNext The new length of the oracle array, independent of population
52
+ function initialize(Observation[65535] storage self, uint32 time)
53
+ internal
54
+ returns (uint16 cardinality, uint16 cardinalityNext)
55
+ {
56
+ self[0] = Observation({
57
+ blockTimestamp: time,
58
+ tickCumulative: 0,
59
+ secondsPerLiquidityCumulativeX128: 0,
60
+ initialized: true
61
+ });
62
+ return (1, 1);
63
+ }
64
+
65
+ /// @notice Writes an oracle observation to the array
66
+ /// @dev Writable at most once per block. Index represents the most recently written element. cardinality and index must be tracked externally.
67
+ /// If the index is at the end of the allowable array length (according to cardinality), and the next cardinality
68
+ /// is greater than the current one, cardinality may be increased. This restriction is created to preserve ordering.
69
+ /// @param self The stored oracle array
70
+ /// @param index The index of the observation that was most recently written to the observations array
71
+ /// @param blockTimestamp The timestamp of the new observation
72
+ /// @param tick The active tick at the time of the new observation
73
+ /// @param liquidity The total in-range liquidity at the time of the new observation
74
+ /// @param cardinality The number of populated elements in the oracle array
75
+ /// @param cardinalityNext The new length of the oracle array, independent of population
76
+ /// @return indexUpdated The new index of the most recently written element in the oracle array
77
+ /// @return cardinalityUpdated The new cardinality of the oracle array
78
+ function write(
79
+ Observation[65535] storage self,
80
+ uint16 index,
81
+ uint32 blockTimestamp,
82
+ int24 tick,
83
+ uint128 liquidity,
84
+ uint16 cardinality,
85
+ uint16 cardinalityNext
86
+ ) internal returns (uint16 indexUpdated, uint16 cardinalityUpdated) {
87
+ Observation memory last = self[index];
88
+
89
+ // early return if we've already written an observation this block
90
+ if (last.blockTimestamp == blockTimestamp) return (index, cardinality);
91
+
92
+ // if the conditions are right, we can bump the cardinality
93
+ if (cardinalityNext > cardinality && index == (cardinality - 1)) {
94
+ cardinalityUpdated = cardinalityNext;
95
+ } else {
96
+ cardinalityUpdated = cardinality;
97
+ }
98
+
99
+ indexUpdated = (index + 1) % cardinalityUpdated;
100
+ self[indexUpdated] = transform(last, blockTimestamp, tick, liquidity);
101
+ }
102
+
103
+ /// @notice Prepares the oracle array to store up to `next` observations
104
+ /// @param self The stored oracle array
105
+ /// @param current The current next cardinality of the oracle array
106
+ /// @param next The proposed next cardinality which will be populated in the oracle array
107
+ /// @return next The next cardinality which will be populated in the oracle array
108
+ function grow(
109
+ Observation[65535] storage self,
110
+ uint16 current,
111
+ uint16 next
112
+ ) internal returns (uint16) {
113
+ require(current > 0, 'I');
114
+ // no-op if the passed next value isn't greater than the current next value
115
+ if (next <= current) return current;
116
+ // store in each slot to prevent fresh SSTOREs in swaps
117
+ // this data will not be used because the initialized boolean is still false
118
+ for (uint16 i = current; i < next; i++) self[i].blockTimestamp = 1;
119
+ return next;
120
+ }
121
+
122
+ /// @notice comparator for 32-bit timestamps
123
+ /// @dev safe for 0 or 1 overflows, a and b _must_ be chronologically before or equal to time
124
+ /// @param time A timestamp truncated to 32 bits
125
+ /// @param a A comparison timestamp from which to determine the relative position of `time`
126
+ /// @param b From which to determine the relative position of `time`
127
+ /// @return bool Whether `a` is chronologically <= `b`
128
+ function lte(
129
+ uint32 time,
130
+ uint32 a,
131
+ uint32 b
132
+ ) private pure returns (bool) {
133
+ // if there hasn't been overflow, no need to adjust
134
+ if (a <= time && b <= time) return a <= b;
135
+
136
+ uint256 aAdjusted = a > time ? a : a + 2**32;
137
+ uint256 bAdjusted = b > time ? b : b + 2**32;
138
+
139
+ return aAdjusted <= bAdjusted;
140
+ }
141
+
142
+ /// @notice Fetches the observations beforeOrAt and atOrAfter a target, i.e. where [beforeOrAt, atOrAfter] is satisfied.
143
+ /// The result may be the same observation, or adjacent observations.
144
+ /// @dev The answer must be contained in the array, used when the target is located within the stored observation
145
+ /// boundaries: older than the most recent observation and younger, or the same age as, the oldest observation
146
+ /// @param self The stored oracle array
147
+ /// @param time The current block.timestamp
148
+ /// @param target The timestamp at which the reserved observation should be for
149
+ /// @param index The index of the observation that was most recently written to the observations array
150
+ /// @param cardinality The number of populated elements in the oracle array
151
+ /// @return beforeOrAt The observation recorded before, or at, the target
152
+ /// @return atOrAfter The observation recorded at, or after, the target
153
+ function binarySearch(
154
+ Observation[65535] storage self,
155
+ uint32 time,
156
+ uint32 target,
157
+ uint16 index,
158
+ uint16 cardinality
159
+ ) private view returns (Observation memory beforeOrAt, Observation memory atOrAfter) {
160
+ uint256 l = (index + 1) % cardinality; // oldest observation
161
+ uint256 r = l + cardinality - 1; // newest observation
162
+ uint256 i;
163
+ while (true) {
164
+ i = (l + r) / 2;
165
+
166
+ beforeOrAt = self[i % cardinality];
167
+
168
+ // we've landed on an uninitialized tick, keep searching higher (more recently)
169
+ if (!beforeOrAt.initialized) {
170
+ l = i + 1;
171
+ continue;
172
+ }
173
+
174
+ atOrAfter = self[(i + 1) % cardinality];
175
+
176
+ bool targetAtOrAfter = lte(time, beforeOrAt.blockTimestamp, target);
177
+
178
+ // check if we've found the answer!
179
+ if (targetAtOrAfter && lte(time, target, atOrAfter.blockTimestamp)) break;
180
+
181
+ if (!targetAtOrAfter) r = i - 1;
182
+ else l = i + 1;
183
+ }
184
+ }
185
+
186
+ /// @notice Fetches the observations beforeOrAt and atOrAfter a given target, i.e. where [beforeOrAt, atOrAfter] is satisfied
187
+ /// @dev Assumes there is at least 1 initialized observation.
188
+ /// Used by observeSingle() to compute the counterfactual accumulator values as of a given block timestamp.
189
+ /// @param self The stored oracle array
190
+ /// @param time The current block.timestamp
191
+ /// @param target The timestamp at which the reserved observation should be for
192
+ /// @param tick The active tick at the time of the returned or simulated observation
193
+ /// @param index The index of the observation that was most recently written to the observations array
194
+ /// @param liquidity The total pool liquidity at the time of the call
195
+ /// @param cardinality The number of populated elements in the oracle array
196
+ /// @return beforeOrAt The observation which occurred at, or before, the given timestamp
197
+ /// @return atOrAfter The observation which occurred at, or after, the given timestamp
198
+ function getSurroundingObservations(
199
+ Observation[65535] storage self,
200
+ uint32 time,
201
+ uint32 target,
202
+ int24 tick,
203
+ uint16 index,
204
+ uint128 liquidity,
205
+ uint16 cardinality
206
+ ) private view returns (Observation memory beforeOrAt, Observation memory atOrAfter) {
207
+ // optimistically set before to the newest observation
208
+ beforeOrAt = self[index];
209
+
210
+ // if the target is chronologically at or after the newest observation, we can early return
211
+ if (lte(time, beforeOrAt.blockTimestamp, target)) {
212
+ if (beforeOrAt.blockTimestamp == target) {
213
+ // if newest observation equals target, we're in the same block, so we can ignore atOrAfter
214
+ return (beforeOrAt, atOrAfter);
215
+ } else {
216
+ // otherwise, we need to transform
217
+ return (beforeOrAt, transform(beforeOrAt, target, tick, liquidity));
218
+ }
219
+ }
220
+
221
+ // now, set before to the oldest observation
222
+ beforeOrAt = self[(index + 1) % cardinality];
223
+ if (!beforeOrAt.initialized) beforeOrAt = self[0];
224
+
225
+ // ensure that the target is chronologically at or after the oldest observation
226
+ require(lte(time, beforeOrAt.blockTimestamp, target), 'OLD');
227
+
228
+ // if we've reached this point, we have to binary search
229
+ return binarySearch(self, time, target, index, cardinality);
230
+ }
231
+
232
+ /// @dev Reverts if an observation at or before the desired observation timestamp does not exist.
233
+ /// 0 may be passed as `secondsAgo' to return the current cumulative values.
234
+ /// If called with a timestamp falling between two observations, returns the counterfactual accumulator values
235
+ /// at exactly the timestamp between the two observations.
236
+ /// @param self The stored oracle array
237
+ /// @param time The current block timestamp
238
+ /// @param secondsAgo The amount of time to look back, in seconds, at which point to return an observation
239
+ /// @param tick The current tick
240
+ /// @param index The index of the observation that was most recently written to the observations array
241
+ /// @param liquidity The current in-range pool liquidity
242
+ /// @param cardinality The number of populated elements in the oracle array
243
+ /// @return tickCumulative The tick * time elapsed since the pool was first initialized, as of `secondsAgo`
244
+ /// @return secondsPerLiquidityCumulativeX128 The time elapsed / max(1, liquidity) since the pool was first initialized, as of `secondsAgo`
245
+ function observeSingle(
246
+ Observation[65535] storage self,
247
+ uint32 time,
248
+ uint32 secondsAgo,
249
+ int24 tick,
250
+ uint16 index,
251
+ uint128 liquidity,
252
+ uint16 cardinality
253
+ ) internal view returns (int56 tickCumulative, uint160 secondsPerLiquidityCumulativeX128) {
254
+ if (secondsAgo == 0) {
255
+ Observation memory last = self[index];
256
+ if (last.blockTimestamp != time) last = transform(last, time, tick, liquidity);
257
+ return (last.tickCumulative, last.secondsPerLiquidityCumulativeX128);
258
+ }
259
+
260
+ uint32 target = time - secondsAgo;
261
+
262
+ (Observation memory beforeOrAt, Observation memory atOrAfter) =
263
+ getSurroundingObservations(self, time, target, tick, index, liquidity, cardinality);
264
+
265
+ if (target == beforeOrAt.blockTimestamp) {
266
+ // we're at the left boundary
267
+ return (beforeOrAt.tickCumulative, beforeOrAt.secondsPerLiquidityCumulativeX128);
268
+ } else if (target == atOrAfter.blockTimestamp) {
269
+ // we're at the right boundary
270
+ return (atOrAfter.tickCumulative, atOrAfter.secondsPerLiquidityCumulativeX128);
271
+ } else {
272
+ // we're in the middle
273
+ uint32 observationTimeDelta = atOrAfter.blockTimestamp - beforeOrAt.blockTimestamp;
274
+ uint32 targetDelta = target - beforeOrAt.blockTimestamp;
275
+ return (
276
+ beforeOrAt.tickCumulative +
277
+ ((atOrAfter.tickCumulative - beforeOrAt.tickCumulative) / observationTimeDelta) *
278
+ targetDelta,
279
+ beforeOrAt.secondsPerLiquidityCumulativeX128 +
280
+ uint160(
281
+ (uint256(
282
+ atOrAfter.secondsPerLiquidityCumulativeX128 - beforeOrAt.secondsPerLiquidityCumulativeX128
283
+ ) * targetDelta) / observationTimeDelta
284
+ )
285
+ );
286
+ }
287
+ }
288
+
289
+ /// @notice Returns the accumulator values as of each time seconds ago from the given time in the array of `secondsAgos`
290
+ /// @dev Reverts if `secondsAgos` > oldest observation
291
+ /// @param self The stored oracle array
292
+ /// @param time The current block.timestamp
293
+ /// @param secondsAgos Each amount of time to look back, in seconds, at which point to return an observation
294
+ /// @param tick The current tick
295
+ /// @param index The index of the observation that was most recently written to the observations array
296
+ /// @param liquidity The current in-range pool liquidity
297
+ /// @param cardinality The number of populated elements in the oracle array
298
+ /// @return tickCumulatives The tick * time elapsed since the pool was first initialized, as of each `secondsAgo`
299
+ /// @return secondsPerLiquidityCumulativeX128s The cumulative seconds / max(1, liquidity) since the pool was first initialized, as of each `secondsAgo`
300
+ function observe(
301
+ Observation[65535] storage self,
302
+ uint32 time,
303
+ uint32[] memory secondsAgos,
304
+ int24 tick,
305
+ uint16 index,
306
+ uint128 liquidity,
307
+ uint16 cardinality
308
+ ) internal view returns (int56[] memory tickCumulatives, uint160[] memory secondsPerLiquidityCumulativeX128s) {
309
+ require(cardinality > 0, 'I');
310
+
311
+ tickCumulatives = new int56[](secondsAgos.length);
312
+ secondsPerLiquidityCumulativeX128s = new uint160[](secondsAgos.length);
313
+ for (uint256 i = 0; i < secondsAgos.length; i++) {
314
+ (tickCumulatives[i], secondsPerLiquidityCumulativeX128s[i]) = observeSingle(
315
+ self,
316
+ time,
317
+ secondsAgos[i],
318
+ tick,
319
+ index,
320
+ liquidity,
321
+ cardinality
322
+ );
323
+ }
324
+ }
325
+ }
@@ -0,0 +1,88 @@
1
+ // SPDX-License-Identifier: BUSL-1.1
2
+ pragma solidity >=0.5.0 <0.8.0;
3
+
4
+ import './FullMath.sol';
5
+ import './FixedPoint128.sol';
6
+ import './LiquidityMath.sol';
7
+
8
+ /// @title Position
9
+ /// @notice Positions represent an owner address' liquidity between a lower and upper tick boundary
10
+ /// @dev Positions store additional state for tracking fees owed to the position
11
+ library Position {
12
+ // info stored for each user's position
13
+ struct Info {
14
+ // the amount of liquidity owned by this position
15
+ uint128 liquidity;
16
+ // fee growth per unit of liquidity as of the last update to liquidity or fees owed
17
+ uint256 feeGrowthInside0LastX128;
18
+ uint256 feeGrowthInside1LastX128;
19
+ // the fees owed to the position owner in token0/token1
20
+ uint128 tokensOwed0;
21
+ uint128 tokensOwed1;
22
+ }
23
+
24
+ /// @notice Returns the Info struct of a position, given an owner and position boundaries
25
+ /// @param self The mapping containing all user positions
26
+ /// @param owner The address of the position owner
27
+ /// @param tickLower The lower tick boundary of the position
28
+ /// @param tickUpper The upper tick boundary of the position
29
+ /// @return position The position info struct of the given owners' position
30
+ function get(
31
+ mapping(bytes32 => Info) storage self,
32
+ address owner,
33
+ int24 tickLower,
34
+ int24 tickUpper
35
+ ) internal view returns (Position.Info storage position) {
36
+ position = self[keccak256(abi.encodePacked(owner, tickLower, tickUpper))];
37
+ }
38
+
39
+ /// @notice Credits accumulated fees to a user's position
40
+ /// @param self The individual position to update
41
+ /// @param liquidityDelta The change in pool liquidity as a result of the position update
42
+ /// @param feeGrowthInside0X128 The all-time fee growth in token0, per unit of liquidity, inside the position's tick boundaries
43
+ /// @param feeGrowthInside1X128 The all-time fee growth in token1, per unit of liquidity, inside the position's tick boundaries
44
+ function update(
45
+ Info storage self,
46
+ int128 liquidityDelta,
47
+ uint256 feeGrowthInside0X128,
48
+ uint256 feeGrowthInside1X128
49
+ ) internal {
50
+ Info memory _self = self;
51
+
52
+ uint128 liquidityNext;
53
+ if (liquidityDelta == 0) {
54
+ require(_self.liquidity > 0, 'NP'); // disallow pokes for 0 liquidity positions
55
+ liquidityNext = _self.liquidity;
56
+ } else {
57
+ liquidityNext = LiquidityMath.addDelta(_self.liquidity, liquidityDelta);
58
+ }
59
+
60
+ // calculate accumulated fees
61
+ uint128 tokensOwed0 =
62
+ uint128(
63
+ FullMath.mulDiv(
64
+ feeGrowthInside0X128 - _self.feeGrowthInside0LastX128,
65
+ _self.liquidity,
66
+ FixedPoint128.Q128
67
+ )
68
+ );
69
+ uint128 tokensOwed1 =
70
+ uint128(
71
+ FullMath.mulDiv(
72
+ feeGrowthInside1X128 - _self.feeGrowthInside1LastX128,
73
+ _self.liquidity,
74
+ FixedPoint128.Q128
75
+ )
76
+ );
77
+
78
+ // update the position
79
+ if (liquidityDelta != 0) self.liquidity = liquidityNext;
80
+ self.feeGrowthInside0LastX128 = feeGrowthInside0X128;
81
+ self.feeGrowthInside1LastX128 = feeGrowthInside1X128;
82
+ if (tokensOwed0 > 0 || tokensOwed1 > 0) {
83
+ // overflow is acceptable, have to withdraw before you hit type(uint128).max fees
84
+ self.tokensOwed0 += tokensOwed0;
85
+ self.tokensOwed1 += tokensOwed1;
86
+ }
87
+ }
88
+ }
@@ -0,0 +1,28 @@
1
+ // SPDX-License-Identifier: GPL-2.0-or-later
2
+ pragma solidity >=0.5.0;
3
+
4
+ /// @title Safe casting methods
5
+ /// @notice Contains methods for safely casting between types
6
+ library SafeCast {
7
+ /// @notice Cast a uint256 to a uint160, revert on overflow
8
+ /// @param y The uint256 to be downcasted
9
+ /// @return z The downcasted integer, now type uint160
10
+ function toUint160(uint256 y) internal pure returns (uint160 z) {
11
+ require((z = uint160(y)) == y);
12
+ }
13
+
14
+ /// @notice Cast a int256 to a int128, revert on overflow or underflow
15
+ /// @param y The int256 to be downcasted
16
+ /// @return z The downcasted integer, now type int128
17
+ function toInt128(int256 y) internal pure returns (int128 z) {
18
+ require((z = int128(y)) == y);
19
+ }
20
+
21
+ /// @notice Cast a uint256 to a int256, revert on overflow
22
+ /// @param y The uint256 to be casted
23
+ /// @return z The casted integer, now type int256
24
+ function toInt256(uint256 y) internal pure returns (int256 z) {
25
+ require(y < 2**255);
26
+ z = int256(y);
27
+ }
28
+ }
@@ -0,0 +1,227 @@
1
+ // SPDX-License-Identifier: BUSL-1.1
2
+ pragma solidity >=0.5.0;
3
+
4
+ import './LowGasSafeMath.sol';
5
+ import './SafeCast.sol';
6
+
7
+ import './FullMath.sol';
8
+ import './UnsafeMath.sol';
9
+ import './FixedPoint96.sol';
10
+
11
+ /// @title Functions based on Q64.96 sqrt price and liquidity
12
+ /// @notice Contains the math that uses square root of price as a Q64.96 and liquidity to compute deltas
13
+ library SqrtPriceMath {
14
+ using LowGasSafeMath for uint256;
15
+ using SafeCast for uint256;
16
+
17
+ /// @notice Gets the next sqrt price given a delta of token0
18
+ /// @dev Always rounds up, because in the exact output case (increasing price) we need to move the price at least
19
+ /// far enough to get the desired output amount, and in the exact input case (decreasing price) we need to move the
20
+ /// price less in order to not send too much output.
21
+ /// The most precise formula for this is liquidity * sqrtPX96 / (liquidity +- amount * sqrtPX96),
22
+ /// if this is impossible because of overflow, we calculate liquidity / (liquidity / sqrtPX96 +- amount).
23
+ /// @param sqrtPX96 The starting price, i.e. before accounting for the token0 delta
24
+ /// @param liquidity The amount of usable liquidity
25
+ /// @param amount How much of token0 to add or remove from virtual reserves
26
+ /// @param add Whether to add or remove the amount of token0
27
+ /// @return The price after adding or removing amount, depending on add
28
+ function getNextSqrtPriceFromAmount0RoundingUp(
29
+ uint160 sqrtPX96,
30
+ uint128 liquidity,
31
+ uint256 amount,
32
+ bool add
33
+ ) internal pure returns (uint160) {
34
+ // we short circuit amount == 0 because the result is otherwise not guaranteed to equal the input price
35
+ if (amount == 0) return sqrtPX96;
36
+ uint256 numerator1 = uint256(liquidity) << FixedPoint96.RESOLUTION;
37
+
38
+ if (add) {
39
+ uint256 product;
40
+ if ((product = amount * sqrtPX96) / amount == sqrtPX96) {
41
+ uint256 denominator = numerator1 + product;
42
+ if (denominator >= numerator1)
43
+ // always fits in 160 bits
44
+ return uint160(FullMath.mulDivRoundingUp(numerator1, sqrtPX96, denominator));
45
+ }
46
+
47
+ return uint160(UnsafeMath.divRoundingUp(numerator1, (numerator1 / sqrtPX96).add(amount)));
48
+ } else {
49
+ uint256 product;
50
+ // if the product overflows, we know the denominator underflows
51
+ // in addition, we must check that the denominator does not underflow
52
+ require((product = amount * sqrtPX96) / amount == sqrtPX96 && numerator1 > product);
53
+ uint256 denominator = numerator1 - product;
54
+ return FullMath.mulDivRoundingUp(numerator1, sqrtPX96, denominator).toUint160();
55
+ }
56
+ }
57
+
58
+ /// @notice Gets the next sqrt price given a delta of token1
59
+ /// @dev Always rounds down, because in the exact output case (decreasing price) we need to move the price at least
60
+ /// far enough to get the desired output amount, and in the exact input case (increasing price) we need to move the
61
+ /// price less in order to not send too much output.
62
+ /// The formula we compute is within <1 wei of the lossless version: sqrtPX96 +- amount / liquidity
63
+ /// @param sqrtPX96 The starting price, i.e., before accounting for the token1 delta
64
+ /// @param liquidity The amount of usable liquidity
65
+ /// @param amount How much of token1 to add, or remove, from virtual reserves
66
+ /// @param add Whether to add, or remove, the amount of token1
67
+ /// @return The price after adding or removing `amount`
68
+ function getNextSqrtPriceFromAmount1RoundingDown(
69
+ uint160 sqrtPX96,
70
+ uint128 liquidity,
71
+ uint256 amount,
72
+ bool add
73
+ ) internal pure returns (uint160) {
74
+ // if we're adding (subtracting), rounding down requires rounding the quotient down (up)
75
+ // in both cases, avoid a mulDiv for most inputs
76
+ if (add) {
77
+ uint256 quotient =
78
+ (
79
+ amount <= type(uint160).max
80
+ ? (amount << FixedPoint96.RESOLUTION) / liquidity
81
+ : FullMath.mulDiv(amount, FixedPoint96.Q96, liquidity)
82
+ );
83
+
84
+ return uint256(sqrtPX96).add(quotient).toUint160();
85
+ } else {
86
+ uint256 quotient =
87
+ (
88
+ amount <= type(uint160).max
89
+ ? UnsafeMath.divRoundingUp(amount << FixedPoint96.RESOLUTION, liquidity)
90
+ : FullMath.mulDivRoundingUp(amount, FixedPoint96.Q96, liquidity)
91
+ );
92
+
93
+ require(sqrtPX96 > quotient);
94
+ // always fits 160 bits
95
+ return uint160(sqrtPX96 - quotient);
96
+ }
97
+ }
98
+
99
+ /// @notice Gets the next sqrt price given an input amount of token0 or token1
100
+ /// @dev Throws if price or liquidity are 0, or if the next price is out of bounds
101
+ /// @param sqrtPX96 The starting price, i.e., before accounting for the input amount
102
+ /// @param liquidity The amount of usable liquidity
103
+ /// @param amountIn How much of token0, or token1, is being swapped in
104
+ /// @param zeroForOne Whether the amount in is token0 or token1
105
+ /// @return sqrtQX96 The price after adding the input amount to token0 or token1
106
+ function getNextSqrtPriceFromInput(
107
+ uint160 sqrtPX96,
108
+ uint128 liquidity,
109
+ uint256 amountIn,
110
+ bool zeroForOne
111
+ ) internal pure returns (uint160 sqrtQX96) {
112
+ require(sqrtPX96 > 0);
113
+ require(liquidity > 0);
114
+
115
+ // round to make sure that we don't pass the target price
116
+ return
117
+ zeroForOne
118
+ ? getNextSqrtPriceFromAmount0RoundingUp(sqrtPX96, liquidity, amountIn, true)
119
+ : getNextSqrtPriceFromAmount1RoundingDown(sqrtPX96, liquidity, amountIn, true);
120
+ }
121
+
122
+ /// @notice Gets the next sqrt price given an output amount of token0 or token1
123
+ /// @dev Throws if price or liquidity are 0 or the next price is out of bounds
124
+ /// @param sqrtPX96 The starting price before accounting for the output amount
125
+ /// @param liquidity The amount of usable liquidity
126
+ /// @param amountOut How much of token0, or token1, is being swapped out
127
+ /// @param zeroForOne Whether the amount out is token0 or token1
128
+ /// @return sqrtQX96 The price after removing the output amount of token0 or token1
129
+ function getNextSqrtPriceFromOutput(
130
+ uint160 sqrtPX96,
131
+ uint128 liquidity,
132
+ uint256 amountOut,
133
+ bool zeroForOne
134
+ ) internal pure returns (uint160 sqrtQX96) {
135
+ require(sqrtPX96 > 0);
136
+ require(liquidity > 0);
137
+
138
+ // round to make sure that we pass the target price
139
+ return
140
+ zeroForOne
141
+ ? getNextSqrtPriceFromAmount1RoundingDown(sqrtPX96, liquidity, amountOut, false)
142
+ : getNextSqrtPriceFromAmount0RoundingUp(sqrtPX96, liquidity, amountOut, false);
143
+ }
144
+
145
+ /// @notice Gets the amount0 delta between two prices
146
+ /// @dev Calculates liquidity / sqrt(lower) - liquidity / sqrt(upper),
147
+ /// i.e. liquidity * (sqrt(upper) - sqrt(lower)) / (sqrt(upper) * sqrt(lower))
148
+ /// @param sqrtRatioAX96 A sqrt price
149
+ /// @param sqrtRatioBX96 Another sqrt price
150
+ /// @param liquidity The amount of usable liquidity
151
+ /// @param roundUp Whether to round the amount up or down
152
+ /// @return amount0 Amount of token0 required to cover a position of size liquidity between the two passed prices
153
+ function getAmount0Delta(
154
+ uint160 sqrtRatioAX96,
155
+ uint160 sqrtRatioBX96,
156
+ uint128 liquidity,
157
+ bool roundUp
158
+ ) internal pure returns (uint256 amount0) {
159
+ if (sqrtRatioAX96 > sqrtRatioBX96) (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);
160
+
161
+ uint256 numerator1 = uint256(liquidity) << FixedPoint96.RESOLUTION;
162
+ uint256 numerator2 = sqrtRatioBX96 - sqrtRatioAX96;
163
+
164
+ require(sqrtRatioAX96 > 0);
165
+
166
+ return
167
+ roundUp
168
+ ? UnsafeMath.divRoundingUp(
169
+ FullMath.mulDivRoundingUp(numerator1, numerator2, sqrtRatioBX96),
170
+ sqrtRatioAX96
171
+ )
172
+ : FullMath.mulDiv(numerator1, numerator2, sqrtRatioBX96) / sqrtRatioAX96;
173
+ }
174
+
175
+ /// @notice Gets the amount1 delta between two prices
176
+ /// @dev Calculates liquidity * (sqrt(upper) - sqrt(lower))
177
+ /// @param sqrtRatioAX96 A sqrt price
178
+ /// @param sqrtRatioBX96 Another sqrt price
179
+ /// @param liquidity The amount of usable liquidity
180
+ /// @param roundUp Whether to round the amount up, or down
181
+ /// @return amount1 Amount of token1 required to cover a position of size liquidity between the two passed prices
182
+ function getAmount1Delta(
183
+ uint160 sqrtRatioAX96,
184
+ uint160 sqrtRatioBX96,
185
+ uint128 liquidity,
186
+ bool roundUp
187
+ ) internal pure returns (uint256 amount1) {
188
+ if (sqrtRatioAX96 > sqrtRatioBX96) (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96);
189
+
190
+ return
191
+ roundUp
192
+ ? FullMath.mulDivRoundingUp(liquidity, sqrtRatioBX96 - sqrtRatioAX96, FixedPoint96.Q96)
193
+ : FullMath.mulDiv(liquidity, sqrtRatioBX96 - sqrtRatioAX96, FixedPoint96.Q96);
194
+ }
195
+
196
+ /// @notice Helper that gets signed token0 delta
197
+ /// @param sqrtRatioAX96 A sqrt price
198
+ /// @param sqrtRatioBX96 Another sqrt price
199
+ /// @param liquidity The change in liquidity for which to compute the amount0 delta
200
+ /// @return amount0 Amount of token0 corresponding to the passed liquidityDelta between the two prices
201
+ function getAmount0Delta(
202
+ uint160 sqrtRatioAX96,
203
+ uint160 sqrtRatioBX96,
204
+ int128 liquidity
205
+ ) internal pure returns (int256 amount0) {
206
+ return
207
+ liquidity < 0
208
+ ? -getAmount0Delta(sqrtRatioAX96, sqrtRatioBX96, uint128(-liquidity), false).toInt256()
209
+ : getAmount0Delta(sqrtRatioAX96, sqrtRatioBX96, uint128(liquidity), true).toInt256();
210
+ }
211
+
212
+ /// @notice Helper that gets signed token1 delta
213
+ /// @param sqrtRatioAX96 A sqrt price
214
+ /// @param sqrtRatioBX96 Another sqrt price
215
+ /// @param liquidity The change in liquidity for which to compute the amount1 delta
216
+ /// @return amount1 Amount of token1 corresponding to the passed liquidityDelta between the two prices
217
+ function getAmount1Delta(
218
+ uint160 sqrtRatioAX96,
219
+ uint160 sqrtRatioBX96,
220
+ int128 liquidity
221
+ ) internal pure returns (int256 amount1) {
222
+ return
223
+ liquidity < 0
224
+ ? -getAmount1Delta(sqrtRatioAX96, sqrtRatioBX96, uint128(-liquidity), false).toInt256()
225
+ : getAmount1Delta(sqrtRatioAX96, sqrtRatioBX96, uint128(liquidity), true).toInt256();
226
+ }
227
+ }