web3gbit-cli 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 (989) hide show
  1. package/--broadcast +0 -0
  2. package/--private-key +0 -0
  3. package/--rpc-url +0 -0
  4. package/.github/workflows/test.yml +38 -0
  5. package/.gitmodules +3 -0
  6. package/GbitToken_flat.sol +2 -0
  7. package/GbitToken_flat.solnpx +0 -0
  8. package/README.md +72 -0
  9. package/admin-cli.js +413 -0
  10. package/cache/solidity-files-cache.json +1 -0
  11. package/foundry.lock +8 -0
  12. package/foundry.toml +6 -0
  13. package/lib/forge-std/.gitattributes +1 -0
  14. package/lib/forge-std/.github/CODEOWNERS +1 -0
  15. package/lib/forge-std/.github/dependabot.yml +6 -0
  16. package/lib/forge-std/.github/workflows/ci.yml +125 -0
  17. package/lib/forge-std/.github/workflows/sync.yml +36 -0
  18. package/lib/forge-std/CONTRIBUTING.md +193 -0
  19. package/lib/forge-std/LICENSE-APACHE +203 -0
  20. package/lib/forge-std/LICENSE-MIT +25 -0
  21. package/lib/forge-std/README.md +268 -0
  22. package/lib/forge-std/RELEASE_CHECKLIST.md +12 -0
  23. package/lib/forge-std/foundry.toml +18 -0
  24. package/lib/forge-std/package.json +16 -0
  25. package/lib/forge-std/scripts/vm.py +636 -0
  26. package/lib/forge-std/src/Base.sol +48 -0
  27. package/lib/forge-std/src/Config.sol +60 -0
  28. package/lib/forge-std/src/LibVariable.sol +477 -0
  29. package/lib/forge-std/src/Script.sol +28 -0
  30. package/lib/forge-std/src/StdAssertions.sol +779 -0
  31. package/lib/forge-std/src/StdChains.sol +295 -0
  32. package/lib/forge-std/src/StdCheats.sol +825 -0
  33. package/lib/forge-std/src/StdConfig.sol +632 -0
  34. package/lib/forge-std/src/StdConstants.sol +30 -0
  35. package/lib/forge-std/src/StdError.sol +15 -0
  36. package/lib/forge-std/src/StdInvariant.sol +120 -0
  37. package/lib/forge-std/src/StdJson.sol +275 -0
  38. package/lib/forge-std/src/StdMath.sol +47 -0
  39. package/lib/forge-std/src/StdStorage.sol +475 -0
  40. package/lib/forge-std/src/StdStyle.sol +333 -0
  41. package/lib/forge-std/src/StdToml.sol +275 -0
  42. package/lib/forge-std/src/StdUtils.sol +200 -0
  43. package/lib/forge-std/src/Test.sol +32 -0
  44. package/lib/forge-std/src/Vm.sol +2500 -0
  45. package/lib/forge-std/src/console.sol +1551 -0
  46. package/lib/forge-std/src/console2.sol +4 -0
  47. package/lib/forge-std/src/interfaces/IERC1155.sol +105 -0
  48. package/lib/forge-std/src/interfaces/IERC165.sol +12 -0
  49. package/lib/forge-std/src/interfaces/IERC20.sol +43 -0
  50. package/lib/forge-std/src/interfaces/IERC4626.sol +190 -0
  51. package/lib/forge-std/src/interfaces/IERC6909.sol +72 -0
  52. package/lib/forge-std/src/interfaces/IERC721.sol +164 -0
  53. package/lib/forge-std/src/interfaces/IERC7540.sol +144 -0
  54. package/lib/forge-std/src/interfaces/IERC7575.sol +241 -0
  55. package/lib/forge-std/src/interfaces/IMulticall3.sol +68 -0
  56. package/lib/forge-std/src/safeconsole.sol +13248 -0
  57. package/lib/forge-std/test/CommonBase.t.sol +44 -0
  58. package/lib/forge-std/test/Config.t.sol +381 -0
  59. package/lib/forge-std/test/LibVariable.t.sol +452 -0
  60. package/lib/forge-std/test/StdAssertions.t.sol +141 -0
  61. package/lib/forge-std/test/StdChains.t.sol +227 -0
  62. package/lib/forge-std/test/StdCheats.t.sol +638 -0
  63. package/lib/forge-std/test/StdConstants.t.sol +38 -0
  64. package/lib/forge-std/test/StdError.t.sol +119 -0
  65. package/lib/forge-std/test/StdJson.t.sol +49 -0
  66. package/lib/forge-std/test/StdMath.t.sol +202 -0
  67. package/lib/forge-std/test/StdStorage.t.sol +485 -0
  68. package/lib/forge-std/test/StdStyle.t.sol +110 -0
  69. package/lib/forge-std/test/StdToml.t.sol +49 -0
  70. package/lib/forge-std/test/StdUtils.t.sol +342 -0
  71. package/lib/forge-std/test/Vm.t.sol +18 -0
  72. package/lib/forge-std/test/compilation/CompilationScript.sol +8 -0
  73. package/lib/forge-std/test/compilation/CompilationScriptBase.sol +8 -0
  74. package/lib/forge-std/test/compilation/CompilationTest.sol +8 -0
  75. package/lib/forge-std/test/compilation/CompilationTestBase.sol +8 -0
  76. package/lib/forge-std/test/fixtures/broadcast.log.json +187 -0
  77. package/lib/forge-std/test/fixtures/config.toml +81 -0
  78. package/lib/forge-std/test/fixtures/test.json +8 -0
  79. package/lib/forge-std/test/fixtures/test.toml +6 -0
  80. package/lib/openzeppelin-contracts/.changeset/blue-mirrors-agree.md +5 -0
  81. package/lib/openzeppelin-contracts/.changeset/bright-webs-create.md +5 -0
  82. package/lib/openzeppelin-contracts/.changeset/clean-worlds-end.md +5 -0
  83. package/lib/openzeppelin-contracts/.changeset/config.json +12 -0
  84. package/lib/openzeppelin-contracts/.changeset/curly-pandas-flow.md +5 -0
  85. package/lib/openzeppelin-contracts/.changeset/flat-ideas-count.md +5 -0
  86. package/lib/openzeppelin-contracts/.changeset/fluffy-facts-brake.md +5 -0
  87. package/lib/openzeppelin-contracts/.changeset/forty-ads-design.md +5 -0
  88. package/lib/openzeppelin-contracts/.changeset/full-emus-hear.md +5 -0
  89. package/lib/openzeppelin-contracts/.changeset/fuzzy-lizards-do.md +5 -0
  90. package/lib/openzeppelin-contracts/.changeset/grumpy-cats-brake.md +5 -0
  91. package/lib/openzeppelin-contracts/.changeset/khaki-crews-join.md +5 -0
  92. package/lib/openzeppelin-contracts/.changeset/new-socks-deny.md +5 -0
  93. package/lib/openzeppelin-contracts/.changeset/shaky-phones-mix.md +5 -0
  94. package/lib/openzeppelin-contracts/.changeset/social-tools-sniff.md +5 -0
  95. package/lib/openzeppelin-contracts/.changeset/spotty-plums-brush.md +5 -0
  96. package/lib/openzeppelin-contracts/.changeset/stale-lizards-cheat.md +5 -0
  97. package/lib/openzeppelin-contracts/.changeset/swift-planets-juggle.md +5 -0
  98. package/lib/openzeppelin-contracts/.changeset/tame-monkeys-make.md +5 -0
  99. package/lib/openzeppelin-contracts/.changeset/tender-pans-yawn.md +5 -0
  100. package/lib/openzeppelin-contracts/.changeset/thick-banks-relate.md +5 -0
  101. package/lib/openzeppelin-contracts/.changeset/vast-worlds-pull.md +5 -0
  102. package/lib/openzeppelin-contracts/.changeset/whole-turkeys-swim.md +5 -0
  103. package/lib/openzeppelin-contracts/.changeset/yellow-clowns-mate.md +5 -0
  104. package/lib/openzeppelin-contracts/.changeset/young-corners-help.md +5 -0
  105. package/lib/openzeppelin-contracts/.codecov.yml +16 -0
  106. package/lib/openzeppelin-contracts/.editorconfig +21 -0
  107. package/lib/openzeppelin-contracts/.gitattributes +3 -0
  108. package/lib/openzeppelin-contracts/.github/CODEOWNERS +10 -0
  109. package/lib/openzeppelin-contracts/.github/ISSUE_TEMPLATE/bug_report.md +21 -0
  110. package/lib/openzeppelin-contracts/.github/ISSUE_TEMPLATE/config.yml +4 -0
  111. package/lib/openzeppelin-contracts/.github/ISSUE_TEMPLATE/feature_request.md +14 -0
  112. package/lib/openzeppelin-contracts/.github/PULL_REQUEST_TEMPLATE.md +20 -0
  113. package/lib/openzeppelin-contracts/.github/actions/gas-compare/action.yml +51 -0
  114. package/lib/openzeppelin-contracts/.github/actions/setup/action.yml +108 -0
  115. package/lib/openzeppelin-contracts/.github/actions/storage-layout/action.yml +57 -0
  116. package/lib/openzeppelin-contracts/.github/workflows/actionlint.yml +18 -0
  117. package/lib/openzeppelin-contracts/.github/workflows/changeset.yml +28 -0
  118. package/lib/openzeppelin-contracts/.github/workflows/checks.yml +132 -0
  119. package/lib/openzeppelin-contracts/.github/workflows/docs.yml +19 -0
  120. package/lib/openzeppelin-contracts/.github/workflows/formal-verification.yml +63 -0
  121. package/lib/openzeppelin-contracts/.github/workflows/release-cycle.yml +212 -0
  122. package/lib/openzeppelin-contracts/.github/workflows/release-upgradeable.yml +95 -0
  123. package/lib/openzeppelin-contracts/.github/workflows/upgradeable.yml +35 -0
  124. package/lib/openzeppelin-contracts/.gitmodules +10 -0
  125. package/lib/openzeppelin-contracts/.husky/pre-commit +2 -0
  126. package/lib/openzeppelin-contracts/.mocharc.js +4 -0
  127. package/lib/openzeppelin-contracts/.prettierrc +15 -0
  128. package/lib/openzeppelin-contracts/.solcover.js +21 -0
  129. package/lib/openzeppelin-contracts/CHANGELOG.md +1364 -0
  130. package/lib/openzeppelin-contracts/CODE_OF_CONDUCT.md +73 -0
  131. package/lib/openzeppelin-contracts/CONTRIBUTING.md +36 -0
  132. package/lib/openzeppelin-contracts/FUNDING.json +10 -0
  133. package/lib/openzeppelin-contracts/GUIDELINES.md +170 -0
  134. package/lib/openzeppelin-contracts/LICENSE +22 -0
  135. package/lib/openzeppelin-contracts/README.md +122 -0
  136. package/lib/openzeppelin-contracts/RELEASING.md +45 -0
  137. package/lib/openzeppelin-contracts/SECURITY.md +43 -0
  138. package/lib/openzeppelin-contracts/audits/2017-03.md +292 -0
  139. package/lib/openzeppelin-contracts/audits/2018-10.pdf +0 -0
  140. package/lib/openzeppelin-contracts/audits/2022-10-Checkpoints.pdf +0 -0
  141. package/lib/openzeppelin-contracts/audits/2022-10-ERC4626.pdf +0 -0
  142. package/lib/openzeppelin-contracts/audits/2023-05-v4.9.pdf +0 -0
  143. package/lib/openzeppelin-contracts/audits/2023-10-v5.0.pdf +0 -0
  144. package/lib/openzeppelin-contracts/audits/2024-10-v5.1.pdf +0 -0
  145. package/lib/openzeppelin-contracts/audits/2024-12-v5.2.pdf +0 -0
  146. package/lib/openzeppelin-contracts/audits/2025-04-v5.3.pdf +0 -0
  147. package/lib/openzeppelin-contracts/audits/2025-07-v5.4.pdf +0 -0
  148. package/lib/openzeppelin-contracts/audits/2025-10-v5.5.pdf +0 -0
  149. package/lib/openzeppelin-contracts/audits/README.md +22 -0
  150. package/lib/openzeppelin-contracts/contracts/access/AccessControl.sol +207 -0
  151. package/lib/openzeppelin-contracts/contracts/access/IAccessControl.sol +98 -0
  152. package/lib/openzeppelin-contracts/contracts/access/Ownable.sol +100 -0
  153. package/lib/openzeppelin-contracts/contracts/access/Ownable2Step.sol +67 -0
  154. package/lib/openzeppelin-contracts/contracts/access/README.adoc +45 -0
  155. package/lib/openzeppelin-contracts/contracts/access/extensions/AccessControlDefaultAdminRules.sol +372 -0
  156. package/lib/openzeppelin-contracts/contracts/access/extensions/AccessControlEnumerable.sol +81 -0
  157. package/lib/openzeppelin-contracts/contracts/access/extensions/IAccessControlDefaultAdminRules.sol +192 -0
  158. package/lib/openzeppelin-contracts/contracts/access/extensions/IAccessControlEnumerable.sol +31 -0
  159. package/lib/openzeppelin-contracts/contracts/access/manager/AccessManaged.sol +112 -0
  160. package/lib/openzeppelin-contracts/contracts/access/manager/AccessManager.sol +741 -0
  161. package/lib/openzeppelin-contracts/contracts/access/manager/AuthorityUtils.sol +36 -0
  162. package/lib/openzeppelin-contracts/contracts/access/manager/IAccessManaged.sol +32 -0
  163. package/lib/openzeppelin-contracts/contracts/access/manager/IAccessManager.sol +403 -0
  164. package/lib/openzeppelin-contracts/contracts/access/manager/IAuthority.sol +14 -0
  165. package/lib/openzeppelin-contracts/contracts/account/Account.sol +151 -0
  166. package/lib/openzeppelin-contracts/contracts/account/README.adoc +30 -0
  167. package/lib/openzeppelin-contracts/contracts/account/extensions/draft-AccountERC7579.sol +420 -0
  168. package/lib/openzeppelin-contracts/contracts/account/extensions/draft-AccountERC7579Hooked.sol +107 -0
  169. package/lib/openzeppelin-contracts/contracts/account/extensions/draft-ERC7821.sol +70 -0
  170. package/lib/openzeppelin-contracts/contracts/account/utils/EIP7702Utils.sol +21 -0
  171. package/lib/openzeppelin-contracts/contracts/account/utils/draft-ERC4337Utils.sol +279 -0
  172. package/lib/openzeppelin-contracts/contracts/account/utils/draft-ERC7579Utils.sol +280 -0
  173. package/lib/openzeppelin-contracts/contracts/crosschain/CrosschainLinked.sol +108 -0
  174. package/lib/openzeppelin-contracts/contracts/crosschain/ERC7786Recipient.sol +70 -0
  175. package/lib/openzeppelin-contracts/contracts/crosschain/README.adoc +29 -0
  176. package/lib/openzeppelin-contracts/contracts/crosschain/bridges/BridgeERC20.sol +36 -0
  177. package/lib/openzeppelin-contracts/contracts/crosschain/bridges/BridgeERC20Core.sol +79 -0
  178. package/lib/openzeppelin-contracts/contracts/crosschain/bridges/BridgeERC7802.sol +33 -0
  179. package/lib/openzeppelin-contracts/contracts/finance/README.adoc +14 -0
  180. package/lib/openzeppelin-contracts/contracts/finance/VestingWallet.sol +160 -0
  181. package/lib/openzeppelin-contracts/contracts/finance/VestingWalletCliff.sol +54 -0
  182. package/lib/openzeppelin-contracts/contracts/governance/Governor.sol +819 -0
  183. package/lib/openzeppelin-contracts/contracts/governance/IGovernor.sol +454 -0
  184. package/lib/openzeppelin-contracts/contracts/governance/README.adoc +197 -0
  185. package/lib/openzeppelin-contracts/contracts/governance/TimelockController.sol +470 -0
  186. package/lib/openzeppelin-contracts/contracts/governance/extensions/GovernorCountingFractional.sol +190 -0
  187. package/lib/openzeppelin-contracts/contracts/governance/extensions/GovernorCountingOverridable.sol +222 -0
  188. package/lib/openzeppelin-contracts/contracts/governance/extensions/GovernorCountingSimple.sol +96 -0
  189. package/lib/openzeppelin-contracts/contracts/governance/extensions/GovernorNoncesKeyed.sol +91 -0
  190. package/lib/openzeppelin-contracts/contracts/governance/extensions/GovernorPreventLateQuorum.sol +92 -0
  191. package/lib/openzeppelin-contracts/contracts/governance/extensions/GovernorProposalGuardian.sol +59 -0
  192. package/lib/openzeppelin-contracts/contracts/governance/extensions/GovernorSequentialProposalId.sol +75 -0
  193. package/lib/openzeppelin-contracts/contracts/governance/extensions/GovernorSettings.sol +106 -0
  194. package/lib/openzeppelin-contracts/contracts/governance/extensions/GovernorStorage.sol +134 -0
  195. package/lib/openzeppelin-contracts/contracts/governance/extensions/GovernorSuperQuorum.sol +59 -0
  196. package/lib/openzeppelin-contracts/contracts/governance/extensions/GovernorTimelockAccess.sol +346 -0
  197. package/lib/openzeppelin-contracts/contracts/governance/extensions/GovernorTimelockCompound.sol +165 -0
  198. package/lib/openzeppelin-contracts/contracts/governance/extensions/GovernorTimelockControl.sol +167 -0
  199. package/lib/openzeppelin-contracts/contracts/governance/extensions/GovernorVotes.sol +63 -0
  200. package/lib/openzeppelin-contracts/contracts/governance/extensions/GovernorVotesQuorumFraction.sol +113 -0
  201. package/lib/openzeppelin-contracts/contracts/governance/extensions/GovernorVotesSuperQuorumFraction.sol +135 -0
  202. package/lib/openzeppelin-contracts/contracts/governance/utils/IVotes.sol +60 -0
  203. package/lib/openzeppelin-contracts/contracts/governance/utils/Votes.sol +253 -0
  204. package/lib/openzeppelin-contracts/contracts/governance/utils/VotesExtended.sol +85 -0
  205. package/lib/openzeppelin-contracts/contracts/interfaces/IERC1155.sol +6 -0
  206. package/lib/openzeppelin-contracts/contracts/interfaces/IERC1155MetadataURI.sol +6 -0
  207. package/lib/openzeppelin-contracts/contracts/interfaces/IERC1155Receiver.sol +6 -0
  208. package/lib/openzeppelin-contracts/contracts/interfaces/IERC1271.sol +17 -0
  209. package/lib/openzeppelin-contracts/contracts/interfaces/IERC1363.sol +86 -0
  210. package/lib/openzeppelin-contracts/contracts/interfaces/IERC1363Receiver.sol +32 -0
  211. package/lib/openzeppelin-contracts/contracts/interfaces/IERC1363Spender.sol +26 -0
  212. package/lib/openzeppelin-contracts/contracts/interfaces/IERC165.sol +6 -0
  213. package/lib/openzeppelin-contracts/contracts/interfaces/IERC1820Implementer.sol +20 -0
  214. package/lib/openzeppelin-contracts/contracts/interfaces/IERC1820Registry.sol +112 -0
  215. package/lib/openzeppelin-contracts/contracts/interfaces/IERC1967.sol +24 -0
  216. package/lib/openzeppelin-contracts/contracts/interfaces/IERC20.sol +6 -0
  217. package/lib/openzeppelin-contracts/contracts/interfaces/IERC20Metadata.sol +6 -0
  218. package/lib/openzeppelin-contracts/contracts/interfaces/IERC2309.sol +19 -0
  219. package/lib/openzeppelin-contracts/contracts/interfaces/IERC2612.sol +8 -0
  220. package/lib/openzeppelin-contracts/contracts/interfaces/IERC2981.sol +26 -0
  221. package/lib/openzeppelin-contracts/contracts/interfaces/IERC3156.sol +7 -0
  222. package/lib/openzeppelin-contracts/contracts/interfaces/IERC3156FlashBorrower.sol +27 -0
  223. package/lib/openzeppelin-contracts/contracts/interfaces/IERC3156FlashLender.sol +41 -0
  224. package/lib/openzeppelin-contracts/contracts/interfaces/IERC4626.sol +230 -0
  225. package/lib/openzeppelin-contracts/contracts/interfaces/IERC4906.sol +20 -0
  226. package/lib/openzeppelin-contracts/contracts/interfaces/IERC5267.sol +28 -0
  227. package/lib/openzeppelin-contracts/contracts/interfaces/IERC5313.sol +16 -0
  228. package/lib/openzeppelin-contracts/contracts/interfaces/IERC5805.sol +9 -0
  229. package/lib/openzeppelin-contracts/contracts/interfaces/IERC6372.sol +17 -0
  230. package/lib/openzeppelin-contracts/contracts/interfaces/IERC6909.sol +125 -0
  231. package/lib/openzeppelin-contracts/contracts/interfaces/IERC721.sol +6 -0
  232. package/lib/openzeppelin-contracts/contracts/interfaces/IERC721Enumerable.sol +6 -0
  233. package/lib/openzeppelin-contracts/contracts/interfaces/IERC721Metadata.sol +6 -0
  234. package/lib/openzeppelin-contracts/contracts/interfaces/IERC721Receiver.sol +6 -0
  235. package/lib/openzeppelin-contracts/contracts/interfaces/IERC7751.sol +12 -0
  236. package/lib/openzeppelin-contracts/contracts/interfaces/IERC777.sol +200 -0
  237. package/lib/openzeppelin-contracts/contracts/interfaces/IERC777Recipient.sol +35 -0
  238. package/lib/openzeppelin-contracts/contracts/interfaces/IERC777Sender.sol +35 -0
  239. package/lib/openzeppelin-contracts/contracts/interfaces/IERC7913.sol +18 -0
  240. package/lib/openzeppelin-contracts/contracts/interfaces/README.adoc +138 -0
  241. package/lib/openzeppelin-contracts/contracts/interfaces/draft-IERC1822.sol +20 -0
  242. package/lib/openzeppelin-contracts/contracts/interfaces/draft-IERC4337.sol +255 -0
  243. package/lib/openzeppelin-contracts/contracts/interfaces/draft-IERC6093.sol +162 -0
  244. package/lib/openzeppelin-contracts/contracts/interfaces/draft-IERC7579.sol +227 -0
  245. package/lib/openzeppelin-contracts/contracts/interfaces/draft-IERC7674.sol +17 -0
  246. package/lib/openzeppelin-contracts/contracts/interfaces/draft-IERC7786.sol +64 -0
  247. package/lib/openzeppelin-contracts/contracts/interfaces/draft-IERC7802.sol +32 -0
  248. package/lib/openzeppelin-contracts/contracts/interfaces/draft-IERC7821.sol +44 -0
  249. package/lib/openzeppelin-contracts/contracts/metatx/ERC2771Context.sol +90 -0
  250. package/lib/openzeppelin-contracts/contracts/metatx/ERC2771Forwarder.sol +372 -0
  251. package/lib/openzeppelin-contracts/contracts/metatx/README.adoc +17 -0
  252. package/lib/openzeppelin-contracts/contracts/mocks/AccessManagedTarget.sol +34 -0
  253. package/lib/openzeppelin-contracts/contracts/mocks/AccessManagerMock.sol +20 -0
  254. package/lib/openzeppelin-contracts/contracts/mocks/ArraysMock.sol +171 -0
  255. package/lib/openzeppelin-contracts/contracts/mocks/AuthorityMock.sol +69 -0
  256. package/lib/openzeppelin-contracts/contracts/mocks/Base64Dirty.sol +19 -0
  257. package/lib/openzeppelin-contracts/contracts/mocks/BatchCaller.sol +20 -0
  258. package/lib/openzeppelin-contracts/contracts/mocks/CallReceiverMock.sol +106 -0
  259. package/lib/openzeppelin-contracts/contracts/mocks/ConstructorMock.sol +34 -0
  260. package/lib/openzeppelin-contracts/contracts/mocks/ContextMock.sol +35 -0
  261. package/lib/openzeppelin-contracts/contracts/mocks/DummyImplementation.sol +61 -0
  262. package/lib/openzeppelin-contracts/contracts/mocks/EIP712Verifier.sol +16 -0
  263. package/lib/openzeppelin-contracts/contracts/mocks/ERC1271WalletMock.sol +24 -0
  264. package/lib/openzeppelin-contracts/contracts/mocks/ERC165Mock.sol +100 -0
  265. package/lib/openzeppelin-contracts/contracts/mocks/ERC2771ContextMock.sol +28 -0
  266. package/lib/openzeppelin-contracts/contracts/mocks/ERC3156FlashBorrowerMock.sol +53 -0
  267. package/lib/openzeppelin-contracts/contracts/mocks/EtherReceiverMock.sol +17 -0
  268. package/lib/openzeppelin-contracts/contracts/mocks/InitializableMock.sol +130 -0
  269. package/lib/openzeppelin-contracts/contracts/mocks/MerkleProofCustomHashMock.sol +62 -0
  270. package/lib/openzeppelin-contracts/contracts/mocks/MerkleTreeMock.sol +52 -0
  271. package/lib/openzeppelin-contracts/contracts/mocks/MulticallHelper.sol +23 -0
  272. package/lib/openzeppelin-contracts/contracts/mocks/MultipleInheritanceInitializableMocks.sol +131 -0
  273. package/lib/openzeppelin-contracts/contracts/mocks/PausableMock.sol +31 -0
  274. package/lib/openzeppelin-contracts/contracts/mocks/ReentrancyAttack.sol +17 -0
  275. package/lib/openzeppelin-contracts/contracts/mocks/ReentrancyMock.sol +59 -0
  276. package/lib/openzeppelin-contracts/contracts/mocks/ReentrancyTransientMock.sol +59 -0
  277. package/lib/openzeppelin-contracts/contracts/mocks/RegressionImplementation.sol +61 -0
  278. package/lib/openzeppelin-contracts/contracts/mocks/SingleInheritanceInitializableMocks.sol +49 -0
  279. package/lib/openzeppelin-contracts/contracts/mocks/Stateless.sol +62 -0
  280. package/lib/openzeppelin-contracts/contracts/mocks/StorageSlotMock.sol +87 -0
  281. package/lib/openzeppelin-contracts/contracts/mocks/TimelockReentrant.sol +26 -0
  282. package/lib/openzeppelin-contracts/contracts/mocks/TransientSlotMock.sol +61 -0
  283. package/lib/openzeppelin-contracts/contracts/mocks/UpgradeableBeaconMock.sol +27 -0
  284. package/lib/openzeppelin-contracts/contracts/mocks/VotesExtendedMock.sol +42 -0
  285. package/lib/openzeppelin-contracts/contracts/mocks/VotesMock.sol +42 -0
  286. package/lib/openzeppelin-contracts/contracts/mocks/account/AccountMock.sol +181 -0
  287. package/lib/openzeppelin-contracts/contracts/mocks/account/modules/ERC7579Mock.sol +128 -0
  288. package/lib/openzeppelin-contracts/contracts/mocks/account/utils/ERC7579UtilsMock.sol +23 -0
  289. package/lib/openzeppelin-contracts/contracts/mocks/compound/CompTimelock.sol +174 -0
  290. package/lib/openzeppelin-contracts/contracts/mocks/crosschain/ERC7786GatewayMock.sol +56 -0
  291. package/lib/openzeppelin-contracts/contracts/mocks/crosschain/ERC7786RecipientMock.sol +31 -0
  292. package/lib/openzeppelin-contracts/contracts/mocks/docs/AccessManagerEnumerable.sol +161 -0
  293. package/lib/openzeppelin-contracts/contracts/mocks/docs/ERC20WithAutoMinerReward.sol +22 -0
  294. package/lib/openzeppelin-contracts/contracts/mocks/docs/ERC4626Fees.sol +109 -0
  295. package/lib/openzeppelin-contracts/contracts/mocks/docs/MyNFT.sol +9 -0
  296. package/lib/openzeppelin-contracts/contracts/mocks/docs/access-control/AccessControlERC20MintBase.sol +25 -0
  297. package/lib/openzeppelin-contracts/contracts/mocks/docs/access-control/AccessControlERC20MintMissing.sol +24 -0
  298. package/lib/openzeppelin-contracts/contracts/mocks/docs/access-control/AccessControlERC20MintOnlyRole.sol +23 -0
  299. package/lib/openzeppelin-contracts/contracts/mocks/docs/access-control/AccessControlModified.sol +14 -0
  300. package/lib/openzeppelin-contracts/contracts/mocks/docs/access-control/AccessManagedERC20MintBase.sol +16 -0
  301. package/lib/openzeppelin-contracts/contracts/mocks/docs/access-control/MyContractOwnable.sol +17 -0
  302. package/lib/openzeppelin-contracts/contracts/mocks/docs/account/MyAccountEIP7702.sol +20 -0
  303. package/lib/openzeppelin-contracts/contracts/mocks/docs/account/MyFactoryAccount.sol +37 -0
  304. package/lib/openzeppelin-contracts/contracts/mocks/docs/governance/MyGovernor.sol +80 -0
  305. package/lib/openzeppelin-contracts/contracts/mocks/docs/governance/MyToken.sol +21 -0
  306. package/lib/openzeppelin-contracts/contracts/mocks/docs/governance/MyTokenTimestampBased.sol +32 -0
  307. package/lib/openzeppelin-contracts/contracts/mocks/docs/governance/MyTokenWrapped.sol +28 -0
  308. package/lib/openzeppelin-contracts/contracts/mocks/docs/token/ERC1155/GameItems.sol +21 -0
  309. package/lib/openzeppelin-contracts/contracts/mocks/docs/token/ERC1155/MyERC115HolderContract.sol +7 -0
  310. package/lib/openzeppelin-contracts/contracts/mocks/docs/token/ERC20/GLDToken.sol +11 -0
  311. package/lib/openzeppelin-contracts/contracts/mocks/docs/token/ERC6909/ERC6909GameItems.sol +26 -0
  312. package/lib/openzeppelin-contracts/contracts/mocks/docs/token/ERC721/GameItem.sol +19 -0
  313. package/lib/openzeppelin-contracts/contracts/mocks/docs/utilities/Base64NFT.sol +27 -0
  314. package/lib/openzeppelin-contracts/contracts/mocks/docs/utilities/Multicall.sol +15 -0
  315. package/lib/openzeppelin-contracts/contracts/mocks/governance/GovernorCountingOverridableMock.sol +18 -0
  316. package/lib/openzeppelin-contracts/contracts/mocks/governance/GovernorFractionalMock.sol +14 -0
  317. package/lib/openzeppelin-contracts/contracts/mocks/governance/GovernorMock.sol +14 -0
  318. package/lib/openzeppelin-contracts/contracts/mocks/governance/GovernorNoncesKeyedMock.sol +44 -0
  319. package/lib/openzeppelin-contracts/contracts/mocks/governance/GovernorPreventLateQuorumMock.sol +40 -0
  320. package/lib/openzeppelin-contracts/contracts/mocks/governance/GovernorProposalGuardianMock.sol +27 -0
  321. package/lib/openzeppelin-contracts/contracts/mocks/governance/GovernorSequentialProposalIdMock.sol +39 -0
  322. package/lib/openzeppelin-contracts/contracts/mocks/governance/GovernorStorageMock.sol +79 -0
  323. package/lib/openzeppelin-contracts/contracts/mocks/governance/GovernorSuperQuorumMock.sol +95 -0
  324. package/lib/openzeppelin-contracts/contracts/mocks/governance/GovernorTimelockAccessMock.sol +70 -0
  325. package/lib/openzeppelin-contracts/contracts/mocks/governance/GovernorTimelockCompoundMock.sol +69 -0
  326. package/lib/openzeppelin-contracts/contracts/mocks/governance/GovernorTimelockControlMock.sol +69 -0
  327. package/lib/openzeppelin-contracts/contracts/mocks/governance/GovernorVoteMock.sol +20 -0
  328. package/lib/openzeppelin-contracts/contracts/mocks/governance/GovernorVotesSuperQuorumFractionMock.sol +37 -0
  329. package/lib/openzeppelin-contracts/contracts/mocks/governance/GovernorWithParamsMock.sol +51 -0
  330. package/lib/openzeppelin-contracts/contracts/mocks/proxy/BadBeacon.sol +11 -0
  331. package/lib/openzeppelin-contracts/contracts/mocks/proxy/ClashingImplementation.sol +19 -0
  332. package/lib/openzeppelin-contracts/contracts/mocks/proxy/ERC1967ProxyUnsafe.sol +13 -0
  333. package/lib/openzeppelin-contracts/contracts/mocks/proxy/UUPSUpgradeableMock.sol +35 -0
  334. package/lib/openzeppelin-contracts/contracts/mocks/token/ERC1155ReceiverMock.sol +74 -0
  335. package/lib/openzeppelin-contracts/contracts/mocks/token/ERC1363ForceApproveMock.sol +13 -0
  336. package/lib/openzeppelin-contracts/contracts/mocks/token/ERC1363NoReturnMock.sol +33 -0
  337. package/lib/openzeppelin-contracts/contracts/mocks/token/ERC1363ReceiverMock.sol +52 -0
  338. package/lib/openzeppelin-contracts/contracts/mocks/token/ERC1363ReturnFalseMock.sol +34 -0
  339. package/lib/openzeppelin-contracts/contracts/mocks/token/ERC1363SpenderMock.sol +47 -0
  340. package/lib/openzeppelin-contracts/contracts/mocks/token/ERC20ApprovalMock.sol +10 -0
  341. package/lib/openzeppelin-contracts/contracts/mocks/token/ERC20BridgeableMock.sol +30 -0
  342. package/lib/openzeppelin-contracts/contracts/mocks/token/ERC20DecimalsMock.sol +17 -0
  343. package/lib/openzeppelin-contracts/contracts/mocks/token/ERC20ExcessDecimalsMock.sol +9 -0
  344. package/lib/openzeppelin-contracts/contracts/mocks/token/ERC20FlashMintMock.sol +26 -0
  345. package/lib/openzeppelin-contracts/contracts/mocks/token/ERC20ForceApproveMock.sol +13 -0
  346. package/lib/openzeppelin-contracts/contracts/mocks/token/ERC20GetterHelper.sol +38 -0
  347. package/lib/openzeppelin-contracts/contracts/mocks/token/ERC20Mock.sol +16 -0
  348. package/lib/openzeppelin-contracts/contracts/mocks/token/ERC20MulticallMock.sol +8 -0
  349. package/lib/openzeppelin-contracts/contracts/mocks/token/ERC20NoReturnMock.sol +30 -0
  350. package/lib/openzeppelin-contracts/contracts/mocks/token/ERC20Reentrant.sol +39 -0
  351. package/lib/openzeppelin-contracts/contracts/mocks/token/ERC20ReturnFalseMock.sol +19 -0
  352. package/lib/openzeppelin-contracts/contracts/mocks/token/ERC20VotesAdditionalCheckpointsMock.sol +31 -0
  353. package/lib/openzeppelin-contracts/contracts/mocks/token/ERC20VotesLegacyMock.sol +253 -0
  354. package/lib/openzeppelin-contracts/contracts/mocks/token/ERC20VotesTimestampMock.sol +29 -0
  355. package/lib/openzeppelin-contracts/contracts/mocks/token/ERC4626LimitsMock.sol +23 -0
  356. package/lib/openzeppelin-contracts/contracts/mocks/token/ERC4626Mock.sol +17 -0
  357. package/lib/openzeppelin-contracts/contracts/mocks/token/ERC4626OffsetMock.sol +17 -0
  358. package/lib/openzeppelin-contracts/contracts/mocks/token/ERC4646FeesMock.sol +40 -0
  359. package/lib/openzeppelin-contracts/contracts/mocks/token/ERC721ConsecutiveEnumerableMock.sol +42 -0
  360. package/lib/openzeppelin-contracts/contracts/mocks/token/ERC721ConsecutiveMock.sol +61 -0
  361. package/lib/openzeppelin-contracts/contracts/mocks/token/ERC721ReceiverMock.sol +47 -0
  362. package/lib/openzeppelin-contracts/contracts/mocks/token/ERC721URIStorageMock.sol +17 -0
  363. package/lib/openzeppelin-contracts/contracts/mocks/utils/cryptography/ERC7739Mock.sol +12 -0
  364. package/lib/openzeppelin-contracts/contracts/package.json +32 -0
  365. package/lib/openzeppelin-contracts/contracts/proxy/Clones.sol +294 -0
  366. package/lib/openzeppelin-contracts/contracts/proxy/ERC1967/ERC1967Proxy.sol +62 -0
  367. package/lib/openzeppelin-contracts/contracts/proxy/ERC1967/ERC1967Utils.sol +177 -0
  368. package/lib/openzeppelin-contracts/contracts/proxy/Proxy.sol +69 -0
  369. package/lib/openzeppelin-contracts/contracts/proxy/README.adoc +87 -0
  370. package/lib/openzeppelin-contracts/contracts/proxy/beacon/BeaconProxy.sol +57 -0
  371. package/lib/openzeppelin-contracts/contracts/proxy/beacon/IBeacon.sol +16 -0
  372. package/lib/openzeppelin-contracts/contracts/proxy/beacon/UpgradeableBeacon.sol +70 -0
  373. package/lib/openzeppelin-contracts/contracts/proxy/transparent/ProxyAdmin.sol +45 -0
  374. package/lib/openzeppelin-contracts/contracts/proxy/transparent/TransparentUpgradeableProxy.sol +118 -0
  375. package/lib/openzeppelin-contracts/contracts/proxy/utils/Initializable.sol +238 -0
  376. package/lib/openzeppelin-contracts/contracts/proxy/utils/UUPSUpgradeable.sol +148 -0
  377. package/lib/openzeppelin-contracts/contracts/token/ERC1155/ERC1155.sol +416 -0
  378. package/lib/openzeppelin-contracts/contracts/token/ERC1155/IERC1155.sol +123 -0
  379. package/lib/openzeppelin-contracts/contracts/token/ERC1155/IERC1155Receiver.sol +59 -0
  380. package/lib/openzeppelin-contracts/contracts/token/ERC1155/README.adoc +43 -0
  381. package/lib/openzeppelin-contracts/contracts/token/ERC1155/extensions/ERC1155Burnable.sol +28 -0
  382. package/lib/openzeppelin-contracts/contracts/token/ERC1155/extensions/ERC1155Pausable.sol +38 -0
  383. package/lib/openzeppelin-contracts/contracts/token/ERC1155/extensions/ERC1155Supply.sol +88 -0
  384. package/lib/openzeppelin-contracts/contracts/token/ERC1155/extensions/ERC1155URIStorage.sol +58 -0
  385. package/lib/openzeppelin-contracts/contracts/token/ERC1155/extensions/IERC1155MetadataURI.sol +20 -0
  386. package/lib/openzeppelin-contracts/contracts/token/ERC1155/utils/ERC1155Holder.sol +42 -0
  387. package/lib/openzeppelin-contracts/contracts/token/ERC1155/utils/ERC1155Utils.sol +88 -0
  388. package/lib/openzeppelin-contracts/contracts/token/ERC20/ERC20.sol +305 -0
  389. package/lib/openzeppelin-contracts/contracts/token/ERC20/IERC20.sol +79 -0
  390. package/lib/openzeppelin-contracts/contracts/token/ERC20/README.adoc +81 -0
  391. package/lib/openzeppelin-contracts/contracts/token/ERC20/extensions/ERC1363.sol +135 -0
  392. package/lib/openzeppelin-contracts/contracts/token/ERC20/extensions/ERC20Burnable.sol +39 -0
  393. package/lib/openzeppelin-contracts/contracts/token/ERC20/extensions/ERC20Capped.sol +54 -0
  394. package/lib/openzeppelin-contracts/contracts/token/ERC20/extensions/ERC20Crosschain.sol +38 -0
  395. package/lib/openzeppelin-contracts/contracts/token/ERC20/extensions/ERC20FlashMint.sol +130 -0
  396. package/lib/openzeppelin-contracts/contracts/token/ERC20/extensions/ERC20Pausable.sol +33 -0
  397. package/lib/openzeppelin-contracts/contracts/token/ERC20/extensions/ERC20Permit.sol +77 -0
  398. package/lib/openzeppelin-contracts/contracts/token/ERC20/extensions/ERC20Votes.sol +83 -0
  399. package/lib/openzeppelin-contracts/contracts/token/ERC20/extensions/ERC20Wrapper.sol +89 -0
  400. package/lib/openzeppelin-contracts/contracts/token/ERC20/extensions/ERC4626.sol +315 -0
  401. package/lib/openzeppelin-contracts/contracts/token/ERC20/extensions/IERC20Metadata.sol +26 -0
  402. package/lib/openzeppelin-contracts/contracts/token/ERC20/extensions/IERC20Permit.sol +90 -0
  403. package/lib/openzeppelin-contracts/contracts/token/ERC20/extensions/draft-ERC20Bridgeable.sol +51 -0
  404. package/lib/openzeppelin-contracts/contracts/token/ERC20/extensions/draft-ERC20TemporaryApproval.sol +119 -0
  405. package/lib/openzeppelin-contracts/contracts/token/ERC20/utils/ERC1363Utils.sol +95 -0
  406. package/lib/openzeppelin-contracts/contracts/token/ERC20/utils/SafeERC20.sol +280 -0
  407. package/lib/openzeppelin-contracts/contracts/token/ERC6909/ERC6909.sol +224 -0
  408. package/lib/openzeppelin-contracts/contracts/token/ERC6909/README.adoc +27 -0
  409. package/lib/openzeppelin-contracts/contracts/token/ERC6909/extensions/ERC6909ContentURI.sol +59 -0
  410. package/lib/openzeppelin-contracts/contracts/token/ERC6909/extensions/ERC6909Metadata.sol +83 -0
  411. package/lib/openzeppelin-contracts/contracts/token/ERC6909/extensions/ERC6909TokenSupply.sol +41 -0
  412. package/lib/openzeppelin-contracts/contracts/token/ERC721/ERC721.sol +433 -0
  413. package/lib/openzeppelin-contracts/contracts/token/ERC721/IERC721.sol +135 -0
  414. package/lib/openzeppelin-contracts/contracts/token/ERC721/IERC721Receiver.sol +28 -0
  415. package/lib/openzeppelin-contracts/contracts/token/ERC721/README.adoc +69 -0
  416. package/lib/openzeppelin-contracts/contracts/token/ERC721/extensions/ERC721Burnable.sol +26 -0
  417. package/lib/openzeppelin-contracts/contracts/token/ERC721/extensions/ERC721Consecutive.sol +176 -0
  418. package/lib/openzeppelin-contracts/contracts/token/ERC721/extensions/ERC721Enumerable.sol +165 -0
  419. package/lib/openzeppelin-contracts/contracts/token/ERC721/extensions/ERC721Pausable.sol +37 -0
  420. package/lib/openzeppelin-contracts/contracts/token/ERC721/extensions/ERC721Royalty.sol +26 -0
  421. package/lib/openzeppelin-contracts/contracts/token/ERC721/extensions/ERC721URIStorage.sol +62 -0
  422. package/lib/openzeppelin-contracts/contracts/token/ERC721/extensions/ERC721Votes.sol +47 -0
  423. package/lib/openzeppelin-contracts/contracts/token/ERC721/extensions/ERC721Wrapper.sol +102 -0
  424. package/lib/openzeppelin-contracts/contracts/token/ERC721/extensions/IERC721Enumerable.sol +29 -0
  425. package/lib/openzeppelin-contracts/contracts/token/ERC721/extensions/IERC721Metadata.sol +27 -0
  426. package/lib/openzeppelin-contracts/contracts/token/ERC721/utils/ERC721Holder.sol +26 -0
  427. package/lib/openzeppelin-contracts/contracts/token/ERC721/utils/ERC721Utils.sol +50 -0
  428. package/lib/openzeppelin-contracts/contracts/token/common/ERC2981.sol +139 -0
  429. package/lib/openzeppelin-contracts/contracts/token/common/README.adoc +10 -0
  430. package/lib/openzeppelin-contracts/contracts/utils/Address.sol +167 -0
  431. package/lib/openzeppelin-contracts/contracts/utils/Arrays.sol +888 -0
  432. package/lib/openzeppelin-contracts/contracts/utils/Base58.sol +240 -0
  433. package/lib/openzeppelin-contracts/contracts/utils/Base64.sol +234 -0
  434. package/lib/openzeppelin-contracts/contracts/utils/Blockhash.sol +54 -0
  435. package/lib/openzeppelin-contracts/contracts/utils/Bytes.sol +332 -0
  436. package/lib/openzeppelin-contracts/contracts/utils/CAIP10.sol +54 -0
  437. package/lib/openzeppelin-contracts/contracts/utils/CAIP2.sol +51 -0
  438. package/lib/openzeppelin-contracts/contracts/utils/Calldata.sol +25 -0
  439. package/lib/openzeppelin-contracts/contracts/utils/Comparators.sol +19 -0
  440. package/lib/openzeppelin-contracts/contracts/utils/Context.sol +28 -0
  441. package/lib/openzeppelin-contracts/contracts/utils/Create2.sol +91 -0
  442. package/lib/openzeppelin-contracts/contracts/utils/Errors.sol +34 -0
  443. package/lib/openzeppelin-contracts/contracts/utils/LowLevelCall.sol +127 -0
  444. package/lib/openzeppelin-contracts/contracts/utils/Memory.sol +146 -0
  445. package/lib/openzeppelin-contracts/contracts/utils/Multicall.sol +37 -0
  446. package/lib/openzeppelin-contracts/contracts/utils/Nonces.sol +46 -0
  447. package/lib/openzeppelin-contracts/contracts/utils/NoncesKeyed.sol +74 -0
  448. package/lib/openzeppelin-contracts/contracts/utils/Packing.sol +1656 -0
  449. package/lib/openzeppelin-contracts/contracts/utils/Panic.sol +57 -0
  450. package/lib/openzeppelin-contracts/contracts/utils/Pausable.sol +112 -0
  451. package/lib/openzeppelin-contracts/contracts/utils/README.adoc +160 -0
  452. package/lib/openzeppelin-contracts/contracts/utils/RLP.sol +476 -0
  453. package/lib/openzeppelin-contracts/contracts/utils/ReentrancyGuard.sol +119 -0
  454. package/lib/openzeppelin-contracts/contracts/utils/ReentrancyGuardTransient.sol +84 -0
  455. package/lib/openzeppelin-contracts/contracts/utils/RelayedCall.sol +133 -0
  456. package/lib/openzeppelin-contracts/contracts/utils/ShortStrings.sol +122 -0
  457. package/lib/openzeppelin-contracts/contracts/utils/SlotDerivation.sol +155 -0
  458. package/lib/openzeppelin-contracts/contracts/utils/StorageSlot.sol +143 -0
  459. package/lib/openzeppelin-contracts/contracts/utils/Strings.sol +508 -0
  460. package/lib/openzeppelin-contracts/contracts/utils/TransientSlot.sol +183 -0
  461. package/lib/openzeppelin-contracts/contracts/utils/cryptography/ECDSA.sol +284 -0
  462. package/lib/openzeppelin-contracts/contracts/utils/cryptography/EIP712.sol +160 -0
  463. package/lib/openzeppelin-contracts/contracts/utils/cryptography/Hashes.sol +31 -0
  464. package/lib/openzeppelin-contracts/contracts/utils/cryptography/MerkleProof.sol +510 -0
  465. package/lib/openzeppelin-contracts/contracts/utils/cryptography/MessageHashUtils.sol +228 -0
  466. package/lib/openzeppelin-contracts/contracts/utils/cryptography/P256.sol +408 -0
  467. package/lib/openzeppelin-contracts/contracts/utils/cryptography/README.adoc +76 -0
  468. package/lib/openzeppelin-contracts/contracts/utils/cryptography/RSA.sol +154 -0
  469. package/lib/openzeppelin-contracts/contracts/utils/cryptography/SignatureChecker.sol +191 -0
  470. package/lib/openzeppelin-contracts/contracts/utils/cryptography/TrieProof.sol +230 -0
  471. package/lib/openzeppelin-contracts/contracts/utils/cryptography/WebAuthn.sol +261 -0
  472. package/lib/openzeppelin-contracts/contracts/utils/cryptography/draft-ERC7739Utils.sol +207 -0
  473. package/lib/openzeppelin-contracts/contracts/utils/cryptography/signers/AbstractSigner.sol +23 -0
  474. package/lib/openzeppelin-contracts/contracts/utils/cryptography/signers/MultiSignerERC7913.sol +259 -0
  475. package/lib/openzeppelin-contracts/contracts/utils/cryptography/signers/MultiSignerERC7913Weighted.sol +208 -0
  476. package/lib/openzeppelin-contracts/contracts/utils/cryptography/signers/SignerECDSA.sol +56 -0
  477. package/lib/openzeppelin-contracts/contracts/utils/cryptography/signers/SignerEIP7702.sol +25 -0
  478. package/lib/openzeppelin-contracts/contracts/utils/cryptography/signers/SignerERC7913.sol +63 -0
  479. package/lib/openzeppelin-contracts/contracts/utils/cryptography/signers/SignerP256.sol +64 -0
  480. package/lib/openzeppelin-contracts/contracts/utils/cryptography/signers/SignerRSA.sol +65 -0
  481. package/lib/openzeppelin-contracts/contracts/utils/cryptography/signers/SignerWebAuthn.sol +51 -0
  482. package/lib/openzeppelin-contracts/contracts/utils/cryptography/signers/draft-ERC7739.sol +98 -0
  483. package/lib/openzeppelin-contracts/contracts/utils/cryptography/verifiers/ERC7913P256Verifier.sol +29 -0
  484. package/lib/openzeppelin-contracts/contracts/utils/cryptography/verifiers/ERC7913RSAVerifier.sol +23 -0
  485. package/lib/openzeppelin-contracts/contracts/utils/cryptography/verifiers/ERC7913WebAuthnVerifier.sol +35 -0
  486. package/lib/openzeppelin-contracts/contracts/utils/draft-InteroperableAddress.sol +235 -0
  487. package/lib/openzeppelin-contracts/contracts/utils/introspection/ERC165.sol +25 -0
  488. package/lib/openzeppelin-contracts/contracts/utils/introspection/ERC165Checker.sol +142 -0
  489. package/lib/openzeppelin-contracts/contracts/utils/introspection/IERC165.sol +25 -0
  490. package/lib/openzeppelin-contracts/contracts/utils/math/Math.sol +763 -0
  491. package/lib/openzeppelin-contracts/contracts/utils/math/SafeCast.sol +1162 -0
  492. package/lib/openzeppelin-contracts/contracts/utils/math/SignedMath.sol +68 -0
  493. package/lib/openzeppelin-contracts/contracts/utils/structs/Accumulators.sol +130 -0
  494. package/lib/openzeppelin-contracts/contracts/utils/structs/BitMaps.sol +60 -0
  495. package/lib/openzeppelin-contracts/contracts/utils/structs/Checkpoints.sol +833 -0
  496. package/lib/openzeppelin-contracts/contracts/utils/structs/CircularBuffer.sol +152 -0
  497. package/lib/openzeppelin-contracts/contracts/utils/structs/DoubleEndedQueue.sol +237 -0
  498. package/lib/openzeppelin-contracts/contracts/utils/structs/EnumerableMap.sol +1443 -0
  499. package/lib/openzeppelin-contracts/contracts/utils/structs/EnumerableSet.sol +895 -0
  500. package/lib/openzeppelin-contracts/contracts/utils/structs/Heap.sol +259 -0
  501. package/lib/openzeppelin-contracts/contracts/utils/structs/MerkleTree.sol +267 -0
  502. package/lib/openzeppelin-contracts/contracts/utils/types/Time.sol +133 -0
  503. package/lib/openzeppelin-contracts/contracts/vendor/compound/ICompoundTimelock.sol +86 -0
  504. package/lib/openzeppelin-contracts/contracts/vendor/compound/LICENSE +11 -0
  505. package/lib/openzeppelin-contracts/docs/README.md +16 -0
  506. package/lib/openzeppelin-contracts/docs/antora.yml +7 -0
  507. package/lib/openzeppelin-contracts/docs/config.js +21 -0
  508. package/lib/openzeppelin-contracts/docs/modules/ROOT/images/access-control-multiple.svg +97 -0
  509. package/lib/openzeppelin-contracts/docs/modules/ROOT/images/access-manager-functions.svg +47 -0
  510. package/lib/openzeppelin-contracts/docs/modules/ROOT/images/access-manager.svg +99 -0
  511. package/lib/openzeppelin-contracts/docs/modules/ROOT/images/erc4626-attack-3a.png +0 -0
  512. package/lib/openzeppelin-contracts/docs/modules/ROOT/images/erc4626-attack-3b.png +0 -0
  513. package/lib/openzeppelin-contracts/docs/modules/ROOT/images/erc4626-attack-6.png +0 -0
  514. package/lib/openzeppelin-contracts/docs/modules/ROOT/images/erc4626-attack.png +0 -0
  515. package/lib/openzeppelin-contracts/docs/modules/ROOT/images/erc4626-deposit.png +0 -0
  516. package/lib/openzeppelin-contracts/docs/modules/ROOT/images/erc4626-mint.png +0 -0
  517. package/lib/openzeppelin-contracts/docs/modules/ROOT/images/erc4626-rate-linear.png +0 -0
  518. package/lib/openzeppelin-contracts/docs/modules/ROOT/images/erc4626-rate-loglog.png +0 -0
  519. package/lib/openzeppelin-contracts/docs/modules/ROOT/images/erc4626-rate-loglogext.png +0 -0
  520. package/lib/openzeppelin-contracts/docs/modules/ROOT/images/tally-exec.png +0 -0
  521. package/lib/openzeppelin-contracts/docs/modules/ROOT/images/tally-vote.png +0 -0
  522. package/lib/openzeppelin-contracts/docs/modules/ROOT/nav.adoc +29 -0
  523. package/lib/openzeppelin-contracts/docs/modules/ROOT/pages/access-control.adoc +339 -0
  524. package/lib/openzeppelin-contracts/docs/modules/ROOT/pages/account-abstraction.adoc +100 -0
  525. package/lib/openzeppelin-contracts/docs/modules/ROOT/pages/accounts.adoc +354 -0
  526. package/lib/openzeppelin-contracts/docs/modules/ROOT/pages/backwards-compatibility.adoc +50 -0
  527. package/lib/openzeppelin-contracts/docs/modules/ROOT/pages/eoa-delegation.adoc +143 -0
  528. package/lib/openzeppelin-contracts/docs/modules/ROOT/pages/erc1155.adoc +118 -0
  529. package/lib/openzeppelin-contracts/docs/modules/ROOT/pages/erc20-supply.adoc +71 -0
  530. package/lib/openzeppelin-contracts/docs/modules/ROOT/pages/erc20.adoc +67 -0
  531. package/lib/openzeppelin-contracts/docs/modules/ROOT/pages/erc4626.adoc +214 -0
  532. package/lib/openzeppelin-contracts/docs/modules/ROOT/pages/erc6909.adoc +47 -0
  533. package/lib/openzeppelin-contracts/docs/modules/ROOT/pages/erc721.adoc +58 -0
  534. package/lib/openzeppelin-contracts/docs/modules/ROOT/pages/extending-contracts.adoc +51 -0
  535. package/lib/openzeppelin-contracts/docs/modules/ROOT/pages/faq.adoc +13 -0
  536. package/lib/openzeppelin-contracts/docs/modules/ROOT/pages/governance.adoc +242 -0
  537. package/lib/openzeppelin-contracts/docs/modules/ROOT/pages/index.adoc +100 -0
  538. package/lib/openzeppelin-contracts/docs/modules/ROOT/pages/multisig.adoc +308 -0
  539. package/lib/openzeppelin-contracts/docs/modules/ROOT/pages/tokens.adoc +31 -0
  540. package/lib/openzeppelin-contracts/docs/modules/ROOT/pages/upgradeable.adoc +77 -0
  541. package/lib/openzeppelin-contracts/docs/modules/ROOT/pages/utilities.adoc +634 -0
  542. package/lib/openzeppelin-contracts/docs/modules/ROOT/pages/wizard.adoc +15 -0
  543. package/lib/openzeppelin-contracts/docs/templates/contract.hbs +141 -0
  544. package/lib/openzeppelin-contracts/docs/templates/helpers.js +46 -0
  545. package/lib/openzeppelin-contracts/docs/templates/page.hbs +4 -0
  546. package/lib/openzeppelin-contracts/docs/templates/properties.js +88 -0
  547. package/lib/openzeppelin-contracts/eslint.config.mjs +29 -0
  548. package/lib/openzeppelin-contracts/foundry.toml +20 -0
  549. package/lib/openzeppelin-contracts/fv/Makefile +54 -0
  550. package/lib/openzeppelin-contracts/fv/README.md +60 -0
  551. package/lib/openzeppelin-contracts/fv/diff/access_manager_AccessManager.sol.patch +97 -0
  552. package/lib/openzeppelin-contracts/fv/diff/account_extensions_draft-AccountERC7579.sol.patch +25 -0
  553. package/lib/openzeppelin-contracts/fv/diff/token_ERC721_ERC721.sol.patch +11 -0
  554. package/lib/openzeppelin-contracts/fv/harnesses/AccessControlDefaultAdminRulesHarness.sol +46 -0
  555. package/lib/openzeppelin-contracts/fv/harnesses/AccessControlHarness.sol +6 -0
  556. package/lib/openzeppelin-contracts/fv/harnesses/AccessManagedHarness.sol +36 -0
  557. package/lib/openzeppelin-contracts/fv/harnesses/AccessManagerHarness.sol +116 -0
  558. package/lib/openzeppelin-contracts/fv/harnesses/AccountHarness.sol +60 -0
  559. package/lib/openzeppelin-contracts/fv/harnesses/DoubleEndedQueueHarness.sol +58 -0
  560. package/lib/openzeppelin-contracts/fv/harnesses/ERC20FlashMintHarness.sol +36 -0
  561. package/lib/openzeppelin-contracts/fv/harnesses/ERC20PermitHarness.sol +16 -0
  562. package/lib/openzeppelin-contracts/fv/harnesses/ERC20WrapperHarness.sol +22 -0
  563. package/lib/openzeppelin-contracts/fv/harnesses/ERC3156FlashBorrowerHarness.sol +13 -0
  564. package/lib/openzeppelin-contracts/fv/harnesses/ERC721Harness.sol +37 -0
  565. package/lib/openzeppelin-contracts/fv/harnesses/ERC721ReceiverHarness.sol +11 -0
  566. package/lib/openzeppelin-contracts/fv/harnesses/EnumerableMapHarness.sol +55 -0
  567. package/lib/openzeppelin-contracts/fv/harnesses/EnumerableSetHarness.sol +35 -0
  568. package/lib/openzeppelin-contracts/fv/harnesses/InitializableHarness.sol +23 -0
  569. package/lib/openzeppelin-contracts/fv/harnesses/NoncesHarness.sol +14 -0
  570. package/lib/openzeppelin-contracts/fv/harnesses/Ownable2StepHarness.sol +10 -0
  571. package/lib/openzeppelin-contracts/fv/harnesses/OwnableHarness.sol +10 -0
  572. package/lib/openzeppelin-contracts/fv/harnesses/PausableHarness.sol +18 -0
  573. package/lib/openzeppelin-contracts/fv/harnesses/TimelockControllerHarness.sol +13 -0
  574. package/lib/openzeppelin-contracts/fv/reports/2021-10.pdf +0 -0
  575. package/lib/openzeppelin-contracts/fv/reports/2022-03.pdf +0 -0
  576. package/lib/openzeppelin-contracts/fv/reports/2022-05.pdf +0 -0
  577. package/lib/openzeppelin-contracts/fv/run.js +68 -0
  578. package/lib/openzeppelin-contracts/fv/specs/AccessControl.conf +8 -0
  579. package/lib/openzeppelin-contracts/fv/specs/AccessControl.spec +119 -0
  580. package/lib/openzeppelin-contracts/fv/specs/AccessControlDefaultAdminRules.conf +8 -0
  581. package/lib/openzeppelin-contracts/fv/specs/AccessControlDefaultAdminRules.spec +467 -0
  582. package/lib/openzeppelin-contracts/fv/specs/AccessManaged.conf +14 -0
  583. package/lib/openzeppelin-contracts/fv/specs/AccessManaged.spec +49 -0
  584. package/lib/openzeppelin-contracts/fv/specs/AccessManager.conf +10 -0
  585. package/lib/openzeppelin-contracts/fv/specs/AccessManager.spec +837 -0
  586. package/lib/openzeppelin-contracts/fv/specs/Account.conf +9 -0
  587. package/lib/openzeppelin-contracts/fv/specs/Account.spec +490 -0
  588. package/lib/openzeppelin-contracts/fv/specs/DoubleEndedQueue.conf +8 -0
  589. package/lib/openzeppelin-contracts/fv/specs/DoubleEndedQueue.spec +300 -0
  590. package/lib/openzeppelin-contracts/fv/specs/ERC20.conf +9 -0
  591. package/lib/openzeppelin-contracts/fv/specs/ERC20.spec +352 -0
  592. package/lib/openzeppelin-contracts/fv/specs/ERC20FlashMint.conf +10 -0
  593. package/lib/openzeppelin-contracts/fv/specs/ERC20FlashMint.spec +55 -0
  594. package/lib/openzeppelin-contracts/fv/specs/ERC20Wrapper.conf +13 -0
  595. package/lib/openzeppelin-contracts/fv/specs/ERC20Wrapper.spec +226 -0
  596. package/lib/openzeppelin-contracts/fv/specs/ERC721.conf +10 -0
  597. package/lib/openzeppelin-contracts/fv/specs/ERC721.spec +695 -0
  598. package/lib/openzeppelin-contracts/fv/specs/EnumerableMap.conf +8 -0
  599. package/lib/openzeppelin-contracts/fv/specs/EnumerableMap.spec +364 -0
  600. package/lib/openzeppelin-contracts/fv/specs/EnumerableSet.conf +8 -0
  601. package/lib/openzeppelin-contracts/fv/specs/EnumerableSet.spec +272 -0
  602. package/lib/openzeppelin-contracts/fv/specs/Initializable.conf +8 -0
  603. package/lib/openzeppelin-contracts/fv/specs/Initializable.spec +176 -0
  604. package/lib/openzeppelin-contracts/fv/specs/Nonces.conf +8 -0
  605. package/lib/openzeppelin-contracts/fv/specs/Nonces.spec +92 -0
  606. package/lib/openzeppelin-contracts/fv/specs/Ownable.conf +8 -0
  607. package/lib/openzeppelin-contracts/fv/specs/Ownable.spec +77 -0
  608. package/lib/openzeppelin-contracts/fv/specs/Ownable2Step.conf +8 -0
  609. package/lib/openzeppelin-contracts/fv/specs/Ownable2Step.spec +108 -0
  610. package/lib/openzeppelin-contracts/fv/specs/Pausable.conf +8 -0
  611. package/lib/openzeppelin-contracts/fv/specs/Pausable.spec +96 -0
  612. package/lib/openzeppelin-contracts/fv/specs/TimelockController.conf +10 -0
  613. package/lib/openzeppelin-contracts/fv/specs/TimelockController.spec +299 -0
  614. package/lib/openzeppelin-contracts/fv/specs/helpers/helpers.spec +13 -0
  615. package/lib/openzeppelin-contracts/fv/specs/methods/IAccessControl.spec +8 -0
  616. package/lib/openzeppelin-contracts/fv/specs/methods/IAccessControlDefaultAdminRules.spec +36 -0
  617. package/lib/openzeppelin-contracts/fv/specs/methods/IAccessManaged.spec +5 -0
  618. package/lib/openzeppelin-contracts/fv/specs/methods/IAccessManager.spec +33 -0
  619. package/lib/openzeppelin-contracts/fv/specs/methods/IAccount.spec +34 -0
  620. package/lib/openzeppelin-contracts/fv/specs/methods/IERC20.spec +11 -0
  621. package/lib/openzeppelin-contracts/fv/specs/methods/IERC2612.spec +5 -0
  622. package/lib/openzeppelin-contracts/fv/specs/methods/IERC3156FlashBorrower.spec +3 -0
  623. package/lib/openzeppelin-contracts/fv/specs/methods/IERC3156FlashLender.spec +5 -0
  624. package/lib/openzeppelin-contracts/fv/specs/methods/IERC5313.spec +3 -0
  625. package/lib/openzeppelin-contracts/fv/specs/methods/IERC721.spec +17 -0
  626. package/lib/openzeppelin-contracts/fv/specs/methods/IERC721Receiver.spec +3 -0
  627. package/lib/openzeppelin-contracts/fv/specs/methods/IOwnable.spec +5 -0
  628. package/lib/openzeppelin-contracts/fv/specs/methods/IOwnable2Step.spec +7 -0
  629. package/lib/openzeppelin-contracts/fv-requirements.txt +4 -0
  630. package/lib/openzeppelin-contracts/hardhat/async-test-sanity.js +10 -0
  631. package/lib/openzeppelin-contracts/hardhat/env-artifacts.js +29 -0
  632. package/lib/openzeppelin-contracts/hardhat/ignore-unreachable-warnings.js +45 -0
  633. package/lib/openzeppelin-contracts/hardhat/remappings.js +18 -0
  634. package/lib/openzeppelin-contracts/hardhat/skip-foundry-tests.js +6 -0
  635. package/lib/openzeppelin-contracts/hardhat/task-test-get-files.js +25 -0
  636. package/lib/openzeppelin-contracts/hardhat.config.js +124 -0
  637. package/lib/openzeppelin-contracts/logo.svg +15 -0
  638. package/lib/openzeppelin-contracts/netlify.toml +3 -0
  639. package/lib/openzeppelin-contracts/package-lock.json +11140 -0
  640. package/lib/openzeppelin-contracts/package.json +108 -0
  641. package/lib/openzeppelin-contracts/remappings.txt +1 -0
  642. package/lib/openzeppelin-contracts/renovate.json +4 -0
  643. package/lib/openzeppelin-contracts/scripts/checks/compare-layout.js +28 -0
  644. package/lib/openzeppelin-contracts/scripts/checks/compareGasReports.js +249 -0
  645. package/lib/openzeppelin-contracts/scripts/checks/coverage.sh +24 -0
  646. package/lib/openzeppelin-contracts/scripts/checks/extract-layout.js +39 -0
  647. package/lib/openzeppelin-contracts/scripts/checks/generation.sh +6 -0
  648. package/lib/openzeppelin-contracts/scripts/checks/inheritance-ordering.js +55 -0
  649. package/lib/openzeppelin-contracts/scripts/checks/pragma-validity.js +45 -0
  650. package/lib/openzeppelin-contracts/scripts/fetch-common-contracts.js +50 -0
  651. package/lib/openzeppelin-contracts/scripts/gen-nav.js +81 -0
  652. package/lib/openzeppelin-contracts/scripts/generate/format-lines.js +16 -0
  653. package/lib/openzeppelin-contracts/scripts/generate/helpers/sanitize.js +5 -0
  654. package/lib/openzeppelin-contracts/scripts/generate/run.js +61 -0
  655. package/lib/openzeppelin-contracts/scripts/generate/templates/Arrays.js +505 -0
  656. package/lib/openzeppelin-contracts/scripts/generate/templates/Arrays.opts.js +9 -0
  657. package/lib/openzeppelin-contracts/scripts/generate/templates/Checkpoints.js +242 -0
  658. package/lib/openzeppelin-contracts/scripts/generate/templates/Checkpoints.opts.js +18 -0
  659. package/lib/openzeppelin-contracts/scripts/generate/templates/Checkpoints.t.js +141 -0
  660. package/lib/openzeppelin-contracts/scripts/generate/templates/Enumerable.opts.js +56 -0
  661. package/lib/openzeppelin-contracts/scripts/generate/templates/EnumerableMap.js +464 -0
  662. package/lib/openzeppelin-contracts/scripts/generate/templates/EnumerableSet.js +470 -0
  663. package/lib/openzeppelin-contracts/scripts/generate/templates/MerkleProof.js +186 -0
  664. package/lib/openzeppelin-contracts/scripts/generate/templates/MerkleProof.opts.js +11 -0
  665. package/lib/openzeppelin-contracts/scripts/generate/templates/Packing.js +92 -0
  666. package/lib/openzeppelin-contracts/scripts/generate/templates/Packing.opts.js +3 -0
  667. package/lib/openzeppelin-contracts/scripts/generate/templates/Packing.t.js +48 -0
  668. package/lib/openzeppelin-contracts/scripts/generate/templates/SafeCast.js +136 -0
  669. package/lib/openzeppelin-contracts/scripts/generate/templates/Slot.opts.js +15 -0
  670. package/lib/openzeppelin-contracts/scripts/generate/templates/SlotDerivation.js +119 -0
  671. package/lib/openzeppelin-contracts/scripts/generate/templates/SlotDerivation.t.js +127 -0
  672. package/lib/openzeppelin-contracts/scripts/generate/templates/StorageSlot.js +77 -0
  673. package/lib/openzeppelin-contracts/scripts/generate/templates/StorageSlotMock.js +57 -0
  674. package/lib/openzeppelin-contracts/scripts/generate/templates/TransientSlot.js +80 -0
  675. package/lib/openzeppelin-contracts/scripts/generate/templates/TransientSlotMock.js +35 -0
  676. package/lib/openzeppelin-contracts/scripts/generate/templates/conversion.js +34 -0
  677. package/lib/openzeppelin-contracts/scripts/get-contracts-metadata.js +55 -0
  678. package/lib/openzeppelin-contracts/scripts/git-user-config.sh +6 -0
  679. package/lib/openzeppelin-contracts/scripts/helpers.js +7 -0
  680. package/lib/openzeppelin-contracts/scripts/minimize-pragma.js +140 -0
  681. package/lib/openzeppelin-contracts/scripts/prepack.sh +23 -0
  682. package/lib/openzeppelin-contracts/scripts/prepare-docs.sh +26 -0
  683. package/lib/openzeppelin-contracts/scripts/release/format-changelog.js +33 -0
  684. package/lib/openzeppelin-contracts/scripts/release/synchronize-versions.js +15 -0
  685. package/lib/openzeppelin-contracts/scripts/release/update-comment.js +34 -0
  686. package/lib/openzeppelin-contracts/scripts/release/version.sh +11 -0
  687. package/lib/openzeppelin-contracts/scripts/release/workflow/check-upgradeable.sh +27 -0
  688. package/lib/openzeppelin-contracts/scripts/release/workflow/exit-prerelease.sh +8 -0
  689. package/lib/openzeppelin-contracts/scripts/release/workflow/github-release.js +48 -0
  690. package/lib/openzeppelin-contracts/scripts/release/workflow/integrity-check.sh +20 -0
  691. package/lib/openzeppelin-contracts/scripts/release/workflow/pack.sh +26 -0
  692. package/lib/openzeppelin-contracts/scripts/release/workflow/publish.sh +26 -0
  693. package/lib/openzeppelin-contracts/scripts/release/workflow/rerun.js +7 -0
  694. package/lib/openzeppelin-contracts/scripts/release/workflow/set-changesets-pr-title.js +17 -0
  695. package/lib/openzeppelin-contracts/scripts/release/workflow/start.sh +35 -0
  696. package/lib/openzeppelin-contracts/scripts/release/workflow/state.js +112 -0
  697. package/lib/openzeppelin-contracts/scripts/remove-ignored-artifacts.js +45 -0
  698. package/lib/openzeppelin-contracts/scripts/set-max-old-space-size.sh +10 -0
  699. package/lib/openzeppelin-contracts/scripts/solc-versions.js +15 -0
  700. package/lib/openzeppelin-contracts/scripts/solhint-custom/index.js +118 -0
  701. package/lib/openzeppelin-contracts/scripts/solhint-custom/package.json +8 -0
  702. package/lib/openzeppelin-contracts/scripts/update-docs-branch.js +65 -0
  703. package/lib/openzeppelin-contracts/scripts/upgradeable/README.md +21 -0
  704. package/lib/openzeppelin-contracts/scripts/upgradeable/alias/Initializable.sol +5 -0
  705. package/lib/openzeppelin-contracts/scripts/upgradeable/alias/UUPSUpgradeable.sol +5 -0
  706. package/lib/openzeppelin-contracts/scripts/upgradeable/patch-apply.sh +19 -0
  707. package/lib/openzeppelin-contracts/scripts/upgradeable/patch-save.sh +18 -0
  708. package/lib/openzeppelin-contracts/scripts/upgradeable/transpile-onto.sh +54 -0
  709. package/lib/openzeppelin-contracts/scripts/upgradeable/transpile.sh +50 -0
  710. package/lib/openzeppelin-contracts/scripts/upgradeable/upgradeable.patch +390 -0
  711. package/lib/openzeppelin-contracts/slither.config.json +4 -0
  712. package/lib/openzeppelin-contracts/solhint.config.js +29 -0
  713. package/lib/openzeppelin-contracts/test/TESTING.md +3 -0
  714. package/lib/openzeppelin-contracts/test/access/AccessControl.behavior.js +874 -0
  715. package/lib/openzeppelin-contracts/test/access/AccessControl.test.js +19 -0
  716. package/lib/openzeppelin-contracts/test/access/Ownable.test.js +79 -0
  717. package/lib/openzeppelin-contracts/test/access/Ownable2Step.test.js +102 -0
  718. package/lib/openzeppelin-contracts/test/access/extensions/AccessControlDefaultAdminRules.test.js +32 -0
  719. package/lib/openzeppelin-contracts/test/access/extensions/AccessControlEnumerable.test.js +24 -0
  720. package/lib/openzeppelin-contracts/test/access/manager/AccessManaged.test.js +146 -0
  721. package/lib/openzeppelin-contracts/test/access/manager/AccessManager.behavior.js +257 -0
  722. package/lib/openzeppelin-contracts/test/access/manager/AccessManager.predicate.js +456 -0
  723. package/lib/openzeppelin-contracts/test/access/manager/AccessManager.test.js +2489 -0
  724. package/lib/openzeppelin-contracts/test/access/manager/AuthorityUtils.test.js +112 -0
  725. package/lib/openzeppelin-contracts/test/account/Account.behavior.js +144 -0
  726. package/lib/openzeppelin-contracts/test/account/Account.test.js +48 -0
  727. package/lib/openzeppelin-contracts/test/account/AccountECDSA.test.js +52 -0
  728. package/lib/openzeppelin-contracts/test/account/AccountEIP7702.t.sol +116 -0
  729. package/lib/openzeppelin-contracts/test/account/AccountEIP7702.test.js +52 -0
  730. package/lib/openzeppelin-contracts/test/account/AccountERC7913.test.js +138 -0
  731. package/lib/openzeppelin-contracts/test/account/AccountMultiSigner.test.js +326 -0
  732. package/lib/openzeppelin-contracts/test/account/AccountMultiSignerWeighted.test.js +312 -0
  733. package/lib/openzeppelin-contracts/test/account/AccountP256.test.js +58 -0
  734. package/lib/openzeppelin-contracts/test/account/AccountRSA.test.js +58 -0
  735. package/lib/openzeppelin-contracts/test/account/AccountWebAuthn.test.js +88 -0
  736. package/lib/openzeppelin-contracts/test/account/examples/AccountEIP7702WithModulesMock.test.js +99 -0
  737. package/lib/openzeppelin-contracts/test/account/extensions/AccountERC7579.behavior.js +621 -0
  738. package/lib/openzeppelin-contracts/test/account/extensions/AccountERC7579.test.js +60 -0
  739. package/lib/openzeppelin-contracts/test/account/extensions/AccountERC7579Hooked.test.js +60 -0
  740. package/lib/openzeppelin-contracts/test/account/extensions/ERC7821.behavior.js +145 -0
  741. package/lib/openzeppelin-contracts/test/account/utils/EIP7702Utils.test.js +53 -0
  742. package/lib/openzeppelin-contracts/test/account/utils/draft-ERC4337Utils.test.js +594 -0
  743. package/lib/openzeppelin-contracts/test/account/utils/draft-ERC7579Utils.t.sol +434 -0
  744. package/lib/openzeppelin-contracts/test/account/utils/draft-ERC7579Utils.test.js +399 -0
  745. package/lib/openzeppelin-contracts/test/crosschain/BridgeERC20.behavior.js +163 -0
  746. package/lib/openzeppelin-contracts/test/crosschain/BridgeERC20.test.js +46 -0
  747. package/lib/openzeppelin-contracts/test/crosschain/ERC7786Recipient.test.js +73 -0
  748. package/lib/openzeppelin-contracts/test/finance/VestingWallet.behavior.js +87 -0
  749. package/lib/openzeppelin-contracts/test/finance/VestingWallet.test.js +65 -0
  750. package/lib/openzeppelin-contracts/test/finance/VestingWalletCliff.test.js +70 -0
  751. package/lib/openzeppelin-contracts/test/governance/Governor.t.sol +59 -0
  752. package/lib/openzeppelin-contracts/test/governance/Governor.test.js +980 -0
  753. package/lib/openzeppelin-contracts/test/governance/TimelockController.test.js +1279 -0
  754. package/lib/openzeppelin-contracts/test/governance/extensions/GovernorCountingFractional.test.js +248 -0
  755. package/lib/openzeppelin-contracts/test/governance/extensions/GovernorCountingOverridable.test.js +346 -0
  756. package/lib/openzeppelin-contracts/test/governance/extensions/GovernorERC721.test.js +131 -0
  757. package/lib/openzeppelin-contracts/test/governance/extensions/GovernorNoncesKeyed.test.js +243 -0
  758. package/lib/openzeppelin-contracts/test/governance/extensions/GovernorPreventLateQuorum.test.js +185 -0
  759. package/lib/openzeppelin-contracts/test/governance/extensions/GovernorProposalGuardian.test.js +132 -0
  760. package/lib/openzeppelin-contracts/test/governance/extensions/GovernorSequentialProposalId.test.js +202 -0
  761. package/lib/openzeppelin-contracts/test/governance/extensions/GovernorStorage.test.js +175 -0
  762. package/lib/openzeppelin-contracts/test/governance/extensions/GovernorSuperQuorum.test.js +168 -0
  763. package/lib/openzeppelin-contracts/test/governance/extensions/GovernorSuperQuorumGreaterThanQuorum.t.sol +83 -0
  764. package/lib/openzeppelin-contracts/test/governance/extensions/GovernorTimelockAccess.test.js +864 -0
  765. package/lib/openzeppelin-contracts/test/governance/extensions/GovernorTimelockCompound.test.js +448 -0
  766. package/lib/openzeppelin-contracts/test/governance/extensions/GovernorTimelockControl.test.js +504 -0
  767. package/lib/openzeppelin-contracts/test/governance/extensions/GovernorVotesQuorumFraction.test.js +165 -0
  768. package/lib/openzeppelin-contracts/test/governance/extensions/GovernorVotesSuperQuorumFraction.test.js +160 -0
  769. package/lib/openzeppelin-contracts/test/governance/extensions/GovernorWithParams.test.js +245 -0
  770. package/lib/openzeppelin-contracts/test/governance/utils/ERC6372.behavior.js +28 -0
  771. package/lib/openzeppelin-contracts/test/governance/utils/Votes.behavior.js +325 -0
  772. package/lib/openzeppelin-contracts/test/governance/utils/Votes.test.js +102 -0
  773. package/lib/openzeppelin-contracts/test/governance/utils/VotesExtended.test.js +152 -0
  774. package/lib/openzeppelin-contracts/test/helpers/access-manager.js +85 -0
  775. package/lib/openzeppelin-contracts/test/helpers/account.js +16 -0
  776. package/lib/openzeppelin-contracts/test/helpers/chains.js +56 -0
  777. package/lib/openzeppelin-contracts/test/helpers/constants.js +7 -0
  778. package/lib/openzeppelin-contracts/test/helpers/deploy.js +14 -0
  779. package/lib/openzeppelin-contracts/test/helpers/eip712-types.js +61 -0
  780. package/lib/openzeppelin-contracts/test/helpers/eip712.js +45 -0
  781. package/lib/openzeppelin-contracts/test/helpers/enums.js +15 -0
  782. package/lib/openzeppelin-contracts/test/helpers/erc4337.js +244 -0
  783. package/lib/openzeppelin-contracts/test/helpers/erc7579.js +58 -0
  784. package/lib/openzeppelin-contracts/test/helpers/erc7739.js +118 -0
  785. package/lib/openzeppelin-contracts/test/helpers/governance.js +218 -0
  786. package/lib/openzeppelin-contracts/test/helpers/iterate.js +41 -0
  787. package/lib/openzeppelin-contracts/test/helpers/math.js +33 -0
  788. package/lib/openzeppelin-contracts/test/helpers/methods.js +14 -0
  789. package/lib/openzeppelin-contracts/test/helpers/precompiles.js +12 -0
  790. package/lib/openzeppelin-contracts/test/helpers/random.js +26 -0
  791. package/lib/openzeppelin-contracts/test/helpers/signers.js +222 -0
  792. package/lib/openzeppelin-contracts/test/helpers/storage.js +48 -0
  793. package/lib/openzeppelin-contracts/test/helpers/strings.js +5 -0
  794. package/lib/openzeppelin-contracts/test/helpers/time.js +33 -0
  795. package/lib/openzeppelin-contracts/test/helpers/trie.js +79 -0
  796. package/lib/openzeppelin-contracts/test/helpers/txpool.js +28 -0
  797. package/lib/openzeppelin-contracts/test/metatx/ERC2771Context.test.js +109 -0
  798. package/lib/openzeppelin-contracts/test/metatx/ERC2771Forwarder.t.sol +279 -0
  799. package/lib/openzeppelin-contracts/test/metatx/ERC2771Forwarder.test.js +384 -0
  800. package/lib/openzeppelin-contracts/test/proxy/Clones.behaviour.js +160 -0
  801. package/lib/openzeppelin-contracts/test/proxy/Clones.t.sol +91 -0
  802. package/lib/openzeppelin-contracts/test/proxy/Clones.test.js +177 -0
  803. package/lib/openzeppelin-contracts/test/proxy/ERC1967/ERC1967Proxy.test.js +36 -0
  804. package/lib/openzeppelin-contracts/test/proxy/ERC1967/ERC1967Utils.test.js +162 -0
  805. package/lib/openzeppelin-contracts/test/proxy/Proxy.behaviour.js +198 -0
  806. package/lib/openzeppelin-contracts/test/proxy/beacon/BeaconProxy.test.js +141 -0
  807. package/lib/openzeppelin-contracts/test/proxy/beacon/UpgradeableBeacon.test.js +55 -0
  808. package/lib/openzeppelin-contracts/test/proxy/transparent/ProxyAdmin.test.js +82 -0
  809. package/lib/openzeppelin-contracts/test/proxy/transparent/TransparentUpgradeableProxy.behaviour.js +367 -0
  810. package/lib/openzeppelin-contracts/test/proxy/transparent/TransparentUpgradeableProxy.test.js +28 -0
  811. package/lib/openzeppelin-contracts/test/proxy/utils/Initializable.test.js +216 -0
  812. package/lib/openzeppelin-contracts/test/proxy/utils/UUPSUpgradeable.test.js +120 -0
  813. package/lib/openzeppelin-contracts/test/sanity.test.js +27 -0
  814. package/lib/openzeppelin-contracts/test/token/ERC1155/ERC1155.behavior.js +865 -0
  815. package/lib/openzeppelin-contracts/test/token/ERC1155/ERC1155.test.js +258 -0
  816. package/lib/openzeppelin-contracts/test/token/ERC1155/extensions/ERC1155Burnable.test.js +66 -0
  817. package/lib/openzeppelin-contracts/test/token/ERC1155/extensions/ERC1155Pausable.test.js +105 -0
  818. package/lib/openzeppelin-contracts/test/token/ERC1155/extensions/ERC1155Supply.test.js +119 -0
  819. package/lib/openzeppelin-contracts/test/token/ERC1155/extensions/ERC1155URIStorage.test.js +70 -0
  820. package/lib/openzeppelin-contracts/test/token/ERC1155/utils/ERC1155Holder.test.js +56 -0
  821. package/lib/openzeppelin-contracts/test/token/ERC1155/utils/ERC1155Utils.test.js +299 -0
  822. package/lib/openzeppelin-contracts/test/token/ERC20/ERC20.behavior.js +269 -0
  823. package/lib/openzeppelin-contracts/test/token/ERC20/ERC20.test.js +199 -0
  824. package/lib/openzeppelin-contracts/test/token/ERC20/extensions/ERC1363.test.js +370 -0
  825. package/lib/openzeppelin-contracts/test/token/ERC20/extensions/ERC20Burnable.test.js +105 -0
  826. package/lib/openzeppelin-contracts/test/token/ERC20/extensions/ERC20Capped.test.js +55 -0
  827. package/lib/openzeppelin-contracts/test/token/ERC20/extensions/ERC20Crosschain.test.js +83 -0
  828. package/lib/openzeppelin-contracts/test/token/ERC20/extensions/ERC20FlashMint.test.js +164 -0
  829. package/lib/openzeppelin-contracts/test/token/ERC20/extensions/ERC20Pausable.test.js +129 -0
  830. package/lib/openzeppelin-contracts/test/token/ERC20/extensions/ERC20Permit.test.js +109 -0
  831. package/lib/openzeppelin-contracts/test/token/ERC20/extensions/ERC20Votes.test.js +546 -0
  832. package/lib/openzeppelin-contracts/test/token/ERC20/extensions/ERC20Wrapper.test.js +203 -0
  833. package/lib/openzeppelin-contracts/test/token/ERC20/extensions/ERC4626.t.sol +41 -0
  834. package/lib/openzeppelin-contracts/test/token/ERC20/extensions/ERC4626.test.js +888 -0
  835. package/lib/openzeppelin-contracts/test/token/ERC20/extensions/draft-ERC20Bridgeable.test.js +89 -0
  836. package/lib/openzeppelin-contracts/test/token/ERC20/extensions/draft-ERC20TemporaryApproval.test.js +142 -0
  837. package/lib/openzeppelin-contracts/test/token/ERC20/utils/SafeERC20.test.js +463 -0
  838. package/lib/openzeppelin-contracts/test/token/ERC6909/ERC6909.behavior.js +216 -0
  839. package/lib/openzeppelin-contracts/test/token/ERC6909/ERC6909.test.js +104 -0
  840. package/lib/openzeppelin-contracts/test/token/ERC6909/extensions/ERC6909ContentURI.test.js +52 -0
  841. package/lib/openzeppelin-contracts/test/token/ERC6909/extensions/ERC6909Metadata.test.js +62 -0
  842. package/lib/openzeppelin-contracts/test/token/ERC6909/extensions/ERC6909TokenSupply.test.js +56 -0
  843. package/lib/openzeppelin-contracts/test/token/ERC721/ERC721.behavior.js +954 -0
  844. package/lib/openzeppelin-contracts/test/token/ERC721/ERC721.test.js +23 -0
  845. package/lib/openzeppelin-contracts/test/token/ERC721/ERC721Enumerable.test.js +28 -0
  846. package/lib/openzeppelin-contracts/test/token/ERC721/extensions/ERC721Burnable.test.js +77 -0
  847. package/lib/openzeppelin-contracts/test/token/ERC721/extensions/ERC721Consecutive.t.sol +187 -0
  848. package/lib/openzeppelin-contracts/test/token/ERC721/extensions/ERC721Consecutive.test.js +228 -0
  849. package/lib/openzeppelin-contracts/test/token/ERC721/extensions/ERC721Pausable.test.js +81 -0
  850. package/lib/openzeppelin-contracts/test/token/ERC721/extensions/ERC721Royalty.test.js +57 -0
  851. package/lib/openzeppelin-contracts/test/token/ERC721/extensions/ERC721URIStorage.test.js +134 -0
  852. package/lib/openzeppelin-contracts/test/token/ERC721/extensions/ERC721Votes.test.js +194 -0
  853. package/lib/openzeppelin-contracts/test/token/ERC721/extensions/ERC721Wrapper.test.js +201 -0
  854. package/lib/openzeppelin-contracts/test/token/ERC721/utils/ERC721Holder.test.js +20 -0
  855. package/lib/openzeppelin-contracts/test/token/ERC721/utils/ERC721Utils.test.js +94 -0
  856. package/lib/openzeppelin-contracts/test/token/common/ERC2981.behavior.js +152 -0
  857. package/lib/openzeppelin-contracts/test/utils/Address.test.js +332 -0
  858. package/lib/openzeppelin-contracts/test/utils/Arrays.t.sol +416 -0
  859. package/lib/openzeppelin-contracts/test/utils/Arrays.test.js +284 -0
  860. package/lib/openzeppelin-contracts/test/utils/Base58.t.sol +24 -0
  861. package/lib/openzeppelin-contracts/test/utils/Base58.test.js +65 -0
  862. package/lib/openzeppelin-contracts/test/utils/Base64.t.sol +36 -0
  863. package/lib/openzeppelin-contracts/test/utils/Base64.test.js +79 -0
  864. package/lib/openzeppelin-contracts/test/utils/Blockhash.t.sol +101 -0
  865. package/lib/openzeppelin-contracts/test/utils/Blockhash.test.js +59 -0
  866. package/lib/openzeppelin-contracts/test/utils/Bytes.t.sol +322 -0
  867. package/lib/openzeppelin-contracts/test/utils/Bytes.test.js +371 -0
  868. package/lib/openzeppelin-contracts/test/utils/CAIP.test.js +56 -0
  869. package/lib/openzeppelin-contracts/test/utils/Calldata.test.js +22 -0
  870. package/lib/openzeppelin-contracts/test/utils/Context.behavior.js +48 -0
  871. package/lib/openzeppelin-contracts/test/utils/Context.test.js +18 -0
  872. package/lib/openzeppelin-contracts/test/utils/Create2.t.sol +17 -0
  873. package/lib/openzeppelin-contracts/test/utils/Create2.test.js +190 -0
  874. package/lib/openzeppelin-contracts/test/utils/LowLevelCall.test.js +257 -0
  875. package/lib/openzeppelin-contracts/test/utils/Memory.t.sol +63 -0
  876. package/lib/openzeppelin-contracts/test/utils/Memory.test.js +106 -0
  877. package/lib/openzeppelin-contracts/test/utils/Multicall.test.js +72 -0
  878. package/lib/openzeppelin-contracts/test/utils/Nonces.behavior.js +189 -0
  879. package/lib/openzeppelin-contracts/test/utils/Nonces.test.js +16 -0
  880. package/lib/openzeppelin-contracts/test/utils/NoncesKeyed.t.sol +51 -0
  881. package/lib/openzeppelin-contracts/test/utils/NoncesKeyed.test.js +17 -0
  882. package/lib/openzeppelin-contracts/test/utils/Packing.t.sol +993 -0
  883. package/lib/openzeppelin-contracts/test/utils/Packing.test.js +70 -0
  884. package/lib/openzeppelin-contracts/test/utils/Panic.test.js +37 -0
  885. package/lib/openzeppelin-contracts/test/utils/Pausable.test.js +90 -0
  886. package/lib/openzeppelin-contracts/test/utils/RLP.t.sol +144 -0
  887. package/lib/openzeppelin-contracts/test/utils/RLP.test.js +224 -0
  888. package/lib/openzeppelin-contracts/test/utils/ReentrancyGuard.test.js +58 -0
  889. package/lib/openzeppelin-contracts/test/utils/RelayedCall.test.js +217 -0
  890. package/lib/openzeppelin-contracts/test/utils/ShortStrings.t.sol +109 -0
  891. package/lib/openzeppelin-contracts/test/utils/ShortStrings.test.js +64 -0
  892. package/lib/openzeppelin-contracts/test/utils/SlotDerivation.t.sol +248 -0
  893. package/lib/openzeppelin-contracts/test/utils/SlotDerivation.test.js +58 -0
  894. package/lib/openzeppelin-contracts/test/utils/StorageSlot.test.js +73 -0
  895. package/lib/openzeppelin-contracts/test/utils/Strings.t.sol +50 -0
  896. package/lib/openzeppelin-contracts/test/utils/Strings.test.js +360 -0
  897. package/lib/openzeppelin-contracts/test/utils/TransientSlot.test.js +59 -0
  898. package/lib/openzeppelin-contracts/test/utils/cryptography/ECDSA.test.js +322 -0
  899. package/lib/openzeppelin-contracts/test/utils/cryptography/EIP712.test.js +105 -0
  900. package/lib/openzeppelin-contracts/test/utils/cryptography/ERC1271.behavior.js +111 -0
  901. package/lib/openzeppelin-contracts/test/utils/cryptography/ERC7739.test.js +42 -0
  902. package/lib/openzeppelin-contracts/test/utils/cryptography/ERC7739Utils.test.js +203 -0
  903. package/lib/openzeppelin-contracts/test/utils/cryptography/MerkleProof.test.js +216 -0
  904. package/lib/openzeppelin-contracts/test/utils/cryptography/MessageHashUtils.t.sol +33 -0
  905. package/lib/openzeppelin-contracts/test/utils/cryptography/MessageHashUtils.test.js +149 -0
  906. package/lib/openzeppelin-contracts/test/utils/cryptography/P256.t.sol +45 -0
  907. package/lib/openzeppelin-contracts/test/utils/cryptography/P256.test.js +182 -0
  908. package/lib/openzeppelin-contracts/test/utils/cryptography/RSA.helper.js +17 -0
  909. package/lib/openzeppelin-contracts/test/utils/cryptography/RSA.test.js +102 -0
  910. package/lib/openzeppelin-contracts/test/utils/cryptography/SigVer15_186-3.rsp +3850 -0
  911. package/lib/openzeppelin-contracts/test/utils/cryptography/SignatureChecker.test.js +427 -0
  912. package/lib/openzeppelin-contracts/test/utils/cryptography/TrieProof.test.js +659 -0
  913. package/lib/openzeppelin-contracts/test/utils/cryptography/WebAuthn.t.sol +298 -0
  914. package/lib/openzeppelin-contracts/test/utils/cryptography/ecdsa_secp256r1_sha256_p1363_test.json +3719 -0
  915. package/lib/openzeppelin-contracts/test/utils/draft-InteroperableAddress.t.sol +99 -0
  916. package/lib/openzeppelin-contracts/test/utils/draft-InteroperableAddress.test.js +170 -0
  917. package/lib/openzeppelin-contracts/test/utils/introspection/ERC165.test.js +18 -0
  918. package/lib/openzeppelin-contracts/test/utils/introspection/ERC165Checker.test.js +272 -0
  919. package/lib/openzeppelin-contracts/test/utils/introspection/SupportsInterface.behavior.js +169 -0
  920. package/lib/openzeppelin-contracts/test/utils/math/Math.t.sol +370 -0
  921. package/lib/openzeppelin-contracts/test/utils/math/Math.test.js +746 -0
  922. package/lib/openzeppelin-contracts/test/utils/math/SafeCast.test.js +159 -0
  923. package/lib/openzeppelin-contracts/test/utils/math/SignedMath.t.sol +81 -0
  924. package/lib/openzeppelin-contracts/test/utils/math/SignedMath.test.js +53 -0
  925. package/lib/openzeppelin-contracts/test/utils/structs/Accumulators.t.sol +35 -0
  926. package/lib/openzeppelin-contracts/test/utils/structs/BitMap.test.js +149 -0
  927. package/lib/openzeppelin-contracts/test/utils/structs/Checkpoints.t.sol +440 -0
  928. package/lib/openzeppelin-contracts/test/utils/structs/Checkpoints.test.js +147 -0
  929. package/lib/openzeppelin-contracts/test/utils/structs/CircularBuffer.test.js +83 -0
  930. package/lib/openzeppelin-contracts/test/utils/structs/DoubleEndedQueue.test.js +144 -0
  931. package/lib/openzeppelin-contracts/test/utils/structs/EnumerableMap.behavior.js +214 -0
  932. package/lib/openzeppelin-contracts/test/utils/structs/EnumerableMap.test.js +83 -0
  933. package/lib/openzeppelin-contracts/test/utils/structs/EnumerableSet.behavior.js +175 -0
  934. package/lib/openzeppelin-contracts/test/utils/structs/EnumerableSet.test.js +66 -0
  935. package/lib/openzeppelin-contracts/test/utils/structs/Heap.t.sol +74 -0
  936. package/lib/openzeppelin-contracts/test/utils/structs/Heap.test.js +113 -0
  937. package/lib/openzeppelin-contracts/test/utils/structs/MerkleTree.test.js +180 -0
  938. package/lib/openzeppelin-contracts/test/utils/types/Time.test.js +135 -0
  939. package/lucro.txt +1 -0
  940. package/out/Base.sol/CommonBase.json +1 -0
  941. package/out/Base.sol/ScriptBase.json +1 -0
  942. package/out/Base.sol/TestBase.json +1 -0
  943. package/out/Context.sol/Context.json +1 -0
  944. package/out/Counter.s.sol/CounterScript.json +1 -0
  945. package/out/Counter.sol/Counter.json +1 -0
  946. package/out/Counter.t.sol/CounterTest.json +1 -0
  947. package/out/ERC20.sol/ERC20.json +1 -0
  948. package/out/GbitToken.sol/GbitToken.json +1 -0
  949. package/out/Guestbook.sol/Guestbook.json +1 -0
  950. package/out/IERC20.sol/IERC20.json +1 -0
  951. package/out/IERC20Metadata.sol/IERC20Metadata.json +1 -0
  952. package/out/IMulticall3.sol/IMulticall3.json +1 -0
  953. package/out/Script.sol/Script.json +1 -0
  954. package/out/StdAssertions.sol/StdAssertions.json +1 -0
  955. package/out/StdChains.sol/StdChains.json +1 -0
  956. package/out/StdCheats.sol/StdCheats.json +1 -0
  957. package/out/StdCheats.sol/StdCheatsSafe.json +1 -0
  958. package/out/StdConstants.sol/StdConstants.json +1 -0
  959. package/out/StdError.sol/stdError.json +1 -0
  960. package/out/StdInvariant.sol/StdInvariant.json +1 -0
  961. package/out/StdJson.sol/stdJson.json +1 -0
  962. package/out/StdMath.sol/stdMath.json +1 -0
  963. package/out/StdStorage.sol/stdStorage.json +1 -0
  964. package/out/StdStorage.sol/stdStorageSafe.json +1 -0
  965. package/out/StdStyle.sol/StdStyle.json +1 -0
  966. package/out/StdToml.sol/stdToml.json +1 -0
  967. package/out/StdUtils.sol/StdUtils.json +1 -0
  968. package/out/Test.sol/Test.json +1 -0
  969. package/out/Vm.sol/Vm.json +1 -0
  970. package/out/Vm.sol/VmSafe.json +1 -0
  971. package/out/Web3HubCore.sol/Web3HubCore.json +1 -0
  972. package/out/build-info/8a1d781106536b7b.json +1 -0
  973. package/out/build-info/aac4797350a36a99.json +1 -0
  974. package/out/build-info/c34d5a7881e6beba.json +1 -0
  975. package/out/build-info/ce38d811b8078146.json +1 -0
  976. package/out/build-info/db34a3531e47e196.json +1 -0
  977. package/out/console.sol/console.json +1 -0
  978. package/out/draft-IERC6093.sol/IERC1155Errors.json +1 -0
  979. package/out/draft-IERC6093.sol/IERC20Errors.json +1 -0
  980. package/out/draft-IERC6093.sol/IERC721Errors.json +1 -0
  981. package/out/safeconsole.sol/safeconsole.json +1 -0
  982. package/package.json +25 -0
  983. package/remappings.txt +1 -0
  984. package/script/Counter.s.sol +19 -0
  985. package/src/Counter.sol +14 -0
  986. package/src/GbitToken.sol +72 -0
  987. package/src/Guestbook.sol +28 -0
  988. package/src/Web3HubCore.sol +42 -0
  989. package/test/Counter.t.sol +24 -0
@@ -0,0 +1,1443 @@
1
+ // SPDX-License-Identifier: MIT
2
+ // OpenZeppelin Contracts (last updated v5.5.0) (utils/structs/EnumerableMap.sol)
3
+ // This file was procedurally generated from scripts/generate/templates/EnumerableMap.js.
4
+
5
+ pragma solidity ^0.8.24;
6
+
7
+ import {EnumerableSet} from "./EnumerableSet.sol";
8
+
9
+ /**
10
+ * @dev Library for managing an enumerable variant of Solidity's
11
+ * https://solidity.readthedocs.io/en/latest/types.html#mapping-types[`mapping`]
12
+ * type.
13
+ *
14
+ * Maps have the following properties:
15
+ *
16
+ * - Entries are added, removed, and checked for existence in constant time
17
+ * (O(1)).
18
+ * - Entries are enumerated in O(n). No guarantees are made on the ordering.
19
+ * - Map can be cleared (all entries removed) in O(n).
20
+ *
21
+ * ```solidity
22
+ * contract Example {
23
+ * // Add the library methods
24
+ * using EnumerableMap for EnumerableMap.UintToAddressMap;
25
+ *
26
+ * // Declare a set state variable
27
+ * EnumerableMap.UintToAddressMap private myMap;
28
+ * }
29
+ * ```
30
+ *
31
+ * The following map types are supported:
32
+ *
33
+ * - `uint256 -> address` (`UintToAddressMap`) since v3.0.0
34
+ * - `address -> uint256` (`AddressToUintMap`) since v4.6.0
35
+ * - `bytes32 -> bytes32` (`Bytes32ToBytes32Map`) since v4.6.0
36
+ * - `uint256 -> uint256` (`UintToUintMap`) since v4.7.0
37
+ * - `bytes32 -> uint256` (`Bytes32ToUintMap`) since v4.7.0
38
+ * - `uint256 -> bytes32` (`UintToBytes32Map`) since v5.1.0
39
+ * - `address -> address` (`AddressToAddressMap`) since v5.1.0
40
+ * - `address -> bytes32` (`AddressToBytes32Map`) since v5.1.0
41
+ * - `bytes32 -> address` (`Bytes32ToAddressMap`) since v5.1.0
42
+ * - `bytes -> bytes` (`BytesToBytesMap`) since v5.4.0
43
+ * - `bytes4 -> address` (`Bytes4ToAddressMap`) since v5.6.0
44
+ *
45
+ * [WARNING]
46
+ * ====
47
+ * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure
48
+ * unusable.
49
+ * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info.
50
+ *
51
+ * In order to clean an EnumerableMap, you can either remove all elements one by one or create a fresh instance using an
52
+ * array of EnumerableMap.
53
+ * ====
54
+ */
55
+ library EnumerableMap {
56
+ using EnumerableSet for *;
57
+
58
+ // To implement this library for multiple types with as little code repetition as possible, we write it in
59
+ // terms of a generic Map type with bytes32 keys and values. The Map implementation uses private functions,
60
+ // and user-facing implementations such as `UintToAddressMap` are just wrappers around the underlying Map.
61
+ // This means that we can only create new EnumerableMaps for types that fit in bytes32.
62
+
63
+ /**
64
+ * @dev Query for a nonexistent map key.
65
+ */
66
+ error EnumerableMapNonexistentKey(bytes32 key);
67
+
68
+ struct Bytes32ToBytes32Map {
69
+ // Storage of keys
70
+ EnumerableSet.Bytes32Set _keys;
71
+ mapping(bytes32 key => bytes32) _values;
72
+ }
73
+
74
+ /**
75
+ * @dev Adds a key-value pair to a map, or updates the value for an existing
76
+ * key. O(1).
77
+ *
78
+ * Returns true if the key was added to the map, that is if it was not
79
+ * already present.
80
+ */
81
+ function set(Bytes32ToBytes32Map storage map, bytes32 key, bytes32 value) internal returns (bool) {
82
+ map._values[key] = value;
83
+ return map._keys.add(key);
84
+ }
85
+
86
+ /**
87
+ * @dev Removes a key-value pair from a map. O(1).
88
+ *
89
+ * Returns true if the key was removed from the map, that is if it was present.
90
+ */
91
+ function remove(Bytes32ToBytes32Map storage map, bytes32 key) internal returns (bool) {
92
+ delete map._values[key];
93
+ return map._keys.remove(key);
94
+ }
95
+
96
+ /**
97
+ * @dev Removes all the entries from a map. O(n).
98
+ *
99
+ * WARNING: Developers should keep in mind that this function has an unbounded cost and using it may render the
100
+ * function uncallable if the map grows to the point where clearing it consumes too much gas to fit in a block.
101
+ */
102
+ function clear(Bytes32ToBytes32Map storage map) internal {
103
+ uint256 len = length(map);
104
+ for (uint256 i = 0; i < len; ++i) {
105
+ delete map._values[map._keys.at(i)];
106
+ }
107
+ map._keys.clear();
108
+ }
109
+
110
+ /**
111
+ * @dev Returns true if the key is in the map. O(1).
112
+ */
113
+ function contains(Bytes32ToBytes32Map storage map, bytes32 key) internal view returns (bool) {
114
+ return map._keys.contains(key);
115
+ }
116
+
117
+ /**
118
+ * @dev Returns the number of key-value pairs in the map. O(1).
119
+ */
120
+ function length(Bytes32ToBytes32Map storage map) internal view returns (uint256) {
121
+ return map._keys.length();
122
+ }
123
+
124
+ /**
125
+ * @dev Returns the key-value pair stored at position `index` in the map. O(1).
126
+ *
127
+ * Note that there are no guarantees on the ordering of entries inside the
128
+ * array, and it may change when more entries are added or removed.
129
+ *
130
+ * Requirements:
131
+ *
132
+ * - `index` must be strictly less than {length}.
133
+ */
134
+ function at(Bytes32ToBytes32Map storage map, uint256 index) internal view returns (bytes32 key, bytes32 value) {
135
+ bytes32 atKey = map._keys.at(index);
136
+ return (atKey, map._values[atKey]);
137
+ }
138
+
139
+ /**
140
+ * @dev Tries to return the value associated with `key`. O(1).
141
+ * Does not revert if `key` is not in the map.
142
+ */
143
+ function tryGet(Bytes32ToBytes32Map storage map, bytes32 key) internal view returns (bool exists, bytes32 value) {
144
+ bytes32 val = map._values[key];
145
+ if (val == bytes32(0)) {
146
+ return (contains(map, key), bytes32(0));
147
+ } else {
148
+ return (true, val);
149
+ }
150
+ }
151
+
152
+ /**
153
+ * @dev Returns the value associated with `key`. O(1).
154
+ *
155
+ * Requirements:
156
+ *
157
+ * - `key` must be in the map.
158
+ */
159
+ function get(Bytes32ToBytes32Map storage map, bytes32 key) internal view returns (bytes32) {
160
+ bytes32 value = map._values[key];
161
+ if (value == 0 && !contains(map, key)) {
162
+ revert EnumerableMapNonexistentKey(key);
163
+ }
164
+ return value;
165
+ }
166
+
167
+ /**
168
+ * @dev Returns an array containing all the keys
169
+ *
170
+ * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
171
+ * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
172
+ * this function has an unbounded cost, and using it as part of a state-changing function may render the function
173
+ * uncallable if the map grows to a point where copying to memory consumes too much gas to fit in a block.
174
+ */
175
+ function keys(Bytes32ToBytes32Map storage map) internal view returns (bytes32[] memory) {
176
+ return map._keys.values();
177
+ }
178
+
179
+ /**
180
+ * @dev Returns an array containing a slice of the keys
181
+ *
182
+ * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
183
+ * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
184
+ * this function has an unbounded cost, and using it as part of a state-changing function may render the function
185
+ * uncallable if the map grows to a point where copying to memory consumes too much gas to fit in a block.
186
+ */
187
+ function keys(
188
+ Bytes32ToBytes32Map storage map,
189
+ uint256 start,
190
+ uint256 end
191
+ ) internal view returns (bytes32[] memory) {
192
+ return map._keys.values(start, end);
193
+ }
194
+
195
+ // UintToUintMap
196
+
197
+ struct UintToUintMap {
198
+ Bytes32ToBytes32Map _inner;
199
+ }
200
+
201
+ /**
202
+ * @dev Adds a key-value pair to a map, or updates the value for an existing
203
+ * key. O(1).
204
+ *
205
+ * Returns true if the key was added to the map, that is if it was not
206
+ * already present.
207
+ */
208
+ function set(UintToUintMap storage map, uint256 key, uint256 value) internal returns (bool) {
209
+ return set(map._inner, bytes32(key), bytes32(value));
210
+ }
211
+
212
+ /**
213
+ * @dev Removes a value from a map. O(1).
214
+ *
215
+ * Returns true if the key was removed from the map, that is if it was present.
216
+ */
217
+ function remove(UintToUintMap storage map, uint256 key) internal returns (bool) {
218
+ return remove(map._inner, bytes32(key));
219
+ }
220
+
221
+ /**
222
+ * @dev Removes all the entries from a map. O(n).
223
+ *
224
+ * WARNING: This function has an unbounded cost that scales with map size. Developers should keep in mind that
225
+ * using it may render the function uncallable if the map grows to the point where clearing it consumes too much
226
+ * gas to fit in a block.
227
+ */
228
+ function clear(UintToUintMap storage map) internal {
229
+ clear(map._inner);
230
+ }
231
+
232
+ /**
233
+ * @dev Returns true if the key is in the map. O(1).
234
+ */
235
+ function contains(UintToUintMap storage map, uint256 key) internal view returns (bool) {
236
+ return contains(map._inner, bytes32(key));
237
+ }
238
+
239
+ /**
240
+ * @dev Returns the number of elements in the map. O(1).
241
+ */
242
+ function length(UintToUintMap storage map) internal view returns (uint256) {
243
+ return length(map._inner);
244
+ }
245
+
246
+ /**
247
+ * @dev Returns the element stored at position `index` in the map. O(1).
248
+ * Note that there are no guarantees on the ordering of values inside the
249
+ * array, and it may change when more values are added or removed.
250
+ *
251
+ * Requirements:
252
+ *
253
+ * - `index` must be strictly less than {length}.
254
+ */
255
+ function at(UintToUintMap storage map, uint256 index) internal view returns (uint256 key, uint256 value) {
256
+ (bytes32 atKey, bytes32 val) = at(map._inner, index);
257
+ return (uint256(atKey), uint256(val));
258
+ }
259
+
260
+ /**
261
+ * @dev Tries to return the value associated with `key`. O(1).
262
+ * Does not revert if `key` is not in the map.
263
+ */
264
+ function tryGet(UintToUintMap storage map, uint256 key) internal view returns (bool exists, uint256 value) {
265
+ (bool success, bytes32 val) = tryGet(map._inner, bytes32(key));
266
+ return (success, uint256(val));
267
+ }
268
+
269
+ /**
270
+ * @dev Returns the value associated with `key`. O(1).
271
+ *
272
+ * Requirements:
273
+ *
274
+ * - `key` must be in the map.
275
+ */
276
+ function get(UintToUintMap storage map, uint256 key) internal view returns (uint256) {
277
+ return uint256(get(map._inner, bytes32(key)));
278
+ }
279
+
280
+ /**
281
+ * @dev Returns an array containing all the keys
282
+ *
283
+ * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
284
+ * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
285
+ * this function has an unbounded cost, and using it as part of a state-changing function may render the function
286
+ * uncallable if the map grows to a point where copying to memory consumes too much gas to fit in a block.
287
+ */
288
+ function keys(UintToUintMap storage map) internal view returns (uint256[] memory) {
289
+ bytes32[] memory store = keys(map._inner);
290
+ uint256[] memory result;
291
+
292
+ assembly ("memory-safe") {
293
+ result := store
294
+ }
295
+
296
+ return result;
297
+ }
298
+
299
+ /**
300
+ * @dev Returns an array containing a slice of the keys
301
+ *
302
+ * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
303
+ * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
304
+ * this function has an unbounded cost, and using it as part of a state-changing function may render the function
305
+ * uncallable if the map grows to a point where copying to memory consumes too much gas to fit in a block.
306
+ */
307
+ function keys(UintToUintMap storage map, uint256 start, uint256 end) internal view returns (uint256[] memory) {
308
+ bytes32[] memory store = keys(map._inner, start, end);
309
+ uint256[] memory result;
310
+
311
+ assembly ("memory-safe") {
312
+ result := store
313
+ }
314
+
315
+ return result;
316
+ }
317
+
318
+ // UintToAddressMap
319
+
320
+ struct UintToAddressMap {
321
+ Bytes32ToBytes32Map _inner;
322
+ }
323
+
324
+ /**
325
+ * @dev Adds a key-value pair to a map, or updates the value for an existing
326
+ * key. O(1).
327
+ *
328
+ * Returns true if the key was added to the map, that is if it was not
329
+ * already present.
330
+ */
331
+ function set(UintToAddressMap storage map, uint256 key, address value) internal returns (bool) {
332
+ return set(map._inner, bytes32(key), bytes32(uint256(uint160(value))));
333
+ }
334
+
335
+ /**
336
+ * @dev Removes a value from a map. O(1).
337
+ *
338
+ * Returns true if the key was removed from the map, that is if it was present.
339
+ */
340
+ function remove(UintToAddressMap storage map, uint256 key) internal returns (bool) {
341
+ return remove(map._inner, bytes32(key));
342
+ }
343
+
344
+ /**
345
+ * @dev Removes all the entries from a map. O(n).
346
+ *
347
+ * WARNING: This function has an unbounded cost that scales with map size. Developers should keep in mind that
348
+ * using it may render the function uncallable if the map grows to the point where clearing it consumes too much
349
+ * gas to fit in a block.
350
+ */
351
+ function clear(UintToAddressMap storage map) internal {
352
+ clear(map._inner);
353
+ }
354
+
355
+ /**
356
+ * @dev Returns true if the key is in the map. O(1).
357
+ */
358
+ function contains(UintToAddressMap storage map, uint256 key) internal view returns (bool) {
359
+ return contains(map._inner, bytes32(key));
360
+ }
361
+
362
+ /**
363
+ * @dev Returns the number of elements in the map. O(1).
364
+ */
365
+ function length(UintToAddressMap storage map) internal view returns (uint256) {
366
+ return length(map._inner);
367
+ }
368
+
369
+ /**
370
+ * @dev Returns the element stored at position `index` in the map. O(1).
371
+ * Note that there are no guarantees on the ordering of values inside the
372
+ * array, and it may change when more values are added or removed.
373
+ *
374
+ * Requirements:
375
+ *
376
+ * - `index` must be strictly less than {length}.
377
+ */
378
+ function at(UintToAddressMap storage map, uint256 index) internal view returns (uint256 key, address value) {
379
+ (bytes32 atKey, bytes32 val) = at(map._inner, index);
380
+ return (uint256(atKey), address(uint160(uint256(val))));
381
+ }
382
+
383
+ /**
384
+ * @dev Tries to return the value associated with `key`. O(1).
385
+ * Does not revert if `key` is not in the map.
386
+ */
387
+ function tryGet(UintToAddressMap storage map, uint256 key) internal view returns (bool exists, address value) {
388
+ (bool success, bytes32 val) = tryGet(map._inner, bytes32(key));
389
+ return (success, address(uint160(uint256(val))));
390
+ }
391
+
392
+ /**
393
+ * @dev Returns the value associated with `key`. O(1).
394
+ *
395
+ * Requirements:
396
+ *
397
+ * - `key` must be in the map.
398
+ */
399
+ function get(UintToAddressMap storage map, uint256 key) internal view returns (address) {
400
+ return address(uint160(uint256(get(map._inner, bytes32(key)))));
401
+ }
402
+
403
+ /**
404
+ * @dev Returns an array containing all the keys
405
+ *
406
+ * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
407
+ * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
408
+ * this function has an unbounded cost, and using it as part of a state-changing function may render the function
409
+ * uncallable if the map grows to a point where copying to memory consumes too much gas to fit in a block.
410
+ */
411
+ function keys(UintToAddressMap storage map) internal view returns (uint256[] memory) {
412
+ bytes32[] memory store = keys(map._inner);
413
+ uint256[] memory result;
414
+
415
+ assembly ("memory-safe") {
416
+ result := store
417
+ }
418
+
419
+ return result;
420
+ }
421
+
422
+ /**
423
+ * @dev Returns an array containing a slice of the keys
424
+ *
425
+ * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
426
+ * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
427
+ * this function has an unbounded cost, and using it as part of a state-changing function may render the function
428
+ * uncallable if the map grows to a point where copying to memory consumes too much gas to fit in a block.
429
+ */
430
+ function keys(UintToAddressMap storage map, uint256 start, uint256 end) internal view returns (uint256[] memory) {
431
+ bytes32[] memory store = keys(map._inner, start, end);
432
+ uint256[] memory result;
433
+
434
+ assembly ("memory-safe") {
435
+ result := store
436
+ }
437
+
438
+ return result;
439
+ }
440
+
441
+ // UintToBytes32Map
442
+
443
+ struct UintToBytes32Map {
444
+ Bytes32ToBytes32Map _inner;
445
+ }
446
+
447
+ /**
448
+ * @dev Adds a key-value pair to a map, or updates the value for an existing
449
+ * key. O(1).
450
+ *
451
+ * Returns true if the key was added to the map, that is if it was not
452
+ * already present.
453
+ */
454
+ function set(UintToBytes32Map storage map, uint256 key, bytes32 value) internal returns (bool) {
455
+ return set(map._inner, bytes32(key), value);
456
+ }
457
+
458
+ /**
459
+ * @dev Removes a value from a map. O(1).
460
+ *
461
+ * Returns true if the key was removed from the map, that is if it was present.
462
+ */
463
+ function remove(UintToBytes32Map storage map, uint256 key) internal returns (bool) {
464
+ return remove(map._inner, bytes32(key));
465
+ }
466
+
467
+ /**
468
+ * @dev Removes all the entries from a map. O(n).
469
+ *
470
+ * WARNING: This function has an unbounded cost that scales with map size. Developers should keep in mind that
471
+ * using it may render the function uncallable if the map grows to the point where clearing it consumes too much
472
+ * gas to fit in a block.
473
+ */
474
+ function clear(UintToBytes32Map storage map) internal {
475
+ clear(map._inner);
476
+ }
477
+
478
+ /**
479
+ * @dev Returns true if the key is in the map. O(1).
480
+ */
481
+ function contains(UintToBytes32Map storage map, uint256 key) internal view returns (bool) {
482
+ return contains(map._inner, bytes32(key));
483
+ }
484
+
485
+ /**
486
+ * @dev Returns the number of elements in the map. O(1).
487
+ */
488
+ function length(UintToBytes32Map storage map) internal view returns (uint256) {
489
+ return length(map._inner);
490
+ }
491
+
492
+ /**
493
+ * @dev Returns the element stored at position `index` in the map. O(1).
494
+ * Note that there are no guarantees on the ordering of values inside the
495
+ * array, and it may change when more values are added or removed.
496
+ *
497
+ * Requirements:
498
+ *
499
+ * - `index` must be strictly less than {length}.
500
+ */
501
+ function at(UintToBytes32Map storage map, uint256 index) internal view returns (uint256 key, bytes32 value) {
502
+ (bytes32 atKey, bytes32 val) = at(map._inner, index);
503
+ return (uint256(atKey), val);
504
+ }
505
+
506
+ /**
507
+ * @dev Tries to return the value associated with `key`. O(1).
508
+ * Does not revert if `key` is not in the map.
509
+ */
510
+ function tryGet(UintToBytes32Map storage map, uint256 key) internal view returns (bool exists, bytes32 value) {
511
+ (bool success, bytes32 val) = tryGet(map._inner, bytes32(key));
512
+ return (success, val);
513
+ }
514
+
515
+ /**
516
+ * @dev Returns the value associated with `key`. O(1).
517
+ *
518
+ * Requirements:
519
+ *
520
+ * - `key` must be in the map.
521
+ */
522
+ function get(UintToBytes32Map storage map, uint256 key) internal view returns (bytes32) {
523
+ return get(map._inner, bytes32(key));
524
+ }
525
+
526
+ /**
527
+ * @dev Returns an array containing all the keys
528
+ *
529
+ * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
530
+ * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
531
+ * this function has an unbounded cost, and using it as part of a state-changing function may render the function
532
+ * uncallable if the map grows to a point where copying to memory consumes too much gas to fit in a block.
533
+ */
534
+ function keys(UintToBytes32Map storage map) internal view returns (uint256[] memory) {
535
+ bytes32[] memory store = keys(map._inner);
536
+ uint256[] memory result;
537
+
538
+ assembly ("memory-safe") {
539
+ result := store
540
+ }
541
+
542
+ return result;
543
+ }
544
+
545
+ /**
546
+ * @dev Returns an array containing a slice of the keys
547
+ *
548
+ * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
549
+ * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
550
+ * this function has an unbounded cost, and using it as part of a state-changing function may render the function
551
+ * uncallable if the map grows to a point where copying to memory consumes too much gas to fit in a block.
552
+ */
553
+ function keys(UintToBytes32Map storage map, uint256 start, uint256 end) internal view returns (uint256[] memory) {
554
+ bytes32[] memory store = keys(map._inner, start, end);
555
+ uint256[] memory result;
556
+
557
+ assembly ("memory-safe") {
558
+ result := store
559
+ }
560
+
561
+ return result;
562
+ }
563
+
564
+ // AddressToUintMap
565
+
566
+ struct AddressToUintMap {
567
+ Bytes32ToBytes32Map _inner;
568
+ }
569
+
570
+ /**
571
+ * @dev Adds a key-value pair to a map, or updates the value for an existing
572
+ * key. O(1).
573
+ *
574
+ * Returns true if the key was added to the map, that is if it was not
575
+ * already present.
576
+ */
577
+ function set(AddressToUintMap storage map, address key, uint256 value) internal returns (bool) {
578
+ return set(map._inner, bytes32(uint256(uint160(key))), bytes32(value));
579
+ }
580
+
581
+ /**
582
+ * @dev Removes a value from a map. O(1).
583
+ *
584
+ * Returns true if the key was removed from the map, that is if it was present.
585
+ */
586
+ function remove(AddressToUintMap storage map, address key) internal returns (bool) {
587
+ return remove(map._inner, bytes32(uint256(uint160(key))));
588
+ }
589
+
590
+ /**
591
+ * @dev Removes all the entries from a map. O(n).
592
+ *
593
+ * WARNING: This function has an unbounded cost that scales with map size. Developers should keep in mind that
594
+ * using it may render the function uncallable if the map grows to the point where clearing it consumes too much
595
+ * gas to fit in a block.
596
+ */
597
+ function clear(AddressToUintMap storage map) internal {
598
+ clear(map._inner);
599
+ }
600
+
601
+ /**
602
+ * @dev Returns true if the key is in the map. O(1).
603
+ */
604
+ function contains(AddressToUintMap storage map, address key) internal view returns (bool) {
605
+ return contains(map._inner, bytes32(uint256(uint160(key))));
606
+ }
607
+
608
+ /**
609
+ * @dev Returns the number of elements in the map. O(1).
610
+ */
611
+ function length(AddressToUintMap storage map) internal view returns (uint256) {
612
+ return length(map._inner);
613
+ }
614
+
615
+ /**
616
+ * @dev Returns the element stored at position `index` in the map. O(1).
617
+ * Note that there are no guarantees on the ordering of values inside the
618
+ * array, and it may change when more values are added or removed.
619
+ *
620
+ * Requirements:
621
+ *
622
+ * - `index` must be strictly less than {length}.
623
+ */
624
+ function at(AddressToUintMap storage map, uint256 index) internal view returns (address key, uint256 value) {
625
+ (bytes32 atKey, bytes32 val) = at(map._inner, index);
626
+ return (address(uint160(uint256(atKey))), uint256(val));
627
+ }
628
+
629
+ /**
630
+ * @dev Tries to return the value associated with `key`. O(1).
631
+ * Does not revert if `key` is not in the map.
632
+ */
633
+ function tryGet(AddressToUintMap storage map, address key) internal view returns (bool exists, uint256 value) {
634
+ (bool success, bytes32 val) = tryGet(map._inner, bytes32(uint256(uint160(key))));
635
+ return (success, uint256(val));
636
+ }
637
+
638
+ /**
639
+ * @dev Returns the value associated with `key`. O(1).
640
+ *
641
+ * Requirements:
642
+ *
643
+ * - `key` must be in the map.
644
+ */
645
+ function get(AddressToUintMap storage map, address key) internal view returns (uint256) {
646
+ return uint256(get(map._inner, bytes32(uint256(uint160(key)))));
647
+ }
648
+
649
+ /**
650
+ * @dev Returns an array containing all the keys
651
+ *
652
+ * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
653
+ * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
654
+ * this function has an unbounded cost, and using it as part of a state-changing function may render the function
655
+ * uncallable if the map grows to a point where copying to memory consumes too much gas to fit in a block.
656
+ */
657
+ function keys(AddressToUintMap storage map) internal view returns (address[] memory) {
658
+ bytes32[] memory store = keys(map._inner);
659
+ address[] memory result;
660
+
661
+ assembly ("memory-safe") {
662
+ result := store
663
+ }
664
+
665
+ return result;
666
+ }
667
+
668
+ /**
669
+ * @dev Returns an array containing a slice of the keys
670
+ *
671
+ * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
672
+ * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
673
+ * this function has an unbounded cost, and using it as part of a state-changing function may render the function
674
+ * uncallable if the map grows to a point where copying to memory consumes too much gas to fit in a block.
675
+ */
676
+ function keys(AddressToUintMap storage map, uint256 start, uint256 end) internal view returns (address[] memory) {
677
+ bytes32[] memory store = keys(map._inner, start, end);
678
+ address[] memory result;
679
+
680
+ assembly ("memory-safe") {
681
+ result := store
682
+ }
683
+
684
+ return result;
685
+ }
686
+
687
+ // AddressToAddressMap
688
+
689
+ struct AddressToAddressMap {
690
+ Bytes32ToBytes32Map _inner;
691
+ }
692
+
693
+ /**
694
+ * @dev Adds a key-value pair to a map, or updates the value for an existing
695
+ * key. O(1).
696
+ *
697
+ * Returns true if the key was added to the map, that is if it was not
698
+ * already present.
699
+ */
700
+ function set(AddressToAddressMap storage map, address key, address value) internal returns (bool) {
701
+ return set(map._inner, bytes32(uint256(uint160(key))), bytes32(uint256(uint160(value))));
702
+ }
703
+
704
+ /**
705
+ * @dev Removes a value from a map. O(1).
706
+ *
707
+ * Returns true if the key was removed from the map, that is if it was present.
708
+ */
709
+ function remove(AddressToAddressMap storage map, address key) internal returns (bool) {
710
+ return remove(map._inner, bytes32(uint256(uint160(key))));
711
+ }
712
+
713
+ /**
714
+ * @dev Removes all the entries from a map. O(n).
715
+ *
716
+ * WARNING: This function has an unbounded cost that scales with map size. Developers should keep in mind that
717
+ * using it may render the function uncallable if the map grows to the point where clearing it consumes too much
718
+ * gas to fit in a block.
719
+ */
720
+ function clear(AddressToAddressMap storage map) internal {
721
+ clear(map._inner);
722
+ }
723
+
724
+ /**
725
+ * @dev Returns true if the key is in the map. O(1).
726
+ */
727
+ function contains(AddressToAddressMap storage map, address key) internal view returns (bool) {
728
+ return contains(map._inner, bytes32(uint256(uint160(key))));
729
+ }
730
+
731
+ /**
732
+ * @dev Returns the number of elements in the map. O(1).
733
+ */
734
+ function length(AddressToAddressMap storage map) internal view returns (uint256) {
735
+ return length(map._inner);
736
+ }
737
+
738
+ /**
739
+ * @dev Returns the element stored at position `index` in the map. O(1).
740
+ * Note that there are no guarantees on the ordering of values inside the
741
+ * array, and it may change when more values are added or removed.
742
+ *
743
+ * Requirements:
744
+ *
745
+ * - `index` must be strictly less than {length}.
746
+ */
747
+ function at(AddressToAddressMap storage map, uint256 index) internal view returns (address key, address value) {
748
+ (bytes32 atKey, bytes32 val) = at(map._inner, index);
749
+ return (address(uint160(uint256(atKey))), address(uint160(uint256(val))));
750
+ }
751
+
752
+ /**
753
+ * @dev Tries to return the value associated with `key`. O(1).
754
+ * Does not revert if `key` is not in the map.
755
+ */
756
+ function tryGet(AddressToAddressMap storage map, address key) internal view returns (bool exists, address value) {
757
+ (bool success, bytes32 val) = tryGet(map._inner, bytes32(uint256(uint160(key))));
758
+ return (success, address(uint160(uint256(val))));
759
+ }
760
+
761
+ /**
762
+ * @dev Returns the value associated with `key`. O(1).
763
+ *
764
+ * Requirements:
765
+ *
766
+ * - `key` must be in the map.
767
+ */
768
+ function get(AddressToAddressMap storage map, address key) internal view returns (address) {
769
+ return address(uint160(uint256(get(map._inner, bytes32(uint256(uint160(key)))))));
770
+ }
771
+
772
+ /**
773
+ * @dev Returns an array containing all the keys
774
+ *
775
+ * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
776
+ * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
777
+ * this function has an unbounded cost, and using it as part of a state-changing function may render the function
778
+ * uncallable if the map grows to a point where copying to memory consumes too much gas to fit in a block.
779
+ */
780
+ function keys(AddressToAddressMap storage map) internal view returns (address[] memory) {
781
+ bytes32[] memory store = keys(map._inner);
782
+ address[] memory result;
783
+
784
+ assembly ("memory-safe") {
785
+ result := store
786
+ }
787
+
788
+ return result;
789
+ }
790
+
791
+ /**
792
+ * @dev Returns an array containing a slice of the keys
793
+ *
794
+ * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
795
+ * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
796
+ * this function has an unbounded cost, and using it as part of a state-changing function may render the function
797
+ * uncallable if the map grows to a point where copying to memory consumes too much gas to fit in a block.
798
+ */
799
+ function keys(
800
+ AddressToAddressMap storage map,
801
+ uint256 start,
802
+ uint256 end
803
+ ) internal view returns (address[] memory) {
804
+ bytes32[] memory store = keys(map._inner, start, end);
805
+ address[] memory result;
806
+
807
+ assembly ("memory-safe") {
808
+ result := store
809
+ }
810
+
811
+ return result;
812
+ }
813
+
814
+ // AddressToBytes32Map
815
+
816
+ struct AddressToBytes32Map {
817
+ Bytes32ToBytes32Map _inner;
818
+ }
819
+
820
+ /**
821
+ * @dev Adds a key-value pair to a map, or updates the value for an existing
822
+ * key. O(1).
823
+ *
824
+ * Returns true if the key was added to the map, that is if it was not
825
+ * already present.
826
+ */
827
+ function set(AddressToBytes32Map storage map, address key, bytes32 value) internal returns (bool) {
828
+ return set(map._inner, bytes32(uint256(uint160(key))), value);
829
+ }
830
+
831
+ /**
832
+ * @dev Removes a value from a map. O(1).
833
+ *
834
+ * Returns true if the key was removed from the map, that is if it was present.
835
+ */
836
+ function remove(AddressToBytes32Map storage map, address key) internal returns (bool) {
837
+ return remove(map._inner, bytes32(uint256(uint160(key))));
838
+ }
839
+
840
+ /**
841
+ * @dev Removes all the entries from a map. O(n).
842
+ *
843
+ * WARNING: This function has an unbounded cost that scales with map size. Developers should keep in mind that
844
+ * using it may render the function uncallable if the map grows to the point where clearing it consumes too much
845
+ * gas to fit in a block.
846
+ */
847
+ function clear(AddressToBytes32Map storage map) internal {
848
+ clear(map._inner);
849
+ }
850
+
851
+ /**
852
+ * @dev Returns true if the key is in the map. O(1).
853
+ */
854
+ function contains(AddressToBytes32Map storage map, address key) internal view returns (bool) {
855
+ return contains(map._inner, bytes32(uint256(uint160(key))));
856
+ }
857
+
858
+ /**
859
+ * @dev Returns the number of elements in the map. O(1).
860
+ */
861
+ function length(AddressToBytes32Map storage map) internal view returns (uint256) {
862
+ return length(map._inner);
863
+ }
864
+
865
+ /**
866
+ * @dev Returns the element stored at position `index` in the map. O(1).
867
+ * Note that there are no guarantees on the ordering of values inside the
868
+ * array, and it may change when more values are added or removed.
869
+ *
870
+ * Requirements:
871
+ *
872
+ * - `index` must be strictly less than {length}.
873
+ */
874
+ function at(AddressToBytes32Map storage map, uint256 index) internal view returns (address key, bytes32 value) {
875
+ (bytes32 atKey, bytes32 val) = at(map._inner, index);
876
+ return (address(uint160(uint256(atKey))), val);
877
+ }
878
+
879
+ /**
880
+ * @dev Tries to return the value associated with `key`. O(1).
881
+ * Does not revert if `key` is not in the map.
882
+ */
883
+ function tryGet(AddressToBytes32Map storage map, address key) internal view returns (bool exists, bytes32 value) {
884
+ (bool success, bytes32 val) = tryGet(map._inner, bytes32(uint256(uint160(key))));
885
+ return (success, val);
886
+ }
887
+
888
+ /**
889
+ * @dev Returns the value associated with `key`. O(1).
890
+ *
891
+ * Requirements:
892
+ *
893
+ * - `key` must be in the map.
894
+ */
895
+ function get(AddressToBytes32Map storage map, address key) internal view returns (bytes32) {
896
+ return get(map._inner, bytes32(uint256(uint160(key))));
897
+ }
898
+
899
+ /**
900
+ * @dev Returns an array containing all the keys
901
+ *
902
+ * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
903
+ * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
904
+ * this function has an unbounded cost, and using it as part of a state-changing function may render the function
905
+ * uncallable if the map grows to a point where copying to memory consumes too much gas to fit in a block.
906
+ */
907
+ function keys(AddressToBytes32Map storage map) internal view returns (address[] memory) {
908
+ bytes32[] memory store = keys(map._inner);
909
+ address[] memory result;
910
+
911
+ assembly ("memory-safe") {
912
+ result := store
913
+ }
914
+
915
+ return result;
916
+ }
917
+
918
+ /**
919
+ * @dev Returns an array containing a slice of the keys
920
+ *
921
+ * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
922
+ * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
923
+ * this function has an unbounded cost, and using it as part of a state-changing function may render the function
924
+ * uncallable if the map grows to a point where copying to memory consumes too much gas to fit in a block.
925
+ */
926
+ function keys(
927
+ AddressToBytes32Map storage map,
928
+ uint256 start,
929
+ uint256 end
930
+ ) internal view returns (address[] memory) {
931
+ bytes32[] memory store = keys(map._inner, start, end);
932
+ address[] memory result;
933
+
934
+ assembly ("memory-safe") {
935
+ result := store
936
+ }
937
+
938
+ return result;
939
+ }
940
+
941
+ // Bytes32ToUintMap
942
+
943
+ struct Bytes32ToUintMap {
944
+ Bytes32ToBytes32Map _inner;
945
+ }
946
+
947
+ /**
948
+ * @dev Adds a key-value pair to a map, or updates the value for an existing
949
+ * key. O(1).
950
+ *
951
+ * Returns true if the key was added to the map, that is if it was not
952
+ * already present.
953
+ */
954
+ function set(Bytes32ToUintMap storage map, bytes32 key, uint256 value) internal returns (bool) {
955
+ return set(map._inner, key, bytes32(value));
956
+ }
957
+
958
+ /**
959
+ * @dev Removes a value from a map. O(1).
960
+ *
961
+ * Returns true if the key was removed from the map, that is if it was present.
962
+ */
963
+ function remove(Bytes32ToUintMap storage map, bytes32 key) internal returns (bool) {
964
+ return remove(map._inner, key);
965
+ }
966
+
967
+ /**
968
+ * @dev Removes all the entries from a map. O(n).
969
+ *
970
+ * WARNING: This function has an unbounded cost that scales with map size. Developers should keep in mind that
971
+ * using it may render the function uncallable if the map grows to the point where clearing it consumes too much
972
+ * gas to fit in a block.
973
+ */
974
+ function clear(Bytes32ToUintMap storage map) internal {
975
+ clear(map._inner);
976
+ }
977
+
978
+ /**
979
+ * @dev Returns true if the key is in the map. O(1).
980
+ */
981
+ function contains(Bytes32ToUintMap storage map, bytes32 key) internal view returns (bool) {
982
+ return contains(map._inner, key);
983
+ }
984
+
985
+ /**
986
+ * @dev Returns the number of elements in the map. O(1).
987
+ */
988
+ function length(Bytes32ToUintMap storage map) internal view returns (uint256) {
989
+ return length(map._inner);
990
+ }
991
+
992
+ /**
993
+ * @dev Returns the element stored at position `index` in the map. O(1).
994
+ * Note that there are no guarantees on the ordering of values inside the
995
+ * array, and it may change when more values are added or removed.
996
+ *
997
+ * Requirements:
998
+ *
999
+ * - `index` must be strictly less than {length}.
1000
+ */
1001
+ function at(Bytes32ToUintMap storage map, uint256 index) internal view returns (bytes32 key, uint256 value) {
1002
+ (bytes32 atKey, bytes32 val) = at(map._inner, index);
1003
+ return (atKey, uint256(val));
1004
+ }
1005
+
1006
+ /**
1007
+ * @dev Tries to return the value associated with `key`. O(1).
1008
+ * Does not revert if `key` is not in the map.
1009
+ */
1010
+ function tryGet(Bytes32ToUintMap storage map, bytes32 key) internal view returns (bool exists, uint256 value) {
1011
+ (bool success, bytes32 val) = tryGet(map._inner, key);
1012
+ return (success, uint256(val));
1013
+ }
1014
+
1015
+ /**
1016
+ * @dev Returns the value associated with `key`. O(1).
1017
+ *
1018
+ * Requirements:
1019
+ *
1020
+ * - `key` must be in the map.
1021
+ */
1022
+ function get(Bytes32ToUintMap storage map, bytes32 key) internal view returns (uint256) {
1023
+ return uint256(get(map._inner, key));
1024
+ }
1025
+
1026
+ /**
1027
+ * @dev Returns an array containing all the keys
1028
+ *
1029
+ * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
1030
+ * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
1031
+ * this function has an unbounded cost, and using it as part of a state-changing function may render the function
1032
+ * uncallable if the map grows to a point where copying to memory consumes too much gas to fit in a block.
1033
+ */
1034
+ function keys(Bytes32ToUintMap storage map) internal view returns (bytes32[] memory) {
1035
+ bytes32[] memory store = keys(map._inner);
1036
+ bytes32[] memory result;
1037
+
1038
+ assembly ("memory-safe") {
1039
+ result := store
1040
+ }
1041
+
1042
+ return result;
1043
+ }
1044
+
1045
+ /**
1046
+ * @dev Returns an array containing a slice of the keys
1047
+ *
1048
+ * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
1049
+ * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
1050
+ * this function has an unbounded cost, and using it as part of a state-changing function may render the function
1051
+ * uncallable if the map grows to a point where copying to memory consumes too much gas to fit in a block.
1052
+ */
1053
+ function keys(Bytes32ToUintMap storage map, uint256 start, uint256 end) internal view returns (bytes32[] memory) {
1054
+ bytes32[] memory store = keys(map._inner, start, end);
1055
+ bytes32[] memory result;
1056
+
1057
+ assembly ("memory-safe") {
1058
+ result := store
1059
+ }
1060
+
1061
+ return result;
1062
+ }
1063
+
1064
+ // Bytes32ToAddressMap
1065
+
1066
+ struct Bytes32ToAddressMap {
1067
+ Bytes32ToBytes32Map _inner;
1068
+ }
1069
+
1070
+ /**
1071
+ * @dev Adds a key-value pair to a map, or updates the value for an existing
1072
+ * key. O(1).
1073
+ *
1074
+ * Returns true if the key was added to the map, that is if it was not
1075
+ * already present.
1076
+ */
1077
+ function set(Bytes32ToAddressMap storage map, bytes32 key, address value) internal returns (bool) {
1078
+ return set(map._inner, key, bytes32(uint256(uint160(value))));
1079
+ }
1080
+
1081
+ /**
1082
+ * @dev Removes a value from a map. O(1).
1083
+ *
1084
+ * Returns true if the key was removed from the map, that is if it was present.
1085
+ */
1086
+ function remove(Bytes32ToAddressMap storage map, bytes32 key) internal returns (bool) {
1087
+ return remove(map._inner, key);
1088
+ }
1089
+
1090
+ /**
1091
+ * @dev Removes all the entries from a map. O(n).
1092
+ *
1093
+ * WARNING: This function has an unbounded cost that scales with map size. Developers should keep in mind that
1094
+ * using it may render the function uncallable if the map grows to the point where clearing it consumes too much
1095
+ * gas to fit in a block.
1096
+ */
1097
+ function clear(Bytes32ToAddressMap storage map) internal {
1098
+ clear(map._inner);
1099
+ }
1100
+
1101
+ /**
1102
+ * @dev Returns true if the key is in the map. O(1).
1103
+ */
1104
+ function contains(Bytes32ToAddressMap storage map, bytes32 key) internal view returns (bool) {
1105
+ return contains(map._inner, key);
1106
+ }
1107
+
1108
+ /**
1109
+ * @dev Returns the number of elements in the map. O(1).
1110
+ */
1111
+ function length(Bytes32ToAddressMap storage map) internal view returns (uint256) {
1112
+ return length(map._inner);
1113
+ }
1114
+
1115
+ /**
1116
+ * @dev Returns the element stored at position `index` in the map. O(1).
1117
+ * Note that there are no guarantees on the ordering of values inside the
1118
+ * array, and it may change when more values are added or removed.
1119
+ *
1120
+ * Requirements:
1121
+ *
1122
+ * - `index` must be strictly less than {length}.
1123
+ */
1124
+ function at(Bytes32ToAddressMap storage map, uint256 index) internal view returns (bytes32 key, address value) {
1125
+ (bytes32 atKey, bytes32 val) = at(map._inner, index);
1126
+ return (atKey, address(uint160(uint256(val))));
1127
+ }
1128
+
1129
+ /**
1130
+ * @dev Tries to return the value associated with `key`. O(1).
1131
+ * Does not revert if `key` is not in the map.
1132
+ */
1133
+ function tryGet(Bytes32ToAddressMap storage map, bytes32 key) internal view returns (bool exists, address value) {
1134
+ (bool success, bytes32 val) = tryGet(map._inner, key);
1135
+ return (success, address(uint160(uint256(val))));
1136
+ }
1137
+
1138
+ /**
1139
+ * @dev Returns the value associated with `key`. O(1).
1140
+ *
1141
+ * Requirements:
1142
+ *
1143
+ * - `key` must be in the map.
1144
+ */
1145
+ function get(Bytes32ToAddressMap storage map, bytes32 key) internal view returns (address) {
1146
+ return address(uint160(uint256(get(map._inner, key))));
1147
+ }
1148
+
1149
+ /**
1150
+ * @dev Returns an array containing all the keys
1151
+ *
1152
+ * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
1153
+ * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
1154
+ * this function has an unbounded cost, and using it as part of a state-changing function may render the function
1155
+ * uncallable if the map grows to a point where copying to memory consumes too much gas to fit in a block.
1156
+ */
1157
+ function keys(Bytes32ToAddressMap storage map) internal view returns (bytes32[] memory) {
1158
+ bytes32[] memory store = keys(map._inner);
1159
+ bytes32[] memory result;
1160
+
1161
+ assembly ("memory-safe") {
1162
+ result := store
1163
+ }
1164
+
1165
+ return result;
1166
+ }
1167
+
1168
+ /**
1169
+ * @dev Returns an array containing a slice of the keys
1170
+ *
1171
+ * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
1172
+ * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
1173
+ * this function has an unbounded cost, and using it as part of a state-changing function may render the function
1174
+ * uncallable if the map grows to a point where copying to memory consumes too much gas to fit in a block.
1175
+ */
1176
+ function keys(
1177
+ Bytes32ToAddressMap storage map,
1178
+ uint256 start,
1179
+ uint256 end
1180
+ ) internal view returns (bytes32[] memory) {
1181
+ bytes32[] memory store = keys(map._inner, start, end);
1182
+ bytes32[] memory result;
1183
+
1184
+ assembly ("memory-safe") {
1185
+ result := store
1186
+ }
1187
+
1188
+ return result;
1189
+ }
1190
+
1191
+ // Bytes4ToAddressMap
1192
+
1193
+ struct Bytes4ToAddressMap {
1194
+ Bytes32ToBytes32Map _inner;
1195
+ }
1196
+
1197
+ /**
1198
+ * @dev Adds a key-value pair to a map, or updates the value for an existing
1199
+ * key. O(1).
1200
+ *
1201
+ * Returns true if the key was added to the map, that is if it was not
1202
+ * already present.
1203
+ */
1204
+ function set(Bytes4ToAddressMap storage map, bytes4 key, address value) internal returns (bool) {
1205
+ return set(map._inner, bytes32(key), bytes32(uint256(uint160(value))));
1206
+ }
1207
+
1208
+ /**
1209
+ * @dev Removes a value from a map. O(1).
1210
+ *
1211
+ * Returns true if the key was removed from the map, that is if it was present.
1212
+ */
1213
+ function remove(Bytes4ToAddressMap storage map, bytes4 key) internal returns (bool) {
1214
+ return remove(map._inner, bytes32(key));
1215
+ }
1216
+
1217
+ /**
1218
+ * @dev Removes all the entries from a map. O(n).
1219
+ *
1220
+ * WARNING: This function has an unbounded cost that scales with map size. Developers should keep in mind that
1221
+ * using it may render the function uncallable if the map grows to the point where clearing it consumes too much
1222
+ * gas to fit in a block.
1223
+ */
1224
+ function clear(Bytes4ToAddressMap storage map) internal {
1225
+ clear(map._inner);
1226
+ }
1227
+
1228
+ /**
1229
+ * @dev Returns true if the key is in the map. O(1).
1230
+ */
1231
+ function contains(Bytes4ToAddressMap storage map, bytes4 key) internal view returns (bool) {
1232
+ return contains(map._inner, bytes32(key));
1233
+ }
1234
+
1235
+ /**
1236
+ * @dev Returns the number of elements in the map. O(1).
1237
+ */
1238
+ function length(Bytes4ToAddressMap storage map) internal view returns (uint256) {
1239
+ return length(map._inner);
1240
+ }
1241
+
1242
+ /**
1243
+ * @dev Returns the element stored at position `index` in the map. O(1).
1244
+ * Note that there are no guarantees on the ordering of values inside the
1245
+ * array, and it may change when more values are added or removed.
1246
+ *
1247
+ * Requirements:
1248
+ *
1249
+ * - `index` must be strictly less than {length}.
1250
+ */
1251
+ function at(Bytes4ToAddressMap storage map, uint256 index) internal view returns (bytes4 key, address value) {
1252
+ (bytes32 atKey, bytes32 val) = at(map._inner, index);
1253
+ return (bytes4(atKey), address(uint160(uint256(val))));
1254
+ }
1255
+
1256
+ /**
1257
+ * @dev Tries to return the value associated with `key`. O(1).
1258
+ * Does not revert if `key` is not in the map.
1259
+ */
1260
+ function tryGet(Bytes4ToAddressMap storage map, bytes4 key) internal view returns (bool exists, address value) {
1261
+ (bool success, bytes32 val) = tryGet(map._inner, bytes32(key));
1262
+ return (success, address(uint160(uint256(val))));
1263
+ }
1264
+
1265
+ /**
1266
+ * @dev Returns the value associated with `key`. O(1).
1267
+ *
1268
+ * Requirements:
1269
+ *
1270
+ * - `key` must be in the map.
1271
+ */
1272
+ function get(Bytes4ToAddressMap storage map, bytes4 key) internal view returns (address) {
1273
+ return address(uint160(uint256(get(map._inner, bytes32(key)))));
1274
+ }
1275
+
1276
+ /**
1277
+ * @dev Returns an array containing all the keys
1278
+ *
1279
+ * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
1280
+ * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
1281
+ * this function has an unbounded cost, and using it as part of a state-changing function may render the function
1282
+ * uncallable if the map grows to a point where copying to memory consumes too much gas to fit in a block.
1283
+ */
1284
+ function keys(Bytes4ToAddressMap storage map) internal view returns (bytes4[] memory) {
1285
+ bytes32[] memory store = keys(map._inner);
1286
+ bytes4[] memory result;
1287
+
1288
+ assembly ("memory-safe") {
1289
+ result := store
1290
+ }
1291
+
1292
+ return result;
1293
+ }
1294
+
1295
+ /**
1296
+ * @dev Returns an array containing a slice of the keys
1297
+ *
1298
+ * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
1299
+ * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
1300
+ * this function has an unbounded cost, and using it as part of a state-changing function may render the function
1301
+ * uncallable if the map grows to a point where copying to memory consumes too much gas to fit in a block.
1302
+ */
1303
+ function keys(Bytes4ToAddressMap storage map, uint256 start, uint256 end) internal view returns (bytes4[] memory) {
1304
+ bytes32[] memory store = keys(map._inner, start, end);
1305
+ bytes4[] memory result;
1306
+
1307
+ assembly ("memory-safe") {
1308
+ result := store
1309
+ }
1310
+
1311
+ return result;
1312
+ }
1313
+
1314
+ /**
1315
+ * @dev Query for a nonexistent map key.
1316
+ */
1317
+ error EnumerableMapNonexistentBytesKey(bytes key);
1318
+
1319
+ struct BytesToBytesMap {
1320
+ // Storage of keys
1321
+ EnumerableSet.BytesSet _keys;
1322
+ mapping(bytes key => bytes) _values;
1323
+ }
1324
+
1325
+ /**
1326
+ * @dev Adds a key-value pair to a map, or updates the value for an existing
1327
+ * key. O(1).
1328
+ *
1329
+ * Returns true if the key was added to the map, that is if it was not
1330
+ * already present.
1331
+ */
1332
+ function set(BytesToBytesMap storage map, bytes memory key, bytes memory value) internal returns (bool) {
1333
+ map._values[key] = value;
1334
+ return map._keys.add(key);
1335
+ }
1336
+
1337
+ /**
1338
+ * @dev Removes a key-value pair from a map. O(1).
1339
+ *
1340
+ * Returns true if the key was removed from the map, that is if it was present.
1341
+ */
1342
+ function remove(BytesToBytesMap storage map, bytes memory key) internal returns (bool) {
1343
+ delete map._values[key];
1344
+ return map._keys.remove(key);
1345
+ }
1346
+
1347
+ /**
1348
+ * @dev Removes all the entries from a map. O(n).
1349
+ *
1350
+ * WARNING: Developers should keep in mind that this function has an unbounded cost and using it may render the
1351
+ * function uncallable if the map grows to the point where clearing it consumes too much gas to fit in a block.
1352
+ */
1353
+ function clear(BytesToBytesMap storage map) internal {
1354
+ uint256 len = length(map);
1355
+ for (uint256 i = 0; i < len; ++i) {
1356
+ delete map._values[map._keys.at(i)];
1357
+ }
1358
+ map._keys.clear();
1359
+ }
1360
+
1361
+ /**
1362
+ * @dev Returns true if the key is in the map. O(1).
1363
+ */
1364
+ function contains(BytesToBytesMap storage map, bytes memory key) internal view returns (bool) {
1365
+ return map._keys.contains(key);
1366
+ }
1367
+
1368
+ /**
1369
+ * @dev Returns the number of key-value pairs in the map. O(1).
1370
+ */
1371
+ function length(BytesToBytesMap storage map) internal view returns (uint256) {
1372
+ return map._keys.length();
1373
+ }
1374
+
1375
+ /**
1376
+ * @dev Returns the key-value pair stored at position `index` in the map. O(1).
1377
+ *
1378
+ * Note that there are no guarantees on the ordering of entries inside the
1379
+ * array, and it may change when more entries are added or removed.
1380
+ *
1381
+ * Requirements:
1382
+ *
1383
+ * - `index` must be strictly less than {length}.
1384
+ */
1385
+ function at(
1386
+ BytesToBytesMap storage map,
1387
+ uint256 index
1388
+ ) internal view returns (bytes memory key, bytes memory value) {
1389
+ key = map._keys.at(index);
1390
+ value = map._values[key];
1391
+ }
1392
+
1393
+ /**
1394
+ * @dev Tries to return the value associated with `key`. O(1).
1395
+ * Does not revert if `key` is not in the map.
1396
+ */
1397
+ function tryGet(
1398
+ BytesToBytesMap storage map,
1399
+ bytes memory key
1400
+ ) internal view returns (bool exists, bytes memory value) {
1401
+ value = map._values[key];
1402
+ exists = bytes(value).length != 0 || contains(map, key);
1403
+ }
1404
+
1405
+ /**
1406
+ * @dev Returns the value associated with `key`. O(1).
1407
+ *
1408
+ * Requirements:
1409
+ *
1410
+ * - `key` must be in the map.
1411
+ */
1412
+ function get(BytesToBytesMap storage map, bytes memory key) internal view returns (bytes memory value) {
1413
+ bool exists;
1414
+ (exists, value) = tryGet(map, key);
1415
+ if (!exists) {
1416
+ revert EnumerableMapNonexistentBytesKey(key);
1417
+ }
1418
+ }
1419
+
1420
+ /**
1421
+ * @dev Returns an array containing all the keys
1422
+ *
1423
+ * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
1424
+ * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
1425
+ * this function has an unbounded cost, and using it as part of a state-changing function may render the function
1426
+ * uncallable if the map grows to a point where copying to memory consumes too much gas to fit in a block.
1427
+ */
1428
+ function keys(BytesToBytesMap storage map) internal view returns (bytes[] memory) {
1429
+ return map._keys.values();
1430
+ }
1431
+
1432
+ /**
1433
+ * @dev Returns an array containing a slice of the keys
1434
+ *
1435
+ * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
1436
+ * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
1437
+ * this function has an unbounded cost, and using it as part of a state-changing function may render the function
1438
+ * uncallable if the map grows to a point where copying to memory consumes too much gas to fit in a block.
1439
+ */
1440
+ function keys(BytesToBytesMap storage map, uint256 start, uint256 end) internal view returns (bytes[] memory) {
1441
+ return map._keys.values(start, end);
1442
+ }
1443
+ }