@elizaos/autonomous 2.0.0-alpha.21 → 2.0.0-alpha.23
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.
- package/package.json +14 -6
- package/test/agent-export.e2e.test.ts +376 -0
- package/test/agent-orchestration.e2e.test.ts +1568 -0
- package/test/agent-restart-recovery.e2e.test.ts +149 -0
- package/test/agent-runtime.e2e.test.ts +1515 -0
- package/test/anvil-contracts.e2e.test.ts +533 -0
- package/test/anvil-helper.ts +285 -0
- package/test/api-auth-live.e2e.test.ts +519 -0
- package/test/api-auth.e2e.test.ts +1039 -0
- package/test/api-server.e2e.test.ts +4582 -0
- package/test/apps-e2e.e2e.test.ts +1108 -0
- package/test/auth-modules.e2e.test.ts +71 -0
- package/test/cloud-auth-state.e2e.test.ts +145 -0
- package/test/cloud-persistence.e2e.test.ts +260 -0
- package/test/cloud-providers.e2e.test.ts +781 -0
- package/test/config-hot-reload.e2e.test.ts +131 -0
- package/test/contract-deployer.ts +151 -0
- package/test/contracts/MockMiladyAgentRegistry.sol +216 -0
- package/test/contracts/MockMiladyCollection.sol +195 -0
- package/test/contracts/cache/solidity-files-cache.json +1 -0
- package/test/contracts/foundry.toml +14 -0
- package/test/contracts/lib/openzeppelin-contracts/.changeset/config.json +12 -0
- package/test/contracts/lib/openzeppelin-contracts/.codecov.yml +12 -0
- package/test/contracts/lib/openzeppelin-contracts/.editorconfig +21 -0
- package/test/contracts/lib/openzeppelin-contracts/.eslintrc +20 -0
- package/test/contracts/lib/openzeppelin-contracts/.github/ISSUE_TEMPLATE/bug_report.md +21 -0
- package/test/contracts/lib/openzeppelin-contracts/.github/ISSUE_TEMPLATE/config.yml +4 -0
- package/test/contracts/lib/openzeppelin-contracts/.github/ISSUE_TEMPLATE/feature_request.md +14 -0
- package/test/contracts/lib/openzeppelin-contracts/.github/PULL_REQUEST_TEMPLATE.md +20 -0
- package/test/contracts/lib/openzeppelin-contracts/.github/actions/gas-compare/action.yml +49 -0
- package/test/contracts/lib/openzeppelin-contracts/.github/actions/setup/action.yml +19 -0
- package/test/contracts/lib/openzeppelin-contracts/.github/actions/storage-layout/action.yml +55 -0
- package/test/contracts/lib/openzeppelin-contracts/.github/workflows/actionlint.yml +18 -0
- package/test/contracts/lib/openzeppelin-contracts/.github/workflows/changeset.yml +28 -0
- package/test/contracts/lib/openzeppelin-contracts/.github/workflows/checks.yml +111 -0
- package/test/contracts/lib/openzeppelin-contracts/.github/workflows/docs.yml +19 -0
- package/test/contracts/lib/openzeppelin-contracts/.github/workflows/formal-verification.yml +68 -0
- package/test/contracts/lib/openzeppelin-contracts/.github/workflows/release-cycle.yml +218 -0
- package/test/contracts/lib/openzeppelin-contracts/.github/workflows/upgradeable.yml +30 -0
- package/test/contracts/lib/openzeppelin-contracts/.gitmodules +7 -0
- package/test/contracts/lib/openzeppelin-contracts/.mocharc.js +4 -0
- package/test/contracts/lib/openzeppelin-contracts/.prettierrc +14 -0
- package/test/contracts/lib/openzeppelin-contracts/.solcover.js +13 -0
- package/test/contracts/lib/openzeppelin-contracts/.solhint.json +14 -0
- package/test/contracts/lib/openzeppelin-contracts/CHANGELOG.md +743 -0
- package/test/contracts/lib/openzeppelin-contracts/CODE_OF_CONDUCT.md +73 -0
- package/test/contracts/lib/openzeppelin-contracts/CONTRIBUTING.md +36 -0
- package/test/contracts/lib/openzeppelin-contracts/GUIDELINES.md +117 -0
- package/test/contracts/lib/openzeppelin-contracts/LICENSE +22 -0
- package/test/contracts/lib/openzeppelin-contracts/README.md +90 -0
- package/test/contracts/lib/openzeppelin-contracts/RELEASING.md +47 -0
- package/test/contracts/lib/openzeppelin-contracts/SECURITY.md +42 -0
- package/test/contracts/lib/openzeppelin-contracts/audits/2017-03.md +292 -0
- package/test/contracts/lib/openzeppelin-contracts/audits/2018-10.pdf +0 -0
- package/test/contracts/lib/openzeppelin-contracts/audits/2022-10-Checkpoints.pdf +0 -0
- package/test/contracts/lib/openzeppelin-contracts/audits/2022-10-ERC4626.pdf +0 -0
- package/test/contracts/lib/openzeppelin-contracts/audits/2023-05-v4.9.pdf +0 -0
- package/test/contracts/lib/openzeppelin-contracts/audits/README.md +16 -0
- package/test/contracts/lib/openzeppelin-contracts/certora/Makefile +54 -0
- package/test/contracts/lib/openzeppelin-contracts/certora/README.md +60 -0
- package/test/contracts/lib/openzeppelin-contracts/certora/diff/token_ERC721_ERC721.sol.patch +14 -0
- package/test/contracts/lib/openzeppelin-contracts/certora/harnesses/AccessControlDefaultAdminRulesHarness.sol +47 -0
- package/test/contracts/lib/openzeppelin-contracts/certora/harnesses/AccessControlHarness.sol +7 -0
- package/test/contracts/lib/openzeppelin-contracts/certora/harnesses/DoubleEndedQueueHarness.sol +59 -0
- package/test/contracts/lib/openzeppelin-contracts/certora/harnesses/ERC20FlashMintHarness.sol +36 -0
- package/test/contracts/lib/openzeppelin-contracts/certora/harnesses/ERC20PermitHarness.sol +17 -0
- package/test/contracts/lib/openzeppelin-contracts/certora/harnesses/ERC20WrapperHarness.sol +25 -0
- package/test/contracts/lib/openzeppelin-contracts/certora/harnesses/ERC3156FlashBorrowerHarness.sol +13 -0
- package/test/contracts/lib/openzeppelin-contracts/certora/harnesses/ERC721Harness.sol +37 -0
- package/test/contracts/lib/openzeppelin-contracts/certora/harnesses/ERC721ReceiverHarness.sol +11 -0
- package/test/contracts/lib/openzeppelin-contracts/certora/harnesses/EnumerableMapHarness.sol +55 -0
- package/test/contracts/lib/openzeppelin-contracts/certora/harnesses/EnumerableSetHarness.sol +35 -0
- package/test/contracts/lib/openzeppelin-contracts/certora/harnesses/InitializableHarness.sol +23 -0
- package/test/contracts/lib/openzeppelin-contracts/certora/harnesses/Ownable2StepHarness.sol +9 -0
- package/test/contracts/lib/openzeppelin-contracts/certora/harnesses/OwnableHarness.sol +9 -0
- package/test/contracts/lib/openzeppelin-contracts/certora/harnesses/PausableHarness.sol +19 -0
- package/test/contracts/lib/openzeppelin-contracts/certora/harnesses/TimelockControllerHarness.sol +12 -0
- package/test/contracts/lib/openzeppelin-contracts/certora/reports/2021-10.pdf +0 -0
- package/test/contracts/lib/openzeppelin-contracts/certora/reports/2022-03.pdf +0 -0
- package/test/contracts/lib/openzeppelin-contracts/certora/reports/2022-05.pdf +0 -0
- package/test/contracts/lib/openzeppelin-contracts/certora/run.js +146 -0
- package/test/contracts/lib/openzeppelin-contracts/certora/specs/AccessControl.spec +126 -0
- package/test/contracts/lib/openzeppelin-contracts/certora/specs/AccessControlDefaultAdminRules.spec +500 -0
- package/test/contracts/lib/openzeppelin-contracts/certora/specs/DoubleEndedQueue.spec +366 -0
- package/test/contracts/lib/openzeppelin-contracts/certora/specs/ERC20.spec +414 -0
- package/test/contracts/lib/openzeppelin-contracts/certora/specs/ERC20FlashMint.spec +48 -0
- package/test/contracts/lib/openzeppelin-contracts/certora/specs/ERC20Wrapper.spec +198 -0
- package/test/contracts/lib/openzeppelin-contracts/certora/specs/ERC721.spec +589 -0
- package/test/contracts/lib/openzeppelin-contracts/certora/specs/EnumerableMap.spec +334 -0
- package/test/contracts/lib/openzeppelin-contracts/certora/specs/EnumerableSet.spec +247 -0
- package/test/contracts/lib/openzeppelin-contracts/certora/specs/Initializable.spec +165 -0
- package/test/contracts/lib/openzeppelin-contracts/certora/specs/Ownable.spec +78 -0
- package/test/contracts/lib/openzeppelin-contracts/certora/specs/Ownable2Step.spec +108 -0
- package/test/contracts/lib/openzeppelin-contracts/certora/specs/Pausable.spec +96 -0
- package/test/contracts/lib/openzeppelin-contracts/certora/specs/TimelockController.spec +275 -0
- package/test/contracts/lib/openzeppelin-contracts/certora/specs/helpers/helpers.spec +1 -0
- package/test/contracts/lib/openzeppelin-contracts/certora/specs/methods/IAccessControl.spec +7 -0
- package/test/contracts/lib/openzeppelin-contracts/certora/specs/methods/IAccessControlDefaultAdminRules.spec +36 -0
- package/test/contracts/lib/openzeppelin-contracts/certora/specs/methods/IERC20.spec +11 -0
- package/test/contracts/lib/openzeppelin-contracts/certora/specs/methods/IERC2612.spec +5 -0
- package/test/contracts/lib/openzeppelin-contracts/certora/specs/methods/IERC3156.spec +5 -0
- package/test/contracts/lib/openzeppelin-contracts/certora/specs/methods/IERC5313.spec +3 -0
- package/test/contracts/lib/openzeppelin-contracts/certora/specs/methods/IERC721.spec +20 -0
- package/test/contracts/lib/openzeppelin-contracts/certora/specs/methods/IOwnable.spec +5 -0
- package/test/contracts/lib/openzeppelin-contracts/certora/specs/methods/IOwnable2Step.spec +7 -0
- package/test/contracts/lib/openzeppelin-contracts/certora/specs.json +86 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/access/AccessControl.sol +248 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/access/AccessControlCrossChain.sol +45 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/access/AccessControlDefaultAdminRules.sol +383 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/access/AccessControlEnumerable.sol +64 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/access/IAccessControl.sol +88 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/access/IAccessControlDefaultAdminRules.sol +172 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/access/IAccessControlEnumerable.sol +31 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/access/Ownable.sol +83 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/access/Ownable2Step.sol +57 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/access/README.adoc +27 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/crosschain/CrossChainEnabled.sol +54 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/crosschain/README.adoc +34 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/crosschain/amb/CrossChainEnabledAMB.sol +49 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/crosschain/amb/LibAMB.sol +35 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/crosschain/arbitrum/CrossChainEnabledArbitrumL1.sol +44 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/crosschain/arbitrum/CrossChainEnabledArbitrumL2.sol +40 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/crosschain/arbitrum/LibArbitrumL1.sol +42 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/crosschain/arbitrum/LibArbitrumL2.sol +45 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/crosschain/errors.sol +7 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/crosschain/optimism/CrossChainEnabledOptimism.sol +41 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/crosschain/optimism/LibOptimism.sol +36 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/crosschain/polygon/CrossChainEnabledPolygonChild.sol +72 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/finance/PaymentSplitter.sol +214 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/finance/README.adoc +20 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/finance/VestingWallet.sol +145 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/governance/Governor.sol +723 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/governance/IGovernor.sol +313 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/governance/README.adoc +176 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/governance/TimelockController.sol +422 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/governance/compatibility/GovernorCompatibilityBravo.sol +333 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/governance/compatibility/IGovernorCompatibilityBravo.sol +118 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/governance/extensions/GovernorCountingSimple.sol +100 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/governance/extensions/GovernorPreventLateQuorum.sol +105 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/governance/extensions/GovernorProposalThreshold.sol +23 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/governance/extensions/GovernorSettings.sol +110 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/governance/extensions/GovernorTimelockCompound.sol +190 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/governance/extensions/GovernorTimelockControl.sol +166 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/governance/extensions/GovernorVotes.sol +55 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/governance/extensions/GovernorVotesComp.sol +55 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/governance/extensions/GovernorVotesQuorumFraction.sol +121 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/governance/extensions/IGovernorTimelock.sol +26 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/governance/utils/IVotes.sol +56 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/governance/utils/Votes.sol +244 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/interfaces/IERC1155.sol +6 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/interfaces/IERC1155MetadataURI.sol +6 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/interfaces/IERC1155Receiver.sol +6 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/interfaces/IERC1271.sol +19 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/interfaces/IERC1363.sol +80 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/interfaces/IERC1363Receiver.sol +35 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/interfaces/IERC1363Spender.sol +29 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/interfaces/IERC165.sol +6 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/interfaces/IERC1820Implementer.sol +6 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/interfaces/IERC1820Registry.sol +6 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/interfaces/IERC1967.sol +26 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/interfaces/IERC20.sol +6 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/interfaces/IERC20Metadata.sol +6 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/interfaces/IERC2309.sol +21 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/interfaces/IERC2612.sol +8 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/interfaces/IERC2981.sol +25 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/interfaces/IERC3156.sol +7 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/interfaces/IERC3156FlashBorrower.sol +29 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/interfaces/IERC3156FlashLender.sol +43 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/interfaces/IERC4626.sol +232 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/interfaces/IERC4906.sol +20 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/interfaces/IERC5267.sol +28 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/interfaces/IERC5313.sol +18 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/interfaces/IERC5805.sol +9 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/interfaces/IERC6372.sol +17 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/interfaces/IERC721.sol +6 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/interfaces/IERC721Enumerable.sol +6 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/interfaces/IERC721Metadata.sol +6 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/interfaces/IERC721Receiver.sol +6 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/interfaces/IERC777.sol +6 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/interfaces/IERC777Recipient.sol +6 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/interfaces/IERC777Sender.sol +6 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/interfaces/README.adoc +73 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/interfaces/draft-IERC1822.sol +20 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/interfaces/draft-IERC2612.sol +8 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/metatx/ERC2771Context.sol +54 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/metatx/MinimalForwarder.sol +72 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/metatx/README.adoc +12 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/mocks/AccessControlCrossChainMock.sol +8 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/mocks/ArraysMock.sol +51 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/mocks/Base64Dirty.sol +19 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/mocks/CallReceiverMock.sol +61 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/mocks/ConditionalEscrowMock.sol +18 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/mocks/ContextMock.sol +35 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/mocks/DummyImplementation.sol +57 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/mocks/EIP712Verifier.sol +16 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/mocks/ERC1271WalletMock.sol +26 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/mocks/ERC165/ERC165MaliciousData.sol +12 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/mocks/ERC165/ERC165MissingData.sol +7 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/mocks/ERC165/ERC165NotSupported.sol +5 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/mocks/ERC165/ERC165ReturnBomb.sol +18 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/mocks/ERC20Mock.sol +16 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/mocks/ERC20Reentrant.sol +43 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/mocks/ERC2771ContextMock.sol +27 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/mocks/ERC3156FlashBorrowerMock.sol +53 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/mocks/ERC4626Mock.sol +16 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/mocks/EtherReceiverMock.sol +17 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/mocks/InitializableMock.sol +130 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/mocks/MulticallTest.sol +23 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/mocks/MultipleInheritanceInitializableMocks.sol +131 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/mocks/PausableMock.sol +31 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/mocks/PullPaymentMock.sol +15 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/mocks/ReentrancyAttack.sol +12 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/mocks/ReentrancyMock.sol +51 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/mocks/RegressionImplementation.sol +61 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/mocks/SafeMathMemoryCheck.sol +72 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/mocks/SingleInheritanceInitializableMocks.sol +49 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/mocks/StorageSlotMock.sol +77 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/mocks/TimelockReentrant.sol +26 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/mocks/TimersBlockNumberImpl.sol +39 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/mocks/TimersTimestampImpl.sol +39 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/mocks/VotesMock.sol +45 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/mocks/compound/CompTimelock.sol +174 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/mocks/crosschain/bridges.sol +94 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/mocks/crosschain/receivers.sol +54 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/mocks/docs/ERC4626Fees.sol +100 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/mocks/docs/governance/MyGovernor.sol +88 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/mocks/docs/governance/MyToken.sol +24 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/mocks/docs/governance/MyTokenTimestampBased.sol +35 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/mocks/docs/governance/MyTokenWrapped.sol +31 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/mocks/governance/GovernorCompMock.sol +20 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/mocks/governance/GovernorCompatibilityBravoMock.sol +100 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/mocks/governance/GovernorMock.sol +28 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/mocks/governance/GovernorPreventLateQuorumMock.sol +45 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/mocks/governance/GovernorTimelockCompoundMock.sol +60 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/mocks/governance/GovernorTimelockControlMock.sol +60 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/mocks/governance/GovernorVoteMock.sol +20 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/mocks/governance/GovernorWithParamsMock.sol +50 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/mocks/proxy/BadBeacon.sol +11 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/mocks/proxy/ClashingImplementation.sol +17 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/mocks/proxy/UUPSLegacy.sol +54 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/mocks/proxy/UUPSUpgradeableMock.sol +33 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/mocks/token/ERC1155ReceiverMock.sol +47 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/mocks/token/ERC20DecimalsMock.sol +17 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/mocks/token/ERC20ExcessDecimalsMock.sol +9 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/mocks/token/ERC20FlashMintMock.sol +26 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/mocks/token/ERC20ForceApproveMock.sol +13 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/mocks/token/ERC20MulticallMock.sol +8 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/mocks/token/ERC20NoReturnMock.sol +28 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/mocks/token/ERC20PermitNoRevertMock.sol +36 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/mocks/token/ERC20ReturnFalseMock.sol +19 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/mocks/token/ERC20VotesLegacyMock.sol +262 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/mocks/token/ERC4626OffsetMock.sol +17 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/mocks/token/ERC4646FeesMock.sol +40 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/mocks/token/ERC721ConsecutiveEnumerableMock.sol +51 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/mocks/token/ERC721ConsecutiveMock.sol +61 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/mocks/token/ERC721ReceiverMock.sol +42 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/mocks/token/ERC721URIStorageMock.sol +17 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/mocks/token/ERC777Mock.sol +13 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/mocks/token/ERC777SenderRecipientMock.sol +152 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/mocks/token/VotesTimestamp.sol +40 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/mocks/wizard/MyGovernor1.sol +79 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/mocks/wizard/MyGovernor2.sol +85 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/mocks/wizard/MyGovernor3.sol +94 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/package.json +32 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/proxy/Clones.sol +88 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/proxy/ERC1967/ERC1967Proxy.sol +32 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/proxy/ERC1967/ERC1967Upgrade.sol +157 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/proxy/Proxy.sol +86 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/proxy/README.adoc +87 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/proxy/beacon/BeaconProxy.sol +61 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/proxy/beacon/IBeacon.sol +16 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/proxy/beacon/UpgradeableBeacon.sol +65 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/proxy/transparent/ProxyAdmin.sol +81 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/proxy/transparent/TransparentUpgradeableProxy.sol +191 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/proxy/utils/Initializable.sol +166 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/proxy/utils/UUPSUpgradeable.sol +99 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/security/Pausable.sol +105 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/security/PullPayment.sol +74 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/security/README.adoc +20 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/security/ReentrancyGuard.sol +77 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/token/ERC1155/ERC1155.sol +497 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/token/ERC1155/IERC1155.sol +119 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/token/ERC1155/IERC1155Receiver.sol +58 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/token/ERC1155/README.adoc +49 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/token/ERC1155/extensions/ERC1155Burnable.sol +32 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/token/ERC1155/extensions/ERC1155Pausable.sol +44 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/token/ERC1155/extensions/ERC1155Supply.sol +64 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/token/ERC1155/extensions/ERC1155URIStorage.sol +63 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/token/ERC1155/extensions/IERC1155MetadataURI.sol +22 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/token/ERC1155/presets/ERC1155PresetMinterPauser.sol +114 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/token/ERC1155/presets/README.md +1 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/token/ERC1155/utils/ERC1155Holder.sol +36 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/token/ERC1155/utils/ERC1155Receiver.sol +19 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/token/ERC20/ERC20.sol +365 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/token/ERC20/IERC20.sol +78 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/token/ERC20/README.adoc +80 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/token/ERC20/extensions/ERC20Burnable.sol +39 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/token/ERC20/extensions/ERC20Capped.sol +37 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/token/ERC20/extensions/ERC20FlashMint.sol +109 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/token/ERC20/extensions/ERC20Pausable.sol +35 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/token/ERC20/extensions/ERC20Permit.sol +95 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/token/ERC20/extensions/ERC20Snapshot.sol +191 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/token/ERC20/extensions/ERC20Votes.sol +290 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/token/ERC20/extensions/ERC20VotesComp.sol +46 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/token/ERC20/extensions/ERC20Wrapper.sol +73 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/token/ERC20/extensions/ERC4626.sol +256 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/token/ERC20/extensions/IERC20Metadata.sol +28 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/token/ERC20/extensions/IERC20Permit.sol +90 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/token/ERC20/extensions/draft-ERC20Permit.sol +8 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/token/ERC20/extensions/draft-IERC20Permit.sol +8 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/token/ERC20/presets/ERC20PresetFixedSupply.sol +30 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/token/ERC20/presets/ERC20PresetMinterPauser.sol +94 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/token/ERC20/presets/README.md +1 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/token/ERC20/utils/SafeERC20.sol +143 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/token/ERC20/utils/TokenTimelock.sol +72 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/token/ERC721/ERC721.sol +466 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/token/ERC721/IERC721.sol +132 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/token/ERC721/IERC721Receiver.sol +27 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/token/ERC721/README.adoc +73 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/token/ERC721/extensions/ERC721Burnable.sol +26 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/token/ERC721/extensions/ERC721Consecutive.sol +148 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/token/ERC721/extensions/ERC721Enumerable.sol +159 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/token/ERC721/extensions/ERC721Pausable.sol +40 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/token/ERC721/extensions/ERC721Royalty.sol +38 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/token/ERC721/extensions/ERC721URIStorage.sol +74 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/token/ERC721/extensions/ERC721Votes.sol +43 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/token/ERC721/extensions/ERC721Wrapper.sol +97 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/token/ERC721/extensions/IERC721Enumerable.sol +29 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/token/ERC721/extensions/IERC721Metadata.sol +27 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/token/ERC721/extensions/draft-ERC721Votes.sol +9 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/token/ERC721/presets/ERC721PresetMinterPauserAutoId.sol +132 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/token/ERC721/presets/README.md +1 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/token/ERC721/utils/ERC721Holder.sol +23 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/token/ERC777/ERC777.sol +514 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/token/ERC777/IERC777.sol +200 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/token/ERC777/IERC777Recipient.sol +35 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/token/ERC777/IERC777Sender.sol +35 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/token/ERC777/README.adoc +32 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/token/ERC777/presets/ERC777PresetFixedSupply.sol +30 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/token/common/ERC2981.sol +107 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/token/common/README.adoc +10 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/utils/Address.sol +244 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/utils/Arrays.sol +105 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/utils/Base64.sol +101 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/utils/Checkpoints.sol +560 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/utils/Context.sol +28 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/utils/Counters.sol +43 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/utils/Create2.sol +75 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/utils/Multicall.sol +39 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/utils/README.adoc +113 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/utils/ShortStrings.sol +122 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/utils/StorageSlot.sol +138 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/utils/Strings.sol +85 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/utils/Timers.sol +75 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/utils/cryptography/ECDSA.sol +217 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/utils/cryptography/EIP712.sol +142 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/utils/cryptography/MerkleProof.sol +227 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/utils/cryptography/SignatureChecker.sol +50 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/utils/cryptography/draft-EIP712.sol +8 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/utils/escrow/ConditionalEscrow.sol +25 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/utils/escrow/Escrow.sol +67 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/utils/escrow/RefundEscrow.sol +100 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/utils/introspection/ERC165.sol +29 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/utils/introspection/ERC165Checker.sol +126 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/utils/introspection/ERC165Storage.sol +42 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/utils/introspection/ERC1820Implementer.sol +43 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/utils/introspection/IERC165.sol +25 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/utils/introspection/IERC1820Implementer.sol +20 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/utils/introspection/IERC1820Registry.sol +112 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/utils/math/Math.sol +339 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/utils/math/SafeCast.sol +1136 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/utils/math/SafeMath.sol +215 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/utils/math/SignedMath.sol +43 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/utils/math/SignedSafeMath.sol +68 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/utils/structs/BitMaps.sol +51 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/utils/structs/DoubleEndedQueue.sol +170 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/utils/structs/EnumerableMap.sol +598 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/utils/structs/EnumerableSet.sol +378 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/vendor/amb/IAMB.sol +41 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/vendor/arbitrum/IArbSys.sol +134 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/vendor/arbitrum/IBridge.sol +102 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/vendor/arbitrum/IDelayedMessageProvider.sol +16 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/vendor/arbitrum/IInbox.sol +152 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/vendor/arbitrum/IOutbox.sol +117 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/vendor/compound/ICompoundTimelock.sol +86 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/vendor/compound/LICENSE +11 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/vendor/optimism/ICrossDomainMessenger.sol +34 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/vendor/optimism/LICENSE +22 -0
- package/test/contracts/lib/openzeppelin-contracts/contracts/vendor/polygon/IFxMessageProcessor.sol +7 -0
- package/test/contracts/lib/openzeppelin-contracts/docs/README.md +16 -0
- package/test/contracts/lib/openzeppelin-contracts/docs/antora.yml +6 -0
- package/test/contracts/lib/openzeppelin-contracts/docs/config.js +21 -0
- package/test/contracts/lib/openzeppelin-contracts/docs/modules/ROOT/images/erc4626-attack-3a.png +0 -0
- package/test/contracts/lib/openzeppelin-contracts/docs/modules/ROOT/images/erc4626-attack-3b.png +0 -0
- package/test/contracts/lib/openzeppelin-contracts/docs/modules/ROOT/images/erc4626-attack-6.png +0 -0
- package/test/contracts/lib/openzeppelin-contracts/docs/modules/ROOT/images/erc4626-attack.png +0 -0
- package/test/contracts/lib/openzeppelin-contracts/docs/modules/ROOT/images/erc4626-deposit.png +0 -0
- package/test/contracts/lib/openzeppelin-contracts/docs/modules/ROOT/images/erc4626-mint.png +0 -0
- package/test/contracts/lib/openzeppelin-contracts/docs/modules/ROOT/images/erc4626-rate-linear.png +0 -0
- package/test/contracts/lib/openzeppelin-contracts/docs/modules/ROOT/images/erc4626-rate-loglog.png +0 -0
- package/test/contracts/lib/openzeppelin-contracts/docs/modules/ROOT/images/erc4626-rate-loglogext.png +0 -0
- package/test/contracts/lib/openzeppelin-contracts/docs/modules/ROOT/images/tally-exec.png +0 -0
- package/test/contracts/lib/openzeppelin-contracts/docs/modules/ROOT/images/tally-vote.png +0 -0
- package/test/contracts/lib/openzeppelin-contracts/docs/modules/ROOT/nav.adoc +23 -0
- package/test/contracts/lib/openzeppelin-contracts/docs/modules/ROOT/pages/access-control.adoc +219 -0
- package/test/contracts/lib/openzeppelin-contracts/docs/modules/ROOT/pages/crosschain.adoc +210 -0
- package/test/contracts/lib/openzeppelin-contracts/docs/modules/ROOT/pages/crowdsales.adoc +11 -0
- package/test/contracts/lib/openzeppelin-contracts/docs/modules/ROOT/pages/drafts.adoc +19 -0
- package/test/contracts/lib/openzeppelin-contracts/docs/modules/ROOT/pages/erc1155.adoc +153 -0
- package/test/contracts/lib/openzeppelin-contracts/docs/modules/ROOT/pages/erc20-supply.adoc +113 -0
- package/test/contracts/lib/openzeppelin-contracts/docs/modules/ROOT/pages/erc20.adoc +85 -0
- package/test/contracts/lib/openzeppelin-contracts/docs/modules/ROOT/pages/erc4626.adoc +214 -0
- package/test/contracts/lib/openzeppelin-contracts/docs/modules/ROOT/pages/erc721.adoc +90 -0
- package/test/contracts/lib/openzeppelin-contracts/docs/modules/ROOT/pages/erc777.adoc +75 -0
- package/test/contracts/lib/openzeppelin-contracts/docs/modules/ROOT/pages/extending-contracts.adoc +131 -0
- package/test/contracts/lib/openzeppelin-contracts/docs/modules/ROOT/pages/governance.adoc +237 -0
- package/test/contracts/lib/openzeppelin-contracts/docs/modules/ROOT/pages/index.adoc +65 -0
- package/test/contracts/lib/openzeppelin-contracts/docs/modules/ROOT/pages/releases-stability.adoc +85 -0
- package/test/contracts/lib/openzeppelin-contracts/docs/modules/ROOT/pages/tokens.adoc +32 -0
- package/test/contracts/lib/openzeppelin-contracts/docs/modules/ROOT/pages/upgradeable.adoc +73 -0
- package/test/contracts/lib/openzeppelin-contracts/docs/modules/ROOT/pages/utilities.adoc +190 -0
- package/test/contracts/lib/openzeppelin-contracts/docs/templates/contract.hbs +85 -0
- package/test/contracts/lib/openzeppelin-contracts/docs/templates/helpers.js +46 -0
- package/test/contracts/lib/openzeppelin-contracts/docs/templates/page.hbs +4 -0
- package/test/contracts/lib/openzeppelin-contracts/docs/templates/properties.js +45 -0
- package/test/contracts/lib/openzeppelin-contracts/foundry.toml +3 -0
- package/test/contracts/lib/openzeppelin-contracts/hardhat/env-artifacts.js +24 -0
- package/test/contracts/lib/openzeppelin-contracts/hardhat/env-contract.js +10 -0
- package/test/contracts/lib/openzeppelin-contracts/hardhat/ignore-unreachable-warnings.js +45 -0
- package/test/contracts/lib/openzeppelin-contracts/hardhat/skip-foundry-tests.js +6 -0
- package/test/contracts/lib/openzeppelin-contracts/hardhat/task-test-get-files.js +25 -0
- package/test/contracts/lib/openzeppelin-contracts/hardhat.config.js +118 -0
- package/test/contracts/lib/openzeppelin-contracts/lib/erc4626-tests/ERC4626.prop.sol +404 -0
- package/test/contracts/lib/openzeppelin-contracts/lib/erc4626-tests/ERC4626.test.sol +349 -0
- package/test/contracts/lib/openzeppelin-contracts/lib/erc4626-tests/LICENSE +661 -0
- package/test/contracts/lib/openzeppelin-contracts/lib/erc4626-tests/README.md +116 -0
- package/test/contracts/lib/openzeppelin-contracts/lib/forge-std/.github/workflows/ci.yml +92 -0
- package/test/contracts/lib/openzeppelin-contracts/lib/forge-std/.gitmodules +3 -0
- package/test/contracts/lib/openzeppelin-contracts/lib/forge-std/LICENSE-APACHE +203 -0
- package/test/contracts/lib/openzeppelin-contracts/lib/forge-std/LICENSE-MIT +25 -0
- package/test/contracts/lib/openzeppelin-contracts/lib/forge-std/README.md +250 -0
- package/test/contracts/lib/openzeppelin-contracts/lib/forge-std/foundry.toml +21 -0
- package/test/contracts/lib/openzeppelin-contracts/lib/forge-std/lib/ds-test/.github/workflows/build.yml +41 -0
- package/test/contracts/lib/openzeppelin-contracts/lib/forge-std/lib/ds-test/LICENSE +674 -0
- package/test/contracts/lib/openzeppelin-contracts/lib/forge-std/lib/ds-test/Makefile +14 -0
- package/test/contracts/lib/openzeppelin-contracts/lib/forge-std/lib/ds-test/default.nix +4 -0
- package/test/contracts/lib/openzeppelin-contracts/lib/forge-std/lib/ds-test/demo/demo.sol +222 -0
- package/test/contracts/lib/openzeppelin-contracts/lib/forge-std/lib/ds-test/package.json +15 -0
- package/test/contracts/lib/openzeppelin-contracts/lib/forge-std/lib/ds-test/src/test.sol +469 -0
- package/test/contracts/lib/openzeppelin-contracts/lib/forge-std/lib/ds-test/src/test.t.sol +313 -0
- package/test/contracts/lib/openzeppelin-contracts/lib/forge-std/package.json +16 -0
- package/test/contracts/lib/openzeppelin-contracts/lib/forge-std/src/Base.sol +33 -0
- package/test/contracts/lib/openzeppelin-contracts/lib/forge-std/src/Script.sol +26 -0
- package/test/contracts/lib/openzeppelin-contracts/lib/forge-std/src/StdAssertions.sol +376 -0
- package/test/contracts/lib/openzeppelin-contracts/lib/forge-std/src/StdChains.sol +233 -0
- package/test/contracts/lib/openzeppelin-contracts/lib/forge-std/src/StdCheats.sol +624 -0
- package/test/contracts/lib/openzeppelin-contracts/lib/forge-std/src/StdError.sol +15 -0
- package/test/contracts/lib/openzeppelin-contracts/lib/forge-std/src/StdInvariant.sol +92 -0
- package/test/contracts/lib/openzeppelin-contracts/lib/forge-std/src/StdJson.sol +179 -0
- package/test/contracts/lib/openzeppelin-contracts/lib/forge-std/src/StdMath.sol +43 -0
- package/test/contracts/lib/openzeppelin-contracts/lib/forge-std/src/StdStorage.sol +327 -0
- package/test/contracts/lib/openzeppelin-contracts/lib/forge-std/src/StdStyle.sol +333 -0
- package/test/contracts/lib/openzeppelin-contracts/lib/forge-std/src/StdUtils.sol +189 -0
- package/test/contracts/lib/openzeppelin-contracts/lib/forge-std/src/Test.sol +32 -0
- package/test/contracts/lib/openzeppelin-contracts/lib/forge-std/src/Vm.sol +409 -0
- package/test/contracts/lib/openzeppelin-contracts/lib/forge-std/src/console.sol +1533 -0
- package/test/contracts/lib/openzeppelin-contracts/lib/forge-std/src/console2.sol +1546 -0
- package/test/contracts/lib/openzeppelin-contracts/lib/forge-std/src/interfaces/IERC1155.sol +105 -0
- package/test/contracts/lib/openzeppelin-contracts/lib/forge-std/src/interfaces/IERC165.sol +12 -0
- package/test/contracts/lib/openzeppelin-contracts/lib/forge-std/src/interfaces/IERC20.sol +43 -0
- package/test/contracts/lib/openzeppelin-contracts/lib/forge-std/src/interfaces/IERC4626.sol +190 -0
- package/test/contracts/lib/openzeppelin-contracts/lib/forge-std/src/interfaces/IERC721.sol +164 -0
- package/test/contracts/lib/openzeppelin-contracts/lib/forge-std/src/interfaces/IMulticall3.sol +73 -0
- package/test/contracts/lib/openzeppelin-contracts/lib/forge-std/test/StdAssertions.t.sol +954 -0
- package/test/contracts/lib/openzeppelin-contracts/lib/forge-std/test/StdChains.t.sol +160 -0
- package/test/contracts/lib/openzeppelin-contracts/lib/forge-std/test/StdCheats.t.sol +401 -0
- package/test/contracts/lib/openzeppelin-contracts/lib/forge-std/test/StdError.t.sol +118 -0
- package/test/contracts/lib/openzeppelin-contracts/lib/forge-std/test/StdMath.t.sol +197 -0
- package/test/contracts/lib/openzeppelin-contracts/lib/forge-std/test/StdStorage.t.sol +283 -0
- package/test/contracts/lib/openzeppelin-contracts/lib/forge-std/test/StdStyle.t.sol +110 -0
- package/test/contracts/lib/openzeppelin-contracts/lib/forge-std/test/StdUtils.t.sol +297 -0
- package/test/contracts/lib/openzeppelin-contracts/lib/forge-std/test/compilation/CompilationScript.sol +10 -0
- package/test/contracts/lib/openzeppelin-contracts/lib/forge-std/test/compilation/CompilationScriptBase.sol +10 -0
- package/test/contracts/lib/openzeppelin-contracts/lib/forge-std/test/compilation/CompilationTest.sol +10 -0
- package/test/contracts/lib/openzeppelin-contracts/lib/forge-std/test/compilation/CompilationTestBase.sol +10 -0
- package/test/contracts/lib/openzeppelin-contracts/lib/forge-std/test/fixtures/broadcast.log.json +187 -0
- package/test/contracts/lib/openzeppelin-contracts/logo.svg +15 -0
- package/test/contracts/lib/openzeppelin-contracts/netlify.toml +3 -0
- package/test/contracts/lib/openzeppelin-contracts/package-lock.json +28833 -0
- package/test/contracts/lib/openzeppelin-contracts/package.json +96 -0
- package/test/contracts/lib/openzeppelin-contracts/remappings.txt +1 -0
- package/test/contracts/lib/openzeppelin-contracts/renovate.json +4 -0
- package/test/contracts/lib/openzeppelin-contracts/requirements.txt +1 -0
- package/test/contracts/lib/openzeppelin-contracts/scripts/checks/compare-layout.js +19 -0
- package/test/contracts/lib/openzeppelin-contracts/scripts/checks/compareGasReports.js +243 -0
- package/test/contracts/lib/openzeppelin-contracts/scripts/checks/extract-layout.js +40 -0
- package/test/contracts/lib/openzeppelin-contracts/scripts/checks/generation.sh +6 -0
- package/test/contracts/lib/openzeppelin-contracts/scripts/checks/inheritance-ordering.js +54 -0
- package/test/contracts/lib/openzeppelin-contracts/scripts/gen-nav.js +41 -0
- package/test/contracts/lib/openzeppelin-contracts/scripts/generate/format-lines.js +16 -0
- package/test/contracts/lib/openzeppelin-contracts/scripts/generate/run.js +49 -0
- package/test/contracts/lib/openzeppelin-contracts/scripts/generate/templates/Checkpoints.js +304 -0
- package/test/contracts/lib/openzeppelin-contracts/scripts/generate/templates/Checkpoints.opts.js +22 -0
- package/test/contracts/lib/openzeppelin-contracts/scripts/generate/templates/Checkpoints.t.js +256 -0
- package/test/contracts/lib/openzeppelin-contracts/scripts/generate/templates/EnumerableMap.js +310 -0
- package/test/contracts/lib/openzeppelin-contracts/scripts/generate/templates/EnumerableSet.js +250 -0
- package/test/contracts/lib/openzeppelin-contracts/scripts/generate/templates/SafeCast.js +163 -0
- package/test/contracts/lib/openzeppelin-contracts/scripts/generate/templates/StorageSlot.js +87 -0
- package/test/contracts/lib/openzeppelin-contracts/scripts/generate/templates/conversion.js +30 -0
- package/test/contracts/lib/openzeppelin-contracts/scripts/git-user-config.sh +6 -0
- package/test/contracts/lib/openzeppelin-contracts/scripts/helpers.js +37 -0
- package/test/contracts/lib/openzeppelin-contracts/scripts/migrate-imports.js +180 -0
- package/test/contracts/lib/openzeppelin-contracts/scripts/prepack.sh +12 -0
- package/test/contracts/lib/openzeppelin-contracts/scripts/prepare-contracts-package.sh +15 -0
- package/test/contracts/lib/openzeppelin-contracts/scripts/prepare-docs.sh +26 -0
- package/test/contracts/lib/openzeppelin-contracts/scripts/prepare.sh +10 -0
- package/test/contracts/lib/openzeppelin-contracts/scripts/release/format-changelog.js +33 -0
- package/test/contracts/lib/openzeppelin-contracts/scripts/release/synchronize-versions.js +15 -0
- package/test/contracts/lib/openzeppelin-contracts/scripts/release/update-comment.js +34 -0
- package/test/contracts/lib/openzeppelin-contracts/scripts/release/version.sh +11 -0
- package/test/contracts/lib/openzeppelin-contracts/scripts/release/workflow/exit-prerelease.sh +8 -0
- package/test/contracts/lib/openzeppelin-contracts/scripts/release/workflow/github-release.js +47 -0
- package/test/contracts/lib/openzeppelin-contracts/scripts/release/workflow/integrity-check.sh +20 -0
- package/test/contracts/lib/openzeppelin-contracts/scripts/release/workflow/pack.sh +26 -0
- package/test/contracts/lib/openzeppelin-contracts/scripts/release/workflow/publish.sh +26 -0
- package/test/contracts/lib/openzeppelin-contracts/scripts/release/workflow/rerun.js +7 -0
- package/test/contracts/lib/openzeppelin-contracts/scripts/release/workflow/set-changesets-pr-title.js +17 -0
- package/test/contracts/lib/openzeppelin-contracts/scripts/release/workflow/start.sh +35 -0
- package/test/contracts/lib/openzeppelin-contracts/scripts/release/workflow/state.js +112 -0
- package/test/contracts/lib/openzeppelin-contracts/scripts/remove-ignored-artifacts.js +45 -0
- package/test/contracts/lib/openzeppelin-contracts/scripts/update-docs-branch.js +63 -0
- package/test/contracts/lib/openzeppelin-contracts/scripts/upgradeable/README.md +21 -0
- package/test/contracts/lib/openzeppelin-contracts/scripts/upgradeable/patch-apply.sh +19 -0
- package/test/contracts/lib/openzeppelin-contracts/scripts/upgradeable/patch-save.sh +18 -0
- package/test/contracts/lib/openzeppelin-contracts/scripts/upgradeable/transpile-onto.sh +44 -0
- package/test/contracts/lib/openzeppelin-contracts/scripts/upgradeable/transpile.sh +35 -0
- package/test/contracts/lib/openzeppelin-contracts/scripts/upgradeable/upgradeable.patch +481 -0
- package/test/contracts/lib/openzeppelin-contracts/slither.config.json +5 -0
- package/test/contracts/lib/openzeppelin-contracts/test/TESTING.md +3 -0
- package/test/contracts/lib/openzeppelin-contracts/test/access/AccessControl.behavior.js +867 -0
- package/test/contracts/lib/openzeppelin-contracts/test/access/AccessControl.test.js +12 -0
- package/test/contracts/lib/openzeppelin-contracts/test/access/AccessControlCrossChain.test.js +49 -0
- package/test/contracts/lib/openzeppelin-contracts/test/access/AccessControlDefaultAdminRules.test.js +25 -0
- package/test/contracts/lib/openzeppelin-contracts/test/access/AccessControlEnumerable.test.js +17 -0
- package/test/contracts/lib/openzeppelin-contracts/test/access/Ownable.test.js +59 -0
- package/test/contracts/lib/openzeppelin-contracts/test/access/Ownable2Step.test.js +67 -0
- package/test/contracts/lib/openzeppelin-contracts/test/crosschain/CrossChainEnabled.test.js +78 -0
- package/test/contracts/lib/openzeppelin-contracts/test/finance/PaymentSplitter.test.js +217 -0
- package/test/contracts/lib/openzeppelin-contracts/test/finance/VestingWallet.behavior.js +59 -0
- package/test/contracts/lib/openzeppelin-contracts/test/finance/VestingWallet.test.js +67 -0
- package/test/contracts/lib/openzeppelin-contracts/test/governance/Governor.t.sol +55 -0
- package/test/contracts/lib/openzeppelin-contracts/test/governance/Governor.test.js +782 -0
- package/test/contracts/lib/openzeppelin-contracts/test/governance/TimelockController.test.js +1254 -0
- package/test/contracts/lib/openzeppelin-contracts/test/governance/compatibility/GovernorCompatibilityBravo.test.js +283 -0
- package/test/contracts/lib/openzeppelin-contracts/test/governance/extensions/GovernorComp.test.js +88 -0
- package/test/contracts/lib/openzeppelin-contracts/test/governance/extensions/GovernorERC721.test.js +115 -0
- package/test/contracts/lib/openzeppelin-contracts/test/governance/extensions/GovernorPreventLateQuorum.test.js +189 -0
- package/test/contracts/lib/openzeppelin-contracts/test/governance/extensions/GovernorTimelockCompound.test.js +352 -0
- package/test/contracts/lib/openzeppelin-contracts/test/governance/extensions/GovernorTimelockControl.test.js +445 -0
- package/test/contracts/lib/openzeppelin-contracts/test/governance/extensions/GovernorVotesQuorumFraction.test.js +154 -0
- package/test/contracts/lib/openzeppelin-contracts/test/governance/extensions/GovernorWithParams.test.js +173 -0
- package/test/contracts/lib/openzeppelin-contracts/test/governance/utils/EIP6372.behavior.js +23 -0
- package/test/contracts/lib/openzeppelin-contracts/test/governance/utils/Votes.behavior.js +361 -0
- package/test/contracts/lib/openzeppelin-contracts/test/governance/utils/Votes.test.js +71 -0
- package/test/contracts/lib/openzeppelin-contracts/test/helpers/chainid.js +10 -0
- package/test/contracts/lib/openzeppelin-contracts/test/helpers/create2.js +11 -0
- package/test/contracts/lib/openzeppelin-contracts/test/helpers/crosschain.js +61 -0
- package/test/contracts/lib/openzeppelin-contracts/test/helpers/customError.js +24 -0
- package/test/contracts/lib/openzeppelin-contracts/test/helpers/eip712.js +67 -0
- package/test/contracts/lib/openzeppelin-contracts/test/helpers/enums.js +12 -0
- package/test/contracts/lib/openzeppelin-contracts/test/helpers/erc1967.js +24 -0
- package/test/contracts/lib/openzeppelin-contracts/test/helpers/governance.js +201 -0
- package/test/contracts/lib/openzeppelin-contracts/test/helpers/map-values.js +7 -0
- package/test/contracts/lib/openzeppelin-contracts/test/helpers/sign.js +63 -0
- package/test/contracts/lib/openzeppelin-contracts/test/helpers/time.js +17 -0
- package/test/contracts/lib/openzeppelin-contracts/test/helpers/txpool.js +38 -0
- package/test/contracts/lib/openzeppelin-contracts/test/metatx/ERC2771Context.test.js +175 -0
- package/test/contracts/lib/openzeppelin-contracts/test/metatx/MinimalForwarder.test.js +169 -0
- package/test/contracts/lib/openzeppelin-contracts/test/migrate-imports.test.js +33 -0
- package/test/contracts/lib/openzeppelin-contracts/test/proxy/Clones.behaviour.js +136 -0
- package/test/contracts/lib/openzeppelin-contracts/test/proxy/Clones.test.js +61 -0
- package/test/contracts/lib/openzeppelin-contracts/test/proxy/ERC1967/ERC1967Proxy.test.js +13 -0
- package/test/contracts/lib/openzeppelin-contracts/test/proxy/Proxy.behaviour.js +225 -0
- package/test/contracts/lib/openzeppelin-contracts/test/proxy/beacon/BeaconProxy.test.js +139 -0
- package/test/contracts/lib/openzeppelin-contracts/test/proxy/beacon/UpgradeableBeacon.test.js +44 -0
- package/test/contracts/lib/openzeppelin-contracts/test/proxy/transparent/ProxyAdmin.test.js +127 -0
- package/test/contracts/lib/openzeppelin-contracts/test/proxy/transparent/TransparentUpgradeableProxy.behaviour.js +433 -0
- package/test/contracts/lib/openzeppelin-contracts/test/proxy/transparent/TransparentUpgradeableProxy.test.js +17 -0
- package/test/contracts/lib/openzeppelin-contracts/test/proxy/utils/Initializable.test.js +218 -0
- package/test/contracts/lib/openzeppelin-contracts/test/proxy/utils/UUPSUpgradeable.test.js +85 -0
- package/test/contracts/lib/openzeppelin-contracts/test/security/Pausable.test.js +85 -0
- package/test/contracts/lib/openzeppelin-contracts/test/security/PullPayment.test.js +51 -0
- package/test/contracts/lib/openzeppelin-contracts/test/security/ReentrancyGuard.test.js +43 -0
- package/test/contracts/lib/openzeppelin-contracts/test/token/ERC1155/ERC1155.behavior.js +767 -0
- package/test/contracts/lib/openzeppelin-contracts/test/token/ERC1155/ERC1155.test.js +235 -0
- package/test/contracts/lib/openzeppelin-contracts/test/token/ERC1155/extensions/ERC1155Burnable.test.js +67 -0
- package/test/contracts/lib/openzeppelin-contracts/test/token/ERC1155/extensions/ERC1155Pausable.test.js +108 -0
- package/test/contracts/lib/openzeppelin-contracts/test/token/ERC1155/extensions/ERC1155Supply.test.js +107 -0
- package/test/contracts/lib/openzeppelin-contracts/test/token/ERC1155/extensions/ERC1155URIStorage.test.js +66 -0
- package/test/contracts/lib/openzeppelin-contracts/test/token/ERC1155/presets/ERC1155PresetMinterPauser.test.js +156 -0
- package/test/contracts/lib/openzeppelin-contracts/test/token/ERC1155/utils/ERC1155Holder.test.js +64 -0
- package/test/contracts/lib/openzeppelin-contracts/test/token/ERC20/ERC20.behavior.js +322 -0
- package/test/contracts/lib/openzeppelin-contracts/test/token/ERC20/ERC20.test.js +305 -0
- package/test/contracts/lib/openzeppelin-contracts/test/token/ERC20/extensions/ERC20Burnable.behavior.js +106 -0
- package/test/contracts/lib/openzeppelin-contracts/test/token/ERC20/extensions/ERC20Burnable.test.js +20 -0
- package/test/contracts/lib/openzeppelin-contracts/test/token/ERC20/extensions/ERC20Capped.behavior.js +32 -0
- package/test/contracts/lib/openzeppelin-contracts/test/token/ERC20/extensions/ERC20Capped.test.js +23 -0
- package/test/contracts/lib/openzeppelin-contracts/test/token/ERC20/extensions/ERC20FlashMint.test.js +204 -0
- package/test/contracts/lib/openzeppelin-contracts/test/token/ERC20/extensions/ERC20Pausable.test.js +133 -0
- package/test/contracts/lib/openzeppelin-contracts/test/token/ERC20/extensions/ERC20Snapshot.test.js +207 -0
- package/test/contracts/lib/openzeppelin-contracts/test/token/ERC20/extensions/ERC20Votes.test.js +578 -0
- package/test/contracts/lib/openzeppelin-contracts/test/token/ERC20/extensions/ERC20VotesComp.test.js +543 -0
- package/test/contracts/lib/openzeppelin-contracts/test/token/ERC20/extensions/ERC20Wrapper.test.js +190 -0
- package/test/contracts/lib/openzeppelin-contracts/test/token/ERC20/extensions/ERC4626.t.sol +42 -0
- package/test/contracts/lib/openzeppelin-contracts/test/token/ERC20/extensions/ERC4626.test.js +1031 -0
- package/test/contracts/lib/openzeppelin-contracts/test/token/ERC20/extensions/draft-ERC20Permit.test.js +103 -0
- package/test/contracts/lib/openzeppelin-contracts/test/token/ERC20/presets/ERC20PresetFixedSupply.test.js +42 -0
- package/test/contracts/lib/openzeppelin-contracts/test/token/ERC20/presets/ERC20PresetMinterPauser.test.js +110 -0
- package/test/contracts/lib/openzeppelin-contracts/test/token/ERC20/utils/SafeERC20.test.js +350 -0
- package/test/contracts/lib/openzeppelin-contracts/test/token/ERC20/utils/TokenTimelock.test.js +71 -0
- package/test/contracts/lib/openzeppelin-contracts/test/token/ERC721/ERC721.behavior.js +893 -0
- package/test/contracts/lib/openzeppelin-contracts/test/token/ERC721/ERC721.test.js +15 -0
- package/test/contracts/lib/openzeppelin-contracts/test/token/ERC721/ERC721Enumerable.test.js +20 -0
- package/test/contracts/lib/openzeppelin-contracts/test/token/ERC721/extensions/ERC721Burnable.test.js +70 -0
- package/test/contracts/lib/openzeppelin-contracts/test/token/ERC721/extensions/ERC721Consecutive.t.sol +122 -0
- package/test/contracts/lib/openzeppelin-contracts/test/token/ERC721/extensions/ERC721Consecutive.test.js +206 -0
- package/test/contracts/lib/openzeppelin-contracts/test/token/ERC721/extensions/ERC721Pausable.test.js +92 -0
- package/test/contracts/lib/openzeppelin-contracts/test/token/ERC721/extensions/ERC721Royalty.test.js +41 -0
- package/test/contracts/lib/openzeppelin-contracts/test/token/ERC721/extensions/ERC721URIStorage.test.js +100 -0
- package/test/contracts/lib/openzeppelin-contracts/test/token/ERC721/extensions/ERC721Votes.test.js +184 -0
- package/test/contracts/lib/openzeppelin-contracts/test/token/ERC721/extensions/ERC721Wrapper.test.js +283 -0
- package/test/contracts/lib/openzeppelin-contracts/test/token/ERC721/presets/ERC721PresetMinterPauserAutoId.test.js +122 -0
- package/test/contracts/lib/openzeppelin-contracts/test/token/ERC721/utils/ERC721Holder.test.js +22 -0
- package/test/contracts/lib/openzeppelin-contracts/test/token/ERC777/ERC777.behavior.js +597 -0
- package/test/contracts/lib/openzeppelin-contracts/test/token/ERC777/ERC777.test.js +556 -0
- package/test/contracts/lib/openzeppelin-contracts/test/token/ERC777/presets/ERC777PresetFixedSupply.test.js +49 -0
- package/test/contracts/lib/openzeppelin-contracts/test/token/common/ERC2981.behavior.js +157 -0
- package/test/contracts/lib/openzeppelin-contracts/test/utils/Address.test.js +361 -0
- package/test/contracts/lib/openzeppelin-contracts/test/utils/Arrays.test.js +123 -0
- package/test/contracts/lib/openzeppelin-contracts/test/utils/Base64.test.js +43 -0
- package/test/contracts/lib/openzeppelin-contracts/test/utils/Checkpoints.t.sol +347 -0
- package/test/contracts/lib/openzeppelin-contracts/test/utils/Checkpoints.test.js +255 -0
- package/test/contracts/lib/openzeppelin-contracts/test/utils/Context.behavior.js +42 -0
- package/test/contracts/lib/openzeppelin-contracts/test/utils/Context.test.js +17 -0
- package/test/contracts/lib/openzeppelin-contracts/test/utils/Counters.test.js +84 -0
- package/test/contracts/lib/openzeppelin-contracts/test/utils/Create2.test.js +89 -0
- package/test/contracts/lib/openzeppelin-contracts/test/utils/Multicall.test.js +68 -0
- package/test/contracts/lib/openzeppelin-contracts/test/utils/ShortStrings.t.sol +55 -0
- package/test/contracts/lib/openzeppelin-contracts/test/utils/ShortStrings.test.js +55 -0
- package/test/contracts/lib/openzeppelin-contracts/test/utils/StorageSlot.test.js +210 -0
- package/test/contracts/lib/openzeppelin-contracts/test/utils/Strings.test.js +150 -0
- package/test/contracts/lib/openzeppelin-contracts/test/utils/TimersBlockNumberImpl.test.js +55 -0
- package/test/contracts/lib/openzeppelin-contracts/test/utils/TimersTimestamp.test.js +55 -0
- package/test/contracts/lib/openzeppelin-contracts/test/utils/cryptography/ECDSA.test.js +260 -0
- package/test/contracts/lib/openzeppelin-contracts/test/utils/cryptography/EIP712.test.js +103 -0
- package/test/contracts/lib/openzeppelin-contracts/test/utils/cryptography/MerkleProof.test.js +200 -0
- package/test/contracts/lib/openzeppelin-contracts/test/utils/cryptography/SignatureChecker.test.js +87 -0
- package/test/contracts/lib/openzeppelin-contracts/test/utils/escrow/ConditionalEscrow.test.js +37 -0
- package/test/contracts/lib/openzeppelin-contracts/test/utils/escrow/Escrow.behavior.js +90 -0
- package/test/contracts/lib/openzeppelin-contracts/test/utils/escrow/Escrow.test.js +14 -0
- package/test/contracts/lib/openzeppelin-contracts/test/utils/escrow/RefundEscrow.test.js +143 -0
- package/test/contracts/lib/openzeppelin-contracts/test/utils/introspection/ERC165.test.js +11 -0
- package/test/contracts/lib/openzeppelin-contracts/test/utils/introspection/ERC165Checker.test.js +302 -0
- package/test/contracts/lib/openzeppelin-contracts/test/utils/introspection/ERC165Storage.test.js +23 -0
- package/test/contracts/lib/openzeppelin-contracts/test/utils/introspection/ERC1820Implementer.test.js +71 -0
- package/test/contracts/lib/openzeppelin-contracts/test/utils/introspection/SupportsInterface.behavior.js +146 -0
- package/test/contracts/lib/openzeppelin-contracts/test/utils/math/Math.t.sol +217 -0
- package/test/contracts/lib/openzeppelin-contracts/test/utils/math/Math.test.js +289 -0
- package/test/contracts/lib/openzeppelin-contracts/test/utils/math/SafeCast.test.js +152 -0
- package/test/contracts/lib/openzeppelin-contracts/test/utils/math/SafeMath.test.js +433 -0
- package/test/contracts/lib/openzeppelin-contracts/test/utils/math/SignedMath.test.js +95 -0
- package/test/contracts/lib/openzeppelin-contracts/test/utils/math/SignedSafeMath.test.js +152 -0
- package/test/contracts/lib/openzeppelin-contracts/test/utils/structs/BitMap.test.js +145 -0
- package/test/contracts/lib/openzeppelin-contracts/test/utils/structs/DoubleEndedQueue.test.js +99 -0
- package/test/contracts/lib/openzeppelin-contracts/test/utils/structs/EnumerableMap.behavior.js +185 -0
- package/test/contracts/lib/openzeppelin-contracts/test/utils/structs/EnumerableMap.test.js +154 -0
- package/test/contracts/lib/openzeppelin-contracts/test/utils/structs/EnumerableSet.behavior.js +129 -0
- package/test/contracts/lib/openzeppelin-contracts/test/utils/structs/EnumerableSet.test.js +79 -0
- package/test/contracts/out/AccessControl.sol/AccessControl.json +1 -0
- package/test/contracts/out/AccessControlCrossChain.sol/AccessControlCrossChain.json +1 -0
- package/test/contracts/out/AccessControlCrossChainMock.sol/AccessControlCrossChainMock.json +1 -0
- package/test/contracts/out/AccessControlDefaultAdminRules.sol/AccessControlDefaultAdminRules.json +1 -0
- package/test/contracts/out/AccessControlEnumerable.sol/AccessControlEnumerable.json +1 -0
- package/test/contracts/out/Address.sol/Address.json +1 -0
- package/test/contracts/out/Arrays.sol/Arrays.json +1 -0
- package/test/contracts/out/ArraysMock.sol/AddressArraysMock.json +1 -0
- package/test/contracts/out/ArraysMock.sol/Bytes32ArraysMock.json +1 -0
- package/test/contracts/out/ArraysMock.sol/Uint256ArraysMock.json +1 -0
- package/test/contracts/out/BadBeacon.sol/BadBeaconNoImpl.json +1 -0
- package/test/contracts/out/BadBeacon.sol/BadBeaconNotContract.json +1 -0
- package/test/contracts/out/Base.sol/CommonBase.json +1 -0
- package/test/contracts/out/Base.sol/ScriptBase.json +1 -0
- package/test/contracts/out/Base.sol/TestBase.json +1 -0
- package/test/contracts/out/Base64.sol/Base64.json +1 -0
- package/test/contracts/out/Base64Dirty.sol/Base64Dirty.json +1 -0
- package/test/contracts/out/BeaconProxy.sol/BeaconProxy.json +1 -0
- package/test/contracts/out/BitMaps.sol/BitMaps.json +1 -0
- package/test/contracts/out/CallReceiverMock.sol/CallReceiverMock.json +1 -0
- package/test/contracts/out/Checkpoints.sol/Checkpoints.json +1 -0
- package/test/contracts/out/Checkpoints.t.sol/CheckpointsHistoryTest.json +1 -0
- package/test/contracts/out/Checkpoints.t.sol/CheckpointsTrace160Test.json +1 -0
- package/test/contracts/out/Checkpoints.t.sol/CheckpointsTrace224Test.json +1 -0
- package/test/contracts/out/ClashingImplementation.sol/ClashingImplementation.json +1 -0
- package/test/contracts/out/Clones.sol/Clones.json +1 -0
- package/test/contracts/out/CompTimelock.sol/CompTimelock.json +1 -0
- package/test/contracts/out/CompilationScript.sol/CompilationScript.json +1 -0
- package/test/contracts/out/CompilationScriptBase.sol/CompilationScriptBase.json +1 -0
- package/test/contracts/out/CompilationTest.sol/CompilationTest.json +1 -0
- package/test/contracts/out/CompilationTestBase.sol/CompilationTestBase.json +1 -0
- package/test/contracts/out/ConditionalEscrow.sol/ConditionalEscrow.json +1 -0
- package/test/contracts/out/ConditionalEscrowMock.sol/ConditionalEscrowMock.json +1 -0
- package/test/contracts/out/Context.sol/Context.json +1 -0
- package/test/contracts/out/ContextMock.sol/ContextMock.json +1 -0
- package/test/contracts/out/ContextMock.sol/ContextMockCaller.json +1 -0
- package/test/contracts/out/Counters.sol/Counters.json +1 -0
- package/test/contracts/out/Create2.sol/Create2.json +1 -0
- package/test/contracts/out/CrossChainEnabled.sol/CrossChainEnabled.json +1 -0
- package/test/contracts/out/CrossChainEnabledAMB.sol/CrossChainEnabledAMB.json +1 -0
- package/test/contracts/out/CrossChainEnabledArbitrumL1.sol/CrossChainEnabledArbitrumL1.json +1 -0
- package/test/contracts/out/CrossChainEnabledArbitrumL2.sol/CrossChainEnabledArbitrumL2.json +1 -0
- package/test/contracts/out/CrossChainEnabledOptimism.sol/CrossChainEnabledOptimism.json +1 -0
- package/test/contracts/out/CrossChainEnabledPolygonChild.sol/CrossChainEnabledPolygonChild.json +1 -0
- package/test/contracts/out/DoubleEndedQueue.sol/DoubleEndedQueue.json +1 -0
- package/test/contracts/out/DummyImplementation.sol/DummyImplementation.json +1 -0
- package/test/contracts/out/DummyImplementation.sol/DummyImplementationV2.json +1 -0
- package/test/contracts/out/DummyImplementation.sol/Impl.json +1 -0
- package/test/contracts/out/ECDSA.sol/ECDSA.json +1 -0
- package/test/contracts/out/EIP712.sol/EIP712.json +1 -0
- package/test/contracts/out/EIP712Verifier.sol/EIP712Verifier.json +1 -0
- package/test/contracts/out/ERC1155.sol/ERC1155.json +1 -0
- package/test/contracts/out/ERC1155Burnable.sol/ERC1155Burnable.json +1 -0
- package/test/contracts/out/ERC1155Holder.sol/ERC1155Holder.json +1 -0
- package/test/contracts/out/ERC1155Pausable.sol/ERC1155Pausable.json +1 -0
- package/test/contracts/out/ERC1155PresetMinterPauser.sol/ERC1155PresetMinterPauser.json +1 -0
- package/test/contracts/out/ERC1155Receiver.sol/ERC1155Receiver.json +1 -0
- package/test/contracts/out/ERC1155ReceiverMock.sol/ERC1155ReceiverMock.json +1 -0
- package/test/contracts/out/ERC1155Supply.sol/ERC1155Supply.json +1 -0
- package/test/contracts/out/ERC1155URIStorage.sol/ERC1155URIStorage.json +1 -0
- package/test/contracts/out/ERC1271WalletMock.sol/ERC1271MaliciousMock.json +1 -0
- package/test/contracts/out/ERC1271WalletMock.sol/ERC1271WalletMock.json +1 -0
- package/test/contracts/out/ERC165.sol/ERC165.json +1 -0
- package/test/contracts/out/ERC165Checker.sol/ERC165Checker.json +1 -0
- package/test/contracts/out/ERC165MaliciousData.sol/ERC165MaliciousData.json +1 -0
- package/test/contracts/out/ERC165MissingData.sol/ERC165MissingData.json +1 -0
- package/test/contracts/out/ERC165NotSupported.sol/ERC165NotSupported.json +1 -0
- package/test/contracts/out/ERC165ReturnBomb.sol/ERC165ReturnBombMock.json +1 -0
- package/test/contracts/out/ERC165Storage.sol/ERC165Storage.json +1 -0
- package/test/contracts/out/ERC1820Implementer.sol/ERC1820Implementer.json +1 -0
- package/test/contracts/out/ERC1967Proxy.sol/ERC1967Proxy.json +1 -0
- package/test/contracts/out/ERC1967Upgrade.sol/ERC1967Upgrade.json +1 -0
- package/test/contracts/out/ERC20.sol/ERC20.json +1 -0
- package/test/contracts/out/ERC20Burnable.sol/ERC20Burnable.json +1 -0
- package/test/contracts/out/ERC20Capped.sol/ERC20Capped.json +1 -0
- package/test/contracts/out/ERC20DecimalsMock.sol/ERC20DecimalsMock.json +1 -0
- package/test/contracts/out/ERC20ExcessDecimalsMock.sol/ERC20ExcessDecimalsMock.json +1 -0
- package/test/contracts/out/ERC20FlashMint.sol/ERC20FlashMint.json +1 -0
- package/test/contracts/out/ERC20FlashMintMock.sol/ERC20FlashMintMock.json +1 -0
- package/test/contracts/out/ERC20ForceApproveMock.sol/ERC20ForceApproveMock.json +1 -0
- package/test/contracts/out/ERC20Mock.sol/ERC20Mock.json +1 -0
- package/test/contracts/out/ERC20MulticallMock.sol/ERC20MulticallMock.json +1 -0
- package/test/contracts/out/ERC20NoReturnMock.sol/ERC20NoReturnMock.json +1 -0
- package/test/contracts/out/ERC20Pausable.sol/ERC20Pausable.json +1 -0
- package/test/contracts/out/ERC20Permit.sol/ERC20Permit.json +1 -0
- package/test/contracts/out/ERC20PermitNoRevertMock.sol/ERC20PermitNoRevertMock.json +1 -0
- package/test/contracts/out/ERC20PresetFixedSupply.sol/ERC20PresetFixedSupply.json +1 -0
- package/test/contracts/out/ERC20PresetMinterPauser.sol/ERC20PresetMinterPauser.json +1 -0
- package/test/contracts/out/ERC20Reentrant.sol/ERC20Reentrant.json +1 -0
- package/test/contracts/out/ERC20ReturnFalseMock.sol/ERC20ReturnFalseMock.json +1 -0
- package/test/contracts/out/ERC20Snapshot.sol/ERC20Snapshot.json +1 -0
- package/test/contracts/out/ERC20Votes.sol/ERC20Votes.json +1 -0
- package/test/contracts/out/ERC20VotesComp.sol/ERC20VotesComp.json +1 -0
- package/test/contracts/out/ERC20VotesLegacyMock.sol/ERC20VotesLegacyMock.json +1 -0
- package/test/contracts/out/ERC20Wrapper.sol/ERC20Wrapper.json +1 -0
- package/test/contracts/out/ERC2771Context.sol/ERC2771Context.json +1 -0
- package/test/contracts/out/ERC2771ContextMock.sol/ERC2771ContextMock.json +1 -0
- package/test/contracts/out/ERC2981.sol/ERC2981.json +1 -0
- package/test/contracts/out/ERC3156FlashBorrowerMock.sol/ERC3156FlashBorrowerMock.json +1 -0
- package/test/contracts/out/ERC4626.prop.sol/ERC4626Prop.json +1 -0
- package/test/contracts/out/ERC4626.prop.sol/IERC20.json +1 -0
- package/test/contracts/out/ERC4626.prop.sol/IERC4626.json +1 -0
- package/test/contracts/out/ERC4626.sol/ERC4626.json +1 -0
- package/test/contracts/out/ERC4626.t.sol/ERC4626StdTest.json +1 -0
- package/test/contracts/out/ERC4626.t.sol/ERC4626VaultOffsetMock.json +1 -0
- package/test/contracts/out/ERC4626.test.sol/ERC4626Test.json +1 -0
- package/test/contracts/out/ERC4626.test.sol/IMockERC20.json +1 -0
- package/test/contracts/out/ERC4626Fees.sol/ERC4626Fees.json +1 -0
- package/test/contracts/out/ERC4626Mock.sol/ERC4626Mock.json +1 -0
- package/test/contracts/out/ERC4626OffsetMock.sol/ERC4626OffsetMock.json +1 -0
- package/test/contracts/out/ERC4646FeesMock.sol/ERC4626FeesMock.json +1 -0
- package/test/contracts/out/ERC721.sol/ERC721.json +1 -0
- package/test/contracts/out/ERC721Burnable.sol/ERC721Burnable.json +1 -0
- package/test/contracts/out/ERC721Consecutive.sol/ERC721Consecutive.json +1 -0
- package/test/contracts/out/ERC721Consecutive.t.sol/ERC721ConsecutiveTarget.json +1 -0
- package/test/contracts/out/ERC721Consecutive.t.sol/ERC721ConsecutiveTest.json +1 -0
- package/test/contracts/out/ERC721ConsecutiveEnumerableMock.sol/ERC721ConsecutiveEnumerableMock.json +1 -0
- package/test/contracts/out/ERC721ConsecutiveMock.sol/ERC721ConsecutiveMock.json +1 -0
- package/test/contracts/out/ERC721ConsecutiveMock.sol/ERC721ConsecutiveNoConstructorMintMock.json +1 -0
- package/test/contracts/out/ERC721Enumerable.sol/ERC721Enumerable.json +1 -0
- package/test/contracts/out/ERC721Holder.sol/ERC721Holder.json +1 -0
- package/test/contracts/out/ERC721Pausable.sol/ERC721Pausable.json +1 -0
- package/test/contracts/out/ERC721PresetMinterPauserAutoId.sol/ERC721PresetMinterPauserAutoId.json +1 -0
- package/test/contracts/out/ERC721ReceiverMock.sol/ERC721ReceiverMock.json +1 -0
- package/test/contracts/out/ERC721Royalty.sol/ERC721Royalty.json +1 -0
- package/test/contracts/out/ERC721URIStorage.sol/ERC721URIStorage.json +1 -0
- package/test/contracts/out/ERC721URIStorageMock.sol/ERC721URIStorageMock.json +1 -0
- package/test/contracts/out/ERC721Votes.sol/ERC721Votes.json +1 -0
- package/test/contracts/out/ERC721Wrapper.sol/ERC721Wrapper.json +1 -0
- package/test/contracts/out/ERC777.sol/ERC777.json +1 -0
- package/test/contracts/out/ERC777Mock.sol/ERC777Mock.json +1 -0
- package/test/contracts/out/ERC777PresetFixedSupply.sol/ERC777PresetFixedSupply.json +1 -0
- package/test/contracts/out/ERC777SenderRecipientMock.sol/ERC777SenderRecipientMock.json +1 -0
- package/test/contracts/out/EnumerableMap.sol/EnumerableMap.json +1 -0
- package/test/contracts/out/EnumerableSet.sol/EnumerableSet.json +1 -0
- package/test/contracts/out/Escrow.sol/Escrow.json +1 -0
- package/test/contracts/out/EtherReceiverMock.sol/EtherReceiverMock.json +1 -0
- package/test/contracts/out/Governor.sol/Governor.json +1 -0
- package/test/contracts/out/Governor.t.sol/GovernorInternalTest.json +1 -0
- package/test/contracts/out/GovernorCompMock.sol/GovernorCompMock.json +1 -0
- package/test/contracts/out/GovernorCompatibilityBravo.sol/GovernorCompatibilityBravo.json +1 -0
- package/test/contracts/out/GovernorCompatibilityBravoMock.sol/GovernorCompatibilityBravoMock.json +1 -0
- package/test/contracts/out/GovernorCountingSimple.sol/GovernorCountingSimple.json +1 -0
- package/test/contracts/out/GovernorMock.sol/GovernorMock.json +1 -0
- package/test/contracts/out/GovernorPreventLateQuorum.sol/GovernorPreventLateQuorum.json +1 -0
- package/test/contracts/out/GovernorPreventLateQuorumMock.sol/GovernorPreventLateQuorumMock.json +1 -0
- package/test/contracts/out/GovernorProposalThreshold.sol/GovernorProposalThreshold.json +1 -0
- package/test/contracts/out/GovernorSettings.sol/GovernorSettings.json +1 -0
- package/test/contracts/out/GovernorTimelockCompound.sol/GovernorTimelockCompound.json +1 -0
- package/test/contracts/out/GovernorTimelockCompoundMock.sol/GovernorTimelockCompoundMock.json +1 -0
- package/test/contracts/out/GovernorTimelockControl.sol/GovernorTimelockControl.json +1 -0
- package/test/contracts/out/GovernorTimelockControlMock.sol/GovernorTimelockControlMock.json +1 -0
- package/test/contracts/out/GovernorVoteMock.sol/GovernorVoteMocks.json +1 -0
- package/test/contracts/out/GovernorVotes.sol/GovernorVotes.json +1 -0
- package/test/contracts/out/GovernorVotesComp.sol/GovernorVotesComp.json +1 -0
- package/test/contracts/out/GovernorVotesQuorumFraction.sol/GovernorVotesQuorumFraction.json +1 -0
- package/test/contracts/out/GovernorWithParamsMock.sol/GovernorWithParamsMock.json +1 -0
- package/test/contracts/out/IAMB.sol/IAMB.json +1 -0
- package/test/contracts/out/IAccessControl.sol/IAccessControl.json +1 -0
- package/test/contracts/out/IAccessControlDefaultAdminRules.sol/IAccessControlDefaultAdminRules.json +1 -0
- package/test/contracts/out/IAccessControlEnumerable.sol/IAccessControlEnumerable.json +1 -0
- package/test/contracts/out/IArbSys.sol/IArbSys.json +1 -0
- package/test/contracts/out/IBeacon.sol/IBeacon.json +1 -0
- package/test/contracts/out/IBridge.sol/IBridge.json +1 -0
- package/test/contracts/out/ICompoundTimelock.sol/ICompoundTimelock.json +1 -0
- package/test/contracts/out/ICrossDomainMessenger.sol/ICrossDomainMessenger.json +1 -0
- package/test/contracts/out/IDelayedMessageProvider.sol/IDelayedMessageProvider.json +1 -0
- package/test/contracts/out/IERC1155.sol/IERC1155.json +1 -0
- package/test/contracts/out/IERC1155MetadataURI.sol/IERC1155MetadataURI.json +1 -0
- package/test/contracts/out/IERC1155Receiver.sol/IERC1155Receiver.json +1 -0
- package/test/contracts/out/IERC1271.sol/IERC1271.json +1 -0
- package/test/contracts/out/IERC1363.sol/IERC1363.json +1 -0
- package/test/contracts/out/IERC1363Receiver.sol/IERC1363Receiver.json +1 -0
- package/test/contracts/out/IERC1363Spender.sol/IERC1363Spender.json +1 -0
- package/test/contracts/out/IERC165.sol/IERC165.json +1 -0
- package/test/contracts/out/IERC1820Implementer.sol/IERC1820Implementer.json +1 -0
- package/test/contracts/out/IERC1820Registry.sol/IERC1820Registry.json +1 -0
- package/test/contracts/out/IERC1967.sol/IERC1967.json +1 -0
- package/test/contracts/out/IERC20.sol/IERC20.json +1 -0
- package/test/contracts/out/IERC20Metadata.sol/IERC20Metadata.json +1 -0
- package/test/contracts/out/IERC20Permit.sol/IERC20Permit.json +1 -0
- package/test/contracts/out/IERC2309.sol/IERC2309.json +1 -0
- package/test/contracts/out/IERC2612.sol/IERC2612.json +1 -0
- package/test/contracts/out/IERC2981.sol/IERC2981.json +1 -0
- package/test/contracts/out/IERC3156FlashBorrower.sol/IERC3156FlashBorrower.json +1 -0
- package/test/contracts/out/IERC3156FlashLender.sol/IERC3156FlashLender.json +1 -0
- package/test/contracts/out/IERC4626.sol/IERC4626.json +1 -0
- package/test/contracts/out/IERC4906.sol/IERC4906.json +1 -0
- package/test/contracts/out/IERC5267.sol/IERC5267.json +1 -0
- package/test/contracts/out/IERC5313.sol/IERC5313.json +1 -0
- package/test/contracts/out/IERC5805.sol/IERC5805.json +1 -0
- package/test/contracts/out/IERC6372.sol/IERC6372.json +1 -0
- package/test/contracts/out/IERC721.sol/IERC721.json +1 -0
- package/test/contracts/out/IERC721.sol/IERC721Enumerable.json +1 -0
- package/test/contracts/out/IERC721.sol/IERC721Metadata.json +1 -0
- package/test/contracts/out/IERC721.sol/IERC721TokenReceiver.json +1 -0
- package/test/contracts/out/IERC721Enumerable.sol/IERC721Enumerable.json +1 -0
- package/test/contracts/out/IERC721Metadata.sol/IERC721Metadata.json +1 -0
- package/test/contracts/out/IERC721Receiver.sol/IERC721Receiver.json +1 -0
- package/test/contracts/out/IERC777.sol/IERC777.json +1 -0
- package/test/contracts/out/IERC777Recipient.sol/IERC777Recipient.json +1 -0
- package/test/contracts/out/IERC777Sender.sol/IERC777Sender.json +1 -0
- package/test/contracts/out/IFxMessageProcessor.sol/IFxMessageProcessor.json +1 -0
- package/test/contracts/out/IGovernor.sol/IGovernor.json +1 -0
- package/test/contracts/out/IGovernorCompatibilityBravo.sol/IGovernorCompatibilityBravo.json +1 -0
- package/test/contracts/out/IGovernorTimelock.sol/IGovernorTimelock.json +1 -0
- package/test/contracts/out/IInbox.sol/IInbox.json +1 -0
- package/test/contracts/out/IMulticall3.sol/IMulticall3.json +1 -0
- package/test/contracts/out/IOutbox.sol/IOutbox.json +1 -0
- package/test/contracts/out/IVotes.sol/IVotes.json +1 -0
- package/test/contracts/out/Initializable.sol/Initializable.json +1 -0
- package/test/contracts/out/InitializableMock.sol/ChildConstructorInitializableMock.json +1 -0
- package/test/contracts/out/InitializableMock.sol/ConstructorInitializableMock.json +1 -0
- package/test/contracts/out/InitializableMock.sol/DisableBad1.json +1 -0
- package/test/contracts/out/InitializableMock.sol/DisableBad2.json +1 -0
- package/test/contracts/out/InitializableMock.sol/DisableNew.json +1 -0
- package/test/contracts/out/InitializableMock.sol/DisableOk.json +1 -0
- package/test/contracts/out/InitializableMock.sol/DisableOld.json +1 -0
- package/test/contracts/out/InitializableMock.sol/InitializableMock.json +1 -0
- package/test/contracts/out/InitializableMock.sol/ReinitializerMock.json +1 -0
- package/test/contracts/out/LibAMB.sol/LibAMB.json +1 -0
- package/test/contracts/out/LibArbitrumL1.sol/LibArbitrumL1.json +1 -0
- package/test/contracts/out/LibArbitrumL2.sol/LibArbitrumL2.json +1 -0
- package/test/contracts/out/LibOptimism.sol/LibOptimism.json +1 -0
- package/test/contracts/out/Math.sol/Math.json +1 -0
- package/test/contracts/out/Math.t.sol/MathTest.json +1 -0
- package/test/contracts/out/MerkleProof.sol/MerkleProof.json +1 -0
- package/test/contracts/out/MinimalForwarder.sol/MinimalForwarder.json +1 -0
- package/test/contracts/out/MockMiladyAgentRegistry.sol/MockMiladyAgentRegistry.json +1 -0
- package/test/contracts/out/MockMiladyCollection.sol/MockMiladyCollection.json +1 -0
- package/test/contracts/out/Multicall.sol/Multicall.json +1 -0
- package/test/contracts/out/MulticallTest.sol/MulticallTest.json +1 -0
- package/test/contracts/out/MultipleInheritanceInitializableMocks.sol/SampleChild.json +1 -0
- package/test/contracts/out/MultipleInheritanceInitializableMocks.sol/SampleFather.json +1 -0
- package/test/contracts/out/MultipleInheritanceInitializableMocks.sol/SampleGramps.json +1 -0
- package/test/contracts/out/MultipleInheritanceInitializableMocks.sol/SampleHuman.json +1 -0
- package/test/contracts/out/MultipleInheritanceInitializableMocks.sol/SampleMother.json +1 -0
- package/test/contracts/out/MyGovernor.sol/MyGovernor.json +1 -0
- package/test/contracts/out/MyGovernor1.sol/MyGovernor1.json +1 -0
- package/test/contracts/out/MyGovernor2.sol/MyGovernor2.json +1 -0
- package/test/contracts/out/MyGovernor3.sol/MyGovernor3.json +1 -0
- package/test/contracts/out/MyToken.sol/MyToken.json +1 -0
- package/test/contracts/out/MyTokenTimestampBased.sol/MyTokenTimestampBased.json +1 -0
- package/test/contracts/out/MyTokenWrapped.sol/MyTokenWrapped.json +1 -0
- package/test/contracts/out/Ownable.sol/Ownable.json +1 -0
- package/test/contracts/out/Ownable2Step.sol/Ownable2Step.json +1 -0
- package/test/contracts/out/Pausable.sol/Pausable.json +1 -0
- package/test/contracts/out/PausableMock.sol/PausableMock.json +1 -0
- package/test/contracts/out/PaymentSplitter.sol/PaymentSplitter.json +1 -0
- package/test/contracts/out/Proxy.sol/Proxy.json +1 -0
- package/test/contracts/out/ProxyAdmin.sol/ProxyAdmin.json +1 -0
- package/test/contracts/out/PullPayment.sol/PullPayment.json +1 -0
- package/test/contracts/out/PullPaymentMock.sol/PullPaymentMock.json +1 -0
- package/test/contracts/out/ReentrancyAttack.sol/ReentrancyAttack.json +1 -0
- package/test/contracts/out/ReentrancyGuard.sol/ReentrancyGuard.json +1 -0
- package/test/contracts/out/ReentrancyMock.sol/ReentrancyMock.json +1 -0
- package/test/contracts/out/RefundEscrow.sol/RefundEscrow.json +1 -0
- package/test/contracts/out/RegressionImplementation.sol/Implementation1.json +1 -0
- package/test/contracts/out/RegressionImplementation.sol/Implementation2.json +1 -0
- package/test/contracts/out/RegressionImplementation.sol/Implementation3.json +1 -0
- package/test/contracts/out/RegressionImplementation.sol/Implementation4.json +1 -0
- package/test/contracts/out/SafeCast.sol/SafeCast.json +1 -0
- package/test/contracts/out/SafeERC20.sol/SafeERC20.json +1 -0
- package/test/contracts/out/SafeMath.sol/SafeMath.json +1 -0
- package/test/contracts/out/SafeMathMemoryCheck.sol/SafeMathMemoryCheck.json +1 -0
- package/test/contracts/out/Script.sol/Script.json +1 -0
- package/test/contracts/out/ShortStrings.sol/ShortStrings.json +1 -0
- package/test/contracts/out/ShortStrings.t.sol/ShortStringsTest.json +1 -0
- package/test/contracts/out/SignatureChecker.sol/SignatureChecker.json +1 -0
- package/test/contracts/out/SignedMath.sol/SignedMath.json +1 -0
- package/test/contracts/out/SignedSafeMath.sol/SignedSafeMath.json +1 -0
- package/test/contracts/out/SingleInheritanceInitializableMocks.sol/MigratableMockV1.json +1 -0
- package/test/contracts/out/SingleInheritanceInitializableMocks.sol/MigratableMockV2.json +1 -0
- package/test/contracts/out/SingleInheritanceInitializableMocks.sol/MigratableMockV3.json +1 -0
- package/test/contracts/out/StdAssertions.sol/StdAssertions.json +1 -0
- package/test/contracts/out/StdAssertions.t.sol/StdAssertionsTest.json +1 -0
- package/test/contracts/out/StdAssertions.t.sol/TestMockCall.json +1 -0
- package/test/contracts/out/StdAssertions.t.sol/TestTest.json +1 -0
- package/test/contracts/out/StdChains.sol/StdChains.json +1 -0
- package/test/contracts/out/StdChains.t.sol/StdChainsTest.json +1 -0
- package/test/contracts/out/StdCheats.sol/StdCheats.json +1 -0
- package/test/contracts/out/StdCheats.sol/StdCheatsSafe.json +1 -0
- package/test/contracts/out/StdCheats.t.sol/Bar.json +1 -0
- package/test/contracts/out/StdCheats.t.sol/BarERC1155.json +1 -0
- package/test/contracts/out/StdCheats.t.sol/BarERC721.json +1 -0
- package/test/contracts/out/StdCheats.t.sol/RevertingContract.json +1 -0
- package/test/contracts/out/StdCheats.t.sol/StdCheatsTest.json +1 -0
- package/test/contracts/out/StdError.sol/stdError.json +1 -0
- package/test/contracts/out/StdError.t.sol/ErrorsTest.json +1 -0
- package/test/contracts/out/StdError.t.sol/StdErrorsTest.json +1 -0
- package/test/contracts/out/StdInvariant.sol/StdInvariant.json +1 -0
- package/test/contracts/out/StdJson.sol/stdJson.json +1 -0
- package/test/contracts/out/StdMath.sol/stdMath.json +1 -0
- package/test/contracts/out/StdMath.t.sol/StdMathTest.json +1 -0
- package/test/contracts/out/StdStorage.sol/stdStorage.json +1 -0
- package/test/contracts/out/StdStorage.sol/stdStorageSafe.json +1 -0
- package/test/contracts/out/StdStorage.t.sol/StdStorageTest.json +1 -0
- package/test/contracts/out/StdStorage.t.sol/StorageTest.json +1 -0
- package/test/contracts/out/StdStyle.sol/StdStyle.json +1 -0
- package/test/contracts/out/StdStyle.t.sol/StdStyleTest.json +1 -0
- package/test/contracts/out/StdUtils.sol/StdUtils.json +1 -0
- package/test/contracts/out/StdUtils.t.sol/StdUtilsForkTest.json +1 -0
- package/test/contracts/out/StdUtils.t.sol/StdUtilsMock.json +1 -0
- package/test/contracts/out/StdUtils.t.sol/StdUtilsTest.json +1 -0
- package/test/contracts/out/StorageSlot.sol/StorageSlot.json +1 -0
- package/test/contracts/out/StorageSlotMock.sol/StorageSlotMock.json +1 -0
- package/test/contracts/out/Strings.sol/Strings.json +1 -0
- package/test/contracts/out/TimelockController.sol/TimelockController.json +1 -0
- package/test/contracts/out/TimelockReentrant.sol/TimelockReentrant.json +1 -0
- package/test/contracts/out/Timers.sol/Timers.json +1 -0
- package/test/contracts/out/TimersBlockNumberImpl.sol/TimersBlockNumberImpl.json +1 -0
- package/test/contracts/out/TimersTimestampImpl.sol/TimersTimestampImpl.json +1 -0
- package/test/contracts/out/TokenTimelock.sol/TokenTimelock.json +1 -0
- package/test/contracts/out/TransparentUpgradeableProxy.sol/ITransparentUpgradeableProxy.json +1 -0
- package/test/contracts/out/TransparentUpgradeableProxy.sol/TransparentUpgradeableProxy.json +1 -0
- package/test/contracts/out/UUPSLegacy.sol/UUPSUpgradeableLegacyMock.json +1 -0
- package/test/contracts/out/UUPSUpgradeable.sol/UUPSUpgradeable.json +1 -0
- package/test/contracts/out/UUPSUpgradeableMock.sol/NonUpgradeableMock.json +1 -0
- package/test/contracts/out/UUPSUpgradeableMock.sol/UUPSUpgradeableMock.json +1 -0
- package/test/contracts/out/UUPSUpgradeableMock.sol/UUPSUpgradeableUnsafeMock.json +1 -0
- package/test/contracts/out/UpgradeableBeacon.sol/UpgradeableBeacon.json +1 -0
- package/test/contracts/out/VestingWallet.sol/VestingWallet.json +1 -0
- package/test/contracts/out/Vm.sol/Vm.json +1 -0
- package/test/contracts/out/Vm.sol/VmSafe.json +1 -0
- package/test/contracts/out/Votes.sol/Votes.json +1 -0
- package/test/contracts/out/VotesMock.sol/VotesMock.json +1 -0
- package/test/contracts/out/VotesMock.sol/VotesTimestampMock.json +1 -0
- package/test/contracts/out/VotesTimestamp.sol/ERC20VotesCompTimestampMock.json +1 -0
- package/test/contracts/out/VotesTimestamp.sol/ERC20VotesTimestampMock.json +1 -0
- package/test/contracts/out/VotesTimestamp.sol/ERC721VotesTimestampMock.json +1 -0
- package/test/contracts/out/bridges.sol/BaseRelayMock.json +1 -0
- package/test/contracts/out/bridges.sol/BridgeAMBMock.json +1 -0
- package/test/contracts/out/bridges.sol/BridgeArbitrumL1Inbox.json +1 -0
- package/test/contracts/out/bridges.sol/BridgeArbitrumL1Mock.json +1 -0
- package/test/contracts/out/bridges.sol/BridgeArbitrumL1Outbox.json +1 -0
- package/test/contracts/out/bridges.sol/BridgeArbitrumL2Mock.json +1 -0
- package/test/contracts/out/bridges.sol/BridgeOptimismMock.json +1 -0
- package/test/contracts/out/bridges.sol/BridgePolygonChildMock.json +1 -0
- package/test/contracts/out/build-info/2be03bb8eb1ccda1.json +1 -0
- package/test/contracts/out/console.sol/console.json +1 -0
- package/test/contracts/out/console2.sol/console2.json +1 -0
- package/test/contracts/out/demo.sol/DemoTest.json +1 -0
- package/test/contracts/out/demo.sol/DemoTestWithSetUp.json +1 -0
- package/test/contracts/out/draft-IERC1822.sol/IERC1822Proxiable.json +1 -0
- package/test/contracts/out/interfaces/IERC1155.sol/IERC1155.json +1 -0
- package/test/contracts/out/interfaces/IERC165.sol/IERC165.json +1 -0
- package/test/contracts/out/interfaces/IERC20.sol/IERC20.json +1 -0
- package/test/contracts/out/interfaces/IERC4626.sol/IERC4626.json +1 -0
- package/test/contracts/out/interfaces/IERC721.sol/IERC721.json +1 -0
- package/test/contracts/out/receivers.sol/CrossChainEnabledAMBMock.json +1 -0
- package/test/contracts/out/receivers.sol/CrossChainEnabledArbitrumL1Mock.json +1 -0
- package/test/contracts/out/receivers.sol/CrossChainEnabledArbitrumL2Mock.json +1 -0
- package/test/contracts/out/receivers.sol/CrossChainEnabledOptimismMock.json +1 -0
- package/test/contracts/out/receivers.sol/CrossChainEnabledPolygonChildMock.json +1 -0
- package/test/contracts/out/receivers.sol/Receiver.json +1 -0
- package/test/contracts/out/test.sol/DSTest.json +1 -0
- package/test/contracts/out/test.sol/Test.json +1 -0
- package/test/contracts/out/test.t.sol/DemoTest.json +1 -0
- package/test/database-api.e2e.test.ts +666 -0
- package/test/debug-anvil.ts +44 -0
- package/test/deferred-restart.e2e.test.ts +368 -0
- package/test/discord-connector.e2e.test.ts +463 -0
- package/test/e2e-global-setup.ts +29 -0
- package/test/e2e-validation.e2e.test.ts +1588 -0
- package/test/health-endpoint.e2e.test.ts +95 -0
- package/test/knowledge-e2e-flow.e2e.test.ts +134 -0
- package/test/knowledge-live.e2e.test.ts +405 -0
- package/test/mcp-config.e2e.test.ts +630 -0
- package/test/native-modules.e2e.test.ts +470 -0
- package/test/permissions-api.e2e.test.ts +637 -0
- package/test/plugin-install.e2e.test.ts +645 -0
- package/test/plugin-lifecycle.e2e.test.ts +617 -0
- package/test/plugin-management.e2e.test.ts +308 -0
- package/test/provider-switch.e2e.test.ts +322 -0
- package/test/scripts/test-force.ts +139 -0
- package/test/scripts/test-parallel.mjs +192 -0
- package/test/scripts/validate-all-features.sh +557 -0
- package/test/setup.ts +122 -0
- package/test/signal-connector.e2e.test.ts +229 -0
- package/test/skills-marketplace-api.e2e.test.ts +585 -0
- package/test/skills-marketplace-services.e2e.test.ts +518 -0
- package/test/skills-marketplace.e2e.test.ts +268 -0
- package/test/stubs/coding-agent-module.ts +18 -0
- package/test/stubs/electron-module.ts +17 -0
- package/test/stubs/empty-module.mjs +4 -0
- package/test/stubs/pi-ai-module.ts +12 -0
- package/test/subscription-auth.e2e.test.ts +747 -0
- package/test/terminal-execution.e2e.test.ts +134 -0
- package/test/terminal-run-limits.e2e.test.ts +132 -0
- package/test/test-env.ts +156 -0
- package/test/trajectory-collection.e2e.test.ts +800 -0
- package/test/trajectory-database.e2e.test.ts +209 -0
- package/test/trajectory-embedding-filter.e2e.test.ts +317 -0
- package/test/trajectory-restart-carryover.e2e.test.ts +306 -0
- package/test/trigger-execution-flow.e2e.test.ts +132 -0
- package/test/trigger-runtime.e2e.test.ts +247 -0
- package/test/wallet-api.e2e.test.ts +1295 -0
- package/test/wallet-live.e2e.test.ts +428 -0
- package/vitest.e2e.config.ts +71 -0
package/test/contracts/lib/openzeppelin-contracts/docs/modules/ROOT/pages/extending-contracts.adoc
ADDED
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
= Extending Contracts
|
|
2
|
+
|
|
3
|
+
Most of the OpenZeppelin Contracts are expected to be used via https://solidity.readthedocs.io/en/latest/contracts.html#inheritance[inheritance]: you will _inherit_ from them when writing your own contracts.
|
|
4
|
+
|
|
5
|
+
This is the commonly found `is` syntax, like in `contract MyToken is ERC20`.
|
|
6
|
+
|
|
7
|
+
[NOTE]
|
|
8
|
+
====
|
|
9
|
+
Unlike ``contract``s, Solidity ``library``s are not inherited from and instead rely on the https://solidity.readthedocs.io/en/latest/contracts.html#using-for[`using for`] syntax.
|
|
10
|
+
|
|
11
|
+
OpenZeppelin Contracts has some ``library``s: most are in the xref:api:utils.adoc[Utils] directory.
|
|
12
|
+
====
|
|
13
|
+
|
|
14
|
+
== Overriding
|
|
15
|
+
|
|
16
|
+
Inheritance is often used to add the parent contract's functionality to your own contract, but that's not all it can do. You can also _change_ how some parts of the parent behave using _overrides_.
|
|
17
|
+
|
|
18
|
+
For example, imagine you want to change xref:api:access.adoc#AccessControl[`AccessControl`] so that xref:api:access.adoc#AccessControl-revokeRole-bytes32-address-[`revokeRole`] can no longer be called. This can be achieved using overrides:
|
|
19
|
+
|
|
20
|
+
```solidity
|
|
21
|
+
// contracts/ModifiedAccessControl.sol
|
|
22
|
+
// SPDX-License-Identifier: MIT
|
|
23
|
+
pragma solidity ^0.8.0;
|
|
24
|
+
|
|
25
|
+
import "@openzeppelin/contracts/access/AccessControl.sol";
|
|
26
|
+
|
|
27
|
+
contract ModifiedAccessControl is AccessControl {
|
|
28
|
+
// Override the revokeRole function
|
|
29
|
+
function revokeRole(bytes32, address) public override {
|
|
30
|
+
revert("ModifiedAccessControl: cannot revoke roles");
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
The old `revokeRole` is then replaced by our override, and any calls to it will immediately revert. We cannot _remove_ the function from the contract, but reverting on all calls is good enough.
|
|
36
|
+
|
|
37
|
+
=== Calling `super`
|
|
38
|
+
|
|
39
|
+
Sometimes you want to _extend_ a parent's behavior, instead of outright changing it to something else. This is where `super` comes in.
|
|
40
|
+
|
|
41
|
+
The `super` keyword will let you call functions defined in a parent contract, even if they are overridden. This mechanism can be used to add additional checks to a function, emit events, or otherwise add functionality as you see fit.
|
|
42
|
+
|
|
43
|
+
TIP: For more information on how overrides work, head over to the https://solidity.readthedocs.io/en/latest/contracts.html#index-17[official Solidity documentation].
|
|
44
|
+
|
|
45
|
+
Here is a modified version of xref:api:access.adoc#AccessControl[`AccessControl`] where xref:api:access.adoc#AccessControl-revokeRole-bytes32-address-[`revokeRole`] cannot be used to revoke the `DEFAULT_ADMIN_ROLE`:
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
```solidity
|
|
49
|
+
// contracts/ModifiedAccessControl.sol
|
|
50
|
+
// SPDX-License-Identifier: MIT
|
|
51
|
+
pragma solidity ^0.8.0;
|
|
52
|
+
|
|
53
|
+
import "@openzeppelin/contracts/access/AccessControl.sol";
|
|
54
|
+
|
|
55
|
+
contract ModifiedAccessControl is AccessControl {
|
|
56
|
+
function revokeRole(bytes32 role, address account) public override {
|
|
57
|
+
require(
|
|
58
|
+
role != DEFAULT_ADMIN_ROLE,
|
|
59
|
+
"ModifiedAccessControl: cannot revoke default admin role"
|
|
60
|
+
);
|
|
61
|
+
|
|
62
|
+
super.revokeRole(role, account);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
The `super.revokeRole` statement at the end will invoke ``AccessControl``'s original version of `revokeRole`, the same code that would've run if there were no overrides in place.
|
|
68
|
+
|
|
69
|
+
NOTE: The same rule is implemented and extended in xref:api:access.adoc#AccessControlDefaultAdminRules[`AccessControlDefaultAdminRules`], an extension that also adds enforced security measures for the `DEFAULT_ADMIN_ROLE`.
|
|
70
|
+
|
|
71
|
+
[[using-hooks]]
|
|
72
|
+
== Using Hooks
|
|
73
|
+
|
|
74
|
+
Sometimes, in order to extend a parent contract you will need to override multiple related functions, which leads to code duplication and increased likelihood of bugs.
|
|
75
|
+
|
|
76
|
+
For example, consider implementing safe xref:api:token/ERC20.adoc#ERC20[`ERC20`] transfers in the style of xref:api:token/ERC721.adoc#IERC721Receiver[`IERC721Receiver`]. You may think overriding xref:api:token/ERC20.adoc#ERC20-transfer-address-uint256-[`transfer`] and xref:api:token/ERC20.adoc#ERC20-transferFrom-address-address-uint256-[`transferFrom`] would be enough, but what about xref:api:token/ERC20.adoc#ERC20-_transfer-address-address-uint256-[`_transfer`] and xref:api:token/ERC20.adoc#ERC20-_mint-address-uint256-[`_mint`]? To prevent you from having to deal with these details, we introduced **hooks**.
|
|
77
|
+
|
|
78
|
+
Hooks are simply functions that are called before or after some action takes place. They provide a centralized point to _hook into_ and extend the original behavior.
|
|
79
|
+
|
|
80
|
+
Here's how you would implement the `IERC721Receiver` pattern in `ERC20`, using the xref:api:token/ERC20.adoc#ERC20-_beforeTokenTransfer-address-address-uint256-[`_beforeTokenTransfer`] hook:
|
|
81
|
+
|
|
82
|
+
```solidity
|
|
83
|
+
pragma solidity ^0.8.0;
|
|
84
|
+
|
|
85
|
+
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
|
|
86
|
+
|
|
87
|
+
contract ERC20WithSafeTransfer is ERC20 {
|
|
88
|
+
function _beforeTokenTransfer(address from, address to, uint256 amount)
|
|
89
|
+
internal virtual override
|
|
90
|
+
{
|
|
91
|
+
super._beforeTokenTransfer(from, to, amount);
|
|
92
|
+
|
|
93
|
+
require(_validRecipient(to), "ERC20WithSafeTransfer: invalid recipient");
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
function _validRecipient(address to) private view returns (bool) {
|
|
97
|
+
...
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
...
|
|
101
|
+
}
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
Using hooks this way leads to cleaner and safer code, without having to rely on a deep understanding of the parent's internals.
|
|
105
|
+
|
|
106
|
+
=== Rules of Hooks
|
|
107
|
+
|
|
108
|
+
There's a few guidelines you should follow when writing code that uses hooks in order to prevent issues. They are very simple, but do make sure you follow them:
|
|
109
|
+
|
|
110
|
+
1. Whenever you override a parent's hook, re-apply the `virtual` attribute to the hook. That will allow child contracts to add more functionality to the hook.
|
|
111
|
+
2. **Always** call the parent's hook in your override using `super`. This will make sure all hooks in the inheritance tree are called: contracts like xref:api:token/ERC20.adoc#ERC20Pausable[`ERC20Pausable`] rely on this behavior.
|
|
112
|
+
|
|
113
|
+
```solidity
|
|
114
|
+
contract MyToken is ERC20 {
|
|
115
|
+
function _beforeTokenTransfer(address from, address to, uint256 amount)
|
|
116
|
+
internal virtual override // Add virtual here!
|
|
117
|
+
{
|
|
118
|
+
super._beforeTokenTransfer(from, to, amount); // Call parent hook
|
|
119
|
+
...
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
```
|
|
123
|
+
That's it! Enjoy simpler code using hooks!
|
|
124
|
+
|
|
125
|
+
== Security
|
|
126
|
+
|
|
127
|
+
The maintainers of OpenZeppelin Contracts are mainly concerned with the correctness and security of the code as published in the library, and the combinations of base contracts with the official extensions from the library.
|
|
128
|
+
|
|
129
|
+
Custom overrides, and those of hooks in particular, may break some important assumptions and introduce vulnerabilities in otherwise secure code. While we try to ensure the contracts remain secure in the face of a wide range of potential customizations, this is done in a best-effort manner. While we try to document all important assumptions, this should not be relied upon. Custom overrides should be carefully reviewed and checked against the source code of the contract they are customizing so as to fully understand their impact and guarantee their security.
|
|
130
|
+
|
|
131
|
+
The way functions interact internally should not be assumed to stay stable across releases of the library. For example, a function that is used in one context in a particular release may not be used in the same context in the next release. Contracts that override functions should revalidate their assumptions when updating the version of OpenZeppelin Contracts they are built on.
|
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
= How to set up on-chain governance
|
|
2
|
+
|
|
3
|
+
In this guide we will learn how OpenZeppelin’s Governor contract works, how to set it up, and how to use it to create proposals, vote for them, and execute them, using tools provided by Ethers.js and Tally.
|
|
4
|
+
|
|
5
|
+
NOTE: Find detailed contract documentation at xref:api:governance.adoc[Governance API].
|
|
6
|
+
|
|
7
|
+
== Introduction
|
|
8
|
+
|
|
9
|
+
Decentralized protocols are in constant evolution from the moment they are publicly released. Often, the initial team retains control of this evolution in the first stages, but eventually delegates it to a community of stakeholders. The process by which this community makes decisions is called on-chain governance, and it has become a central component of decentralized protocols, fueling varied decisions such as parameter tweaking, smart contract upgrades, integrations with other protocols, treasury management, grants, etc.
|
|
10
|
+
|
|
11
|
+
This governance protocol is generally implemented in a special-purpose contract called “Governor”. The GovernorAlpha and GovernorBravo contracts designed by Compound have been very successful and popular so far, with the downside that projects with different requirements have had to fork the code to customize it for their needs, which can pose a high risk of introducing security issues. For OpenZeppelin Contracts, we set out to build a modular system of Governor contracts so that forking is not needed, and different requirements can be accommodated by writing small modules using Solidity inheritance. You will find the most common requirements out of the box in OpenZeppelin Contracts, but writing additional ones is simple, and we will be adding new features as requested by the community in future releases. Additionally, the design of OpenZeppelin Governor requires minimal use of storage and results in more gas efficient operation.
|
|
12
|
+
|
|
13
|
+
== Compatibility
|
|
14
|
+
|
|
15
|
+
OpenZeppelin’s Governor system was designed with a concern for compatibility with existing systems that were based on Compound’s GovernorAlpha and GovernorBravo. Because of this, you will find that many modules are presented in two variants, one of which is built for compatibility with those systems.
|
|
16
|
+
|
|
17
|
+
=== ERC20Votes & ERC20VotesComp
|
|
18
|
+
|
|
19
|
+
The ERC20 extension to keep track of votes and vote delegation is one such case. The shorter one is the more generic version because it can support token supplies greater than 2^96, while the “Comp” variant is limited in that regard, but exactly fits the interface of the COMP token that is used by GovernorAlpha and Bravo. Both contract variants share the same events, so they are fully compatible when looking at events only.
|
|
20
|
+
|
|
21
|
+
=== Governor & GovernorCompatibilityBravo
|
|
22
|
+
|
|
23
|
+
An OpenZeppelin Governor contract is by default not interface-compatible with Compound's GovernorAlpha or Bravo. Even though events are fully compatible, proposal lifecycle functions (creation, execution, etc.) have different signatures that are meant to optimize storage use. Other functions from GovernorAlpha are Bravo are likewise not available. It’s possible to opt in to a higher level of compatibility by inheriting from the GovernorCompatibilityBravo module, which covers the proposal lifecycle functions such as `propose` and `execute`.
|
|
24
|
+
|
|
25
|
+
Note that even with the use of this module, there will still be differences in the way that `proposalId`s are calculated. Governor uses the hash of the proposal parameters with the purpose of keeping its data off-chain by event indexing, while the original Bravo implementation uses sequential `proposalId`s. Due to this and other differences, several of the functions from GovernorBravo are not included in the compatibility module.
|
|
26
|
+
|
|
27
|
+
=== GovernorTimelockControl & GovernorTimelockCompound
|
|
28
|
+
|
|
29
|
+
When using a timelock with your Governor contract, you can use either OpenZeppelin’s TimelockController or Compound’s Timelock. Based on the choice of timelock, you should choose the corresponding Governor module: GovernorTimelockControl or GovernorTimelockCompound respectively. This allows you to migrate an existing GovernorAlpha instance to an OpenZeppelin-based Governor without changing the timelock in use.
|
|
30
|
+
|
|
31
|
+
=== Tally
|
|
32
|
+
|
|
33
|
+
https://www.tally.xyz[Tally] is a full-fledged application for user owned on-chain governance. It comprises a voting dashboard, proposal creation wizard, real time research and analysis, and educational content.
|
|
34
|
+
|
|
35
|
+
For all of these options, the Governor will be compatible with Tally: users will be able to create proposals, visualize voting power and advocates, navigate proposals, and cast votes. For proposal creation in particular, projects can also use Defender Admin as an alternative interface.
|
|
36
|
+
|
|
37
|
+
In the rest of this guide, we will focus on a fresh deploy of the vanilla OpenZeppelin Governor features without concern for compatibility with GovernorAlpha or Bravo.
|
|
38
|
+
|
|
39
|
+
== Setup
|
|
40
|
+
|
|
41
|
+
=== Token
|
|
42
|
+
|
|
43
|
+
The voting power of each account in our governance setup will be determined by an ERC20 token. The token has to implement the ERC20Votes extension. This extension will keep track of historical balances so that voting power is retrieved from past snapshots rather than current balance, which is an important protection that prevents double voting.
|
|
44
|
+
|
|
45
|
+
```solidity
|
|
46
|
+
include::api:example$governance/MyToken.sol[]
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
If your project already has a live token that does not include ERC20Votes and is not upgradeable, you can wrap it in a governance token by using ERC20Wrapper. This will allow token holders to participate in governance by wrapping their tokens 1-to-1.
|
|
50
|
+
|
|
51
|
+
```solidity
|
|
52
|
+
include::api:example$governance/MyTokenWrapped.sol[]
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
NOTE: The only other source of voting power available in OpenZeppelin Contracts currently is xref:api:token/ERC721.adoc#ERC721Votes[`ERC721Votes`]. ERC721 tokens that don't provide this functionality can be wrapped into a voting tokens using a combination of xref:api:token/ERC721.adoc#ERC721Votes[`ERC721Votes`] and xref:api:token/ERC721Wrapper.adoc#ERC721Wrapper[`ERC721Wrapper`].
|
|
56
|
+
|
|
57
|
+
NOTE: The internal clock used by the token to store voting balances will dictate the operating mode of the Governor contract attached to it. By default, block numbers are used. Since v4.9, developers can override the xref:api:interfaces.adoc#IERC6372[IERC6372] clock to use timestamps instead of block numbers.
|
|
58
|
+
|
|
59
|
+
=== Governor
|
|
60
|
+
|
|
61
|
+
Initially, we will build a Governor without a timelock. The core logic is given by the Governor contract, but we still need to choose: 1) how voting power is determined, 2) how many votes are needed for quorum, 3) what options people have when casting a vote and how those votes are counted, and 4) what type of token should be used to vote. Each of these aspects is customizable by writing your own module, or more easily choosing one from OpenZeppelin Contracts.
|
|
62
|
+
|
|
63
|
+
For 1) we will use the GovernorVotes module, which hooks to an IVotes instance to determine the voting power of an account based on the token balance they hold when a proposal becomes active. This module requires as a constructor parameter the address of the token. This module also discovers the clock mode (ERC6372) used by the token and applies it to the Governor.
|
|
64
|
+
|
|
65
|
+
For 2) we will use GovernorVotesQuorumFraction which works together with ERC20Votes to define quorum as a percentage of the total supply at the block a proposal’s voting power is retrieved. This requires a constructor parameter to set the percentage. Most Governors nowadays use 4%, so we will initialize the module with parameter 4 (this indicates the percentage, resulting in 4%).
|
|
66
|
+
|
|
67
|
+
For 3) we will use GovernorCountingSimple, a module that offers 3 options to voters: For, Against, and Abstain, and where only For and Abstain votes are counted towards quorum.
|
|
68
|
+
|
|
69
|
+
Besides these modules, Governor itself has some parameters we must set.
|
|
70
|
+
|
|
71
|
+
votingDelay: How long after a proposal is created should voting power be fixed. A large voting delay gives users time to unstake tokens if necessary.
|
|
72
|
+
|
|
73
|
+
votingPeriod: How long does a proposal remain open to votes.
|
|
74
|
+
|
|
75
|
+
These parameters are specified in the unit defined in the token's clock. Assuming the token uses block numbers, and assuming block time of around 12 seconds, we will have set votingDelay = 1 day = 7200 blocks, and votingPeriod = 1 week = 50400 blocks.
|
|
76
|
+
|
|
77
|
+
We can optionally set a proposal threshold as well. This restricts proposal creation to accounts who have enough voting power.
|
|
78
|
+
|
|
79
|
+
```solidity
|
|
80
|
+
include::api:example$governance/MyGovernor.sol[]
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
=== Timelock
|
|
84
|
+
|
|
85
|
+
It is good practice to add a timelock to governance decisions. This allows users to exit the system if they disagree with a decision before it is executed. We will use OpenZeppelin’s TimelockController in combination with the GovernorTimelockControl module.
|
|
86
|
+
|
|
87
|
+
IMPORTANT: When using a timelock, it is the timelock that will execute proposals and thus the timelock that should hold any funds, ownership, and access control roles. Before version 4.5 there was no way to recover funds in the Governor contract when using a timelock! Before version 4.3, when using the Compound Timelock, ETH in the timelock was not easily accessible.
|
|
88
|
+
|
|
89
|
+
TimelockController uses an AccessControl setup that we need to understand in order to set up roles.
|
|
90
|
+
|
|
91
|
+
- The Proposer role is in charge of queueing operations: this is the role the Governor instance should be granted, and it should likely be the only proposer in the system.
|
|
92
|
+
- The Executor role is in charge of executing already available operations: we can assign this role to the special zero address to allow anyone to execute (if operations can be particularly time sensitive, the Governor should be made Executor instead).
|
|
93
|
+
- Lastly, there is the Admin role, which can grant and revoke the two previous roles: this is a very sensitive role that will be granted automatically to the timelock itself, and optionally to a second account, which can be used for ease of setup but should promptly renounce the role.
|
|
94
|
+
|
|
95
|
+
== Proposal Lifecycle
|
|
96
|
+
|
|
97
|
+
Let’s walk through how to create and execute a proposal on our newly deployed Governor.
|
|
98
|
+
|
|
99
|
+
A proposal is a sequence of actions that the Governor contract will perform if it passes. Each action consists of a target address, calldata encoding a function call, and an amount of ETH to include. Additionally, a proposal includes a human-readable description.
|
|
100
|
+
|
|
101
|
+
=== Create a Proposal
|
|
102
|
+
|
|
103
|
+
Let’s say we want to create a proposal to give a team a grant, in the form of ERC20 tokens from the governance treasury. This proposal will consist of a single action where the target is the ERC20 token, calldata is the encoded function call `transfer(<team wallet>, <grant amount>)`, and with 0 ETH attached.
|
|
104
|
+
|
|
105
|
+
Generally a proposal will be created with the help of an interface such as Tally or Defender. Here we will show how to create the proposal using Ethers.js.
|
|
106
|
+
|
|
107
|
+
First we get all the parameters necessary for the proposal action.
|
|
108
|
+
|
|
109
|
+
```javascript
|
|
110
|
+
const tokenAddress = ...;
|
|
111
|
+
const token = await ethers.getContractAt(‘ERC20’, tokenAddress);
|
|
112
|
+
|
|
113
|
+
const teamAddress = ...;
|
|
114
|
+
const grantAmount = ...;
|
|
115
|
+
const transferCalldata = token.interface.encodeFunctionData(‘transfer’, [teamAddress, grantAmount]);
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
Now we are ready to call the propose function of the Governor. Note that we don’t pass in one array of actions, but instead three arrays corresponding to the list of targets, the list of values, and the list of calldatas. In this case it’s a single action, so it’s simple:
|
|
119
|
+
|
|
120
|
+
```javascript
|
|
121
|
+
await governor.propose(
|
|
122
|
+
[tokenAddress],
|
|
123
|
+
[0],
|
|
124
|
+
[transferCalldata],
|
|
125
|
+
“Proposal #1: Give grant to team”,
|
|
126
|
+
);
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
This will create a new proposal, with a proposal id that is obtained by hashing together the proposal data, and which will also be found in an event in the logs of the transaction.
|
|
130
|
+
|
|
131
|
+
=== Cast a Vote
|
|
132
|
+
|
|
133
|
+
Once a proposal is active, delegates can cast their vote. Note that it is delegates who carry voting power: if a token holder wants to participate, they can set a trusted representative as their delegate, or they can become a delegate themselves by self-delegating their voting power.
|
|
134
|
+
|
|
135
|
+
Votes are cast by interacting with the Governor contract through the `castVote` family of functions. Voters would generally invoke this from a governance UI such as Tally.
|
|
136
|
+
|
|
137
|
+
image::tally-vote.png[Voting in Tally]
|
|
138
|
+
|
|
139
|
+
=== Execute the Proposal
|
|
140
|
+
|
|
141
|
+
Once the voting period is over, if quorum was reached (enough voting power participated) and the majority voted in favor, the proposal is considered successful and can proceed to be executed. Once a proposal passes, it can be queued and executed from the same place you voted.
|
|
142
|
+
|
|
143
|
+
image::tally-exec.png[Administration Panel in Tally]
|
|
144
|
+
|
|
145
|
+
We will see now how to do this manually using Ethers.js.
|
|
146
|
+
|
|
147
|
+
If a timelock was set up, the first step to execution is queueing. You will notice that both the queue and execute functions require passing in the entire proposal parameters, as opposed to just the proposal id. This is necessary because this data is not stored on chain, as a measure to save gas. Note that these parameters can always be found in the events emitted by the contract. The only parameter that is not sent in its entirety is the description, since this is only needed in its hashed form to compute the proposal id.
|
|
148
|
+
|
|
149
|
+
To queue, we call the queue function:
|
|
150
|
+
|
|
151
|
+
```javascript
|
|
152
|
+
const descriptionHash = ethers.utils.id(“Proposal #1: Give grant to team”);
|
|
153
|
+
|
|
154
|
+
await governor.queue(
|
|
155
|
+
[tokenAddress],
|
|
156
|
+
[0],
|
|
157
|
+
[transferCalldata],
|
|
158
|
+
descriptionHash,
|
|
159
|
+
);
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
This will cause the Governor to interact with the timelock contract and queue the actions for execution after the required delay.
|
|
163
|
+
|
|
164
|
+
After enough time has passed (according to the timelock parameters), the proposal can be executed. If there was no timelock to begin with, this step can be ran immediately after the proposal succeeds.
|
|
165
|
+
|
|
166
|
+
```javascript
|
|
167
|
+
await governor.execute(
|
|
168
|
+
[tokenAddress],
|
|
169
|
+
[0],
|
|
170
|
+
[transferCalldata],
|
|
171
|
+
descriptionHash,
|
|
172
|
+
);
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
Executing the proposal will transfer the ERC20 tokens to the chosen recipient. To wrap up: we set up a system where a treasury is controlled by the collective decision of the token holders of a project, and all actions are executed via proposals enforced by on-chain votes.
|
|
176
|
+
|
|
177
|
+
== Timestamp based governance
|
|
178
|
+
|
|
179
|
+
=== Motivation
|
|
180
|
+
|
|
181
|
+
It is sometimes difficult to deal with durations expressed in number of blocks because of inconsistent or unpredictable time between blocks. This is particularly true of some L2 networks where blocks are produced based on blockchain usage. Using number of blocks can also lead to the governance rules being affected by network upgrades that modify the expected time between blocks.
|
|
182
|
+
|
|
183
|
+
The difficulty of replacing block numbers with timestamps is that the Governor and the token must both use the same format when querying past votes. If a token is designed around block numbers, it is not possible for a Governor to reliably do timestamp based lookups.
|
|
184
|
+
|
|
185
|
+
Therefore, designing a timestamp based voting system starts with the token.
|
|
186
|
+
|
|
187
|
+
=== Token
|
|
188
|
+
|
|
189
|
+
Since v4.9, all voting contracts (including xref:api:token/ERC20.adoc#ERC20Votes[`ERC20Votes`] and xref:api:token/ERC721.adoc#ERC721Votes[`ERC721Votes`]) rely on xref:api:interfaces.adoc#IERC6372[IERC6372] for clock management. In order to change from operating with block numbers to operating with timestamps, all that is required is to override the `clock()` and `CLOCK_MODE()` functions.
|
|
190
|
+
|
|
191
|
+
```solidity
|
|
192
|
+
include::api:example$governance/MyTokenTimestampBased.sol[]
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
=== Governor
|
|
196
|
+
|
|
197
|
+
The Governor will automatically detect the clock mode used by the token and adapt to it. There is no need to override anything in the Governor contract. However, the clock mode does affect how some values are interpreted. It is therefore necessary to set the `votingDelay()` and `votingPeriod()` accordingly.
|
|
198
|
+
|
|
199
|
+
```solidity
|
|
200
|
+
// SPDX-License-Identifier: MIT
|
|
201
|
+
pragma solidity ^0.8.2;
|
|
202
|
+
|
|
203
|
+
import "@openzeppelin/contracts/governance/Governor.sol";
|
|
204
|
+
import "@openzeppelin/contracts/governance/compatibility/GovernorCompatibilityBravo.sol";
|
|
205
|
+
import "@openzeppelin/contracts/governance/extensions/GovernorVotes.sol";
|
|
206
|
+
import "@openzeppelin/contracts/governance/extensions/GovernorVotesQuorumFraction.sol";
|
|
207
|
+
import "@openzeppelin/contracts/governance/extensions/GovernorTimelockControl.sol";
|
|
208
|
+
|
|
209
|
+
contract MyGovernor is Governor, GovernorCompatibilityBravo, GovernorVotes, GovernorVotesQuorumFraction, GovernorTimelockControl {
|
|
210
|
+
constructor(IVotes _token, TimelockController _timelock)
|
|
211
|
+
Governor("MyGovernor")
|
|
212
|
+
GovernorVotes(_token)
|
|
213
|
+
GovernorVotesQuorumFraction(4)
|
|
214
|
+
GovernorTimelockControl(_timelock)
|
|
215
|
+
{}
|
|
216
|
+
|
|
217
|
+
function votingDelay() public pure virtual override returns (uint256) {
|
|
218
|
+
return 1 days;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
function votingPeriod() public pure virtual override returns (uint256) {
|
|
222
|
+
return 1 weeks;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
function proposalThreshold() public pure virtual override returns (uint256) {
|
|
226
|
+
return 0;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
// ...
|
|
230
|
+
}
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
=== Disclaimer
|
|
234
|
+
|
|
235
|
+
Timestamp based voting is a recent feature that was formalized in EIP-6372 and EIP-5805, and introduced in v4.9. At the time this feature is released, governance tooling such as https://www.tally.xyz[Tally] does not support it yet. While support for timestamps should come soon, users can expect invalid reporting of deadlines & durations. This invalid reporting by offchain tools does not affect the onchain security and functionality of the governance contract.
|
|
236
|
+
|
|
237
|
+
Governors with timestamp support (v4.9 and above) are compatible with old tokens (before v4.9) and will operate in "block number" mode (which is the mode all old tokens operate on). On the other hand, old Governor instances (before v4.9) are not compatible with new tokens operating using timestamps. If you update your token code to use timestamps, make sure to also update your Governor code.
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
= Contracts
|
|
2
|
+
|
|
3
|
+
*A library for secure smart contract development.* Build on a solid foundation of community-vetted code.
|
|
4
|
+
|
|
5
|
+
* Implementations of standards like xref:erc20.adoc[ERC20] and xref:erc721.adoc[ERC721].
|
|
6
|
+
* Flexible xref:access-control.adoc[role-based permissioning] scheme.
|
|
7
|
+
* Reusable xref:utilities.adoc[Solidity components] to build custom contracts and complex decentralized systems.
|
|
8
|
+
|
|
9
|
+
== Overview
|
|
10
|
+
|
|
11
|
+
[[install]]
|
|
12
|
+
=== Installation
|
|
13
|
+
|
|
14
|
+
```console
|
|
15
|
+
$ npm install @openzeppelin/contracts
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
OpenZeppelin Contracts features a xref:releases-stability.adoc#api-stability[stable API], which means your contracts won't break unexpectedly when upgrading to a newer minor version.
|
|
19
|
+
|
|
20
|
+
[[usage]]
|
|
21
|
+
=== Usage
|
|
22
|
+
|
|
23
|
+
Once installed, you can use the contracts in the library by importing them:
|
|
24
|
+
|
|
25
|
+
[source,solidity]
|
|
26
|
+
----
|
|
27
|
+
// contracts/MyNFT.sol
|
|
28
|
+
// SPDX-License-Identifier: MIT
|
|
29
|
+
pragma solidity ^0.8.0;
|
|
30
|
+
|
|
31
|
+
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
|
|
32
|
+
|
|
33
|
+
contract MyNFT is ERC721 {
|
|
34
|
+
constructor() ERC721("MyNFT", "MNFT") {
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
----
|
|
38
|
+
|
|
39
|
+
TIP: If you're new to smart contract development, head to xref:learn::developing-smart-contracts.adoc[Developing Smart Contracts] to learn about creating a new project and compiling your contracts.
|
|
40
|
+
|
|
41
|
+
To keep your system secure, you should **always** use the installed code as-is, and neither copy-paste it from online sources, nor modify it yourself. The library is designed so that only the contracts and functions you use are deployed, so you don't need to worry about it needlessly increasing gas costs.
|
|
42
|
+
|
|
43
|
+
[[security]]
|
|
44
|
+
== Security
|
|
45
|
+
|
|
46
|
+
Please report any security issues you find via our https://www.immunefi.com/bounty/openzeppelin[bug bounty program on Immunefi] or directly to security@openzeppelin.org.
|
|
47
|
+
|
|
48
|
+
The https://contracts.openzeppelin.com/security[Security Center] contains more details about the secure development process.
|
|
49
|
+
|
|
50
|
+
[[next-steps]]
|
|
51
|
+
== Learn More
|
|
52
|
+
|
|
53
|
+
The guides in the sidebar will teach about different concepts, and how to use the related contracts that OpenZeppelin Contracts provides:
|
|
54
|
+
|
|
55
|
+
* xref:access-control.adoc[Access Control]: decide who can perform each of the actions on your system.
|
|
56
|
+
* xref:tokens.adoc[Tokens]: create tradable assets or collectibles, like the well known xref:erc20.adoc[ERC20] and xref:erc721.adoc[ERC721] standards.
|
|
57
|
+
* xref:utilities.adoc[Utilities]: generic useful tools, including non-overflowing math, signature verification, and trustless paying systems.
|
|
58
|
+
|
|
59
|
+
The xref:api:token/ERC20.adoc[full API] is also thoroughly documented, and serves as a great reference when developing your smart contract application. You can also ask for help or follow Contracts' development in the https://forum.openzeppelin.com[community forum].
|
|
60
|
+
|
|
61
|
+
Finally, you may want to take a look at the https://blog.openzeppelin.com/guides/[guides on our blog], which cover several common use cases and good practices. The following articles provide great background reading, though please note, some of the referenced tools have changed as the tooling in the ecosystem continues to rapidly evolve.
|
|
62
|
+
|
|
63
|
+
* https://blog.openzeppelin.com/the-hitchhikers-guide-to-smart-contracts-in-ethereum-848f08001f05[The Hitchhiker’s Guide to Smart Contracts in Ethereum] will help you get an overview of the various tools available for smart contract development, and help you set up your environment.
|
|
64
|
+
* https://blog.openzeppelin.com/a-gentle-introduction-to-ethereum-programming-part-1-783cc7796094[A Gentle Introduction to Ethereum Programming, Part 1] provides very useful information on an introductory level, including many basic concepts from the Ethereum platform.
|
|
65
|
+
* For a more in-depth dive, you may read the guide https://blog.openzeppelin.com/designing-the-architecture-for-your-ethereum-application-9cec086f8317[Designing the architecture for your Ethereum application], which discusses how to better structure your application and its relationship to the real world.
|
package/test/contracts/lib/openzeppelin-contracts/docs/modules/ROOT/pages/releases-stability.adoc
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
= New Releases and API Stability
|
|
2
|
+
|
|
3
|
+
Developing smart contracts is hard, and a conservative approach towards dependencies is sometimes favored. However, it is also very important to stay on top of new releases: these may include bug fixes, or deprecate old patterns in favor of newer and better practices.
|
|
4
|
+
|
|
5
|
+
Here we describe when you should expect new releases to come out, and how this affects you as a user of OpenZeppelin Contracts.
|
|
6
|
+
|
|
7
|
+
[[release-schedule]]
|
|
8
|
+
== Release Schedule
|
|
9
|
+
|
|
10
|
+
OpenZeppelin Contracts follows a <<versioning-scheme, semantic versioning scheme>>.
|
|
11
|
+
|
|
12
|
+
We aim for a new minor release every 1 or 2 months.
|
|
13
|
+
|
|
14
|
+
[[minor-releases]]
|
|
15
|
+
=== Release Candidates
|
|
16
|
+
|
|
17
|
+
Before every release, we publish a feature-frozen release candidate. The purpose of the release candidate is to have a period where the community can review the new code before the actual release. If important problems are discovered, several more release candidates may be required. After a week of no more changes to the release candidate, the new version is published.
|
|
18
|
+
|
|
19
|
+
[[major-releases]]
|
|
20
|
+
=== Major Releases
|
|
21
|
+
|
|
22
|
+
After several months or a year, a new major release may come out. These are not scheduled, but will be based on the need to release breaking changes such as a redesign of a core feature of the library (e.g. https://github.com/OpenZeppelin/openzeppelin-contracts/pulls/2112[access control] in 3.0). Since we value stability, we aim for these to happen infrequently (expect no less than six months between majors). However, we may be forced to release one when there are big changes to the Solidity language.
|
|
23
|
+
|
|
24
|
+
[[api-stability]]
|
|
25
|
+
== API Stability
|
|
26
|
+
|
|
27
|
+
On the https://github.com/OpenZeppelin/openzeppelin-contracts/releases/tag/v2.0.0[OpenZeppelin Contracts 2.0 release], we committed ourselves to keeping a stable API. We aim to more precisely define what we understand by _stable_ and _API_ here, so users of the library can understand these guarantees and be confident their project won't break unexpectedly.
|
|
28
|
+
|
|
29
|
+
In a nutshell, the API being stable means _if your project is working today, it will continue to do so after a minor upgrade_. New contracts and features will be added in minor releases, but only in a backwards compatible way.
|
|
30
|
+
|
|
31
|
+
[[versioning-scheme]]
|
|
32
|
+
=== Versioning Scheme
|
|
33
|
+
|
|
34
|
+
We follow https://semver.org/[SemVer], which means API breakage may occur between major releases (which <<release-schedule, don't happen very often>>).
|
|
35
|
+
|
|
36
|
+
[[solidity-functions]]
|
|
37
|
+
=== Solidity Functions
|
|
38
|
+
|
|
39
|
+
While the internal implementation of functions may change, their semantics and signature will remain the same. The domain of their arguments will not be less restrictive (e.g. if transferring a value of 0 is disallowed, it will remain disallowed), nor will general state restrictions be lifted (e.g. `whenPaused` modifiers).
|
|
40
|
+
|
|
41
|
+
If new functions are added to a contract, it will be in a backwards-compatible way: their usage won't be mandatory, and they won't extend functionality in ways that may foreseeably break an application (e.g. https://github.com/OpenZeppelin/openzeppelin-contracts/issues/1512[an `internal` method may be added to make it easier to retrieve information that was already available]).
|
|
42
|
+
|
|
43
|
+
[[internal]]
|
|
44
|
+
==== `internal`
|
|
45
|
+
|
|
46
|
+
This extends not only to `external` and `public` functions, but also `internal` ones: many contracts are meant to be used by inheriting them (e.g. `Pausable`, `PullPayment`, `AccessControl`), and are therefore used by calling these functions. Similarly, since all OpenZeppelin Contracts state variables are `private`, they can only be accessed this way (e.g. to create new `ERC20` tokens, instead of manually modifying `totalSupply` and `balances`, `_mint` should be called).
|
|
47
|
+
|
|
48
|
+
`private` functions have no guarantees on their behavior, usage, or existence.
|
|
49
|
+
|
|
50
|
+
Finally, sometimes language limitations will force us to e.g. make `internal` a function that should be `private` in order to implement features the way we want to. These cases will be well documented, and the normal stability guarantees won't apply.
|
|
51
|
+
|
|
52
|
+
[[libraries]]
|
|
53
|
+
=== Libraries
|
|
54
|
+
|
|
55
|
+
Some of our Solidity libraries use ``struct``s to handle internal data that should not be accessed directly (e.g. `Counter`). There's an https://github.com/ethereum/solidity/issues/4637[open issue] in the Solidity repository requesting a language feature to prevent said access, but it looks like it won't be implemented any time soon. Because of this, we will use leading underscores and mark said `struct` s to make it clear to the user that its contents and layout are _not_ part of the API.
|
|
56
|
+
|
|
57
|
+
[[events]]
|
|
58
|
+
=== Events
|
|
59
|
+
|
|
60
|
+
No events will be removed, and their arguments won't be changed in any way. New events may be added in later versions, and existing events may be emitted under new, reasonable circumstances (e.g. https://github.com/OpenZeppelin/openzeppelin-contracts/issues/707[from 2.1 on, `ERC20` also emits `Approval` on `transferFrom` calls]).
|
|
61
|
+
|
|
62
|
+
[[drafts]]
|
|
63
|
+
=== Drafts
|
|
64
|
+
|
|
65
|
+
Some contracts implement EIPs that are still in Draft status, recognizable by a file name beginning with `draft-`, such as `utils/cryptography/draft-EIP712.sol`. Due to their nature as drafts, the details of these contracts may change and we cannot guarantee their stability. Minor releases of OpenZeppelin Contracts may contain breaking changes for the contracts labelled as Drafts, which will be duly announced in the https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/CHANGELOG.md[changelog]. The EIPs included are used by projects in production and this may make them less likely to change significantly.
|
|
66
|
+
|
|
67
|
+
[[gas-costs]]
|
|
68
|
+
=== Gas Costs
|
|
69
|
+
|
|
70
|
+
While attempts will generally be made to lower the gas costs of working with OpenZeppelin Contracts, there are no guarantees regarding this. In particular, users should not assume gas costs will not increase when upgrading library versions.
|
|
71
|
+
|
|
72
|
+
[[bugfixes]]
|
|
73
|
+
=== Bug Fixes
|
|
74
|
+
|
|
75
|
+
The API stability guarantees may need to be broken in order to fix a bug, and we will do so. This decision won't be made lightly however, and all options will be explored to make the change as non-disruptive as possible. When sufficient, contracts or functions which may result in unsafe behavior will be deprecated instead of removed (e.g. https://github.com/OpenZeppelin/openzeppelin-contracts/pull/1543[#1543] and https://github.com/OpenZeppelin/openzeppelin-contracts/pull/1550[#1550]).
|
|
76
|
+
|
|
77
|
+
[[solidity-compiler-version]]
|
|
78
|
+
=== Solidity Compiler Version
|
|
79
|
+
|
|
80
|
+
Starting on version 0.5.0, the Solidity team switched to a faster release cycle, with minor releases every few weeks (v0.5.0 was released on November 2018, and v0.5.5 on March 2019), and major, breaking-change releases every couple of months (with v0.6.0 released on December 2019 and v0.7.0 on July 2020). Including the compiler version in OpenZeppelin Contract's stability guarantees would therefore force the library to either stick to old compilers, or release frequent major updates simply to keep up with newer Solidity releases.
|
|
81
|
+
|
|
82
|
+
Because of this, *the minimum required Solidity compiler version is not part of the stability guarantees*, and users may be required to upgrade their compiler when using newer versions of Contracts. Bug fixes will still be backported to past major releases so that all versions currently in use receive these updates.
|
|
83
|
+
|
|
84
|
+
You can read more about the rationale behind this, the other options we considered and why we went down this path https://github.com/OpenZeppelin/openzeppelin-contracts/issues/1498#issuecomment-449191611[here].
|
|
85
|
+
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
= Tokens
|
|
2
|
+
|
|
3
|
+
Ah, the "token": blockchain's most powerful and most misunderstood tool.
|
|
4
|
+
|
|
5
|
+
A token is a _representation of something in the blockchain_. This something can be money, time, services, shares in a company, a virtual pet, anything. By representing things as tokens, we can allow smart contracts to interact with them, exchange them, create or destroy them.
|
|
6
|
+
|
|
7
|
+
[[but_first_coffee_a_primer_on_token_contracts]]
|
|
8
|
+
== But First, [strikethrough]#Coffee# a Primer on Token Contracts
|
|
9
|
+
|
|
10
|
+
Much of the confusion surrounding tokens comes from two concepts getting mixed up: _token contracts_ and the actual _tokens_.
|
|
11
|
+
|
|
12
|
+
A _token contract_ is simply an Ethereum smart contract. "Sending tokens" actually means "calling a method on a smart contract that someone wrote and deployed". At the end of the day, a token contract is not much more than a mapping of addresses to balances, plus some methods to add and subtract from those balances.
|
|
13
|
+
|
|
14
|
+
It is these balances that represent the _tokens_ themselves. Someone "has tokens" when their balance in the token contract is non-zero. That's it! These balances could be considered money, experience points in a game, deeds of ownership, or voting rights, and each of these tokens would be stored in different token contracts.
|
|
15
|
+
|
|
16
|
+
[[different-kinds-of-tokens]]
|
|
17
|
+
== Different Kinds of Tokens
|
|
18
|
+
|
|
19
|
+
Note that there's a big difference between having two voting rights and two deeds of ownership: each vote is equal to all others, but houses usually are not! This is called https://en.wikipedia.org/wiki/Fungibility[fungibility]. _Fungible goods_ are equivalent and interchangeable, like Ether, fiat currencies, and voting rights. _Non-fungible_ goods are unique and distinct, like deeds of ownership, or collectibles.
|
|
20
|
+
|
|
21
|
+
In a nutshell, when dealing with non-fungibles (like your house) you care about _which ones_ you have, while in fungible assets (like your bank account statement) what matters is _how much_ you have.
|
|
22
|
+
|
|
23
|
+
== Standards
|
|
24
|
+
|
|
25
|
+
Even though the concept of a token is simple, they have a variety of complexities in the implementation. Because everything in Ethereum is just a smart contract, and there are no rules about what smart contracts have to do, the community has developed a variety of *standards* (called EIPs or ERCs) for documenting how a contract can interoperate with other contracts.
|
|
26
|
+
|
|
27
|
+
You've probably heard of the ERC20 or ERC721 token standards, and that's why you're here. Head to our specialized guides to learn more about these:
|
|
28
|
+
|
|
29
|
+
* xref:erc20.adoc[ERC20]: the most widespread token standard for fungible assets, albeit somewhat limited by its simplicity.
|
|
30
|
+
* xref:erc721.adoc[ERC721]: the de-facto solution for non-fungible tokens, often used for collectibles and games.
|
|
31
|
+
* xref:erc777.adoc[ERC777]: a richer standard for fungible tokens, enabling new use cases and building on past learnings. Backwards compatible with ERC20.
|
|
32
|
+
* xref:erc1155.adoc[ERC1155]: a novel standard for multi-tokens, allowing for a single contract to represent multiple fungible and non-fungible tokens, along with batched operations for increased gas efficiency.
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
= Using with Upgrades
|
|
2
|
+
|
|
3
|
+
If your contract is going to be deployed with upgradeability, such as using the xref:upgrades-plugins::index.adoc[OpenZeppelin Upgrades Plugins], you will need to use the Upgradeable variant of OpenZeppelin Contracts.
|
|
4
|
+
|
|
5
|
+
This variant is available as a separate package called `@openzeppelin/contracts-upgradeable`, which is hosted in the repository https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable[OpenZeppelin/openzeppelin-contracts-upgradeable].
|
|
6
|
+
|
|
7
|
+
It follows all of the rules for xref:upgrades-plugins::writing-upgradeable.adoc[Writing Upgradeable Contracts]: constructors are replaced by initializer functions, state variables are initialized in initializer functions, and we additionally check for storage incompatibilities across minor versions.
|
|
8
|
+
|
|
9
|
+
TIP: OpenZeppelin provides a full suite of tools for deploying and securing upgradeable smart contracts. xref:openzeppelin::upgrades.adoc[Check out the full list of resources].
|
|
10
|
+
|
|
11
|
+
== Overview
|
|
12
|
+
|
|
13
|
+
=== Installation
|
|
14
|
+
|
|
15
|
+
```console
|
|
16
|
+
$ npm install @openzeppelin/contracts-upgradeable
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
=== Usage
|
|
20
|
+
|
|
21
|
+
The package replicates the structure of the main OpenZeppelin Contracts package, but every file and contract has the suffix `Upgradeable`.
|
|
22
|
+
|
|
23
|
+
```diff
|
|
24
|
+
-import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
|
|
25
|
+
+import "@openzeppelin/contracts-upgradeable/token/ERC721/ERC721Upgradeable.sol";
|
|
26
|
+
|
|
27
|
+
-contract MyCollectible is ERC721 {
|
|
28
|
+
+contract MyCollectible is ERC721Upgradeable {
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Constructors are replaced by internal initializer functions following the naming convention `+__{ContractName}_init+`. Since these are internal, you must always define your own public initializer function and call the parent initializer of the contract you extend.
|
|
32
|
+
|
|
33
|
+
```diff
|
|
34
|
+
- constructor() ERC721("MyCollectible", "MCO") public {
|
|
35
|
+
+ function initialize() initializer public {
|
|
36
|
+
+ __ERC721_init("MyCollectible", "MCO");
|
|
37
|
+
}
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
CAUTION: Use with multiple inheritance requires special attention. See the section below titled <<multiple-inheritance>>.
|
|
41
|
+
|
|
42
|
+
Once this contract is set up and compiled, you can deploy it using the xref:upgrades-plugins::index.adoc[Upgrades Plugins]. The following snippet shows an example deployment script using Hardhat.
|
|
43
|
+
|
|
44
|
+
```js
|
|
45
|
+
// scripts/deploy-my-collectible.js
|
|
46
|
+
const { ethers, upgrades } = require("hardhat");
|
|
47
|
+
|
|
48
|
+
async function main() {
|
|
49
|
+
const MyCollectible = await ethers.getContractFactory("MyCollectible");
|
|
50
|
+
|
|
51
|
+
const mc = await upgrades.deployProxy(MyCollectible);
|
|
52
|
+
|
|
53
|
+
await mc.deployed();
|
|
54
|
+
console.log("MyCollectible deployed to:", mc.address);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
main();
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
== Further Notes
|
|
61
|
+
|
|
62
|
+
[[multiple-inheritance]]
|
|
63
|
+
=== Multiple Inheritance
|
|
64
|
+
|
|
65
|
+
Initializer functions are not linearized by the compiler like constructors. Because of this, each `+__{ContractName}_init+` function embeds the linearized calls to all parent initializers. As a consequence, calling two of these `init` functions can potentially initialize the same contract twice.
|
|
66
|
+
|
|
67
|
+
The function `+__{ContractName}_init_unchained+` found in every contract is the initializer function minus the calls to parent initializers, and can be used to avoid the double initialization problem, but doing this manually is not recommended. We hope to be able to implement safety checks for this in future versions of the Upgrades Plugins.
|
|
68
|
+
|
|
69
|
+
=== Storage Gaps
|
|
70
|
+
|
|
71
|
+
You may notice that every contract includes a state variable named `+__gap+`. This is empty reserved space in storage that is put in place in Upgradeable contracts. It allows us to freely add new state variables in the future without compromising the storage compatibility with existing deployments.
|
|
72
|
+
|
|
73
|
+
It isn't safe to simply add a state variable because it "shifts down" all of the state variables below in the inheritance chain. This makes the storage layouts incompatible, as explained in xref:upgrades-plugins::writing-upgradeable.adoc#modifying-your-contracts[Writing Upgradeable Contracts]. The size of the `+__gap+` array is calculated so that the amount of storage used by a contract always adds up to the same number (in this case 50 storage slots).
|